| | |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.web.param.ReplenishmentParam; |
| | | import com.zy.common.web.param.SearchLocParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private ErpService erpService; |
| | | private AgvWaitPakinService agvWaitPakinService; |
| | | @Autowired |
| | | private AgvWorkService agvWorkService; |
| | | @Autowired |
| | | private AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private AgvWrkMastService agvWrkMastService; |
| | | // @Autowired |
| | | // private ErpService erpService; |
| | | |
| | | @PostMapping("/pakin/loc/v1") |
| | | @ResponseBody |
| | |
| | | throw new CoolException(CodeRes.NONE_DETL_900); |
| | | } |
| | | // 检索库位 |
| | | List<String> matnrList = wrkDetls.stream().map(WrkDetl::getMaktx).distinct().collect(Collectors.toList()); |
| | | List<String> matnrList = wrkDetls.stream().map(WrkDetl::getMatnr).distinct().collect(Collectors.toList()); |
| | | return commonService.getLocNo(1, ioType - 50, devpNo, matnrList, locTypeDto,0); // 库位号, 堆垛机,目标站 |
| | | } |
| | | |
| | | /* |
| | | 四项库往AGV补货,wcs调用此接口 |
| | | 四项库往AGV补货,生成AGV入库通知档 |
| | | */ |
| | | @PostMapping("/replenishment") |
| | | @ResponseBody |
| | | public R replenishment(@RequestBody ReplenishmentParam param){ |
| | | Date now = new Date(); |
| | | Integer wrkNo = param.getWrkNo(); |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkNo); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | if(!Cools.isEmpty(wrkDetl.getSuppCode()) && Cools.isEmpty(agvWaitPakinService.selectByContainerCode(wrkDetl.getSuppCode()))){ |
| | | AgvWaitPakin agvWaitPakin = new AgvWaitPakin(); |
| | | BeanUtils.copyProperties(wrkDetl,agvWaitPakin); |
| | | agvWaitPakin.setIoStatus("Y"); |
| | | agvWaitPakin.setModiTime(now); |
| | | agvWaitPakin.setAppeTime(now); |
| | | agvWaitPakinService.insert(agvWaitPakin); |
| | | } |
| | | }); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 生成AGV工作档 |
| | | */ |
| | | @PostMapping("/start") |
| | | @ResponseBody |
| | | public R start(@RequestBody ReplenishmentParam param){ |
| | | |
| | | String containerCode = param.getContainerCode(); |
| | | if(Cools.isEmpty(containerCode)){ |
| | | throw new CoolException("料箱码为空"); |
| | | } |
| | | |
| | | if(!Character.isDigit(containerCode.charAt(0))){ |
| | | containerCode = containerCode.substring(3,containerCode.length()); |
| | | } |
| | | |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.getByDevNo(param.getDevNo()); |
| | | |
| | | if(Cools.isEmpty(agvBasDevp) || !"O".equals(agvBasDevp.getLocSts())){ |
| | | throw new CoolException("当前站点不存在或者站点不为空"); |
| | | } |
| | | if(Cools.isEmpty(agvWaitPakinService.selectByContainerCode(containerCode))){ |
| | | throw new CoolException("该料箱位组托"); |
| | | } |
| | | |
| | | //去找agv工作档任务 |
| | | if(!Cools.isEmpty(agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode",containerCode)))){ |
| | | throw new CoolException("该料箱正在入库中"); |
| | | } |
| | | //绑定站点 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode); |
| | | |
| | | //生成工作档 |
| | | List<AgvBasDevp> agvBasDevpList = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("dev_no", param.getDevNo())); |
| | | agvWorkService.createWaitPainWrkMastStart(agvBasDevpList, null, true); |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |