| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 自动生成跨区入任务 |
| | | * |
| | | * @author Ryan |
| | | * @date 2026/1/10 14:42 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void autoInStack() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 15).eq("online_yn","N")); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | // 构造跨区入库任务 |
| | | WrkMast inMast = new WrkMast(); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(1)); |
| | | inMast.setWrkNo(workNo); // 生成新任务号 |
| | | inMast.setBarcode(wrkMast.getBarcode()); // 托盘码保持一致 |
| | | inMast.setIoType(2); // 跨区入库类型 |
| | | inMast.setWrkSts(1L); // 待下发 |
| | | inMast.setLocNo(wrkMast.getLocNo()); // 原目标库位 |
| | | inMast.setIoPri(13.0); |
| | | inMast.setSourceStaNo(wrkMast.getStaNo()); |
| | | inMast.setWrkCode(wrkMast.getWrkNo()+""); // 关联原出库任务 |
| | | inMast.setAppeUser(wrkMast.getAppeUser()); // 申请人 |
| | | inMast.setAppeTime(new Date()); |
| | | inMast.setIoTime(new Date()); |
| | | inMast.setCrnNo(locMast.getCrnNo()); |
| | | if(!wrkMastService.insert(inMast)){ |
| | | throw new CoolException("跨区入库任务生成失败!"); |
| | | }else { |
| | | wrkMast.setOnlineYn("Y"); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |