自动化立体仓库 - WMS系统
skyouc
2025-12-16 3aed7236f2db67dd90115a39bc8f1465e4cc8b73
立库完成入库添加库区信息
5个文件已修改
173 ■■■■■ 已修改文件
src/main/java/com/zy/api/controller/KopenApiController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/KopenApiController.java
@@ -43,7 +43,6 @@
        return kopenApiService.receiveOrders(params);
    }
    /**
     * 上游下发零件数据变更
     * s
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.api.entity.OrderParams;
@@ -10,7 +9,6 @@
import com.zy.api.entity.ReportOrderParam;
import com.zy.api.entity.SyncMatParmas;
import com.zy.api.enums.MatLocType;
import com.zy.api.enums.MatType;
import com.zy.api.enums.OrderType;
import com.zy.api.enums.OrderWkType;
import com.zy.api.service.KopenApiService;
@@ -62,6 +60,7 @@
    /**
     * 上架派工单反馈
     *
     * @author Ryan
     * @date 2025/11/24 15:33
     */
@@ -95,14 +94,15 @@
        }
    }
     /* */
     /**
      * 备货指示派工单下发
      * @author Ryan
      * @date 2025/11/24 15:21
      * @param params
      * @return com.core.common.R
      */
    /* */
    /**
     * 备货指示派工单下发
     *
     * @author Ryan
     * @date 2025/11/24 15:21
     * @param params
     * @return com.core.common.R
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R sendOutDispatch(PubOrderParams params) {
@@ -121,12 +121,13 @@
        }
        addOrUpdateOrders(params, "add");
        return R.ok("备货指示派工单下发成功!!");
    }
    /**
     * 备货指示派工单
     *
     * @author Ryan
     * @date 2025/12/16 9:15
     * @param params
@@ -153,7 +154,8 @@
            // 删除旧订单明细
            if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) {
                throw new CoolException("订单明细删除失败!!");
            };
            }
            ;
            if (!orderService.deleteById(order.getId())) {
                throw new CoolException("原单据删除失败!!");
            }
@@ -231,7 +233,14 @@
            throw new CoolException("订单类型不能为空!!");
        }
        OrderParams orderParams = JSONObject.parseObject(JSONObject.toJSONString(params), OrderParams.class);
        Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderParams.getInv_no()));
        Order order = new Order();
        if (OrderType.ORDER_IN.type.equals(OrderWkType.getTypeVal(params.getType()))) {
            // 入库
          order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderParams.getInv_no()));
        } else if (OrderType.ORDER_OUT.type.equals(OrderWkType.getTypeVal(params.getType()))) {
            // 出库
           order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", orderParams.getDispatch_no()));
        }
        if (type.equals("add") && !Objects.isNull(order)) {
            throw new CoolException("单据已存在, 不可重复添加!!");
        }
@@ -256,10 +265,10 @@
    public static String generateUUID(OrderParams params) {
        return java.util.UUID.randomUUID().toString();
    }
    /**
     * 生成订单信息
     *
     * @param params
     */
    @Transactional(rollbackFor = Exception.class)
@@ -321,7 +330,7 @@
                orderItem.setBrand(matnr.getBrand());
                orderItem.setBatch(1 + "");
                orderItem.setStandby1(item.getPro_id());
                //关联上加派工单号+零件代码+供应商代码
                // 关联上加派工单号+零件代码+供应商代码
                orderItem.setThreeCode(item.getTotal_serial());
                // 供应商代码
                orderItem.setSuppCode(item.getPro_id());
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -599,6 +599,12 @@
        if (Objects.isNull(param.getBarcode())) {
            throw new CoolException("托盘码不能为空!!");
        }
        BasContainer container = basContainerService
                .selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
        if (Objects.isNull(container)) {
            throw new CoolException("数据错误:容器码不存在!!");
        }
        // if (param.getBarcode().length() != 8) {
        // throw new CoolException("条码长度不是8位===>>" + param.getBarcode());
        // }
@@ -1604,6 +1610,7 @@
        if (Objects.isNull(param.getBarcode())) {
            throw new CoolException("托盘码不能为空!!");
        }
        if (Objects.isNull(param.getCombMats()) || param.getCombMats().isEmpty()) {
            throw new CoolException("组托明细不能为空!!");
        }
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -4,6 +4,7 @@
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.enums.LocAreaType;
import com.zy.asrs.enums.LocStsType;
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.*;
@@ -60,6 +61,8 @@
    private WaitPakinLogService waitPakinLogService;
    @Autowired
    private BasStationDetlService basStationDetlService;
    @Autowired
    private BasAreasService basAreasService;
    public ReturnT<String> start(WrkMast wrkMast) {
        // 4.入库完成
@@ -75,6 +78,12 @@
    public ReturnT<String> doIn(WrkMast wrkMast) {
        Date now = new Date();
        LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_CRN.type));
        if (Objects.isNull(basAreas)) {
            throw new CoolException("数据错误:库区不存在!!");
        }
        locMast.setAreaId(basAreas.getId());
        locMast.setAreaName(basAreas.getName());
        try {
            if (null == locMast) {
                // exceptionHandle("工作档[workNo={0}]库位号错误[locNo={1}]", wrkMast.getWrkNo(),
@@ -122,7 +131,6 @@
                    }
                    // 遍历工作明细,更新库存明细和入库通知档
                    for (WrkDetl wrkDetl : wrkDetls) {
                        LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(),
                                wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(),
                                wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(),
@@ -233,6 +241,8 @@
                            locDetl.sync(wrkDetl);
                            locDetl.setLocNo(wrkMast.getLocNo()); // 库位号
                            locDetl.setAnfme(wrkDetl.getAnfme()); // 数量
                            locDetl.setAreaId(locMast.getAreaId());
                            locMast.setAreaName(locMast.getAreaName());
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
@@ -366,6 +376,8 @@
                            locDetl.sync(wrkDetl);
                            locDetl.setLocNo(wrkMast.getLocNo()); // 库位号
                            locDetl.setAnfme(wrkDetl.getAnfme()); // 数量
                            locDetl.setAreaId(locMast.getAreaId());
                            locMast.setAreaName(locMast.getAreaName());
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
src/main/resources/mapper/LocDetlMapper.xml
@@ -120,22 +120,22 @@
        </choose>
    </sql>
    <sql id="batchSeqA">
        <choose>
            <when test="batch != null and batch != ''">
                and a.batch = #{batch}
            </when>
            <otherwise>
                and (a.batch IS NULL OR a.batch = '')
            </otherwise>
        </choose>
        <choose>
            <when test="brand != null and brand != ''">
                and a.brand = #{brand}
            </when>
            <otherwise>
                and (a.brand IS NULL OR a.brand = '')
            </otherwise>
        </choose>
<!--        <choose>-->
<!--            <when test="batch != null and batch != ''">-->
<!--                and a.batch = #{batch}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.batch IS NULL OR a.batch = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        <choose>-->
<!--            <when test="brand != null and brand != ''">-->
<!--                and a.brand = #{brand}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.brand IS NULL OR a.brand = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
        <choose>
            <when test="standby1 != null and standby1 != ''">
                and a.standby1 = #{standby1}
@@ -144,46 +144,46 @@
                and (a.standby1 IS NULL OR a.standby1 = '')
            </otherwise>
        </choose>
        <choose>
            <when test="standby2 != null and standby2 != ''">
                and a.standby2 = #{standby2}
            </when>
            <otherwise>
                and (a.standby2 IS NULL OR a.standby2 = '')
            </otherwise>
        </choose>
        <choose>
            <when test="standby3 != null and standby3 != ''">
                and a.standby3 = #{standby3}
            </when>
            <otherwise>
                and (a.standby3 IS NULL OR a.standby3 = '')
            </otherwise>
        </choose>
        <choose>
            <when test="boxType1 != null and boxType1 != ''">
                and a.box_type1 = #{boxType1}
            </when>
            <otherwise>
                and (a.box_type1 IS NULL OR a.box_type1 = '')
            </otherwise>
        </choose>
        <choose>
            <when test="boxType2 != null and boxType2 != ''">
                and a.box_type2 = #{boxType2}
            </when>
            <otherwise>
                and (a.box_type2 IS NULL OR a.box_type2 = '')
            </otherwise>
        </choose>
        <choose>
            <when test="boxType3 != null and boxType3 != ''">
                and a.box_type3 = #{boxType3}
            </when>
            <otherwise>
                and (a.box_type3 IS NULL OR a.box_type3 = '')
            </otherwise>
        </choose>
<!--        <choose>-->
<!--            <when test="standby2 != null and standby2 != ''">-->
<!--                and a.standby2 = #{standby2}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.standby2 IS NULL OR a.standby2 = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        <choose>-->
<!--            <when test="standby3 != null and standby3 != ''">-->
<!--                and a.standby3 = #{standby3}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.standby3 IS NULL OR a.standby3 = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        <choose>-->
<!--            <when test="boxType1 != null and boxType1 != ''">-->
<!--                and a.box_type1 = #{boxType1}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.box_type1 IS NULL OR a.box_type1 = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        <choose>-->
<!--            <when test="boxType2 != null and boxType2 != ''">-->
<!--                and a.box_type2 = #{boxType2}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.box_type2 IS NULL OR a.box_type2 = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
<!--        <choose>-->
<!--            <when test="boxType3 != null and boxType3 != ''">-->
<!--                and a.box_type3 = #{boxType3}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (a.box_type3 IS NULL OR a.box_type3 = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
    </sql>
    <sql id="batchSeqNew">
        <choose>