| | |
| | | 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())) { |
| | | return R.error("packNo不能为空"); |
| | | testMast11= testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("user_id",param.getBarcode())//查托盘码 |
| | | .eq("status",4)); //完成测试 |
| | | logs=false; |
| | | } |
| | | Date now = new Date(); |
| | | if (true){ |
| | | try{ |
| | | Mat mat = matService.selectByMatnr(param.getPackNo()); |
| | | 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()); |
| | | } |
| | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>().eq("barcode", wrkMast.getBarcode())); |
| | | |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("barcode", wrkDetl.getMatnr()));//pack码 |
| | | if (Cools.isEmpty(testMast)){ |
| | | //生成测试档 |
| | | testMast=new TestMast(); |
| | | testMast.setChannel(locMast.getChannel()); |
| | | testMast.setUserId(locMast.getLocNo()); |
| | | testMast.setUserId(wrkMast.getBarcode());//托盘码 |
| | | testMast.setStatus(1); |
| | | testMast.setBarcode(wrkDetl.getMatnr()); |
| | | testMast.setLocNo(locMast.getLocNo()); |
| | |
| | | throw new CoolException(wrkDetl.getMatnr()+"生成测试档失败"); |
| | | } |
| | | }else { |
| | | throw new CoolException(wrkDetl.getMatnr()+"已存在测试档"); |
| | | testMast.setBarcode(wrkDetl.getMatnr()); |
| | | testMast.setChannel(locMast.getChannel()); |
| | | testMast.setLocNo(locMast.getLocNo()); |
| | | testMast.setAppeTime(now); |
| | | if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){ |
| | | throw new CoolException(wrkDetl.getMatnr()+"更新测试档失败"); |
| | | } |
| | | } |
| | | }); |
| | | // 更新入库通知档 ioStatus ===>> Y |