From b2dbc07e7d3c3f336a0090b7457c89c6895d5e40 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期一, 05 一月 2026 14:50:10 +0800
Subject: [PATCH] 入库流程修改

---
 src/main/java/com/zy/api/service/impl/HWmsApiServiceImpl.java |  539 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 539 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/api/service/impl/HWmsApiServiceImpl.java b/src/main/java/com/zy/api/service/impl/HWmsApiServiceImpl.java
new file mode 100644
index 0000000..f709dd5
--- /dev/null
+++ b/src/main/java/com/zy/api/service/impl/HWmsApiServiceImpl.java
@@ -0,0 +1,539 @@
+package com.zy.api.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.common.SnowflakeIdWorker;
+import com.core.exception.CoolException;
+import com.zy.api.controller.params.PageRequestParams;
+import com.zy.api.entity.OrderItemsParam;
+import com.zy.api.entity.OrderParams;
+import com.zy.api.entity.OutOrderParams;
+import com.zy.api.entity.PubOrderParams;
+import com.zy.api.entity.ReportOrderParam;
+import com.zy.api.entity.StockUpOrderParams;
+import com.zy.api.entity.SyncMatParmas;
+import com.zy.api.entity.dto.XSR;
+import com.zy.api.enums.MatLocType;
+import com.zy.api.enums.OrderType;
+import com.zy.api.enums.OrderWkType;
+import com.zy.api.service.HWmsApiService;
+import com.zy.asrs.entity.LocDetl;
+import com.zy.asrs.entity.Mat;
+import com.zy.asrs.entity.Order;
+import com.zy.asrs.entity.OrderDetl;
+import com.zy.asrs.enums.CommonEnum;
+import com.zy.asrs.service.LocDetlService;
+import com.zy.asrs.service.MatService;
+import com.zy.asrs.service.OrderDetlService;
+import com.zy.asrs.service.OrderService;
+
+import com.zy.asrs.utils.Utils;
+import com.zy.common.utils.HttpHandler;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+@Slf4j
+@Service("kopenApiServiceImpl")
+public class HWmsApiServiceImpl implements HWmsApiService {
+
+    @Autowired
+    private OrderService orderService;
+    @Autowired
+    private OrderDetlService orderDetlService;
+    @Autowired
+    private MatService matService;
+    @Autowired
+    private LocDetlService locDetlService;
+    @Autowired
+    private SnowflakeIdWorker snowflakeIdWorker;
+//    @Value("${kopen.url}")
+    private String url;
+//    @Value("${kopen.port}")
+    private String port;
+//    @Value("${kopen.prefix}")
+    private String prefix;
+
+
+    /**
+     * 鎺ユ敹涓嬪彂璁㈠崟淇℃伅
+     *
+     * @param orderParams
+     * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/11/24 14:49
+     */
+    @Override
+    public XSR receiveOrders(List<PubOrderParams> orderParams) {
+        orderParams.forEach(params -> {
+            if (params.getType().equals(OrderWkType.getTypeVal(params.getType()))) {
+                throw new CoolException("褰撳墠绫诲瀷涓嶆槸涓婃灦娲惧伐鍗曪紒锛�");
+            }
+            addOrUpdateOrders(params, "add");
+        });
+
+        return XSR.ok("鍗曟嵁涓嬪彂鎴愬姛锛侊紒");
+    }
+
+    /**
+     * 涓婃灦娲惧伐鍗曞弽棣�
+     *
+     * @author Ryan
+     * @date 2025/11/24 15:33
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public XSR getInDispatchResult(List<ReportOrderParam> params, Order order) {
+        if (Objects.isNull(params)) {
+            return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+        String response = null;
+
+        try {
+            response = new HttpHandler.Builder()
+                    .setUri(url + ":" + port)
+                    .setPath(prefix + "/getInDispatchResult")
+                    .setJson(JSONObject.toJSONString(params))
+                    .build()
+                    .doPost();
+            if (Objects.isNull(response) || response.trim().isEmpty()) {
+                return XSR.error("澶栫綉鎺ュ彛鏃犲搷搴旓紒锛�");
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            Integer code = jsonObject.getInteger("code");
+            if (!Objects.isNull(code) && code.equals(200)) {
+                if (!Objects.isNull(order)) {
+                    order.setReportOnce(5);
+                    orderService.updateById(order);
+                }
+                return XSR.ok("鍏ュ簱鍗曚笂鎶ュ畬鎴愶紒锛�");
+            } else {
+                if (!Objects.isNull(order)) {
+                    int reportOnce = order.getReportOnce();
+                    reportOnce ++;
+                    order.setReportOnce(reportOnce);
+                    orderService.updateById(order);
+                }
+                String msg = jsonObject.getString("message");
+                return XSR.error(Objects.isNull(msg) ? "涓婃姤澶辫触锛侊紒" : msg);
+            }
+        } catch (Exception e) {
+            if (!Objects.isNull(order)) {
+                int reportOnce = order.getReportOnce();
+                reportOnce ++;
+                order.setReportOnce(reportOnce);
+                orderService.updateById(order);
+            }
+            log.error(e.getMessage(), e);
+            return XSR.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 鑾峰彇鑷畾涔夎姹傚ご
+     * @author Ryan
+     * @date 2025/12/29 9:11
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    private Map<String, Object> getHeaderParam() {
+        Map<String, Object> headerParam = new HashMap<>();
+//        headerParam.put("accept", "*/*");
+//        headerParam.put("connection", "Keep-Alive");
+        //璁剧疆璇锋眰杩炴帴鐨凾oken
+        headerParam.put("api_key", "WMS");
+        headerParam.put("charset", "UTF-8");
+        headerParam.put("timestamp", new Date());
+        headerParam.put("format", "xml");
+        headerParam.put("signature", "c56ced444ed772098ffeb59537bbfa59");
+
+        return headerParam;
+    }
+
+    /* */
+
+    /**
+     * 澶囪揣鎸囩ず娲惧伐鍗曚笅鍙�
+     *
+     * @param pubOrderParams
+     * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/11/24 15:21
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public XSR sendOutDispatch(List<PubOrderParams> pubOrderParams) {
+        if (Objects.isNull(pubOrderParams) || pubOrderParams.isEmpty()) {
+            return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+        pubOrderParams.forEach(params -> {
+            // 鏍¢獙鍙傛暟
+            if (Objects.isNull(params.getDispatch_no())) {
+                throw new CoolException("娲惧伐鍗曠紪鍙蜂笉鑳戒负绌猴紒锛�");
+            }
+            if (Objects.isNull(params.getKopen_id())) {
+                throw new CoolException("娴佹按鍙蜂笉鑳戒负绌猴紒锛�");
+            }
+            if (Objects.isNull(params.getCompany_id())) {
+                throw new CoolException("鍏徃ID涓嶈兘涓虹┖锛侊紒");
+            }
+
+            addOrUpdateOrders(params, "add");
+        });
+
+        return XSR.ok("澶囪揣鎸囩ず娲惧伐鍗曚笅鍙戞垚鍔燂紒锛�");
+    }
+
+    // /**
+    // * 澶囪揣鎸囩ず娲惧伐鍗�
+    // *
+    // * @author Ryan
+    // * @date 2025/12/16 9:15
+    // * @param params
+    // */
+    // private void outOrderAddAndUpdate(PubOrderParams params, String type) {
+    // if (Objects.isNull(params)) {
+    // throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+    // }
+    // if (Objects.isNull(params.getType())) {
+    // throw new CoolException("璁㈠崟绫诲瀷涓嶈兘涓虹┖锛侊紒");
+    // }
+
+    // OrderParams orderParams =
+    // JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class);
+    // Order order = orderService.selectOne(new
+    // EntityWrapper<Order>().eq("order_no", orderParams.getInv_no()));
+    // if (type.equals("add") && !Objects.isNull(order)) {
+    // throw new CoolException("鍗曟嵁宸插瓨鍦�, 涓嶅彲閲嶅娣诲姞锛侊紒");
+    // }
+    // // 鍒ゆ柇璁㈠崟鏄惁瀛樺湪
+    // if (Objects.isNull(order)) {
+    // /** 涓嶅瓨鍦紝鏂板璁㈠崟 */
+    // generateOrders(params);
+    // } else {
+    // /** 瀛樺湪锛屽垹闄よ�佽鍗曪紝鏇存柊鎻掑叆鏂拌鍗� */
+    // // 鍒犻櫎鏃ц鍗曟槑缁�
+    // if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id",
+    // order.getId()))) {
+    // throw new CoolException("璁㈠崟鏄庣粏鍒犻櫎澶辫触锛侊紒");
+    // }
+    // ;
+    // if (!orderService.deleteById(order.getId())) {
+    // throw new CoolException("鍘熷崟鎹垹闄ゅけ璐ワ紒锛�");
+    // }
+    // generateOrders(params);
+    // }
+
+    // }
+
+    /**
+     * 鍩虹闆朵欢鍙樻洿
+     *
+     * @param params
+     * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/11/24 15:05
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public synchronized XSR basMatupdate(List<SyncMatParmas> params) {
+        if (Objects.isNull(params) || params.isEmpty()) {
+            return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+        params.forEach(mats -> {
+            if (Objects.isNull(mats)) {
+                throw new CoolException("鐗╂枡缂栫爜涓嶈兘涓虹┖锛侊紒");
+            }
+            if (Objects.isNull(mats.getPro_type())) {
+                throw new CoolException("闆朵欢绫诲瀷涓嶈兘涓虹┖锛侊紒");
+            }
+            Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", mats.getPro_komcode()));
+            if (!Objects.isNull(matnr)) {
+                // 璁㈠崟鏃堕棿
+                if (Utils.isValidFormat(mats.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) {
+                    Date date1 = Utils.getFormateDate(mats.getUpdate_time());
+                    matnr.setUpdateTime(date1);
+                }
+                matnr.setMaktx(mats.getPro_name());
+                matnr.setSpecs(mats.getPro_size());
+                matnr.setWeight(Objects.isNull(mats.getPro_wet()) ? 0.0 : Double.parseDouble(mats.getPro_wet()));
+                matnr.setSuppCode(mats.getPro_id());
+                matnr.setTagId(MatLocType.getTag(mats.getPro_type()));
+                matnr.setLocType(MatLocType.getTag(mats.getPro_type()));
+                matnr.setManu(mats.getCompany_id());
+                if (!matService.updateById(matnr)) {
+                    throw new CoolException("鐗╂枡鏇存柊澶辫触鎴栨棤闇�鏇存柊锛侊紒");
+                }
+            } else {
+                if (Objects.isNull(matnr)) {
+                    matnr = new Mat();
+                }
+                // 璁㈠崟鏃堕棿
+                if (Utils.isValidFormat(mats.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) {
+                    Date date1 = Utils.getFormateDate(mats.getUpdate_time());
+                    matnr.setUpdateTime(date1);
+                }
+                matnr.setMaktx(mats.getPro_name());
+                matnr.setMatnr(mats.getPro_komcode());
+                matnr.setSpecs(mats.getPro_size());
+                matnr.setWeight(Double.parseDouble(mats.getPro_wet()));
+                matnr.setSuppCode(mats.getPro_id());
+                matnr.setTagId(MatLocType.getTag(mats.getPro_type()));
+                matnr.setLocType(MatLocType.getTag(mats.getPro_type()));
+                matnr.setManu(mats.getCompany_id());
+                if (!matService.insert(matnr)) {
+                    throw new CoolException("鐗╂枡鏇存柊澶辫触锛侊紒");
+                }
+            }
+        });
+
+        return XSR.ok("淇濆瓨鎴愬姛锛侊紒");
+    }
+
+    /**
+     * 鏂板鎴栦慨鏀硅鍗曚俊鎭�
+     *
+     * @author Ryan
+     * @date 2025/11/24 15:32
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void addOrUpdateOrders(PubOrderParams params, String type) {
+        if (Objects.isNull(params)) {
+            throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+        if (Objects.isNull(params.getType())) {
+            throw new CoolException("璁㈠崟绫诲瀷涓嶈兘涓虹┖锛侊紒");
+        }
+        OrderParams orderParams = JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class);
+        // Order order = orderService.selectOne(new
+        // EntityWrapper<Order>().eq("order_no", orderParams.getDispatch_no()));
+        Order order = null;
+        if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+            // 鍏ュ簱
+            order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",
+                    orderParams.getDispatch_no()));
+        } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+            // 鍑哄簱
+            if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) {
+                // 澶囪揣鍗曞嚭搴�
+                order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",
+                        orderParams.getPick_no()));
+            } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType())
+                    || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) {
+                // 澶囪揣鎸囩ず娲惧伐鍗曪紙EO/SO锛夊嚭搴�
+                order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",
+                        orderParams.getDispatch_no()));
+            } else {
+                throw new CoolException("鍗曟嵁绫诲瀷涓嶅瓨鍦紝涓嶆敮鎸佹坊鍔狅紒锛�");
+            }
+        } else {
+            throw new CoolException("鍗曟嵁绫诲瀷涓嶅瓨鍦紝涓嶆敮鎸佹坊鍔狅紒锛�");
+        }
+        // 鍑哄簱
+        if (type.equals("add") && !Objects.isNull(order)) {
+            throw new CoolException("鍗曟嵁宸插瓨鍦�, 涓嶅彲閲嶅娣诲姞锛侊紒");
+        }
+        // 鍒ゆ柇璁㈠崟鏄惁瀛樺湪
+        if (Objects.isNull(order)) {
+            /** 涓嶅瓨鍦紝鏂板璁㈠崟 */
+            generateOrders(params);
+        } else {
+            /** 瀛樺湪锛屽垹闄よ�佽鍗曪紝鏇存柊鎻掑叆鏂拌鍗� */
+            // 鍒犻櫎鏃ц鍗曟槑缁�
+            if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) {
+                throw new CoolException("璁㈠崟鏄庣粏鍒犻櫎澶辫触锛侊紒");
+            }
+
+            if (!orderService.deleteById(order.getId())) {
+                throw new CoolException("鍘熷崟鎹垹闄ゅけ璐ワ紒锛�");
+            }
+            generateOrders(params);
+        }
+    }
+
+    public static String generateUUID(OrderParams params) {
+        return UUID.randomUUID().toString();
+    }
+
+    /**
+     * 鐢熸垚璁㈠崟淇℃伅
+     *
+     * @param params
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void generateOrders(PubOrderParams params) {
+        // 灏嗘暟鎹綋鏂拌鍗曟彃鍏�
+        Order newOrder = new Order();
+        // 娲惧伐鍗曞彿
+        newOrder.setOrderNo(params.getDispatch_no());
+        if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+            // 鍏ュ簱
+            newOrder.setPakinPakoutStatus(1);
+//            Integer docType = OrderWkType.getDocType(params.getType());
+//            newOrder.setDocType(Long.parseLong(docType + ""));
+            newOrder.setNumber(params.getInv_no());
+        } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+            // 鍑哄簱
+            if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) {
+                // 澶囪揣鍗曞嚭搴�
+                newOrder.setOrderNo(params.getPick_no());
+                newOrder.setNumber(params.getDispatch_no());
+                newOrder.setShipCode(params.getOrder_no());
+                newOrder.setCstmrName(params.getCus_id());
+                newOrder.setTel(params.getCus_address());
+//                newOrder.setDocType(Long.parseLong(OrderTypeEnum.STOCK.type + ""));
+            } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType())
+                    || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) {
+                // 澶囪揣鎸囩ず娲惧伐鍗曪紙EO/SO锛夊嚭搴�
+//                newOrder.setDocType(Long.parseLong(OrderTypeEnum.TRANSFER.type + ""));
+            }
+            newOrder.setPakinPakoutStatus(2);
+        }
+
+        newOrder.setUuid(generateUUID(params));
+        // 娴佹按鍙凤紙鍞竴锛�
+        newOrder.setDefNumber(params.getKopen_id());
+//        newOrder.setTargetLocation(params.getTarget_location());
+        // 绠卞彿
+        newOrder.setItemName(params.getPm_tktid());
+//        newOrder.setSettle(OrderSettle.ORDER_SETTLE_HOLDING.type);
+        newOrder.setStatus(CommonEnum.COMMON_ENUM_Y.type);
+        // 璁㈠崟鏃堕棿
+        if (Utils.isValidFormat(params.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) {
+            newOrder.setOrderTime(params.getUpdate_time());
+        }
+        // 鍏徃ID
+        newOrder.setCstmrName(params.getCompany_id());
+        newOrder.setCreateTime(new Date());
+        newOrder.setUpdateTime(new Date());
+        if (!orderService.insert(newOrder)) {
+            throw new RuntimeException("鏂板璁㈠崟澶辫触锛侊紒");
+        }
+        if (!Objects.isNull(params.getDetails()) && !params.getDetails().isEmpty()) {
+            params.getDetails().forEach(item -> {
+                Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", item.getPro_komcode()));
+                if (Objects.isNull(matnr)) {
+                    throw new CoolException("鐗╂枡缂栫爜涓嶅瓨鍦紒锛�");
+                }
+                OrderDetl orderItem = new OrderDetl();
+                BeanUtils.copyProperties(matnr, orderItem);
+                orderItem.setOrderId(newOrder.getId());
+                orderItem.setOrderNo(newOrder.getOrderNo());
+
+                if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+                    // 鍏ュ簱
+                    orderItem.setAnfme(Math.round(item.getInv_qty() * 10000) / 10000.0);
+                } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) {
+                    // 鍑哄簱
+                    if (OrderWkType.ORDER_WK_ORDER_OUT.val.equals(params.getType())) {
+                        // 澶囪揣鍗曞嚭搴�
+                        orderItem.setAnfme(Math.round(item.getPick_qty() * 10000) / 10000.0);
+                    } else if (OrderWkType.ORDER_WK_ORDER_OUT_EO.val.equals(params.getType())
+                            || OrderWkType.ORDER_WK_ORDER_OUT_SO.val.equals(params.getType())) {
+                        // 澶囪揣鎸囩ず娲惧伐鍗曪紙EO/SO锛夊嚭搴�
+                        orderItem.setAnfme(Math.round(item.getOrder_qty() * 10000) / 10000.0);
+                    }
+                }
+                orderItem.setMatnr(matnr.getMatnr());
+                orderItem.setMaktx(matnr.getMaktx());
+                orderItem.setBrand(matnr.getBrand());
+                orderItem.setBatch(1 + "");
+                orderItem.setStandby1(item.getPro_id());
+                // 鍏宠仈涓婂姞娲惧伐鍗曞彿+闆朵欢浠g爜+渚涘簲鍟嗕唬鐮�
+                orderItem.setThreeCode(item.getTotal_serial());
+                // 渚涘簲鍟嗕唬鐮�
+                orderItem.setSuppCode(item.getPro_id());
+                orderItem.setCreateTime(new Date());
+                orderItem.setUpdateTime(new Date());
+                if (!orderDetlService.insert(orderItem)) {
+                    throw new CoolException("璁㈠崟鏄庣粏鏂板澶辫触锛侊紒");
+                }
+            });
+        }
+    }
+
+    /**
+     * 澶囪揣鍗曚笅鍙�
+     *
+     * @param stockUpParams
+     * @return com.core.common.R
+     * @author Ryan
+     * @date 2025/11/24 15:40
+     */
+    @Override
+    public XSR getOutDetails(List<StockUpOrderParams> stockUpParams) {
+        if (Objects.isNull(stockUpParams)) {
+            return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+        stockUpParams.forEach(params -> {
+            if (Objects.isNull(params.getDispatch_no())) {
+                throw new CoolException("娲惧伐鍗曠紪鍙蜂笉鑳戒负绌猴紒锛�");
+            }
+            if (Objects.isNull(params.getKopen_id())) {
+                throw new CoolException("娴佹按鍙蜂笉鑳戒负绌猴紒锛�");
+            }
+            if (Objects.isNull(params.getCompany_id())) {
+                throw new CoolException("鍏徃ID涓嶈兘涓虹┖锛侊紒");
+            }
+            if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) {
+                throw new CoolException("璁㈠崟鏄庣粏涓嶈兘涓虹┖锛侊紒");
+            }
+            List<OrderItemsParam> items = new ArrayList<>();
+            if (params.getDetails() != null) {
+                for (OutOrderParams detail : params.getDetails()) {
+                    if (detail.getPartList() != null) {
+                        items.addAll(detail.getPartList());
+                    }
+                }
+            }
+
+            params.getDetails().forEach(item -> {
+                PubOrderParams pubOrderParams = new PubOrderParams();
+                BeanUtils.copyProperties(params, pubOrderParams);
+                pubOrderParams.setType(item.getType())
+                        .setPick_no(item.getPick_no())
+                        .setCus_address(item.getCus_address())
+                        .setOrder_no(item.getOrder_no())
+                        .setUpdate_time(params.getUpdate_time())
+                        .setCus_id(item.getCus_id());
+                pubOrderParams.setDetails(item.getPartList());
+                addOrUpdateOrders(pubOrderParams, "add");
+            });
+        });
+
+        return XSR.ok("澶囪揣鍗曚笅鍙戞垚鍔燂紒锛�");
+    }
+
+    /**
+     * 鏌ヨWMS搴撳瓨淇℃伅
+     *
+     * @param params
+     * @return com.core.common.R
+     */
+    @Override
+    public XSR getStockInfo(PageRequestParams params) {
+        EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
+        if (!Objects.isNull(params.getPro_id())) {
+            wrapper.eq("supp_code", params.getPro_id());
+        }
+        if (!Objects.isNull(params.getPro_komcode())) {
+            wrapper.eq("matnr", params.getPro_komcode());
+        }
+
+        Page<LocDetl> locDetls = locDetlService.selectPage(new Page<>(params.getCurr(), params.getLimit()),  wrapper);
+
+        return XSR.ok(locDetls.getRecords());
+    }
+
+
+    private String kopen() {
+        return url + ":" + port + prefix;
+    }
+
+}

--
Gitblit v1.9.1