7a546480f6ddfaee1366f280981a002a08412c11..aaf4a5039c86db159587e1299d5c3925adb70489
2025-12-18 Junjie
#
aaf4a5 对比 | 目录
2025-12-18 Junjie
#
af2f94 对比 | 目录
2025-12-18 Junjie
#
707f8d 对比 | 目录
2025-12-18 Junjie
#
98d120 对比 | 目录
27个文件已修改
482 ■■■■ 已修改文件
pom.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ConsoleController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/enums/StationStatusType.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/vo/StationLatestDataVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/BasDevp.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocMastService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/HttpHandler.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RedisKeyType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/StationProtocol.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/network/entity/ZyStationStatusEntity.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/network/fake/ZyRgvFakeConnect.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/plugin/FakeProcess.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/ZyStationThread.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/map/上海临港哥斯拉项目.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BasDevpMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/components/DevpCard.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/components/MapCanvas.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/basDevp/basDevp.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/basDevp/basDevp.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -131,6 +131,10 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    </dependencies>
    <build>
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -117,11 +117,12 @@
                vo.setOutEnable(stationProtocol.isOutEnable()); // æ˜¯å¦å¯å‡º
                vo.setEmptyMk(stationProtocol.isEmptyMk()); // æ˜¯å¦ç©ºæ¿
                vo.setFullPlt(stationProtocol.isFullPlt()); // æ˜¯å¦æ»¡æ¿
                vo.setRunBlock(stationProtocol.isRunBlock());// è¿è¡Œå µå¡ž
                vo.setPalletHeight(stationProtocol.getPalletHeight()); // æ‰˜ç›˜é«˜åº¦
                vo.setError(stationProtocol.getError()); // é”™è¯¯ç 
                vo.setBarcode(stationProtocol.getBarcode()); // æ¡ç 
                String stationStatus = StationStatusType.process(stationProtocol).toString().toLowerCase().replaceAll("_", "-");
                if (stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.getTaskNo() > 0) {
                if (stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.getTaskNo() > 0 && !stationProtocol.isRunBlock()) {
                    String taskClass = getStationTaskClass(stationProtocol.getTaskNo(), inTaskRange, outTaskRange);
                    if (taskClass != null) {
                        stationStatus = taskClass;
src/main/java/com/zy/asrs/domain/enums/StationStatusType.java
@@ -20,12 +20,17 @@
    SITE_AUTO_ID,
    // æ•…éšœ
    SITE_ERROR,
    // è¿è¡Œé˜»å¡ž
    SITE_RUN_BLOCK,
    ;
    public static StationStatusType process(StationProtocol stationProtocol){
        if (stationProtocol == null) {
            return null;
        }
        if(stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.getTaskNo() > 0 && stationProtocol.isRunBlock()){
            return SITE_RUN_BLOCK;
        }
        if (stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.getTaskNo() > 0) {
            return SITE_AUTO_RUN_ID;
        }
src/main/java/com/zy/asrs/domain/vo/StationLatestDataVo.java
@@ -32,6 +32,9 @@
    // æ»¡æ‰˜ç›˜
    private boolean fullPlt;
    // è¿è¡Œé˜»å¡ž
    private boolean runBlock;
    // æ‰˜ç›˜é«˜åº¦
    private Integer palletHeight;
src/main/java/com/zy/asrs/entity/BasDevp.java
@@ -106,6 +106,20 @@
    @TableField("out_station_list")
    private String outStationList;
    /**
     * è¿è¡Œå µå¡žé‡æ–°åˆ†é…åº“位站点数据
     */
    @ApiModelProperty(value= "运行堵塞重新分配库位站点数据")
    @TableField("run_block_reassign_loc_station_list")
    private String runBlockReassignLocStationList;
    /**
     *  é¡¶å‡ç§»æ ½ç«™ç‚¹æ•°æ®
     */
    @ApiModelProperty(value= "顶升移栽站点数据")
    @TableField("lift_transfer_station_list")
    private String liftTransferStationList;
    public BasDevp() {}
    public BasDevp(Integer devpNo,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,String stationList,String barcodeStationList,String inStationList,String outStationList) {
@@ -209,4 +223,17 @@
        return list;
    }
    public List<StationObjModel> getRunBlockReassignLocStationList$(){
        List<StationObjModel> list = new ArrayList<>();
        if (Cools.isEmpty(this.runBlockReassignLocStationList)){
            return list;
        }
        List<StationObjModel> jsonList = JSON.parseArray(this.runBlockReassignLocStationList, StationObjModel.class);
        for (StationObjModel json : jsonList){
            list.add(json);
        }
        return list;
    }
}
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -14,13 +14,7 @@
    LocMast queryByLoc(String locNo);
    LocMast queryByQrCode(String qrCodeValue);
    List<LocMast> selectLocByLev(Integer lev);
    List<LocMast> selectEmptyLocNos(@Param("locNos") List<String> locNos);
    List<LocMast> selectNotEmptyLocNos(@Param("locNos") List<String> locNos);
    //查询所有楼层
    List<Integer> getLevList();
src/main/java/com/zy/asrs/service/LocMastService.java
@@ -9,14 +9,8 @@
    LocMast queryByLoc(String locNo);
    LocMast queryByQrCode(String qrCodeValue);
    //查询指定楼层的库位数据
    List<LocMast> selectLocByLev(Integer lev);
    List<LocMast> selectEmptyLocNos(List<String> locNos);
    List<LocMast> selectNotEmptyLocNos(List<String> locNos);
    //查询所有楼层
    List<Integer> getLevList();
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -19,26 +19,8 @@
    }
    @Override
    public LocMast queryByQrCode(String qrCodeValue) {
        return this.baseMapper.queryByQrCode(qrCodeValue);
    }
    @Override
    public List<LocMast> selectLocByLev(Integer lev) {
        return this.baseMapper.selectLocByLev(lev);
    }
    @Override
    public List<LocMast> selectEmptyLocNos(List<String> locNos) {
        return this.baseMapper.selectEmptyLocNos(locNos);
    }
    @Override
    public List<LocMast> selectNotEmptyLocNos(List<String> locNos) {
        if (locNos.isEmpty()) {
            return new ArrayList<LocMast>();
        }
        return this.baseMapper.selectNotEmptyLocNos(locNos);
    }
    @Override
src/main/java/com/zy/asrs/utils/Utils.java
@@ -140,6 +140,11 @@
    //获取入库任务可用排
    public static List<Integer> getInTaskEnableRow() {
        return getInTaskEnableRow(new ArrayList<>());
    }
    //获取入库任务可用排
    public static List<Integer> getInTaskEnableRow(List<Integer> excludeCrnList) {
        List<Integer> list = new ArrayList<>();
        try {
            RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
@@ -201,6 +206,9 @@
                    News.info("堆垛机:{} å·²è¾¾æœ€å¤§å…¥åº“任务数,当前任务数:{}", basCrnp.getCrnNo(), inWrkMasts.size());
                    continue;
                }
                if (excludeCrnList.contains(basCrnp.getCrnNo())) {
                    continue;
                }
                enabledCrnps.add(basCrnp);
            }
src/main/java/com/zy/common/utils/HttpHandler.java
@@ -51,9 +51,12 @@
            }
        }
        Request request = headerBuilder.url(url).build();
        Response response = getClient(timeout, timeUnit).newCall(request).execute();
        OkHttpClient client = getClient(timeout, timeUnit);
        Response response = client.newCall(request).execute();
        String result = response.isSuccessful() ? response.body().string() : null;
        response.close();
        try { client.dispatcher().executorService().shutdown(); } catch (Exception ignore) {}
        try { client.connectionPool().evictAll(); } catch (Exception ignore) {}
        return result;
    }
