| | |
| | | // 上报时,默认目标位置是null |
| | | .setLocation_type(null) |
| | | // 上报时,默认上报时间是更新时间 |
| | | .setSj_date(order.getUpdateBy().toString()) |
| | | .setSj_date(order.getUpdateTime$()) |
| | | // 上报时,默认上报人是更新人 |
| | | .setSj_emp(order.getUpdateBy$()) |
| | | // 上报时,默认上报数量是订单数量 |
| | |
| | | XSR response = null; |
| | | boolean success = false; |
| | | try { |
| | | // List<ReportOrderParam> orderParams = new ArrayList<>(); |
| | | // orderParams.add(orderParam); |
| | | // if (order.getReportOnce() < 4) { |
| | | // response = kopenApiService.getOutDetailsResult(orderParams, order); |
| | | // } else { |
| | | // return FAIL; |
| | | // } |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(MesConstant.URL) |
| | | // .setPath(MesConstant.PAKOUT_URL) |
| | | // .setJson(JSON.toJSONString(pakoutParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | if (true) { |
| | | List<ReportOrderParam> orderParams = new ArrayList<>(); |
| | | orderParams.add(orderParam); |
| | | if (order.getReportOnce() < 4) { |
| | | response = kopenApiService.reportOutDetailsResult(orderParams, order); |
| | | } else { |
| | | return FAIL; |
| | | } |
| | | if (response.getSuccess()) { |
| | | success = true; |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", |
| | | MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT, |
| | | JSON.toJSONString(orderParam), JSON.toJSONString(response)); |
| | | MesConstant.URL + MesConstant.OUT_DETAILS_RESULT, |
| | | JSON.toJSONString(orderParams), JSON.toJSONString(response)); |
| | | throw new CoolException("上报KOPEN系统失败"); |
| | | } |
| | | // if (true) { |
| | | // success = true; |
| | | // // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", |
| | | // MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT, |
| | | // JSON.toJSONString(orderParam), JSON.toJSONString(response)); |
| | | // throw new CoolException("上报KOPEN系统失败"); |
| | | // } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | return FAIL.setMsg(e.getMessage()); |