#
TQS
2022-11-22 13c2b426704d4ec12e4c263d054cec2f1416be39
#
3个文件已修改
55 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -105,4 +105,11 @@
     * @return
     */
    WrkMast selectLocMoveData(@Param("crnNo")Integer crnNo);
    /**
     * 查找工作档是否已存在绑定小车号的任务,状态17的除外
     * @param steNo
     * @return
     */
    WrkMast selectSteNoData(@Param("steNo")Integer steNo);
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1070,6 +1070,12 @@
                            if (steProtocol == null) { continue; }
                            if (steProtocol.isIdle()) {
                                //小车只能绑定一笔作业中任务
                                WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                                if(wrkMast1 != null){
                                    continue;
                                }
                                // 命令下发区 --------------------------------------------------------------------------
                                SteCommand steCommand = new SteCommand();
                                steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1261,6 +1267,12 @@
                    SteProtocol steProtocol = steThread.getSteProtocol();
                    if (steProtocol == null) { return; }
                    if (steProtocol.isIdle()) {
                        //小车只能绑定一笔作业中任务
                        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                        if(wrkMast1 != null){
                            return;
                        }
                        // 命令下发区 --------------------------------------------------------------------------
                        SteCommand steCommand = new SteCommand();
@@ -1689,6 +1701,12 @@
                    if (steProtocol == null) { return; }
                    if (steProtocol.isIdle()) {
                        //小车只能绑定一笔作业中任务
                        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                        if(wrkMast1 != null){
                            return;
                        }
                        // 命令下发区 --------------------------------------------------------------------------
                        SteCommand steCommand = new SteCommand();
                        steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1884,6 +1902,12 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1897,7 +1921,7 @@
            if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
            } else {
                log.error("穿梭车命令下发成功让小车从 远点 ====>> 待机位,IoType={}, 穿梭车号={},任务数据={}", wrkMast.getIoType(), steNo, JSON.toJSON(steCommand));
                log.error("穿梭车命令下发成功让小车从 远点 ====>> 待机位,绑定穿梭车,IoType={}, 穿梭车号={},任务数据={}", wrkMast.getIoType(), steNo, JSON.toJSON(steCommand));
                // 修改工作档状态 绑定穿梭车
                wrkMast.setSteNo(steNo);
                wrkMast.setModiTime(new Date());
@@ -1916,6 +1940,12 @@
        if (!basSteService.updatePakMk(steNo, "Y")) {
            log.error("修改穿梭车作业状态 失败!!,穿梭车={}", steNo);
            return;
        }
        //小车只能绑定一笔作业中任务
        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
        if(wrkMast1 != null){
            return;
        }
@@ -1952,6 +1982,12 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1988,6 +2024,12 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
src/main/resources/mapper/WrkMastMapper.xml
@@ -180,4 +180,8 @@
    <select id="selectLocMoveData" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where crn_no=#{crnNo} and io_type=11 order by io_pri desc,io_time,wrk_no asc
    </select>
    <select id="selectSteNoData" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where ste_no=#{steNo} and wrk_sts!=17 order by io_pri desc,io_time,wrk_no asc
    </select>
</mapper>