| | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast,WrkMast wrkMastOther) { |
| | | try { |
| | | Date now = new Date(); |
| | |
| | | return FAIL; |
| | | } |
| | | String[] strings = staNoOther(locMast1.getLocNo()); |
| | | if (Cools.isEmpty(strings)){ |
| | | if (Cools.isEmpty(strings) || Cools.isEmpty(strings[0]) || Cools.isEmpty(strings[1])){ |
| | | return FAIL; |
| | | } |
| | | wrkMast.setLocNo(strings[0]); |
| | |
| | | |
| | | WrkMastCrn wrkMastCrn = new WrkMastCrn(wrkMast,wrkMastOther,now); |
| | | |
| | | wrkMastCrnService.insert(wrkMastCrn); |
| | | |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | |
| | | throw new CoolException(locMast1.getLocNo()+"目标库位已被占用"); |
| | | } |
| | | |
| | | wrkMastService.updateById(wrkMast); |
| | | |
| | | // 更新目标库位状态 |
| | | LocMast locMastOther = locMastService.selectById(wrkMastOther.getLocNo()); |
| | |
| | | } else { |
| | | throw new CoolException(locMast1.getLocNo()+"目标库位已被占用"); |
| | | } |
| | | wrkMastService.updateById(wrkMast); |
| | | wrkMastService.updateById(wrkMastOther); |
| | | |
| | | wrkMastCrnService.insert(wrkMastCrn); |
| | | |
| | | }catch (Exception e){ |
| | | log.error("异常!!!"+e); |
| | | return FAIL; |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | try { |
| | | Date now = new Date(); |
| | | LocTypeDto locTypeDto = new LocTypeDto(); |
| | | locTypeDto.setLocType1((short)1); |
| | | |
| | | String deepLocOther = getDeepLoc2(wrkMast.getSourceLocNo(), Utils.getRow(wrkMast.getSourceLocNo())); |
| | | if (Cools.isEmpty(deepLocOther)){ |
| | | return FAIL; |
| | | } |
| | | WrkMast wrkMastOther = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no", deepLocOther).eq("wrk_sts", 11L)); |
| | | if (!Cools.isEmpty(wrkMastOther)){ |
| | | WrkMastCrn wrkMastCrn = new WrkMastCrn(wrkMast,wrkMastOther,now); |
| | | wrkMastCrnService.insert(wrkMastCrn); |
| | | }else { |
| | | return FAIL; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("异常!!!"+e); |
| | | return FAIL; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号 |
| | | */ |
| | | public static String getDeepLoc(String shallowLoc,int row) { |
| | | if (row == 2 || row == 6) { |
| | | return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2); |
| | | } else if (row == 3 || row == 7) { |
| | | return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2); |
| | | }else { |
| | | return shallowLoc; |
| | | } |
| | | } |
| | | // /** |
| | | // * 获取 浅库位对应的深库位号 |
| | | // */ |
| | | // public static String getDeepLoc(String shallowLoc,int row) { |
| | | // if (row == 2 || row == 6) { |
| | | // return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2); |
| | | // } else if (row == 3 || row == 7) { |
| | | // return Utils.zerofill(String.valueOf(row+1), 2) + shallowLoc.substring(2); |
| | | // }else { |
| | | // return shallowLoc; |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 获取 深库位对应的浅库位号 |
| | |
| | | } else if (row == 4 || row == 8) { |
| | | return Utils.zerofill(String.valueOf(row-1), 2) + shallowLoc.substring(2); |
| | | }else { |
| | | return shallowLoc; |
| | | return null; |
| | | } |
| | | } |
| | | |