| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.MatServiceImpl; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private MatServiceImpl matService; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { |
| | | int tagId = 0; |
| | | if (Cools.isEmpty(matnr)) { //物料号 |
| | | matnr = ""; |
| | | }else{ |
| | | tagId = matService.getTagIdByMatnr(matnr); |
| | | } |
| | | if (Cools.isEmpty(batch)) { //箱号 |
| | | batch = ""; |
| | |
| | | int sRow = rowLastno.getsRow(); |
| | | int eRow = rowLastno.geteRow(); |
| | | int crnNumber = rowLastno.getCrnQty(); |
| | | |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | |
| | | // } |
| | | |
| | | if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | if(tagId == 226){ |
| | | List<LocMast> filteredLocMasts = new ArrayList<>(); |
| | | for (LocMast loc : locMasts) { |
| | | Integer lev = loc.getLev1(); |
| | | if (lev != null && lev >= 6 && lev <= 10) { |
| | | filteredLocMasts.add(loc); |
| | | } |
| | | } |
| | | locMasts = filteredLocMasts; |
| | | } |
| | | // if(tagId == 226){ //原材料毛胚等 |
| | | // List<LocMast> filteredLocMasts = new ArrayList<>(); |
| | | // for (LocMast loc : locMasts) { |
| | | // Integer lev = loc.getLev1(); |
| | | // if (lev != null && lev >= 1 && lev <= 5) { |
| | | // filteredLocMasts.add(loc); |
| | | // } |
| | | // } |
| | | // locMasts = filteredLocMasts; |
| | | // } |
| | | for (LocMast locMast1 : locMasts) { |
| | | if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | continue; |
| | |
| | | // return getLocNo(1, staDescId, sourceStaNo, matnr,batch,grade, locTypeDto, 0); |
| | | // } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | throw new CoolException("没有空库位或堆垛机异常"); |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |