| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Value("${channel.channelMax}") |
| | | private Integer channelMax; |
| | | @Value("${channel.equipmentCount}") |
| | | private Integer equipmentCount; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | } else if (ruleId == 1){ //按测试设备排序,优先排满单台设备 |
| | | locMast = locMastService.queryFreeLocMast1(curRow, locTypeDto.getLocType1() ,channelMax+1); |
| | | } else if (ruleId == 2){ //按通道排序,均匀分配每台设备 |
| | | |
| | | locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1() ); |
| | | Short locType2 = getLocType2Small(curRow, locTypeDto.getLocType1()); |
| | | locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1() ,locType2); |
| | | } else { //默认规则 |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); |
| | | locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1(),(short)0); |
| | | } |
| | | } |
| | | |
| | |
| | | return startupDto; |
| | | } |
| | | |
| | | public Short getLocType2Small(Integer curRow,short locType1){ |
| | | Integer OCount = locMastService.queryFreeLocMastCount(curRow, locType1, (short)1); |
| | | Short locType2=1; |
| | | for (int i=2;i<equipmentCount+1;i++){ |
| | | Integer integer =locMastService.queryFreeLocMastCount(curRow, locType1, (short)i); |
| | | if (OCount<integer){ |
| | | OCount=integer; |
| | | locType2=(short)i; |
| | | } |
| | | } |
| | | |
| | | return locType2; |
| | | } |
| | | |
| | | } |