自动化立体仓库 - WMS系统
ZY
2025-05-08 32a905fbf1daeac74cbd573e5b841709c44955c2
代码编写
38个文件已修改
13个文件已删除
2 文件已重命名
1981 ■■■■ 已修改文件
license.lic 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/ReportToThirdService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 321 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/ReportToThirdServiceImpl.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/TagServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/config/ds/DataSourceAop.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/config/ds/DataSourceType.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/DetlDto.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/SendUtil.java 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/entity/NccSaleXsfhmxWms.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/entity/NccScZkmxbWms.java 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/mapper/NccSaleXsfhmxWmsMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/mapper/NccScZkmxbWmsMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/service/NccSaleXsfhmxWmsService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/service/NccScZkmxbWmsService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/service/impl/NccSaleXsfhmxWmsServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/service/impl/NccScZkmxbWmsServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/task/BaseDataTask.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/task/PlanOrderTask.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/task/handler/BaseDataHandler.java 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/util/NcResultMessage.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/nc/vo/SaleOutHeadVO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccBdCustomerWmsMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccCgCgdhdWmsMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccCkPddWmsMapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcBmWmsMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcCkWmsMapper.xml 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcCkhwMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcQilibcBarcodeflowWmsMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcRyWmsMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccJcWlflWmsMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccOrgCorpWmsMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccSaleXsfhmxWmsMapper.xml 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/NccScZkmxbWmsMapper.xml 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/com/zy/nc/mapper/VGetBdMaterialMapper.xml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/license.lic 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccBdCustomerWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccCgCgdhdWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccCkPddWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcBmWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcCkWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcCkhwMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcQilibcBarcodeflowWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcRyWmsMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccJcWlflWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccOrgCorpWmsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccSaleXsfhmxWmsMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/NccScZkmxbWmsMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/nc/VGetBdMaterialMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
license.lic
Binary files differ
src/main/java/com/zy/asrs/service/ReportToThirdService.java
@@ -8,5 +8,5 @@
public interface ReportToThirdService {
    void report(Order order, List<OrderDetl> orderDetls, DocType docType);
    void report(Order order, List<OrderDetl> orderDetls, DocType docType) throws Exception;
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -13,7 +13,6 @@
import com.zy.asrs.service.*;
import com.zy.asrs.utils.MatUtils;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.common.constant.MesConstant;
import com.zy.common.entity.Parameter;
import com.zy.common.model.DetlDto;
import com.zy.common.model.MesCombParam;
@@ -805,167 +804,167 @@
    @Override
    @Transactional
    public void packComb(CombParam param, Long userId) {
        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
            throw new CoolException(BaseRes.PARAM);
        }
        // 判断是否有相同条码的数据
        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
            throw new CoolException(param.getBarcode() + "数据正在进行入库");
        }
        Date now = new Date();
        boolean packDown = Parameter.get().getPackDown().equals("true");
        // 无单组托
        if (Cools.isEmpty(param.getOrderNo())) {
            // 生成入库通知档
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
                // 打包上线数据校验
                if (packDown) {
                    Pack pack = packService.selectByBarcode(elem.getMatnr());
                    if (pack == null) {
                        throw new CoolException(elem.getMatnr() + "条码冗余,请检查!");
                    }
                    if (pack.getSettle() != 1) {
                        throw new CoolException(elem.getMatnr() + "条码已下线,请检查!");
                    }
                }
                Mat analyse = MatUtils.analyseMat(elem.getMatnr());
                // 条码、物料代码、序列号、数量
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),analyse.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
                        elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(),  elem.getAnfme());
//                DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme());
//                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme());
                if (DetlDto.has(detlDtos, detlDto)) {
                    DetlDto one = DetlDto.findDto(detlDtos, detlDto);
                    assert one != null;
                    one.setAnfme(one.getAnfme() + detlDto.getAnfme());
                } else {
                    detlDtos.add(detlDto);
                }
            });
            if (packDown) {
                MesCombParam mesCombParam = new MesCombParam();
                mesCombParam.setZpallet(param.getBarcode());
                mesCombParam.setPakinTime(DateUtils.convert(now));
                mesCombParam.setLgort("5008");
                mesCombParam.setPlantCode("5000");
                mesCombParam.setFromCode("5012-20");
                mesCombParam.setStationCode("JJQ-PFZPDB-XX");
                for (DetlDto detlDto : detlDtos) {
                    mesCombParam.getList().add(new MesCombParam.Detl(detlDto.getOrderNo(), detlDto.getAnfme()));
                }
                String response = "";
                boolean success = false;
                try {
                    response = new HttpHandler.Builder()
                            .setUri(MesConstant.URL)
                            .setPath(MesConstant.PACK_DOWN_URL)
                            .setJson(JSON.toJSONString(mesCombParam))
                            .build()
                            .doPost();
                    JSONObject jsonObject = JSON.parseObject(response);
                    if (jsonObject.getInteger("code").equals(200)) {
                        success = true;
                    } else if (jsonObject.getInteger("code").equals(500)) {
                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response);
                        throw new CoolException(jsonObject.getString("msg"));
                    } else {
                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response);
                        throw new CoolException("上报mes系统失败");
                    }
                } catch (Exception e) {
                    log.error("fail", e);
                    throw new CoolException(e.getMessage());
                } finally {
                    try {
                        // 保存接口日志
                        apiLogService.save(
                                "打包下线帮托上报",
                                MesConstant.URL + MesConstant.PACK_DOWN_URL,
                                null,
                                "127.0.0.1",
                                JSON.toJSONString(mesCombParam),
                                response,
                                success
                        );
                    } catch (Exception e) { log.error("", e); }
                }
            }
            // 生成入库单据
            String orderNo = "PACK" + snowflakeIdWorker.nextId();
            OpenOrderPakinParam openParam = new OpenOrderPakinParam();
            openParam.setOrderNo(orderNo);
            openParam.setOrderTime(DateUtils.convert(now));
            openParam.setOrderType("打包入库单");
            openParam.setOrderDetails(detlDtos);
            openService.pakinOrderCreate(openParam);
//            Order order = orderService.selectByNo(orderNo);
            Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, param.getOrderNo());
            if (null == order) {
                throw new CoolException("生成单据失败");
            }
//            if (!orderService.updateSettle(order.getId(), 2L, userId)) {
//                throw new CoolException("修改单据状态失败");
//            }
            OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId);
            // 生成入库通知档
            for (DetlDto detlDto : detlDtos) {
                // 修改作业数量 ----------------------------------------
                // 订单明细数量校验
//                OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch());
                OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3()
                        ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3());
                if (detlDto.getAnfme() > orderDetl.getEnableQty()) {
                    throw new CoolException(orderDetl.getMatnr() + "入库数量不合法");
                }
                // 修改订单作业数量
//                if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) {
//                    throw new CoolException("修改单据作业数量失败");
//        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
//            throw new CoolException(BaseRes.PARAM);
//        }
//        // 判断是否有相同条码的数据
//        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
//                eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
//            throw new CoolException(param.getBarcode() + "数据正在进行入库");
//        }
//        Date now = new Date();
//
//        boolean packDown = Parameter.get().getPackDown().equals("true");
//
//        // 无单组托
//        if (Cools.isEmpty(param.getOrderNo())) {
//
//            // 生成入库通知档
//            List<DetlDto> detlDtos = new ArrayList<>();
//            param.getCombMats().forEach(elem -> {
//                // 打包上线数据校验
//                if (packDown) {
//                    Pack pack = packService.selectByBarcode(elem.getMatnr());
//                    if (pack == null) {
//                        throw new CoolException(elem.getMatnr() + "条码冗余,请检查!");
//                    }
//                    if (pack.getSettle() != 1) {
//                        throw new CoolException(elem.getMatnr() + "条码已下线,请检查!");
//                    }
//                }
                OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3()
                        ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme());
                // 保存入库通知档
                Mat mat = matService.selectByMatnr(detlDto.getMatnr());
                if (Cools.isEmpty(mat)) {
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
                waitPakin.setOrderNo(orderNo);
                waitPakin.setBatch(detlDto.getBatch());
                waitPakin.setZpallet(param.getBarcode());   // 托盘码
                waitPakin.setIoStatus("N");     // 入出状态
                waitPakin.setAnfme(detlDto.getAnfme());  // 数量
                waitPakin.setStatus("Y");    // 状态
                waitPakin.setAppeUser(userId);
                waitPakin.setAppeTime(now);
                waitPakin.setModiUser(userId);
                waitPakin.setModiTime(now);
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
                }
                // 修改打包数据状态
                Pack pack = packService.selectByBarcode(detlDto.getOrderNo());
                pack.setSettle(2L);
                pack.setUpdateTime(now);
                pack.setUpdateBy(userId);
                if (!packService.updateById(pack)) {
                    throw new CoolException("修改打包数据异常");
                }
            }
        }
//                Mat analyse = MatUtils.analyseMat(elem.getMatnr());
//                // 条码、物料代码、序列号、数量
//                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(),analyse.getBrand(),elem.getStandby1(),elem.getStandby2(),elem.getStandby3(),
//                        elem.getBoxType1(),elem.getBoxType2(),elem.getBoxType3(),  elem.getAnfme());
//
////                DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme());
////                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme());
//                if (DetlDto.has(detlDtos, detlDto)) {
//                    DetlDto one = DetlDto.findDto(detlDtos, detlDto);
//                    assert one != null;
//                    one.setAnfme(one.getAnfme() + detlDto.getAnfme());
//                } else {
//                    detlDtos.add(detlDto);
//                }
//            });
//
//            if (packDown) {
//                MesCombParam mesCombParam = new MesCombParam();
//                mesCombParam.setZpallet(param.getBarcode());
//                mesCombParam.setPakinTime(DateUtils.convert(now));
//                mesCombParam.setLgort("5008");
//                mesCombParam.setPlantCode("5000");
//                mesCombParam.setFromCode("5012-20");
//                mesCombParam.setStationCode("JJQ-PFZPDB-XX");
//                for (DetlDto detlDto : detlDtos) {
//                    mesCombParam.getList().add(new MesCombParam.Detl(detlDto.getOrderNo(), detlDto.getAnfme()));
//                }
//                String response = "";
//                boolean success = false;
//                try {
//                    response = new HttpHandler.Builder()
//                            .setUri(MesConstant.URL)
//                            .setPath(MesConstant.PACK_DOWN_URL)
//                            .setJson(JSON.toJSONString(mesCombParam))
//                            .build()
//                            .doPost();
//                    JSONObject jsonObject = JSON.parseObject(response);
//                    if (jsonObject.getInteger("code").equals(200)) {
//                        success = true;
//                    } else if (jsonObject.getInteger("code").equals(500)) {
//                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response);
//                        throw new CoolException(jsonObject.getString("msg"));
//                    } else {
//                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response);
//                        throw new CoolException("上报mes系统失败");
//                    }
//                } catch (Exception e) {
//                    log.error("fail", e);
//                    throw new CoolException(e.getMessage());
//                } finally {
//                    try {
//                        // 保存接口日志
//                        apiLogService.save(
//                                "打包下线帮托上报",
//                                MesConstant.URL + MesConstant.PACK_DOWN_URL,
//                                null,
//                                "127.0.0.1",
//                                JSON.toJSONString(mesCombParam),
//                                response,
//                                success
//                        );
//                    } catch (Exception e) { log.error("", e); }
//                }
//
//            }
//
//            // 生成入库单据
//            String orderNo = "PACK" + snowflakeIdWorker.nextId();
//            OpenOrderPakinParam openParam = new OpenOrderPakinParam();
//            openParam.setOrderNo(orderNo);
//            openParam.setOrderTime(DateUtils.convert(now));
//            openParam.setOrderType("打包入库单");
//            openParam.setOrderDetails(detlDtos);
//            openService.pakinOrderCreate(openParam);
////            Order order = orderService.selectByNo(orderNo);
//            Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, param.getOrderNo());
//
//            if (null == order) {
//                throw new CoolException("生成单据失败");
//            }
////            if (!orderService.updateSettle(order.getId(), 2L, userId)) {
////                throw new CoolException("修改单据状态失败");
////            }
//            OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId);
//
//            // 生成入库通知档
//            for (DetlDto detlDto : detlDtos) {
//
//                // 修改作业数量 ----------------------------------------
//                // 订单明细数量校验
////                OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch());
//                OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3()
//                        ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3());
//                if (detlDto.getAnfme() > orderDetl.getEnableQty()) {
//                    throw new CoolException(orderDetl.getMatnr() + "入库数量不合法");
//                }
//                // 修改订单作业数量
////                if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) {
////                    throw new CoolException("修改单据作业数量失败");
////                }
//                OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE,order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3()
//                        ,detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme());
//                // 保存入库通知档
//                Mat mat = matService.selectByMatnr(detlDto.getMatnr());
//                if (Cools.isEmpty(mat)) {
//                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
//                }
//                WaitPakin waitPakin = new WaitPakin();
//                waitPakin.sync(mat);
//                waitPakin.setOrderNo(orderNo);
//                waitPakin.setBatch(detlDto.getBatch());
//                waitPakin.setZpallet(param.getBarcode());   // 托盘码
//                waitPakin.setIoStatus("N");     // 入出状态
//                waitPakin.setAnfme(detlDto.getAnfme());  // 数量
//                waitPakin.setStatus("Y");    // 状态
//                waitPakin.setAppeUser(userId);
//                waitPakin.setAppeTime(now);
//                waitPakin.setModiUser(userId);
//                waitPakin.setModiTime(now);
//                if (!waitPakinService.insert(waitPakin)) {
//                    throw new CoolException("保存入库通知档失败");
//                }
//                // 修改打包数据状态
//                Pack pack = packService.selectByBarcode(detlDto.getOrderNo());
//                pack.setSettle(2L);
//                pack.setUpdateTime(now);
//                pack.setUpdateBy(userId);
//                if (!packService.updateById(pack)) {
//                    throw new CoolException("修改打包数据异常");
//                }
//            }
//
//        }
    }
    @Override
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -104,9 +104,9 @@
        List<DetlDto> list = new ArrayList<>();
        List<DetlDto> orderDetails = param.getOrderDetails();
        for (DetlDto detail : orderDetails) {
            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(),detail.getLineNumber(),detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme());
            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getBrand(), detail.getStandby1(), detail.getStandby2(), detail.getStandby3(), detail.getLineNumber(), detail.getBoxType1(), detail.getBoxType2(), detail.getBoxType3(), detail.getAnfme());
            if (DetlDto.hasLineNumber(list, dto)) {
                DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getLineNumber(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3());
                DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(), dto.getBrand(), dto.getStandby1(), dto.getStandby2(), dto.getStandby3(), dto.getLineNumber(), dto.getBoxType1(), dto.getBoxType2(), dto.getBoxType3());
                assert detlDto != null;
                detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme());
            } else {
@@ -161,23 +161,23 @@
                List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
//                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
                for (OrderDetl orderDetl : orderDetls) {
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),
                            orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty()));
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(),
                            orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3(), orderDetl.getQty()));
                }
                if (order.getSettle() == 4L) {
                    // 修改订单状态 4.完成 ===>> 6.已上报
//                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                        throw new CoolException("服务器内部错误,请联系管理员");
//                    }
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(), 6L, null);
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
                }
            }
        } else {
            // 所有订单
//            List<Order> orders = orderService.selectBySettle(4L);
            List<Order> orders = OrderInAndOutUtil.selectBySettle(null, 4L);
            if (orders.isEmpty()){
            if (orders.isEmpty()) {
                orders = new ArrayList<>();
            }
            for (Order order : orders) {
@@ -190,16 +190,16 @@
//                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
                for (OrderDetl orderDetl : orderDetls) {
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),
                            orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(),
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(),
                            orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3(),
                            orderDetl.getQty()));
                }
//                // 修改订单状态 4.完成 ===>> 6.已上报
//                if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                    throw new CoolException("服务器内部错误,请联系管理员");
//                }
                OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
                OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
            }
        }
@@ -264,11 +264,11 @@
        List<DetlDto> list = new ArrayList<>();
        List<DetlDto> orderDetails = param.getOrderDetails();
        for (DetlDto detail : orderDetails) {
            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(),detail.getLineNumber(),
                    detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme());
            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getBrand(), detail.getStandby1(), detail.getStandby2(), detail.getStandby3(), detail.getLineNumber(),
                    detail.getBoxType1(), detail.getBoxType2(), detail.getBoxType3(), detail.getAnfme());
            if (DetlDto.hasLineNumber(list, dto)) {
                DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getLineNumber(),
                        dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3());
                DetlDto detlDto = DetlDto.findLineNumber(list, dto.getMatnr(), dto.getBatch(), dto.getBrand(), dto.getStandby1(), dto.getStandby2(), dto.getStandby3(), dto.getLineNumber(),
                        dto.getBoxType1(), dto.getBoxType2(), dto.getBoxType3());
                assert detlDto != null;
                detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme());
            } else {
@@ -321,15 +321,15 @@
//                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(),order.getId());
                for (OrderDetl orderDetl : orderDetls) {
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(),
                            orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty()));
                            orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3(), orderDetl.getQty()));
                }
                if (order.getSettle() == 4L) {
                    // 修改订单状态 4.完成 ===>> 6.已上报
//                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                        throw new CoolException("服务器内部错误,请联系管理员");
//                    }
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
                    OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
                }
            }
        } else {
@@ -345,15 +345,15 @@
                List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
//                List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
                for (OrderDetl orderDetl : orderDetls) {
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getBrand(),
                            orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3(), orderDetl.getQty()));
                    result.getOrderDetails().add(new DetlDto(orderDetl.getOrderNo(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(),
                            orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getLineNumber(),
                            orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3(), orderDetl.getQty()));
                }
                // 修改订单状态 4.完成 ===>> 6.已上报
//                if (!orderService.updateSettle(order.getId(), 6L, null)) {
//                    throw new CoolException("服务器内部错误,请联系管理员");
//                }
                OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
                OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
            }
        }
        return results;
@@ -483,12 +483,12 @@
    @Override
    @Transactional
    public void syncMat(MatSyncParam param) {
        if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <=0 ) {
        if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <= 0) {
            throw new CoolException("商品数据为空");
        }
        for(MatSyncParam.MatParam matParam : param.getMatDetails()){
            if(Cools.isEmpty(matParam.getMatnr())){
        for (MatSyncParam.MatParam matParam : param.getMatDetails()) {
            if (Cools.isEmpty(matParam.getMatnr())) {
                throw new CoolException("商品编码不能为空");
            }
@@ -500,7 +500,7 @@
                Long tagId;
                // 一级分类
                if (!Cools.isEmpty(matParam.getGroupCode()) && !Cools.isEmpty(matParam.getGroupName())) {
                    Tag priTag = tagService.selectByName(matParam.getGroupCode(), 2);
                    Tag priTag = tagService.selectOne(new EntityWrapper<Tag>().eq("name", matParam.getGroupCode()));
                    if (priTag == null) {
                        Tag top = tagService.getTop();
                        NodeUtils nodeUtils = new NodeUtils();
@@ -565,10 +565,6 @@
                    tagId = tagService.getTop().getId();
                }
                mat.sync(matParam);
//            mat.setMatnr(param.getMatnr());
//            mat.setMaktx(param.getMaktx());
//            mat.setSpecs(param.getSpecs());
//            mat.setModel(param.getModel());
                mat.setTagId(tagId);
                mat.setStatus(1);
@@ -581,7 +577,7 @@
                }
            } else {
                mat.sync(matParam);
                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) {
                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", matParam.getMatnr()))) {
                    throw new CoolException("更新已存在商品信息失败,请联系管理员");
                }
            }
src/main/java/com/zy/asrs/service/impl/ReportToThirdServiceImpl.java
@@ -10,14 +10,18 @@
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.OrderService;
import com.zy.asrs.service.ReportToThirdService;
import com.zy.common.utils.HttpHandler;
import com.zy.nc.SendUtil;
import com.zy.nc.util.NcResultMessage;
import com.zy.nc.vo.SaleOutBodyVO;
import com.zy.nc.vo.SaleOutHeadVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
@@ -42,62 +46,70 @@
    @Override
    public void report(Order order, List<OrderDetl> orderDetls, DocType docType) {
        Boolean http = false;
        switch (order.getDocType().toString()) {
            case "销售发货":
                http = http("", docType.getDocName(), nyncIp + port, saveRefDelivery);
                if (Cools.isEmpty(order.getShipCode()) || order.getShipCode().equalsIgnoreCase("1")) {
                }
                break;
            case "产成品入库":
                break;
            case "辅料采购入库":
                break;
            case "辅料及成品转库":
                break;
            case "自动包装入库":
                break;
            case "内部调拨":
                break;
            default:
                break;
        }
        if (http) {
            // 修改订单状态 4.完成 ===>> 6.已上报
            if (!orderService.updateSettle(order.getId(), 6L, null)) {
                throw new CoolException("服务器内部错误,请联系管理员");
        NcResultMessage response = null;
        try {
            switch (order.getDocType().toString()) {
                case "销售发货":
                    //组装对象数据
                    Map<String, Object> data = new HashMap<String, Object>();
                    SaleOutHeadVO saleOutHeadVO = new SaleOutHeadVO();
                    saleOutHeadVO.setPk_org("FYT");
                    saleOutHeadVO.setCwarehouseid("6101");
                    SaleOutBodyVO saleOutBodyVO = null;
                    for (OrderDetl orderDetl : orderDetls) {
                        saleOutBodyVO = new SaleOutBodyVO();
                        saleOutBodyVO.setCsourcebillhid("1001A1100000027XNSH2");
                        saleOutBodyVO.setCsourcebillbid("1001A1100000027YFC8U");
                        saleOutBodyVO.setCsourcetype("4331-01");
                    }
                    data.put("saleOutHeadVO", saleOutHeadVO);
                    data.put("saleOutBodyVO", saleOutBodyVO);
                    //发送请求
                    response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + port, saveRefDelivery, JSONObject.toJSONString(data));
                    if (!Cools.isEmpty(response) && response.isSuccess()) {
                        log.info("response:{}", response);
                        http = true;
                    }
                    break;
                case "产成品入库":
                    break;
                case "辅料采购入库":
                    break;
                case "辅料及成品转库":
                    break;
                case "自动包装入库":
                    break;
                case "内部调拨":
                    break;
                default:
                    break;
            }
            if (http) {
                // 修改订单状态 4.完成 ===>> 6.已上报
                if (!orderService.updateSettle(order.getId(), 6L, null)) {
                    throw new CoolException("服务器内部错误,请联系管理员");
                }
            }
        } catch (Exception e) {
            throw new CoolException("调用接口报错,请联系管理员");
        } finally {
            reportApiLog(response, order.getDocType$(), nyncIp, saveRefDelivery);
        }
    }
    private Boolean http(Object data, String docType, String url, String path) {
    private Boolean reportApiLog(Object data, String docType, String url, String path) {
        String response = "";
        boolean success = false;
        try {
            response = new HttpHandler.Builder()
                    .setUri(url)
                    .setPath(path)
                    .setJson(JSON.toJSONString(data))
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger("code").equals(1)) {
                return true;
            }
            log.error("请求接口失败!!!url:{};request:{};response:{}", url + path, JSON.toJSONString(data), response);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            apiLogService.save(
                    docType,
                    url + path,
                    null,
                    "127.0.0.1",
                    JSON.toJSONString(data),
                    response,
                    success
            );
        }
        apiLogService.save(
                docType,
                url + path,
                null,
                "127.0.0.1",
                JSON.toJSONString(data),
                response,
                success
        );
        return false;
    }
}
src/main/java/com/zy/asrs/service/impl/TagServiceImpl.java
@@ -33,4 +33,6 @@
    public Tag selectByName(String name, Integer level) {
        return this.selectOne(new EntityWrapper<Tag>().eq("name", name).eq("level", level));
    }
}
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -1,25 +1,24 @@
package com.zy.asrs.task.handler;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.DocType;
import com.zy.asrs.entity.Order;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.service.*;
import com.zy.asrs.service.DocTypeService;
import com.zy.asrs.service.OrderDetlService;
import com.zy.asrs.service.OrderService;
import com.zy.asrs.service.ReportToThirdService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.common.model.DetlDto;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -168,7 +167,11 @@
            return SUCCESS;
        }
        List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
        reportToThirdService.report(order, orderDetls, docType);
        try {
            reportToThirdService.report(order, orderDetls, docType);
        } catch (Exception e) {
            return FAIL;
        }
        return SUCCESS;
    }
src/main/java/com/zy/common/config/ds/DataSourceAop.java
@@ -9,19 +9,19 @@
public class DataSourceAop {
    @Before("execution(* com.zy.asrs..*(..))")
    public void setDataSource2test01() {
        System.err.println("test01业务");
        //System.err.println("test01业务");
        DataSourceType.setDataBaseType(DataSourceType.DataBaseType.TEST01);
    }
    @Before("execution(* com.zy.system..*(..))")
    public void setDataSource2test012() {
        System.err.println("test01业务");
        //System.err.println("test01业务");
        DataSourceType.setDataBaseType(DataSourceType.DataBaseType.TEST01);
    }
    @Before("execution(* com.zy.nc..*(..))")
    public void setDataSource2test02() {
        System.err.println("test02业务");
        //System.err.println("test02业务");
        DataSourceType.setDataBaseType(DataSourceType.DataBaseType.TEST02);
    }
}
src/main/java/com/zy/common/config/ds/DataSourceType.java
@@ -14,14 +14,14 @@
        if (dataBaseType == null) {
            throw new NullPointerException();
        }
        System.err.println("[将当前数据源改为]:" + dataBaseType);
        //System.err.println("[将当前数据源改为]:" + dataBaseType);
        TYPE.set(dataBaseType);
    }
    // 获取数据源类型
    public static DataBaseType getDataBaseType() {
        DataBaseType dataBaseType = TYPE.get() == null ? DataBaseType.TEST01 : TYPE.get();
        System.err.println("[获取当前数据源的类型为]:" + dataBaseType);
        //System.err.println("[获取当前数据源的类型为]:" + dataBaseType);
        return dataBaseType;
    }
src/main/java/com/zy/common/model/DetlDto.java
@@ -27,9 +27,9 @@
    private Long lineNumber = 1L;
    private String boxType1 = "1";
    private String boxType2 = "1";
    private String boxType3 = "1";
    private String boxType1 = "";
    private String boxType2 = "";
    private String boxType3 = "";
    private Double anfme;
@@ -133,7 +133,7 @@
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())
                    && Cools.eq(dto.getBoxType1(), orderDetl.getBoxType1()) && Cools.eq(dto.getBoxType2(), orderDetl.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3())) {
                return true;
            }
//                }
@@ -159,7 +159,7 @@
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())
                    && dto.getLineNumber().equals(orderDetl.getLineNumber())
                    && Cools.eq(dto.getBoxType1(), orderDetl.getBoxType1()) && Cools.eq(dto.getBoxType2(), orderDetl.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3())) {
                return true;
            }
//                }
@@ -174,7 +174,7 @@
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())
                    && Cools.eq(dto.getBoxType1(), orderDetl.getBoxType1()) && Cools.eq(dto.getBoxType2(), orderDetl.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3())) {
                return true;
            }
        }
@@ -187,7 +187,7 @@
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())
                    && Cools.eq(dto.getBoxType1(), orderDetl.getBoxType1()) && Cools.eq(dto.getBoxType2(), orderDetl.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), orderDetl.getBoxType3())) {
                return true;
            }
        }
@@ -200,7 +200,7 @@
                    && Cools.eq(dto.getBrand(), detlDto.getBrand()) && Cools.eq(dto.getStandby1(), detlDto.getStandby1())
                    && Cools.eq(dto.getStandby2(), detlDto.getStandby2()) && Cools.eq(dto.getStandby3(), detlDto.getStandby3())
                    && Cools.eq(dto.getBoxType1(), detlDto.getBoxType1()) && Cools.eq(dto.getBoxType2(), detlDto.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), detlDto.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), detlDto.getBoxType3())) {
                return true;
            }
        }
@@ -214,7 +214,7 @@
                    && Cools.eq(dto.getStandby2(), detlDto.getStandby2()) && Cools.eq(dto.getStandby3(), detlDto.getStandby3())
                    && dto.getLineNumber().equals(detlDto.getLineNumber())
                    && Cools.eq(dto.getBoxType1(), detlDto.getBoxType1()) && Cools.eq(dto.getBoxType2(), detlDto.getBoxType2())
                    && Cools.eq(dto.getBoxType3(), detlDto.getBoxType3()) ) {
                    && Cools.eq(dto.getBoxType3(), detlDto.getBoxType3())) {
                return true;
            }
        }
