| | |
| | | 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; |
| | |
| | | private PurchaseService purchaseService; |
| | | @Autowired |
| | | private PurchaseItemService purchaseItemService; |
| | | |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | |
| | | @Autowired |
| | | private MatnrService matnrService; |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Resource |
| | | private SysStockProperties flowProperties; |
| | | @Autowired |
| | |
| | | if (StringUtils.isBlank(trackCode)) { |
| | | throw new CoolException("单据跟踪码生成失败:请检查「sys_asn_mantr_label」是否配置完成!!"); |
| | | } |
| | | item.setTrackCode(trackCode); |
| | | // item.setTrackCode(trackCode); |
| | | item.setBarcode(trackCode); |
| | | items.add(item); |
| | | }); |
| | | |
| | |
| | | * @return |
| | | * @time 2025/3/29 12:36 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | @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("原单据明细删除失败!!"); |
| | | } |
| | | } |