Showing
9 changed files
with
33 additions
and
8 deletions
| ... | @@ -21,6 +21,9 @@ public interface ParamConfigConstants { | ... | @@ -21,6 +21,9 @@ public interface ParamConfigConstants { |
| 21 | * @Date 2024/11/20 | 21 | * @Date 2024/11/20 |
| 22 | */ | 22 | */ |
| 23 | interface TASK_PARAM_KEYS{ | 23 | interface TASK_PARAM_KEYS{ |
| 24 | - | 24 | + //推送进口文件定时任务处理数量 |
| 25 | + String PUSH_CON_NUMBER = "push_con_number"; | ||
| 26 | + // | ||
| 27 | + String NOTIFICATION_SENDER_NUMBER = "notification_sender_number"; | ||
| 25 | } | 28 | } |
| 26 | } | 29 | } | ... | ... |
server/task-schedule/src/main/java/com/fedex/connect/task/repository/base/AbstractDaoRepository.java
| ... | @@ -31,4 +31,6 @@ public class AbstractDaoRepository { | ... | @@ -31,4 +31,6 @@ public class AbstractDaoRepository { |
| 31 | protected PortclearEmailMappingExtMapper portclearEmailMappingExtMapper; | 31 | protected PortclearEmailMappingExtMapper portclearEmailMappingExtMapper; |
| 32 | @Autowired | 32 | @Autowired |
| 33 | protected PushObMapperExt pushObMapperExt; | 33 | protected PushObMapperExt pushObMapperExt; |
| 34 | + @Autowired | ||
| 35 | + protected ParamConfigExtMapper paramConfigExtMapper; | ||
| 34 | } | 36 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -9,7 +9,7 @@ import java.util.List; | ... | @@ -9,7 +9,7 @@ import java.util.List; |
| 9 | 9 | ||
| 10 | @Mapper | 10 | @Mapper |
| 11 | public interface EmailExtMapper { | 11 | public interface EmailExtMapper { |
| 12 | - List<Email> findEmailsByDic(String typeCode,String statusCode); | 12 | + List<Email> findEmailsByDic(String typeCode,String statusCode,String rowLimit); |
| 13 | 13 | ||
| 14 | @Delete("DELETE FROM T_BIZ_EMAIL WHERE ID = #{id}") | 14 | @Delete("DELETE FROM T_BIZ_EMAIL WHERE ID = #{id}") |
| 15 | void deleteById(@Param("id") Long id); | 15 | void deleteById(@Param("id") Long id); | ... | ... |
server/task-schedule/src/main/java/com/fedex/connect/task/repository/dao/ParamConfigExtMapper.java
0 → 100644
| 1 | +package com.fedex.connect.task.repository.dao; | ||
| 2 | + | ||
| 3 | +import com.fedex.connect.common.model.sys.ParamConfig; | ||
| 4 | +import org.apache.ibatis.annotations.Mapper; | ||
| 5 | +import org.apache.ibatis.annotations.Param; | ||
| 6 | +import org.apache.ibatis.annotations.Select; | ||
| 7 | + | ||
| 8 | +@Mapper | ||
| 9 | +public interface ParamConfigExtMapper { | ||
| 10 | + | ||
| 11 | + @Select("SELECT * FROM T_SYS_PARAM_CONFIG WHERE CODE = #{code}") | ||
| 12 | + ParamConfig findByCode(@Param("code") String code); | ||
| 13 | +} |
| ... | @@ -10,6 +10,6 @@ | ... | @@ -10,6 +10,6 @@ |
| 10 | AND STATUS_CODE = #{statusCode} | 10 | AND STATUS_CODE = #{statusCode} |
| 11 | ORDER BY CREATED_DATE DESC | 11 | ORDER BY CREATED_DATE DESC |
| 12 | ) | 12 | ) |
| 13 | - WHERE ROWNUM < 500 | 13 | + WHERE ROWNUM < #{rowLimit} |
| 14 | </select> | 14 | </select> |
| 15 | </mapper> | 15 | </mapper> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -5,7 +5,7 @@ import com.fedex.connect.common.model.biz.Email; | ... | @@ -5,7 +5,7 @@ import com.fedex.connect.common.model.biz.Email; |
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | 6 | ||
| 7 | public interface IEmailRepository { | 7 | public interface IEmailRepository { |
| 8 | - List<Email> findEmailsByDic(String typeCode,String statusCode); | 8 | + List<Email> findEmailsByDic(String typeCode,String statusCode,String configCode); |
| 9 | 9 | ||
| 10 | void deleteById(Long id); | 10 | void deleteById(Long id); |
| 11 | 11 | ... | ... |
| 1 | package com.fedex.connect.task.repository.repo.biz.impl; | 1 | package com.fedex.connect.task.repository.repo.biz.impl; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.model.biz.Email; | 3 | import com.fedex.connect.common.model.biz.Email; |
| 4 | +import com.fedex.connect.common.model.sys.ParamConfig; | ||
| 4 | import com.fedex.connect.task.repository.base.AbstractDaoRepository; | 5 | import com.fedex.connect.task.repository.base.AbstractDaoRepository; |
| 5 | import com.fedex.connect.task.repository.repo.biz.IEmailRepository; | 6 | import com.fedex.connect.task.repository.repo.biz.IEmailRepository; |
| 6 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
| ... | @@ -9,8 +10,12 @@ import java.util.List; | ... | @@ -9,8 +10,12 @@ import java.util.List; |
| 9 | 10 | ||
| 10 | @Repository | 11 | @Repository |
| 11 | public class EmailRepositoryImpl extends AbstractDaoRepository implements IEmailRepository { | 12 | public class EmailRepositoryImpl extends AbstractDaoRepository implements IEmailRepository { |
| 12 | - public List<Email> findEmailsByDic(String typeCode,String statusCode){ | 13 | + public List<Email> findEmailsByDic(String typeCode,String statusCode,String configCode){ |
| 13 | - return emailExtMapper.findEmailsByDic(typeCode,statusCode); | 14 | + /** |
| 15 | + * 获取查询数量 | ||
| 16 | + */ | ||
| 17 | + ParamConfig paramConfig = paramConfigExtMapper.findByCode(configCode); | ||
| 18 | + return emailExtMapper.findEmailsByDic(typeCode,statusCode,paramConfig.getValue()); | ||
| 14 | } | 19 | } |
| 15 | 20 | ||
| 16 | @Override | 21 | @Override | ... | ... |
| 1 | package com.fedex.connect.task.service.biz.impl; | 1 | package com.fedex.connect.task.service.biz.impl; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; | 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; |
| 4 | +import com.fedex.connect.common.dependencies.contants.ParamConfigConstants; | ||
| 4 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; | 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; |
| 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; | 6 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; |
| 6 | import com.fedex.connect.common.model.biz.Email; | 7 | import com.fedex.connect.common.model.biz.Email; |
| ... | @@ -37,7 +38,7 @@ public class DuplicateConsignmentEmailServiceImpl extends BaseService implements | ... | @@ -37,7 +38,7 @@ public class DuplicateConsignmentEmailServiceImpl extends BaseService implements |
| 37 | * 查询邮件发送日志表中状态为待推送且类型为“提醒发件人”的数据 | 38 | * 查询邮件发送日志表中状态为待推送且类型为“提醒发件人”的数据 |
| 38 | */ | 39 | */ |
| 39 | List<Email> emails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.NOTIFICATION_SENDER.getEnMsg()).getCode(), | 40 | List<Email> emails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.NOTIFICATION_SENDER.getEnMsg()).getCode(), |
| 40 | - cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode()); | 41 | + cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode(), ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_NUMBER); |
| 41 | /** | 42 | /** |
| 42 | * 发送邮件 | 43 | * 发送邮件 |
| 43 | */ | 44 | */ | ... | ... |
| 1 | package com.fedex.connect.task.service.biz.impl; | 1 | package com.fedex.connect.task.service.biz.impl; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; | 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; |
| 4 | +import com.fedex.connect.common.dependencies.contants.ParamConfigConstants; | ||
| 4 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; | 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; |
| 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; | 6 | import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; |
| 6 | import com.fedex.connect.common.dependencies.util.NIOFileUtils; | 7 | import com.fedex.connect.common.dependencies.util.NIOFileUtils; |
| ... | @@ -56,7 +57,7 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush | ... | @@ -56,7 +57,7 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush |
| 56 | String finalPath = ""; | 57 | String finalPath = ""; |
| 57 | //查询需要发送的数据 | 58 | //查询需要发送的数据 |
| 58 | List<Email> conPushEmails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.PUSH_CON_FILE.getEnMsg()).getCode(), | 59 | List<Email> conPushEmails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.PUSH_CON_FILE.getEnMsg()).getCode(), |
| 59 | - cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode()); | 60 | + cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode(),ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_NUMBER); |
| 60 | 61 | ||
| 61 | for (Email conPushEmail : conPushEmails) { | 62 | for (Email conPushEmail : conPushEmails) { |
| 62 | //获取待发送的文件并打zip包 | 63 | //获取待发送的文件并打zip包 | ... | ... |
-
Please register or login to post a comment