自动化立体仓库 - WMS系统
skyouc
昨天 bfa307fb0fe82ce6f5a2ea354fcee43d9d1f0fa1
no message
18个文件已修改
389 ■■■■ 已修改文件
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocMastService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/StaDescService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderPakout/agvOut.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -463,7 +463,7 @@
        }
        newOrder.setUuid(generateUUID(params));
        newOrder.setShipName(type);
        newOrder.setShipName(params.getType());
        // 流水号(唯一)
        newOrder.setDefNumber(params.getKopen_id());
        newOrder.setTargetLocation(params.getTarget_location());
@@ -483,12 +483,13 @@
            throw new RuntimeException("新增订单失败!!");
        }
        if (!Objects.isNull(params.getDetails()) && !params.getDetails().isEmpty()) {
            List<OrderDetl> orderDetls = new ArrayList<>();
            params.getDetails().forEach(item -> {
                Mat matnr = matService.selectOne(new EntityWrapper<Mat>()
                        .eq("supp_code", item.getPro_id())
                        .eq("matnr", item.getPro_komcode()));
                if (Objects.isNull(matnr)) {
                    throw new CoolException("物料编码不存在!!");
                    throw new CoolException(item.getPro_komcode() + ",物料编码不存在,请维护后再推送!!");
                }
                OrderDetl orderItem = new OrderDetl();
                BeanUtils.copyProperties(matnr, orderItem);
@@ -528,7 +529,11 @@
                orderItem.setSuppCode(item.getPro_id());
                orderItem.setCreateTime(new Date());
                orderItem.setUpdateTime(new Date());
                if (!orderDetlService.insert(orderItem)) {
                orderDetls.add(orderItem);
            });
            orderDetls.forEach(orderDetl -> {
                if (!orderDetlService.insert(orderDetl)) {
                    throw new CoolException("订单明细新增失败!!");
                }
            });
src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
@@ -223,9 +223,9 @@
                            }
                        }
                        mast.setWrkSts(4L);
                    } else if ((mast.getIoType() == 54 || mast.getIoType() == 57) ) {
                    } else if ((mast.getIoType() == 54 || mast.getIoType() == 57) && !Objects.isNull(json) && json.getInteger("ioType") == 1 ) {
                        mast.setWrkSts(4L);
                    } else if (mast.getIoType() != 53 ) {
                    } else if (mast.getIoType() != 53 && mast.getIoType() != 54 && mast.getIoType() != 57) {
                        mast.setWrkSts(4L);
                    }
                }
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -222,15 +222,8 @@
        return mobileService.callAgvMove(params, getUserId());
    }
    /**
     * SO/EO入库
     * @author Ryan
     * @date 2026/4/3 14:53
     * @param params
     * @return com.core.common.R
     */
    @PostMapping("/collection/agv/call")
    @ApiOperation("SO/EO入库")
    @ApiOperation("集货区入库")
    @ManagerAuth
    public R CollectionInCall(@RequestBody AgvCallParams params) {
        if (Objects.isNull(params)) {
@@ -384,7 +377,7 @@
    }
    /**
     * 空板出库
     * 呼叫立库空板出库
     * @param params
     * @return
     */
@@ -461,7 +454,7 @@
    /**
     * @author Ryan
     * @date 2025/9/24
     * @description: 呼叫AGV返回
     * @description: 呼叫AGV返回/空车回库
     * @version 1.0
     */
    @ManagerAuth(memo = "呼叫AGV返回")
@@ -475,6 +468,7 @@
    @ManagerAuth(memo = "缓冲库确认上架(模拟物理按钮)")
    @RequestMapping("/cache/comb/pub")
    public R cacheCombPub(@RequestBody CompleteParam combParam) {
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -63,5 +63,5 @@
     */
    String findFirstFrozenLocNo(@Param("locNoList") List<String> locNoList);
    LocMast selectNotFull(@Param("locType")Long locType, @Param("id")Long id);
    LocMast selectNotFull(@Param("locType")Long locType, @Param("id")Long id, @Param("locs") List<String> locs);
}
src/main/java/com/zy/asrs/service/LocMastService.java
@@ -71,5 +71,5 @@
     * @param id
     * @return com.zy.asrs.entity.LocMast
     */
    LocMast selectNotFull(Long locType, Long id);
    LocMast selectNotFull(Long locType, Long id, List<String> locs);
}
src/main/java/com/zy/asrs/service/StaDescService.java
@@ -1,6 +1,7 @@
package com.zy.asrs.service;
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.StaDesc;
import java.util.List;
@@ -15,4 +16,5 @@
    StaDesc queryCrnStn(Integer crnNo);
    StaDesc queryCrnStnByLoc(Integer ioType, LocMast locMast, Integer outSta);
}
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -119,8 +119,8 @@
    }
    @Override
    public LocMast selectNotFull(Long locType, Long id) {
        return this.baseMapper.selectNotFull(locType, id);
    public LocMast selectNotFull(Long locType, Long id, List<String> locs) {
        return this.baseMapper.selectNotFull(locType, id, locs );
    }
    @Override
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1454,7 +1454,13 @@
                    .eq("ctn_type", mat.getTagId())
                    .eq("dev_no", params.getTarSite()));
            if (Objects.isNull(station)) {
//                throw new CoolException("!!");
                continue;
            }
            Task task = taskService.selectOne(new EntityWrapper<Task>().eq("source_sta_no", station.getDevNo()).or().eq("sta_no", station.getDevNo()));
            if (!Objects.isNull(task)) {
                throw new CoolException("当前站点上一个任务未完成!!");
            }
            /**生成缓存区出库任务*/
@@ -1485,7 +1491,8 @@
        List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type)
                .eq("area_id", basAreas.getId()));
                .eq("area_id", basAreas.getId())
                .orderAsc(Arrays.asList("modi_time")));
        if (locCaches.isEmpty()) {
            throw new CoolException("暂无空板库位");
        }
@@ -1508,12 +1515,10 @@
        if (Objects.isNull(params.getOrgSite())) {
            throw new CoolException("源站点不能为空!!");
        }
        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("name", params.getTarSite()));
        if (Objects.isNull(basAreas)) {
            return R.error("站点不存在,请检查站点是否输入正确!!");
        }
        List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                .eq("area_id", basAreas.getId()));
@@ -1591,15 +1596,11 @@
        });
        // 修改目标库位状态
        if (loc.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
            loc.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约
            loc.setModiTime(new Date());
            loc.setModiUser(userId);
            if (!locCacheService.update(loc, new EntityWrapper<LocCache>().eq("loc_no", loc.getLocNo()))) {
                throw new CoolException("更新目标库位状态失败");
            }
        } else {
            throw new CoolException("移转失败,目标库位状态:" + loc.getLocSts$());
        }
        // 修改原站点信息
@@ -1883,7 +1884,7 @@
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("请输入正确的站点号");
        }
        if (basStation.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type) || basStation.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type)) {
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", params.getOrgBarcode()));
        if (Objects.isNull(wrkMast)) {
            throw new CoolException("出库任务档信息不存在!!");
@@ -1899,7 +1900,12 @@
                throw new CoolException("未找到备货入库单");
            }
                try {
            UpdateDetailsOfPakin(orderPakin, combMat);
                } catch (Exception e) {
                    log.error(e.getMessage());
                    throw new CoolException(e.getMessage());
                }
            BasStationDetl basStationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>()
                    .eq("dev_no", basStation.getDevNo())
@@ -1957,6 +1963,9 @@
            basStation.setBarcode(params.getTarBarcode());
            basStation.setLocSts(LocStsType.LOC_STS_TYPE_F.type);
            basStationService.updateById(basStation);
            }
        } else {
            throw new CoolException("当前站点不是在库状态,无法绑定台车!!");
        }
        return R.ok();
