|  |  |  | 
|---|
|  |  |  | * 自动生成库位明细 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @Scheduled(cron = "0/25 * * * * ?") | 
|---|
|  |  |  | //    @Scheduled(cron = "0/25 * * * * ?") | 
|---|
|  |  |  | public void insertRandomMats() { | 
|---|
|  |  |  | List<Loc> list = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type)); | 
|---|
|  |  |  | for (Loc loc : list) { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(autoRunArea)) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<Integer> array = new ArrayList<>(); | 
|---|
|  |  |  | List<String> list = new ArrayList<>(); | 
|---|
|  |  |  | for (char c : autoRunArea.toCharArray()) { | 
|---|
|  |  |  | switch (c) { | 
|---|
|  |  |  | case '1': | 
|---|
|  |  |  | this.autoRun(LocGroupConstant.FAR_RIGHT_LOC_ROW_LIST, StaGroupConstant.FAR_RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.FAR_RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.FAR_RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '2': | 
|---|
|  |  |  | this.autoRun(LocGroupConstant.RIGHT_LOC_ROW_LIST, StaGroupConstant.RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '3': | 
|---|
|  |  |  | this.autoRun(LocGroupConstant.MIDDLE_LOC_ROW_LIST, StaGroupConstant.MIDDLE_STA_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.MIDDLE_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.MIDDLE_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '4': | 
|---|
|  |  |  | this.autoRun(LocGroupConstant.LEFT_LOC_ROW_LIST, StaGroupConstant.LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '5': | 
|---|
|  |  |  | this.autoRun(LocGroupConstant.FAR_LEFT_LOC_ROW_LIST, StaGroupConstant.FAR_LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.FAR_LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.FAR_LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.autoRun(array, list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void autoRun(List<Integer> locGroupList, List<String> staGroupList) { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(autoRunArea)) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<Integer> array = new ArrayList<>(); | 
|---|
|  |  |  | List<String> list = new ArrayList<>(); | 
|---|
|  |  |  | for (char c : autoRunArea.toCharArray()) { | 
|---|
|  |  |  | switch (c) { | 
|---|
|  |  |  | case '1': | 
|---|
|  |  |  | xx(LocGroupConstant.FAR_RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.FAR_RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.FAR_RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '2': | 
|---|
|  |  |  | xx(LocGroupConstant.RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.RIGHT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.RIGHT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '3': | 
|---|
|  |  |  | xx(LocGroupConstant.MIDDLE_LOC_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.MIDDLE_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.MIDDLE_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '4': | 
|---|
|  |  |  | xx(LocGroupConstant.LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '5': | 
|---|
|  |  |  | xx(LocGroupConstant.FAR_LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | array.addAll(LocGroupConstant.FAR_LEFT_LOC_ROW_LIST); | 
|---|
|  |  |  | list.addAll(StaGroupConstant.FAR_LEFT_STA_ROW_LIST); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | xx(array); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void xx(List<Integer> locGroupList) { | 
|---|
|  |  |  | Integer startRow = Collections.min(locGroupList); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String memo = "DEMO_LOC_" + startRow + "-" + endRow; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer maxThread = 40; | 
|---|
|  |  |  | Integer maxThread = 30; | 
|---|
|  |  |  | Config confNum = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, GlobalConfigCode.AUTO_RUN_MOVE_THEAD_MAX)); | 
|---|
|  |  |  | if (!Objects.isNull(confNum)) { | 
|---|
|  |  |  | maxThread = Integer.valueOf(confNum.getVal()); | 
|---|