| | |
| | | @RequestMapping("/full/store/put/start") |
| | | @ManagerAuth(memo = "全板入库") |
| | | public R fullStorePutStart(@RequestBody FullStoreParam fullStoreParam) { |
| | | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | try { |
| | | String locNo = workService.startupFullPutStore(fullStoreParam, getUserId()); |
| | | return R.ok("入库启动成功").add(locNo); |
| | | } catch (Exception e){ |
| | | return R.error("入库启动失败==>"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/plate/out/start") |
| | |
| | | |
| | | @Override |
| | | public LocMast selectLocByLocStsPakInF(Integer curRow,Integer nearRow,LocMast locMast,Long type) { |
| | | if (curRow<nearRow){ |
| | | if (curRow>nearRow){ |
| | | return this.baseMapper.selectLocByLocStsPakInF1(locMast.getCrnNo(),locMast.getBay1(),locMast.getLev1(),locMast.getGro1(),type); |
| | | } |
| | | return this.baseMapper.selectLocByLocStsPakInF2(locMast.getCrnNo(),locMast.getBay1(),locMast.getLev1(),locMast.getGro1(),type); |
| | |
| | | // } |
| | | @Override |
| | | public LocMast selectLocByLocStsPakInO(Integer curRow,Integer nearRow,LocMast locMast,Long type) { |
| | | if (curRow<nearRow){ |
| | | if (curRow>nearRow){ |
| | | return this.baseMapper.selectLocByLocStsPakInO1(locMast.getCrnNo(),locMast.getBay1(),locMast.getLev1(),locMast.getGro1(),type); |
| | | } |
| | | return this.baseMapper.selectLocByLocStsPakInO2(locMast.getCrnNo(),locMast.getBay1(),locMast.getLev1(),locMast.getGro1(),type); |
| | |
| | | List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | // List<String> batchs = param.getList().stream().map(FullStoreParam.MatCodeStore::getBatch).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(1, param.getDevpNo(), matnrs.get(0), null, null,locTypeDto); |
| | | if (Cools.isEmpty(dto)){ |
| | | throw new CoolException("查询库位失败!!==》startupFullPutStore ==》 commonService.getLocNo"); |
| | | } |
| | | // 生成工作号 |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | |
| | | public static int[] LocNecessaryParametersDoubleExtension6(RowLastno rowLastno, Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | | Integer sRow = rowLastno.getsRow();//起始排号 |
| | | Integer offset = 0;//起始排号 |
| | | Integer offset = 4;//起始排号 |
| | | Integer sCrnNo = rowLastno.getsCrnNo();//起始堆垛机号 |
| | | necessaryParameters[0] = crnNumber; // 轮询次数 |
| | | curRow = curRow - offset; |
| | | //满板正常入库 |
| | | switch (curRow){ |
| | | case 2: |
| | | case 1: |
| | | necessaryParameters[1] = 4; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 7; //nearRow 最浅库位排 |
| | | break; |
| | | case 7: |
| | | case 4: |
| | | necessaryParameters[1] = 9; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 12; //nearRow 最浅库位排 |
| | | break; |
| | | case 12: |
| | | necessaryParameters[1] = 7; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 4; //nearRow 最浅库位排 |
| | | break; |
| | | case 4: |
| | | necessaryParameters[1] = 12; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 9; //nearRow 最浅库位排 |
| | | break; |
| | | case 9: |
| | | necessaryParameters[1] = 14; //curRow 最深库位排 |
| | |
| | | necessaryParameters[3] = 14; //nearRow 最浅库位排 |
| | | break; |
| | | case 14: |
| | | necessaryParameters[1] = 7; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 4; //nearRow 最浅库位排 |
| | | break; |
| | | case 7: |
| | | necessaryParameters[1] = 12; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 9; //nearRow 最浅库位排 |
| | | break; |
| | | case 12: |
| | | necessaryParameters[1] = 1; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = 2; //nearRow 最浅库位排 |
| | |
| | | log.error("站点={} 未查询到对应的规则",sourceStaNo); |
| | | break; |
| | | case 4: |
| | | return getLocNoRun2(whsType,staDescId,sourceStaNo,matnr,batch,grade,3,locTypeDto,0); |
| | | return getLocNoRun2(whsType,staDescId,sourceStaNo,matnr,batch,grade,4,locTypeDto,0); |
| | | case 5: |
| | | return getLocNoRun2(whsType,staDescId,sourceStaNo,matnr,batch,grade,3,locTypeDto,0); |
| | | default: |
| | |
| | | int nearbay = 0; //相似工作档案 目标库位列 |
| | | int nearlev = 0; //相似工作档案 目标库位层 |
| | | for (WrkMast wrkMast:wrkMasts){ |
| | | int curRowW = curRow; //相似工作档案 最深库位排 |
| | | int nearRowW = nearRow; //相似工作档案 最浅库位排 |
| | | if (Cools.isEmpty(wrkMast.getLocNo())){ |
| | | continue; |
| | | } |
| | |
| | | nearbay=Utils.getBay(wrkMast.getLocNo()); |
| | | nearlev=Utils.getLev(wrkMast.getLocNo()); |
| | | } |
| | | |
| | | //获取目标库位所在巷道并排序 |
| | | // List<String> groupOutsideLocCrn = Utils.getGroupOutLocCrn(curRow,nearRow,wrkMast.getLocNo(), curRow>nearRow); |
| | | LocMast locMastGro = locMastService.selectById(wrkMast.getLocNo()); |
| | | |
| | | for (int i = 0; i < crnNumber*2; i++) { |
| | | if (!(Utils.getRow(locMastGro.getLocNo())>nearRowW && Utils.getRow(locMastGro.getLocNo())<=curRowW) && !(Utils.getRow(locMastGro.getLocNo())<nearRowW && Utils.getRow(locMastGro.getLocNo())>=curRowW) ){ |
| | | int[] locNecessaryParameters = Utils.LocNecessaryParameters(rowLastno, curRowW, crnNumber); |
| | | curRowW = locNecessaryParameters[1]; |
| | | nearRowW = locNecessaryParameters[3]; |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //获取目标库位所在巷道最浅非空库位 |
| | | LocMast locMast2 = locMastService.selectLocByLocStsPakInF(curRow,nearRow,locMastGro,rowLastnoType.getType().longValue()); |
| | | LocMast locMast2 = locMastService.selectLocByLocStsPakInF(curRowW,nearRowW,locMastGro,rowLastnoType.getType().longValue()); |
| | | |
| | | //目标库位所在巷道最浅非空库位存在&&非最外侧库位&&入库状态 |
| | | if (!Cools.isEmpty(locMast2) && Utils.getRow(locMast2.getLocNo())!=nearRow && (locMast2.getLocSts().equals("S") || locMast2.getLocSts().equals("Q"))){ |
| | | if (!Cools.isEmpty(locMast2) && Utils.getRow(locMast2.getLocNo())!=nearRowW && (locMast2.getLocSts().equals("S") || locMast2.getLocSts().equals("Q"))){ |
| | | //获取库存明细 |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | //判断同规格物料 |
| | |
| | | && batch.equals(batch.isEmpty() ? "":wrkDetl.getBatch()) |
| | | && grade.equals(grade.isEmpty()? "":wrkDetl.getBrand())){ |
| | | int row2=0; |
| | | if (Utils.getRow(locMast2.getLocNo())>nearRow){ |
| | | if (Utils.getRow(locMast2.getLocNo())>nearRowW){ |
| | | row2=Utils.getRow(locMast2.getLocNo())-1; |
| | | } else { |
| | | row2=Utils.getRow(locMast2.getLocNo())+1; |
| | | } |
| | | String targetLocNo = zerofill(String.valueOf(row2), 2) + locMast2.getLocNo().substring(2); |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",targetLocNo)); |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",targetLocNo).eq("loc_sts","O")); |
| | | if (Cools.isEmpty(locMast)){ |
| | | continue; |
| | | } |
| | | break; |
| | | } |
| | | } |