自动化立体仓库 - WMS系统
7cf2e143941e1548cc468992ada42106a27805a1..fee18a4910fe117f5f75780550fe3bd7c9d50fa1
1 天以前 zhou zhou
#出库单
fee18a 对比 | 目录
1 天以前 skyouc
no message
786c17 对比 | 目录
1 天以前 skyouc
no message
37db2b 对比 | 目录
1个文件已添加
10个文件已修改
445 ■■■■ 已修改文件
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/BasStationDetl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/AgvCallParams.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/CollectionPakinParams.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/CompleteParam.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 345 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -131,7 +131,7 @@
        newOrder.setNumber(params.getDispatch_no());
        // 箱号
        newOrder.setItemName(params.getPm_tktid());
        newOrder.setSettle(OrderSettle.ORDER_SETTLE_INIT.type);
        newOrder.setSettle(OrderSettle.ORDER_SETTLE_HOLDING.type);
        newOrder.setStatus(CommonEnum.COMMON_ENUM_Y.type);
        // 订单时间
        newOrder.setOrderTime(DateUtils.convert(new Date(), "yyyy-MM-dd HH:mm:ss"));
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -60,6 +60,18 @@
    @Resource
    private StaDescService staDescService;
    @PostMapping("/agv/collectionPakin/view")
    @ManagerAuth
    public R pdaAgvCollectionPakinView(@RequestBody CollectionPakinParams params){
        return mobileService.collectionPakinView(params);
    }
    @PostMapping("/agv/collectionPakin/auth")
    @ManagerAuth
    public R pdaAgvCollectionPakin(@RequestBody CollectionPakinParams params){
        return mobileService.collectionPakin(params, getUserId());
    }
    @PostMapping("/agv/callEmptyCar")
    @ManagerAuth
@@ -337,7 +349,7 @@
        if (Objects.isNull(combParam)) {
            return R.error("参数不能为空!!");
        }
        mobileService.combInPub(combParam, getUserId());
        mobileService.combInPub(combParam, 10031L);
        return R.ok("上架成功");
    }
@@ -358,7 +370,7 @@
    @RequestMapping("/pack/comb/auth")
    @ManagerAuth(memo = "下线组托")
    public R packComb(@RequestBody CombParam combParam){
        mobileService.packComb(combParam, getUserId());
        mobileService.packComb(combParam, 10031L);
        return R.ok("组托成功");
    }
src/main/java/com/zy/asrs/entity/BasStationDetl.java
@@ -8,6 +8,8 @@
import com.zy.system.entity.User;
import java.text.SimpleDateFormat;
import java.util.Date;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import com.core.common.SpringUtils;
import com.zy.system.service.UserService;
@@ -22,6 +24,7 @@
@Data
@TableName("agv_bas_station_detl")
@Accessors(chain = true)
public class BasStationDetl implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -35,7 +38,7 @@
     */
    @ApiModelProperty(value= "站点编码")
    @TableField("dev_no")
    private Integer devNo;
    private String devNo;
    /**
     * 数量
@@ -302,7 +305,7 @@
    public BasStationDetl() {}
    public BasStationDetl(Long id,Integer devNo,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double manLength,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long lineNumber,String standby1,String standby2,String standby3,String boxType1,String boxType2,String boxType3) {
    public BasStationDetl(Long id,String devNo,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double manLength,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long lineNumber,String standby1,String standby2,String standby3,String boxType1,String boxType2,String boxType3) {
        this.id = id;
        this.devNo = devNo;
        this.anfme = anfme;
src/main/java/com/zy/asrs/entity/param/AgvCallParams.java
@@ -23,6 +23,9 @@
    @ApiModelProperty("托盘码")
    private String barcode;
    @ApiModelProperty("台车托盘")
    private String carBarcode;
    @ApiModelProperty("BS编码")
    private String bsCode;
src/main/java/com/zy/asrs/entity/param/CollectionPakinParams.java
New file
@@ -0,0 +1,52 @@
package com.zy.asrs.entity.param;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class CollectionPakinParams {
    private String orgBarcode;
    private String tarBarcode;
    private String devNo;
    private List<CombMat> combMats;
    @Data
    public static class CombMat {
        private String orderNo;
        // 物料编号
        private String matnr = "";
        // 序列码
        private String batch = "";
        private String brand = "";
        private String standby1 = "";
        private String standby2 = "";
        private String standby3 = "";
        private String boxType1 = "1";
        private String boxType2 = "1";
        private String boxType3 = "1";
        // 物料数量
        private BigDecimal anfme;
        // 物料数量
        private BigDecimal workQty;
        // 商品名称
        private String maktx;
        // 规格
        private String specs;
        private String threeCode;
    }
}
src/main/java/com/zy/asrs/entity/param/CompleteParam.java
@@ -14,6 +14,8 @@
    private String station;
    private String carBarcode;
    private Integer IoType;
}
src/main/java/com/zy/asrs/service/MobileService.java
@@ -148,4 +148,8 @@
     * @date 2025/12/9 15:04
     */
    void combInPub(CompleteParam combParam, Long userId);
    R collectionPakin(CollectionPakinParams params, Long userId);
    R collectionPakinView(CollectionPakinParams params);
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -593,9 +593,14 @@
            throw new CoolException("条码长度不是8位===>>" + param.getBarcode());
        }
        if (Objects.isNull(param.getType())) {
            param.setType("0");
        }
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode()));
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>()
                .eq(!Objects.isNull(param.getType()), "type", param.getType())
                .eq("zpallet", param.getBarcode()));
        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
            throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode());
        }
@@ -726,6 +731,8 @@
                waitPakin.setOrderId(detlDto.getOrderId());
                waitPakin.setBatch(detlDto.getBatch());     // 序列码
                waitPakin.setZpallet(param.getBarcode());   // 托盘码
                waitPakin.setThreeCode(detlDto.getThreeCode());
                waitPakin.setSuppCode(detlDto.getStandby1());
                waitPakin.setIoStatus("N");     // 入出状态
                waitPakin.setAnfme(detlDto.getAnfme());  // 数量
                waitPakin.setStatus("Y");    // 状态
@@ -1272,6 +1279,7 @@
     * @version 1.0
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R OutCallAgv(AgvCallParams params, Long userId) {
        /**获取入库最早的一条数据**/
        LocCache locCaches = locCacheService.selectOne(new EntityWrapper<LocCache>()
@@ -1339,29 +1347,125 @@
    }
    @Override
//    @Transactional(rollbackFor = Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public R collectionInCall(AgvCallParams params, Long userId) {
        if (Objects.isNull(params.getOrgSite())) {
            throw new CoolException("源站点不能为空!!");
        }
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", params.getBarcode()));
        if (!tasks.isEmpty()) {
            throw new CoolException("托盘码已生成任务");
        }
        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("name", params.getTarSite()));
        List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_D.type)
                .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                .eq("area_id", basAreas.getId()));
        if (locCaches.isEmpty()) {
            throw new CoolException("当前暂无空库位!!");
        }
        generateAgvTask("agv", locCaches.get(0), params.getOrgSite(), params.getBarcode(), userId);
        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", params.getOrgSite()));
        if (Objects.isNull(station)) {
            throw new CoolException("源站点未检索到数据!!");
        }
        generateSOEOInTask("agv", locCaches.get(0), params.getOrgSite(), station.getBarcode(), userId);
        return R.ok();
    }
    @Transactional(rollbackFor = Exception.class)
    public void generateSOEOInTask(String type, LocCache loc, String orgSite, String barcode, Long userId) {
        List<BasStationDetl> basStationDetls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", orgSite));
        if (Objects.isNull(basStationDetls) || basStationDetls.isEmpty()) {
            throw new CoolException("站点信息不存在!!");
        }
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode));
        if (!tasks.isEmpty()) {
            throw new CoolException("托盘已在任务执行中..");
        }
        // 获取工作号
        int workNo = commonService.getWorkNo(WorkNoType.PICK.type);
        // 保存工作档
        Task task = new Task();
        task.setWrkNo(workNo)
                .setIoTime(new Date())
                .setWrkSts(1L) // 工作状态:11.生成出库ID
                .setIoType(1) // 入出库状态: 11.库格移载
                .setTaskType("agv")
                .setIoPri(10D)
                .setLocNo(loc.getLocNo()) // 目标库位
                .setFullPlt("Y") // 满板:Y
                .setPicking("N") // 拣料
                .setExitMk("N")// 退出
                .setSourceStaNo(orgSite)
                .setEmptyMk(loc.getLocSts().equals("D") ? "Y" : "N")// 空板
                .setBarcode(barcode)// 托盘码
                .setLinkMis("N")
                .setAppeUser(userId)
                .setAppeTime(new Date())
                .setModiUser(userId)
                .setModiTime(new Date());
        if (!taskService.insert(task)) {
            throw new CoolException("保存工作档失败");
        }
        for (BasStationDetl basStationDetl : basStationDetls) {
            TaskDetl wrkDetl = new TaskDetl();
            BeanUtils.copyProperties(basStationDetl, wrkDetl);
            wrkDetl.setWrkNo(workNo)
                    .setIoTime(new Date())
                    .setOrderNo(basStationDetl.getOrderNo())
                    .setAnfme(basStationDetl.getAnfme())
                    .setZpallet(basStationDetl.getBarcode())
                    .setBatch(basStationDetl.getBatch())
                    .setMatnr(basStationDetl.getMatnr())
                    .setMaktx(basStationDetl.getMaktx())
                    .setStandby1(basStationDetl.getStandby1())
                    .setAppeUser(userId)
                    .setUnit(basStationDetl.getUnit())
                    .setModel(basStationDetl.getModel())
                    .setAppeTime(new Date())
                    .setModiUser(userId);
            //保存工作档明细
            if (!taskDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作档明细失败");
            }
        }
        // 修改目标库位状态
        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.updateById(loc)) {
                throw new CoolException("更新目标库位状态失败");
            }
        } else {
            throw new CoolException("移转失败,目标库位状态:" + loc.getLocSts$());
        }
        // 修改目标站点信息
        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", orgSite));
        if (Objects.isNull(station)) {
            throw new CoolException("站点不存在!!");
        }
        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type)) {
            station.setLocSts("R"); // S.入库预约
            station.setBarcode(barcode);
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {
                throw new CoolException("更新目标库位状态失败");
            }
        } else {
            throw new CoolException("移转失败,目标库位状态:" + station.getLocSts());
        }
    }
    /**
@@ -1388,8 +1492,8 @@
     */
    @Override
    public R combCacehList(AgvCallParams params) {
        if (Objects.isNull(params.getBarcode())) {
            throw new CoolException("托盘码不能为空!!");
        if (Objects.isNull(params.getCarBarcode())) {
            throw new CoolException("台车托盘码不能为空!!");
        }
        if (Objects.isNull(params.getBsCode())) {
            throw new CoolException("BS码不能为空!!");
@@ -1397,14 +1501,15 @@
        Task task = taskService.selectOne(new EntityWrapper<Task>()
                .eq("io_type", TaskIOType.PICK_OUT.type)
                .eq("wrk_sts", 14)
                .eq("barcode", params.getBarcode()));
                .eq("barcode", params.getCarBarcode()));
        if (Objects.isNull(task)) {
            throw new CoolException("数据错误:任务信息存在!!");
        }
        List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>()
                .eq("three_code", params.getBsCode())
                .eq("zpallet", params.getBarcode()));
                .eq("wrk_no", task.getWrkNo())
                .eq("zpallet", params.getCarBarcode()));
        if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) {
            throw new CoolException("当前BS编码不存在!!");
@@ -1457,22 +1562,46 @@
                detlDtos.add(detlDto);
            }
        });
        BasContainer container = basContainerService.selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
        if (Objects.isNull(container)) {
            throw new CoolException("数据错误:容器码不存在!!");
        }
        if (container.getMixMax() < detlDtos.size()) {
            throw new CoolException("超出容器最大混装数量,当前容器最大数量为:" + container.getMixMax() + "!!");
        }
        Set<String> matnrs = detlDtos.stream().map(DetlDto::getMatnr).collect(Collectors.toSet());
        List<Mat> mats = matService.selectList(new EntityWrapper<Mat>().in("matnr", matnrs));
        Set<Long> tagIds = mats.stream().map(Mat::getTagId).collect(Collectors.toSet());
        if (tagIds.size() > 1) {
            throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
        }
        //还可以放入多少种物料
        Integer suplus = container.getMixMax();
        Date now = new Date();
        for (DetlDto detlDto : detlDtos) {
            Mat mat = matService.selectByMatnr(detlDto.getMatnr());
            if (Cools.isEmpty(mat)) {
                throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
            }
            if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) {
                throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty());
            //最多可放数量
            Double singleMax = mat.getUpQty() * suplus;
            if (singleMax.compareTo(detlDto.getAnfme()) < 0) {
                throw new CoolException("物料:" + detlDto.getMatnr() + "单次组托上限为:" + mat.getUpQty() + ",当前总量超出托盘装载上限!!");
            }
            BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty());
            //当前物料需要占用料箱格数
            Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue();
            suplus = suplus - curr;
            if (suplus < 0) {
                throw new CoolException("物料:" + detlDto.getMatnr() + ", 超出当前托盘装载上限!!");
            }
            WaitPakin waitPakin = new WaitPakin();
            BeanUtils.copyProperties(mat, waitPakin);
            waitPakin.setBatch(detlDto.getBatch());
            waitPakin.setZpallet(param.getBarcode());
            //设置组托类型
            waitPakin.setType(CommonEnum.COMMON_ENUM_Y.type + "");
            waitPakin.setType(param.getType());
            waitPakin.setIoStatus("N");
            waitPakin.setAnfme(detlDto.getAnfme());
            waitPakin.setThreeCode(detlDto.getThreeCode());
