pang.jiabao
2024-10-24 c7338c0fc1513507c05c1a7fd00bff8c11ad5d1e
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -38,6 +38,8 @@
import com.zy.core.thread.LedThread;
import com.zy.core.thread.RgvThread;
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
import com.zy.system.mapper.ConfigMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -45,6 +47,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -100,6 +103,9 @@
    private BasRgvMapMapper basRgvMapMapper;
    @Autowired
    private RgvOneSignMapper rgvOneSignMapper;
    @Resource
    private ConfigMapper configMapper;
    @Value("${wms.url}")
    private String wmsUrl;
@@ -2714,9 +2720,18 @@
        try {
            List<Integer> rows = locMastService.queryDistinctRow(crn.getId());
            LocMast loc = null;
            // 获取备货区配置
            Config config = configMapper.selectConfigByCode("auto_stock_up");
            if (config == null) {
                return;
            }
            // 备货取是前几列
            int bay1 = Integer.parseInt(config.getValue());
            for (Integer row : rows) {
                if (Utils.isDeepLoc(slaveProperties, row)) {
                    loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1());
                    loc = locMastService.queryFreeLocMastNotBay(row, shallowLoc.getLocType1(),bay1);
                    if (loc != null) {
                        if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
@@ -2735,7 +2750,7 @@
            if (null == loc) {
                for (Integer row : rows) {
                    if (Utils.isShallowLoc(slaveProperties, row)) {
                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1());
                        loc = locMastService.queryFreeLocMastNotBay(row, shallowLoc.getLocType1(),bay1);
                        if (null != loc) {//对应深库位非在库状态,不能移库
                            String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo());