| | |
| | | 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.mapper.ConfigMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | |
| | | @Resource |
| | | private ConfigMapper configMapper; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | // 可用堆垛机列表 |
| | | List<Integer> crnNoList = basCrnps.stream().map(BasCrnp::getCrnNo).collect(Collectors.toList()); |
| | | |
| | | // 获取备货区配置 |
| | | Config config = configMapper.selectConfigByCode("auto_stock_up"); |
| | | if (config == null) { |
| | | throw new CoolException("理货获取备货区配置错误!!!"); |
| | | } |
| | | |
| | | // 前几列是备货区 |
| | | int columnNum = Integer.parseInt(config.getValue()); |
| | | |
| | | // 搜索深库位 |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","O").in("crn_no",crnNoList).in("row1","1,4,5,8,9,12,13,16,17,20,21,24").orderBy("lev1,bay1,row1")); |
| | | .eq("loc_sts","O").in("crn_no",crnNoList).in("row1","1,4,5,8,9,12,13,16,17,20,21,24").orderBy("lev1,bay1,row1") |
| | | .gt("bay1",columnNum)); |
| | | |
| | | // 深库位没有则搜索浅库位 |
| | | if (locMasts.isEmpty()) { |
| | | locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","O").in("crn_no",crnNoList).in("row1","2,3,6,7,10,11,14,15,18,19,22,23").orderBy("lev1,bay1,row1")); |
| | | .eq("loc_sts","O").in("crn_no",crnNoList).in("row1","2,3,6,7,10,11,14,15,18,19,22,23").orderBy("lev1,bay1,row1") |
| | | .gt("bay1",columnNum)); |
| | | } |
| | | if (locMasts.isEmpty()) { |
| | | throw new CoolException("没有可用库位"); |