Showing
1 changed file
with
0 additions
and
63 deletions
| ... | @@ -7,15 +7,12 @@ import com.fedex.connect.common.dependencies.util.ResponseUtils; | ... | @@ -7,15 +7,12 @@ 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.AddBo; |
| 10 | -import com.fedex.connect.customer.data.bo.ConsignmentBo; | ||
| 11 | import com.fedex.connect.customer.data.dto.ConsignmentAddDto; | 10 | import com.fedex.connect.customer.data.dto.ConsignmentAddDto; |
| 12 | import com.fedex.connect.customer.enums.ResponseCode; | 11 | import com.fedex.connect.customer.enums.ResponseCode; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Component; | 13 | import org.springframework.stereotype.Component; |
| 15 | import org.springframework.util.StringUtils; | 14 | import org.springframework.util.StringUtils; |
| 16 | 15 | ||
| 17 | -import java.util.ArrayList; | ||
| 18 | -import java.util.List; | ||
| 19 | import java.util.Objects; | 16 | import java.util.Objects; |
| 20 | 17 | ||
| 21 | /** | 18 | /** |
| ... | @@ -111,64 +108,4 @@ public class ConsignmentUtil { | ... | @@ -111,64 +108,4 @@ public class ConsignmentUtil { |
| 111 | private boolean isShipperAccountMatch(String account1, String account2) { | 108 | private boolean isShipperAccountMatch(String account1, String account2) { |
| 112 | return StringUtils.hasText(account1) && StringUtils.hasText(account2) && account1.equals(account2); | 109 | return StringUtils.hasText(account1) && StringUtils.hasText(account2) && account1.equals(account2); |
| 113 | } | 110 | } |
| 114 | - | ||
| 115 | - | ||
| 116 | - /** | ||
| 117 | - * @Author Szl | ||
| 118 | - * @Description 功能说明 校验运单创建人 | ||
| 119 | - * @Date 2024/11/5 | ||
| 120 | - * @param consignment | ||
| 121 | - * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | ||
| 122 | - */ | ||
| 123 | - public void consignmentCreatorCheck(Consignment consignment, ConsignmentBo bo) { | ||
| 124 | - List<String> errList = new ArrayList<>(); | ||
| 125 | - | ||
| 126 | - // 校验字段是否匹配,并将错误信息添加到errList中 | ||
| 127 | - checkFieldMismatch(bo.getShipperAccount(), consignment.getShipperAccount(), ResponseCode.MESSAGE_CODE_31001.getMsg(), errList); | ||
| 128 | - //checkFieldMismatch(bo.getRecipientCountry(), consignment.getRecipientCountry(), "con_recipientCountry", errList); | ||
| 129 | - //checkFieldMismatch(bo.getShipperCountry(), consignment.getShipperCountry(), "con_shipperCountry", errList); | ||
| 130 | - if (!errList.isEmpty()) { | ||
| 131 | - responseUtils.fail(ResponseCode.MESSAGE_CODE_30003,errList); | ||
| 132 | - } | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | - /** | ||
| 136 | - * @Author Szl | ||
| 137 | - * @Description 功能说明 对比是否一致 | ||
| 138 | - * @Date 2024/11/5 | ||
| 139 | - * @param boField | ||
| 140 | - * @param consignmentField | ||
| 141 | - * @param messageKey | ||
| 142 | - * @param errList | ||
| 143 | - * @return void | ||
| 144 | - */ | ||
| 145 | - private void checkFieldMismatch(String boField, String consignmentField, String messageKey, List<String> errList) { | ||
| 146 | - if (!boField.equals(consignmentField)) { | ||
| 147 | - errList.add(localeMessageUtil.getMessage(messageKey)); | ||
| 148 | - } | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - /** | ||
| 152 | - * @Author Szl | ||
| 153 | - * @Description 功能说明 判断是否为该用户的uuid | ||
| 154 | - * @Date 2024/11/6 | ||
| 155 | - * @param consignment | ||
| 156 | - * @param user | ||
| 157 | - * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | ||
| 158 | - */ | ||
| 159 | - public ResponseVo consignmentUuidCheck(Consignment consignment, User user){ | ||
| 160 | - ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | ||
| 161 | - consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | ||
| 162 | - consignmentAddDto.setConsignment(consignment); | ||
| 163 | - if (!Objects.equals(consignment.getUserUuid(), user.getUserUuid())){ | ||
| 164 | - consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); | ||
| 165 | - if (Objects.equals(consignment.getShipperAccount(),user.getAccountNo())){ | ||
| 166 | - return responseUtils.success(ResponseCode.MESSAGE_CODE_30004,consignmentAddDto); | ||
| 167 | - }else { | ||
| 168 | - return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto); | ||
| 169 | - } | ||
| 170 | - }else { | ||
| 171 | - return responseUtils.success(consignmentAddDto); | ||
| 172 | - } | ||
| 173 | - } | ||
| 174 | } | 111 | } | ... | ... |
-
Please register or login to post a comment