@@ -2296,7 +2305,12 @@
                    });
                } else {
                    // 获取当前供应商+ 物料在库
                    LocMast notFullList = locMastService.selectNotFull(mats.getLocType(), one.getId());
                    List<String> locs = new ArrayList<>();
                    if (!locMasts.isEmpty()) {
                        locs = locMasts.stream().map(CrnTaskDetlDTO::getLocNo).collect(Collectors.toList());
                    }
                    LocMast notFullList = locMastService.selectNotFull(mats.getLocType(), one.getId(), locs);
                    if (Objects.isNull(notFullList)) {
                        continue;
                    }
@@ -2305,6 +2319,11 @@
                    if (Objects.isNull(container)) {
                        throw new CoolException("数据错误,容器不存在!!");
                    }
//                    notFullList.setLocSts(LocStsType.LOC_STS_TYPE_R.type);
//                    if (!locMastService.update(notFullList, new EntityWrapper<LocMast>().eq("loc_no", notFullList.getLocNo()))) {
//                        throw new CoolException("预约出库失败!!");
//                    }
                    List<LocDetl> adetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", notFullList.getLocNo()));
                    Set<String> sets = adetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet());
                    List<LocDetl> locDtls = new ArrayList<>();
@@ -2335,13 +2354,17 @@
                }
            }
        });
        Integer whyType = 2;
        if (station.getId().equals(124L) || station.getId().equals(125L)) {
            whyType = 1;
        }
        /**是否优先空板出库*/
        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "OutStockOrderByEmpty"));
        if (!Objects.isNull(config) && Boolean.parseBoolean(config.getValue())) {
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                    // todo 根据物料种类,区分库区类型
                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type)
                    .eq("whs_type", whyType)
                    .orderAsc(Arrays.asList("row1", "bay1", "lev1"))
                    .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
@@ -2361,6 +2384,7 @@
                LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                        // todo 根据物料种类,区分库区类型
                        .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type)
                        .eq("whs_type", whyType)
                        .orderAsc(Arrays.asList("row1", "bay1", "lev1"))
                        .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
@@ -2399,7 +2423,8 @@
            if (Cools.isEmpty(wrkMast1)) {
                Integer outSta = devp.getDevNo();
                // 获取路径
                StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta);
                StaDesc staDesc = staDescService.queryCrnStnByLoc(ioType, locMast, outSta);
//                StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta);
                // 生成工作档
                WrkMast wrkMast = new WrkMast();
@@ -2529,22 +2554,22 @@
        loc.setModiUser(userId);
        loc.setModiTime(new Date());
//        if (!) {
//            throw new CoolException("更新库位状态信息!!");
//        }
        locCacheService.update(loc, new EntityWrapper<LocCache>().eq("loc_no", loc.getLocNo()));
        if (!locCacheService.update(loc, new EntityWrapper<LocCache>().eq("loc_no", loc.getLocNo()))) {
            throw new CoolException("更新库位状态信息!!");
        }
        // 修改目标站点信息
        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
//        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
//
//        } else {
//            log.error("移转失败,目标库位状态:" + station.getLocSts());
//            throw new CoolException("移转失败,目标库位状态:" + station.getLocSts());
//        }
            station.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {
                throw new CoolException("更新目标库位状态失败");
            }
        } else {
            log.error("移转失败,目标库位状态:" + station.getLocSts());
//            throw new CoolException("移转失败,目标库位状态:" + station.getLocSts());
        }
    }
@@ -2651,6 +2676,7 @@
            // 修改目标库位状态
            loc.setLocSts(LocStsType.LOC_STS_TYPE_D.type); // S.入库预约
            loc.setModiTime(new Date());
            loc.setBarcode(barcode);
            loc.setModiUser(userId);
            if (!locCacheService.update(loc, new EntityWrapper<LocCache>().eq("loc_no", loc.getLocNo()))) {
                throw new CoolException("更新目标库位状态失败");
@@ -2661,11 +2687,12 @@
            if (Objects.isNull(station)) {
                throw new CoolException("站点不存在!!");
            }
            station.setLocSts("O");
            station.setBarcode(barcode);
            station.setLocSts(LocStsType.LOC_STS_TYPE_O.type); // S.入库预约
            station.setBarcode("");
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {
            if (!basStationService.update(station, new EntityWrapper<BasStation>().eq("dev_no", orgSite))) {
                throw new CoolException("更新目标库位状态失败");
            }
            basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
@@ -2753,13 +2780,9 @@
        if (Objects.isNull(station)) {
            throw new CoolException("站点不存在!!");
        }
        try {
            //空台车回库
            generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId, "M2");
        } catch (Exception e) {
            log.error(e.getMessage());
            throw new CoolException(e.getMessage());
        }
        return R.ok(locCache);
    }
