自动化立体仓库 - WMS系统
skyouc
2 天以前 707d414c0e6a8baff3ce7affec820f0fc1a13c19
no message
7个文件已添加
28个文件已修改
833 ■■■■■ 已修改文件
license.lic 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/AgvScheduleController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/params/AgvCallBackItemParam.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/params/AgvCallBackParam.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/params/AgvCarriesParam.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/params/AgvRequestParam.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/controller/params/CallBackItem.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/entity/CallAgvParams.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/enums/MatLocType.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/AgvScheduleService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/BasStationDetl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocDetl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetlPakin.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetlPakout.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/TaskDetl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WaitPakin.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkDetl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/CheckOrderServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocCacheServiceImpl.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/WorkMastScheduler.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/AutoLocMoveHandler.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/constant/HIKApiConstant.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/constant/MesConstant.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/license.lic 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locCache/locCache.html 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
license.lic
Binary files differ
src/main/java/com/zy/api/controller/AgvScheduleController.java
@@ -1,6 +1,7 @@
package com.zy.api.controller;
import com.core.common.R;
import com.zy.api.controller.params.AgvCallBackParam;
import com.zy.api.entity.CallAgvParams;
import com.zy.api.service.AgvScheduleService;
import io.swagger.annotations.ApiOperation;
@@ -34,10 +35,14 @@
        return agvScheduleService.callAgvCarry(params);
    }
    /**
     * AGV任务完成
     * @param params
     * @return
     */
    @ApiOperation("agv搬运结果回传")
    @PostMapping("/agv/result/callback")
    public R agvCarryCallBack(@RequestBody CallAgvParams params) {
    public R agvCarryCallBack(@RequestBody AgvCallBackParam params) {
        if (Objects.isNull(params)) {
            return R.error("参数不能为空!!");
        }
src/main/java/com/zy/api/controller/params/AgvCallBackItemParam.java
New file
@@ -0,0 +1,44 @@
package com.zy.api.controller.params;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
public class AgvCallBackItemParam implements Serializable {
    private CallBackItem values;
//    {
//        "robotTaskCode": "5685",
//            "singleRobotCode": "8857",
//            "currentSeq": -1,
//            "extra": {
//        "async": "0",
//                "values": {
//                    "mapCode": "DD",
//                    "slotCategory": "SITE",
//                    "slotCode": "286260DD305240",
//                    "slotName": "JH06",
//                    "x": 286260.0,
//                    "y": 305240.0,
//                    "method": "start",
//                    "carrierCategory": "POD",
//                    "carrierType": "TC",
//                    "carrierCode": "TC10104",
//                    "pileCount": 1,
//                    "taskTime": "2026-02-12 15:59:45.704",
//                    "amrCategory": "LMR",
//                    "amrType": "17",
//                    "amrCode": "8857",
//                    "carrierName": "TC10104",
//                    "layerNo": 1
//        }
//    }
//    }
}
src/main/java/com/zy/api/controller/params/AgvCallBackParam.java
New file
@@ -0,0 +1,15 @@
package com.zy.api.controller.params;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
public class AgvCallBackParam implements Serializable {
    private String robotTaskCode;
    private AgvCallBackItemParam extra;
}
src/main/java/com/zy/api/controller/params/AgvCarriesParam.java
New file
@@ -0,0 +1,22 @@
package com.zy.api.controller.params;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
@ApiModel(value = "AgvCarriesParam", description = "AGV搬运参数")
public class AgvCarriesParam implements Serializable {
    private Integer autoStart = 1;
    private String code;
    private Integer seq;
    private String type = "SITE";
}
src/main/java/com/zy/api/controller/params/AgvRequestParam.java
New file
@@ -0,0 +1,26 @@
package com.zy.api.controller.params;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
@Data
@Accessors(chain = true)
@ApiModel(value = "AgvRequestParam", description = "Agv请求参数")
public class AgvRequestParam implements Serializable {
    //任务类型
    private String taskType;
    //任务执行清单
    private List<AgvCarriesParam> targetRoute;
    //任务号
    private String robotTaskCode;
}
src/main/java/com/zy/api/controller/params/CallBackItem.java
New file
@@ -0,0 +1,42 @@
package com.zy.api.controller.params;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
public class CallBackItem implements Serializable {
    private String slotName;
    private String method;
    private String carrierCode;
    private String taskTime;
    private String carrierName;
//                "values": {
//                    "mapCode": "DD",
//                    "slotCategory": "SITE",
//                    "slotCode": "286260DD305240",
//                    "slotName": "JH06",
//                    "x": 286260.0,
//                    "y": 305240.0,
//                    "method": "start",
//                    "carrierCategory": "POD",
//                    "carrierType": "TC",
//                    "carrierCode": "TC10104",
//                    "pileCount": 1,
//                    "taskTime": "2026-02-12 15:59:45.704",
//                    "amrCategory": "LMR",
//                    "amrType": "17",
//                    "amrCode": "8857",
//                    "carrierName": "TC10104",
//                    "layerNo": 1
//        }
}
src/main/java/com/zy/api/entity/CallAgvParams.java
@@ -32,4 +32,7 @@
    @ApiModelProperty("任务号")
    private String wrkNo;
    @ApiModelProperty("任务类型")
    private String taskType = "M2";
}
src/main/java/com/zy/api/enums/MatLocType.java
@@ -39,24 +39,23 @@
    public static Long getTag(String type) {
        if (type.equals(MatType.LARGE.type)) {
            return Long.parseLong(MatLocType.AUTOMATED.type);
            return Long.parseLong(MatLocType.EO_HOLDING.type);
        } else if (type.equals(MatType.MIDDEL.type)) {
            return Long.parseLong(MatLocType.SO_HOLDING.type);
        } else if (type.equals(MatType.SMALL.type)) {
            return Long.parseLong(MatLocType.EO_HOLDING.type);
            return Long.parseLong(MatLocType.AUTOMATED.type);
        } else {
            return null;
        }
    }
    public static String getMatTag(String type) {
        if (type.equals(MatLocType.AUTOMATED.type)) {
        if (type.equals(MatLocType.EO_HOLDING.type)) {
            return MatType.LARGE.type;
        } else if (type.equals(MatLocType.SO_HOLDING.type)) {
            return MatType.MIDDEL.type;
        } else if (type.equals(MatLocType.EO_HOLDING.type)) {
        } else if (type.equals(MatLocType.AUTOMATED.type)) {
            return MatType.SMALL.type;
        } else {
            return null;
src/main/java/com/zy/api/service/AgvScheduleService.java
@@ -1,11 +1,12 @@
package com.zy.api.service;
import com.core.common.R;
import com.zy.api.controller.params.AgvCallBackParam;
import com.zy.api.entity.CallAgvParams;
public interface AgvScheduleService {
    R callAgvCarry(CallAgvParams params);
    R callback(CallAgvParams params);
    R callback(AgvCallBackParam params);
}
src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java
@@ -5,6 +5,9 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.api.controller.params.AgvCallBackParam;
import com.zy.api.controller.params.AgvCarriesParam;
import com.zy.api.controller.params.AgvRequestParam;
import com.zy.api.entity.CallAgvParams;
import com.zy.api.enums.OrderType;
import com.zy.api.service.AgvScheduleService;
@@ -27,11 +30,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.*;
@Slf4j
@Service
@@ -75,46 +74,59 @@
            task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_OUT.type);
        }
        if (!taskService.updateById(task)) {
            throw new CoolException("任务状态更新失败!!");
        HIKResultDTO hikResultDTO = sendAgvTask(params, HIKApiConstant.TASK_SUBMIT);
        if (hikResultDTO.isSuccess()) {
            if (!taskService.updateById(task)) {
                throw new CoolException("任务状态更新失败!!");
            }
        }
        return R.ok();
    }
    /**
     * 获取自定义请求头
     *
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author Ryan
     * @date 2025/12/29 9:11
     */
    private Map<String, Object> getHeaderParam() {
        Map<String, Object> headerParam = new HashMap<>();
        //设置请求连接的Token
        headerParam.put("X-LR-REQUEST-ID", new Date().getTime() + "");
        return headerParam;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R callback(CallAgvParams params) {
    public R callback(AgvCallBackParam params) {
        if (Objects.isNull(params)) {
            return R.error("参数不能为空!!");
        }
        if (Objects.isNull(params.getWrkNo())) {
        if (Objects.isNull(params.getRobotTaskCode())) {
            return R.error("任务号不能为空!!");
        }
        Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getWrkNo()));
        Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", params.getRobotTaskCode()));
        if (Objects.isNull(task)) {
            return R.error("任务信息不存在!!");
        }
//        if (!Arrays.asList(TaskStatusType.AGV_TASK_ISSUED_IN.type, TaskStatusType.AGV_TASK_ISSUED_OUT.type).contains(task.getIoType())) {
//            return R.error("");
//        }
//
        if (Arrays.asList(TaskIOType.ALL_IN.type, TaskIOType.PICK_IN.type, TaskIOType.MERGE_IN.type)
                .contains(task.getIoType())) {
            // 入库
            if (params.getStatus().equals("RUNNING")) {
            if (params.getExtra().getValues().getMethod().equals("start")) {
                task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_IN.type);
            } else if (params.getStatus().equals("FINISHED")){
            } else if (params.getExtra().getValues().getMethod().equals("end")){
                task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_IN.type);
            }
        } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type, TaskIOType.EMPTY_OUT.type)
                .contains(task.getIoType())) {
            // 出库
            if (params.getStatus().equals("RUNNING")) {
            // 出库p
            if (params.getExtra().getValues().getMethod().equals("start")) {
                task.setWrkSts(TaskStatusType.AGV_TASK_RUNNING_OUT.type);
            } else if (params.getStatus().equals("FINISHED")){
            } else if (params.getExtra().getValues().getMethod().equals("end")){
                task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_OUT.type);
            }
        }
@@ -122,35 +134,42 @@
        if (!taskService.updateById(task)) {
            throw new CoolException("状态修改失败!!");
        }
        return R.ok("执行完成 !!");
    }
    public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO, String path) {
    public HIKResultDTO sendAgvTask(CallAgvParams param, String path) {
        HIKResultDTO result = new HIKResultDTO();
        ForwardAGVTaskDTO forwardAGVTaskParam = new ForwardAGVTaskDTO();
        forwardAGVTaskParam.setReqCode(UUID.randomUUID().toString().replace("-", ""));
        forwardAGVTaskParam.setClientCode("IWMS");
        forwardAGVTaskParam.setTaskTyp(haiKangApiDTO.getTaskType());
        forwardAGVTaskParam.setCtnrTyp(haiKangApiDTO.getCtnrType());
        forwardAGVTaskParam.setPriority(haiKangApiDTO.getPriority());
        List<ForwardAGVTaskDTO.PositionCodePaths> positionCodePathsList = new ArrayList<>();
        positionCodePathsList
                .add(new ForwardAGVTaskDTO.PositionCodePaths(haiKangApiDTO.getOrg(), haiKangApiDTO.getOrgType()));
        positionCodePathsList
                .add(new ForwardAGVTaskDTO.PositionCodePaths(haiKangApiDTO.getTar(), haiKangApiDTO.getTarType()));
        forwardAGVTaskParam.setPositionCodePath(positionCodePathsList);
        String body = JSON.toJSONString(forwardAGVTaskParam);
        AgvRequestParam requestParam = new AgvRequestParam();
        requestParam.setTaskType(param.getTaskType());
        List<AgvCarriesParam> agvCarriesParams = new ArrayList<>();
        AgvCarriesParam carriesParam = new AgvCarriesParam();
        carriesParam.setSeq(0);
        carriesParam.setCode(param.getOrgSite());
        agvCarriesParams.add(carriesParam);
        AgvCarriesParam carriesParam2 = new AgvCarriesParam();
        carriesParam2.setSeq(1);
        carriesParam2.setCode(param.getTarSite());
        agvCarriesParams.add(carriesParam2);
        requestParam.setRobotTaskCode(param.getWrkNo());
        requestParam.setTargetRoute(agvCarriesParams);
        String body = JSON.toJSONString(requestParam);
        String response = "";
        try {
            response = new HttpHandler.Builder()
                    .setUri(HIKApiConstant.AGV_IP)
                    .setPath(path)
                    .setHeaders(getHeaderParam())
                    .setJson(body)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger("code").equals(0)) {
            if (jsonObject.getString("code").equals("SUCCESS")) {
                result.setSuccess(true);
            } else {
                result.setMessage(jsonObject.getString("message"));
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -28,6 +28,8 @@
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.BasAreasServiceImpl;
import com.zy.asrs.service.impl.OrderDetlPakinServiceImpl;
import com.zy.asrs.service.impl.OrderPakinServiceImpl;
import com.zy.asrs.utils.Utils;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
@@ -67,6 +69,10 @@
    private String prefix;
    @Autowired
    private BasAreasService basAreasService;
    @Autowired
    private OrderPakinService orderPakinService;
    @Autowired
    private OrderDetlPakinService orderDetlPakinService;
    /**
@@ -197,7 +203,6 @@
            if (Objects.isNull(params.getCompany_id())) {
                throw new CoolException("公司ID不能为空!!");
            }
            addOrUpdateOrders(params, type);
        });
@@ -366,19 +371,28 @@
            /** 不存在,新增订单 */
            generateOrders(params, type);
        } else {
            if (order.getSettle() == 2) {
            OrderPakin orderPakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>().eq("order_no", order.getOrderNo()));
            if (!Objects.isNull(orderPakin) && orderPakin.getSettle() != 1) {
                throw new CoolException("订单已处理,不可再变更!!");
            }
            /** 存在,删除老订单,更新插入新订单 */
            // 删除旧订单明细
            if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) {
                throw new CoolException("订单明细删除失败!!");
            if (!orderDetlPakinService.delete(new EntityWrapper<OrderDetlPakin>().eq("order_no", orderPakin.getOrderNo()))) {
                throw new CoolException("订单删除失败!!");
            }
            if (!orderService.deleteById(order.getId())) {
            if (!orderPakinService.delete(new EntityWrapper<OrderPakin>().eq("order_no", orderPakin.getOrderNo()))) {
                throw new CoolException("主单删除失败!!");
            }
            // 删除旧订单明细
//            if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) {
//                throw new CoolException("订单明细删除失败!!");
//            }
            order.setSettle(3L);
            if (!orderService.updateById(order)) {
                throw new CoolException("原单据删除失败!!");
            }
            generateOrders(params, type);
//            generateOrders(params, type);
        }
    }
@@ -443,7 +457,9 @@
        }
        if (!Objects.isNull(params.getDetails()) && !params.getDetails().isEmpty()) {
            params.getDetails().forEach(item -> {
                Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", item.getPro_komcode()));
                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("物料编码不存在!!");
                }
@@ -581,18 +597,17 @@
            } else {
                locDetlDto.setStock_qty(Integer.parseInt(item.getBookQty().toString()));
            }
            LocDetl barcode = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("barcode", item.getZpallet()));
            LocDetl barcode = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("zpallet", item.getZpallet()));
            if (!Objects.isNull(barcode)) {
                BasAreas areas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("id", barcode.getAreaId()));
                if (!Objects.isNull(areas)) {
                    locDetlDto.setLocation_no(areas.getName());
                    locDetlDto.setTarget_location(areas.getName());
                }
            }
            locDetlDto
                    .setPro_komcode(item.getMatnr())
                    .setPro_id(item.getStandby1())
                    .setLocation_no(item.getZpallet())
                    .setTarget_location("");
                    .setLocation_no(item.getZpallet());
            dtos.add(locDetlDto);
        });
        return XSR.ok(dtos);
src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
@@ -127,22 +127,15 @@
     * @date 2026/1/10 13:58
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R pubWrkToWcs(WorkTaskParams params) {
        if (Objects.isNull(params.getTaskNo())) {
            return R.error("任务号不能为空!!");
        }
//        if (params.getType().equals("in"))
//        if (Objects.isNull(params.getBarcode())) {
//            return R.error("托盘码不能为空!!");
//        }
//        if (Objects.isNull(params.getLocNo())) {
//            return R.error("目标库位不能为空!!");
//        }
        String url = MesConstant.PUB_TASK_IN;
        if (!Objects.isNull(params.getType()) && params.getType().equals("out")) {
            url = MesConstant.PUB_TASK_OUT;
        }
        log.info("出库任务下发参数:{}", JSON.toJSONString(params));
        String response;
        try {
@@ -154,13 +147,16 @@
                    .doPost();
            Map<String, Object> result = JSON.parseObject(response, Map.class);
            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo()));
            wrkMast.setWrkSts(12L);
            if (!wrkMastService.updateById(wrkMast)) {
                throw new CoolException("更新失败!!");
            }
            if (result.get("code").equals(200)) {
                WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo()));
                wrkMast.setWrkSts(12L);
                wrkMastService.updateById(wrkMast);
                //TODO 上报是否成功
            } else {
                return R.error().add(result);
                throw new CoolException("出库下发任务下发失败!!");
//                return R.error().add(result);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -71,6 +71,7 @@
        for (LocDetl locDetl : groupLocDetl.getRecords()) {
            AbnormalLocDetlParam abnormalLocDetlParam = new AbnormalLocDetlParam();
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("supp_code", locDetl.getStandby1())
                    .eq("matnr", locDetl.getMatnr()));
            if (Cools.isEmpty(mat)) {
                continue;
@@ -300,6 +301,7 @@
        for (LocDetl locDetl : groupLocDetl.getRecords()) {
            AbnormalLocDetlParam abnormalLocDetlParam = new AbnormalLocDetlParam();
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("supp_code", locDetl.getStandby1())
                    .eq("matnr", locDetl.getMatnr()));
            if (Cools.isEmpty(mat)) {
                continue;
src/main/java/com/zy/asrs/entity/BasStationDetl.java
@@ -448,7 +448,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -287,7 +287,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -484,7 +484,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/OrderDetlPakin.java
@@ -418,7 +418,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
           return null;
        }
src/main/java/com/zy/asrs/entity/OrderDetlPakout.java
@@ -464,7 +464,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/TaskDetl.java
@@ -481,7 +481,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/WaitPakin.java
@@ -177,7 +177,7 @@
     * 备用1
     */
    @ApiModelProperty(value= "备用1")
    private String standby1 = "";
    private String standby1;
    /**
     * 备用2
@@ -196,7 +196,7 @@
     */
    @ApiModelProperty(value= "备用1")
    @TableField("box_type1")
    private String boxType1 = "1";
    private String boxType1;
    /**
     * 备用2
@@ -252,7 +252,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/entity/WrkDetl.java
@@ -375,7 +375,9 @@
    public String getTag$() {
        MatService service = SpringUtils.getBean(MatService.class);
        Mat order = service.selectOne(new EntityWrapper<Mat>().eq("matnr", this.matnr));
        Mat order = service.selectOne(new EntityWrapper<Mat>()
                .eq("supp_code", this.suppCode)
                .eq("matnr", this.matnr));
        if (Cools.isEmpty(order)){
            return null;
        }
src/main/java/com/zy/asrs/service/impl/CheckOrderServiceImpl.java
@@ -139,7 +139,7 @@
                        .eq("loc_no", locMast.getLocNo())
                        .eq("matnr", checkOrderDetl.getMatnr())
                        .eq(!Cools.isEmpty(checkOrderDetl.getBatch()),"batch", checkOrderDetl.getBatch())
                        .eq("supp_code", checkOrderDetl.getSuppCode())
                        .eq(!Cools.isEmpty(checkOrderDetl.getSuppCode()),"supp_code", checkOrderDetl.getSuppCode())
                );
                if (!Cools.isEmpty(locDetl)){
                    throw new CoolException("当前库位有相同库存信息");
src/main/java/com/zy/asrs/service/impl/LocCacheServiceImpl.java
@@ -42,45 +42,47 @@
    public R initLocCache(LocMastInitParam param, Long userId) {
        try {
            List<LocCache> list = new ArrayList<>();
            BasAreas areas = basAreasService.selectById(param.getIdentifying());
            if (Cools.isEmpty(areas)) {
                return R.error("库区不存在!!!");
            }
            for (int r = param.getStartRow(); r <= param.getEndRow(); r++) {
                for (int b = param.getStartBay(); b <= param.getEndBay(); b++) {
                    for (int l = param.getStartLev(); l <= param.getEndLev(); l++) {
                        // 获取库位号
                        String locNo = areas.getAreaNo() + String.format("%02d", r) + String.format("%03d", b) + String.format("%02d", l);
                        Date now = new Date();
                        LocCache locMast = new LocCache();
                        locMast.setLocNo(locNo);
                        locMast.setLocSts("O");
                        locMast.setRow1(r); // 排
                        locMast.setBay1(b); // 列
                        locMast.setLev1(l); // 层
                        locMast.setId(null);
                        locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1);
                        locMast.setLocType2(param.getLocType2());
                        locMast.setLocType3(param.getLocType3());
                        locMast.setAppeUser(userId);
                        locMast.setAppeTime(now);
                        locMast.setModiUser(userId);
                        locMast.setModiTime(now);
                        locMast.setAreaId(areas.getId());
                        locMast.setAreaName(areas.getName());
                        list.add(locMast);
                    }
                }
            }
            if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1) {
                if (!this.delete(new EntityWrapper<>())) {
                    throw new CoolException("删除失败!!");
                }
            }
            if (!this.insertBatch(list)) {
                throw new CoolException("添加失败!!");
            BasAreas areas = basAreasService.selectById(param.getIdentifying());
            if (Cools.isEmpty(areas)) {
                return R.error("库区不存在!!!");
            }
            for (int r = param.getStartRow(); r <= param.getEndRow(); r++) {
//                for (int b = param.getStartBay(); b <= param.getEndBay(); b++) {
//                    for (int l = param.getStartLev(); l <= param.getEndLev(); l++) {
//
//                    }
//                }
                // 获取库位号
                String locNo = areas.getAreaNo() + String.format("%02d", r);
                Date now = new Date();
                LocCache locMast = new LocCache();
                locMast.setLocNo(locNo);
                locMast.setLocSts("O");
                locMast.setRow1(r); // 排
                locMast.setBay1(1); // 列
                locMast.setLev1(1); // 层
                locMast.setFullPlt("N");
                locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1);
                locMast.setLocType2(param.getLocType2());
                locMast.setLocType3(param.getLocType3());
                locMast.setAppeUser(userId);
                locMast.setAppeTime(now);
                locMast.setModiUser(userId);
                locMast.setModiTime(now);
                locMast.setAreaId(areas.getId());
                locMast.setAreaName(areas.getName());
//                list.add(locMast);
                if (!this.insert(locMast)) {
                    throw new CoolException("添加失败!!");
                }
            }
            return R.ok("初始化成功");
        } catch (Exception e) {
            return R.error("初始化失败===>" + e.getMessage());
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -178,7 +178,9 @@
        wrkMastService.insert(wrkMast);
        for (OrderDetl orderDetl : param.getCombMats()) {
            Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", orderDetl.getMatnr()));
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("supp_code", orderDetl.getStandby1())
                    .eq("matnr", orderDetl.getMatnr()));
            if (mat == null) {
                throw new CoolException("保存工作档失败,物料信息不存在:" + orderDetl.getMatnr());
            }
@@ -377,6 +379,7 @@
        for (CombParam.CombMat combMat : combParam.getCombMats()) {
            List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>()
                    .eq("loc_no", combParam.getLocNo())
                    .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1())
                    .eq("matnr", combMat.getMatnr()));
            if (locDetlList.isEmpty()) {
                return R.error("未查询到库存数据");
@@ -451,7 +454,9 @@
                wrkMast.setModiUser(userId);
                wrkMastService.insert(wrkMast);
                Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr()));
                Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                        .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1())
                        .eq("matnr", combMat.getMatnr()));
                if (mat == null) {
                    throw new CoolException("保存工作档失败,物料信息不存在:" + combMat.getMatnr());
                }
@@ -632,7 +637,7 @@
        // 无单组托
        if (Cools.isEmpty(param.getOrderNo())) {
            //空板组托
            if (!Cools.isEmpty(param.getPakinType()) &&  param.getPakinType().equals("3")) {
            if (!Cools.isEmpty(param.getPakinType()) && param.getPakinType().equals("3")) {
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.setZpallet(param.getBarcode());
                waitPakin.setIoStatus("N");
@@ -713,6 +718,7 @@
                // elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3());
                OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                        .eq("order_id", order.getId())
                        .eq("supp_code", elem.getStandby1())
                        .eq("matnr", elem.getMatnr()));
                if (Objects.isNull(elem.getBoxType1())) {
                    throw new CoolException("格层编码不能为空!!");
@@ -743,9 +749,16 @@
                }
            });
            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());
            List<Mat> tempMats = new ArrayList<>();
            for (DetlDto detlDto : detlDtos) {
                Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                        .eq("matnr", detlDto.getMatnr())
                        .eq("supp_code", detlDto.getStandby1()));
                tempMats.add(mat);
            }
//            Set<String> matnrs = tempMats.stream().map(Mat::getMatnr).collect(Collectors.toSet());
            Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet());
            if (tagIds.size() > 1) {
                throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
            }
@@ -1191,6 +1204,7 @@
                orderDetl.setUpdateBy(userId);
                orderDetl.setUpdateTime(now);
                Wrapper wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo)
                        .eq(!Cools.isEmpty(orderDetl.getStandby1()), "supp_code", orderDetl.getStandby1())
                        .eq("matnr", orderDetl.getMatnr());
                if (!Cools.isEmpty(orderDetl.getBatch())) {
                    wrapper.eq("batch", orderDetl.getBatch());
@@ -1308,7 +1322,6 @@
                .eq("area_id", basAreas.getId())
                .eq("frozen", 0)
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                // .eq("loc_no", params.getTarSite())
                .orderAsc(Arrays.asList("loc_no"))
                .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
        if (Objects.isNull(locCache)) {
@@ -1337,7 +1350,7 @@
        }
        List<OrderDetlPakin> detlPakins = orderDetlPakinService.selectList(new EntityWrapper<OrderDetlPakin>()
                .eq(!Cools.isEmpty(params.getThreeCode()), "three_code", params.getThreeCode())
                        .eq(!Cools.isEmpty(params.getThreeCode()), "three_code", params.getThreeCode())
//                .eq(!Cools.isEmpty(params.getMatnr()), "matnr", params.getMatnr())
//                .eq(!Cools.isEmpty(params.getOrderNo()), "order_no", params.getOrderNo())
        );
@@ -1680,9 +1693,13 @@
        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());
        List<Mat> tempMats = new ArrayList<>();
        for (DetlDto detlDto : detlDtos) {
            Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", detlDto.getMatnr())
                    .eq("supp_code", detlDto.getStandby1()));
            tempMats.add(mat);
        }
        Set<Long> tagIds = tempMats.stream().map(Mat::getTagId).collect(Collectors.toSet());
        if (tagIds.size() > 1) {
            throw new CoolException("组托物料类型不一致,只有相同的物料分类才可以组托!!");
        }
@@ -1894,7 +1911,7 @@
                    .eq("dev_no", basStation.getDevNo())
                    .eq("matnr", combMat.getMatnr())
                    .eq("batch", combMat.getBatch())
                    .eq("standby1", combMat.getStandby1()));
                    .eq(!Cools.isEmpty(combMat.getStandby1()), "standby1", combMat.getStandby1()));
            if (Cools.isEmpty(basStationDetl)) {
                basStationDetl = new BasStationDetl();
                Mat mat = matService.selectByMatnr(combMat.getMatnr());
@@ -1935,8 +1952,8 @@
        OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
                .eq("order_id", orderPakin.getId())
                .eq("matnr", combMat.getMatnr())
                .eq("batch", combMat.getBatch())
                .eq("standby1", combMat.getStandby1()));
                .eq(!Cools.isEmpty(combMat.getBatch()),"batch", combMat.getBatch())
                .eq(!Cools.isEmpty(combMat.getStandby1()), "supp_code", combMat.getStandby1()));
        if (Cools.isEmpty(orderDetlPakin)) {
            throw new CoolException("检索单据明细数据失败");
        }
@@ -2118,6 +2135,7 @@
        // 更新入库通知档 ioStatus ===>> Y
        Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
                .eq("zpallet", pakin.getZpallet());
        WaitPakin setParam = new WaitPakin();
        setParam.setLocNo(locNo);
        setParam.setIoStatus("Y");
@@ -2226,7 +2244,9 @@
                        if (container.getMixMax() > sets.size()) {
                            //余下可混放种类
                            long suplus = Math.round((container.getMixMax() - sets.size()) * 10000) / 10000;
                            Mat mats = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr));
                            Mat mats = matService.selectOne(new EntityWrapper<Mat>()
                                    .eq("supp_code", supId)
                                    .eq("matnr", matnr));
                            if (Objects.isNull(mats)) {
                                throw new CoolException("物料不存在!!");
                            }
@@ -2520,7 +2540,6 @@
                if (!taskDetlService.insert(wrkDetl)) {
                    throw new CoolException("保存工作档明细失败");
                }
            }
            for (WaitPakin pakin : pakins) {
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -160,7 +160,7 @@
        String locNo = ""; // 待修改目标库位
        String locSts = ""; // 待修改目标库位状态
        // 入库取消(修改目标库位)
        if (wrkMast.getWrkSts() < 4) {
        if (wrkMast.getIoType() == 1 &&  wrkMast.getWrkSts() < 204) {
            locNo = wrkMast.getLocNo();
            locSts = "O";
@@ -189,7 +189,7 @@
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
            // 出库取消(修改源库位)
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) {
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() < 14) {
            locNo = wrkMast.getSourceLocNo();
            // 出库 ===>> F.在库
            if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) {
@@ -223,12 +223,7 @@
            } else {
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
        } else {
            throw new CoolException("当前工作状态无法取消");
        }
        //取消入库工作档时,查询组托表,如果有将状态改为待处理
        if (wrkMast.getIoType() == 1) {
        } else if (wrkMast.getIoType() == 1) {
            List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
            for (WaitPakin waitPakin : waitPakins) {
                if (!Cools.isEmpty(waitPakin)) {
@@ -241,8 +236,23 @@
                            .eq("batch", waitPakin.getBatch()));
                }
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (station.getLocSts().equals("R")) {
                station.setLocSts("O");
                station.setBarcode("");
                station.setModiTime(new Date());
                station.setModiUser(userId);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("更新源站点状态失败");
                }
            }
        } else {
            throw new CoolException("当前工作状态无法取消");
        }
        //取消入库工作档时,查询组托表,如果有将状态改为待处理
        //取消出库工作档时,查询单据管理表,回滚作业中数量
        if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) {
            List<TaskDetl> wrkDetls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", wrkMast.getWrkNo()));
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -283,7 +283,9 @@
                                locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3(), locDetl.getAnfme(), locDetl.getThreeCode()));
                        locDetl.setOwner(param.getOwnerId());
                        try {
                            locDetlService.update(locDetl, new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", locDetl.getMatnr()));
                            locDetlService.update(locDetl, new EntityWrapper<LocDetl>().eq("loc_no", locNo)
                                    .eq("supp_code", locDetl.getStandby1())
                                    .eq("matnr", locDetl.getMatnr()));
                        } catch (Exception e) {
                            throw new Exception("更新库存明细拥有者字段信息出错了");
                        }
@@ -416,17 +418,17 @@
        String orderNo = taskDto.getLocDtos().get(0).getOrderNo();
//        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
        int ioType =  (taskDto.isAll() ? 101 : 103);
        if(ioType == 101){
        int ioType = (taskDto.isAll() ? 101 : 103);
        if (ioType == 101) {
            boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto ->
                    locDetlService.selectOne(new EntityWrapper<LocDetl>()
                            .eq("loc_no", locDto.getLocNo())
                            .eq("matnr", locDto.getMatnr())
                            .eq("batch", locDto.getBatch())
                            .eq("standby1",locDto.getStandby1())
                            .eq(!Cools.isEmpty(locDto.getBatch()), "batch", locDto.getBatch())
                            .eq("standby1", locDto.getStandby1())
                    ).getDiffQty().compareTo(BigDecimal.ZERO) == 0
            );
            if (!DiffQty){
            if (!DiffQty) {
                ioType = 103;
            }
        }
@@ -559,7 +561,7 @@
            List<CheckOrderDetl> checkOrderDetls = checkOrderDetlService.selectList(new EntityWrapper<CheckOrderDetl>()
                    .eq("loc_no", locDto.getLocNo())
                    .eq("matnr", locDto.getMatnr())
                    .eq("batch", locDto.getBatch())
                    .eq(!Cools.isEmpty(locDto.getBatch()),"batch", locDto.getBatch())
                    .eq("order_no", locDto.getOrderNo())
            );
@@ -585,7 +587,7 @@
            }
            // 修改订单明细
            checkOrderDetls.get(0).setStatus(2);
            if (!checkOrderDetlService.updateById(checkOrderDetls.get(0))){
            if (!checkOrderDetlService.updateById(checkOrderDetls.get(0))) {
                throw new CoolException("保存订单明细失败");
            }
        }
@@ -1279,7 +1281,7 @@
    @Transactional(rollbackFor = Exception.class)
    public void cancelWrkMast(String workNo, Long userId) {
        Date now = new Date();
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",workNo));
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", workNo));
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
@@ -1385,7 +1387,7 @@
        if (wrkMast.getIoType() == 107) {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            if (!Cools.isEmpty(wrkDetls.get(0).getOrderNo())){
            if (!Cools.isEmpty(wrkDetls.get(0).getOrderNo())) {
                for (WrkDetl wrkDetl : wrkDetls) {
                    CheckOrderDetl checkOrderDetl = checkOrderDetlService.selectOne(new EntityWrapper<CheckOrderDetl>()
@@ -1400,7 +1402,7 @@
                CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", wrkDetls.get(0).getOrderNo()));
                List<CheckOrderDetl> checkOrderDetls = checkOrderDetlService.selectList(new EntityWrapper<CheckOrderDetl>().eq("order_id", checkOrder.getId()));
                boolean is = checkOrderDetls.stream().allMatch(item -> item.getStatus().equals(1));
                checkOrder.setSettle(is?1L:12L);
                checkOrder.setSettle(is ? 1L : 12L);
                checkOrderService.updateById(checkOrder);
            }
@@ -1525,7 +1527,7 @@
        // .修改并托入库明细托码
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                        .eq("area_id", locMast.getAreaId())
                .eq("area_id", locMast.getAreaId())
                .eq("loc_no", locMast.getLocNo()));
        if (!Objects.isNull(locDetls) && !locDetls.isEmpty()) {
            locDetls.forEach(locDetl -> {
@@ -1544,8 +1546,8 @@
                wrkDetl.setZpallet(wrkMast.getBarcode());
                wrkDetl.setBarcode(wrkMast.getBarcode());
                if (!wrkDetlService.update(wrkDetl, new EntityWrapper<WrkDetl>()
                                .eq("matnr", wrkDetl.getMatnr())
                                .eq("standby1", wrkDetl.getStandby1())
                        .eq("matnr", wrkDetl.getMatnr())
                        .eq("standby1", wrkDetl.getStandby1())
                        .eq("wrk_no", wrkMast.getWrkNo()))) {
                    throw new CoolException("任务档明细修改失败!!");
                }
@@ -1665,7 +1667,8 @@
        if (Cools.isEmpty(mat)) {
            throw new CoolException("目标库位商品编码有误!");
        }
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("matnr", param.getLocDetls().get(0).getMatnr()));
        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                .eq("matnr", param.getLocDetls().get(0).getMatnr()));
        if (Cools.isEmpty(locDetls) || locDetls.size() < 1) {
            throw new CoolException("待修改商品无库存,无需修改!  品号:" + param.getLocDetls().get(0).getMatnr());
        }
src/main/java/com/zy/asrs/task/WorkMastScheduler.java
@@ -1,7 +1,10 @@
package com.zy.asrs.task;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.api.controller.params.AgvCarriesParam;
import com.zy.api.controller.params.WorkTaskParams;
import com.zy.api.entity.CallAgvParams;
import com.zy.api.service.AgvScheduleService;
import com.zy.api.service.WcsApiService;
import com.zy.asrs.entity.Task;
import com.zy.asrs.entity.WrkMast;
@@ -40,6 +43,8 @@
    private MobileService mobileService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private AgvScheduleService agvScheduleService;
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute() {
@@ -92,7 +97,7 @@
        if (wrkMasts.isEmpty()) {
            return;
        }
        Collections.shuffle(wrkMasts);
//        Collections.shuffle(wrkMasts);
        wrkMasts.forEach(wrkMast -> {
            WorkTaskParams params = new WorkTaskParams();
            if (wrkMast.getIoType().equals(11)) {
@@ -112,7 +117,34 @@
                wcsApiService.pubWrkToWcs(params);
            }
        });
    }
    /**
     * AGV任务自动下发出库任务
     *
     * @author Ryan
     * @date 2026/1/10 14:42
     */
    @Scheduled(cron = "0/5 * * * * ? ")
    private void autoPubAgvTasks() {
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().in("wrk_sts", Arrays.asList(201L, 301L)));
        if (tasks.isEmpty()) {
            return;
        }
        Collections.shuffle(tasks);
        tasks.forEach(wrkMast -> {
            CallAgvParams param = new CallAgvParams();
            if (wrkMast.getIoType() == 1) {
                param.setWrkNo(wrkMast.getWrkNo() + "");
                param.setOrgSite(wrkMast.getSourceStaNo());
                param.setTarSite(wrkMast.getLocNo());
            } else if (wrkMast.getIoType() == 110 ||wrkMast.getIoType() == 101){
                param.setWrkNo(wrkMast.getWrkNo() + "");
                param.setOrgSite(wrkMast.getSourceLocNo());
                param.setTarSite(wrkMast.getStaNo());
            }
            agvScheduleService.callAgvCarry(param);
        });
    }
}
src/main/java/com/zy/asrs/task/handler/AutoLocMoveHandler.java
@@ -10,7 +10,9 @@
import com.zy.asrs.service.WorkService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.StartupDto;
import com.zy.common.properties.SlaveProperties;
import com.zy.common.service.CommonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +22,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
@@ -37,6 +40,9 @@
    @Autowired
    private WorkService workService;
    @Autowired
    private SlaveProperties slaveProperties;
    @Transactional(isolation = Isolation.REPEATABLE_READ)
    public ReturnT<String> start(Integer crnNo, Integer ioType) {
        try {
@@ -47,9 +53,16 @@
                        List<LocMast> locMasts = locMastService.selectLocMastShuttleMoveUnilateral(bay, lev, crnNo);
                        if (!Cools.isEmpty(locMasts) && locMasts.size() < 4) {
                            for (LocMast locMast : locMasts) {
//                                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
//                                StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 6 : 5, ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null);
//                                FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl);
                                if (Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) {
                                    String shallowLoc = Utils.getShallowLoc(slaveProperties, locMast.getLocNo());
                                    LocMast locNo = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc));
                                    if (!Objects.isNull(locNo)) {
                                        StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 109 : 126, 1, null, null);
                                        workService.locMove(locNo.getLocNo(), startupDto.getLocNo(), 9527L);
                                        break;
                                    }
                                }
                                StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 109 : 126, 1, null, null);
                                workService.locMove(locMast.getLocNo(), startupDto.getLocNo(), 9527L);
                                break;
@@ -64,6 +77,18 @@
                        List<LocMast> locMasts = locMastService.selectLocMastShuttleMoveUnilateral(bay, lev, crnNo );
                        if (!Cools.isEmpty(locMasts) && locMasts.size() < 4) {
                            for (LocMast locMast : locMasts) {
//                                if (Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) {
//                                    String shallowLoc = Utils.getShallowLoc(slaveProperties, locMast.getLocNo());
//                                    LocMast locNo = locMastService.selectOne(new EntityWrapper<LocMast>()
//                                            .eq("crn_no", crnNo)
//                                            .eq("loc_no", shallowLoc));
//                                    if (!Objects.isNull(locNo)) {
//                                        StartupDto startupDto = commonService.getLocNo(ioType, crnNo == 1 ? 205 : 215, 3, null, null);
//                                        workService.locMove(locNo.getLocNo(), startupDto.getLocNo(), 9527L);
//                                        break;
//                                    }
//                                }
//                                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
//                                StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 6 : 5, ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null);
//                                FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl);
src/main/java/com/zy/common/constant/HIKApiConstant.java
@@ -4,7 +4,9 @@
public class HIKApiConstant {
    // AGV IP地址
    public static final String AGV_IP = "10.0.100.110:8182";
    public static final String AGV_IP = "http://192.168.238.202/rcs/rtas/api/robot/controller";
    public static final String TASK_SUBMIT = "/task/submit";
    // 入库呼叫AGV取货
    public static final String AGV_CALL_IN_PATH = "/rcms/services/rest/hikRpcService/genAgvSchedulingTask";
src/main/java/com/zy/common/constant/MesConstant.java
@@ -9,10 +9,13 @@
//    public static final String URL = "http://webservice.kopen.com.cn:1482/kc-api/api/wms/ ";
    public static final String URL = "http://10.143.23.26:1482/kc-api/api/wms/ ";
    //AGV拉口地址
    public static final String AGV_URL = "http://192.168.238.202/rcs/rtas/api/robot/controller";
    //WCS系统接口地址
//    public static final String WCS_URL = "http://192.168.238.32:9090/wcs";
    public static final String WCS_URL = "http://192.168.238.241:9090/wcs";
    public static final String WCS_URL = "http://192.168.238.31:9090/wcs";
    //上架派工单反馈
    public static final String IN_DISPATCH_RESULT = "getInDispatchResult";
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
@@ -69,11 +69,11 @@
            logger.info("++++++++ 开始加载许可证 ++++++++");
            try {
//                String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath();
//                File publicKeysStoreFile = new File(publicKeysStoreFileName);
//
//                String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath();
//                File licensePathFile = new File(licensePathFileName);
                String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath();
                File publicKeysStoreFile = new File(publicKeysStoreFileName);
                String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath();
                File licensePathFile = new File(licensePathFileName);
                LicenseVerifyParam param = new LicenseVerifyParam();
                param.setSubject(subject);
@@ -84,29 +84,29 @@
                LicenseVerify licenseVerify = new LicenseVerify();
                //安装证书
//                LicenseContent install = licenseVerify.install(param);
                LicenseContent install = licenseVerify.install(param);
                logger.info("++++++++ 许可证加载结束 ++++++++");
                logger.info("++++++++ 许可证加载标记,搜索修改 ++++++++");
                licenseTimer.setSystemSupport(true);
                licenseTimer.setLicenseDays(9999);
                return 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);
//                }
//
//
//                return install != null;
                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;
            } catch (Exception e) {
                return false;
            }
src/main/resources/application-dev.yml
@@ -12,7 +12,8 @@
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    username: sa
    password: sa@123
    url: jdbc:sqlserver://47.97.1.152:1433;databasename=jsxsasrs
    url: jdbc:sqlserver://192.168.238.32:1433;databasename=jsxsasrs
#    url: jdbc:sqlserver://127.0.0.1:1433;databasename=jsxsasrs
  mvc:
    static-path-pattern: /**
  redis:
@@ -58,21 +59,21 @@
  # 双深
  doubleDeep: true
  # 双深库位排号
  doubleLocs: 1,4,5,8,9,12,13,16
  doubleLocs: 11, 14
  # 一个堆垛机负责的货架排数
  groupCount: 4
  # 左深库位排号
  doubleLocsLeft: 1,5,9,13
  doubleLocsLeft: 11
  # 右深库位排号
  doubleLocsRight: 4,8,12,16
  doubleLocsRight: 14
# wms参数配置
wms-parameter:
  # 自动补空板功能开关
  automaticFillingBoardStaNosBoolean: false
  automaticFillingBoardStaNosBoolean: true
  # 自动补空板站点
  automaticFillingBoardStaNos: 112,101
  # 自动移库功能开关
  autoLocMoveBoolean: false
  autoLocMoveBoolean: true
  # 自动移库功能开关 穿梭
  autoLocMoveUnilateralBoolean: false
@@ -113,7 +114,8 @@
#KOPEN小松平台
kopen:
  url: webservice.kopen.com.cn
#  url: webservice.kopen.com.cn
  url: 10.143.23.26
  port: 1482
  prefix: /kc-api/api/wms
src/main/resources/license.lic
Binary files differ
src/main/webapp/views/locCache/locCache.html
@@ -119,7 +119,7 @@
        <!-- 排 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止排</label>
                <label class="layui-form-label">起止</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startRow" autocomplete="off" class="layui-input"
                           lay-verify="required|number">
@@ -131,84 +131,84 @@
                </div>
            </div>
        </div>
        <!-- 列 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止列</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startBay" autocomplete="off" class="layui-input"
                           lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endBay" autocomplete="off" class="layui-input"
                           lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 层 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止层</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startLev" autocomplete="off" class="layui-input"
                           lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endLev" autocomplete="off" class="layui-input"
                           lay-verify="required|number">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">堆垛机数量</label>
            <div class="layui-input-inline">
                <input type="text" name="crnAmount" lay-verify="required|number" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起始堆垛机</label>
                <div class="layui-input-inline">
                    <input type="text" name="staCrn" autocomplete="off" class="layui-input" lay-verify="number">
                </div>
            </div>
        </div>
<!--        &lt;!&ndash; 列 &ndash;&gt;-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-inline">-->
<!--                <label class="layui-form-label">起止列</label>-->
<!--                <div class="layui-input-inline" style="width: 100px;">-->
<!--                    <input type="text" name="startBay" autocomplete="off" class="layui-input"-->
<!--                           lay-verify="required|number">-->
<!--                </div>-->
<!--                <div class="layui-form-mid">-</div>-->
<!--                <div class="layui-input-inline" style="width: 100px;">-->
<!--                    <input type="text" name="endBay" autocomplete="off" class="layui-input"-->
<!--                           lay-verify="required|number">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--        &lt;!&ndash; 层 &ndash;&gt;-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-inline">-->
<!--                <label class="layui-form-label">起止层</label>-->
<!--                <div class="layui-input-inline" style="width: 100px;">-->
<!--                    <input type="text" name="startLev" autocomplete="off" class="layui-input"-->
<!--                           lay-verify="required|number">-->
<!--                </div>-->
<!--                <div class="layui-form-mid">-</div>-->
<!--                <div class="layui-input-inline" style="width: 100px;">-->
<!--                    <input type="text" name="endLev" autocomplete="off" class="layui-input"-->
<!--                           lay-verify="required|number">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">堆垛机数量</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <input type="text" name="crnAmount" lay-verify="required|number" autocomplete="off" class="layui-input">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-inline">-->
<!--                <label class="layui-form-label">起始堆垛机</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" name="staCrn" autocomplete="off" class="layui-input" lay-verify="number">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
        <!-- 库位类型 -->
        <div class="layui-form-item">
            <label class="layui-form-label">高低类型</label>
            <div class="layui-input-inline">
                <select name="locType1">
                    <option style="display: none"></option>
                    <option value="0">未知</option>
                    <option value="1">低库位</option>
                    <option value="2">高库位</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">宽窄类型</label>
            <div class="layui-input-inline">
                <select name="locType2">
                    <option style="display: none"></option>
                    <option value="0">未知</option>
                    <option value="1">窄库位</option>
                    <option value="2">宽库位</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">轻重类型</label>
            <div class="layui-input-inline">
                <select name="locType3">
                    <option style="display: none"></option>
                    <option value="0">未知</option>
                    <option value="1">轻库位</option>
                    <option value="2">重库位</option>
                </select>
            </div>
        </div>
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">高低类型</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <select name="locType1">-->
<!--                    <option style="display: none"></option>-->
<!--                    <option value="0">未知</option>-->
<!--                    <option value="1">低库位</option>-->
<!--                    <option value="2">高库位</option>-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">宽窄类型</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <select name="locType2">-->
<!--                    <option style="display: none"></option>-->
<!--                    <option value="0">未知</option>-->
<!--                    <option value="1">窄库位</option>-->
<!--                    <option value="2">宽库位</option>-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label">轻重类型</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <select name="locType3">-->
<!--                    <option style="display: none"></option>-->
<!--                    <option value="0">未知</option>-->
<!--                    <option value="1">轻库位</option>-->
<!--                    <option value="2">重库位</option>-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
        <div style="text-align: center; margin-top: 20px">
            <button class="layui-btn layui-btn-radius layui-btn-normal" id="initDo" lay-submit lay-filter="initDo">
                确定