zelong.shao

customer|add代码&&查询调整

package com.fedex.connect.customer.data.dto;
import com.fedex.connect.common.model.biz.Consignment;
import lombok.Data;
@Data
......@@ -8,6 +7,6 @@ public class ConsignmentAddDto {
/**
* 是否为该用户的运单 1:是 0:否
*/
Integer isCreatorFlag;
Consignment consignment;
private Integer isCreatorFlag;
private Long consignmentId;
}
......
......@@ -24,4 +24,14 @@ public class FindConsignmentsDto {
private Date modifyTime;
private String statusName;
private String userUuid;
private String userInputShipperAccount;
private String shipperAccount;
private String userInputOriginCountryCode;
private String userInputOriginCountry;
}
......
......@@ -28,7 +28,12 @@
c.CREATE_USER_NAME,
c.CREATE_TIME,
c.MODIFY_TIME,
c.STATUS_NAME
c.STATUS_NAME,
c.USER_UUID,
c.SHIPPER_ACCOUNT,
c.USER_INPUT_SHIPPER_ACCOUNT,
c.USER_INPUT_ORIGIN_COUNTRY_CODE,
c.USER_INPUT_ORIGIN_COUNTRY
</sql>
<select id="findConsignments" resultType="com.fedex.connect.customer.data.dto.FindConsignmentsDto">
......
......@@ -45,6 +45,18 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe
if (SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME.equals(consignment.getCreateUserName())){
consignment.setCreateUserName(user.getUserName());
}
if (!user.getUserUuid().equals(consignment.getUserUuid()) && !user.getAccountNo().equals(consignment.getShipperAccount())){
consignment.setRecipientContactName(null);
consignment.setRecipientCompany(null);
consignment.setDocNondocFlag(null);
consignment.setCreateUserName(null);
consignment.setCreateTime(null);
consignment.setModifyTime(null);
consignment.setStatusName(null);
consignment.setUserUuid(null);
consignment.setShipperAccount(null);
consignment.setOriginCountry(consignment.getUserInputOriginCountry());
}
});
return consignments;
}
......
......@@ -99,12 +99,13 @@ public class ConsignmentUtil {
*/
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignment(consignment);
consignmentAddDto.setConsignmentId(consignment.getId());
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -120,7 +121,7 @@ public class ConsignmentUtil {
*/
public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) {
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignment(consignment);
consignmentAddDto.setConsignmentId(consignment.getId());
/**
* uuid相同,直接返回所有运单信息
......@@ -143,7 +144,7 @@ public class ConsignmentUtil {
*/
if (!StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
consignmentAddDto.setConsignment(null);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30012,consignmentAddDto);
}
......@@ -162,7 +163,7 @@ public class ConsignmentUtil {
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignment(null);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......