Showing
13 changed files
with
85 additions
and
9 deletions
server/task-schedule/src/main/java/com/fedex/connect/task/repository/base/AbstractDaoRepository.java
| ... | @@ -2,6 +2,7 @@ package com.fedex.connect.task.repository.base; | ... | @@ -2,6 +2,7 @@ package com.fedex.connect.task.repository.base; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper; | 3 | import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper; |
| 4 | import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper; | 4 | import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper; |
| 5 | +import com.fedex.connect.task.repository.dao.AttachmentExtMapper; | ||
| 5 | import com.fedex.connect.task.repository.dao.EmailExtMapper; | 6 | import com.fedex.connect.task.repository.dao.EmailExtMapper; |
| 6 | import com.fedex.connect.task.repository.dao.KafkaTemporaryStorageMapperExt; | 7 | import com.fedex.connect.task.repository.dao.KafkaTemporaryStorageMapperExt; |
| 7 | import com.fedex.connect.task.repository.dao.RedisSlabMapperExt; | 8 | import com.fedex.connect.task.repository.dao.RedisSlabMapperExt; |
| ... | @@ -18,4 +19,6 @@ public class AbstractDaoRepository { | ... | @@ -18,4 +19,6 @@ public class AbstractDaoRepository { |
| 18 | protected RedisSlabMapperExt redisSlabMapperExt; | 19 | protected RedisSlabMapperExt redisSlabMapperExt; |
| 19 | @Autowired | 20 | @Autowired |
| 20 | protected EmailExtMapper emailExtMapper; | 21 | protected EmailExtMapper emailExtMapper; |
| 22 | + @Autowired | ||
| 23 | + protected AttachmentExtMapper attachmentExtMapper; | ||
| 21 | } | 24 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
server/task-schedule/src/main/java/com/fedex/connect/task/repository/dao/AttachmentExtMapper.java
0 → 100644
| 1 | +package com.fedex.connect.task.repository.dao; | ||
| 2 | + | ||
| 3 | +import com.fedex.connect.task.data.dto.PushZipEmailDto; | ||
| 4 | +import org.apache.ibatis.annotations.Mapper; | ||
| 5 | +import org.apache.ibatis.annotations.Param; | ||
| 6 | +import org.apache.ibatis.annotations.Select; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +@Mapper | ||
| 11 | +public interface AttachmentExtMapper { | ||
| 12 | + | ||
| 13 | + @Select("SELECT c.DEST_IATA_CODE, a.* " + | ||
| 14 | + "FROM T_BIZ_CONSIGNMENT c " + | ||
| 15 | + "JOIN T_BIZ_ATTACHMENT a ON c.ID = a.BIZ_ID " + | ||
| 16 | + "WHERE c.ID = #{conId}") | ||
| 17 | + List<PushZipEmailDto> findAttachmentAndPortByCode(@Param("conId") Long conId); | ||
| 18 | +} |
server/task-schedule/src/main/java/com/fedex/connect/task/repository/mapper/AttachmentExtMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.fedex.connect.task.repository.dao.AttachmentExtMapper"> | ||
| 4 | + | ||
| 5 | +</mapper> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -2,9 +2,14 @@ | ... | @@ -2,9 +2,14 @@ |
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="com.fedex.connect.task.repository.dao.EmailExtMapper"> | 3 | <mapper namespace="com.fedex.connect.task.repository.dao.EmailExtMapper"> |
| 4 | <select id="findConPushEmails" resultType="com.fedex.connect.common.model.biz.Email"> | 4 | <select id="findConPushEmails" resultType="com.fedex.connect.common.model.biz.Email"> |
| 5 | - SELECT * | 5 | + SELECT * |
| 6 | - FROM T_BIZ_EMAIL | 6 | + FROM ( |
| 7 | - WHERE TYPE_ID = #{typeId} | 7 | + SELECT * |
| 8 | - AND STATUS_ID = #{statusId} | 8 | + FROM T_BIZ_EMAIL |
| 9 | + WHERE TYPE_ID = #{typeId} | ||
| 10 | + AND STATUS_ID = #{statusId} | ||
| 11 | + ORDER BY CREATED_DATE DESC | ||
| 12 | + ) | ||
| 13 | + WHERE ROWNUM < 500 | ||
| 9 | </select> | 14 | </select> |
| 10 | </mapper> | 15 | </mapper> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -14,6 +14,6 @@ | ... | @@ -14,6 +14,6 @@ |
| 14 | </sql> | 14 | </sql> |
| 15 | 15 | ||
| 16 | <select id="findValidRedisMsgList" resultMap="BaseResultMap"> | 16 | <select id="findValidRedisMsgList" resultMap="BaseResultMap"> |
| 17 | - SELECT <include refid="Base_Column_List" /> FROM T_REDIS_SLAB WHERE DIS_TIME < #{curDate,jdbcType=TIMESTAMP} | 17 | + SELECT <include refid="Base_Column_List" /> FROM T_SYS_REDIS_SLAB WHERE DIS_TIME < #{curDate,jdbcType=TIMESTAMP} |
| 18 | </select> | 18 | </select> |
| 19 | </mapper> | 19 | </mapper> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | +package com.fedex.connect.task.repository.repo.biz.impl; | ||
| 2 | + | ||
| 3 | +import com.fedex.connect.task.data.dto.PushZipEmailDto; | ||
| 4 | +import com.fedex.connect.task.repository.base.AbstractDaoRepository; | ||
| 5 | +import com.fedex.connect.task.repository.repo.biz.IAttachmentExtRepository; | ||
| 6 | +import org.springframework.stereotype.Repository; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +@Repository | ||
| 11 | +public class AttachmentExtRepositoryImpl extends AbstractDaoRepository implements IAttachmentExtRepository { | ||
| 12 | + | ||
| 13 | + @Override | ||
| 14 | + public List<PushZipEmailDto> findAttachmentAndPortByCode(Long conId) { | ||
| 15 | + return attachmentExtMapper.findAttachmentAndPortByCode(conId); | ||
| 16 | + } | ||
| 17 | +} |
| ... | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; | ... | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; |
| 8 | import java.util.List; | 8 | import java.util.List; |
| 9 | 9 | ||
| 10 | @Repository | 10 | @Repository |
| 11 | -public class EmailRepositoryExtImpl extends AbstractDaoRepository implements IEmailExtRepository { | 11 | +public class EmailExtRepositoryImpl extends AbstractDaoRepository implements IEmailExtRepository { |
| 12 | public List<Email> findConPushEmails(Long typeId,Long statusId){ | 12 | public List<Email> findConPushEmails(Long typeId,Long statusId){ |
| 13 | return emailExtMapper.findConPushEmails(typeId,statusId); | 13 | return emailExtMapper.findConPushEmails(typeId,statusId); |
| 14 | } | 14 | } | ... | ... |
| 1 | package com.fedex.connect.task.repository.repo.sys; | 1 | package com.fedex.connect.task.repository.repo.sys; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.model.sys.RedisSlab; | 3 | import com.fedex.connect.common.model.sys.RedisSlab; |
| 4 | -import org.springframework.stereotype.Repository; | ||
| 5 | 4 | ||
| 6 | import java.util.Date; | 5 | import java.util.Date; |
| 7 | import java.util.List; | 6 | import java.util.List; |
| 8 | 7 | ||
| 9 | -@Repository | 8 | + |
| 10 | public interface IRedisSlabExtRepository { | 9 | public interface IRedisSlabExtRepository { |
| 11 | List<RedisSlab> findValidRedisMsgList(Date curDate); | 10 | List<RedisSlab> findValidRedisMsgList(Date curDate); |
| 12 | } | 11 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.fedex.connect.task.repository.repo.sys.impl; | ... | @@ -3,6 +3,7 @@ package com.fedex.connect.task.repository.repo.sys.impl; |
| 3 | import com.fedex.connect.common.model.sys.RedisSlab; | 3 | import com.fedex.connect.common.model.sys.RedisSlab; |
| 4 | import com.fedex.connect.task.repository.base.AbstractDaoRepository; | 4 | import com.fedex.connect.task.repository.base.AbstractDaoRepository; |
| 5 | import com.fedex.connect.task.repository.repo.sys.IRedisSlabExtRepository; | 5 | import com.fedex.connect.task.repository.repo.sys.IRedisSlabExtRepository; |
| 6 | +import org.springframework.stereotype.Repository; | ||
| 6 | 7 | ||
| 7 | import java.util.Date; | 8 | import java.util.Date; |
| 8 | import java.util.List; | 9 | import java.util.List; |
| ... | @@ -12,6 +13,7 @@ import java.util.List; | ... | @@ -12,6 +13,7 @@ import java.util.List; |
| 12 | * @Description redis平替操作类 | 13 | * @Description redis平替操作类 |
| 13 | * @Date 2024/11/6 | 14 | * @Date 2024/11/6 |
| 14 | */ | 15 | */ |
| 16 | +@Repository | ||
| 15 | public class RedisSlabExtRepositoryImpl extends AbstractDaoRepository implements IRedisSlabExtRepository { | 17 | public class RedisSlabExtRepositoryImpl extends AbstractDaoRepository implements IRedisSlabExtRepository { |
| 16 | 18 | ||
| 17 | /** | 19 | /** | ... | ... |
| 1 | package com.fedex.connect.task.service.base; | 1 | package com.fedex.connect.task.service.base; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabRepository; | 3 | import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabRepository; |
| 4 | +import com.fedex.connect.task.repository.repo.biz.IAttachmentExtRepository; | ||
| 4 | import com.fedex.connect.task.repository.repo.biz.IEmailExtRepository; | 5 | import com.fedex.connect.task.repository.repo.biz.IEmailExtRepository; |
| 5 | import com.fedex.connect.task.repository.repo.sys.IKafkaStorageHistoryRepository; | 6 | import com.fedex.connect.task.repository.repo.sys.IKafkaStorageHistoryRepository; |
| 6 | import com.fedex.connect.task.repository.repo.sys.IKafkaTemporaryStorageRepository; | 7 | import com.fedex.connect.task.repository.repo.sys.IKafkaTemporaryStorageRepository; |
| ... | @@ -23,4 +24,6 @@ public class BaseService { | ... | @@ -23,4 +24,6 @@ public class BaseService { |
| 23 | protected IRedisSlabExtRepository redisRepository; | 24 | protected IRedisSlabExtRepository redisRepository; |
| 24 | @Autowired | 25 | @Autowired |
| 25 | protected IEmailExtRepository iEmailExtRepository; | 26 | protected IEmailExtRepository iEmailExtRepository; |
| 27 | + @Autowired | ||
| 28 | + protected IAttachmentExtRepository attachmentExtRepository; | ||
| 26 | } | 29 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.cache.CacheSystem; | ... | @@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.cache.CacheSystem; |
| 4 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; | 4 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; |
| 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; | 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; |
| 6 | import com.fedex.connect.common.model.biz.Email; | 6 | import com.fedex.connect.common.model.biz.Email; |
| 7 | +import com.fedex.connect.task.data.dto.PushZipEmailDto; | ||
| 7 | import com.fedex.connect.task.service.base.BaseService; | 8 | import com.fedex.connect.task.service.base.BaseService; |
| 8 | import com.fedex.connect.task.service.biz.IPushConsignmentFileService; | 9 | import com.fedex.connect.task.service.biz.IPushConsignmentFileService; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -36,7 +37,10 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush | ... | @@ -36,7 +37,10 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush |
| 36 | //打zip包 | 37 | //打zip包 |
| 37 | if (!CollectionUtils.isEmpty(conPushEmails)){ | 38 | if (!CollectionUtils.isEmpty(conPushEmails)){ |
| 38 | for (Email conPushEmail : conPushEmails) { | 39 | for (Email conPushEmail : conPushEmails) { |
| 39 | - | 40 | + /** |
| 41 | + * 获取每个运单的附件 | ||
| 42 | + */ | ||
| 43 | + List<PushZipEmailDto> attachmentAndPortByCode = attachmentExtRepository.findAttachmentAndPortByCode(conPushEmail.getBizId()); | ||
| 40 | } | 44 | } |
| 41 | } | 45 | } |
| 42 | //发送邮件 | 46 | //发送邮件 | ... | ... |
-
Please register or login to post a comment