| | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Value("mes.url") |
| | | @Value("${mes.url}") |
| | | private String mesUrl; |
| | | |
| | | @Value("mes.inPath") |
| | | @Value("${mes.inPath}") |
| | | private String inpath; |
| | | |
| | | @PostMapping("/pakin/loc/v1") |
| | |
| | | if (Cools.isEmpty(param.getSourceStaNo())) { |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("托盘码不能为空"); |
| | | } |
| | | boolean logs=true; |
| | | TestMast testMast11=new TestMast(); |
| | | //如果pack码为空,查测试表 |
| | | if (Cools.isEmpty(param.getPackNo())) { |
| | | testMast11= testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("user_id",param.getBarcode())//查托盘码 |
| | | .eq("status",4)); //完成测试 |
| | | logs=false; |
| | | }else{ |
| | | LocDetl locDetl=locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("matnr",param.getPackNo()) |
| | | .or() |
| | | .eq("zpallet",param.getBarcode())); |
| | | if(!Cools.isEmpty(locDetl)){ |
| | | return R.error("PACK码在库!!!!"); |
| | | } |
| | | |
| | | } |
| | | Date now = new Date(); |
| | | if (true){ |
| | | try{ |
| | | Mat mat=new Mat(); |
| | | if(logs){ |
| | | mat = matService.selectByMatnr(param.getPackNo()); |
| | | }else { |
| | | mat = matService.selectByMatnr(testMast11.getBarcode()); |
| | | } |
| | | |
| | | if (Cools.isEmpty(mat)){ |
| | | return R.error("商品信息档案未查询到pack信息"+param.getPackNo()); |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | int i = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if(i==0){ |
| | | waitPakin.setMatnr(mat.getMatnr());// Pack码 |
| | | waitPakin.setMaktx(mat.getMaktx()); |
| | | waitPakin.setZpallet(param.getBarcode()); //托盘码 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(1.0); // 数量 |
| | | waitPakin.setStatus("Y"); // 状态 |
| | | waitPakin.setManuDate(mat.getManuDate()); |
| | | waitPakin.setAppeUser(null); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(null); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setDeadWarn(mat.getDeadWarn()); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | List<WaitPakin> waitPakins = null; |
| | | if (param.getIoType() == 1) { |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), false); |
| | | // sourceStaNo.setLocType1(param.getLocType1()); |
| | | sourceStaNo.setLocType1((short)1); |
| | | sourceStaNo.setLocType1(param.getLocType1()); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | |
| | | StartupDto dto = null; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 全板入库 |
| | | * 全板入库 |
| | | */ |
| | | @Transactional |
| | | public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<WaitPakin> waitPakins) { |
| | |
| | | } |
| | | |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("barcode", wrkDetl.getMatnr()));//pack码 |
| | | .eq("barcode", wrkDetl.getMatnr()) |
| | | .eq("user_id",wrkDetl.getZpallet()));//pack码 |
| | | if (Cools.isEmpty(testMast)){ |
| | | //生成测试档 |
| | | testMast=new TestMast(); |
| | |
| | | testMast.setAppeTime(now); |
| | | if (!testMastService.insert(testMast)){ |
| | | throw new CoolException(wrkDetl.getMatnr()+"生成测试档失败"); |
| | | } |
| | | }else if(wrkMast.getStaNo()==209){ |
| | | testMast.setBarcode(wrkDetl.getMatnr()); |
| | | testMast.setChannel(locMast.getChannel()); |
| | | testMast.setLocNo(locMast.getLocNo()); |
| | | testMast.setUserId(wrkMast.getBarcode());//托盘码 |
| | | testMast.setAppeTime(now); |
| | | if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){ |
| | | throw new CoolException(wrkDetl.getMatnr()+"更新测试档失败"); |
| | | } |
| | | }else { |
| | | testMast.setBarcode(wrkDetl.getMatnr()); |
| | |
| | | if (!locMastService.updateById(locMast)){ |
| | | throw new CoolException("改变库位状态失败"); |
| | | }else{ |
| | | // if (locMast.getRow1()<3){ |
| | | // //1.扫码上报 |
| | | // CombParam combParam = new CombParam(); |
| | | // combParam.setPackNo(wrkMast.getBarcode()); |
| | | // combParam.setLocNo(wrkMast.getLocNo()); |
| | | // combParam.setPackSts(0); |
| | | // combParam.setStepSts(1); |
| | | // combParam.setRequestTime(DateUtils.convert(now)); |
| | | if (locMast.getRow1()<2){ |
| | | //1.扫码上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(waitPakins.get(0).getMatnr()); |
| | | combParam.setBarcode(wrkMast.getBarcode()); |
| | | combParam.setLocNo(wrkMast.getLocNo()); |
| | | combParam.setPackSts(0); |
| | | combParam.setStepSts(1); |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // } |
| | | } |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo()+"目标库位已被占用"); |