Showing
7 changed files
with
28 additions
and
16 deletions
| 1 | package com.fedex.connect.customer.controller.biz; | 1 | package com.fedex.connect.customer.controller.biz; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseVo; |
| 4 | -import com.fedex.connect.customer.data.bo.ConsignmentBo; | 4 | +import com.fedex.connect.customer.data.bo.AddBo; |
| 5 | import org.springframework.web.bind.annotation.RequestBody; | 5 | import org.springframework.web.bind.annotation.RequestBody; |
| 6 | import org.springframework.web.bind.annotation.RequestParam; | 6 | import org.springframework.web.bind.annotation.RequestParam; |
| 7 | import org.springframework.web.multipart.MultipartFile; | 7 | import org.springframework.web.multipart.MultipartFile; |
| 8 | 8 | ||
| 9 | public interface IConsignmentController { | 9 | public interface IConsignmentController { |
| 10 | - ResponseVo addConsignment(@RequestBody ConsignmentBo bo); | 10 | + ResponseVo addConsignment(@RequestBody AddBo bo); |
| 11 | ResponseVo submitConsignment(@RequestParam("fileUpload") MultipartFile[] files, | 11 | ResponseVo submitConsignment(@RequestParam("fileUpload") MultipartFile[] files, |
| 12 | @RequestParam("consignmentJson") String consignmentJson); | 12 | @RequestParam("consignmentJson") String consignmentJson); |
| 13 | } | 13 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; |
| 6 | import com.fedex.connect.common.model.sys.User; | 6 | import com.fedex.connect.common.model.sys.User; |
| 7 | import com.fedex.connect.customer.controller.base.BaseController; | 7 | import com.fedex.connect.customer.controller.base.BaseController; |
| 8 | import com.fedex.connect.customer.controller.biz.IConsignmentController; | 8 | import com.fedex.connect.customer.controller.biz.IConsignmentController; |
| 9 | +import com.fedex.connect.customer.data.bo.AddBo; | ||
| 9 | import com.fedex.connect.customer.data.bo.ConsignmentBo; | 10 | import com.fedex.connect.customer.data.bo.ConsignmentBo; |
| 10 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -26,7 +27,7 @@ public class ConsignmentController extends BaseController implements IConsignmen | ... | @@ -26,7 +27,7 @@ public class ConsignmentController extends BaseController implements IConsignmen |
| 26 | @PostMapping("/add") | 27 | @PostMapping("/add") |
| 27 | @ApiOperation(value = "ResponseVo", notes = "上传运单") | 28 | @ApiOperation(value = "ResponseVo", notes = "上传运单") |
| 28 | @OperationMethodLog(describe = "business_log_20001") | 29 | @OperationMethodLog(describe = "business_log_20001") |
| 29 | - public ResponseVo addConsignment(@RequestBody ConsignmentBo bo){ | 30 | + public ResponseVo addConsignment(@RequestBody AddBo bo){ |
| 30 | consignmentValidate.preCheckAdd(bo); | 31 | consignmentValidate.preCheckAdd(bo); |
| 31 | /** | 32 | /** |
| 32 | * 获取当前用户信息 | 33 | * 获取当前用户信息 | ... | ... |
| 1 | +package com.fedex.connect.customer.data.bo; | ||
| 2 | + | ||
| 3 | +import com.fedex.connect.common.dependencies.annotation.BaseNotBlank; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +@Data | ||
| 7 | +public class AddBo { | ||
| 8 | + private String shipperAccount; | ||
| 9 | + @BaseNotBlank(describe = "business_field_31003") | ||
| 10 | + private String consignmentCode; | ||
| 11 | +} |
| ... | @@ -2,6 +2,7 @@ package com.fedex.connect.customer.service.biz; | ... | @@ -2,6 +2,7 @@ package com.fedex.connect.customer.service.biz; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | 3 | import com.fedex.connect.common.dependencies.date.vo.ResponseVo; |
| 4 | import com.fedex.connect.common.model.sys.User; | 4 | import com.fedex.connect.common.model.sys.User; |
| 5 | +import com.fedex.connect.customer.data.bo.AddBo; | ||
| 5 | import com.fedex.connect.customer.data.bo.ConsignmentBo; | 6 | import com.fedex.connect.customer.data.bo.ConsignmentBo; |
| 6 | import org.springframework.web.multipart.MultipartFile; | 7 | import org.springframework.web.multipart.MultipartFile; |
| 7 | 8 | ||
| ... | @@ -15,7 +16,7 @@ public interface IConsignmentService { | ... | @@ -15,7 +16,7 @@ public interface IConsignmentService { |
| 15 | * @param user | 16 | * @param user |
| 16 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | 17 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo |
| 17 | */ | 18 | */ |
| 18 | - ResponseVo add(ConsignmentBo bo, User user); | 19 | + ResponseVo add(AddBo bo, User user); |
| 19 | 20 | ||
| 20 | /** | 21 | /** |
| 21 | * @Author mt | 22 | * @Author mt | ... | ... |
| ... | @@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | ... | @@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; |
| 4 | import com.fedex.connect.common.dependencies.util.ResponseUtils; | 4 | import com.fedex.connect.common.dependencies.util.ResponseUtils; |
| 5 | import com.fedex.connect.common.model.biz.Consignment; | 5 | import com.fedex.connect.common.model.biz.Consignment; |
| 6 | import com.fedex.connect.common.model.sys.User; | 6 | import com.fedex.connect.common.model.sys.User; |
| 7 | +import com.fedex.connect.customer.data.bo.AddBo; | ||
| 7 | import com.fedex.connect.customer.data.bo.ConsignmentBo; | 8 | import com.fedex.connect.customer.data.bo.ConsignmentBo; |
| 8 | import com.fedex.connect.customer.service.base.BaseService; | 9 | import com.fedex.connect.customer.service.base.BaseService; |
| 9 | import com.fedex.connect.customer.service.biz.IConsignmentService; | 10 | import com.fedex.connect.customer.service.biz.IConsignmentService; |
| ... | @@ -37,7 +38,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS | ... | @@ -37,7 +38,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS |
| 37 | * @param user | 38 | * @param user |
| 38 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | 39 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo |
| 39 | */ | 40 | */ |
| 40 | - public ResponseVo add(ConsignmentBo bo, User user){ | 41 | + public ResponseVo add(AddBo bo, User user){ |
| 41 | //查询运单表是否存在已提交的运单 | 42 | //查询运单表是否存在已提交的运单 |
| 42 | Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode()); | 43 | Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode()); |
| 43 | /** | 44 | /** | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; | ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; |
| 6 | import com.fedex.connect.common.dependencies.util.ResponseUtils; | 6 | import com.fedex.connect.common.dependencies.util.ResponseUtils; |
| 7 | import com.fedex.connect.common.model.biz.Consignment; | 7 | import com.fedex.connect.common.model.biz.Consignment; |
| 8 | import com.fedex.connect.common.model.sys.User; | 8 | import com.fedex.connect.common.model.sys.User; |
| 9 | +import com.fedex.connect.customer.data.bo.AddBo; | ||
| 9 | import com.fedex.connect.customer.data.bo.ConsignmentBo; | 10 | import com.fedex.connect.customer.data.bo.ConsignmentBo; |
| 10 | import com.fedex.connect.customer.data.dto.ConsignmentAddDto; | 11 | import com.fedex.connect.customer.data.dto.ConsignmentAddDto; |
| 11 | import com.fedex.connect.customer.enums.ResponseCode; | 12 | import com.fedex.connect.customer.enums.ResponseCode; |
| ... | @@ -39,7 +40,7 @@ public class ConsignmentUtil { | ... | @@ -39,7 +40,7 @@ public class ConsignmentUtil { |
| 39 | * @param user | 40 | * @param user |
| 40 | * @return void | 41 | * @return void |
| 41 | */ | 42 | */ |
| 42 | - public ResponseVo consignmentCheckWithNotCe(Consignment consignment, ConsignmentBo bo, User user){ | 43 | + public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo, User user){ |
| 43 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | 44 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); |
| 44 | consignmentAddDto.setConsignment(consignment); | 45 | consignmentAddDto.setConsignment(consignment); |
| 45 | if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){ | 46 | if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){ |
| ... | @@ -59,7 +60,7 @@ public class ConsignmentUtil { | ... | @@ -59,7 +60,7 @@ public class ConsignmentUtil { |
| 59 | * @param user | 60 | * @param user |
| 60 | * @return void | 61 | * @return void |
| 61 | */ | 62 | */ |
| 62 | - public ResponseVo consignmentCheckWithCe(Consignment consignment, ConsignmentBo bo, User user) { | 63 | + public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) { |
| 63 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | 64 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); |
| 64 | consignmentAddDto.setConsignment(consignment); | 65 | consignmentAddDto.setConsignment(consignment); |
| 65 | 66 | ... | ... |
| ... | @@ -2,13 +2,11 @@ package com.fedex.connect.customer.validate.controller.biz; | ... | @@ -2,13 +2,11 @@ package com.fedex.connect.customer.validate.controller.biz; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.util.BaseValidateUtils; | 3 | import com.fedex.connect.common.dependencies.util.BaseValidateUtils; |
| 4 | import com.fedex.connect.common.dependencies.util.ResponseUtils; | 4 | import com.fedex.connect.common.dependencies.util.ResponseUtils; |
| 5 | +import com.fedex.connect.customer.data.bo.AddBo; | ||
| 5 | import com.fedex.connect.customer.data.bo.ConsignmentBo; | 6 | import com.fedex.connect.customer.data.bo.ConsignmentBo; |
| 6 | import com.fedex.connect.customer.enums.ResponseCode; | 7 | import com.fedex.connect.customer.enums.ResponseCode; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Component; | 9 | import org.springframework.stereotype.Component; |
| 9 | -import org.springframework.util.StringUtils; | ||
| 10 | - | ||
| 11 | -import java.util.Objects; | ||
| 12 | 10 | ||
| 13 | /** | 11 | /** |
| 14 | * @Author Szl | 12 | * @Author Szl |
| ... | @@ -29,12 +27,11 @@ public class ConsignmentValidate { | ... | @@ -29,12 +27,11 @@ public class ConsignmentValidate { |
| 29 | * @param bo | 27 | * @param bo |
| 30 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | 28 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo |
| 31 | */ | 29 | */ |
| 32 | - public void preCheckAdd(ConsignmentBo bo){ | 30 | + public void preCheckAdd(AddBo bo){ |
| 33 | - if (bo == null || StringUtils.isEmpty(bo.getConsignmentCode()) || | 31 | + /** |
| 34 | - StringUtils.isEmpty(bo.getOriginCountryCode()) || StringUtils.isEmpty(bo.getShipperAccount()) || | 32 | + * 非空字段校验 |
| 35 | - StringUtils.isEmpty(bo.getDestinationCountryCode())){ | 33 | + */ |
| 36 | - responseUtils.fail(ResponseCode.MESSAGE_CODE_30001); | 34 | + baseValidateUtils.notBlankValidate(bo,ResponseCode.MESSAGE_CODE_30001); |
| 37 | - } | ||
| 38 | } | 35 | } |
| 39 | 36 | ||
| 40 | /** | 37 | /** | ... | ... |
-
Please register or login to post a comment