| | |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.DateUtils; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | |
| | | * @return |
| | | * @time 2025/3/29 12:36 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | // @Scheduled(cron = "0 0/05 * * * ? ") |
| | | @Scheduled(cron = "0/25 * * * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void pakinLog() { |
| | | List<WaitPakin> pakinIds = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getIoStatus, 2).select(WaitPakin::getId)); |
| | | List<WaitPakin> pakinIds = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getIoStatus, Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_TASK_DONE.val)) |
| | | .select(WaitPakin::getId)); |
| | | if (pakinIds.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | if (!waitPakinItemLogService.saveBatch(itemLogs)) { |
| | | throw new CoolException("历史明细档保存失败!!"); |
| | | } |
| | | if (!waitPakinService.removeByIds(pakins)) { |
| | | if (!waitPakinService.removeByIds(list)) { |
| | | throw new CoolException("原单据删除失败!!"); |
| | | } |
| | | if (!waitPakinItemService.removeByIds(pakinItems)) { |
| | | if (!waitPakinItemService.remove(new LambdaQueryWrapper<WaitPakinItem>().in(WaitPakinItem::getPakinId, list))) { |
| | | throw new CoolException("原单据明细删除失败!!"); |
| | | } |
| | | } |