自动化立体仓库 - WMS系统
skyouc
2 天以前 0f3025a6cf28e2cf9630f38a681f2dd8d7f1a052
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -345,7 +345,7 @@
                }
            }
        } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.TRANSFER.type)) {
            // 备货派工单(出库)
            // 备货指示派工单(出库)
            ReportOrderParam orderParam = new ReportOrderParam();
            orderParam.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
@@ -354,7 +354,7 @@
                    .setInv_no(order.getNumber())
                    .setPm_tktid(order.getItemName())
                    .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"))
                    .setTarget_location("");
                    .setTarget_location("1");
            List<ReportOrderParams> reportOrderParams = new ArrayList<>();
            orderDetls.forEach(detl -> {
@@ -376,7 +376,7 @@
                        // 上报时,默认目标位置是null
                        .setLocation_type(null)
                        // 上报时,默认上报时间是更新时间
                        .setSj_date(order.getUpdateBy().toString())
                        .setSj_date(order.getUpdateTime$())
                        // 上报时,默认上报人是更新人
                        .setSj_emp(order.getUpdateBy$())
                        // 上报时,默认上报数量是订单数量
@@ -394,22 +394,14 @@
            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)) {
@@ -417,10 +409,22 @@
                    }
                } 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());
@@ -549,8 +553,8 @@
        adjustParam.setCompany_id(order.getCstmrName())
                .setWms_id(order.getId() + "")
                .setType(0 + "")
                .setUpdate_time(order.getUpdateTime$())
                .setKopen_id(order.getDefNumber());
                .setUpdate_time(order.getUpdateTime$());
//                .setKopen_id(order.getDefNumber());
        adjustParam.setBsby_no(order.getOrderNo())
                .setReason("")
@@ -577,7 +581,14 @@
        adjustParams.add(adjustParam);
        XSR response = kopenApiService.reportCheckOrder(adjustParams, order);
        if (order.getReportOnce() < 3) {
            XSR response = kopenApiService.reportCheckOrder(adjustParams, order);
            if (response.getSuccess()) {
                return SUCCESS;
            } else {
                return  FAIL;
            }
        }
        return SUCCESS;
        // TODO Auto-generated method stub