Showing
9 changed files
with
61 additions
and
14 deletions
| ... | @@ -307,8 +307,6 @@ public class ConsignmentUtil { | ... | @@ -307,8 +307,6 @@ public class ConsignmentUtil { |
| 307 | * 保存附件表信息 | 307 | * 保存附件表信息 |
| 308 | */ | 308 | */ |
| 309 | attachmentRepository.saveOrUpdateAll(attachmentList); | 309 | attachmentRepository.saveOrUpdateAll(attachmentList); |
| 310 | - //用户uuid与运单uuid不一致,则需要添加用户运单中间表信息 | ||
| 311 | - if(!user.getUserUuid().equals(consignment.getUserUuid())){ | ||
| 312 | /** | 310 | /** |
| 313 | * 查找用户与运单关联信息 | 311 | * 查找用户与运单关联信息 |
| 314 | */ | 312 | */ |
| ... | @@ -317,13 +315,13 @@ public class ConsignmentUtil { | ... | @@ -317,13 +315,13 @@ public class ConsignmentUtil { |
| 317 | /** | 315 | /** |
| 318 | * 初始化插入预清关文件推送任务日志 | 316 | * 初始化插入预清关文件推送任务日志 |
| 319 | */ | 317 | */ |
| 320 | - userConsignmentMapping = userConsignmentMappingUtil.initUserConsignmentMapping(user.getId(),consignment.getId(),ceFlag); | 318 | + userConsignmentMapping = userConsignmentMappingUtil.initUserConsignmentMapping(user.getId(),consignment); |
| 319 | + } | ||
| 320 | + userConsignmentMapping.setCeFlag(ceFlag); | ||
| 321 | /** | 321 | /** |
| 322 | * 初始化插入预清关文件推送任务日志 | 322 | * 初始化插入预清关文件推送任务日志 |
| 323 | */ | 323 | */ |
| 324 | userConsignmentMappingRepository.saveOrUpdate(userConsignmentMapping); | 324 | userConsignmentMappingRepository.saveOrUpdate(userConsignmentMapping); |
| 325 | - } | ||
| 326 | - } | ||
| 327 | /** | 325 | /** |
| 328 | * 初始化插入预清关文件推送日志,mt添加 | 326 | * 初始化插入预清关文件推送日志,mt添加 |
| 329 | */ | 327 | */ | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.fedex.connect.customer.util.service.biz; | ... | @@ -2,6 +2,7 @@ package com.fedex.connect.customer.util.service.biz; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.enums.base.StatusEnum; | 3 | import com.fedex.connect.common.dependencies.enums.base.StatusEnum; |
| 4 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; | 4 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; |
| 5 | +import com.fedex.connect.common.model.biz.Consignment; | ||
| 5 | import com.fedex.connect.common.model.biz.UserConsignmentMapping; | 6 | import com.fedex.connect.common.model.biz.UserConsignmentMapping; |
| 6 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
| 7 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
| ... | @@ -22,12 +23,12 @@ public class UserConsignmentMappingUtil { | ... | @@ -22,12 +23,12 @@ public class UserConsignmentMappingUtil { |
| 22 | * @param | 23 | * @param |
| 23 | * @return com.fedex.connect.common.model.biz.PushOb | 24 | * @return com.fedex.connect.common.model.biz.PushOb |
| 24 | */ | 25 | */ |
| 25 | - public UserConsignmentMapping initUserConsignmentMapping(Long userId,Long consignmentId,Long ceFlag) throws Exception{ | 26 | + public UserConsignmentMapping initUserConsignmentMapping(Long userId, Consignment consignment) throws Exception{ |
| 26 | UserConsignmentMapping userConsignmentMapping = new UserConsignmentMapping(); | 27 | UserConsignmentMapping userConsignmentMapping = new UserConsignmentMapping(); |
| 27 | userConsignmentMapping.setUserId(userId); | 28 | userConsignmentMapping.setUserId(userId); |
| 28 | - userConsignmentMapping.setConsignmentId(consignmentId); | 29 | + userConsignmentMapping.setConsignmentId(consignment.getId()); |
| 30 | + userConsignmentMapping.setConsignmentCode(consignment.getConsignmentCode()); | ||
| 29 | userConsignmentMapping.setStatus(StatusEnum.YES.getCode()); | 31 | userConsignmentMapping.setStatus(StatusEnum.YES.getCode()); |
| 30 | - userConsignmentMapping.setCeFlag(ceFlag); | ||
| 31 | AssignmentFieldUtils.assignmentTableBaseField(userConsignmentMapping); | 32 | AssignmentFieldUtils.assignmentTableBaseField(userConsignmentMapping); |
| 32 | return userConsignmentMapping; | 33 | return userConsignmentMapping; |
| 33 | } | 34 | } | ... | ... |
| ... | @@ -64,7 +64,7 @@ public class UserConsignmentMapping implements Serializable { | ... | @@ -64,7 +64,7 @@ public class UserConsignmentMapping implements Serializable { |
| 64 | private String consignmentCode; | 64 | private String consignmentCode; |
| 65 | 65 | ||
| 66 | /** | 66 | /** |
| 67 | - * 是否使用CE数据标志 | 67 | + * 是否使用CE数据标志(0“非501数据,1:501数据) |
| 68 | */ | 68 | */ |
| 69 | private Long ceFlag; | 69 | private Long ceFlag; |
| 70 | 70 | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper; | ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper; |
| 7 | import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper; | 7 | import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper; |
| 8 | import com.fedex.connect.kafka.repository.dao.CeInfoMapperExt; | 8 | import com.fedex.connect.kafka.repository.dao.CeInfoMapperExt; |
| 9 | import com.fedex.connect.kafka.repository.dao.KafkaTemporaryStorageMapperExt; | 9 | import com.fedex.connect.kafka.repository.dao.KafkaTemporaryStorageMapperExt; |
| 10 | +import com.fedex.connect.kafka.repository.dao.UserConsignmentMappingMapperExt; | ||
| 10 | import com.fedex.connect.kafka.repository.dao.UserMapperExt; | 11 | import com.fedex.connect.kafka.repository.dao.UserMapperExt; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 13 | ||
| ... | @@ -27,4 +28,6 @@ public class BaseRepository { | ... | @@ -27,4 +28,6 @@ public class BaseRepository { |
| 27 | protected UserMapperExt userMapperExt; | 28 | protected UserMapperExt userMapperExt; |
| 28 | @Autowired | 29 | @Autowired |
| 29 | protected EmailMapper emailMapper; | 30 | protected EmailMapper emailMapper; |
| 31 | + @Autowired | ||
| 32 | + protected UserConsignmentMappingMapperExt userConsignmentMappingMapperExt; | ||
| 30 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | +package com.fedex.connect.kafka.repository.dao; | ||
| 2 | + | ||
| 3 | +import org.apache.ibatis.annotations.Mapper; | ||
| 4 | +import org.apache.ibatis.annotations.Param; | ||
| 5 | +import org.apache.ibatis.annotations.Update; | ||
| 6 | + | ||
| 7 | +@Mapper | ||
| 8 | +public interface UserConsignmentMappingMapperExt { | ||
| 9 | + | ||
| 10 | + @Update( "<script>" + | ||
| 11 | + "UPDATE T_BIZ_USER_CONSIGNMENT_MAPPING SET CE_FLAG = 1 WHERE ID IN( " + | ||
| 12 | + "SELECT CM.ID FROM T_BIZ_USER_CONSIGNMENT_MAPPING CM INNER JOIN T_SYS_USER SU ON(CM.USER_ID = SU.ID) WHERE SU.ACCOUNT_NO = #{shipperAccount} OR SU.USER_UUID = #{uuid})" + | ||
| 13 | + "</script>") | ||
| 14 | + void updateUserChmMappingByAnUuId(@Param("shipperAccount") String shipperAccount,@Param("uuid") String uuid); | ||
| 15 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +package com.fedex.connect.kafka.repository.repo.impl; | ||
| 2 | + | ||
| 3 | +import com.fedex.connect.kafka.repository.base.BaseRepository; | ||
| 4 | +import com.fedex.connect.kafka.repository.repo.IUserConsignmentMappingRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @Author mt | ||
| 9 | + * @Description 用户运单映射 | ||
| 10 | + * @Date 2025/1/2 | ||
| 11 | + */ | ||
| 12 | +@Repository | ||
| 13 | +public class UserConsignmentMappingRepositoryImpl extends BaseRepository implements IUserConsignmentMappingRepository { | ||
| 14 | + /** | ||
| 15 | + * @Author mt | ||
| 16 | + * @Description 根据shipperAccount、uuid更新用户运单映射表ce标志 | ||
| 17 | + * @Date 2025/1/2 | ||
| 18 | + * @param shipperAccount | ||
| 19 | + * @param uuid | ||
| 20 | + * @return void | ||
| 21 | + */ | ||
| 22 | + public void updateUserChmMappingByAnUuId(String shipperAccount, String uuid){ | ||
| 23 | + userConsignmentMappingMapperExt.updateUserChmMappingByAnUuId(shipperAccount,uuid); | ||
| 24 | + } | ||
| 25 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -68,5 +68,4 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service { | ... | @@ -68,5 +68,4 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service { |
| 68 | }); | 68 | }); |
| 69 | return processResults; | 69 | return processResults; |
| 70 | } | 70 | } |
| 71 | - | ||
| 72 | } | 71 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -13,10 +13,7 @@ import com.fedex.connect.common.model.sys.User; | ... | @@ -13,10 +13,7 @@ import com.fedex.connect.common.model.sys.User; |
| 13 | import com.fedex.connect.kafka.constants.Constant; | 13 | import com.fedex.connect.kafka.constants.Constant; |
| 14 | import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501ConAddresses; | 14 | import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501ConAddresses; |
| 15 | import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501Consignments; | 15 | import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501Consignments; |
| 16 | -import com.fedex.connect.kafka.repository.repo.ICeInfoRepository; | 16 | +import com.fedex.connect.kafka.repository.repo.*; |
| 17 | -import com.fedex.connect.kafka.repository.repo.IConsignmentRepository; | ||
| 18 | -import com.fedex.connect.kafka.repository.repo.IEmailRepository; | ||
| 19 | -import com.fedex.connect.kafka.repository.repo.IUserRepository; | ||
| 20 | import org.apache.commons.lang3.StringUtils; | 17 | import org.apache.commons.lang3.StringUtils; |
| 21 | import org.springframework.beans.BeanUtils; | 18 | import org.springframework.beans.BeanUtils; |
| 22 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -42,6 +39,8 @@ public class Dm501Util { | ... | @@ -42,6 +39,8 @@ public class Dm501Util { |
| 42 | IUserRepository userRepository; | 39 | IUserRepository userRepository; |
| 43 | @Autowired | 40 | @Autowired |
| 44 | IEmailRepository emailRepository; | 41 | IEmailRepository emailRepository; |
| 42 | + @Autowired | ||
| 43 | + IUserConsignmentMappingRepository userConsignmentMappingRepository; | ||
| 45 | 44 | ||
| 46 | /** | 45 | /** |
| 47 | * @Author mt | 46 | * @Author mt |
| ... | @@ -334,6 +333,8 @@ public class Dm501Util { | ... | @@ -334,6 +333,8 @@ public class Dm501Util { |
| 334 | //绑定ceInfo表Id | 333 | //绑定ceInfo表Id |
| 335 | consignment.setCeInfoId(ceInfo.getId()); | 334 | consignment.setCeInfoId(ceInfo.getId()); |
| 336 | consignmentRepository.save(consignment); | 335 | consignmentRepository.save(consignment); |
| 336 | + //根据shipperAccount、uuid更新用户运单映射表ce标志 | ||
| 337 | + userConsignmentMappingRepository.updateUserChmMappingByAnUuId(consignment.getShipperAccount(),consignment.getUserUuid()); | ||
| 337 | /** | 338 | /** |
| 338 | * 保存入库 | 339 | * 保存入库 |
| 339 | */ | 340 | */ | ... | ... |
-
Please register or login to post a comment