| | |
| | | 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; |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private MatServiceImpl matService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | // ===============>>>> 开始执行 |
| | | curRow = rowLastno.getCurrentRow(); |
| | | |
| | | if (!Cools.isEmpty(moveCrnNo) && moveCrnNo != 0) { |
| | | crnNumber = moveCrnNo; |
| | | if (times == 0) { |
| | | curRow = moveCrnNo * 4 - 1; |
| | | } else { |
| | | curRow = moveCrnNo * 4 - 2; |
| | | } |
| | | } |
| | | // if (!Cools.isEmpty(moveCrnNo) && moveCrnNo != 0) { |
| | | // crnNumber = moveCrnNo; |
| | | // if (times == 0) { |
| | | // curRow = moveCrnNo * 4 - 1; |
| | | // } else { |
| | | // curRow = moveCrnNo * 4 - 2; |
| | | // } |
| | | // } |
| | | |
| | | //此程序用于优化堆垛机异常时的运行时间 |
| | | for (int i = times; i < crnNumber; i++) { |
| | |
| | | |
| | | } |
| | | } |
| | | if (locMasts.size() < 2){ |
| | | // 低库位向高库位兼容 |
| | | if (locMasts.size() < 5 && locTypeDto.getLocType1() == 2){ |
| | | 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("无空库位可用"); |
| | | } |
| | | List<LocMast> locMastList = new ArrayList<>(); |
| | |
| | | }); |
| | | |
| | | for (LocMast locMast1 : locMasts) { |
| | | if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | continue; |
| | | } |
| | | // if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | // continue; |
| | | // } |
| | | String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo()); |
| | | LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc)); |
| | | if (Cools.isEmpty(locMast2)){ |