| | |
| | | private ErpTokenService erpTokenService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | |
| | | if (wrkMast.getIoType() == 1) { |
| | | // 入库通知单 |
| | | if (!Cools.isEmpty(wrkMast.getBarcode())) { |
| | | String request = "{\"barcode\":\"" + wrkMast.getBarcode() + "\"}"; |
| | | JSONObject res = erpTokenService.stockIn(wrkMast.getBarcode()); |
| | | 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(wrkMast.getIsSuplus()!=null && wrkMast.getIsSuplus()==1 && wrkMast.getExitMk().equals("Y")){ |
| | | List<WrkDetl> wrkDetls1 = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no",wrkMast.getWrkNo())); |
| | | WrkDetl wrkDetl = wrkDetls1.get(0); |
| | | String request = "{\"barcode\":\"" + wrkMast.getBarcode() + "\",\"anfme\":" + wrkDetl.getAnfme() + "}"; |
| | | JSONObject res = erpTokenService.stockBack(wrkMast.getBarcode(),wrkDetl.getAnfme(),null); |
| | | apiLogService.save("erp.stockBack", "erpTokenService.stockBack", 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"))) { |
| | | |
| | | } |
| | | }else if(Objects.isNull(wrkMast.getLocNo())){ |
| | | String request = "{\"barcode\":\"" + wrkMast.getBarcode() + "\"}"; |
| | | JSONObject res = erpTokenService.stockOut(wrkMast.getBarcode(),null); |
| | | apiLogService.save("erp.stockOut", "erpTokenService.stockOut", 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"))) { |
| | | |
| | | } |