@@ -1511,7 +1640,9 @@
            throw new CoolException("站点不能为空!!");
        }
        //TODO 修改缓存站点状态及数据
        Task task = taskService.selectOne(new EntityWrapper<Task>().eq("barcode", param.getBarcode()));
        Task task = taskService.selectOne(new EntityWrapper<Task>()
                .eq("wrk_sts", 14L)
                .eq("barcode", param.getCarBarcode()));
        if (Objects.isNull(task)) {
            throw new CoolException("数据错误,任务不存在!!");
        }
@@ -1530,10 +1661,7 @@
        if (!basStationService.updateById(station)) {
            throw new CoolException("站点状态修改失败!");
        }
        if (!basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()))) {
            throw new CoolException("站点删除失败!");
        }
        basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
        //任务完成
        task.setWrkSts(15L);
@@ -1542,12 +1670,131 @@
            throw new CoolException("AGV任务完成失败!!");
        }
        List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("barcodee", param.getBarcode()));
        List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
        if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) {
            throw new CoolException("数据错误,组拖档已不存在!!");
        }
        generateCrnInTask(waitPakins, station, param.getLocType1(), userId);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R collectionPakin(CollectionPakinParams params, Long userId) {
        List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("barcode", params.getTarBarcode()));
        if (basStations.isEmpty() && Cools.isEmpty(params.getDevNo())) {
            throw new CoolException("请输入站点号");
        }
        BasStation basStation = null;
        if (!basStations.isEmpty()) {
            basStation =  basStations.get(0);
        }else {
            basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", params.getDevNo()));
        }
        if (Cools.isEmpty(basStation)){
            throw new CoolException("请输入正确的站点号");
        }
        for (CollectionPakinParams.CombMat combMat : params.getCombMats()) {
            if (combMat.getWorkQty().compareTo(BigDecimal.ZERO) == 0) {
                continue;
            }
            OrderPakin orderPakin = orderPakinService.selectByNo(combMat.getOrderNo());
            if (Cools.isEmpty(orderPakin)) {
                throw new CoolException("未找到备货入库单");
            }
            UpdateDetailsOfPakin(orderPakin,combMat);
            BasStationDetl basStationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>()
                    .eq("dev_no", basStation.getDevNo())
                    .eq("matnr", combMat.getMatnr())
                    .eq("batch", combMat.getBatch())
                    .eq("standby1", combMat.getStandby1())
            );
            if (Cools.isEmpty(basStationDetl)) {
                basStationDetl = new BasStationDetl();
                Mat mat = matService.selectByMatnr(combMat.getMatnr());
                BeanUtils.copyProperties(mat,basStationDetl);
                basStationDetl
                        .setOrderNo(orderPakin.getOrderNo())
                        .setDevNo(basStation.getDevNo())
                        .setBarcode(params.getTarBarcode())
                        .setBatch(combMat.getBatch())
                        .setStandby1(combMat.getStandby1())
                        .setAnfme(combMat.getWorkQty().doubleValue())
                ;
                if (!basStationDetlService.insert(basStationDetl)){
                    throw new CoolException("插入明细失败");
                }
            }else {
                BigDecimal anfme = new BigDecimal(basStationDetl.getAnfme().toString()).add(combMat.getWorkQty());
                basStationDetl.setAnfme(anfme.doubleValue());
                if (!basStationDetlService.updateById(basStationDetl)){
                    throw new CoolException("更新明细数据失败");
                }
            }
        }
        if (basStation.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type) || basStation.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
            basStation.setBarcode(params.getTarBarcode());
            basStation.setLocSts(LocStsType.LOC_STS_TYPE_F.type);
            basStationService.updateById(basStation);
        }
        return R.ok();
    }
    @Transactional(rollbackFor = Exception.class)
    public void UpdateDetailsOfPakin(OrderPakin orderPakin,CollectionPakinParams.CombMat combMat){
        OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                .eq("order_id", orderPakin.getId())
                .eq("matnr", combMat.getMatnr())
                .eq("batch", combMat.getBatch())
                .eq("standby1", combMat.getStandby1())
        );
        if (Cools.isEmpty(orderDetlPakin)) {
            throw new CoolException("检索单据明细数据失败");
        }
        if (orderDetlPakin.getWorkQty() >= orderDetlPakin.getAnfme()) {
            throw new CoolException("请勿超出订单明细数量");
        }
        BigDecimal workQty = new BigDecimal(orderDetlPakin.getWorkQty().toString()).add(combMat.getWorkQty());
        orderDetlPakin.setWorkQty(workQty.doubleValue());
        if (!orderDetlPakinService.updateById(orderDetlPakin)){
            throw new CoolException("更新单据明细数据失败");
        }
        if (!orderPakin.getSettle().equals(2L)){
            orderPakin.setSettle(2L);
            if (!orderPakinService.updateById(orderPakin)){
                throw new CoolException("更新单据状态失败");
            }
        }
    }
    @Override
    public R collectionPakinView(CollectionPakinParams params) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(params.getOrgBarcode());
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException("未找到任务");
        }
        if (wrkMast.getIoType().equals(TaskIOType.ALL_OUT.type) && wrkMast.getIoType().equals(TaskIOType.PICK_OUT.type)){
            throw new CoolException("人物类型错误");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
        if (Cools.isEmpty(wrkDetls)) {
            throw new CoolException("未找到任务明细");
        }
        return R.ok(wrkDetls);
    }
    /**
@@ -1558,10 +1805,11 @@
     * @date 2025/12/9 13:54
     */
    @Transactional(rollbackFor = Exception.class)
    public void generateCrnInTask(List<WaitPakin> waitPakins, BasStation station, Short locType,  Long userId) {
    public void generateCrnInTask(List<WaitPakin> waitPakins, BasStation station, Short locType, Long userId) {
        Date now = new Date();
        StationRela rela = stationRelaService.selectOne(new EntityWrapper<StationRela>()
                .eq("dev_no", station.getDevNo())
                .eq("agv_sta", station.getDevNo())
                .orderAsc(Arrays.asList("crn_sta"))
                .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
        if (Objects.isNull(rela)) {
@@ -1574,7 +1822,7 @@
        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
        WaitPakin pakin = waitPakins.stream().findFirst().get();
        FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(pakin);
        StartupDto dto = commonService.getLocNo( 1, sourceStaNo.getDevNo(),findLocNoAttributeVo, locTypeDto);
        StartupDto dto = commonService.getLocNo(1, sourceStaNo.getDevNo(), findLocNoAttributeVo, locTypeDto);
        int workNo = dto.getWorkNo();
        // 生成工作档
        WrkMast wrkMast = new WrkMast();
@@ -1617,7 +1865,7 @@
        });
        // 更新入库通知档 ioStatus ===>> Y
        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
                .eq("zpallet", pakin.getBarcode());
                .eq("zpallet", pakin.getZpallet());
        WaitPakin setParam = new WaitPakin();
        setParam.setLocNo(dto.getLocNo());
        setParam.setIoStatus("Y");
@@ -1628,19 +1876,19 @@
        // 更新源站点信息
        sourceStaNo.setWrkNo(workNo);
        sourceStaNo.setModiTime(now);
        if (!basDevpService.updateById(sourceStaNo)){
        if (!basDevpService.updateById(sourceStaNo)) {
            throw new CoolException("更新源站失败");
        }
        // 更新目标库位状态
        LocMast locMast = locMastService.selectById(dto.getLocNo());
        if (locMast.getLocSts().equals("O")){
        if (locMast.getLocSts().equals("O")) {
            locMast.setLocSts("S"); // S.入库预约
            locMast.setModiTime(now);
            if (!locMastService.updateById(locMast)){
            if (!locMastService.updateById(locMast)) {
                throw new CoolException("改变库位状态失败");
            }
        } else {
            throw new CoolException(dto.getLocNo()+"目标库位已被占用");
            throw new CoolException(dto.getLocNo() + "目标库位已被占用");
        }
    }
@@ -1666,7 +1914,7 @@
        }
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                .eq("area_id", basAreas.getId())
                .eq("loc_id", locCaches.getId()));
                .eq("loc_no", locCaches.getLocNo()));
        if (Objects.isNull(locDetls) || locDetls.isEmpty()) {
            throw new CoolException("库存明细不存在!!");
        }
@@ -1756,15 +2004,14 @@
                    .orderAsc(Arrays.asList("row1", "bay1", "lev1"))
                    .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
            locMasts.add(locMast);
            //空板出库
            generateTask(locMasts, TaskIOType.EMPTY_OUT.type, basDevp, userId);
        } else {
            if (!locMasts.isEmpty()) {
                //生成堆垛机出库任务
                generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
            }
            //生成堆垛机出库任务
            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
//            if (!locMasts.isEmpty()) {
//
//            }
        }
    }
@@ -1832,7 +2079,7 @@
            }
            // 修改库位状态:   F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中
            locMast = locMastService.selectById(locMast.getLocNo());
            if (locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type)) {
            if (locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type) || locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type)) {
                locMast.setLocSts(ioType == 101 ? "R" : "P");
                locMast.setModiUser(userId);
                locMast.setModiTime(now);
@@ -1900,12 +2147,11 @@
                        .setModel(pakin.getModel())
                        .setAppeTime(new Date())
                        .setModiUser(userId);
                taskDetls.add(wrkDetl);
                //保存工作档明细
                if (!taskDetlService.insert(wrkDetl)) {
                    throw new CoolException("保存工作档明细失败");
                }
            });
            //保存工作档明细
            if (!taskDetlService.insertBatch(taskDetls)) {
                throw new CoolException("保存工作档明细失败");
            }
        }
        loc.setLocSts(LocStsType.LOC_STS_TYPE_R.type);
@@ -1940,6 +2186,11 @@
        List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode));
        if (Objects.isNull(pakins) || pakins.isEmpty()) {
            throw new CoolException("组托信息不存在!!");
        }
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode));
        if (!tasks.isEmpty()) {
            throw new CoolException("托盘已在任务执行中..");
        }
        // 获取工作号
        int workNo = commonService.getWorkNo(WorkNoType.PICK.type);
@@ -2014,7 +2265,11 @@
        // 修改目标站点信息
        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", orgSite));
        if (station.getLocSts().equals("O")) {
        if (Objects.isNull(station)) {
            throw new CoolException("站点不存在!!");
        }
        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
            station.setLocSts("R"); // S.入库预约
            station.setBarcode(barcode);
            station.setModiTime(new Date());
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -6,6 +6,7 @@
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.enums.LocStsType;
import com.zy.asrs.mapper.TaskMapper;
import com.zy.asrs.service.*;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@@ -52,8 +53,16 @@
        if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) {
            throw new CoolException("当前工作档已完成");
        }
        // 入库 + 库位转移
        if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) {
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (!Objects.isNull(station)) {
                station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("站点状态修改失败!!");
                }
            }
            wrkMast.setWrkSts(4L);
            // 出库
        } else if (wrkMast.getWrkSts() > 10) {
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -410,8 +410,8 @@
        // 判断是否是盘点单
        String orderNo = taskDto.getLocDtos().get(0).getOrderNo();
//        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
        CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo));
        int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103);
        int ioType =  (taskDto.isAll() ? 101 : 103);
        if(ioType == 101){
            boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto ->
                    locDetlService.selectOne(new EntityWrapper<LocDetl>()
src/main/webapp/static/js/order/order.js
@@ -228,6 +228,7 @@
                        {type: 'numbers', title: '#'},
                        {field: 'matnr', title: '商品编码', width: 160},
                        {field: 'maktx', title: '商品名称', width: 200},
                        {field: 'standby1', title: '供应商代码', edit: true},
                        {field: 'batch', title: '批号', edit: true},
                        {field: 'specs', title: '规格'},
                        {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},