@@ -3024,14 +3047,28 @@
                .eq("dev_no", params.getOrgSite())
                .eq("barcode", params.getCarBarcode()));
        if (Objects.isNull(station)) {
            throw new CoolException("台车与站点绑定关系不存在,请联系管理员!");
            LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("dev_no", params.getOrgSite()));
            if (!Objects.isNull(locCache)) {
                BasAreas whsTypeId = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
                if (Objects.isNull(whsTypeId)) {
                    throw new CoolException("库区不存在!!");
        }
                List<LocDetl>  locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                                .eq("area_id", whsTypeId.getId())
                        .eq("dev_no", params.getOrgSite()));
                if (!locDetls.isEmpty()) {
                    return R.ok().add(locDetls);
                }
            }
        } else {
        List<BasStationDetl> stationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>()
                .like(!Cools.isEmpty(params.getMatnr()), "matnr", params.getMatnr())
                .eq("dev_no", station.getDevNo()));
        if (!stationDetls.isEmpty()) {
            return R.ok().add(stationDetls);
        }
        }
        return R.ok();
    }
@@ -3119,7 +3156,7 @@
                    }
                }
            } else {
                throw new CoolException("订单明细绑定关系不存在或已完成入库!!");
                throw new CoolException("订单明细绑定关系不存在!!");
            }
        }
        return R.ok();
@@ -3235,8 +3272,8 @@
                                    detl.setSupp(combMat.getSuppCode());
                                    if (!taskDetlService.update(detl, new EntityWrapper<TaskDetl>()
                                            .eq("matnr", detl.getMatnr())
                                            .eq("order_no", detl.getOrderNo())
                                            .eq("supp_code", detl.getSuppCode())
                                            .eq("order_no", detl.getOrderNo())
                                            .eq("wrk_no", task.getWrkNo()))) {
                                        throw new CoolException("任务号信息更新失败!!");
                                    }
src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.StaDesc;
import com.zy.asrs.mapper.StaDescMapper;
import com.zy.asrs.service.StaDescService;
@@ -21,6 +22,19 @@
    }
    @Override
    public StaDesc queryCrnStnByLoc(Integer typeNo, LocMast crnNo, Integer stnNo) {
        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
                .eq("type_no", typeNo)
                .eq("stn_no", stnNo)
                .eq("crn_no", crnNo.getCrnNo());
        StaDesc staDesc = this.selectOne(wrapper);
        if (staDesc == null) {
            throw new CoolException(crnNo.getLocNo() +  ",出库路径不存在");
        }
        return staDesc;
    }
    @Override
    public StaDesc queryCrnStn(Integer typeNo, Integer crnNo, Integer stnNo) {
        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
                .eq("type_no", typeNo)
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -164,18 +164,18 @@
            locNo = wrkMast.getLocNo();
            locSts = "O";
//            // 库位转移
//            if (wrkMast.getIoType() == 11) {
//                // 库位转移:源库位
//                LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getSourceLocNo()));
//                if (Cools.isEmpty(locMast)) {
//                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
//                }
//                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F");
//                locMast.setModiTime(now);
//                locMast.setModiUser(userId);
//                locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()));
//            }
            // 库位转移
            if (wrkMast.getIoType() == 11) {
                // 库位转移:源库位
                LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getSourceLocNo()));
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
                }
                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F");
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()));
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (station.getLocSts().equals("R")) {
@@ -213,6 +213,7 @@
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo()));
            if (station.getLocSts().equals("S")) {
            station.setLocSts("O");
            station.setBarcode("");
            station.setModiTime(new Date());
@@ -220,6 +221,9 @@
            if (!basStationService.updateById(station)) {
                throw new CoolException("更新源站点状态失败");
            }
            } else {
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
        } else if (wrkMast.getIoType() == 1) {
            List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
            for (WaitPakin waitPakin : waitPakins) {
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -1544,6 +1544,22 @@
        wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57
        wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走
        wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站
//        if (wrkMast.getIoType() == 107) {
//            // 修改库位状态 Q.拣料/盘点/并板再入库
//            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo()));
//            if (Cools.isEmpty(locMast)) {
//                throw new CoolException("库位不存在:" + wrkMast.getLocNo());
//            }
//            locMastService.selectOne(new EntityWrapper<LocMast>()
//                            .eq("loc_sts", )
//                    .eq("whs_type", locMast.getWhsType()));
//
//
//        } else {
//            //        wrkMast.setStaNo(staNo + ""); // 目标站
//            wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位
//            wrkMast.setSourceLocNo(""); // 源库位清空
//        }
//        wrkMast.setStaNo(staNo + ""); // 目标站
        wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位
        wrkMast.setSourceLocNo(""); // 源库位清空
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -185,7 +185,6 @@
                                    wrkDetl.getStandby3(),
                                    wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3());
                        }
                        try {
                            if (!Cools.isEmpty(orderDetlPakin)) {
                                if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(),
                                        wrkDetl.getMatnr(),
@@ -199,9 +198,6 @@
                                    return FAIL.setMsg("全板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo()
                                            + "],[locNo=" + wrkMast.getLocNo() + "]");
                                }
                            }
                        } catch (Exception ignore) {
                        }
                    }
                    // 修改库位状态 S ====>> F
