Showing
4 changed files
with
10 additions
and
4 deletions
| ... | @@ -34,6 +34,7 @@ public enum ResponseCode { | ... | @@ -34,6 +34,7 @@ public enum ResponseCode { |
| 34 | MESSAGE_CODE_30014(30014,"business_exception_30014"), | 34 | MESSAGE_CODE_30014(30014,"business_exception_30014"), |
| 35 | MESSAGE_CODE_30015(30015,"business_success_30015"), | 35 | MESSAGE_CODE_30015(30015,"business_success_30015"), |
| 36 | MESSAGE_CODE_30016(30016,"business_exception_30016"), | 36 | MESSAGE_CODE_30016(30016,"business_exception_30016"), |
| 37 | + MESSAGE_CODE_30017(30017,"business_exception_30017"), | ||
| 37 | 38 | ||
| 38 | /******打个样,编写样例*****/ | 39 | /******打个样,编写样例*****/ |
| 39 | // MESSAGE_CODE_30001(30001,"business_exception_30001"), | 40 | // MESSAGE_CODE_30001(30001,"business_exception_30001"), | ... | ... |
| ... | @@ -58,6 +58,11 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS | ... | @@ -58,6 +58,11 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS |
| 58 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | 58 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo |
| 59 | */ | 59 | */ |
| 60 | public ResponseVo add(AddBo bo, User user){ | 60 | public ResponseVo add(AddBo bo, User user){ |
| 61 | + ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | ||
| 62 | + if (StringUtils.isEmpty(bo.getConsignmentCode()) || !bo.getConsignmentCode().matches("\\d{12}")) { | ||
| 63 | + consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); | ||
| 64 | + return responseUtils.success(ResponseCode.MESSAGE_CODE_30004, consignmentAddDto); | ||
| 65 | + } | ||
| 61 | //查询运单表是否存在已提交的运单 | 66 | //查询运单表是否存在已提交的运单 |
| 62 | LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30); | 67 | LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30); |
| 63 | Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode(),thirtyDaysAgo); | 68 | Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode(),thirtyDaysAgo); |
| ... | @@ -65,7 +70,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS | ... | @@ -65,7 +70,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS |
| 65 | * 不存在则直接返回 | 70 | * 不存在则直接返回 |
| 66 | */ | 71 | */ |
| 67 | if (consignment == null){ | 72 | if (consignment == null){ |
| 68 | - ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | ||
| 69 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO); | 73 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO); |
| 70 | if (!StringUtils.isEmpty(bo.getShipperAccount())){ | 74 | if (!StringUtils.isEmpty(bo.getShipperAccount())){ |
| 71 | if (Objects.equals(user.getAccountNo(),bo.getShipperAccount())){ | 75 | if (Objects.equals(user.getAccountNo(),bo.getShipperAccount())){ |
| ... | @@ -91,7 +95,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS | ... | @@ -91,7 +95,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS |
| 91 | * 非501数据 | 95 | * 非501数据 |
| 92 | */ | 96 | */ |
| 93 | if (StringUtils.isEmpty(bo.getShipperAccount())){ | 97 | if (StringUtils.isEmpty(bo.getShipperAccount())){ |
| 94 | - ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | ||
| 95 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO); | 98 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO); |
| 96 | return responseUtils.success(consignmentAddDto); | 99 | return responseUtils.success(consignmentAddDto); |
| 97 | } | 100 | } | ... | ... |
| ... | @@ -45,4 +45,5 @@ business_exception_30012=UUID不一致 | ... | @@ -45,4 +45,5 @@ business_exception_30012=UUID不一致 |
| 45 | business_exception_30013=文件名为:{0},上传失败,请检查后重试 | 45 | business_exception_30013=文件名为:{0},上传失败,请检查后重试 |
| 46 | business_exception_30014=运单信息加载失败,请稍后重试 | 46 | business_exception_30014=运单信息加载失败,请稍后重试 |
| 47 | business_success_30015=上传成功 | 47 | business_success_30015=上传成功 |
| 48 | -business_exception_30016=运单提交失败 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 48 | +business_exception_30016=运单提交失败 | ||
| 49 | +business_exception_30017=运单号填写错误 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -45,4 +45,5 @@ business_exception_30012=UUID不一致 | ... | @@ -45,4 +45,5 @@ business_exception_30012=UUID不一致 |
| 45 | business_exception_30013=文件名为:{0},上传失败,请检查后重试 | 45 | business_exception_30013=文件名为:{0},上传失败,请检查后重试 |
| 46 | business_exception_30014=运单信息加载失败,请稍后重试 | 46 | business_exception_30014=运单信息加载失败,请稍后重试 |
| 47 | business_success_30015=上传成功 | 47 | business_success_30015=上传成功 |
| 48 | -business_exception_30016=运单提交失败 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 48 | +business_exception_30016=运单提交失败 | ||
| 49 | +business_exception_30017=运单号填写错误 | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment