自动化立体仓库 - WMS系统
skyouc
2 天以前 6cb4e6647b0e2e8c0cafa38a07666e07709bcf54
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -255,7 +255,6 @@
            ReportOrderParam orderParam = new ReportOrderParam();
            orderParam.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
//                    .setOrder_no(order.getOrderNo())
                    .setDispatch_no(order.getOrderNo())
                    .setType(order.getDocType() + "")
                    .setInv_no(order.getNumber())
@@ -349,47 +348,36 @@
            ReportOrderParam orderParam = new ReportOrderParam();
            orderParam.setCompany_id(order.getCstmrName())
                    .setWms_id(order.getId() + "")
                    .setOrder_no(order.getOrderNo())
                    .setDispatch_no(order.getOrderNo())
                    .setType(order.getDocType() + "")
                    .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<>();
            List<OrderItemsParam> reportOrderParams = new ArrayList<>();
            orderDetls.forEach(detl -> {
                Mat material = matService.selectByMatnr(detl.getMatnr());
                if (Objects.isNull(material)) {
                    throw new CoolException("物料不存在");
                }
                ReportOrderParams itemParam = new ReportOrderParams();
                OrderItemsParam itemParam = new OrderItemsParam();
                // BS Code
                itemParam.setTotal_serial(detl.getThreeCode())
                itemParam
                        // 上报时,默认产品类型是null
                        .setPro_type(material.getProType())
                        // 上报时,默认产品编码
                        .setPro_komcode(detl.getMatnr())
                        // 上报时,默认产品id是供应商编码
                        .setPro_id(detl.getSuppCode())
                        // 上报时,默认来源位置是null
//                        // 上报时,默认来源位置是null
                        .setLocation_no(null)
                        // 上报时,默认目标位置是null
                        .setLocation_type(null)
                        // 上报时,默认上报时间是更新时间
                        .setSj_date(order.getUpdateTime$())
                        // 上报时,默认上报人是更新人
                        .setSj_emp(order.getUpdateBy$())
                        // 上报时,默认上报数量是订单数量
                        .setPick_qty(detl.getQty().intValue())
                        // 上报时,默认损坏数量是0
                        .setDamage_qty(0)
                        // 上报时,默认差异数量是0
                        .setDiff_qty(0);
                        .setPick_qty(detl.getQty().intValue());
                reportOrderParams.add(itemParam);
            });
            orderParam.setDetails(reportOrderParams);
            orderParam.setPartList(reportOrderParams);
            XSR response = null;
            boolean success = false;
@@ -413,18 +401,6 @@
                            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());