| | |
| | | @Resource |
| | | private OrderPakoutService orderPakOutService; |
| | | |
| | | @Resource |
| | | private BasAgvLocDetlService basAgvLocDetlService; |
| | | |
| | | @Resource |
| | | private BasAgvWrkDetlService basAgvWrkDetlService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public String startupFullPutStore(FullStoreParam param, Long userId) { |
| | |
| | | dtos.add(new OutLocDto(locNo, locDetlDto)); |
| | | } |
| | | } |
| | | Config configAutoMPArea = configService.selectConfigByCode("AutoMPArea"); |
| | | |
| | | Integer ioType = null; |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | |
| | | |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | | if(ioType.equals(107)){ |
| | | staDesc = staDescService.queryCrnStnCheck(ioType, locMast.getCrnNo(), outSta); |
| | | } |
| | | |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | | // 生成工作档 |
| | |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setTakeNone("0"); //0非自动 |
| | | |
| | | List<BasAgvWrkDetl> basAgvWrkDetls = null; |
| | | List<BasAgvLocDetl> basAgvLocDetls = null; |
| | | try{ |
| | | if (Boolean.parseBoolean(configAutoMPArea.getValue())){ |
| | | if (wrkMast.getStaNoAgvSign()){ |
| | | if (ioType==101){ |
| | | // 全板出库 |
| | | basAgvLocDetls = new ArrayList<>(); |
| | | } else { |
| | | // 拣料出库 |
| | | basAgvWrkDetls = new ArrayList<>(); |
| | | } |
| | | wrkMast.setTakeNone("1"); //等待下发 |
| | | } else { |
| | | wrkMast.setTakeNone("3"); //无需AGV搬运 |
| | | } |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | } |
| | | |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | |
| | | try{ |
| | | if (basAgvWrkDetls != null){ |
| | | BasAgvWrkDetl basAgvWrkDetl = new BasAgvWrkDetl(); |
| | | basAgvWrkDetl.sync(wrkDetl); |
| | | basAgvWrkDetls.add(basAgvWrkDetl); |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | // if(locMastRgv !=null){ |
| | | // if (Boolean.parseBoolean(config.getValue()) && locMastRgv.getLocNo() != null && ioType != 107) { //若有空库位且配置允许则绑定其备料库位号 |
| | | // //修改agv备料区状态 |
| | | // if(locMastRgv.getLocSts().equals("O") && ioType != 107){ |
| | | // locMastRgv.setLocSts("S"); |
| | | // locMastRgv.setModiUser(userId); |
| | | // locMastRgv.setModiTime(now); |
| | | // if (!locMastService.updateById(locMastRgv)) { |
| | | // throw new CoolException("预约agv备料区库位状态失败,库位号:"+locMastRgv.getLocNo()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | |
| | | try{ |
| | | if (basAgvLocDetls != null){ |
| | | List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | for (LocDetl locDetl : locDetlList) { |
| | | BasAgvLocDetl basAgvLocDetl = new BasAgvLocDetl(); |
| | | basAgvLocDetl.sync(locDetl); |
| | | basAgvLocDetls.add(basAgvLocDetl); |
| | | } |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | |
| | | try{ |
| | | // 增加AGV库存中转数量 |
| | | if (basAgvLocDetls != null){ |
| | | for (BasAgvLocDetl basAgvLocDetl : basAgvLocDetls) { |
| | | basAgvLocDetlService.insert(basAgvLocDetl); |
| | | } |
| | | } |
| | | if (basAgvWrkDetls != null){ |
| | | for (BasAgvWrkDetl basAgvWrkDetl : basAgvWrkDetls) { |
| | | basAgvWrkDetlService.insert(basAgvWrkDetl); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){} |
| | | } |
| | | } |
| | | |
| | |
| | | throw new CoolException("订单出库异常,请联系管理员"); |
| | | } |
| | | } |
| | | Config config = configService.selectConfigByCode("AutoMPArea"); |
| | | Config configAutoMPArea = configService.selectConfigByCode("AutoMPArea"); |
| | | |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(taskDto.getLocNo()); |
| | |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(taskDto.getLocNo()); // 源库位 |
| | | if (Boolean.parseBoolean(config.getValue()) && locMastRgv.getLocNo() != null) { //若有空库位且配置允许则绑定其备料库位号 |
| | | wrkMast.setLocNo(locMastRgv.getLocNo()); |
| | | wrkMast.setTakeNone("0"); //0rgv未取,1rgv已取货 |
| | | } |
| | | wrkMast.setTakeNone("0"); //0非自动 |
| | | |
| | | List<BasAgvWrkDetl> basAgvWrkDetls = null; |
| | | List<BasAgvLocDetl> basAgvLocDetls = null; |
| | | try{ |
| | | if (Boolean.parseBoolean(configAutoMPArea.getValue())){ |
| | | if (wrkMast.getStaNoAgvSign()){ |
| | | if (ioType==101){ |
| | | // 全板出库 |
| | | basAgvLocDetls = new ArrayList<>(); |
| | | } else { |
| | | // 拣料出库 |
| | | basAgvWrkDetls = new ArrayList<>(); |
| | | } |
| | | wrkMast.setTakeNone("1"); //等待下发 |
| | | } else { |
| | | wrkMast.setTakeNone("3"); //无需AGV搬运 |
| | | } |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | |
| | | try{ |
| | | if (basAgvWrkDetls != null){ |
| | | BasAgvWrkDetl basAgvWrkDetl = new BasAgvWrkDetl(); |
| | | basAgvWrkDetl.sync(wrkDetl); |
| | | basAgvWrkDetls.add(basAgvWrkDetl); |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | |
| | | locMastRgv.setModiUser(userId); |
| | | locMastRgv.setModiTime(now); |
| | | if (!locMastService.updateById(locMastRgv)) { |
| | | throw new CoolException("预约agv备料区库位状态失败,库位号:"+taskDto.getLocNo()); |
| | | throw new CoolException("预约agv备料区库位状态失败,库位号:"+locMastRgv.getLocNo()); |
| | | } |
| | | }else{ |
| | | throw new CoolException(taskDto.getLocNo() + "备料区不是空库位状态"); |
| | | throw new CoolException(locMastRgv.getLocNo() + "备料区不是空库位状态"); |
| | | |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(taskDto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | try{ |
| | | if (basAgvLocDetls != null){ |
| | | List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | for (LocDetl locDetl : locDetlList) { |
| | | BasAgvLocDetl basAgvLocDetl = new BasAgvLocDetl(); |
| | | basAgvLocDetl.sync(locDetl); |
| | | basAgvLocDetls.add(basAgvLocDetl); |
| | | } |
| | | } |
| | | } catch (Exception e) {} //配置项不存在,不做处理 |
| | | |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | } else { |
| | | throw new CoolException(taskDto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | |
| | | |
| | | |
| | | try{ |
| | | // 增加AGV库存中转数量 |
| | | if (basAgvLocDetls != null){ |
| | | for (BasAgvLocDetl basAgvLocDetl : basAgvLocDetls) { |
| | | basAgvLocDetlService.insert(basAgvLocDetl); |
| | | } |
| | | } |
| | | if (basAgvWrkDetls != null){ |
| | | for (BasAgvWrkDetl basAgvWrkDetl : basAgvWrkDetls) { |
| | | basAgvWrkDetlService.insert(basAgvWrkDetl); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){} |
| | | } |
| | | |
| | | @Override |