#
Junjie
13 小时以前 bf4e43c1fd1a361029e7cb51daac378fa5ee3617
#
5个文件已修改
53 ■■■■ 已修改文件
src/main/java/com/zy/asrs/domain/path/StationPathProfileConfig.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/20260313_create_station_path_policy_tables.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/stationPathPolicy/stationPathPolicy.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/path/StationPathProfileConfig.java
@@ -26,6 +26,7 @@
    private Double s2DeadlockWeight = 8.0d;
    private Double s2RunBlockWeight = 10.0d;
    private Double s2LoopLoadWeight = 12.0d;
    private Double circleMaxLoadLimit = 80.0d;
    private Double stationPathLenWeightPercent = 50.0d;
    private Double stationPathCongWeightPercent = 50.0d;
@@ -56,6 +57,7 @@
        if (source.s2DeadlockWeight != null) this.s2DeadlockWeight = source.s2DeadlockWeight;
        if (source.s2RunBlockWeight != null) this.s2RunBlockWeight = source.s2RunBlockWeight;
        if (source.s2LoopLoadWeight != null) this.s2LoopLoadWeight = source.s2LoopLoadWeight;
        if (source.circleMaxLoadLimit != null) this.circleMaxLoadLimit = source.circleMaxLoadLimit;
        if (source.stationPathLenWeightPercent != null) this.stationPathLenWeightPercent = source.stationPathLenWeightPercent;
        if (source.stationPathCongWeightPercent != null) this.stationPathCongWeightPercent = source.stationPathCongWeightPercent;
        if (source.stationPathPassOtherOutStationWeightPercent != null) this.stationPathPassOtherOutStationWeightPercent = source.stationPathPassOtherOutStationWeightPercent;
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -7,6 +7,7 @@
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.domain.enums.NotifyMsgType;
import com.zy.asrs.domain.path.StationPathResolvedPolicy;
import com.zy.asrs.domain.vo.StationCycleCapacityVo;
import com.zy.asrs.domain.vo.StationCycleLoopVo;
import com.zy.asrs.entity.*;
@@ -57,13 +58,15 @@
    private BasStationService basStationService;
    @Autowired
    private StationCycleCapacityService stationCycleCapacityService;
    @Autowired
    private StationPathPolicyService stationPathPolicyService;
    //执行输送站点入库任务
    public synchronized void stationInExecute() {
        try {
            DispatchLimitConfig limitConfig = getDispatchLimitConfig();
            DispatchLimitConfig baseLimitConfig = getDispatchLimitConfig(null, null);
            int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()};
            LoadGuardState loadGuardState = buildLoadGuardState(limitConfig);
            LoadGuardState loadGuardState = buildLoadGuardState(baseLimitConfig);
            List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>());
            for (BasDevp basDevp : basDevps) {
@@ -119,6 +122,7 @@
                            continue;
                        }
                        DispatchLimitConfig limitConfig = getDispatchLimitConfig(stationProtocol.getStationId(), targetStationId);
                        LoopHitResult loopHitResult = findPathLoopHit(limitConfig, stationProtocol.getStationId(), targetStationId, loadGuardState);
                        if (isDispatchBlocked(limitConfig, currentStationTaskCountRef[0], loadGuardState, loopHitResult.isThroughLoop())) {
@@ -154,9 +158,9 @@
    //执行堆垛机输送站点出库任务
    public synchronized void crnStationOutExecute() {
        try {
            DispatchLimitConfig limitConfig = getDispatchLimitConfig();
            DispatchLimitConfig baseLimitConfig = getDispatchLimitConfig(null, null);
            int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()};
            LoadGuardState loadGuardState = buildLoadGuardState(limitConfig);
            LoadGuardState loadGuardState = buildLoadGuardState(baseLimitConfig);
            List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>()
                    .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts)
@@ -200,6 +204,7 @@
                            true
                    );
                    DispatchLimitConfig limitConfig = getDispatchLimitConfig(stationProtocol.getStationId(), moveStaNo);
                    LoopHitResult loopHitResult = findPathLoopHit(limitConfig, stationProtocol.getStationId(), moveStaNo, loadGuardState);
                    if (isDispatchBlocked(limitConfig, currentStationTaskCountRef[0], loadGuardState, loopHitResult.isThroughLoop())) {
@@ -1000,14 +1005,11 @@
        redisUtil.expire(RedisKeyType.STATION_CYCLE_LOAD_RESERVE.key, LOOP_LOAD_RESERVE_EXPIRE_SECONDS);
    }
    private DispatchLimitConfig getDispatchLimitConfig() {
    private DispatchLimitConfig getDispatchLimitConfig(Integer startStationId, Integer endStationId) {
        DispatchLimitConfig config = new DispatchLimitConfig();
        Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
        if (!(systemConfigMapObj instanceof Map)) {
            return config;
        }
        if (systemConfigMapObj instanceof Map) {
        Map<?, ?> systemConfigMap = (Map<?, ?>) systemConfigMapObj;
        config.circleMaxLoadLimit = parseLoadLimit(getConfigValue(systemConfigMap, "circleMaxLoadLimit"), config.circleMaxLoadLimit);
        String loopModeValue = getConfigValue(systemConfigMap, "circleLoopModeEnable");
        if (isBlank(loopModeValue)) {
@@ -1017,6 +1019,17 @@
            loopModeValue = getConfigValue(systemConfigMap, "isCircleMode");
        }
        config.loopModeEnable = parseBoolean(loopModeValue, config.loopModeEnable);
        }
        if (stationPathPolicyService != null && startStationId != null && endStationId != null) {
            try {
                StationPathResolvedPolicy resolvedPolicy = stationPathPolicyService.resolvePolicy(startStationId, endStationId);
                if (resolvedPolicy != null && resolvedPolicy.getProfileConfig() != null) {
                    config.circleMaxLoadLimit = parseLoadLimit(String.valueOf(resolvedPolicy.getProfileConfig().getCircleMaxLoadLimit()), config.circleMaxLoadLimit);
                }
            } catch (Exception ignore) {
            }
        }
        return config;
    }
src/main/resources/sql/20260313_create_station_path_policy_tables.sql
@@ -45,7 +45,7 @@
  100,
  1,
  1,
  '{"calcMaxDepth":120,"calcMaxPaths":500,"calcMaxCost":300,"s1TopK":5,"s1LenWeight":1.0,"s1TurnWeight":3.0,"s1LiftWeight":8.0,"s1SoftDeviationWeight":4.0,"s1MaxLenRatio":1.15,"s1MaxTurnDiff":1,"s2BusyWeight":2.0,"s2QueueWeight":2.5,"s2WaitWeight":1.5,"s2DeadlockWeight":8.0,"s2RunBlockWeight":10.0,"s2LoopLoadWeight":12.0,"stationPathLenWeightPercent":50.0,"stationPathCongWeightPercent":50.0,"stationPathPassOtherOutStationWeightPercent":100.0,"stationPathPassOtherOutStationForceSkip":false}',
  '{"calcMaxDepth":120,"calcMaxPaths":500,"calcMaxCost":300,"s1TopK":5,"s1LenWeight":1.0,"s1TurnWeight":3.0,"s1LiftWeight":8.0,"s1SoftDeviationWeight":4.0,"s1MaxLenRatio":1.15,"s1MaxTurnDiff":1,"s2BusyWeight":2.0,"s2QueueWeight":2.5,"s2WaitWeight":1.5,"s2DeadlockWeight":8.0,"s2RunBlockWeight":10.0,"s2LoopLoadWeight":12.0,"circleMaxLoadLimit":80.0,"stationPathLenWeightPercent":50.0,"stationPathCongWeightPercent":50.0,"stationPathPassOtherOutStationWeightPercent":100.0,"stationPathPassOtherOutStationForceSkip":false}',
  '默认模板'
FROM dual
WHERE NOT EXISTS (
src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js
@@ -16,6 +16,7 @@
        s2DeadlockWeight: 8.0,
        s2RunBlockWeight: 10.0,
        s2LoopLoadWeight: 12.0,
        circleMaxLoadLimit: 80.0,
        stationPathLenWeightPercent: 50,
        stationPathCongWeightPercent: 50,
        stationPathPassOtherOutStationWeightPercent: 100,
@@ -1156,9 +1157,11 @@
        },
        normalizeProfile: function (raw) {
            var config = Object.assign({}, this.defaultProfileConfig(), this.parseJson(raw.configJson) || raw.config || {})
            config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit)
            config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent)
            config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent)
            config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent)
            config.circleMaxLoadLimit = config.circleMaxLoadLimit == null ? 80 : config.circleMaxLoadLimit
            config.stationPathLenWeightPercent = config.stationPathLenWeightPercent == null ? 50 : config.stationPathLenWeightPercent
            config.stationPathCongWeightPercent = config.stationPathCongWeightPercent == null ? 50 : config.stationPathCongWeightPercent
            config.stationPathPassOtherOutStationWeightPercent = config.stationPathPassOtherOutStationWeightPercent == null ? 100 : config.stationPathPassOtherOutStationWeightPercent
@@ -1209,6 +1212,7 @@
        },
        sanitizeProfileForSave: function (item) {
            var config = Object.assign({}, item.config || {})
            config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit) == null ? 80 : this.toNumberSafe(config.circleMaxLoadLimit)
            config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathLenWeightPercent)
            config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathCongWeightPercent)
            config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent) == null ? 100 : this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent)
@@ -1306,6 +1310,16 @@
            var num = Number(value)
            return isNaN(num) ? null : num
        },
        displayLoadLimitPercent: function (value) {
            var num = this.toNumberSafe(value)
            if (num == null) {
                num = 80
            }
            if (num <= 1) {
                num = num * 100
            }
            return num.toFixed(1) + '%'
        },
        notNull: function (value) {
            return value != null
        },
src/main/webapp/views/stationPathPolicy/stationPathPolicy.html
@@ -846,7 +846,8 @@
                            <div class="entity-desc">
                                S1: 长度(s1LenWeight) {{ item.config.s1LenWeight }} / 拐点(s1TurnWeight) {{ item.config.s1TurnWeight }} / 顶升(s1LiftWeight) {{ item.config.s1LiftWeight }}<br>
                                S2: 拥堵(s2BusyWeight) {{ item.config.s2BusyWeight }} / 排队(s2QueueWeight) {{ item.config.s2QueueWeight }} / 等待(s2WaitWeight) {{ item.config.s2WaitWeight }} / 死锁(s2DeadlockWeight) {{ item.config.s2DeadlockWeight }} / 堵塞(s2RunBlockWeight) {{ item.config.s2RunBlockWeight }} / 环线(s2LoopLoadWeight) {{ item.config.s2LoopLoadWeight }}<br>
                                平衡: 长度(stationPathLenWeightPercent) {{ item.config.stationPathLenWeightPercent }}% / 承载(stationPathCongWeightPercent) {{ item.config.stationPathCongWeightPercent }}% / 他出惩罚(stationPathPassOtherOutStationWeightPercent) {{ item.config.stationPathPassOtherOutStationWeightPercent }} / 强跳(stationPathPassOtherOutStationForceSkip) {{ item.config.stationPathPassOtherOutStationForceSkip ? '是' : '否' }}
                                平衡: 长度(stationPathLenWeightPercent) {{ item.config.stationPathLenWeightPercent }}% / 承载(stationPathCongWeightPercent) {{ item.config.stationPathCongWeightPercent }}% / 他出惩罚(stationPathPassOtherOutStationWeightPercent) {{ item.config.stationPathPassOtherOutStationWeightPercent }} / 强跳(stationPathPassOtherOutStationForceSkip) {{ item.config.stationPathPassOtherOutStationForceSkip ? '是' : '否' }}<br>
                                执行: 环线禁发阈值(circleMaxLoadLimit) {{ displayLoadLimitPercent(item.config.circleMaxLoadLimit) }}
                            </div>
                            <div class="entity-actions">
                                <el-button size="mini" @click.stop="openProfileDialog(item)">编辑</el-button>
@@ -1084,6 +1085,7 @@
                        <el-form-item label="死锁风险权重(s2DeadlockWeight)"><el-input-number v-model="profileForm.config.s2DeadlockWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item>
                        <el-form-item label="堵塞权重(s2RunBlockWeight)"><el-input-number v-model="profileForm.config.s2RunBlockWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item>
                        <el-form-item label="环线负载权重(s2LoopLoadWeight)"><el-input-number v-model="profileForm.config.s2LoopLoadWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item>
                        <el-form-item label="环线禁发阈值(circleMaxLoadLimit, %)"><el-input-number v-model="profileForm.config.circleMaxLoadLimit" :min="0" :max="100" :step="5" style="width: 100%;"></el-input-number></el-form-item>
                    </div>
                </div>
            </el-form>