@@ -86,10 +89,13 @@
            request = builder.post(body).build();
        }
        Call call = getClient(timeout, timeUnit).newCall(request);
        OkHttpClient client = getClient(timeout, timeUnit);
        Call call = client.newCall(request);
        Response response = call.execute();
        String result = response.body().string();
        response.close();
        try { client.dispatcher().executorService().shutdown(); } catch (Exception ignore) {}
        try { client.connectionPool().evictAll(); } catch (Exception ignore) {}
        return result;
    }
src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -33,6 +33,7 @@
    CRN_IO_EXECUTE_FINISH_LIMIT("crn_io_execute_finish_limit_"),
    STATION_IN_EXECUTE_LIMIT("station_in_execute_limit_"),
    STATION_OUT_EXECUTE_LIMIT("station_out_execute_limit_"),
    CHECK_STATION_RUN_BLOCK_LIMIT_("check_station_run_block_limit_"),
    CURRENT_CIRCLE_TASK_CRN_NO("current_circle_task_crn_no_"),
    AI_CHAT_HISTORY("ai_chat_history_"),
src/main/java/com/zy/core/model/protocol/StationProtocol.java
@@ -35,6 +35,9 @@
    // æ»¡æ‰˜ç›˜
    private boolean fullPlt;
    // è¿è¡Œé˜»å¡ž
    private boolean runBlock;
    // æ‰˜ç›˜é«˜åº¦
    private Integer palletHeight;
src/main/java/com/zy/core/network/entity/ZyStationStatusEntity.java
@@ -44,6 +44,9 @@
    //条码
    private String barcode;
    //运行堵塞
    private boolean runBlock = false;
    @Override
    public ZyStationStatusEntity clone() {
        try {
src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
@@ -29,6 +29,7 @@
    @Override
    public boolean disconnect() {
        try { executor.shutdownNow(); } catch (Exception ignore) {}
        return true;
    }
@@ -90,6 +91,9 @@
        moveZ(this.crnStatus.getLevel(), sourcePosZ);
        this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(1);
        this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id);
@@ -97,6 +101,9 @@
        moveZ(this.crnStatus.getLevel(), destinationPosZ);
        this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(0);
        this.crnStatus.setStatus(CrnStatusType.WAITING.id);
    }
@@ -109,6 +116,9 @@
                initSourcePosZ++;
                this.crnStatus.setLevel(initSourcePosZ);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
            int moveLength = sourcePosZ - destinationPosZ;
@@ -117,6 +127,9 @@
                initSourcePosZ--;
                this.crnStatus.setLevel(initSourcePosZ);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
    }
@@ -129,6 +142,9 @@
                initSourcePosY++;
                this.crnStatus.setBay(initSourcePosY);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
            int moveLength = sourcePosY - destinationPosY;
@@ -137,6 +153,9 @@
                initSourcePosY--;
                this.crnStatus.setBay(initSourcePosY);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
    }
@@ -145,7 +164,7 @@
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
            Thread.currentThread().interrupt();
        }
    }
}
src/main/java/com/zy/core/network/fake/ZyRgvFakeConnect.java
@@ -37,6 +37,7 @@
    @Override
    public boolean disconnect() {
        try { executor.shutdownNow(); } catch (Exception ignore) {}
        return true;
    }
@@ -120,11 +121,17 @@
            status.setRgvPos(currentTrackSiteNo);
            sleep(1000);
            if (Thread.currentThread().isInterrupted()) {
                return;
            }
        }
        status.setStatus(RgvStatusType.PUTTING.id);
        status.setLoaded(1);
        sleep(1000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        for (int i = 0; i < targetNavigateNodes.size(); i++) {
            NavigateNode navigateNode = targetNavigateNodes.get(i);
@@ -133,9 +140,15 @@
            status.setRgvPos(currentTrackSiteNo);
            sleep(1000);
            if (Thread.currentThread().isInterrupted()) {
                return;
            }
        }
        sleep(1000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        status.setStatus(RgvStatusType.WAITING.id);
    }
@@ -181,6 +194,9 @@
            status.setRgvPos(currentTrackSiteNo);
            sleep(1000);
            if (Thread.currentThread().isInterrupted()) {
                return;
            }
        }
        status.setStatus(RgvStatusType.WAITING.id);
    }
@@ -194,7 +210,7 @@
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
            Thread.currentThread().interrupt();
        }
    }
}
}
src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
@@ -14,6 +14,7 @@
import com.zy.core.network.api.ZyStationConnectApi;
import com.zy.core.network.entity.ZyStationStatusEntity;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -63,6 +64,7 @@
                    status.setOutEnable(true);// æ¨¡æ‹Ÿå¯å‡º
                    status.setEmptyMk(false);// æ¨¡æ‹Ÿç©ºæ¿ä¿¡å·
                    status.setFullPlt(false);// æ¨¡æ‹Ÿæ»¡æ‰˜ç›˜
                    status.setRunBlock(false);// è¿è¡Œæ— å µå¡ž
                    status.setPalletHeight(0);// æ¨¡æ‹Ÿæ‰˜ç›˜é«˜åº¦ä¸º0
                    status.setError(0);// æ¨¡æ‹Ÿæ— æŠ¥è­¦
                    status.setBarcode("");// æ¨¡æ‹Ÿæ— æ¡ç 
@@ -263,15 +265,21 @@
            return;
        }
        stationMove(navigateNodes, taskNo, stationId, true, generateBarcode);
        stationMove(targetNavigateNodes, taskNo, targetStationId, false, generateBarcode);
        boolean result = stationMove(navigateNodes, taskNo, stationId, true, generateBarcode);
        if(result) {
            stationMove(targetNavigateNodes, taskNo, targetStationId, false, generateBarcode);
        }
    }
    private void stationMove(List<NavigateNode> navigateNodes, Integer taskNo, Integer targetStationId, boolean clearData, boolean generateBarcode) {
    private boolean stationMove(List<NavigateNode> navigateNodes, Integer taskNo, Integer targetStationId, boolean clearData, boolean generateBarcode) {
        Integer lastStationId = null;
        long executeTime = System.currentTimeMillis();
        int i = 0;
        while (i < navigateNodes.size()) {
            if (Thread.currentThread().isInterrupted()) {
                return false;
            }
            NavigateNode navigateNode = navigateNodes.get(i);
            JSONObject valueObject = JSON.parseObject(navigateNode.getNodeValue());
            Integer currentStationId = valueObject.getInteger("stationId");
@@ -285,8 +293,24 @@
            }
            if (nextStationId != null) {
            if (!checkTaskNoInArea(taskNo)) {
                boolean fakeAllowCheckBlock = true;
                Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
                if (systemConfigMapObj != null) {
                    HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
                    if (!systemConfigMap.get("fakeAllowCheckBlock").equals("Y")) {
                        fakeAllowCheckBlock = false;
                    }
                }
                if (fakeAllowCheckBlock && System.currentTimeMillis() - executeTime > 1000 * 10) {
                    //认定堵塞
                    boolean result = runBlockStation(taskNo, currentStationId, taskNo, currentStationId);
                    if(!result) {
                        continue;
                    }
                    return false;
                }
            }
            if (i == 0) {
@@ -295,6 +319,9 @@
                    continue;
                }
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return false;
                }
            }
            if(nextStationId != null) {
@@ -306,12 +333,19 @@
            }
            i++;
            executeTime = System.currentTimeMillis();
            sleep(1000);
            if (Thread.currentThread().isInterrupted()) {
                return false;
            }
        }
        if (generateBarcode) {
            if (lastStationId != null) {
                while (true) {
                    if (Thread.currentThread().isInterrupted()) {
                        break;
                    }
                    boolean result = generateStationBarcode(taskNo, targetStationId);
                    sleep(1000);
                    if (!result) {
@@ -324,8 +358,14 @@
        if (clearData) {
            sleep(10000);
            if (Thread.currentThread().isInterrupted()) {
                return true;
            }
            if (lastStationId != null) {
                while (true) {
                    if (Thread.currentThread().isInterrupted()) {
                        break;
                    }
                    boolean result = clearStation(taskNo, targetStationId);
                    sleep(1000);
                    if (!result) {
@@ -335,13 +375,15 @@
                }
            }
        }
        return true;
    }
    private void sleep(long ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
            Thread.currentThread().interrupt();
        }
    }
@@ -366,7 +408,7 @@
        return true;
    }
    public synchronized boolean updateStationData(Integer lockTaskNo, Integer stationId, Integer taskNo, Integer targetStaNo, Boolean isLoading, String barcode) {
    public synchronized boolean updateStationData(Integer lockTaskNo, Integer stationId, Integer taskNo, Integer targetStaNo, Boolean isLoading, String barcode, Boolean runBlock) {
        if (LOCK_STATION != lockTaskNo) {
            return false;
        }
@@ -393,6 +435,10 @@
        if (barcode != null) {
            currentStatus.setBarcode(barcode);
        }
        if(runBlock != null) {
            currentStatus.setRunBlock(runBlock);
        }
        return true;
    }
@@ -405,15 +451,13 @@
                return false;
            }
            if(currentStatus.getTaskNo().equals(taskNo)) {
                return true;
            if (currentStatus.getTaskNo() > 0) {
                if (!currentStatus.getTaskNo().equals(taskNo) && currentStatus.isLoading()) {
                    return false;
                }
            }
            if (currentStatus.getTaskNo() > 0 || currentStatus.isLoading()) {
                return false;
            }
            boolean result = updateStationData(taskNo, currentStationId, taskNo, targetStationId, isLoading, barcode);
            boolean result = updateStationData(taskNo, currentStationId, taskNo, targetStationId, isLoading, barcode, false);
            if (!result) {
                return false;
            }
@@ -439,12 +483,12 @@
                return false;
            }
            boolean result = updateStationData(lockTaskNo, nextStationId, taskNo, targetStaNo, true, null);
            boolean result = updateStationData(lockTaskNo, nextStationId, taskNo, targetStaNo, true, null, false);
            if (!result) {
                return false;
            }
            boolean result2 = updateStationData(lockTaskNo, currentStationId, 0, 0, false, null);
            boolean result2 = updateStationData(lockTaskNo, currentStationId, 0, 0, false, "", false);
            if (!result2) {
                return false;
            }
@@ -466,7 +510,7 @@
            String barcodeTime = String.valueOf(System.currentTimeMillis());
            String barcode = barcodeTime.substring(5);
            boolean result = updateStationData(lockTaskNo, currentStationId, null, null, null, barcode);
            boolean result = updateStationData(lockTaskNo, currentStationId, null, null, null, barcode, null);
            if (!result) {
                return false;
            }
@@ -485,7 +529,26 @@
                return false;
            }
            boolean result = updateStationData(lockTaskNo, currentStationId, 0, 0, false, "");
            boolean result = updateStationData(lockTaskNo, currentStationId, 0, 0, false, "", false);
            if (!result) {
                return false;
            }
            return true;
        });
        return executeResult;
    }
    public synchronized boolean runBlockStation(Integer lockTaskNo, Integer currentStationId, Integer taskNo, Integer blockStationId) {
        boolean executeResult = lockExecute(lockTaskNo, () -> {
            ZyStationStatusEntity currentStatus = statusList.stream()
                    .filter(item -> item.getStationId().equals(currentStationId)).findFirst().orElse(null);
            if (currentStatus == null) {
                return false;
            }
            boolean result = updateStationData(lockTaskNo, currentStationId, taskNo, blockStationId, true, "", true);
            if (!result) {
                return false;
            }
src/main/java/com/zy/core/plugin/FakeProcess.java
@@ -113,6 +113,8 @@
        stationOperateProcessUtils.stationOutExecute();
        //检测输送站点出库任务执行完成
        stationOperateProcessUtils.stationOutExecuteFinish();
        //检测输送站点是否运行堵塞
        stationOperateProcessUtils.checkStationRunBlock();
    }
    //检测入库站是否有任务生成,并仿真生成模拟入库站点数据
src/main/java/com/zy/core/thread/impl/ZyStationThread.java
@@ -158,6 +158,7 @@
                    stationProtocol.setPalletHeight(statusEntity.getPalletHeight());
                    stationProtocol.setError(statusEntity.getError());
                    stationProtocol.setBarcode(statusEntity.getBarcode());
                    stationProtocol.setRunBlock(statusEntity.isRunBlock());
                }
            }
        }
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -4,13 +4,13 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.domain.param.CreateInTaskParam;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.common.utils.RedisUtil;
import com.zy.core.News;
import com.zy.core.cache.MessageQueue;
@@ -23,12 +23,12 @@
import com.zy.core.model.command.StationCommand;
import com.zy.core.model.protocol.StationProtocol;
import com.zy.core.thread.StationThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@Component
public class StationOperateProcessUtils {
@@ -43,6 +43,12 @@
    private BasCrnpService basCrnpService;
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private ConfigService configService;
    @Autowired
    private HttpRequestLogService httpRequestLogService;
    @Autowired
    private LocMastService locMastService;
    //执行输送站点入库任务
    public synchronized void stationInExecute() {
@@ -212,5 +218,170 @@
        }
    }
    //检测输送站点是否运行堵塞
    public synchronized void checkStationRunBlock() {
        String wmsUrl = null;
        Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri"));
        if (wmsSystemUriConfig != null) {
            wmsUrl = wmsSystemUriConfig.getValue();
        }
        if(wmsUrl == null){
            News.error("未配置WMS系统URI,配置文件Code编码:wmsSystemUri");
            return;
        }
        String wmsSystemReassignInTaskUrl = null;
        Config wmsSystemReassignInTaskUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl"));
        if (wmsSystemReassignInTaskUrlConfig != null) {
            wmsSystemReassignInTaskUrl = wmsSystemReassignInTaskUrlConfig.getValue();
        }
        if(wmsSystemReassignInTaskUrl == null){
            News.error("未配置WMS任务重新分配入库库位接口地址,配置文件Code编码:wmsSystemReassignInTaskUrl");
            return;
        }
        List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>());
        for (BasDevp basDevp : basDevps) {
            StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
            if(stationThread == null){
                continue;
            }
            List<Integer> runBlockReassignLocStationList = new ArrayList<>();
            for (StationObjModel stationObjModel : basDevp.getRunBlockReassignLocStationList$()) {
                runBlockReassignLocStationList.add(stationObjModel.getStationId());
            }
            List<StationProtocol> list = stationThread.getStatus();
            for (StationProtocol stationProtocol : list) {
                if(stationProtocol.isAutoing()
                    && stationProtocol.isLoading()
                    && stationProtocol.getTaskNo() > 0
                    && stationProtocol.isRunBlock()
                ) {
                    WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo());
                    if (wrkMast == null) {
                        News.info("输送站点号={} è¿è¡Œé˜»å¡žï¼Œä½†æ— æ³•找到对应任务,工作号={}", stationProtocol.getStationId(), stationProtocol.getTaskNo());
                        continue;
                    }
                    Object lock = redisUtil.get(RedisKeyType.CHECK_STATION_RUN_BLOCK_LIMIT_.key + stationProtocol.getTaskNo());
                    if (lock != null) {
                        continue;
                    }
                    redisUtil.set(RedisKeyType.CHECK_STATION_RUN_BLOCK_LIMIT_.key + stationProtocol.getTaskNo(), "lock", 15);
                    if (runBlockReassignLocStationList.contains(stationProtocol.getStationId())) {
                        //站点处于重新分配库位区域
                        //运行堵塞,重新申请任务
                        HashMap<String, Object> requestParam = new HashMap<>();
                        String response = null;
                        try {
                            requestParam.put("taskNo", wrkMast.getWmsWrkNo());
                            requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(basDevp.getDevpNo())));
                            response = new HttpHandler.Builder()
                                    .setUri(wmsUrl)
                                    .setPath(wmsSystemReassignInTaskUrl)
                                    .setJson(JSON.toJSONString(requestParam))
                                    .build()
                                    .doPost();
                            JSONObject jsonObject = JSON.parseObject(response);
                            if (jsonObject.getInteger("code").equals(200)) {
                                StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                                String sourceLocNo = wrkMast.getLocNo();
                                String locNo = dto.getLocNo();
                                LocMast sourceLocMast = locMastService.queryByLoc(sourceLocNo);
                                if (sourceLocMast == null) {
                                    News.taskInfo(wrkMast.getWrkNo(), "库位号:{} æºåº“位信息不存在", sourceLocNo);
                                    continue;
                                }
                                if (!sourceLocMast.getLocSts().equals("S")) {
                                    News.taskInfo(wrkMast.getWrkNo(), "库位号:{} æºåº“位状态不处于入库预约", sourceLocNo);
                                    continue;
                                }
                                LocMast locMast = locMastService.queryByLoc(locNo);
                                if (locMast == null) {
                                    News.taskInfo(wrkMast.getWrkNo(), "库位号:{} ç›®æ ‡åº“位信息不存在", locNo);
                                    continue;
                                }
                                if (!locMast.getLocSts().equals("O")) {
                                    News.taskInfo(wrkMast.getWrkNo(), "库位号:{} ç›®æ ‡åº“位状态不处于空库位", locNo);
                                    continue;
                                }
                                Integer crnNo = commonService.findCrnNoByLocNo(locNo);
                                if (crnNo == null) {
                                    News.taskInfo(wrkMast.getWrkNo(), "未匹配到堆垛机");
                                    continue;
                                }
                                Integer targetStationId = commonService.findInStationId(crnNo, stationProtocol.getStationId());
                                if (targetStationId == null) {
                                    News.taskInfo(wrkMast.getWrkNo(), "搜索入库站点失败");
                                    continue;
                                }
                                StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), targetStationId, 0);
                                if(command == null){
                                    News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败");
                                    continue;
                                }
                                //更新源库位
                                sourceLocMast.setLocSts("O");
                                sourceLocMast.setModiTime(new Date());
                                locMastService.updateById(sourceLocMast);
                                //更新目标库位
                                locMast.setLocSts("S");
                                locMast.setModiTime(new Date());
                                locMastService.updateById(locMast);
                                //更新工作档数据
                                wrkMast.setLocNo(locNo);
                                wrkMast.setCrnNo(crnNo);
                                wrkMast.setStaNo(targetStationId);
                                if (wrkMastService.updateById(wrkMast)) {
                                    MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
                                }
                                News.info("请求WMS接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
                            } else {
                                News.error("请求WMS接口失败!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
                            }
                        } catch (Exception e) {
                            News.error("请求WMS接口异常!!!url:{};request:{}; response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response, e);
                        } finally {
                            HttpRequestLog httpRequestLog = new HttpRequestLog();
                            httpRequestLog.setName(wmsUrl + wmsSystemReassignInTaskUrl);
                            httpRequestLog.setRequest(JSON.toJSONString(requestParam));
                            httpRequestLog.setResponse(response);
                            httpRequestLog.setCreateTime(new Date());
                            httpRequestLogService.insert(httpRequestLog);
                        }
                    }else {
                        //运行堵塞,重新计算路线
                        StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), wrkMast.getStaNo(), 0);
                        if(command == null){
                            News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败");
                            continue;
                        }
                        MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
                        News.info("输送站点堵塞后重新计算路径命令下发成功,站点号={},工作号={},命令数据={}", stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command));
                    }
                }
            }
        }
    }
}
src/main/resources/application.yml
@@ -46,7 +46,7 @@
logging:
  file:
    path: ./stock/out/@pom.build.finalName@/logs
    path: /stock/out/@pom.build.finalName@/logs
