cpT
2025-06-19 c2bb8ac8fd2bb217364162ee84af3baf8a34fb8d
#改造
4个文件已修改
99 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/OpenController.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/wms/js/deviceError/deviceError.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/deviceError/deviceError.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -6,6 +6,7 @@
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.*;
@@ -345,18 +346,43 @@
        auth(appkey, params, request);
//        List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>();
        for (CarryParam param:params){
            param.updateIoTyoe(param.getIoType());//中航下发  1:出库,2:移库 3:入库   ====转换为====>  1:入库,2:出库,3:移库
            param.updateLocNo();
            if (Cools.isEmpty(param)){
                try{
                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                    deviceErrorService.addDeviceError("wms", 1, "参数为空,params:"+JSON.toJSONString(params));
                } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                }
                return R.error("参数为空!");
            } else if (Cools.isEmpty(param.getTaskNo())){
                try{
                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                    deviceErrorService.addDeviceError("wms", 1, "任务号为空,taskNo:"+JSON.toJSONString(param));
                } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                }
                return R.error("任务号为空!");
            } else if (Cools.isEmpty(param.getIoType())){
                try{
                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                    deviceErrorService.addDeviceError("wms", 1, "任务类型为空,ioType:"+JSON.toJSONString(param));
                } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                }
                return R.error("任务类型为空!");
            }
            if (Cools.isEmpty(param.getStartPoint()) || Cools.isEmpty(param.getTargetPoint())){
                try{
                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                    deviceErrorService.addDeviceError("wms", 1, "初始目标或者目标位为空,Point:"+JSON.toJSONString(param));
                } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                }
                return R.error("初始目标或者目标位为空");
            }
            param.updateIoTyoe(param.getIoType());//中航下发  1:出库,2:移库 3:入库   ====转换为====>  1:入库,2:出库,3:移库
            param.updateLocNo();
//            if (Cools.isEmpty(param.getContainerCode())){
//                return R.error("容器编码(托盘码)为空!");
//            }
@@ -378,6 +404,12 @@
            }
            LocMast locMast = locMastService.selectByLocNo(locNo);
            if(Cools.isEmpty(locMast)){
                try{
                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                    deviceErrorService.addDeviceError("wms", 1, "初始库位无法找到,locNo:"+JSON.toJSONString(locNo));
                } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                }
                return R.error("初始库位无法找到");
            }
@@ -390,6 +422,12 @@
                        .eq("crn_no",locMast.getCrnNo())
                        .eq("stn_no",param.getStartPoint()));
                if(Cools.isEmpty(staDesc)){
                    try{
                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                        deviceErrorService.addDeviceError("wms", 1, "入库路劲不存在,param:"+JSON.toJSONString(param));
                    } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                    }
                    return R.error("入库路劲不存在");
                }
                r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getCrnStn()));
@@ -401,15 +439,33 @@
                        .eq("crn_no",locMast.getCrnNo())
                        .eq("stn_no",param.getTargetPoint()));
                if(Cools.isEmpty(staDesc)){
                    try{
                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                        deviceErrorService.addDeviceError("wms", 1, "出库路劲不存在,param:"+JSON.toJSONString(param));
                    } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                    }
                    return R.error("出库路劲不存在");
                }
                r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getStnNo()));
            }else if (param.getIoType() == 3){
                LocMast locMast2 = locMastService.selectByLocNo(param.getTargetPoint());
                if(Cools.isEmpty(locMast2)){
                    try{
                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                        deviceErrorService.addDeviceError("wms", 1, "目标库位无法找到,locNo:"+JSON.toJSONString(param.getTargetPoint()));
                    } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                    }
                    return R.error("目标库位无法找到");
                }
                if (!locMast2.getCrnNo().equals(locMast.getCrnNo())){
                    try{
                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                        deviceErrorService.addDeviceError("wms", 1, "起始库位与目标库位不再同一巷道,param:"+JSON.toJSONString(param));
                    } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
                    }
                    return R.error("起始库位与目标库位不再同一巷道");
                }
                //移库任务创建
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.R;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.domain.enums.TaskStatusType;
import com.zy.asrs.domain.enums.WorkNoType;
@@ -65,9 +66,21 @@
    public R taskCreate(TaskCreateParam param) {
        TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
        if (taskWrk != null) {
            try{
                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                deviceErrorService.addDeviceError("wms", 1, "任务已存在,请勿重复提交,taskWrk:"+JSON.toJSONString(taskWrk));
            } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
            }
            throw new CoolException(param.getTaskNo() + "任务已存在,请勿重复提交");
        }
        if (param.getIoType().equals(0)){
            try{
                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                deviceErrorService.addDeviceError("wms", 1, "生成任务失败,任务类型不存在!,iotype:"+JSON.toJSONString(param.getIoType()));
            } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
            }
            throw new CoolException("生成任务失败,任务类型不存在!");
        }
@@ -139,6 +152,12 @@
        }
        if (!taskWrkService.insert(taskWrk)) {
            try{
                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
                deviceErrorService.addDeviceError("wms", 1, "创建任务失败!,param:"+JSON.toJSONString(param));
            } catch (Exception e2){
//                    log.error("e2:"+e2.getMessage());
            }
            return R.error("创建任务失败");
        }
        return R.ok();
src/main/webapp/static/wms/js/deviceError/deviceError.js
@@ -22,11 +22,11 @@
        height: 'full-120',
        cols: [[
            {type: 'checkbox'}
            ,{field: 'id', align: 'center',title: '编号'}
            ,{field: 'device', align: 'center',title: '设备'}
            ,{field: 'deviceId', align: 'center',title: '设备ID'}
            ,{field: 'msg', align: 'center',title: '异常信息'}
            ,{field: 'createTime$', align: 'center',title: '创建时间'}
            ,{field: 'id', align: 'center',title: '编号',hide : true}
            ,{field: 'device', align: 'center',title: '类型', hide: false}
            ,{field: 'deviceId', align: 'center',title: '相关ID', hide: false}
            ,{field: 'msg', align: 'center',title: '异常信息', hide: false}
            ,{field: 'createTime$', align: 'center',title: '日期', hide: false}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120}
        ]],
src/main/webapp/views/deviceError/deviceError.html
@@ -17,11 +17,11 @@
        <div class="layui-card-body">
            <div class="layui-form toolbar" id="search-box">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">
                        </div>
                    </div>
<!--                    <div class="layui-inline">-->
<!--                        <div class="layui-input-inline">-->
<!--                            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">-->
<!--                        </div>-->
<!--                    </div>-->
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="device" placeholder="设备" autocomplete="off">