| | |
| | | |
| | | @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; |
| | | } |
| | | |
| | | |
| | |
| | | }else if (jsonObject.getDate("isComplete").equals(false)){ |
| | | success = false; |
| | | }else { |
| | | log.error("返回值出错!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(combParam), response); |
| | | log.error("返回值出错!!!url:{};request:{};response:{}", mesUrl+mesPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException("返回值出错"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(combParam), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", mesUrl+mesPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库入库上报", |
| | | MesConstant.URL + MesConstant.PAKIN_URL, |
| | | mesUrl + mesPath, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(combParam), |