自动化立体仓库 - WMS系统
1
ZY
2025-03-29 c65db22f67af8018ae7105ea00d8743e42835e13
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -1,5 +1,6 @@
package com.zy.asrs.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.BaseRes;
import com.core.common.Cools;
@@ -24,9 +25,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -252,7 +251,7 @@
                if (order.getSettle() == 4L) {
                    // 修改订单状态 4.完成 ===>> 6.已上报
                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                        throw new CoolException("订单状态修改(4-6)失败");
                    }
                }
            }
@@ -271,7 +270,7 @@
                }
                // 修改订单状态 4.完成 ===>> 6.已上报
                if (!orderService.updateSettle(order.getId(), 6L, null)) {
                    throw new CoolException("服务器内部错误,请联系管理员");
                    throw new CoolException("订单状态修改(4-6)失败");
                }
            }
        }
@@ -461,7 +460,7 @@
                if (order.getSettle() == 4L) {
                    // 修改订单状态 4.完成 ===>> 6.已上报
                    if (!orderService.updateSettle(order.getId(), 6L, null)) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                        throw new CoolException("订单状态修改(4-6)失败");
                    }
                }
            }
@@ -480,7 +479,7 @@
                }
                // 修改订单状态 4.完成 ===>> 6.已上报
                if (!orderService.updateSettle(order.getId(), 6L, null)) {
                    throw new CoolException("服务器内部错误,请联系管理员");
                    throw new CoolException("订单状态修改(4-6)失败");
                }
            }
        }
@@ -517,7 +516,7 @@
                null    // 备注
        );
        if (!packService.insert(pack)) {
            throw new CoolException("服务器内部错误,请联系管理员");
            throw new CoolException("打包失败");
        }
        Mat mat = matService.selectByMatnr(analyse.getMatnr());
@@ -553,7 +552,7 @@
                            null    // 备注
                    );
                    if (tagMapper.insert(priTag) == 0) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                        throw new CoolException("分类添加失败");
                    }
                }
                // 二级分类
@@ -582,7 +581,7 @@
                            null    // 备注
                    );
                    if (tagMapper.insert(secTag) == 0) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                        throw new CoolException("分类添加失败");
                    }
                }
                tagId = secTag.getId();
@@ -598,7 +597,7 @@
            mat.setCreateTime(now);
            mat.setUpdateTime(now);
            if (!matService.insert(mat)) {
                throw new CoolException("服务器内部错误,请联系管理员");
                throw new CoolException("物料添加失败");
            } else {
                log.info("打包上线添加新物料[物料号:{}]", mat.getMatnr());
            }
@@ -855,6 +854,12 @@
            throw new CoolException("单据参数为空或者单据详情为空,无法生成单据信息");
        }
        if ("银座生产退料申请单".equalsIgnoreCase(docName)) {
            if (Cools.isEmpty(param.getBackOrderNo())){
                throw new CoolException("退料单的退料编号backOrderNo不能为空");
            }
        }
        Order orderOld = null;
        if (!Cools.isEmpty(orderService.selectByNo(param.getCPOID()))) {
@@ -886,6 +891,11 @@
        }
        Date now = new Date();
        Order order = orderMapping(param, now, pakin, docName);
        Set<String> set = new HashSet<>();
        for (OrderSyncParam.OrderDetl child : param.getChildren()) {
            set.add(child.getCDefine22());
        }
        order.setTel(JSON.toJSONString(set));
        orderService.insert(order);
        param.getChildren().forEach(od -> {
            OrderDetl orderDetl = orderDetlMapping(order, od, now);
@@ -984,8 +994,11 @@
        order.setDefNumber(param.get操作系统号());
        order.setCreateBy(9999L);
        order.setCreateTime(now);
        order.setUpdateBy(9999L);
        order.setUpdateTime(now);
        order.setSalesman(param.getBackOrderNo());
        order.setUpstreamcode(param.getUpstreamcode());
        //订单状态
        order.setSettle(1L);
@@ -1020,8 +1033,13 @@
        od.setAnfme(odParam.getIQuantity());
        //销售订单号
        od.setThreeCode(odParam.getCDefine22());
        od.setDevNo(odParam.getDevNo());
        //自由项
        od.setBatch((Cools.isEmpty(odParam.getBatch()) ? "" : odParam.getBatch()) + "__" + (Cools.isEmpty(odParam.getBFree1()) ? "" : odParam.getBFree1()));
        if (!Cools.isEmpty(odParam.getBatch()) || !Cools.isEmpty(odParam.getBFree1())) {
            od.setBrand((Cools.isEmpty(odParam.getBatch()) ? "" : odParam.getBatch()) + "__" + (Cools.isEmpty(odParam.getBFree1()) ? "" : odParam.getBFree1()));
        }
        od.setWeight(odParam.getINum());
        od.setVolume(odParam.getIinvexchrate());
        //IDs
        od.setSku(odParam.getId());
@@ -1030,6 +1048,7 @@
        od.setSource(order.getDocType().intValue());
        od.setStatus(1);
        od.setQty(0.0D);
        od.setReportQty(0.0D);
        od.setCreateBy(9999L);
        od.setCreateTime(now);
        od.setUpdateBy(9999L);