zelong.shao

customer|add功能bo调整

package com.fedex.connect.customer.controller.biz;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.data.bo.AddBo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
public interface IConsignmentController {
ResponseVo addConsignment(@RequestBody ConsignmentBo bo);
ResponseVo addConsignment(@RequestBody AddBo bo);
ResponseVo submitConsignment(@RequestParam("fileUpload") MultipartFile[] files,
@RequestParam("consignmentJson") String consignmentJson);
}
......
......@@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.controller.base.BaseController;
import com.fedex.connect.customer.controller.biz.IConsignmentController;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -26,7 +27,7 @@ public class ConsignmentController extends BaseController implements IConsignmen
@PostMapping("/add")
@ApiOperation(value = "ResponseVo", notes = "上传运单")
@OperationMethodLog(describe = "business_log_20001")
public ResponseVo addConsignment(@RequestBody ConsignmentBo bo){
public ResponseVo addConsignment(@RequestBody AddBo bo){
consignmentValidate.preCheckAdd(bo);
/**
* 获取当前用户信息
......
package com.fedex.connect.customer.data.bo;
import com.fedex.connect.common.dependencies.annotation.BaseNotBlank;
import lombok.Data;
@Data
public class AddBo {
private String shipperAccount;
@BaseNotBlank(describe = "business_field_31003")
private String consignmentCode;
}
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.service.biz;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import org.springframework.web.multipart.MultipartFile;
......@@ -15,7 +16,7 @@ public interface IConsignmentService {
* @param user
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
ResponseVo add(ConsignmentBo bo, User user);
ResponseVo add(AddBo bo, User user);
/**
* @Author mt
......
......@@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IConsignmentService;
......@@ -37,7 +38,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
* @param user
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo add(ConsignmentBo bo, User user){
public ResponseVo add(AddBo bo, User user){
//查询运单表是否存在已提交的运单
Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode());
/**
......
......@@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.data.dto.ConsignmentAddDto;
import com.fedex.connect.customer.enums.ResponseCode;
......@@ -39,7 +40,7 @@ public class ConsignmentUtil {
* @param user
* @return void
*/
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, ConsignmentBo bo, User user){
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo, User user){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignment(consignment);
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){
......@@ -59,7 +60,7 @@ public class ConsignmentUtil {
* @param user
* @return void
*/
public ResponseVo consignmentCheckWithCe(Consignment consignment, ConsignmentBo bo, User user) {
public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) {
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignment(consignment);
......
......@@ -2,13 +2,11 @@ package com.fedex.connect.customer.validate.controller.biz;
import com.fedex.connect.common.dependencies.util.BaseValidateUtils;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.enums.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.Objects;
/**
* @Author Szl
......@@ -29,12 +27,11 @@ public class ConsignmentValidate {
* @param bo
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public void preCheckAdd(ConsignmentBo bo){
if (bo == null || StringUtils.isEmpty(bo.getConsignmentCode()) ||
StringUtils.isEmpty(bo.getOriginCountryCode()) || StringUtils.isEmpty(bo.getShipperAccount()) ||
StringUtils.isEmpty(bo.getDestinationCountryCode())){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30001);
}
public void preCheckAdd(AddBo bo){
/**
* 非空字段校验
*/
baseValidateUtils.notBlankValidate(bo,ResponseCode.MESSAGE_CODE_30001);
}
/**
......