| | |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("billType", wrkDetl.getThreeCode()); |
| | | jsonObject.put("orderNo", wrkDetl.getOrderNo()); |
| | | jsonObject.put("createTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now)); |
| | | jsonObject.put("createTime", null); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (WrkDetl detl : wrkDetls) { |
| | | JSONObject object = new JSONObject(); |
| | |
| | | jsonArray.add(object); |
| | | } |
| | | jsonObject.put("details", jsonArray); |
| | | String url = DJ_URL + "api/OutboundOrder/WmsOutFinish"; |
| | | String url = DJ_URL + "/api/OutboundOrder/WmsOutnFinish"; |
| | | String request = jsonObject.toJSONString(); |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(DJ_URL) |
| | | .setPath("api/OutboundOrder/WmsOutFinish") |
| | | .setPath("api/OutboundOrder/WmsOutnFinish") |
| | | .setJson(request) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject responseJson = JSON.parseObject(response); |
| | | if (responseJson.getString("Success").equals("1")) { |
| | | if (!Cools.isEmpty(responseJson.getString("code")) && responseJson.getInteger("code")== 200) { |
| | | success = true; |
| | | log.info("CTU出库反馈end,上报TMS成功,工作号:{},明细:{}", wrkMast.getWrkNo(), request); |
| | | } else { |