#
lsh
2022-12-29 4420bfb992da73896ae21107ae45b981df4c726e
#
5个文件已修改
97 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MonitorController.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/console.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MonitorController.java
@@ -11,7 +11,10 @@
import com.zy.core.CrnThread;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.LedSlave;
import com.zy.core.model.command.LedCommand;
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.LedThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -33,6 +36,8 @@
    @Autowired
    private ReportQueryMapper reportQueryMapper;
    @Autowired
    private SlaveProperties slaveProperties;
    /**
     * 获取当前时间
@@ -62,7 +67,7 @@
            case 101:
                ledId=1;
                break;
            case 107:
            case 109:
                ledId=2;
                break;
            case 117:
@@ -264,7 +269,41 @@
        );
    }
    /**
     * 获取其他信息
     */
    @GetMapping("/led")
    public R monitorLed(@RequestParam("ledId") Integer ledId) {
        String ledContent = "";
        List<LedCommand> commandList = null;
        for (LedSlave slave : slaveProperties.getLed()) {
            if (slave.getStaArr().contains(ledId)) {
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, slave.getId());
                if (null != ledThread) {
                    ledContent = ledThread.getStringBuffer().toString();
                    commandList = ledThread.getCommandList();
                }
            }
        }
        return R.ok().add(commandList);
    }
    /**
     * 异常通知
     */
    @GetMapping("/led/error")
    public R monitorLedError(@RequestParam("ledId") Integer ledId) {
        String errorMsg = "";
        for (LedSlave slave : slaveProperties.getLed()) {
            if (slave.getStaArr().contains(ledId)) {
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, slave.getId());
                if (null != ledThread) {
                    errorMsg = ledThread.getErrorMsg().toString();
                }
            }
        }
        return R.ok().add(errorMsg);
    }
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -25,6 +25,8 @@
//    @Select("select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC")
    WrkMast selectPakInStep1(@Param("sourceStaNo")Integer sourceStaNo, @Param("barcode")String barcode);
    WrkMast selectPakInStepBarcode(@Param("barcode")String barcode);
    WrkMast selectPakInStep11(@Param("sourceStaNo")Integer sourceStaNo);
    // 入库第二步,当托盘物料在堆垛机入库站时时查询
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -150,11 +150,31 @@
                    // 判断重复工作档
                    WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
                    WrkMast wrkMast1 = wrkMastMapper.selectPakInStepBarcode(barcode);
                    if (wrkMast1 !=null){
                        if (wrkMast1.getIoType()==103 || wrkMast1.getIoType()==107 || wrkMast1.getIoType()==104){
                            continue;
                        }
                    }
                    if (wrkMast != null) {
                        log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo());
                        if (inSta.getStaNo()==100 || inSta.getStaNo()==108 || inSta.getStaNo()==116){
                        if (inSta.getStaNo()==101 || inSta.getStaNo()==109 || inSta.getStaNo()==117){
                            staProtocol.setWorkNo((short)9999);
                            staProtocol.setStaNo((short)100);
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
                                throw new CoolException("更新plc站点信息失败");
                            }
                        }else if (inSta.getStaNo()==201 || inSta.getStaNo()==207 || inSta.getStaNo()==213){
                            staProtocol.setWorkNo((short)9999);
                            if (inSta.getStaNo()==201){
                                staProtocol.setStaNo((short)200);
                            }else if (inSta.getStaNo()==207){
                                staProtocol.setStaNo((short)206);
                            }else if (inSta.getStaNo()==213){
                                staProtocol.setStaNo((short)212);
                            }
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
@@ -199,6 +219,29 @@
                            }
                        } else {
                            log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                            if (inSta.getStaNo()==101 || inSta.getStaNo()==109 || inSta.getStaNo()==117){
                                staProtocol.setWorkNo((short)9999);
                                staProtocol.setStaNo((short)100);
                                devpThread.setPakMk(staProtocol.getSiteId(), false);
                                boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                                if (!result) {
                                    throw new CoolException("更新plc站点信息失败");
                                }
                            }else if (inSta.getStaNo()==201 || inSta.getStaNo()==207 || inSta.getStaNo()==213){
                                staProtocol.setWorkNo((short)9999);
                                if (inSta.getStaNo()==201){
                                    staProtocol.setStaNo((short)200);
                                }else if (inSta.getStaNo()==207){
                                    staProtocol.setStaNo((short)206);
                                }else if (inSta.getStaNo()==213){
                                    staProtocol.setStaNo((short)212);
                                }
                                devpThread.setPakMk(staProtocol.getSiteId(), false);
                                boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                                if (!result) {
                                    throw new CoolException("更新plc站点信息失败");
                                }
                            }
                        }
src/main/resources/mapper/WrkMastMapper.xml
@@ -86,6 +86,9 @@
    <select id="selectPakInStep1" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStepBarcode" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where  barcode = #{barcode}
    </select>
    <select id="selectPakInStep11" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=1 and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
src/main/webapp/views/console.html
@@ -605,11 +605,11 @@
                        var offSet = 0;
                        switch (i) {
                            case 0:
                            case 1:;
                            case 1:
                            case 2:
                            case 3:
                                unit = 150;
                                offSet = 550;
                                unit = 35;
                                offSet = 500;
                                break;
                            case 5:
                                unit = 124;