| | |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.OrderDetlPakoutMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.asrs.utils.Utils; |
| | |
| | | |
| | | @Resource |
| | | private OrderPakoutService orderPakOutService; |
| | | |
| | | @Resource |
| | | private OrderDetlPakoutMapper orderDetlPakoutMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException(locNo+"库位不存在"); |
| | | } |
| | | if (!locMast.getLocSts().equals("M") && !locMast.getLocSts().equals("Z")) { |
| | | throw new CoolException("库位状态有误:" + locMast.getLocSts()); |
| | | } |
| | | // 获取源站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", 110) |
| | |
| | | throw new CoolException(locDetl.getLocNo() + "," + locDetl.getMatnr() + "," + locDetl.getBatch() + "库存明细已被冻结!"); |
| | | } |
| | | |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("D"))){ |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("M") && !sourceLoc.getLocSts().equals("Z"))){ |
| | | throw new CoolException("库位状态已改变"); |
| | | } |
| | | if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { |
| | |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls)?"N":"Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("M") ? "M" : sourceLoc.getLocSts().equals("Z") ? "Z" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); |
| | |
| | | } |
| | | } |
| | | // 修改源库位状态 |
| | | if (sourceLoc.getLocSts().equals("D") || sourceLoc.getLocSts().equals("F")) { |
| | | if (sourceLoc.getLocSts().equals("F") || sourceLoc.getLocSts().equals("M") || sourceLoc.getLocSts().equals("Z")) { |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiUser(userId); |
| | | sourceLoc.setModiTime(now); |
| | |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | workNoOther = wrkMast.getWorkNoOther(); |
| | | } else if(wrkMast.getIoType() == 1 && wrkMast.getWrkSts() == 10) { |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setRgvFinishTime(new Date()); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | |
| | | } |
| | | if(workNoOther != 0) { |
| | | WrkMast wrkMast1 = wrkMastService.selectById(workNoOther); |
| | | wrkMast1.setWrkSts(wrkMast.getWrkSts()); |
| | | wrkMast1.setCrnStrTime(wrkMast.getCrnStrTime()); |
| | | wrkMast1.setCrnEndTime(now); |
| | | wrkMast1.setModiTime(now); |
| | | wrkMast1.setModiUser(userId); |
| | | wrkMast1.setManuType("手动完成"); |
| | | wrkMastService.updateById(wrkMast1); |
| | | if (wrkMast1 != null) { |
| | | wrkMast1.setWrkSts(wrkMast.getWrkSts()); |
| | | wrkMast1.setCrnStrTime(wrkMast.getCrnStrTime()); |
| | | wrkMast1.setCrnEndTime(now); |
| | | wrkMast1.setModiTime(now); |
| | | wrkMast1.setModiUser(userId); |
| | | wrkMast1.setManuType("手动完成"); |
| | | wrkMastService.updateById(wrkMast1); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,源库位不存在:"+ wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F"); |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N")?wrkMast.getEmptyMk():"F"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | OrderInAndOutUtil.decrease(Boolean.FALSE,wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(), |
| | | wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3(), wrkDetl.getAnfme()); |
| | | // OrderInAndOutUtil.decrease(Boolean.FALSE,wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(), |
| | | // wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3(), wrkDetl.getAnfme()); |
| | | orderDetlPakoutMapper.increaseQtyByOrderNoNew(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | wrkDetl.getBatch(),wrkDetl.getModel(),wrkDetl.getVolume(),wrkDetl.getAnfme()); |
| | | |
| | | //修改订单主表状态,没有作业数量时才可以修改 |
| | | boolean flag = true; |