@@ -452,27 +448,27 @@
                        }
                    }
                    String agvSta = null;
                    if (wrkMast.getIoType().equals(TaskIOType.MERGE_IN.type)) {
                        agvSta = wrkMast.getPauseMk();
                    }
                    List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", agvSta));
                    if (Objects.isNull(basStationDetls) || basStationDetls.isEmpty()) {
                        // . 删除缓存站点明细
                        if (!Objects.isNull(agvSta)) {
                            // 修改目标站点信息
                            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", agvSta));
                            if (Objects.isNull(station)) {
                                throw new CoolException("站点不存在!!");
                            }
                            basStationDetlService.delete(new EntityWrapper<BasStationDetl>()
                                    .eq("dev_no", station.getDevNo()));
                            station.setLocSts(LocStsType.LOC_STS_TYPE_D.type);
                            if (!basStationService.updateById(station)) {
                                throw new CoolException("站点状态更新失败!!");
                            }
                        }
                    }
//                    String agvSta = null;
//                    if (wrkMast.getIoType().equals(TaskIOType.MERGE_IN.type)) {
//                        agvSta = wrkMast.getPauseMk();
//                    }
//                    List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", agvSta));
//                    if (Objects.isNull(basStationDetls) || basStationDetls.isEmpty()) {
//                        // . 删除缓存站点明细
//                        if (!Objects.isNull(agvSta)) {
//                            // 修改目标站点信息
//                            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", agvSta));
//                            if (Objects.isNull(station)) {
//                                throw new CoolException("站点不存在!!");
//                            }
//                            basStationDetlService.delete(new EntityWrapper<BasStationDetl>()
//                                    .eq("dev_no", station.getDevNo()));
//                            station.setLocSts(LocStsType.LOC_STS_TYPE_D.type);
//                            if (!basStationService.updateById(station)) {
//                                throw new CoolException("站点状态更新失败!!");
//                            }
//                        }
//                    }
                    break;
                // 盘点入库
                case 57:
@@ -1081,6 +1077,7 @@
            }
            return SUCCESS;
        }
        if (wrkMast.getTaskType().equals("agv_back")) {
            wrkMast.setWrkSts(TaskStatusType.AGV_INVENTORY_UPDATED_IN.type);
            wrkMast.setModiTime(new Date());
@@ -1089,6 +1086,7 @@
            }
            return SUCCESS;
        }
        LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo()));
        if (!Objects.isNull(wrkMast.getSourceStaNo())) {
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
@@ -1099,10 +1097,10 @@
                    station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
                }
                station.setBarcode("");
//                basStationService.updateById(station);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("站点状态修改失败!!");
                }
                basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
            }
        }
src/main/java/com/zy/common/service/CommonService.java
@@ -216,7 +216,97 @@
                .le("row1", rowLastno.geteRow())
                .eq("loc_type1", locTypeDto.getLocType1())
                .eq("loc_sts", "O")
                .orderAsc(Arrays.asList("lev1", "row1", "bay1"));
                .orderAsc(Arrays.asList( "row1", "bay1","lev1"));
        if (locTypeDto.getLocType1() != 2) {
            wrapper.eq("crn_no", crnNo);
        }
        locMast = locMastService.selectOne(wrapper);
        // int crnCountO = wrkMastService.selectCount(new
        // EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
        // 生成工作号
        int workNo;
        if (whsType == 2) {
            // 生成工作号
            workNo = getWorkNo(3);
        } else {
            // 生成工作号
            workNo = getWorkNo(0);
        }
        // 返回dto
        startupDto.setWorkNo(workNo);
        startupDto.setCrnNo(locMast.getCrnNo());
        startupDto.setSourceStaNo(sourceStaNo);
        startupDto.setLocNo(locMast.getLocNo());
        return startupDto;
    }
    public StartupDto getChecklocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo,
                                  FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        staDescId = 1;
        // 初始化参数
        int crnNo = 0; // 堆垛机号
        int nearRow = 0; // 最浅库位排
        LocMast locMast = null; // 目标库位
        RowLastno rowLastno = rowLastnoService.selectById(whsType);
        if (Cools.isEmpty(rowLastno)) {
            throw new CoolException("数据异常,请联系管理员===>库位规则未知");
        }
        int minCount = Integer.MAX_VALUE;
        if (whsType == 2) {
            if (locTypeDto.getLocType1() == 2) {
                // 均衡分布堆垛机
                for (int i = 4; i <= 5; i++) {
                    int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
                    if (count < minCount) {
                        minCount = count;
                        crnNo = i;
                    }
                }
            } else {
                for (int i = 4; i <= 6; i++) {
                    int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
                    if (count < minCount) {
                        minCount = count;
                        crnNo = i;
                    }
                }
                if (crnNo == 6) {
                    return getDoubleLocNoRun(3, 1, sourceStaNo, findLocNoAttributeVo, null, locTypeDto, times);
                }
            }
        } else {
            // 均衡分布堆垛机
            for (int i = rowLastno.getsCrnNo(); i <= rowLastno.geteCrnNo(); i++) {
                int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
                if (count < minCount) {
                    minCount = count;
                    crnNo = i;
                }
            }
        }
        StartupDto startupDto = new StartupDto();
//        new EntityWrapper<LocMast>(new EntityWrapper<LocMast>()
//                .ge("row1", rowLastno.getsRow())
//                .le("row1", rowLastno.geteRow())
//                .eq("crn_no", crnNo)
//                .eq("loc_type1", locTypeDto.getLocType1())
//                .eq("loc_sts", "O")
//                .orderAsc(Arrays.asList("lev1", "row1", "bay1")))
        Wrapper<LocMast> wrapper = new EntityWrapper<LocMast>()
                .ge("row1", rowLastno.getsRow())
                .le("row1", rowLastno.geteRow())
                .eq("loc_type1", locTypeDto.getLocType1())
                .eq("loc_sts", "O")
                .orderAsc(Arrays.asList( "row1", "bay1","lev1"));
        if (locTypeDto.getLocType1() != 2) {
            wrapper.eq("crn_no", crnNo);
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
@@ -89,24 +89,24 @@
                logger.info("++++++++ 许可证加载结束 ++++++++");
                logger.info("++++++++ 许可证加载标记,搜索修改 ++++++++");
                licenseTimer.setSystemSupport(true);
                licenseTimer.setLicenseDays(9999);
                return true;
//                licenseTimer.setSystemSupport(true);
//                licenseTimer.setLicenseDays(9999);
//                return true;
//                licenseTimer.setSystemSupport(install!=null);
//
//                if (install != null) {
//                    Date start = new Date();
//                    Date end = install.getNotAfter();
//                    Long starTime = start.getTime();
//                    Long endTime = end.getTime();
//                    Long num = endTime - starTime;//时间戳相差的毫秒数
//                    int day = (int) (num / 24 / 60 / 60 / 1000);
//                    licenseTimer.setLicenseDays(day);
//                }
                licenseTimer.setSystemSupport(install!=null);
                if (install != null) {
                    Date start = new Date();
                    Date end = install.getNotAfter();
                    Long starTime = start.getTime();
                    Long endTime = end.getTime();
                    Long num = endTime - starTime;//时间戳相差的毫秒数
                    int day = (int) (num / 24 / 60 / 60 / 1000);
                    licenseTimer.setLicenseDays(day);
                }
//                return install != null;
                return install != null;
            } catch (Exception e) {
                return false;
            }
src/main/resources/application-dev.yml
@@ -12,8 +12,8 @@
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    username: sa
    password: sa@123
#    url: jdbc:sqlserver://192.168.238.32:1433;databasename=jsxsasrs
    url: jdbc:sqlserver://192.168.4.15:1433;databasename=jsxsasrs
    url: jdbc:sqlserver://192.168.238.31:1433;databasename=jsxsasrs
#    url: jdbc:sqlserver://192.168.4.34:1433;databasename=jsxsasrs
  mvc:
    static-path-pattern: /**
  redis:
src/main/resources/mapper/LocDetlMapper.xml
@@ -318,6 +318,7 @@
        <include refid="batchSeqA"></include>
        <if test="locNos != null and locNos.size > 0">
            and b.loc_no not in
            <foreach item="item" collection="locNos" index="index"  separator="," open="(" close=")">
@@ -336,7 +337,6 @@
            DATEPART( dd, a.modi_time ),
            a.anfme,b.lev1,b.bay1
        ASC
    </select>
    <select id="queryStockAllCache" resultMap="BaseResultMap">
src/main/resources/mapper/LocMastMapper.xml
@@ -221,7 +221,16 @@
        FROM
            asr_loc_mast
        WHERE
            barcode IN (SELECT zpallet  FROM asr_loc_detl ald INNER JOIN man_mat mt ON ald.matnr = mt.matnr AND ald.supp_code = mt.supp_code  WHERE mt.loc_type =#{locType}  AND area_id = #{id} GROUP BY zpallet HAVING COUNT ( * ) &lt; 2) ORDER BY loc_no, modi_time ASC
            barcode IN (SELECT zpallet  FROM asr_loc_detl ald
                INNER JOIN man_mat mt ON ald.matnr = mt.matnr AND ald.supp_code = mt.supp_code
                                        WHERE mt.loc_type =#{locType}  AND area_id = #{id} GROUP BY zpallet HAVING COUNT (*) &lt; 2)
        <if test="locs != null and locs.size > 0" >
            AND loc_no NOT IN
            <foreach collection="locs" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        ORDER BY loc_no, modi_time ASC
    </select>
</mapper>
src/main/webapp/static/js/orderPakout/agvOut.js
@@ -35,10 +35,10 @@
            ,{field: 'matnr', align: 'center',title: '商品编码', width: 160}
            ,{field: 'maktx', align: 'center',title: '商品名称', width: 200}
            ,{field: 'standby1', align: 'center',title: '供应商代码'}
            ,{field: 'specs', align: 'center',title: '规格',hide: true}
            ,{field: 'specs', align: 'center',title: '规格'}
            ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'}
            ,{field: 'workQty', align: 'center',title: '执行中', style: 'font-weight: bold'}
            ,{field: 'qty', align: 'center',title: '已完成', style: 'font-weight: bold'}
            ,{field: 'qty', align: 'center',title: '完成量', style: 'font-weight: bold'}
            ,{field: 'unit', align: 'center',title: '单位', hide: true}
            ,{field: 'barcode', align: 'center',title: '商品条码', hide: true}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160}