Authored by mali

寄存二期

... ... @@ -22,7 +22,7 @@ public interface StorageDepositMapper {
* @param curTime
* @return 最多返回500条记录,怕内存不够
*/
List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") Integer remindStatus);
List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") List<Integer> remindStatus);
/**
* 更新通知快到期的状态
... ...
... ... @@ -95,7 +95,11 @@
<select id="selectNeddRemindDeposit" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from storage_deposit WHERE del_status = 0 and deposit_end_time &lt;= #{curTime} and remind_status = #{remindStatus} AND status = 1 limit 500
from storage_deposit WHERE del_status = 0 and deposit_end_time &lt;= #{curTime} and remind_status in
<foreach collection="remindStatus" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
AND status = 1 limit 500
</select>
<update id="updateHasRemind">
... ...
... ... @@ -128,7 +128,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
* @return
*/
public List<StorageDeposit> selectNeddRemindDeposit() {
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, 0);
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, Lists.newArrayList(0, 1));
}
... ... @@ -447,7 +447,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
}
public int updateHasRemind(Integer id) {
return storageDepositMapper.updateHasRemind(id, 1);
return storageDepositMapper.updateHasRemind(id, 2);
}
public List<StorageDeposit> selectNeddDownDeposit() {
... ... @@ -505,7 +505,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
}
public List<StorageDeposit> selectThreedDayNeedRemindDeposit() {
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, 0);
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, Lists.newArrayList(0));
}
public int updateThreedDayHasRemind(Integer id) {
... ...
... ... @@ -72,25 +72,25 @@ public class StorageDepositAutoDown implements YhJob {
storageDeposits.stream().forEach(item -> {
LOGGER.info("method StorageDepositAutoDown.process item is {}", item);
int downResult = 0;
if (item.getOrderStatus() == 1) {
boolean offResult = offShelveByErp(item);
if (offResult) { // 下架成功之后触发,变成待拣货状态
downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
}
} else { // 下架成功之后触发,变成待拣货状态
downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
//int downResult = 0;
if (item.getOrderStatus() == 1 && offShelveByErp(item)) { // 到期商品直接下架
notifyOwnerUid(item); // 修改成功之后,调用发通知
}
//if (offResult) { // 下架成功之后触发,变成待拣货状态
//downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
// 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
// }
//} else { // 下架成功之后触发,变成待拣货状态
// downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
// 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
//}
if (downResult > 0) {
notifyOwnerUid(item); // 修改成功之后,调用发通知
//if (downResult > 0) {
clearOrderInfoCache(item);
} else {
LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item);
}
//clearOrderInfoCache(item);
//} else {
// LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item);
});
result.setJobResultCode(JobResultCode.SUCCESS);
... ...
... ... @@ -27,9 +27,9 @@ import java.util.List;
* Created by li.ma on 2019/7/8.
* 扫描库存到期前24小时的到期提醒
*/
/*@Service(value="StorageDepositThreeddayRemind")
@Service(value="StorageDepositThreeddayRemind")
@YhJobDef(desc = "72小时库存寄存到期处理", jobName = "StorageDepositThreeddayRemind", cron = "0 0/10 * * * ?", misfiredPolicy = MisfiredPolicy.CRON_DO_NOTHING,
jobType = JobType.CRON, jobGroup = "ufoPlatform")*/
jobType = JobType.CRON, jobGroup = "ufoPlatform")
public class StorageDepositThreeddayRemind implements YhJob {
private static final Logger LOGGER = LoggerFactory.getLogger("scheduledLog");
... ...