Showing
5 changed files
with
27 additions
and
23 deletions
@@ -22,7 +22,7 @@ public interface StorageDepositMapper { | @@ -22,7 +22,7 @@ public interface StorageDepositMapper { | ||
22 | * @param curTime | 22 | * @param curTime |
23 | * @return 最多返回500条记录,怕内存不够 | 23 | * @return 最多返回500条记录,怕内存不够 |
24 | */ | 24 | */ |
25 | - List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") Integer remindStatus); | 25 | + List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") List<Integer> remindStatus); |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * 更新通知快到期的状态 | 28 | * 更新通知快到期的状态 |
@@ -95,7 +95,11 @@ | @@ -95,7 +95,11 @@ | ||
95 | 95 | ||
96 | <select id="selectNeddRemindDeposit" resultMap="BaseResultMap"> | 96 | <select id="selectNeddRemindDeposit" resultMap="BaseResultMap"> |
97 | select <include refid="Base_Column_List"></include> | 97 | select <include refid="Base_Column_List"></include> |
98 | - from storage_deposit WHERE del_status = 0 and deposit_end_time <= #{curTime} and remind_status = #{remindStatus} AND status = 1 limit 500 | 98 | + from storage_deposit WHERE del_status = 0 and deposit_end_time <= #{curTime} and remind_status in |
99 | + <foreach collection="remindStatus" item="item" open="(" close=")" separator=","> | ||
100 | + #{item} | ||
101 | + </foreach> | ||
102 | + AND status = 1 limit 500 | ||
99 | </select> | 103 | </select> |
100 | 104 | ||
101 | <update id="updateHasRemind"> | 105 | <update id="updateHasRemind"> |
@@ -128,7 +128,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | @@ -128,7 +128,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | ||
128 | * @return | 128 | * @return |
129 | */ | 129 | */ |
130 | public List<StorageDeposit> selectNeddRemindDeposit() { | 130 | public List<StorageDeposit> selectNeddRemindDeposit() { |
131 | - return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, 0); | 131 | + return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, Lists.newArrayList(0, 1)); |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
@@ -447,7 +447,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | @@ -447,7 +447,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | ||
447 | } | 447 | } |
448 | 448 | ||
449 | public int updateHasRemind(Integer id) { | 449 | public int updateHasRemind(Integer id) { |
450 | - return storageDepositMapper.updateHasRemind(id, 1); | 450 | + return storageDepositMapper.updateHasRemind(id, 2); |
451 | } | 451 | } |
452 | 452 | ||
453 | public List<StorageDeposit> selectNeddDownDeposit() { | 453 | public List<StorageDeposit> selectNeddDownDeposit() { |
@@ -505,7 +505,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | @@ -505,7 +505,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ | ||
505 | } | 505 | } |
506 | 506 | ||
507 | public List<StorageDeposit> selectThreedDayNeedRemindDeposit() { | 507 | public List<StorageDeposit> selectThreedDayNeedRemindDeposit() { |
508 | - return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, 0); | 508 | + return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, Lists.newArrayList(0)); |
509 | } | 509 | } |
510 | 510 | ||
511 | public int updateThreedDayHasRemind(Integer id) { | 511 | public int updateThreedDayHasRemind(Integer id) { |
@@ -72,25 +72,25 @@ public class StorageDepositAutoDown implements YhJob { | @@ -72,25 +72,25 @@ public class StorageDepositAutoDown implements YhJob { | ||
72 | storageDeposits.stream().forEach(item -> { | 72 | storageDeposits.stream().forEach(item -> { |
73 | LOGGER.info("method StorageDepositAutoDown.process item is {}", item); | 73 | LOGGER.info("method StorageDepositAutoDown.process item is {}", item); |
74 | 74 | ||
75 | - int downResult = 0; | ||
76 | - if (item.getOrderStatus() == 1) { | ||
77 | - boolean offResult = offShelveByErp(item); | ||
78 | - if (offResult) { // 下架成功之后触发,变成待拣货状态 | ||
79 | - downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(), | ||
80 | - 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode()); | ||
81 | - } | ||
82 | - } else { // 下架成功之后触发,变成待拣货状态 | ||
83 | - downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(), | ||
84 | - 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode()); | 75 | + //int downResult = 0; |
76 | + if (item.getOrderStatus() == 1 && offShelveByErp(item)) { // 到期商品直接下架 | ||
77 | + notifyOwnerUid(item); // 修改成功之后,调用发通知 | ||
85 | } | 78 | } |
79 | + //if (offResult) { // 下架成功之后触发,变成待拣货状态 | ||
80 | + //downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(), | ||
81 | + // 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode()); | ||
82 | + // } | ||
83 | + //} else { // 下架成功之后触发,变成待拣货状态 | ||
84 | + // downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(), | ||
85 | + // 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode()); | ||
86 | + //} | ||
86 | 87 | ||
87 | - if (downResult > 0) { | ||
88 | - notifyOwnerUid(item); // 修改成功之后,调用发通知 | 88 | + //if (downResult > 0) { |
89 | 89 | ||
90 | - clearOrderInfoCache(item); | ||
91 | - } else { | ||
92 | - LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item); | ||
93 | - } | 90 | + |
91 | + //clearOrderInfoCache(item); | ||
92 | + //} else { | ||
93 | + // LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item); | ||
94 | }); | 94 | }); |
95 | 95 | ||
96 | result.setJobResultCode(JobResultCode.SUCCESS); | 96 | result.setJobResultCode(JobResultCode.SUCCESS); |
@@ -27,9 +27,9 @@ import java.util.List; | @@ -27,9 +27,9 @@ import java.util.List; | ||
27 | * Created by li.ma on 2019/7/8. | 27 | * Created by li.ma on 2019/7/8. |
28 | * 扫描库存到期前24小时的到期提醒 | 28 | * 扫描库存到期前24小时的到期提醒 |
29 | */ | 29 | */ |
30 | -/*@Service(value="StorageDepositThreeddayRemind") | 30 | +@Service(value="StorageDepositThreeddayRemind") |
31 | @YhJobDef(desc = "72小时库存寄存到期处理", jobName = "StorageDepositThreeddayRemind", cron = "0 0/10 * * * ?", misfiredPolicy = MisfiredPolicy.CRON_DO_NOTHING, | 31 | @YhJobDef(desc = "72小时库存寄存到期处理", jobName = "StorageDepositThreeddayRemind", cron = "0 0/10 * * * ?", misfiredPolicy = MisfiredPolicy.CRON_DO_NOTHING, |
32 | - jobType = JobType.CRON, jobGroup = "ufoPlatform")*/ | 32 | + jobType = JobType.CRON, jobGroup = "ufoPlatform") |
33 | public class StorageDepositThreeddayRemind implements YhJob { | 33 | public class StorageDepositThreeddayRemind implements YhJob { |
34 | private static final Logger LOGGER = LoggerFactory.getLogger("scheduledLog"); | 34 | private static final Logger LOGGER = LoggerFactory.getLogger("scheduledLog"); |
35 | 35 |
-
Please register or login to post a comment