| | |
| | | //检索库位,选择合适的库位 |
| | | AgvLocMast agvLocMast = agvCommonService.getLocNo(agvBasDevp.getLocType1()); |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),agvBasDevp.getBarcode(),now,userId, isConveyor); |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),agvBasDevp.getBarcode(),now,userId, agvBasDevp.getLocType2()); |
| | | //标记是否为输送线入库 |
| | | wrkMast.setMk(isConveyor ? "Y" : "N"); |
| | | //生成工作档明细 |
| | |
| | | //判断是否全板出库 |
| | | int ioType = isPakOut(sourceLocNo,taskDto) ? 101 : 103; |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,false); |
| | | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,0); |
| | | //生成工作档明细 |
| | | taskDto.getLocDtos().forEach(locDto -> { |
| | | if (!BaseController.isJSON(locDto.getOrderNo())) { |
| | |
| | | return; |
| | | } |
| | | |
| | | int containerType = getContainerTypeByloc(taskDto.getLocNo()); |
| | | |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(107, 21L,taskDto.getLocNo(),taskDto.getAgvStaNo(),taskDto.getLocDtos().get(0).getContainerCode(),now,userId,false); |
| | | AgvWrkMast wrkMast = createWrkMast(107, 21L,taskDto.getLocNo(),taskDto.getAgvStaNo(),taskDto.getLocDtos().get(0).getContainerCode(),now,userId,containerType); |
| | | //生成工作档明细 |
| | | taskDto.getLocDtos().forEach(locDto -> { |
| | | //明细档所需参数 |
| | |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | |
| | | //生成移库工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(11, 21L, sourceLocNo, targetLocNo, sourceLocDetl.getSuppCode(), now, userId,false); |
| | | AgvWrkMast wrkMast = createWrkMast(11, 21L, sourceLocNo, targetLocNo, sourceLocDetl.getSuppCode(), now, userId,getContainerTypeByloc(sourceLocNo)); |
| | | //生成工作党明细 |
| | | createWrkDetlReWrite(sourceLocDetl.getMatnr(),wrkMast.getWrkNo(),null,sourceLocDetl.getBatch(),sourceLocDetl.getAnfme(),sourceLocDetl.getZpallet(),now,userId,sourceLocDetl.getThreeCode(),sourceLocDetl.getDeadTime()); |
| | | //修改目标库位状态 |
| | |
| | | 入库 |
| | | */ |
| | | @Transactional |
| | | public String emptyPlateIn(String station,String containerCode,int containerType, Long userId) { |
| | | public String emptyPlateIn(String station,String containerCode,Short containerType, Long userId) { |
| | | |
| | | Date now = new Date(); |
| | | // 源站点状态检测 |
| | |
| | | List<AgvWaitPakin> agvWaitPakinList = agvWaitPakinService.selectByContainerCode(containerCode); |
| | | if(!Cools.isEmpty(agvWaitPakinList)){ |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),containerCode,now,userId, false); |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),containerCode,now,userId, agvBasDevp.getLocType2()); |
| | | //生成工作档明细 |
| | | agvWaitPakinList.forEach(wp -> { |
| | | createWrkDetlReWrite(wp.getMatnr(),wrkMast.getWrkNo(),wp.getOrderNo(),wp.getBatch(),wp.getAnfme(),wp.getSuppCode(),now,userId,wp.getThreeCode(),wp.getDeadTime()); |
| | | }); |
| | | //修改入库通知档状态 |
| | | agvWaitPakinService.updateIoStatus(containerCode,"Y"); |
| | | }else { |
| | | // 生成工作档 10.空板入库 |
| | | createWrkMast(10,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),containerCode,now,userId,false); |
| | | } |
| | | |
| | | //更新源站点状态 |
| | | updateAgvBasDevp(agvBasDevp,"R"); |
| | | }else { |
| | | // 生成工作档 10.空板入库 |
| | | createWrkMast(10,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),containerCode,now,userId,containerType); |
| | | //更新源站点状态 |
| | | updateAgvBasDevp(agvBasDevp,"R",containerType); |
| | | } |
| | | |
| | | //更新目标库位状态和信息 |
| | | updateAgvLocMast(agvLocMast,"S", (short) containerType); |
| | | updateAgvLocMast(agvLocMast,"S"); |
| | | return agvLocMast.getLocNo(); |
| | | } |
| | | |
| | |
| | | throw new CoolException("暂无当前出库站点类型的空托盘!"); |
| | | } |
| | | //生成工作档 |
| | | createWrkMast(110,21L,agvLocMast.getLocNo(),agvBasDevp.getDevNo(),agvLocMast.getBarcode(),now,userId,false); |
| | | createWrkMast(110,21L,agvLocMast.getLocNo(),agvBasDevp.getDevNo(),agvLocMast.getBarcode(),now,userId,containerType); |
| | | |
| | | //修改源库位状态 |
| | | updateAgvLocMast(agvLocMast,"R"); |
| | |
| | | String devNo = wrkMast.getSourceLocNo(); |
| | | //目标库位 |
| | | String locNo = wrkMast.getLocNo(); |
| | | agvLocMastService.updateLocStsByLocNo(locNo,"O",""); |
| | | agvLocMastService.updateLocStsByLocNo(locNo,"O","",null); |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(devNo,"F",wrkMast.getBarcode()); |
| | | |
| | | //出库取消 |
| | |
| | | String locNo = wrkMast.getSourceLocNo(); |
| | | //目标站点 |
| | | String devNo = wrkMast.getLocNo(); |
| | | agvLocMastService.updateLocStsByLocNo(locNo,"F",wrkMast.getBarcode()); |
| | | agvLocMastService.updateLocStsByLocNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo)); |
| | | if(devNo.contains("@")){ |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(devNo,"O",""); |
| | | } |
| | |
| | | } |
| | | |
| | | /* |
| | | 更新源站点信息和库位托盘类型 |
| | | */ |
| | | private void updateAgvBasDevp(AgvBasDevp agvBasDevp, String locSts, Short continerType){ |
| | | if(!Cools.isEmpty(agvBasDevp)){ |
| | | agvBasDevp.setLocSts(locSts); |
| | | agvBasDevp.setLocType2(continerType); |
| | | agvBasDevpService.updateById(agvBasDevp); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | 生成工作档明细 |
| | | */ |
| | | private void createWrkDetlReWrite(String matnr, int wrkNo, String orderNo,String batch, double anfme, String zpallet, Date now, Long userId, String csocode, String isoseq){ |
| | |
| | | /* |
| | | 生成工作档 |
| | | */ |
| | | private AgvWrkMast createWrkMast(int ioType, long wrkSts, String sourceLocNo, String locNo, String barcode, Date now, Long userId, boolean isConveyor){ |
| | | private AgvWrkMast createWrkMast(int ioType, long wrkSts, String sourceLocNo, String locNo, String barcode, Date now, Long userId, int containerType){ |
| | | AgvWrkMast wrkMast = new AgvWrkMast(); |
| | | //工作状态 |
| | | wrkMast.setWrkSts(wrkSts); |
| | |
| | | wrkMast.setLocNo(locNo); |
| | | //容器编码 |
| | | wrkMast.setBarcode(barcode); |
| | | //标记是否为输送线入库 |
| | | wrkMast.setMk(isConveyor ? "Y" : "N"); |
| | | //容器类型 |
| | | wrkMast.setWhsType(containerType); |
| | | |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | |
| | | } |
| | | } |
| | | |
| | | private int getContainerTypeByloc(String locNo){ |
| | | |
| | | return agvLocMastService.selectOne(new EntityWrapper<AgvLocMast>().eq("loc_no",locNo)).getLocType2(); |
| | | |
| | | } |
| | | |
| | | } |