| | |
| | | wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | try { |
| | | if (!Cools.isEmpty(orderDetlPakin)) { |
| | | if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), |
| | | orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | wrkDetl.getAnfme())) { |
| | | // exceptionHandle("全板入库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() |
| | | + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | if (!Cools.isEmpty(orderDetlPakin)) { |
| | | if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), |
| | | wrkDetl.getMatnr(), |
| | | orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), |
| | | wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), |
| | | wrkDetl.getAnfme())) { |
| | | // exceptionHandle("全板入库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() |
| | | + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } catch (Exception ignore) { |
| | | |
| | | } |
| | | } |
| | | // 修改库位状态 S ====>> F |
| | |
| | | .eq("supp_code", wrkDetl.getSuppCode()) |
| | | .eq("matnr", wrkDetl.getMatnr()) |
| | | .eq("loc_no", locMast.getLocNo())); |
| | | // 更新订单完成数量 |
| | | OrderDetlPakin detlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | // .eq("three_code", wrkDetl.getThreeCode()) //TODO 并板时需要修改BSCODE为订单bscode |
| | | .eq("supp_code", wrkDetl.getSuppCode()) |
| | | .eq("matnr", wrkDetl.getMatnr()) |
| | | .eq("order_no", wrkDetl.getOrderNo())); |
| | | if (!Cools.isEmpty(detlPakin)) { |
| | | //任务明细数量=新入库数量 + 原库存数量 |
| | | double locQty = 0.0; |
| | | if (!Objects.isNull(locDetl)) { |
| | | locQty = locDetl.getAnfme(); |
| | | } |
| | | double v = Math.round((wrkDetl.getAnfme() - locQty) * 10000) / 10000.0; |
| | | double v1 = Math.round((detlPakin.getQty() + v) * 10000) / 10000.0; |
| | | detlPakin.setQty(v1); |
| | | detlPakin.setWorkQty(v1); |
| | | detlPakin.setAdjustQty(wrkDetl.getAdjustQty()); |
| | | detlPakin.setSplusQty(wrkDetl.getSplusQty()); |
| | | if (!orderDetlPakinService.update(detlPakin, new EntityWrapper<OrderDetlPakin>() |
| | | .eq("matnr", detlPakin.getMatnr()) |
| | | .eq("supp_code", detlPakin.getSuppCode()) |
| | | .eq("order_no", detlPakin.getOrderNo()))) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("并板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() |
| | | + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | |
| | | if (null != locDetl) { |
| | | // 更新订单完成数量 |
| | | OrderDetlPakin detlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | // .eq("three_code", wrkDetl.getThreeCode()) //TODO 并板时需要修改BSCODE为订单bscode |
| | | .eq("supp_code", wrkDetl.getSuppCode()) |
| | | .eq("matnr", wrkDetl.getMatnr()) |
| | | .eq("order_no", wrkDetl.getOrderNo())); |
| | | try { |
| | | if (!Cools.isEmpty(detlPakin)) { |
| | | double v = Math.round((wrkDetl.getAnfme() - locDetl.getAnfme()) * 10000) / 10000.0; |
| | | double v1 = Math.round((detlPakin.getQty() + v) * 10000) / 10000.0; |
| | | detlPakin.setQty(v1); |
| | | detlPakin.setWorkQty(v1); |
| | | detlPakin.setAdjustQty(wrkDetl.getAdjustQty()); |
| | | detlPakin.setSplusQty(wrkDetl.getSplusQty()); |
| | | if (!orderDetlPakinService.update(detlPakin, new EntityWrapper<OrderDetlPakin>() |
| | | .eq("matnr", detlPakin.getMatnr()) |
| | | .eq("supp_code", detlPakin.getSuppCode()) |
| | | .eq("order_no", detlPakin.getOrderNo()))) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("并板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() |
| | | + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | |
| | | LocDetl detl = new LocDetl(); |
| | | detl.setAnfme(wrkDetl.getAnfme()); |
| | | detl.setStandby1(wrkDetl.getSuppCode()); |
| | |
| | | } |
| | | } |
| | | |
| | | String agvSta = null; |
| | | if (wrkMast.getIoType().equals(TaskIOType.MERGE_IN.type)) { |
| | | agvSta = wrkMast.getPauseMk(); |
| | | } |
| | | List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", agvSta)); |
| | | if (Objects.isNull(basStationDetls) || basStationDetls.isEmpty()) { |
| | | // . 删除缓存站点明细 |
| | | if (!Objects.isNull(agvSta)) { |
| | | // 修改目标站点信息 |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", agvSta)); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | basStationDetlService.delete(new EntityWrapper<BasStationDetl>() |
| | | .eq("dev_no", station.getDevNo())); |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_D.type); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态更新失败!!"); |
| | | } |
| | | } |
| | | } |
| | | // String agvSta = null; |
| | | // if (wrkMast.getIoType().equals(TaskIOType.MERGE_IN.type)) { |
| | | // agvSta = wrkMast.getPauseMk(); |
| | | // } |
| | | // List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", agvSta)); |
| | | // if (Objects.isNull(basStationDetls) || basStationDetls.isEmpty()) { |
| | | // // . 删除缓存站点明细 |
| | | // if (!Objects.isNull(agvSta)) { |
| | | // // 修改目标站点信息 |
| | | // BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", agvSta)); |
| | | // if (Objects.isNull(station)) { |
| | | // throw new CoolException("站点不存在!!"); |
| | | // } |
| | | // basStationDetlService.delete(new EntityWrapper<BasStationDetl>() |
| | | // .eq("dev_no", station.getDevNo())); |
| | | // station.setLocSts(LocStsType.LOC_STS_TYPE_D.type); |
| | | // if (!basStationService.updateById(station)) { |
| | | // throw new CoolException("站点状态更新失败!!"); |
| | | // } |
| | | // } |
| | | // } |
| | | break; |
| | | // 盘点入库 |
| | | case 57: |
| | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | if (wrkMast.getTaskType().equals("agv_back")) { |
| | | wrkMast.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type); |
| | | wrkMast.setModiTime(new Date()); |
| | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo())); |
| | | if (!Objects.isNull(wrkMast.getSourceStaNo())) { |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | } |
| | | station.setBarcode(""); |
| | | // basStationService.updateById(station); |
| | | if (!basStationService.updateById(station)) { |
| | | throw new CoolException("站点状态修改失败!!"); |
| | | } |
| | | |
| | | basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo())); |
| | | } |
| | | } |