| New file | 
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.entity.result; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class FindLocNoAttributeVo { | 
|---|
|  |  |  | private String matnr = ""; | 
|---|
|  |  |  | private String specs = ""; | 
|---|
|  |  |  | private String batch = ""; | 
|---|
|  |  |  | private String grade = ""; | 
|---|
|  |  |  | private String brand = ""; | 
|---|
|  |  |  | private String standby1 = ""; | 
|---|
|  |  |  | private String standby2 = ""; | 
|---|
|  |  |  | private String standby3 = ""; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo() { | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo(String matnr) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo(String matnr, String batch) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | this.batch = batch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo(String matnr, String batch, String brand) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | this.batch = batch; | 
|---|
|  |  |  | this.brand = brand; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo(String matnr, String batch, String standby1, String standby2, String standby3) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | this.batch = batch; | 
|---|
|  |  |  | this.standby1 = standby1; | 
|---|
|  |  |  | this.standby2 = standby2; | 
|---|
|  |  |  | this.standby3 = standby3; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public FindLocNoAttributeVo(String matnr, String specs, String batch, String grade, String brand, String standby1, String standby2, String standby3) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | this.specs = specs; | 
|---|
|  |  |  | this.batch = batch; | 
|---|
|  |  |  | this.grade = grade; | 
|---|
|  |  |  | this.brand = brand; | 
|---|
|  |  |  | this.standby1 = standby1; | 
|---|
|  |  |  | this.standby2 = standby2; | 
|---|
|  |  |  | this.standby3 = standby3; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getMatnr() { | 
|---|
|  |  |  | return matnr; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setMatnr(String matnr) { | 
|---|
|  |  |  | this.matnr = matnr; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getSpecs() { | 
|---|
|  |  |  | return specs; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setSpecs(String specs) { | 
|---|
|  |  |  | this.specs = specs; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getBatch() { | 
|---|
|  |  |  | return batch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setBatch(String batch) { | 
|---|
|  |  |  | this.batch = batch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getGrade() { | 
|---|
|  |  |  | return grade; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setGrade(String grade) { | 
|---|
|  |  |  | this.grade = grade; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getBrand() { | 
|---|
|  |  |  | return brand; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setBrand(String brand) { | 
|---|
|  |  |  | this.brand = brand; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getStandby1() { | 
|---|
|  |  |  | return standby1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setStandby1(String standby1) { | 
|---|
|  |  |  | this.standby1 = standby1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getStandby2() { | 
|---|
|  |  |  | return standby2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setStandby2(String standby2) { | 
|---|
|  |  |  | this.standby2 = standby2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getStandby3() { | 
|---|
|  |  |  | return standby3; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setStandby3(String standby3) { | 
|---|
|  |  |  | this.standby3 = standby3; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.param.FullStoreParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.LocDetlAdjustParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.StockOutParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.FindLocNoAttributeVo; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.asrs.utils.OrderInAndOutUtil; | 
|---|
|  |  |  | import com.zy.asrs.utils.Utils; | 
|---|
|  |  |  | 
|---|
|  |  |  | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(matnrs.get(0)); | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo(1, param.getDevpNo(), findLocNoAttributeVo,locTypeDto); | 
|---|
|  |  |  | if (Cools.isEmpty(dto)){ | 
|---|
|  |  |  | throw new CoolException("查询库位失败!!==》startupFullPutStore ==》 commonService.getLocNo"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); | 
|---|
|  |  |  | // 检索库位 | 
|---|
|  |  |  | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, devpNo, null,null,null, locTypeDto); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, devpNo, findLocNoAttributeVo, locTypeDto); | 
|---|
|  |  |  | int workNo = dto.getWorkNo(); | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 生成工作档 | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocMast; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.FindLocNoAttributeVo; | 
|---|
|  |  |  | import com.zy.asrs.service.LocDetlService; | 
|---|
|  |  |  | import com.zy.asrs.service.LocMastService; | 
|---|
|  |  |  | import com.zy.asrs.service.WorkService; | 
|---|
|  |  |  | 
|---|
|  |  |  | for (LocMast locMast:locMasts){ | 
|---|
|  |  |  | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); | 
|---|
|  |  |  | //                                StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 6 : 5, ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null); | 
|---|
|  |  |  | StartupDto startupDto = commonService.getLocNo( ioType, crnNo == 1 ? 917 : 918, locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBrand(), null); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl.getMatnr(),locDetl.getBatch(),locDetl.getBrand()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto startupDto = commonService.getLocNo( ioType, crnNo == 1 ? 917 : 918, findLocNoAttributeVo, null); | 
|---|
|  |  |  | workService.locMove(locMast.getLocNo(), startupDto.getLocNo(),9527L); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return SUCCESS; | 
|---|
|  |  |  | 
|---|
|  |  |  | List<LocDetl> locDetlList = locDetlService.selectLocDetlUnilateralMoveShuttle(matnr, batch, grade, crnNo); | 
|---|
|  |  |  | for (LocDetl locDetl : locDetlList) { | 
|---|
|  |  |  | //                        StartupDto startupDto = commonService.getLocNo(crnNo == 1 ? 4 : 3, ioType, crnNo == 1 ? 901 : 932, locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(), null); | 
|---|
|  |  |  | StartupDto startupDto = commonService.getLocNo( ioType, crnNo == 1 ? 901 : 932, locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(), null); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(locDetl.getMatnr(),locDetl.getBatch(),locDetl.getBrand()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto startupDto = commonService.getLocNo( ioType, crnNo == 1 ? 901 : 932, findLocNoAttributeVo, null); | 
|---|
|  |  |  | workService.locMove(locDetl.getLocNo(), startupDto.getLocNo(), 9527L); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.FindLocNoAttributeVo; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.KeyValueVo; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.asrs.utils.Utils; | 
|---|
|  |  |  | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param staDescId   路径ID | 
|---|
|  |  |  | * @param sourceStaNo 源站 | 
|---|
|  |  |  | * @param matnr       物料号集合 | 
|---|
|  |  |  | * @param findLocNoAttributeVo 属性 | 
|---|
|  |  |  | * @param locTypeDto 类型 | 
|---|
|  |  |  | * @return locNo 检索到的库位号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public StartupDto getLocNo( Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) { | 
|---|
|  |  |  | public StartupDto getLocNo(Integer staDescId, Integer sourceStaNo, FindLocNoAttributeVo findLocNoAttributeVo, LocTypeDto locTypeDto) { | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | Integer whsType = Utils.GetWhsType(sourceStaNo); | 
|---|
|  |  |  | RowLastno rowLastno = rowLastnoService.selectById(whsType); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | switch (rowLastnoType.getType()){ | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | return getLocNoRun(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0); | 
|---|
|  |  |  | return getLocNoRun(whsType,staDescId,sourceStaNo,findLocNoAttributeVo,0,locTypeDto,0); | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | log.error("站点={} 未查询到对应的规则",sourceStaNo); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("站点={} 未查询到对应的规则",sourceStaNo); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 4: | 
|---|
|  |  |  | return getLocNoRun4(whsType,staDescId,sourceStaNo,matnr,batch,grade,4,locTypeDto,0); | 
|---|
|  |  |  | return getLocNoRun4(whsType,staDescId,sourceStaNo,findLocNoAttributeVo,4,locTypeDto,0); | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | return getLocNoRun5(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0); | 
|---|
|  |  |  | return getLocNoRun5(whsType,staDescId,sourceStaNo,findLocNoAttributeVo,0,locTypeDto,0); | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | log.error("站点={} 未查询到对应的规则",sourceStaNo); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param whsType     类型 1:双深式货架 | 
|---|
|  |  |  | * @param staDescId   路径ID | 
|---|
|  |  |  | * @param sourceStaNo 源站 | 
|---|
|  |  |  | * @param matnr       物料号集合 | 
|---|
|  |  |  | * @param findLocNoAttributeVo 属性 | 
|---|
|  |  |  | * @param moveCrnNo 源 | 
|---|
|  |  |  | * @param locTypeDto 类型 | 
|---|
|  |  |  | * @param times 轮询次数 | 
|---|
|  |  |  | * @return locNo 检索到的库位号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  | if (Cools.isEmpty(matnr)) {  //物料号 | 
|---|
|  |  |  | matnr = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(batch)) {  //批次 | 
|---|
|  |  |  | batch = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(grade)) {  //备用 | 
|---|
|  |  |  | grade = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 初始化参数 | 
|---|
|  |  |  | int crnNo = 0;      //堆垛机号 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (Utils.BooleanWhsTypeStaIoType(rowLastno)){ | 
|---|
|  |  |  | // 靠近摆放规则 --- 同天同规格物料 //分离版 | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) &&  staDescId == 1){ | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) &&  staDescId == 1){ | 
|---|
|  |  |  | signRule1 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 靠近摆放规则 --- 同天同规格物料 //互通版 | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) && staDescId == 1) { | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) && staDescId == 1) { | 
|---|
|  |  |  | signRule2 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) &&  (staDescId == 11 || staDescId == 111)) { | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) &&  (staDescId == 11 || staDescId == 111)) { | 
|---|
|  |  |  | signRule1 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | LocMast locMastF = locMastService.selectLocByLocStsPakInF(curRow,nearRow,locMast1,rowLastnoType.getType().longValue()); | 
|---|
|  |  |  | if (!Cools.isEmpty(locMastF) && locMastF.getLocSts().equals("F")){ | 
|---|
|  |  |  | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMastF.getLocNo())); | 
|---|
|  |  |  | if (!Cools.isEmpty(locDetl) && matnr.equals(locDetl.getMatnr()) | 
|---|
|  |  |  | && batch.equals(batch.isEmpty() ? "" : locDetl.getBatch()) | 
|---|
|  |  |  | && grade.equals(grade.isEmpty() ? "" : locDetl.getBrand())) { | 
|---|
|  |  |  | if (!Cools.isEmpty(locDetl) && findLocNoAttributeVo.getMatnr().equals(locDetl.getMatnr()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBatch().equals(locDetl.getBatch()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBrand().equals(locDetl.getBrand())) { | 
|---|
|  |  |  | //获取目标库位所在巷道最深空库位 | 
|---|
|  |  |  | locMast = locMastService.selectLocByLocStsPakInO(curRow,nearRow,locMast1,rowLastnoType.getType().longValue()); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else if (signRule2){ | 
|---|
|  |  |  | List<String> locNos = locDetlService.getSameDetlToday(matnr, sRow, eRow); | 
|---|
|  |  |  | List<String> locNos = locDetlService.getSameDetlToday(findLocNoAttributeVo.getMatnr(), sRow, eRow); | 
|---|
|  |  |  | for (String locNo : locNos) { | 
|---|
|  |  |  | if (Utils.isShallowLoc(slaveProperties, locNo)) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 | 
|---|
|  |  |  | if (times < rowCount*2) { | 
|---|
|  |  |  | times = times + 1; | 
|---|
|  |  |  | return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | return getLocNoRun(whsType, staDescId, sourceStaNo, findLocNoAttributeVo,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //            // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 | 
|---|
|  |  |  | //            if (locTypeDto.getLocType1() < 2) { | 
|---|
|  |  |  | 
|---|
|  |  |  | return startupDto; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public StartupDto getLocNoRun4(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  | if (Cools.isEmpty(matnr)) {  //物料号 | 
|---|
|  |  |  | matnr = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(batch)) {  //批次 | 
|---|
|  |  |  | batch = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(grade)) {  //备用 | 
|---|
|  |  |  | grade = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public StartupDto getLocNoRun4(Integer whsType, Integer staDescId, Integer sourceStaNo,FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 初始化参数 | 
|---|
|  |  |  | int crnNo = 0;      //堆垛机号 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 相似工作档案 --- 同天同规格物料 | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111) ) { | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) && (staDescId == 1 || staDescId == 11 || staDescId == 111) ) { | 
|---|
|  |  |  | //查询相似工作档案 | 
|---|
|  |  |  | List<WrkMast> wrkMasts = wrkMastService.selectWrkMastWrkDetlMatnrBatch(staDescId, matnr, batch,grade, crnNo); | 
|---|
|  |  |  | List<WrkMast> wrkMasts = wrkMastService.selectWrkMastWrkDetlMatnrBatch(staDescId, findLocNoAttributeVo.getMatnr(), findLocNoAttributeVo.getBatch(),findLocNoAttributeVo.getBrand(), crnNo); | 
|---|
|  |  |  | int nearbay = 0;    //相似工作档案 目标库位列 | 
|---|
|  |  |  | int nearlev = 0;    //相似工作档案 目标库位层 | 
|---|
|  |  |  | for (WrkMast wrkMast:wrkMasts){ | 
|---|
|  |  |  | 
|---|
|  |  |  | //获取库存明细 | 
|---|
|  |  |  | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); | 
|---|
|  |  |  | //判断同规格物料 | 
|---|
|  |  |  | if (!Cools.isEmpty(wrkDetl) && matnr.equals(wrkDetl.getMatnr()) | 
|---|
|  |  |  | && batch.equals(batch.isEmpty() ? "":wrkDetl.getBatch()) | 
|---|
|  |  |  | && grade.equals(grade.isEmpty()? "":wrkDetl.getBrand())){ | 
|---|
|  |  |  | if (!Cools.isEmpty(wrkDetl) && findLocNoAttributeVo.getMatnr().equals(wrkDetl.getMatnr()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBatch().equals(wrkDetl.getBatch()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBrand().equals(wrkDetl.getBrand())){ | 
|---|
|  |  |  | int row2=0; | 
|---|
|  |  |  | if (Utils.getRow(locMast2.getLocNo())>nearRowW){ | 
|---|
|  |  |  | row2=Utils.getRow(locMast2.getLocNo())-1; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (Utils.BooleanWhsTypeStaIoType(rowLastno)){ | 
|---|
|  |  |  | // 靠近摆放规则 --- 同天同规格物料 //分离版 | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) &&  staDescId == 1){ | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) &&  staDescId == 1){ | 
|---|
|  |  |  | //                signRule1 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 靠近摆放规则 --- 同天同规格物料 //互通版 | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) && staDescId == 1) { | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) && staDescId == 1) { | 
|---|
|  |  |  | signRule2 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(matnr) &&  (staDescId == 11 || staDescId == 111)) { | 
|---|
|  |  |  | if (!Cools.isEmpty(findLocNoAttributeVo.getMatnr()) &&  (staDescId == 11 || staDescId == 111)) { | 
|---|
|  |  |  | signRule1 = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | LocMast locMastF = locMastService.selectLocByLocStsPakInF(curRow,nearRow,locMast1,rowLastnoType.getType().longValue()); | 
|---|
|  |  |  | if (!Cools.isEmpty(locMastF) && locMastF.getLocSts().equals("F")){ | 
|---|
|  |  |  | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMastF.getLocNo())); | 
|---|
|  |  |  | if (!Cools.isEmpty(locDetl) && matnr.equals(locDetl.getMatnr()) | 
|---|
|  |  |  | && batch.equals(batch.isEmpty() ? "" : locDetl.getBatch()) | 
|---|
|  |  |  | && grade.equals(grade.isEmpty() ? "" : locDetl.getBrand())) { | 
|---|
|  |  |  | if (!Cools.isEmpty(locDetl) && findLocNoAttributeVo.getMatnr().equals(locDetl.getMatnr()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBatch().equals(locDetl.getBatch()) | 
|---|
|  |  |  | && findLocNoAttributeVo.getBrand().equals(locDetl.getBrand())) { | 
|---|
|  |  |  | //获取目标库位所在巷道最深空库位 | 
|---|
|  |  |  | locMast = locMastService.selectLocByLocStsPakInO(curRow,nearRow,locMast1,rowLastnoType.getType().longValue()); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else if (signRule2){ | 
|---|
|  |  |  | List<String> locNos = locDetlService.getSameDetlToday(matnr, sRow, eRow); | 
|---|
|  |  |  | List<String> locNos = locDetlService.getSameDetlToday(findLocNoAttributeVo.getMatnr(), sRow, eRow); | 
|---|
|  |  |  | int nearbay = 0; | 
|---|
|  |  |  | int nearlev = 0; | 
|---|
|  |  |  | for (String locNo : locNos) { | 
|---|
|  |  |  | 
|---|
|  |  |  | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 | 
|---|
|  |  |  | if (times < rowCount*2) { | 
|---|
|  |  |  | times = times + 1; | 
|---|
|  |  |  | return getLocNoRun4(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | return getLocNoRun4(whsType, staDescId, sourceStaNo, findLocNoAttributeVo,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); | 
|---|
|  |  |  | throw new CoolException("没有空库位"); | 
|---|
|  |  |  | 
|---|
|  |  |  | startupDto.setLocNo(locNo); | 
|---|
|  |  |  | return startupDto; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public StartupDto getLocNoRun5(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  | if (Cools.isEmpty(matnr)) {  //物料号 | 
|---|
|  |  |  | matnr = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(batch)) {  //批次 | 
|---|
|  |  |  | batch = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(grade)) {  //备用 | 
|---|
|  |  |  | grade = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public StartupDto getLocNoRun5(Integer whsType, Integer staDescId, Integer sourceStaNo,FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 初始化参数 | 
|---|
|  |  |  | int crnNo = 0;      //堆垛机号 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 | 
|---|
|  |  |  | if (times < rowCount*2) { | 
|---|
|  |  |  | times = times + 1; | 
|---|
|  |  |  | return getLocNoRun5(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | return getLocNoRun5(whsType, staDescId, sourceStaNo, findLocNoAttributeVo,moveCrnNo, locTypeDto, times); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); | 
|---|
|  |  |  | throw new CoolException("没有空库位"); | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.EmptyPlateOutParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.FindLocNoAttributeVo; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.common.CodeRes; | 
|---|
|  |  |  | import com.zy.common.model.LocTypeDto; | 
|---|
|  |  |  | 
|---|
|  |  |  | BasDevp sourceStaNo = basDevpService.checkSiteStatus(12, true); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 检索库位 | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, 12, null,null,null, locTypeDto); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, 12, findLocNoAttributeVo, locTypeDto); | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 生成工作档 | 
|---|
|  |  |  | WrkMast wrkMast = new WrkMast(); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 检索库位 | 
|---|
|  |  |  | List<String> matnrs = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList()); | 
|---|
|  |  |  | List<String> batchs = waitPakins.stream().map(WaitPakin::getBatch).distinct().collect(Collectors.toList()); | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 1, devpNo, matnrs.get(0),batchs.get(0),null, locTypeDto); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(matnrs.get(0), batchs.get(0)); | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 1, devpNo,findLocNoAttributeVo, locTypeDto); | 
|---|
|  |  |  | int workNo = dto.getWorkNo(); | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 生成工作档 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 源站点状态检测 | 
|---|
|  |  |  | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); | 
|---|
|  |  |  | // 检索库位 | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, devpNo, null,null,null, locTypeDto); | 
|---|
|  |  |  | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StartupDto dto = commonService.getLocNo( 10, devpNo, findLocNoAttributeVo, locTypeDto); | 
|---|
|  |  |  | int workNo = dto.getWorkNo(); | 
|---|
|  |  |  | // 生成工作档 | 
|---|
|  |  |  | WrkMast wrkMast = new WrkMast(); | 
|---|