| | |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | |
| | | |
| | | @RequestMapping(value = "/mat/back") |
| | | @ManagerAuth |
| | | public R pdaSearchBack(@RequestParam String matnr) { |
| | | EntityWrapper<NccJcQilibcBarcodeflowWms> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("VBARCODE", matnr).orderBy("ts", false); |
| | | NccJcQilibcBarcodeflowWms nccJcQilibcBarcodeflowWms = nccJcQilibcBarcodeflowWmsService.selectOne(wrapper); |
| | | if (null == nccJcQilibcBarcodeflowWms) { |
| | | return R.error("未找到此条码"); |
| | | } else { |
| | | if (!nccJcQilibcBarcodeflowWms.getInfla().equals("出库")) { |
| | | return R.error("该条码最后一次不是出库"); |
| | | } |
| | | 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("未找到此托盘码出库记录"); |
| | | } |
| | | Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm()); |
| | | |
| | | 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(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); |
| | | 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") |