#
Junjie
2026-01-14 664d9030efca22edd8e43b4db4b2c0700fff44af
src/main/java/com/zy/core/utils/WmsOperateUtils.java
@@ -19,7 +19,9 @@
import com.zy.common.entity.FindCrnNoResult;
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.enums.RedisKeyType;
import com.zy.core.enums.SlaveType;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -49,28 +51,40 @@
    private BasDualCrnpService basDualCrnpService;
    @Autowired
    private BasStationService basStationService;
    @Autowired
    private StationOperateProcessUtils stationOperateProcessUtils;
    @Autowired
    private RedisUtil redisUtil;
    //申请入库任务
    public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1) {
        String wmsUrl = null;
        Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri"));
        if (wmsSystemUriConfig != null) {
            wmsUrl = wmsSystemUriConfig.getValue();
        Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
        if (systemConfigMapObj == null) {
            News.error("系统Config缓存失效");
            return null;
        }
        HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
        String wmsUrl = systemConfigMap.get("wmsSystemUri");
        if (wmsUrl == null) {
            News.error("未配置WMS系统URI,配置文件Code编码:wmsSystemUri");
            return null;
        }
        String wmsSystemInUrl = null;
        Config wmsSystemInUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemInUrl"));
        if (wmsSystemInUrlConfig != null) {
            wmsSystemInUrl = wmsSystemInUrlConfig.getValue();
        String wmsSystemInUrl = systemConfigMap.get("wmsSystemInUrl");
        if(wmsSystemInUrl == null){
            News.error("未配置WMS入库接口地址,配置文件Code编码:wmsSystemInUrl");
            return null;
        }
        if(wmsSystemInUrlConfig == null){
            News.error("未配置WMS入库接口地址,配置文件Code编码:wmsSystemInUrl");
        int conveyorStationTaskLimit = 30;
        String conveyorStationTaskLimitStr = systemConfigMap.get("conveyorStationTaskLimit");
        if(conveyorStationTaskLimitStr != null){
            conveyorStationTaskLimit = Integer.parseInt(conveyorStationTaskLimitStr);
        }
        int currentStationTaskCount = stationOperateProcessUtils.getCurrentStationTaskCount();
        if (currentStationTaskCount > conveyorStationTaskLimit) {
            News.error("输送站点任务已达到上限,上限值:{},站点任务数:{}", conveyorStationTaskLimit, currentStationTaskCount);
            return null;
        }