super:
  pwd: xltys1995
@@ -73,7 +73,7 @@
  # è®¾å¤‡æ—¥å¿—存储方式 mysql file
  type: file
  # file类型存储地址
  loggingPath: ./stock/out/@pom.build.finalName@/deviceLogs
  loggingPath: /stock/out/@pom.build.finalName@/deviceLogs
  # æ—¥å¿—过期时间 å•位天
  expireDays: 7
src/main/resources/map/ÉϺ£ÁÙ¸Û¸ç˹À­ÏîÄ¿.xlsx
Binary files differ
src/main/resources/mapper/BasDevpMapper.xml
@@ -16,6 +16,8 @@
        <result column="barcode_station_list" property="barcodeStationList" />
        <result column="in_station_list" property="inStationList" />
        <result column="out_station_list" property="outStationList" />
        <result column="run_block_reassign_loc_station_list" property="runBlockReassignLocStationList" />
        <result column="lift_transfer_station_list" property="liftTransferStationList" />
    </resultMap>
src/main/resources/mapper/LocMastMapper.xml
@@ -30,32 +30,8 @@
        select * from asr_loc_mast where loc_no = #{locNo} limit 0,1
    </select>
    <select id="queryByQrCode" resultMap="BaseResultMap">
        select * from asr_loc_mast where qr_code_value = #{qrCodeValue} limit 0,1
    </select>
    <select id="selectLocByLev" resultMap="BaseResultMap">
        SELECT * FROM asr_loc_mast WHERE lev1 = #{lev}
    </select>
    <select id="selectEmptyLocNos" resultMap="BaseResultMap">
        select * from asr_loc_mast
        where loc_no in
        <foreach item="loc" collection="locNos" index="index"  separator="," open="(" close=")">
            #{loc}
        </foreach>
        and loc_sts = 'O'
        order by row1
    </select>
    <select id="selectNotEmptyLocNos" resultMap="BaseResultMap">
        select * from asr_loc_mast
        where loc_no in
        <foreach item="loc" collection="locNos" index="index"  separator="," open="(" close=")">
            #{loc}
        </foreach>
        and loc_sts not in ('O')
        order by row1
    </select>
    <select id="getLevList" resultType="java.lang.Integer">
src/main/webapp/components/DevpCard.js
@@ -39,6 +39,7 @@
                <el-descriptions-item label="可出">{{ item.outEnable ? 'Y' : 'N' }}</el-descriptions-item>
                <el-descriptions-item label="空板信号">{{ item.emptyMk ? 'Y' : 'N' }}</el-descriptions-item>
                <el-descriptions-item label="满板信号">{{ item.fullPlt ? 'Y' : 'N' }}</el-descriptions-item>
                <el-descriptions-item label="运行阻塞">{{ item.runBlock ? 'Y' : 'N' }}</el-descriptions-item>
                <el-descriptions-item label="托盘高度">{{ item.palletHeight }}</el-descriptions-item>
                <el-descriptions-item label="条码">{{ item.barcode }}</el-descriptions-item>
                <el-descriptions-item label="故障代码">{{ item.error }}</el-descriptions-item>
src/main/webapp/components/MapCanvas.js
@@ -479,6 +479,8 @@
          this.updateColor(sta, 0x30bffc);
        } else if (status === "machine-pakout") {
          this.updateColor(sta, 0x97b400);
        } else if (status === "site-run-block") {
          this.updateColor(sta, 0xe69138);
        } else {
          this.updateColor(sta, 0xb8b8b8);
        }
src/main/webapp/static/js/basDevp/basDevp.js
@@ -28,15 +28,17 @@
          { field: "id", align: "center", title: "编号" },
          { field: "devpNo", align: "center", title: "设备编号" },
          { field: "status$", align: "center", title: "状态" },
          { field: "createBy", align: "center", title: "创建人员" },
          { field: "createTime$", align: "center", title: "创建时间" },
          { field: "updateBy", align: "center", title: "修改人员" },
          { field: "updateTime$", align: "center", title: "修改时间" },
          // { field: "createBy", align: "center", title: "创建人员" },
          // { field: "createTime$", align: "center", title: "创建时间" },
          // { field: "updateBy", align: "center", title: "修改人员" },
          // { field: "updateTime$", align: "center", title: "修改时间" },
          { field: "memo", align: "center", title: "备注" },
          { field: "stationList", align: "center", title: "站点数据" },
          { field: "barcodeStationList", align: "center", title: "条码站点数据" },
          { field: "inStationList", align: "center", title: "入库站点数据" },
          { field: "outStationList", align: "center", title: "出库站点数据" },
          { field: "runBlockReassignLocStationList", align: "center", title: "运行堵塞重新分配库位站点数据" },
          { field: "liftTransferStationList", align: "center", title: "顶升移栽站点数据" },
          {
            fixed: "right",
src/main/webapp/views/basDevp/basDevp.html
@@ -143,6 +143,18 @@
                        <input class="layui-input" name="outStationList" placeholder="请输入出库站点数据">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">运行堵塞重新分配库位站点数据: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="runBlockReassignLocStationList" placeholder="请输入运行堵塞重新分配库位站点数据">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">顶升移栽站点数据: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="liftTransferStationList" placeholder="请输入顶升移栽站点数据">
                    </div>
                </div>
             </div>
        </div>