| | |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MathUtils; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.Synchro; |
| | |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | |
| | | |
| | | @Resource |
| | | private StaDescService staDescService; |
| | | |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | |
| | | @RequestMapping("/pda/WarehouseOut/v1") |
| | | @ManagerAuth(memo = "并板途中拣料-参考念初") |
| | |
| | | Synchro.Copy(orderDetl, combMat); |
| | | combMat.setMatnr(orderDetl.getMatnr()); |
| | | combMat.setBatch(orderDetl.getBatch()); |
| | | combMat.setAnfme(orderDetl.getAnfme() - orderDetl.getWorkQty()); |
| | | combMat.setAnfme(MathUtils.subtract(orderDetl.getAnfme(), orderDetl.getWorkQty())); |
| | | combMat.setMaktx(orderDetl.getMaktx()); |
| | | combMat.setSpecs(orderDetl.getSpecs()); |
| | | combMat.setEnableQty(orderDetl.getAnfme() - orderDetl.getWorkQty()); |
| | | combMat.setEnableQty(MathUtils.subtract(orderDetl.getAnfme(), orderDetl.getWorkQty())); |
| | | combMats.add(combMat); |
| | | } |
| | | combParam.setCombMats(combMats); |
| | |
| | | Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm()); |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>().eq("order_no", nccJcQilibcBarcodeflowWms.getZkdh()).eq("matnr", mat.getMatnr()).eq("batch", nccJcQilibcBarcodeflowWms.getVbatchcode())); |
| | | if (orderDetlPakin == null) { |
| | | throw new CoolException("未找到此单号"); |
| | | } |
| | | matParam.setStandby1(orderDetlPakin.getStandby1()); |
| | | matParam.setOrderNo(nccJcQilibcBarcodeflowWms.getZkdh()); |
| | | matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue()); |
| | | matParam.setWeight(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue()); |
| | | matParam.setAnfme2(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue()); |
| | | matParam.setTiaoma(nccJcQilibcBarcodeflowWms.getVbarcode()); |
| | | return R.ok().add(matParam); |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/auth") |
| | |
| | | matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue()); |
| | | matParam.setAnfme2(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue()); |
| | | matParam.setTiaoma(nccJcQilibcBarcodeflowWms.getVbarcode()); |
| | | return R.ok().add(matParam); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/back") |
| | | @ManagerAuth |
| | | public R pdaSearchBack(@RequestParam String barcode) { |
| | | WrkMastLog wrkMastLog = wrkMastLogService.selectOne(new EntityWrapper<WrkMastLog>() |
| | | .eq("barcode", barcode) |
| | | .in("io_type", 101, 103, 107) |
| | | .orderBy("appe_time", false) |
| | | ); |
| | | |
| | | if(null == wrkMastLog) { |
| | | return R.error("未找到此托盘码出库记录"); |
| | | } |
| | | |
| | | List<WrkDetlLog> wrkDetlLogs = wrkDetlLogService.selectList(new EntityWrapper<WrkDetlLog>() |
| | | .eq("wrk_no", wrkMastLog.getWrkNo()) |
| | | .eq("zpallet", barcode) |
| | | .orderBy("io_time", false) |
| | | ); |
| | | if (wrkDetlLogs.isEmpty()) { |
| | | return R.error("未找到此托盘码出库记录明细"); |
| | | } |
| | | |
| | | WrkDetlLog wrkDetlLog = wrkDetlLogs.get(0); |
| | | String batch = wrkDetlLog.getBatch(); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | Mat mat = matService.selectByMatnr(wrkDetlLog.getMatnr()); |
| | | if (mat == null) { |
| | | return R.error("未找到物料明细"); |
| | | } |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | matParam.setBatch(batch); |
| | | matParam.setAnfme(0.0D); |
| | | matParam.setAnfme2(0.0D); |
| | | matParam.setTiaoma(batch); |
| | | |
| | | String[] split = wrkDetlLog.getOrderNo().split("-"); |
| | | map.put("orderNo", split[0]); |
| | | map.put("matData", matParam); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam) { |