zelong.shao

customer|add部分调整

package com.fedex.connect.customer.service.biz.impl;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.biz.*;
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;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IAttachmentService;
......@@ -62,20 +64,22 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
* 不存在则直接返回
*/
if (consignment == null){
if (!StringUtils.isEmpty(bo.getShipperAccount())){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO);
if (!StringUtils.isEmpty(bo.getShipperAccount())){
if (Objects.equals(user.getAccountNo(),bo.getShipperAccount())){
return responseUtils.success();
return responseUtils.success(consignmentAddDto);
}else {
/**
* 不存在运单,并且没有填写shipperAccount,则直接返回
*/
return responseUtils.success();
return responseUtils.success(consignmentAddDto);
}
}else {
/**
* 不存在运单,并且没有填写shipperAccount,则直接返回
*/
return responseUtils.success();
return responseUtils.success(consignmentAddDto);
}
}
/**
......@@ -85,7 +89,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
/**
* 非501数据
*/
return consignmentUtil.consignmentCheckWithNotCe(consignment,bo,user);
return consignmentUtil.consignmentCheckWithNotCe(consignment,bo);
}else {
/**
* 501数据
......
......@@ -95,17 +95,17 @@ public class ConsignmentUtil {
* @Date 2024/11/12
* @param consignment
* @param bo
* @param user
* @return void
*/
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo, User user){
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignment(consignment);
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
return responseUtils.success(consignmentAddDto);
}else {
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011);
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_FOUR);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -143,6 +143,7 @@ public class ConsignmentUtil {
*/
if (!StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
consignmentAddDto.setConsignment(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30012,consignmentAddDto);
}
......@@ -160,7 +161,9 @@ public class ConsignmentUtil {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
return responseUtils.success(consignmentAddDto);
}else {
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011);
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_FOUR);
consignmentAddDto.setConsignment(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......