@@ -237,7 +237,7 @@
        return null;
    }
    public static DetlDto findLineNumber(List<DetlDto> detlDtos, String matnr, String batch, String brand, String standby1, String standby2, String standby3,Long lineNumber, String boxType1, String boxType2, String boxType3) {
    public static DetlDto findLineNumber(List<DetlDto> detlDtos, String matnr, String batch, String brand, String standby1, String standby2, String standby3, Long lineNumber, String boxType1, String boxType2, String boxType3) {
        if (Cools.isEmpty(matnr)) {
            return null;
        }
@@ -254,7 +254,7 @@
        return null;
    }
    public static DetlDto findDto(List<DetlDto> detlDtos,DetlDto detlDtoB) {
    public static DetlDto findDto(List<DetlDto> detlDtos, DetlDto detlDtoB) {
        if (Cools.isEmpty(detlDtoB)) {
            return null;
        }
src/main/java/com/zy/nc/SendUtil.java
File was renamed from src/main/java/com/zy/nc/Test.java
@@ -21,7 +21,7 @@
 * @author lizhmf
 * @date 2019年6月20日上午10:53:11
 */
public class Test {
public class SendUtil {
    // app_secret
    private static String client_secret = null;
@@ -70,10 +70,88 @@
            }
            System.out.println("getTokenData:" + token);
            // 测试openapi
            testApi(token);
            //sendDataToNc(token);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 请求openapi
     *
     * @param token
     * @throws Exception
     */
    public static NcResultMessage sendDataToNc(String token, String baseUrl, String apiUrl, String requestBody) {
        if (token == null) {
            try {
                token = getToken();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        // token转对象,获取api访问所用token和secret
        NcResultMessage returnData = JSONObject.parseObject(token, NcResultMessage.class);
        if (returnData.isSuccess()) {
            JSONObject data = JSONObject.parseObject(returnData.getData().toString());
            String access_token = (String) data.get("access_token");
            String security_key = (String) data.get("security_key");
            String refresh_token = (String) data.get("refresh_token");
            Long expire_in = data.getLong("expires_in");
            Long ts = data.getLong("ts");
            if (ts + expire_in < System.currentTimeMillis()) {
                try {
                    token = getToken();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                data = JSONObject.parseObject(token.getBytes(), NcResultMessage.class);
                access_token = (String) data.get("access_token");
                security_key = (String) data.get("security_key");
                refresh_token = (String) data.get("refresh_token");
            }
            System.out.println("【ACCESS_TOKEN】:" + access_token);
            // 请求路径
            String url = baseUrl + apiUrl;
            // header 参数
            Map<String, String> headermap = new HashMap<>();
            headermap.put("access_token", access_token);
            headermap.put("client_id", client_id);
            StringBuffer sb = new StringBuffer();
            sb.append(client_id);
            if (!Cools.isEmpty(requestBody)) {
                // sb.append(requestBody.replaceAll("\\s*|\t|\r|\n", "").trim());
                sb.append(requestBody);
            }
            sb.append(pubKey);
            String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
            headermap.put("signature", sign);
            if (!Cools.isEmpty(busi_id)) {
                headermap.put("busi_id", busi_id);
            }
            if (!Cools.isEmpty(repeat_check)) {
                headermap.put("repeat_check", repeat_check);
            }
            //        headermap.put("ucg_flag", "y");
            String mediaType = "application/json;charset=utf-8";
            // 表体数据json
            // 根据安全级别选择加密或压缩请求表体参数
            String json = null;
            String result;
            String result2;
            try {
                json = dealRequestBody(requestBody, security_key, secret_level);
                // 返回值
                result = doPost(url, null, mediaType, headermap, json);
                result2 = dealResponseBody(result, security_key, secret_level);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            System.out.println("【RESULT】:" + result);
            System.out.println("result解密:" + result2);
            return JSONObject.parseObject(result2, NcResultMessage.class);
        }
        return null;
    }
    /**
@@ -161,68 +239,6 @@
        return token;
    }
    /**
     * 请求openapi
     *
     * @param token
     * @throws Exception
     */
    private static void testApi(String token) throws Exception {
        // token转对象,获取api访问所用token和secret
        ResultMessageUtil returnData = JSONObject.parseObject(token, ResultMessageUtil.class);
        Map<String, Object> data = (Map<String, Object>) returnData.getData();
        String access_token = (String) data.get("access_token");
        String security_key = (String) data.get("security_key");
        String refresh_token = (String) data.get("refresh_token");
        long expire_in = new Double((double) data.get("expires_in")).longValue();
        long ts = new Double((double) data.get("ts")).longValue();
        if (ts + expire_in < System.currentTimeMillis()) {
            token = getToken();
            returnData = JSONObject.parseObject(token, ResultMessageUtil.class);
            data = (Map<String, Object>) returnData.getData();
            access_token = (String) data.get("access_token");
            security_key = (String) data.get("security_key");
            refresh_token = (String) data.get("refresh_token");
        }
        System.out.println("【ACCESS_TOKEN】:" + access_token);
        // 请求路径
        String url = baseUrl + apiUrl;
        // header 参数
        Map<String, String> headermap = new HashMap<>();
        headermap.put("access_token", access_token);
        headermap.put("client_id", client_id);
        StringBuffer sb = new StringBuffer();
        sb.append(client_id);
        if (!Cools.isEmpty(requestBody)) {
            // sb.append(requestBody.replaceAll("\\s*|\t|\r|\n", "").trim());
            sb.append(requestBody);
        }
        sb.append(pubKey);
        String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
        headermap.put("signature", sign);
        if (!Cools.isEmpty(busi_id)) {
            headermap.put("busi_id", busi_id);
        }
        if (!Cools.isEmpty(repeat_check)) {
            headermap.put("repeat_check", repeat_check);
        }
//        headermap.put("ucg_flag", "y");
        String mediaType = "application/json;charset=utf-8";
        // 表体数据json
        // 根据安全级别选择加密或压缩请求表体参数
        String json = dealRequestBody(requestBody, security_key, secret_level);
        // 返回值
        String result = doPost(url, null, mediaType, headermap, json);
        String result2 = dealResponseBody(result, security_key, secret_level);
        System.out.println("【RESULT】:" + result);
        System.out.println("result解密:" + result2);
    }
    /**
     * 返回值进行过加密和压缩,对返回值进行解压和解密
src/main/java/com/zy/nc/entity/NccSaleXsfhmxWms.java
@@ -177,7 +177,7 @@
    /**
     * 
     */
    private BigDecimal nastnum;
    private Double nastnum;
    /**
     * 
src/main/java/com/zy/nc/entity/NccScZkmxbWms.java
@@ -1,289 +1,308 @@
package com.zy.nc.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 *
 * @TableName ncc_sc_zkmxb_wms
 */
@TableName(value ="ncc_sc_zkmxb_wms")
@TableName(value = "ncc_sc_zkmxb_wms")
@Data
public class NccScZkmxbWms {
    /**
     *
     *
     */
    @TableId
    private String cspecialbid;
    /**
     *
     *
     */
    private String vbillcode;
    /**
     *
     *
     */
    private String dmakedate;
    /**
     *
     *
     */
    private Date scdmakedate;
    /**
     *
     *
     */
    private String dbilldate;
    /**
     *
     *
     */
    private String taudittime;
    /**
     *
     *
     */
    private String zzbm;
    /**
     *
     *
     */
    private String zzmc;
    /**
     *
     *
     */
    private String ckzzbm;
    /**
     *
     *
     */
    private String ckzzmc;
    /**
     *
     *
     */
    private String ckssbcode;
    /**
     *
     *
     */
    private String cksssyb;
    /**
     *
     *
     */
    private String ckckbm;
    /**
     *
     *
     */
    private String ckckmc;
    /**
     *
     *
     */
    private String ckbmbm;
    /**
     *
     *
     */
    private String ckbmmc;
    /**
     *
     *
     */
    private String rkzzbm;
    /**
     *
     *
     */
    private String rkzzmc;
    /**
     *
     *
     */
    private String rkssbcode;
    /**
     *
     *
     */
    private String rksssyb;
    /**
     *
     *
     */
    private String rkckbm;
    /**
     *
     *
     */
    private String rkckmc;
    /**
     *
     *
     */
    private String rkbmbm;
    /**
     *
     *
     */
    private String rkbmmc;
    /**
     *
     *
     */
    private Long djzt;
    /**
     *
     *
     */
    private String zklx;
    /**
     *
     *
     */
    private String wlbm;
    /**
     *
     *
     */
    private String wlmc;
    /**
     *
     *
     */
    private String wlgg;
    /**
     *
     *
     */
    private String wlxh;
    /**
     *
     *
     */
    private String wljc;
    /**
     *
     *
     */
    private String jbflbm;
    /**
     *
     *
     */
    private String jbflmc;
    /**
     *
     *
     */
    private String sjflbm;
    /**
     *
     *
     */
    private String sjflmc;
    /**
     *
     *
     */
    private String zsjflbm;
    /**
     *
     *
     */
    private String zsjflmc;
    /**
     *
     *
     */
    private String zdw;
    /**
     *
     *
     */
    private String fdw;
    /**
     *
     *
     */
    private String kczt;
    /**
     *
     *
     */
    private String vbatchcode;
    /**
     *
     *
     */
    private String vdef1;
    /**
     *
     *
     */
    private String vdef2;
    /**
     *
     *
     */
    private String vdef3;
    /**
     *
     *
     */
    private String khbm;
    /**
     *
     *
     */
    private String khmc;
    /**
     *
     *
     */
    private String khjc;
    /**
     *
     *
     */
    private BigDecimal yzzsl;
    /**
     *
     *
     */
    private BigDecimal yzfsl;
    /**
     *
     *
     */
    private BigDecimal ljckzsl;
    /**
     *
     *
     */
    private BigDecimal ljrkzsl;
    /**
     *
     *
     */
    private Integer dr;
    /**
     *
     *
     */
    private String ts;
    /**
     *
     *
     */
    private Integer wmsFlag;
    /**
     *
     */
    private Double yingzsl;
    /**
     *
     */
    private Double yingzzsl;
    /**
     *
     */
    private Integer bdr;
    /**
     *
     */
    private String bts;
    @Override
    public boolean equals(Object that) {
@@ -297,60 +316,7 @@
            return false;
        }
        NccScZkmxbWms other = (NccScZkmxbWms) that;
        return (this.getCspecialbid() == null ? other.getCspecialbid() == null : this.getCspecialbid().equals(other.getCspecialbid()))
            && (this.getVbillcode() == null ? other.getVbillcode() == null : this.getVbillcode().equals(other.getVbillcode()))
            && (this.getDmakedate() == null ? other.getDmakedate() == null : this.getDmakedate().equals(other.getDmakedate()))
            && (this.getScdmakedate() == null ? other.getScdmakedate() == null : this.getScdmakedate().equals(other.getScdmakedate()))
            && (this.getDbilldate() == null ? other.getDbilldate() == null : this.getDbilldate().equals(other.getDbilldate()))
            && (this.getTaudittime() == null ? other.getTaudittime() == null : this.getTaudittime().equals(other.getTaudittime()))
            && (this.getZzbm() == null ? other.getZzbm() == null : this.getZzbm().equals(other.getZzbm()))
            && (this.getZzmc() == null ? other.getZzmc() == null : this.getZzmc().equals(other.getZzmc()))
            && (this.getCkzzbm() == null ? other.getCkzzbm() == null : this.getCkzzbm().equals(other.getCkzzbm()))
            && (this.getCkzzmc() == null ? other.getCkzzmc() == null : this.getCkzzmc().equals(other.getCkzzmc()))
            && (this.getCkssbcode() == null ? other.getCkssbcode() == null : this.getCkssbcode().equals(other.getCkssbcode()))
            && (this.getCksssyb() == null ? other.getCksssyb() == null : this.getCksssyb().equals(other.getCksssyb()))
            && (this.getCkckbm() == null ? other.getCkckbm() == null : this.getCkckbm().equals(other.getCkckbm()))
            && (this.getCkckmc() == null ? other.getCkckmc() == null : this.getCkckmc().equals(other.getCkckmc()))
            && (this.getCkbmbm() == null ? other.getCkbmbm() == null : this.getCkbmbm().equals(other.getCkbmbm()))
            && (this.getCkbmmc() == null ? other.getCkbmmc() == null : this.getCkbmmc().equals(other.getCkbmmc()))
            && (this.getRkzzbm() == null ? other.getRkzzbm() == null : this.getRkzzbm().equals(other.getRkzzbm()))
            && (this.getRkzzmc() == null ? other.getRkzzmc() == null : this.getRkzzmc().equals(other.getRkzzmc()))
            && (this.getRkssbcode() == null ? other.getRkssbcode() == null : this.getRkssbcode().equals(other.getRkssbcode()))
            && (this.getRksssyb() == null ? other.getRksssyb() == null : this.getRksssyb().equals(other.getRksssyb()))
            && (this.getRkckbm() == null ? other.getRkckbm() == null : this.getRkckbm().equals(other.getRkckbm()))
            && (this.getRkckmc() == null ? other.getRkckmc() == null : this.getRkckmc().equals(other.getRkckmc()))
            && (this.getRkbmbm() == null ? other.getRkbmbm() == null : this.getRkbmbm().equals(other.getRkbmbm()))
            && (this.getRkbmmc() == null ? other.getRkbmmc() == null : this.getRkbmmc().equals(other.getRkbmmc()))
            && (this.getDjzt() == null ? other.getDjzt() == null : this.getDjzt().equals(other.getDjzt()))
            && (this.getZklx() == null ? other.getZklx() == null : this.getZklx().equals(other.getZklx()))
            && (this.getWlbm() == null ? other.getWlbm() == null : this.getWlbm().equals(other.getWlbm()))
            && (this.getWlmc() == null ? other.getWlmc() == null : this.getWlmc().equals(other.getWlmc()))
            && (this.getWlgg() == null ? other.getWlgg() == null : this.getWlgg().equals(other.getWlgg()))
            && (this.getWlxh() == null ? other.getWlxh() == null : this.getWlxh().equals(other.getWlxh()))
            && (this.getWljc() == null ? other.getWljc() == null : this.getWljc().equals(other.getWljc()))
            && (this.getJbflbm() == null ? other.getJbflbm() == null : this.getJbflbm().equals(other.getJbflbm()))
            && (this.getJbflmc() == null ? other.getJbflmc() == null : this.getJbflmc().equals(other.getJbflmc()))
            && (this.getSjflbm() == null ? other.getSjflbm() == null : this.getSjflbm().equals(other.getSjflbm()))
            && (this.getSjflmc() == null ? other.getSjflmc() == null : this.getSjflmc().equals(other.getSjflmc()))
            && (this.getZsjflbm() == null ? other.getZsjflbm() == null : this.getZsjflbm().equals(other.getZsjflbm()))
            && (this.getZsjflmc() == null ? other.getZsjflmc() == null : this.getZsjflmc().equals(other.getZsjflmc()))
            && (this.getZdw() == null ? other.getZdw() == null : this.getZdw().equals(other.getZdw()))
            && (this.getFdw() == null ? other.getFdw() == null : this.getFdw().equals(other.getFdw()))
            && (this.getKczt() == null ? other.getKczt() == null : this.getKczt().equals(other.getKczt()))
            && (this.getVbatchcode() == null ? other.getVbatchcode() == null : this.getVbatchcode().equals(other.getVbatchcode()))
            && (this.getVdef1() == null ? other.getVdef1() == null : this.getVdef1().equals(other.getVdef1()))
            && (this.getVdef2() == null ? other.getVdef2() == null : this.getVdef2().equals(other.getVdef2()))
            && (this.getVdef3() == null ? other.getVdef3() == null : this.getVdef3().equals(other.getVdef3()))
            && (this.getKhbm() == null ? other.getKhbm() == null : this.getKhbm().equals(other.getKhbm()))
            && (this.getKhmc() == null ? other.getKhmc() == null : this.getKhmc().equals(other.getKhmc()))
            && (this.getKhjc() == null ? other.getKhjc() == null : this.getKhjc().equals(other.getKhjc()))
            && (this.getYzzsl() == null ? other.getYzzsl() == null : this.getYzzsl().equals(other.getYzzsl()))
            && (this.getYzfsl() == null ? other.getYzfsl() == null : this.getYzfsl().equals(other.getYzfsl()))
            && (this.getLjckzsl() == null ? other.getLjckzsl() == null : this.getLjckzsl().equals(other.getLjckzsl()))
            && (this.getLjrkzsl() == null ? other.getLjrkzsl() == null : this.getLjrkzsl().equals(other.getLjrkzsl()))
            && (this.getDr() == null ? other.getDr() == null : this.getDr().equals(other.getDr()))
            && (this.getTs() == null ? other.getTs() == null : this.getTs().equals(other.getTs()))
            && (this.getWmsFlag() == null ? other.getWmsFlag() == null : this.getWmsFlag().equals(other.getWmsFlag()));
        return (this.getCspecialbid() == null ? other.getCspecialbid() == null : this.getCspecialbid().equals(other.getCspecialbid())) && (this.getVbillcode() == null ? other.getVbillcode() == null : this.getVbillcode().equals(other.getVbillcode())) && (this.getDmakedate() == null ? other.getDmakedate() == null : this.getDmakedate().equals(other.getDmakedate())) && (this.getScdmakedate() == null ? other.getScdmakedate() == null : this.getScdmakedate().equals(other.getScdmakedate())) && (this.getDbilldate() == null ? other.getDbilldate() == null : this.getDbilldate().equals(other.getDbilldate())) && (this.getTaudittime() == null ? other.getTaudittime() == null : this.getTaudittime().equals(other.getTaudittime())) && (this.getZzbm() == null ? other.getZzbm() == null : this.getZzbm().equals(other.getZzbm())) && (this.getZzmc() == null ? other.getZzmc() == null : this.getZzmc().equals(other.getZzmc())) && (this.getCkzzbm() == null ? other.getCkzzbm() == null : this.getCkzzbm().equals(other.getCkzzbm())) && (this.getCkzzmc() == null ? other.getCkzzmc() == null : this.getCkzzmc().equals(other.getCkzzmc())) && (this.getCkssbcode() == null ? other.getCkssbcode() == null : this.getCkssbcode().equals(other.getCkssbcode())) && (this.getCksssyb() == null ? other.getCksssyb() == null : this.getCksssyb().equals(other.getCksssyb())) && (this.getCkckbm() == null ? other.getCkckbm() == null : this.getCkckbm().equals(other.getCkckbm())) && (this.getCkckmc() == null ? other.getCkckmc() == null : this.getCkckmc().equals(other.getCkckmc())) && (this.getCkbmbm() == null ? other.getCkbmbm() == null : this.getCkbmbm().equals(other.getCkbmbm())) && (this.getCkbmmc() == null ? other.getCkbmmc() == null : this.getCkbmmc().equals(other.getCkbmmc())) && (this.getRkzzbm() == null ? other.getRkzzbm() == null : this.getRkzzbm().equals(other.getRkzzbm())) && (this.getRkzzmc() == null ? other.getRkzzmc() == null : this.getRkzzmc().equals(other.getRkzzmc())) && (this.getRkssbcode() == null ? other.getRkssbcode() == null : this.getRkssbcode().equals(other.getRkssbcode())) && (this.getRksssyb() == null ? other.getRksssyb() == null : this.getRksssyb().equals(other.getRksssyb())) && (this.getRkckbm() == null ? other.getRkckbm() == null : this.getRkckbm().equals(other.getRkckbm())) && (this.getRkckmc() == null ? other.getRkckmc() == null : this.getRkckmc().equals(other.getRkckmc())) && (this.getRkbmbm() == null ? other.getRkbmbm() == null : this.getRkbmbm().equals(other.getRkbmbm())) && (this.getRkbmmc() == null ? other.getRkbmmc() == null : this.getRkbmmc().equals(other.getRkbmmc())) && (this.getDjzt() == null ? other.getDjzt() == null : this.getDjzt().equals(other.getDjzt())) && (this.getZklx() == null ? other.getZklx() == null : this.getZklx().equals(other.getZklx())) && (this.getWlbm() == null ? other.getWlbm() == null : this.getWlbm().equals(other.getWlbm())) && (this.getWlmc() == null ? other.getWlmc() == null : this.getWlmc().equals(other.getWlmc())) && (this.getWlgg() == null ? other.getWlgg() == null : this.getWlgg().equals(other.getWlgg())) && (this.getWlxh() == null ? other.getWlxh() == null : this.getWlxh().equals(other.getWlxh())) && (this.getWljc() == null ? other.getWljc() == null : this.getWljc().equals(other.getWljc())) && (this.getJbflbm() == null ? other.getJbflbm() == null : this.getJbflbm().equals(other.getJbflbm())) && (this.getJbflmc() == null ? other.getJbflmc() == null : this.getJbflmc().equals(other.getJbflmc())) && (this.getSjflbm() == null ? other.getSjflbm() == null : this.getSjflbm().equals(other.getSjflbm())) && (this.getSjflmc() == null ? other.getSjflmc() == null : this.getSjflmc().equals(other.getSjflmc())) && (this.getZsjflbm() == null ? other.getZsjflbm() == null : this.getZsjflbm().equals(other.getZsjflbm())) && (this.getZsjflmc() == null ? other.getZsjflmc() == null : this.getZsjflmc().equals(other.getZsjflmc())) && (this.getZdw() == null ? other.getZdw() == null : this.getZdw().equals(other.getZdw())) && (this.getFdw() == null ? other.getFdw() == null : this.getFdw().equals(other.getFdw())) && (this.getKczt() == null ? other.getKczt() == null : this.getKczt().equals(other.getKczt())) && (this.getVbatchcode() == null ? other.getVbatchcode() == null : this.getVbatchcode().equals(other.getVbatchcode())) && (this.getVdef1() == null ? other.getVdef1() == null : this.getVdef1().equals(other.getVdef1())) && (this.getVdef2() == null ? other.getVdef2() == null : this.getVdef2().equals(other.getVdef2())) && (this.getVdef3() == null ? other.getVdef3() == null : this.getVdef3().equals(other.getVdef3())) && (this.getKhbm() == null ? other.getKhbm() == null : this.getKhbm().equals(other.getKhbm())) && (this.getKhmc() == null ? other.getKhmc() == null : this.getKhmc().equals(other.getKhmc())) && (this.getKhjc() == null ? other.getKhjc() == null : this.getKhjc().equals(other.getKhjc())) && (this.getYzzsl() == null ? other.getYzzsl() == null : this.getYzzsl().equals(other.getYzzsl())) && (this.getYzfsl() == null ? other.getYzfsl() == null : this.getYzfsl().equals(other.getYzfsl())) && (this.getLjckzsl() == null ? other.getLjckzsl() == null : this.getLjckzsl().equals(other.getLjckzsl())) && (this.getLjrkzsl() == null ? other.getLjrkzsl() == null : this.getLjrkzsl().equals(other.getLjrkzsl())) && (this.getDr() == null ? other.getDr() == null : this.getDr().equals(other.getDr())) && (this.getTs() == null ? other.getTs() == null : this.getTs().equals(other.getTs())) && (this.getWmsFlag() == null ? other.getWmsFlag() == null : this.getWmsFlag().equals(other.getWmsFlag())) && (this.getYingzsl() == null ? other.getYingzsl() == null : this.getYingzsl().equals(other.getYingzsl())) && (this.getYingzzsl() == null ? other.getYingzzsl() == null : this.getYingzzsl().equals(other.getYingzzsl())) && (this.getBdr() == null ? other.getBdr() == null : this.getBdr().equals(other.getBdr())) && (this.getBts() == null ? other.getBts() == null : this.getBts().equals(other.getBts()));
    }
    @Override
@@ -411,6 +377,10 @@
        result = prime * result + ((getDr() == null) ? 0 : getDr().hashCode());
        result = prime * result + ((getTs() == null) ? 0 : getTs().hashCode());
        result = prime * result + ((getWmsFlag() == null) ? 0 : getWmsFlag().hashCode());
        result = prime * result + ((getYingzsl() == null) ? 0 : getYingzsl().hashCode());
        result = prime * result + ((getYingzzsl() == null) ? 0 : getYingzzsl().hashCode());
        result = prime * result + ((getBdr() == null) ? 0 : getBdr().hashCode());
        result = prime * result + ((getBts() == null) ? 0 : getBts().hashCode());
        return result;
    }
@@ -474,6 +444,10 @@
        sb.append(", dr=").append(dr);
        sb.append(", ts=").append(ts);
        sb.append(", wmsFlag=").append(wmsFlag);
        sb.append(", yingzsl=").append(yingzsl);
        sb.append(", yingzzsl=").append(yingzzsl);
        sb.append(", bdr = ").append(bdr);
        sb.append(", bts=").append(bts);
        sb.append("]");
        return sb.toString();
    }
src/main/java/com/zy/nc/mapper/NccSaleXsfhmxWmsMapper.java
@@ -1,15 +1,17 @@
package com.zy.nc.mapper;
import com.zy.nc.entity.NccSaleXsfhmxWms;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.nc.entity.NccSaleXsfhmxWms;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sale_xsfhmx_wms】的数据库操作Mapper
* @createDate 2025-05-08 09:54:48
* @Entity com.zy.nc.entity.NccSaleXsfhmxWms
*/
 * @author ZY
 * @description 针对表【ncc_sale_xsfhmx_wms】的数据库操作Mapper
 * @createDate 2025-05-08 09:54:48
 * @Entity com.zy.nc.entity.NccSaleXsfhmxWms
 */
public interface NccSaleXsfhmxWmsMapper extends BaseMapper<NccSaleXsfhmxWms> {
    List<String> selectXsfh();
}
src/main/java/com/zy/nc/mapper/NccScZkmxbWmsMapper.java
@@ -1,15 +1,17 @@
package com.zy.nc.mapper;
import com.zy.nc.entity.NccScZkmxbWms;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.nc.entity.NccScZkmxbWms;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sc_zkmxb_wms】的数据库操作Mapper
* @createDate 2025-05-08 09:54:48
* @Entity com.zy.nc.entity.NccScZkmxbWms
*/
 * @author ZY
 * @description 针对表【ncc_sc_zkmxb_wms】的数据库操作Mapper
 * @createDate 2025-05-08 16:32:37
 * @Entity com.zy.nc.entity.NccScZkmxbWms
 */
public interface NccScZkmxbWmsMapper extends BaseMapper<NccScZkmxbWms> {
    List<String> selectZk();
}
src/main/java/com/zy/nc/service/NccSaleXsfhmxWmsService.java
@@ -3,6 +3,8 @@
import com.zy.nc.entity.NccSaleXsfhmxWms;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sale_xsfhmx_wms】的数据库操作Service
@@ -10,4 +12,6 @@
*/
public interface NccSaleXsfhmxWmsService extends IService<NccSaleXsfhmxWms> {
    List<String> selectXsfh();
}
src/main/java/com/zy/nc/service/NccScZkmxbWmsService.java
@@ -3,11 +3,14 @@
import com.zy.nc.entity.NccScZkmxbWms;
import com.baomidou.mybatisplus.service.IService;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sc_zkmxb_wms】的数据库操作Service
* @createDate 2025-05-08 09:54:48
* @createDate 2025-05-08 16:32:37
*/
public interface NccScZkmxbWmsService extends IService<NccScZkmxbWms> {
    List<String> selectZk();
}
src/main/java/com/zy/nc/service/impl/NccSaleXsfhmxWmsServiceImpl.java
@@ -2,17 +2,23 @@
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.nc.entity.NccSaleXsfhmxWms;
import com.zy.nc.service.NccSaleXsfhmxWmsService;
import com.zy.nc.mapper.NccSaleXsfhmxWmsMapper;
import com.zy.nc.service.NccSaleXsfhmxWmsService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sale_xsfhmx_wms】的数据库操作Service实现
* @createDate 2025-05-08 09:54:48
*/
 * @author ZY
 * @description 针对表【ncc_sale_xsfhmx_wms】的数据库操作Service实现
 * @createDate 2025-05-08 09:54:48
 */
@Service
public class NccSaleXsfhmxWmsServiceImpl extends ServiceImpl<NccSaleXsfhmxWmsMapper, NccSaleXsfhmxWms>
implements NccSaleXsfhmxWmsService{
        implements NccSaleXsfhmxWmsService {
    @Override
    public List<String> selectXsfh() {
        return this.baseMapper.selectXsfh();
    }
}
src/main/java/com/zy/nc/service/impl/NccScZkmxbWmsServiceImpl.java
@@ -6,13 +6,20 @@
import com.zy.nc.mapper.NccScZkmxbWmsMapper;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @author ZY
* @description 针对表【ncc_sc_zkmxb_wms】的数据库操作Service实现
* @createDate 2025-05-08 09:54:48
* @createDate 2025-05-08 16:32:37
*/
@Service
public class NccScZkmxbWmsServiceImpl extends ServiceImpl<NccScZkmxbWmsMapper, NccScZkmxbWms>
implements NccScZkmxbWmsService{
    @Override
    public List<String> selectZk() {
        return Collections.emptyList();
    }
}
src/main/java/com/zy/nc/task/BaseDataTask.java
@@ -1,7 +1,7 @@
package com.zy.nc.task;
import com.zy.asrs.task.core.ReturnT;
import com.zy.nc.task.handler.PlanOrderHandler;
import com.zy.nc.task.handler.BaseDataHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@@ -12,19 +12,46 @@
public class BaseDataTask {
    @Autowired
    private PlanOrderHandler planOrderHandler;
    private BaseDataHandler baseDataHandler;
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute1() {
        ReturnT<String> returnT = planOrderHandler.start1();
//        ReturnT<String> returnT = baseDataHandler.start1();
//        if (!returnT.isSuccess()) {
//            log.error(returnT.getMsg());
//        }
    }
    /**
     * 人员数据同步
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void start8() {
        ReturnT<String> returnT = baseDataHandler.start8();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
    }
    /**
     * 物料分类数据同步
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute2() {
        ReturnT<String> returnT = planOrderHandler.start2();
    public void start9() {
        ReturnT<String> returnT = baseDataHandler.start9();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
    }
    /**
     * 物料基础数据同步
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute13() {
        ReturnT<String> returnT = baseDataHandler.start13();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
src/main/java/com/zy/nc/task/PlanOrderTask.java
@@ -14,6 +14,12 @@
    @Autowired
    private PlanOrderHandler planOrderHandler;
    /**
     * 发货
     *
     * @return
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute1() {
        ReturnT<String> returnT = planOrderHandler.start1();
@@ -22,6 +28,11 @@
        }
    }
    /**
     * 转库
     *
     * @return
     */
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute2() {
        ReturnT<String> returnT = planOrderHandler.start2();
@@ -30,4 +41,12 @@
        }
    }
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute3() {
//        ReturnT<String> returnT = planOrderHandler.start2();
//        if (!returnT.isSuccess()) {
//            log.error(returnT.getMsg());
//        }
    }
}
src/main/java/com/zy/nc/task/handler/BaseDataHandler.java
@@ -2,15 +2,27 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.common.Cools;
import com.zy.asrs.entity.Tag;
import com.zy.asrs.entity.param.MatSyncParam;
import com.zy.asrs.service.OpenService;
import com.zy.asrs.service.TagService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.nc.entity.NccBdCustomerWms;
import com.zy.nc.entity.NccSaleDbckmxb;
import com.zy.nc.service.NccBdCustomerWmsService;
import com.zy.nc.service.NccCgCgdhdWmsService;
import com.zy.common.utils.NodeUtils;
import com.zy.nc.entity.*;
import com.zy.nc.service.*;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
@@ -22,25 +34,231 @@
    @Autowired
    private NccCgCgdhdWmsService nccCgCgdhdWmsService;
    @Autowired
    private NccCkPddWmsService nccCkPddWmsService;
    @Autowired
    private NccJcBmWmsService nccJcBmWmsService;
    @Autowired
    private NccJcCkhwService nccJcCkhwService;
    @Autowired
    private NccJcCkWmsService nccJcCkWmsService;
    @Autowired
    private NccJcQilibcBarcodeflowWmsService nccJcQilibcBarcodeflowWmsService;
    @Autowired
    private NccJcRyWmsService nccJcRyWmsService;
    @Autowired
    private NccJcWlflWmsService nccJcWlflWmsService;
    @Autowired
    private NccOrgCorpWmsService nccOrgCorpWmsService;
    @Autowired
    private VGetBdMaterialService vGetBdMaterialService;
    @Autowired
    private OpenService openService;
    @Autowired
    private TagService tagService;
    @Autowired
    private UserService userService;
    @Value("${NYNC.pageSize}")
    private Integer pageSize;
    /**
     *
     *
     * @return
     */
    public ReturnT<String> start1() {
        nccBdCustomerWmsService.selectList(new EntityWrapper<NccBdCustomerWms>().ne("wms_flag",1))
        log.info("shuju:{}", JSONObject.toJSON(nccSaleXsckmx));
        Page<NccBdCustomerWms> page = new Page<>(1, pageSize);
        Page<NccBdCustomerWms> wmsFlag = nccBdCustomerWmsService.selectPage(page, new EntityWrapper<NccBdCustomerWms>().ne("wms_flag", 1));
        for (NccBdCustomerWms nccBdCustomerWms : wmsFlag.getRecords()) {
            //TODO
            log.info("NccBdCustomerWms数据:{}", JSONObject.toJSON(nccBdCustomerWms));
        }
        return SUCCESS;
    }
    /**
     *
     *
     * @return
     */
    public ReturnT<String> start2() {
        NccSaleDbckmxb nccSaleDbckmxb = NccCgCgdhdWmsService.selectById("1001A1100000000H9KKJ");
        log.info("shuju:{}", JSONObject.toJSON(nccSaleDbckmxb));
        Page<NccCgCgdhdWms> page = new Page<>(1, pageSize);
        Page<NccCgCgdhdWms> wmsFlag = nccCgCgdhdWmsService.selectPage(page, new EntityWrapper<NccCgCgdhdWms>().ne("wms_flag", 1));
        for (NccCgCgdhdWms nccCgCgdhdWms : wmsFlag.getRecords()) {
            log.info("NccCgCgdhdWms数据:{}", JSONObject.toJSON(nccCgCgdhdWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start3() {
        Page<NccCkPddWms> page = new Page<>(1, pageSize);
        Page<NccCkPddWms> wmsFlag = nccCkPddWmsService.selectPage(page, new EntityWrapper<NccCkPddWms>().ne("wms_flag", 1));
        for (NccCkPddWms nccCkPddWms : wmsFlag.getRecords()) {
            log.info("NccCkPddWms数据:{}", JSONObject.toJSON(nccCkPddWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start4() {
        Page<NccJcBmWms> page = new Page<>(1, pageSize);
        Page<NccJcBmWms> wmsFlag = nccJcBmWmsService.selectPage(page, new EntityWrapper<NccJcBmWms>().ne("wms_flag", 1));
        for (NccJcBmWms nccCkPddWms : wmsFlag.getRecords()) {
            log.info("NccJcBmWms数据:{}", JSONObject.toJSON(nccCkPddWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start5() {
        Page<NccJcCkhw> page = new Page<>(1, pageSize);
        Page<NccJcCkhw> wmsFlag = nccJcCkhwService.selectPage(page, new EntityWrapper<NccJcCkhw>().ne("wms_flag", 1));
        for (NccJcCkhw nccJcCkhw : wmsFlag.getRecords()) {
            log.info("NccJcCkhw数据:{}", JSONObject.toJSON(nccJcCkhw));
        }
        return SUCCESS;
    }
    public ReturnT<String> start6() {
        Page<NccJcCkWms> page = new Page<>(1, pageSize);
        Page<NccJcCkWms> wmsFlag = nccJcCkWmsService.selectPage(page, new EntityWrapper<NccJcCkWms>().ne("wms_flag", 1));
        for (NccJcCkWms nccJcCkWms : wmsFlag.getRecords()) {
            log.info("NccJcCkWms数据:{}", JSONObject.toJSON(nccJcCkWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start7() {
        Page<NccJcQilibcBarcodeflowWms> page = new Page<>(1, pageSize);
        Page<NccJcQilibcBarcodeflowWms> wmsFlag = nccJcQilibcBarcodeflowWmsService.selectPage(page, new EntityWrapper<NccJcQilibcBarcodeflowWms>().ne("wms_flag", 1));
        for (NccJcQilibcBarcodeflowWms nccJcQilibcBarcodeflowWms : wmsFlag.getRecords()) {
            log.info("NccJcQilibcBarcodeflowWms数据:{}", JSONObject.toJSON(nccJcQilibcBarcodeflowWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start8() {
        Page<NccJcRyWms> page = new Page<>(1, pageSize);
        Page<NccJcRyWms> wmsFlag = nccJcRyWmsService.selectPage(page, new EntityWrapper<NccJcRyWms>().ne("wms_flag", 1).eq("sszzmc", "浙江福莱新材料股份有限公司烟台分公司"));
        for (NccJcRyWms nccJcRyWms : wmsFlag.getRecords()) {
            User user = userService.selectOne(new EntityWrapper<User>().eq("username", nccJcRyWms.getRybm()));
            nccJcRyWms.setWmsFlag(1);
            if (user == null) {
                user = new User();
                user.setUsername(nccJcRyWms.getRybm());
                user.setStatus(1);
                user.setCreateTime(new Date());
                userService.insert(user);
            }
            log.info("NccJcRyWms数据:{}", JSONObject.toJSON(nccJcRyWms));
        }
        nccJcRyWmsService.updateBatchById(wmsFlag.getRecords());
        return SUCCESS;
    }
    public ReturnT<String> start9() {
        Page<NccJcWlflWms> page = new Page<>(1, pageSize);
        Page<NccJcWlflWms> wmsFlag = nccJcWlflWmsService.selectPage(page, new EntityWrapper<NccJcWlflWms>().ne("wms_flag", 1));
        Tag top = tagService.getTop();
        for (NccJcWlflWms nccJcWlflWms : wmsFlag.getRecords()) {
            if (!Cools.isEmpty(nccJcWlflWms.getSjflbm())) {
                Tag priTag = tagService.selectOne(new EntityWrapper<Tag>().eq("uuid", nccJcWlflWms.getSjflbm()));
                if (priTag == null) {
                    continue;
                } else {
                    Tag tag = new Tag();
                    tag.setUuid(nccJcWlflWms.getCode());
                    tag.setName(nccJcWlflWms.getName());
                    tag.setParentId(priTag.getId());
                    tag.setParentName(priTag.getName());
                    tag.setType(0);
                    tag.setLevel(priTag.getLevel() + 1);
                    tag.setStatus(1);
                    tag.setCreateTime(new Date());
                    tag.setPath(priTag.getPath());
                    NodeUtils nodeUtils = new NodeUtils();
                    nodeUtils.executePath(priTag.getId());
                    tag.setPath(nodeUtils.path.toString());
                    tag.setPathName(nodeUtils.pathName.toString());
                    tagService.insert(tag);
                    nccJcWlflWms.setWmsFlag(1);
                    nccJcWlflWmsService.updateById(nccJcWlflWms);
                }
            } else {
                Tag tag = new Tag();
                tag.setUuid(nccJcWlflWms.getCode());
                tag.setName(nccJcWlflWms.getName());
                tag.setStatus(1);
                tag.setCreateTime(new Date());
                tag.setType(0);
                tag.setLevel(2);
                tag.setParentId(top.getId());
                tag.setParentName(top.getName());
                tag.setPath(top.getPath());
                NodeUtils nodeUtils = new NodeUtils();
                nodeUtils.executePath(top.getId());
                tag.setPath(nodeUtils.path.toString());
                tag.setPathName(nodeUtils.pathName.toString());
                tagService.insert(tag);
                nccJcWlflWms.setWmsFlag(1);
                nccJcWlflWmsService.updateById(nccJcWlflWms);
            }
            log.info("NccJcWlflWms数据:{}", JSONObject.toJSON(nccJcWlflWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start10() {
        Page<NccOrgCorpWms> page = new Page<>(1, pageSize);
        Page<NccOrgCorpWms> wmsFlag = nccOrgCorpWmsService.selectPage(page, new EntityWrapper<NccOrgCorpWms>().ne("wms_flag", 1));
        for (NccOrgCorpWms nccOrgCorpWms : wmsFlag.getRecords()) {
            log.info("NccOrgCorpWms数据:{}", JSONObject.toJSON(nccOrgCorpWms));
        }
        return SUCCESS;
    }
    public ReturnT<String> start13() {
        Page<VGetBdMaterial> page = new Page<>(1, pageSize);
        Page<VGetBdMaterial> wmsFlag = vGetBdMaterialService.selectPage(page, new EntityWrapper<VGetBdMaterial>().ne("wms_flag", 1));
        MatSyncParam param = new MatSyncParam();
        List<MatSyncParam.MatParam> matDetails = new ArrayList<>();
        MatSyncParam.MatParam matParam;
        for (VGetBdMaterial vGetBdMaterial : wmsFlag.getRecords()) {
            Tag priTag = tagService.selectOne(new EntityWrapper<Tag>().eq("uuid", vGetBdMaterial.get存货分类编码()));
            if (priTag == null) {
                continue;
            }
            matParam = new MatSyncParam.MatParam();
            matParam.setMatnr(vGetBdMaterial.get物料编码());
            matParam.setMaktx(vGetBdMaterial.get物料名称());
            matParam.setSpecs(vGetBdMaterial.get规格());
            matParam.setModel(vGetBdMaterial.get型号());
            matParam.setUnit(vGetBdMaterial.get主单位());
            matParam.setMemo(vGetBdMaterial.get备注());
            matParam.setGroupCode(vGetBdMaterial.get存货分类编码());
            matParam.setGroupName(vGetBdMaterial.get存货分类名称());
            matDetails.add(matParam);
        }
        if (!matDetails.isEmpty()) {
            param.setMatDetails(matDetails);
            openService.syncMat(param);
            for (VGetBdMaterial vGetBdMaterial : wmsFlag.getRecords()) {
                vGetBdMaterial.setWmsFlag(1);
            }
            vGetBdMaterialService.updateBatchById(wmsFlag.getRecords());
        }
        return SUCCESS;
    }
}
src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java
@@ -1,25 +1,35 @@
package com.zy.nc.task.handler;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.entity.param.OpenOrderPakinParam;
import com.zy.asrs.service.OpenService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.nc.entity.NccSaleDbckmxb;
import com.zy.nc.entity.NccSaleXsckmx;
import com.zy.nc.mapper.NccSaleDbckmxbMapper;
import com.zy.nc.mapper.NccSaleXsckmxMapper;
import com.zy.common.model.DetlDto;
import com.zy.nc.entity.NccSaleXsfhmxWms;
import com.zy.nc.entity.NccScZkmxbWms;
import com.zy.nc.service.NccSaleXsfhmxWmsService;
import com.zy.nc.service.NccScZkmxbWmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@Slf4j
public class PlanOrderHandler extends AbstractHandler<String> {
    @Autowired
    private NccSaleXsckmxMapper nccSaleXsckmxMapper;
    private NccSaleXsfhmxWmsService nccSaleXsfhmxWmsService;
    @Autowired
    private NccSaleDbckmxbMapper nccSaleDbckmxbMapper;
    private NccScZkmxbWmsService nccScZkmxbWmsService;
    @Autowired
    private OpenService openService;
    /**
     * 发货
@@ -27,19 +37,64 @@
     * @return
     */
    public ReturnT<String> start1() {
        NccSaleXsckmx nccSaleXsckmx = nccSaleXsckmxMapper.selectById("1001A1100000000H9KKJ");
        log.info("shuju:{}", JSONObject.toJSON(nccSaleXsckmx));
        List<String> Ids = nccSaleXsfhmxWmsService.selectXsfh();
        for (String id : Ids) {
            List<NccSaleXsfhmxWms> wmsFlag = nccSaleXsfhmxWmsService.selectList(new EntityWrapper<NccSaleXsfhmxWms>().eq("cdeliveryid", id).ne("wms_flag", 1).eq("fstatusflag", 2));
            OpenOrderPakinParam param = new OpenOrderPakinParam();
            param.setOrderType("销售发货");
            DetlDto detlDto;
            List<DetlDto> orderDetails = new ArrayList<>();
            long i = 1;
            for (NccSaleXsfhmxWms nccSaleXsfhmxWms : wmsFlag) {
                if (nccSaleXsfhmxWms.getFstatusflag() == 2 && nccSaleXsfhmxWms.getBdr() == 0 && nccSaleXsfhmxWms.getHdr() == 0) {
                    detlDto = new DetlDto();
                    detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm());
                    detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum());
                    detlDto.setLineNumber(i);
                    nccSaleXsfhmxWms.setWmsFlag(1);
                    orderDetails.add(detlDto);
                    log.info("NccSaleXsfhmxWms数据:{}", JSONObject.toJSON(nccSaleXsfhmxWms));
                    i++;
                }
            }
            param.setOrderDetails(orderDetails);
            openService.pakinOrderCreate(param);
            nccSaleXsfhmxWmsService.updateBatchById(wmsFlag);
        }
        return SUCCESS;
    }
    /**
     * 调拨
     * 转库
     *
     * @return
     */
    public ReturnT<String> start2() {
        NccSaleDbckmxb nccSaleDbckmxb = nccSaleDbckmxbMapper.selectById("1001A1100000000H9KKJ");
        log.info("shuju:{}", JSONObject.toJSON(nccSaleDbckmxb));
        List<String> strings = nccScZkmxbWmsService.selectZk();
        for (String string : strings) {
            OpenOrderPakinParam param = new OpenOrderPakinParam();
            param.setOrderType("转库");
            DetlDto detlDto;
            List<DetlDto> orderDetails = new ArrayList<>();
            long i = 1;
            List<NccScZkmxbWms> wmsFlag = nccScZkmxbWmsService.selectList(new EntityWrapper<NccScZkmxbWms>().eq("cdeliveryid", string).ne("wms_flag", 1));
            for (NccScZkmxbWms nccScZkmxbWms : wmsFlag) {
                log.info("NccScZkmxbWms数据:{}", JSONObject.toJSON(nccScZkmxbWms));
                if (nccScZkmxbWms.getDjzt() == 2 && nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getDr() == 0) {
                    detlDto = new DetlDto();
                    detlDto.setMatnr(nccScZkmxbWms.getWlbm());
                    detlDto.setAnfme(nccScZkmxbWms.getYingzzsl());
                    detlDto.setBatch(nccScZkmxbWms.getVbatchcode());
                    detlDto.setLineNumber(i);
                    nccScZkmxbWms.setWmsFlag(1);
                    orderDetails.add(detlDto);
                    i++;
                }
            }
            param.setOrderDetails(orderDetails);
            openService.pakinOrderCreate(param);
            nccScZkmxbWmsService.updateBatchById(wmsFlag);
        }
        return SUCCESS;
    }
}
src/main/java/com/zy/nc/util/NcResultMessage.java
File was renamed from src/main/java/com/zy/nc/util/ResultMessageUtil.java
@@ -1,6 +1,6 @@
package com.zy.nc.util;
public class ResultMessageUtil {
public class NcResultMessage {
    private boolean success;
src/main/java/com/zy/nc/vo/SaleOutHeadVO.java
@@ -6,7 +6,7 @@
public class SaleOutHeadVO {
    // 必填字段
    private String pkOrg; // 库存组织最新版本
    private String pk_org; // 库存组织最新版本
    private String cwarehouseid; // 仓库
    // 可选字段
@@ -55,9 +55,9 @@
    private Double ntotalpiece; // 总件数
    private Double ntotalvolume; // 总体积
    private Double ntotalweight; // 总重量
    private String pkGroup; // 集团
    private String pkMeasware; // 计量器具
    private String pkOrgV; // 库存组织
    private String pk_group; // 集团
    private String pk_measware; // 计量器具
    private String pk_orgV; // 库存组织
    private String taudittime; // 签字日期
    private String trafficorgoid; // 物流组织最新版本
    private String trafficorgvid; // 物流组织
src/main/resources/application.yml
@@ -46,7 +46,7 @@
#License相关配置
license:
  subject: integrationasrs
  subject: ytflwms
  publicAlias: publicCert
  storePass: public_zhongyang_123456789
  licensePath: license.lic
@@ -80,17 +80,18 @@
# 用友NC对接
NYNC:
  ip:
  prot:
  port:
  pageSize: 500
  #1.销售出库单参照发货单新增
  saveRefDelivery: http://${ip}:${port}/nccloud/api/ic/saleout/saveRefDelivery
  saveRefDelivery: /nccloud/api/ic/saleout/saveRefDelivery
  #2.其他入库单参照转库新增
  saveRefWhsTrans: http://ip:port/nccloud/api/ic/generalin/saveRefWhsTrans
  saveRefWhsTrans: /nccloud/api/ic/generalin/saveRefWhsTrans
  #3.新增采购入库单
  purchasein: http://ip:port/nccloud/api/ic/purchasein/save
  purchasein: /nccloud/api/ic/purchasein/save
  #4.1新增转库单
  whstrans: http://ip:port/nccloud/api/ic/whstrans/save
  whstrans: /nccloud/api/ic/whstrans/save
  #4.2其他出库单新增
  generalout: http://ip:port/nccloud/api/ic/generalout/save
  generalout: /nccloud/api/ic/generalout/save
  #4.3.其他入库单参照转库新增
  #saveRefWhsTrans: http://ip:port/nccloud/api/ic/generalin/saveRefWhsTrans
  #5.1新增转库单
src/main/resources/com/zy/nc/mapper/NccBdCustomerWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccCgCgdhdWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccCkPddWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcBmWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcCkWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcCkhwMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcQilibcBarcodeflowWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcRyWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccJcWlflWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccOrgCorpWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccSaleXsfhmxWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/NccScZkmxbWmsMapper.xml
File was deleted
src/main/resources/com/zy/nc/mapper/VGetBdMaterialMapper.xml
File was deleted
src/main/resources/license.lic
Binary files differ
src/main/resources/mapper/nc/NccBdCustomerWmsMapper.xml
@@ -14,10 +14,11 @@
            <result property="tel1" column="TEL1" />
            <result property="legalbody" column="LEGALBODY" />
            <result property="nlimitmny" column="NLIMITMNY" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_CUSTOMER,CODE,NAME,SHORTNAME,TAXPAYERID,KHLX,
        TEL1,LEGALBODY,NLIMITMNY
        TEL1,LEGALBODY,NLIMITMNY,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccCgCgdhdWmsMapper.xml
@@ -35,6 +35,7 @@
            <result property="ydsl" column="YDSL" />
            <result property="hts" column="HTS" />
            <result property="bts" column="BTS" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -43,6 +44,6 @@
        GYSBM,GYSMC,YWLC,DHLXBM,YSFS,
        SHRBM,SHRMC,CGBM,CGMC,FBILLSTATUS,
        VMEMO,WLBM,WLMC,NNUM,NASTNUM,
        YDZSL,YDSL,HTS,BTS
        YDZSL,YDSL,HTS,BTS,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccCkPddWmsMapper.xml
@@ -34,6 +34,7 @@
            <result property="hwmc" column="HWMC" />
            <result property="hts" column="HTS" />
            <result property="bts" column="BTS" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -42,6 +43,6 @@
        BMMC,PDRBM,PDRMC,FBILLFLAG,VNOTE,
        WLBM,WLMC,VBATCHCODE,PK_BATCHCODE,ZMSL,
        TMSL,ZMZSL,PDSL,SPZSL,HWBM,
        HWMC,HTS,BTS
        HWMC,HTS,BTS,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcBmWmsMapper.xml
@@ -15,10 +15,11 @@
            <result property="ssywdymc" column="SSYWDYMC" />
            <result property="sssyb" column="SSSYB" />
            <result property="qyzt" column="QYZT" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_DEPT,BMBM,BMMC,BMJC,SJBM,SSYWDY,
        SSYWDYBM,SSYWDYMC,SSSYB,QYZT
        SSYWDYBM,SSYWDYMC,SSSYB,QYZT,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcCkWmsMapper.xml
@@ -49,6 +49,7 @@
            <result property="proflag" column="PROFLAG" />
            <result property="storaddr" column="STORADDR" />
            <result property="ts" column="TS" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -60,6 +61,6 @@
        MODIFIER,MRPFLAG,NAME,NAME2,NAME3,
        NAME4,NAME5,NAME6,OPERATESUPPLIER,PHONE,
        PK_ADDRESS,PK_GROUP,PK_ORG,PRINCIPALCODE,PROFITCENTRE,
        PROFLAG,STORADDR,TS
        PROFLAG,STORADDR,TS,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcCkhwMapper.xml
@@ -11,9 +11,11 @@
            <result property="ckmc" column="CKMC" />
            <result property="hwbm" column="HWBM" />
            <result property="hwmc" column="HWMC" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_RACK,PK_STORDOC,CKBM,CKMC,HWBM,HWMC
        PK_RACK,PK_STORDOC,CKBM,CKMC,HWBM,HWMC,
        wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcQilibcBarcodeflowWmsMapper.xml
@@ -15,10 +15,11 @@
            <result property="memo" column="MEMO" />
            <result property="vbillno" column="VBILLNO" />
            <result property="nastnum" column="NASTNUM" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_BARCODE,TS,VBARCODE,INFLA,ASNNUM,PK_MATERIAL,
        PK_STORDOC,MEMO,VBILLNO,NASTNUM
        PK_STORDOC,MEMO,VBILLNO,NASTNUM,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcRyWmsMapper.xml
@@ -16,10 +16,12 @@
            <result property="ssbmbm" column="SSBMBM" />
            <result property="ssbmmc" column="SSBMMC" />
            <result property="sssyb" column="SSSYB" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_PSNDOC,QYZT,RYBM,RYMC,PK_ORG,SSZZBM,
        SSZZMC,PK_DEPT,SSBMBM,SSBMMC,SSSYB
        SSZZMC,PK_DEPT,SSBMBM,SSBMMC,SSSYB,
        wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccJcWlflWmsMapper.xml
@@ -12,10 +12,11 @@
            <result property="sjflmc" column="SJFLMC" />
            <result property="wljbfl" column="WLJBFL" />
            <result property="code1" column="CODE1" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        PK_MARBASCLASS,CODE,NAME,SJFLBM,SJFLMC,WLJBFL,
        CODE1
        CODE1,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccOrgCorpWmsMapper.xml
@@ -8,9 +8,10 @@
            <result property="code" column="CODE" />
            <result property="name" column="NAME" />
            <result property="shortname" column="SHORTNAME" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
        CODE,NAME,SHORTNAME
        CODE,NAME,SHORTNAME,wms_flag
    </sql>
</mapper>
src/main/resources/mapper/nc/NccSaleXsfhmxWmsMapper.xml
@@ -77,6 +77,8 @@
            <result property="gssf" column="GSSF" />
            <result property="kczzbm" column="KCZZBM" />
            <result property="kczzmc" column="KCZZMC" />
            <result property="vnote" column="VNOTE" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -94,6 +96,13 @@
        CFIRSTID,CFIRSTBID,VSRCCODE,CSRCID,CSRCBID,
        DSENDDATE,NTOTALOUTNUM,BOUTENDFLAG,NTOTALNOTOUTNUM,BDR,
        TS,HTS,SHSF,GSSF,KCZZBM,
        KCZZMC
        KCZZMC,VNOTE,wms_flag
    </sql>
    <select id="selectXsfh" resultType="java.lang.String">
        select distinct
            CDELIVERYID
        from ncc_sale_xsfhmx_wms where wms_flag != 1 and fstatusflag = 2 limit 100
    </select>
</mapper>
src/main/resources/mapper/nc/NccScZkmxbWmsMapper.xml
@@ -58,6 +58,7 @@
            <result property="ljrkzsl" column="LJRKZSL" />
            <result property="dr" column="DR" />
            <result property="ts" column="TS" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -71,6 +72,12 @@
        ZSJFLMC,ZDW,FDW,KCZT,VBATCHCODE,
        VDEF1,VDEF2,VDEF3,KHBM,KHMC,
        KHJC,YZZSL,YZFSL,LJCKZSL,LJRKZSL,
        DR,TS
        DR,TS,wms_flag
    </sql>
    <select id="selectZk" resultType="java.lang.String">
        select distinct
            CDELIVERYID
        from ncc_sale_xsfhmx_wms where wms_flag != 1 and fstatusflag = 2 limit 100
    </select>
</mapper>
src/main/resources/mapper/nc/VGetBdMaterialMapper.xml
@@ -47,6 +47,7 @@
            <result property="zsjflmc" column="ZSJFLMC" />
            <result property="sjflbm" column="SJFLBM" />
            <result property="sjflmc" column="SJFLMC" />
            <result property="wmsFlag" column="wms_flag" />
    </resultMap>
    <sql id="Base_Column_List">
@@ -58,6 +59,6 @@
        库存状态,单位重量,启用状态,是否外贸,海关编码,
        海关名称,报关英文名,发票名称,创建时间,最后修改时间,
        DEFCODE,DEFNAME,ZSJFLBM,ZSJFLMC,SJFLBM,
        SJFLMC
        SJFLMC,wms_flag
    </sql>
</mapper>