自动化立体仓库 - WMS系统
#1
czkh
1 天以前 7883345f1eb514fcdd2dba26aa85741bbf2fb90b
src/main/java/com/zy/common/service/CommonService.java
@@ -13,6 +13,8 @@
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
import com.zy.common.properties.SlaveProperties;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -50,6 +52,8 @@
    private SlaveProperties slaveProperties;
    @Autowired
    private MatServiceImpl matService;
    @Autowired
    private ConfigService configService;
    /**
     * 生成工作号
@@ -332,6 +336,24 @@
                }
            }
            // 低库位向高库位兼容
            if (locMasts.size() < 5 && locTypeDto.getLocType1() == 1){
                Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "LowToHeigh"));
                if (config == null){
                    throw new CoolException("低库位兼容高库位配置参数异常--->不存在");
                }else if (config.getValue().equals("N")){
                    throw new CoolException("低库位兼容高库位配置参数异常--->参数值为N--->未打开");
                } else if (config.getValue().equals("Y")) {
                    locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O").eq("loc_type1", 5));
                    if (Cools.isEmpty(locMasts) || locMasts.size() <= 5){
                        if (nearRow == 2){
                            locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1",nearRow + 1).eq("loc_sts", "O").eq("loc_type1", 5));
                        } else if (nearRow == 3) {
                            locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1",nearRow - 1).eq("loc_sts", "O").eq("loc_type1", 5));
                        }
                    }
                }
            }
            if (locMasts.size() < 5){
                throw new CoolException("无空库位可用");
            }