| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | if(Cools.isEmpty(agvBasDevp) || !"O".equals(agvBasDevp.getLocSts())){ |
| | | throw new CoolException("当前站点不存在或者站点不为空"); |
| | | } |
| | | |
| | | AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectByContainerCode(containerCode); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", containerCode)); |
| | | |
| | | //拣料、盘点完成任务 |
| | | if(!Cools.isEmpty(agvWrkMast) && (agvWrkMast.getIoType() == 103 || agvWrkMast.getIoType() == 107) && agvWrkMast.getWrkSts() == 205){ |
| | | //绑定站点 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode); |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode,agvWrkMast.getWhsType().shortValue()); |
| | | |
| | | //生成拣料、盘点再入库任务 |
| | | List<AgvWrkMast> agvWrkMastList = new ArrayList<>(); |
| | |
| | | //入库任务 |
| | | if (!Cools.isEmpty(agvWaitPakinService.selectByContainerCode(containerCode))){ |
| | | //绑定站点 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode); |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode,agvWrkMast.getWhsType().shortValue()); |
| | | //生成工作档 |
| | | List<AgvBasDevp> agvBasDevpList = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("dev_no", param.getDevNo())); |
| | | agvWorkService.createWaitPainWrkMastStart(agvBasDevpList, null, true); |
| | |
| | | currentContainerMap = new HashMap<>(); |
| | | } |
| | | |
| | | String containerCode = param.getContainerCode(); |
| | | String containerCode = param.getContainerCode().split(";")[0]; |
| | | |
| | | if(Cools.isEmpty(containerCode)){ |
| | | throw new CoolException("料箱码为空"); |
| | | } |
| | |
| | | //查询旧容器的工作档 |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(currentContainerCode); |
| | | if(!Cools.isEmpty(agvWrkMast) && agvWrkMast.getIoType() == 101){ |
| | | //发送容器立场请求,完成工作档 |
| | | List<AgvWrkMast> agvWrkMastList = new ArrayList<>(); |
| | | agvWrkMastList.add(agvWrkMast); |
| | | try { |
| | | int code = agvWrkMastService.containerMoveOut(agvWrkMastList); |
| | | if(code == 0){ |
| | | //将工作党状态改为容器离场 |
| | | agvWrkMast.setWrkSts(206L); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | } |
| | | } catch (IOException e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | //将工作党状态改为容器离场 |
| | | agvWrkMast.setWrkSts(206L); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | // //发送容器立场请求,完成工作档 |
| | | // List<AgvWrkMast> agvWrkMastList = new ArrayList<>(); |
| | | // agvWrkMastList.add(agvWrkMast); |
| | | // try { |
| | | // int code = agvWrkMastService.containerMoveOut(agvWrkMastList); |
| | | // if(code == 0){ |
| | | // //将工作党状态改为容器离场 |
| | | // agvWrkMast.setWrkSts(206L); |
| | | // agvWrkMastService.updateById(agvWrkMast); |
| | | // } |
| | | // } catch (IOException e) { |
| | | // log.error(e.getMessage()); |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | if(!Cools.isEmpty(agvWrkMast)){ |
| | | List<AgvWrkDetl> agvWrkDetlList = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("wrk_no", agvWrkMast.getWrkNo())); |
| | | |
| | | for (AgvWrkDetl agvWrkDetl : AgvWrkDetlList){ |
| | | for (AgvWrkDetl agvWrkDetl : agvWrkDetlList){ |
| | | agvWrkDetl.setVolume(agvWrkDetl.getAnfme()); |
| | | if(agvWrkMast.getIoType() == 103){ |
| | | //寻找是否有相同物料的工作档明细,并返回数量之和 |
| | |
| | | } |
| | | }; |
| | | |
| | | |
| | | return R.ok(agvWrkDetlList).add(agvWrkMast); |
| | | agvBasDevpDto.setAgvWrkDetls(agvWrkDetlList); |
| | | agvBasDevpDto.setAgvWrkMast(agvWrkMast); |
| | | } |
| | | //查找该容器的入库通知档 |
| | | List<AgvWaitPakin> agvWaitPakinList = agvWaitPakinService.selectList(new EntityWrapper<AgvWaitPakin>().eq("supp_code", containerCode)); |
| | | if(!Cools.isEmpty(agvWaitPakinList)){ |
| | | return R.ok(agvWaitPakinList); |
| | | agvBasDevpDto.setAgvWaitPakins(agvWaitPakinList); |
| | | } |
| | | |
| | | return R.error("没有该容器的出库、拣料、入库信息等"); |
| | | System.out.println("currentContainerMap: " + currentContainerMap); |
| | | |
| | | |
| | | System.out.println("agvBasDevpDto: " + agvBasDevpDto); |
| | | |
| | | return R.ok(agvBasDevpDto); |
| | | } |
| | | |
| | | private double getAllAnfmeInAgvWrkDetlList(List<AgvWrkDetl> agvWrkDetlList, AgvWrkDetl wd0) { |