| | |
| | | if (wrkMast.getIoType() == 1) { |
| | | // 入库通知单 |
| | | if (!Cools.isEmpty(wrkMast.getBarcode())) { |
| | | String request = "{\"barcode\":\"" + wrkMast.getBarcode() + "\"}"; |
| | | log.info("ERP入库上报请求: workNo={}, request={}", wrkMast.getWrkNo(), request); |
| | | JSONObject res = erpTokenService.stockIn(wrkMast.getBarcode()); |
| | | log.info("ERP入库上报响应: workNo={}, response={}", wrkMast.getWrkNo(), res == null ? null : res.toJSONString()); |
| | | apiLogService.save("erp.stockIn", "erpTokenService.stockIn", null, null, request, |
| | | res == null ? null : res.toJSONString(), |
| | | res != null && Boolean.TRUE.equals(res.getBoolean("success"))); |
| | | if (res != null && Boolean.TRUE.equals(res.getBoolean("success"))) { |
| | | JSONObject data = res.getJSONObject("data"); |
| | | String tlocation = data == null ? null : data.getString("tlocation"); |
| | | if (!Cools.isEmpty(tlocation) && !Cools.isEmpty(wrkMast.getLocNo())) { |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", wrkMast.getLocNo())); |
| | | if (!Cools.isEmpty(detls)) { |
| | | for (LocDetl detl : detls) { |
| | | detl.setStandby1(tlocation); |
| | | locDetlService.updateById(detl); |
| | | if(wrkMast.getSourceStaNo().equals("1015")){ |
| | | String request = "{\"barcode\":\"" + wrkMast.getBarcode() + "\"}"; |
| | | log.info("ERP入库上报请求: workNo={}, request={}", wrkMast.getWrkNo(), request); |
| | | JSONObject res = erpTokenService.stockIn(wrkMast.getBarcode()); |
| | | log.info("ERP入库上报响应: workNo={}, response={}", wrkMast.getWrkNo(), res == null ? null : res.toJSONString()); |
| | | apiLogService.save("erp.stockIn", "erpTokenService.stockIn", null, null, request, |
| | | res == null ? null : res.toJSONString(), |
| | | res != null && Boolean.TRUE.equals(res.getBoolean("success"))); |
| | | if (res != null && Boolean.TRUE.equals(res.getBoolean("success"))) { |
| | | JSONObject data = res.getJSONObject("data"); |
| | | String tlocation = data == null ? null : data.getString("tlocation"); |
| | | if (!Cools.isEmpty(tlocation) && !Cools.isEmpty(wrkMast.getLocNo())) { |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", wrkMast.getLocNo())); |
| | | if (!Cools.isEmpty(detls)) { |
| | | for (LocDetl detl : detls) { |
| | | detl.setStandby1(tlocation); |
| | | locDetlService.updateById(detl); |
| | | } |
| | | } |
| | | } |
| | | } |