#
zjj
2023-12-11 c8b2322c5c43b6e627ff724405281bc53c6c98f5
#
8个文件已修改
138 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/CrnController.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/CrnProtocol.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-prod.yml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/deviceOperate/crnOperate.html 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/CrnController.java
@@ -381,12 +381,13 @@
        command.setTaskNo((short) 0); // 工作号
        command.setAckFinish((short) 0);  // 任务完成确认位
        command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式
        command.setSourcePosX(param.getSourceRow());     // 源库位排
        command.setSourcePosY(param.getSourceBay());     // 源库位列
        command.setSourcePosZ(param.getSourceLev());     // 源库位层
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        command.setSourcePosZ(param.getSourceRow());     // 源库位排
        command.setSourcePosX(param.getSourceBay());     // 源库位列
        command.setSourcePosY(param.getSourceLev());     // 源库位层
        command.setDestinationPosZ(param.getRow());     // 目标库位排
        command.setDestinationPosX(param.getBay());     // 目标库位列
        command.setDestinationPosY(param.getLev());     // 目标库位层
        command.setCommand((short)1);
        return crnControl(command)?R.ok():R.error();
    }
@@ -398,12 +399,12 @@
        command.setTaskNo((short) 0); // 工作号
        command.setAckFinish((short) 0);  // 任务完成确认位
        command.setTaskMode(CrnTaskModeType.PAKOUT); // 任务模式
        command.setSourcePosX(param.getSourceRow());     // 源库位排
        command.setSourcePosY(param.getSourceBay());     // 源库位列
        command.setSourcePosZ(param.getSourceLev());     // 源库位层
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        command.setSourcePosZ(param.getSourceRow());     // 源库位排
        command.setSourcePosX(param.getSourceBay());     // 源库位列
        command.setSourcePosY(param.getSourceLev());     // 源库位层
        command.setDestinationPosZ(param.getRow());     // 目标库位排
        command.setDestinationPosX(param.getBay());     // 目标库位列
        command.setDestinationPosY(param.getLev());     // 目标库位层
        return crnControl(command)?R.ok():R.error();
    }
@@ -415,12 +416,13 @@
        command.setTaskNo((short) 0); // 工作号
        command.setAckFinish((short) 0);  // 任务完成确认位
        command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式
        command.setSourcePosX(param.getSourceRow());     // 源库位排
        command.setSourcePosY(param.getSourceBay());     // 源库位列
        command.setSourcePosZ(param.getSourceLev());     // 源库位层
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        command.setSourcePosZ(param.getSourceRow());     // 源库位排
        command.setSourcePosX(param.getSourceBay());     // 源库位列
        command.setSourcePosY(param.getSourceLev());     // 源库位层
        command.setDestinationPosZ(param.getRow());     // 目标库位排
        command.setDestinationPosX(param.getBay());     // 目标库位列
        command.setDestinationPosY(param.getLev());     // 目标库位层
        command.setCommand((short)1);
        LocMast sourceLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getSourcePosX())
                .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ()));
        LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX())
@@ -475,8 +477,8 @@
        command.setSourcePosY((short) 0);     // 源库位列
        command.setSourcePosZ((short) 0);     // 源库位层
        command.setDestinationPosX((short) 0);     // 目标库位排
        command.setDestinationPosY((short) 34);     // 目标库位列
        command.setDestinationPosZ((short) 5);     // 目标库位层
        command.setDestinationPosY((short) 22);     // 目标库位列
        command.setDestinationPosZ((short) 1);     // 目标库位层
        return crnControl(command)?R.ok():R.error();
    }
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -166,17 +166,17 @@
                    String barcode = barcodeThread.getBarcode();
                    if(!Cools.isEmpty(barcode)) {
                        StaDescService staDescService = SpringUtils.getBean(StaDescService.class);
                        StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta()));
                        ToWmsDTO toWmsDTO = new ToWmsDTO();
                        Map<String, Object> map = new HashMap<>();
                        map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2");
                        List<Integer> list = openServiceImpl.getInEnableRoadway();
                        TaskWrk taskWrk = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode).eq("crn_no",staDesc1.getCrnNo()));
                        TaskWrk taskWrk = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode));
                        if (Cools.isEmpty(taskWrk)){
                            continue;
                        }
                        //StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta()));
                        if (taskWrk.getTargetPoint() != null && taskWrk.getStartPoint() != null && taskWrk.getWrkNo() != null && taskWrk.getWrkNo().shortValue() != workNo){
                            //获取堆垛机站点
                            StaDesc staDesc = new StaDesc();
@@ -443,7 +443,7 @@
//                }
            }
            return;
           // return;
        }
    }
@@ -873,7 +873,7 @@
            } else if (taskWrk.getIoType() == 2) {
                //出库任务
                taskWrk.setWrkSts(14);//12.吊车出库中 => 14.出库完成
                taskWrk.setStatus(TaskStatusType.COMPLETE.id);
//                taskWrk.setStatus(TaskStatusType.COMPLETE.id);
                taskWrk.setModiTime(now);
                taskWrkService.updateById(taskWrk);
src/main/java/com/zy/asrs/utils/Utils.java
@@ -330,7 +330,7 @@
//        slaveProperties.setGroupCount(4);
//        Integer deepRow = getDeepRow(slaveProperties, 6);
//        System.out.println(deepRow);
        String wcsLocNo = getWcsLocNo("02-01-01-02-01");
        System.out.println(wcsLocNo);
        CrnSlave.CrnStn crnStnByStaNo = getCrnStnByStaNo(235, true);
        System.out.println(crnStnByStaNo);
    }
}
src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -54,7 +54,7 @@
     */
    public Short status;
    public Short alarm;
    public Short alarm = 0;
    /**
     * 状态枚举
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -43,6 +43,7 @@
    private CrnSlave slave;
    private CrnProtocol crnProtocol;
    private boolean resetFlag = false;
    @Value("${wms.url}")
    private String wmsUrl;
    public static final List<Short> rowOne = new ArrayList<Short>() {{
@@ -248,7 +249,7 @@
                    }
                    ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class);
                    apiLogService.save("Wms任务完成接口"
                            ,wmsUrl+"/wcsManager/wcsInterface/taskStatusFeedback"
                            ,"10.32.53.195:8080"+"/wcsManager/wcsInterface/taskStatusFeedback"
                            ,null
                            ,"127.0.0.1"
                            ,JSON.toJSONString(taskOverToWms)
@@ -383,22 +384,13 @@
        }
        array[1] = command.getTaskNo();
        array[2] = command.getTaskMode();
        array[3] = command.getSourcePosZ();
        array[4] = command.getSourcePosX();
        array[5] = command.getSourcePosY();
        array[6] = command.getDestinationPosZ();
        array[7] = command.getDestinationPosX();
        array[8] = command.getDestinationPosY();
        array[9] = command.getCommand();
        // 作业信息
        OperateResult result = siemensNet.Write("DB100.0", array);
        // 日志记录
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -335,6 +335,19 @@
                staProtocol.setBarcodeErr(status[6]);
            }
        } else if (slave.getId() == 3) {
            //条码
            //Thread.sleep(200);
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.18",(short)10);
            if (result2.IsSuccess) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,0,8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 7);
                    if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                        barcodeThread.setBarcode(barcode);
                    }
            }
            // 外形检测 - 111
            //Thread.sleep(50);
            OperateResultExOne<byte[]> result10 = siemensS7Net.Read("DB101.26", (short)1);
src/main/resources/application-prod.yml
@@ -196,7 +196,7 @@
      devpPlcId: ${wcs-slave.devp[1].id}
    crnInStn[1]:  #堆垛机入库站点2
      staNo: 235
      row: 19
      row: 21
      bay: 22
      lev: 2
      devpPlcId: ${wcs-slave.devp[1].id}
@@ -321,7 +321,7 @@
    inSta[0]: #入库口1
      scale: ${wcs-slave.scale[1].id}
      staNo: 301
      barcode: ${wcs-slave.barcode[1].id}
      barcode: ${wcs-slave.barcode[6].id}
      backSta: 300
      #slot: 0
    outSta[0]: #出库口1
@@ -373,3 +373,7 @@
    port: 51236
    ip: 172.17.91.44
    id: 6
  barcode[6]:
    port: 51236
    ip: 172.17.8.203
    id: 7
src/main/webapp/views/deviceOperate/crnOperate.html
@@ -234,27 +234,34 @@
                },
                requestOperate(method) {
                    let that = this
                    $.ajax({
                        url: baseUrl + "/crn/operator/" + method,
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: this.formParam,
                        method: 'POST',
                        success: function (res) {
                            if (res.code == 200) {
                                that.$message({
                                    message: res.msg,
                                    type: 'success'
                                });
                            } else {
                                that.$message({
                                    message: res.msg,
                                    type: 'error'
                                });
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/crn/operator/" + method,
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: this.formParam,
                            method: 'POST',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        }
                    });
                        });
                    })
                },
                updateEnableInOut(type) {
                    let that = this