| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.StatusParam; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | |
| | | if (Cools.isEmpty(param.getFromPort())) { |
| | | return Re.error("源站编号不能为空"); |
| | | } |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | // if(Cools.isEmpty(param.getWarehouse())){ |
| | | // return Re.error("仓库编号不能为空"); |
| | | // } |
| | | // if(!param.getWarehouse().equals(warehouse)){ |
| | | // return Re.error("仓库编号不匹配"); |
| | | // } |
| | | List<WaitPakin> waitPakins = null; |
| | | if (param.getFromPort().equals("101")) { |
| | | |
| | |
| | | @ResponseBody |
| | | public synchronized Re getLocNo(@RequestBody SearchEmptyParam param) { |
| | | log.info("收到WCS空板入库接口请求====>>入参:{}", param); |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | // if(Cools.isEmpty(param.getWarehouse())){ |
| | | // return Re.error("仓库编号不能为空"); |
| | | // } |
| | | // if(!param.getWarehouse().equals(warehouse)){ |
| | | // return Re.error("仓库编号不匹配"); |
| | | // } |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(Integer.valueOf(param.getFromPort()), true); |
| | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | 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); |
| | | // List<String> matnrs = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList()); |
| | | // List<String> batchs = waitPakins.stream().map(WaitPakin::getBatch).distinct().collect(Collectors.toList()); |
| | | WaitPakin waitPakin1 = waitPakins.get(0); |
| | | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(); |
| | | findLocNoAttributeVo.setMatnr(waitPakin1.getMatnr()); |
| | | |
| | | // StartupDto dto = commonService.getLocNo(1, devpNo, matnrs.get(0), batchs.get(0), null, locTypeDto); |
| | | StartupDto dto = commonService.getLocNoNew(1, devpNo, findLocNoAttributeVo, locTypeDto,barcode); |
| | | if (dto == null) { |
| | | throw new CoolException("没有检索到空库位"); |
| | | } |
| | |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(waitPakin1.getModiUser()); |
| | | wrkMast.setAppeUser(waitPakin1.getAppeUser()); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | StartupDto dto = commonService.getLocNo(10, devpNo, null, null, null, locTypeDto); |
| | | StartupDto dto = commonService.getLocNoNew(10, devpNo, null, null, null); |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | |
| | | success = true; |
| | | } else { |
| | | log.error("wms同步wcs库位失败!!!url:{};request:{};response:{}", url + "/" + loc, JSON.toJSONString(mapList), response); |
| | | throw new CoolException("wms下发任务给wcs失败"); |
| | | throw new CoolException("wms同步wcs库位失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new CoolException("wms下发任务给wcs失败"); |
| | | throw new CoolException("wms同步wcs库位失败"); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |