| | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Component |
| | |
| | | if (wcsStationDto == null) { |
| | | continue; |
| | | } |
| | | if(Cools.isEmpty(wcsStationDto.getTaskNo())){ |
| | | continue; |
| | | } |
| | | |
| | | if (wcsStationDto.getAuto() != 1 |
| | | || wcsStationDto.getLoading() != 1 |
| | |
| | | for (Object o : data.getJSONArray("wrkDetls")) { |
| | | JSONObject wrkDetl = (JSONObject) o; |
| | | TvWrkDetlDto tvWrkDetlDto = new TvWrkDetlDto(); |
| | | list.add(tvWrkDetlDto); |
| | | // list.add(tvWrkDetlDto); |
| | | |
| | | tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr")); |
| | | tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx")); |
| | | tvWrkDetlDto.setSpecs(wrkDetl.getString("specs")); |
| | | tvWrkDetlDto.setBatch(wrkDetl.getString("batch")); |
| | | tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme")); |
| | | tvWrkDetlDto.setBarcode(wrkDetl.getString("zpallet")); |
| | | wcsStationDto.setBarcode(wrkDetl.getString("zpallet")); |
| | | tvWrkDetlDto.setOutboundSeq(wrkDetl.getString("supp")); |
| | | tvWrkDetlDto.setOrderNo(wrkDetl.getString("orderNo")); |
| | | wcsStationDto.setOrderNo(wrkDetl.getString("orderNo")); |
| | | list.add(tvWrkDetlDto); |
| | | } |
| | | |
| | | wcsStationDto.setIoType(data.getInteger("ioType")); |
| | | |
| | | wcsStationDto.setWrkDetls(list); |
| | | stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto); |
| | | } |
| | |
| | | if (Cools.isEmpty(wcsStationDto.getBarcode())) { |
| | | continue; |
| | | } |
| | | |
| | | requestParam.put("barcode", wcsStationDto.getBarcode()); |
| | | String[] split = wcsStationDto.getBarcode().split(","); |
| | | String barcode = split[0]; |
| | | if(Objects.equals(barcode, "NoRead")){ |
| | | continue; |
| | | } |
| | | requestParam.put("taskNo", wcsStationDto.getTaskNo()); |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsCombQueryUrl) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | |
| | | if (response != null) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | |
| | | if(data == null){ |
| | | continue; |
| | | } |
| | | List<TvWrkDetlDto> list = new ArrayList<>(); |
| | | for (Object o : data.getJSONArray("combDetls")) { |
| | | for (Object o : data.getJSONArray("wrkDetls")) { |
| | | JSONObject wrkDetl = (JSONObject) o; |
| | | TvWrkDetlDto tvWrkDetlDto = new TvWrkDetlDto(); |
| | | list.add(tvWrkDetlDto); |
| | | // list.add(tvWrkDetlDto); |
| | | |
| | | tvWrkDetlDto.setMatnr(wrkDetl.getString("matnr")); |
| | | tvWrkDetlDto.setMaktx(wrkDetl.getString("maktx")); |
| | | tvWrkDetlDto.setSpecs(wrkDetl.getString("specs")); |
| | | tvWrkDetlDto.setBatch(wrkDetl.getString("batch")); |
| | | tvWrkDetlDto.setAnfme(wrkDetl.getDouble("anfme")); |
| | | list.add(tvWrkDetlDto); |
| | | } |
| | | |
| | | wcsStationDto.setIoType(1); |
| | | wcsStationDto.setBarcode(barcode); |
| | | wcsStationDto.setWrkDetls(list); |
| | | System.out.println(wcsStationDto); |
| | | stationUtils.stationMap.put(wcsStationDto.getStationId(), wcsStationDto); |
| | | } |
| | | } |