|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${mes.url}") | 
|---|
|  |  |  | private String mesUrl; | 
|---|
|  |  |  | @Value("${ren.url}") | 
|---|
|  |  |  | private String renUrl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${mes.startUpTestPACK}") | 
|---|
|  |  |  | @Value("${ren.startUpTestPACK}") | 
|---|
|  |  |  | private String startUpTestPACK; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${mes.startUpTestPACK}") | 
|---|
|  |  |  | @Value("${ren.startUpTestPACK}") | 
|---|
|  |  |  | private String suspendTestPACK; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${mes.inPath}") | 
|---|
|  |  |  | 
|---|
|  |  |  | combParam.setLocNo(locMast.getLocNo()); | 
|---|
|  |  |  | combParam.setPackSts(1); | 
|---|
|  |  |  | combParam.setRequestTime(DateUtils.convert(new Date())); | 
|---|
|  |  |  | postMesData(inpath,combParam); | 
|---|
|  |  |  | postMesData(mesUrl,inpath,combParam); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){ | 
|---|
|  |  |  | throw new CoolException("申请测试失败"); | 
|---|
|  |  |  | 
|---|
|  |  |  | combParam.setPackName(testMast.getUserId()); | 
|---|
|  |  |  | combParam.setLocNo(testMast.getBarcode()); | 
|---|
|  |  |  | combParam.setRequestTime(DateUtils.convert(new Date())); | 
|---|
|  |  |  | return postMesData(startUpTestPACK,combParam); | 
|---|
|  |  |  | return postMesData(renUrl,startUpTestPACK,combParam); | 
|---|
|  |  |  | }catch (Exception e) { | 
|---|
|  |  |  | log.error("fail", e); | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | 
|---|
|  |  |  | Review review=new Review(); | 
|---|
|  |  |  | review.setPause(true); | 
|---|
|  |  |  | review.setRequestTime(DateUtils.convert(new Date())); | 
|---|
|  |  |  | return postMesData(suspendTestPACK,review); | 
|---|
|  |  |  | return postMesData(renUrl,suspendTestPACK,review); | 
|---|
|  |  |  | }catch (Exception e) { | 
|---|
|  |  |  | log.error("fail", e); | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private ReturnT<String> postMesData(String mesPath,Object combParam){ | 
|---|
|  |  |  | private ReturnT<String> postMesData(String URL,String Path,Object combParam){ | 
|---|
|  |  |  | if(combParam != null){ | 
|---|
|  |  |  | String response = ""; | 
|---|
|  |  |  | boolean success = false; | 
|---|
|  |  |  | 
|---|
|  |  |  | //                map.put("appkey","ea1f0459efc02a79f046f982767939ae"); | 
|---|
|  |  |  | response = new HttpHandler.Builder() | 
|---|
|  |  |  | //                        .setHeaders(map) | 
|---|
|  |  |  | .setUri(mesUrl) | 
|---|
|  |  |  | .setPath(mesPath) | 
|---|
|  |  |  | .setUri(URL) | 
|---|
|  |  |  | .setPath(Path) | 
|---|
|  |  |  | .setJson(JSON.toJSONString(combParam)) | 
|---|
|  |  |  | .build() | 
|---|
|  |  |  | .doPost(); | 
|---|
|  |  |  | 
|---|
|  |  |  | }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:{}", URL+Path, 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:{}", URL+Path, JSON.toJSONString(combParam), response); | 
|---|
|  |  |  | throw new CoolException("上报mes系统失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | // 保存接口日志 | 
|---|
|  |  |  | apiLogService.save( | 
|---|
|  |  |  | "成品库入库上报", | 
|---|
|  |  |  | MesConstant.URL + MesConstant.PAKIN_URL, | 
|---|
|  |  |  | URL + Path, | 
|---|
|  |  |  | null, | 
|---|
|  |  |  | "127.0.0.1", | 
|---|
|  |  |  | JSON.toJSONString(combParam), | 
|---|
|  |  |  | 
|---|
|  |  |  | }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), | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | success = true; | 
|---|
|  |  |  | } 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) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } finally { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | // 保存接口日志 | 
|---|
|  |  |  | //                            MesConstant.URL + MesConstant.PAKIN_URL, | 
|---|
|  |  |  | apiLogService.save( | 
|---|
|  |  |  | "成品库入库上报", | 
|---|
|  |  |  | MesConstant.URL + MesConstant.PAKIN_URL, | 
|---|
|  |  |  | mesUrl + mesPath, | 
|---|
|  |  |  | null, | 
|---|
|  |  |  | "127.0.0.1", | 
|---|
|  |  |  | JSON.toJSONString(combParam), | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | success = true; | 
|---|
|  |  |  | } 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), | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mes: | 
|---|
|  |  |  | url: 172.28.15.251:7899 | 
|---|
|  |  |  | url2: 172.28.15.251:7899 | 
|---|
|  |  |  | # 入库上报 | 
|---|
|  |  |  | inPath: mes-pm/in/stock/condition/warehousing | 
|---|
|  |  |  | # 出库上报 | 
|---|
|  |  |  | outPath: mes-pm/in/stock/condition/exWarehouse | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ren: | 
|---|
|  |  |  | url: 172.28.15.251:7899 | 
|---|
|  |  |  | # 启动测试请求 | 
|---|
|  |  |  | startUpTestPACK: 127.0.0.1:8080/ynwms/open/asrs/rpv/test/open/auth | 
|---|
|  |  |  | #暂停测试 | 
|---|