| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void infoReview(Review review) { |
| | | public TestMast infoReview(Review review) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo())); |
| | | if (!review.getBarcode().equals(locMast.getBarcode())){ |
| | | throw new CoolException("pack码不同"); |
| | |
| | | .eq("loc_no", review.getLocNo()) |
| | | .eq("barcode", review.getBarcode()) |
| | | .eq("user_Id", review.getUserId()); |
| | | if (null == locMast ||locMast.getPackStatus()!=1) { |
| | | throw new CoolException("产品状态不是 1:待测试"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(wrapper); |
| | | if (null == locMast) { |
| | | throw new CoolException("产品状态为空"); |
| | | }else if (locMast.getPackStatus()==2){ |
| | | if (!Cools.isEmpty(testMast)){ |
| | | if (testMast.getStatus()==2 || testMast.getStatus()==3){ |
| | | return testMast; |
| | | } |
| | | } |
| | | }else if (locMast.getPackStatus()!=1){ |
| | | throw new CoolException("产品状态不是1待测试"); |
| | | } |
| | | |
| | | if(null != testMast){ |
| | | if (testMast.getStatus()==1){ |
| | | testMast.setStatus(3); |
| | | testMast.setStatus(2); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,wrapper)){ |
| | | throw new CoolException("更新测试状态失败"); |
| | |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){ |
| | | throw new CoolException("更新产品状态失败"); |
| | | } |
| | | }else if (Cools.isEmpty(testMast.getStatus())){ |
| | | } else if (Cools.isEmpty(testMast.getStatus())){ |
| | | throw new CoolException("状态异常"); |
| | | }else { |
| | | throw new CoolException("状态不是 1:申请中"); |
| | |
| | | } else { |
| | | throw new CoolException("测试申请复核失败"); |
| | | } |
| | | return testMast; |
| | | } |
| | | |
| | | |