Merge branch 'master' of http://test.csylcloud.com:8000/zsef5966/medicinal-supplier
Showing
5 changed files
with
246 additions
and
160 deletions
... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy | ... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy |
7 | 7 | ||
8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ | 8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ |
9 | 9 | ||
10 | spd_common_url = http://10.146.9.50:8080/medicinal-web/a/ | ||
11 | |||
10 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ | 12 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ |
11 | 13 | ||
14 | platform_url= http://61.190.54.189:8001/huarun/ | ||
12 | #spd服务地址 | 15 | #spd服务地址 |
13 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ | 16 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ |
14 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | 17 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | ... | ... |
... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy | ... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy |
7 | 7 | ||
8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ | 8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ |
9 | 9 | ||
10 | spd_common_url = http://10.146.8.221:9002/medicinal-web/a/ | ||
11 | |||
10 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ | 12 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ |
11 | 13 | ||
14 | platform_url= http://61.190.54.189:8005/huarun/ | ||
12 | #spd服务地址 | 15 | #spd服务地址 |
13 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ | 16 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ |
14 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | 17 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | ... | ... |
... | @@ -10,6 +10,9 @@ public class PlatformConstant { | ... | @@ -10,6 +10,9 @@ public class PlatformConstant { |
10 | //SPD接口地址 | 10 | //SPD接口地址 |
11 | public static final String PlatForm_SPD_Url = Global.getConfig("spd_service_url"); | 11 | public static final String PlatForm_SPD_Url = Global.getConfig("spd_service_url"); |
12 | 12 | ||
13 | //SPD接口地址 | ||
14 | public static final String PlatForm_SPD_Common_Url = Global.getConfig("spd_common_url"); | ||
15 | |||
13 | //推送对账,发药,库存平台地址 | 16 | //推送对账,发药,库存平台地址 |
14 | public static final String PlatForm_URL = Global.getConfig("platform_url"); | 17 | public static final String PlatForm_URL = Global.getConfig("platform_url"); |
15 | 18 | ... | ... |
... | @@ -8,11 +8,14 @@ import javax.servlet.http.HttpServletRequest; | ... | @@ -8,11 +8,14 @@ import javax.servlet.http.HttpServletRequest; |
8 | 8 | ||
9 | import org.apache.http.HttpEntity; | 9 | import org.apache.http.HttpEntity; |
10 | import org.apache.http.HttpResponse; | 10 | import org.apache.http.HttpResponse; |
11 | import org.apache.http.NameValuePair; | ||
11 | import org.apache.http.client.HttpClient; | 12 | import org.apache.http.client.HttpClient; |
13 | import org.apache.http.client.entity.UrlEncodedFormEntity; | ||
12 | import org.apache.http.client.methods.HttpPost; | 14 | import org.apache.http.client.methods.HttpPost; |
13 | import org.apache.http.entity.mime.MultipartEntityBuilder; | 15 | import org.apache.http.entity.mime.MultipartEntityBuilder; |
14 | import org.apache.http.entity.mime.content.FileBody; | 16 | import org.apache.http.entity.mime.content.FileBody; |
15 | import org.apache.http.impl.client.HttpClients; | 17 | import org.apache.http.impl.client.HttpClients; |
18 | import org.apache.http.message.BasicNameValuePair; | ||
16 | import org.apache.http.util.EntityUtils; | 19 | import org.apache.http.util.EntityUtils; |
17 | import org.slf4j.Logger; | 20 | import org.slf4j.Logger; |
18 | import org.slf4j.LoggerFactory; | 21 | import org.slf4j.LoggerFactory; |
... | @@ -64,58 +67,59 @@ import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService; | ... | @@ -64,58 +67,59 @@ import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService; |
64 | @RequestMapping(value = "/Api") | 67 | @RequestMapping(value = "/Api") |
65 | public class SpdControlller { | 68 | public class SpdControlller { |
66 | 69 | ||
67 | /** | 70 | /** |
68 | * 日志对象 | 71 | * 日志对象 |
69 | */ | 72 | */ |
70 | protected Logger logger = LoggerFactory.getLogger(getClass()); | 73 | protected Logger logger = LoggerFactory.getLogger(getClass()); |
71 | 74 | ||
72 | @Autowired | 75 | @Autowired |
73 | private HisCtMedicineMaterialService ctMedicineMaterialService; | 76 | private HisCtMedicineMaterialService ctMedicineMaterialService; |
74 | 77 | ||
75 | @Autowired | 78 | @Autowired |
76 | private InterfaceLogService interfaceLogService; | 79 | private InterfaceLogService interfaceLogService; |
77 | 80 | ||
78 | @Autowired | 81 | @Autowired |
79 | private HisCtDeptService hisCtDeptService; | 82 | private HisCtDeptService hisCtDeptService; |
80 | 83 | ||
81 | @Autowired | 84 | @Autowired |
82 | private CTCareProvService cTCareProvService; | 85 | private CTCareProvService cTCareProvService; |
83 | 86 | ||
84 | @Autowired | 87 | @Autowired |
85 | private MedSupplyGoodsService supplyGoodsService; | 88 | private MedSupplyGoodsService supplyGoodsService; |
86 | 89 | ||
87 | @Autowired | 90 | @Autowired |
88 | private MedStockService stockService; | 91 | private MedStockService stockService; |
89 | 92 | ||
90 | @Autowired | 93 | @Autowired |
91 | private MedPlanService medPlanService; | 94 | private MedPlanService medPlanService; |
92 | 95 | ||
93 | @Autowired | 96 | @Autowired |
94 | private MedInStoreService medInStoreService; | 97 | private MedInStoreService medInStoreService; |
95 | 98 | ||
96 | @Autowired | 99 | @Autowired |
97 | private BillBackService backService; | 100 | private BillBackService backService; |
98 | 101 | ||
99 | @Autowired | 102 | @Autowired |
100 | private BillSettlementService billSettlementService; | 103 | private BillSettlementService billSettlementService; |
101 | 104 | ||
102 | @Autowired | 105 | @Autowired |
103 | private SupplierStockService supplierStockService; | 106 | private SupplierStockService supplierStockService; |
104 | 107 | ||
105 | @Autowired | 108 | @Autowired |
106 | private SuOutStoreService suOutStoreService; | 109 | private SuOutStoreService suOutStoreService; |
107 | 110 | ||
108 | @Autowired | 111 | @Autowired |
109 | private HisSpillsService hisSpillsService; | 112 | private HisSpillsService hisSpillsService; |
110 | 113 | ||
111 | @Autowired | 114 | @Autowired |
112 | private SuInvoiceBackService suInvoiceBackService; | 115 | private SuInvoiceBackService suInvoiceBackService; |
113 | 116 | ||
114 | 117 | private static HttpClient client; | |
115 | @RequestMapping(value="/setMFMedGoods") | 118 | |
116 | @ResponseBody | 119 | @RequestMapping(value="/setMFMedGoods") |
117 | public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){ | 120 | @ResponseBody |
118 | logger.debug("药品目录接口请求参数:{}",medgoodsList); | 121 | public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){ |
122 | logger.debug("药品目录接口请求参数:{}",medgoodsList); | ||
119 | String result = ""; | 123 | String result = ""; |
120 | String logId = IdUtil.uuid(); | 124 | String logId = IdUtil.uuid(); |
121 | String exception = ""; | 125 | String exception = ""; |
... | @@ -142,12 +146,12 @@ public class SpdControlller { | ... | @@ -142,12 +146,12 @@ public class SpdControlller { |
142 | } | 146 | } |
143 | interfaceLogService.setResultLog(response, logId, exception); | 147 | interfaceLogService.setResultLog(response, logId, exception); |
144 | return result; | 148 | return result; |
145 | } | 149 | } |
146 | 150 | ||
147 | @RequestMapping(value="/setHDept") | 151 | @RequestMapping(value="/setHDept") |
148 | @ResponseBody | 152 | @ResponseBody |
149 | public String setHDept(String id,HttpServletRequest request, @RequestBody String params){ | 153 | public String setHDept(String id,HttpServletRequest request, @RequestBody String params){ |
150 | logger.debug("医院科室资料接口请求参数:{}",params); | 154 | logger.debug("医院科室资料接口请求参数:{}",params); |
151 | String result = ""; | 155 | String result = ""; |
152 | String logId = IdUtil.uuid(); | 156 | String logId = IdUtil.uuid(); |
153 | String exception = ""; | 157 | String exception = ""; |
... | @@ -176,9 +180,9 @@ public class SpdControlller { | ... | @@ -176,9 +180,9 @@ public class SpdControlller { |
176 | } | 180 | } |
177 | interfaceLogService.setResultLog(response, logId, exception); | 181 | interfaceLogService.setResultLog(response, logId, exception); |
178 | return result; | 182 | return result; |
179 | } | 183 | } |
180 | 184 | ||
181 | /** | 185 | /** |
182 | * 医院人员资料接口 | 186 | * 医院人员资料接口 |
183 | * @param request | 187 | * @param request |
184 | * @param params | 188 | * @param params |
... | @@ -218,8 +222,8 @@ public class SpdControlller { | ... | @@ -218,8 +222,8 @@ public class SpdControlller { |
218 | interfaceLogService.setResultLog(response, logId, exception); | 222 | interfaceLogService.setResultLog(response, logId, exception); |
219 | return result; | 223 | return result; |
220 | } | 224 | } |
221 | 225 | ||
222 | 226 | ||
223 | /** | 227 | /** |
224 | * 医院采购目录接口 | 228 | * 医院采购目录接口 |
225 | * @param request | 229 | * @param request |
... | @@ -260,8 +264,8 @@ public class SpdControlller { | ... | @@ -260,8 +264,8 @@ public class SpdControlller { |
260 | interfaceLogService.setResultLog(response, logId, exception); | 264 | interfaceLogService.setResultLog(response, logId, exception); |
261 | return result; | 265 | return result; |
262 | } | 266 | } |
263 | 267 | ||
264 | 268 | ||
265 | /** | 269 | /** |
266 | * 医院库存接口 | 270 | * 医院库存接口 |
267 | * @param request | 271 | * @param request |
... | @@ -302,8 +306,8 @@ public class SpdControlller { | ... | @@ -302,8 +306,8 @@ public class SpdControlller { |
302 | interfaceLogService.setResultLog(response, logId, exception); | 306 | interfaceLogService.setResultLog(response, logId, exception); |
303 | return result; | 307 | return result; |
304 | } | 308 | } |
305 | 309 | ||
306 | 310 | ||
307 | /** | 311 | /** |
308 | * 医院补货计划接口 | 312 | * 医院补货计划接口 |
309 | * @param request | 313 | * @param request |
... | @@ -345,8 +349,8 @@ public class SpdControlller { | ... | @@ -345,8 +349,8 @@ public class SpdControlller { |
345 | interfaceLogService.setResultLog(response, logId, exception); | 349 | interfaceLogService.setResultLog(response, logId, exception); |
346 | return result; | 350 | return result; |
347 | } | 351 | } |
348 | 352 | ||
349 | 353 | ||
350 | /** | 354 | /** |
351 | * 医院退货接口 | 355 | * 医院退货接口 |
352 | * @param request | 356 | * @param request |
... | @@ -387,7 +391,7 @@ public class SpdControlller { | ... | @@ -387,7 +391,7 @@ public class SpdControlller { |
387 | interfaceLogService.setResultLog(response, logId, exception); | 391 | interfaceLogService.setResultLog(response, logId, exception); |
388 | return result; | 392 | return result; |
389 | } | 393 | } |
390 | 394 | ||
391 | /** | 395 | /** |
392 | * 结算单接口 | 396 | * 结算单接口 |
393 | * @param request | 397 | * @param request |
... | @@ -428,8 +432,8 @@ public class SpdControlller { | ... | @@ -428,8 +432,8 @@ public class SpdControlller { |
428 | interfaceLogService.setResultLog(response, logId, exception); | 432 | interfaceLogService.setResultLog(response, logId, exception); |
429 | return result; | 433 | return result; |
430 | } | 434 | } |
431 | 435 | ||
432 | 436 | ||
433 | /** | 437 | /** |
434 | * 供应商库存接口 | 438 | * 供应商库存接口 |
435 | * @param request | 439 | * @param request |
... | @@ -460,7 +464,7 @@ public class SpdControlller { | ... | @@ -460,7 +464,7 @@ public class SpdControlller { |
460 | result = JSON.toJSONString(response); | 464 | result = JSON.toJSONString(response); |
461 | try | 465 | try |
462 | { | 466 | { |
463 | //SPD服务请求: | 467 | //SPD服务请求: |
464 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params); | 468 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params); |
465 | response = JSONObject.parseObject(result,PlatFormResponse.class); | 469 | response = JSONObject.parseObject(result,PlatFormResponse.class); |
466 | response.setMsg("SPD:"+response.getMsg()); | 470 | response.setMsg("SPD:"+response.getMsg()); |
... | @@ -472,7 +476,7 @@ public class SpdControlller { | ... | @@ -472,7 +476,7 @@ public class SpdControlller { |
472 | response.setMsg("SPD:"+ex.getMessage()); | 476 | response.setMsg("SPD:"+ex.getMessage()); |
473 | result = JSON.toJSONString(response); | 477 | result = JSON.toJSONString(response); |
474 | } | 478 | } |
475 | 479 | ||
476 | } catch (Exception e) { | 480 | } catch (Exception e) { |
477 | logger.error("前置机:"+e.getMessage()); | 481 | logger.error("前置机:"+e.getMessage()); |
478 | exception = "前置机:"+e.getMessage(); | 482 | exception = "前置机:"+e.getMessage(); |
... | @@ -483,8 +487,8 @@ public class SpdControlller { | ... | @@ -483,8 +487,8 @@ public class SpdControlller { |
483 | interfaceLogService.setResultLog(response, logId, exception); | 487 | interfaceLogService.setResultLog(response, logId, exception); |
484 | return result; | 488 | return result; |
485 | } | 489 | } |
486 | 490 | ||
487 | 491 | ||
488 | /** | 492 | /** |
489 | * 供应商出库单接口 | 493 | * 供应商出库单接口 |
490 | * @param request | 494 | * @param request |
... | @@ -515,7 +519,7 @@ public class SpdControlller { | ... | @@ -515,7 +519,7 @@ public class SpdControlller { |
515 | result = JSON.toJSONString(response); | 519 | result = JSON.toJSONString(response); |
516 | try | 520 | try |
517 | { | 521 | { |
518 | //SPD服务请求: | 522 | //SPD服务请求: |
519 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params); | 523 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params); |
520 | response = JSONObject.parseObject(result,PlatFormResponse.class); | 524 | response = JSONObject.parseObject(result,PlatFormResponse.class); |
521 | response.setMsg("SPD:"+response.getMsg()); | 525 | response.setMsg("SPD:"+response.getMsg()); |
... | @@ -527,7 +531,7 @@ public class SpdControlller { | ... | @@ -527,7 +531,7 @@ public class SpdControlller { |
527 | response.setMsg("SPD:"+ex.getMessage()); | 531 | response.setMsg("SPD:"+ex.getMessage()); |
528 | result = JSON.toJSONString(response); | 532 | result = JSON.toJSONString(response); |
529 | } | 533 | } |
530 | 534 | ||
531 | } catch (Exception e) { | 535 | } catch (Exception e) { |
532 | logger.error("前置机:"+e.getMessage()); | 536 | logger.error("前置机:"+e.getMessage()); |
533 | exception = "前置机:"+e.getMessage(); | 537 | exception = "前置机:"+e.getMessage(); |
... | @@ -538,7 +542,7 @@ public class SpdControlller { | ... | @@ -538,7 +542,7 @@ public class SpdControlller { |
538 | interfaceLogService.setResultLog(response, logId, exception); | 542 | interfaceLogService.setResultLog(response, logId, exception); |
539 | return result; | 543 | return result; |
540 | } | 544 | } |
541 | 545 | ||
542 | /** | 546 | /** |
543 | * 医院盘点损溢接口 | 547 | * 医院盘点损溢接口 |
544 | * @param request | 548 | * @param request |
... | @@ -546,9 +550,9 @@ public class SpdControlller { | ... | @@ -546,9 +550,9 @@ public class SpdControlller { |
546 | * @return | 550 | * @return |
547 | */ | 551 | */ |
548 | @RequestMapping(value="/setTrDiff") | 552 | @RequestMapping(value="/setTrDiff") |
549 | @ResponseBody | 553 | @ResponseBody |
550 | public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){ | 554 | public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){ |
551 | logger.debug("医院盘点损溢接口请求参数:{}",params); | 555 | logger.debug("医院盘点损溢接口请求参数:{}",params); |
552 | String result = ""; | 556 | String result = ""; |
553 | String logId = IdUtil.uuid(); | 557 | String logId = IdUtil.uuid(); |
554 | String exception = ""; | 558 | String exception = ""; |
... | @@ -578,9 +582,9 @@ public class SpdControlller { | ... | @@ -578,9 +582,9 @@ public class SpdControlller { |
578 | } | 582 | } |
579 | interfaceLogService.setResultLog(response, logId, exception); | 583 | interfaceLogService.setResultLog(response, logId, exception); |
580 | return result; | 584 | return result; |
581 | } | 585 | } |
582 | 586 | ||
583 | 587 | ||
584 | /** | 588 | /** |
585 | * 供应商发票回传接口 | 589 | * 供应商发票回传接口 |
586 | * @param request | 590 | * @param request |
... | @@ -608,10 +612,10 @@ public class SpdControlller { | ... | @@ -608,10 +612,10 @@ public class SpdControlller { |
608 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); | 612 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); |
609 | response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent); | 613 | response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent); |
610 | } | 614 | } |
611 | result = JSON.toJSONString(response); | 615 | result = JSON.toJSONString(response); |
612 | try | 616 | try |
613 | { | 617 | { |
614 | //SPD服务请求: | 618 | //SPD服务请求: |
615 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params); | 619 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params); |
616 | response = JSONObject.parseObject(result,PlatFormResponse.class); | 620 | response = JSONObject.parseObject(result,PlatFormResponse.class); |
617 | response.setMsg("SPD:"+response.getMsg()); | 621 | response.setMsg("SPD:"+response.getMsg()); |
... | @@ -623,7 +627,7 @@ public class SpdControlller { | ... | @@ -623,7 +627,7 @@ public class SpdControlller { |
623 | response.setMsg("SPD:"+ex.getMessage()); | 627 | response.setMsg("SPD:"+ex.getMessage()); |
624 | result = JSON.toJSONString(response); | 628 | result = JSON.toJSONString(response); |
625 | } | 629 | } |
626 | 630 | ||
627 | } catch (Exception e) { | 631 | } catch (Exception e) { |
628 | logger.error("前置机:"+e.getMessage()); | 632 | logger.error("前置机:"+e.getMessage()); |
629 | exception = "前置机:"+e.getMessage(); | 633 | exception = "前置机:"+e.getMessage(); |
... | @@ -781,7 +785,7 @@ public class SpdControlller { | ... | @@ -781,7 +785,7 @@ public class SpdControlller { |
781 | interfaceLogService.setResultLog(response, logId, exception); | 785 | interfaceLogService.setResultLog(response, logId, exception); |
782 | return result; | 786 | return result; |
783 | } | 787 | } |
784 | 788 | ||
785 | /** | 789 | /** |
786 | * 推送证照数据到平台 | 790 | * 推送证照数据到平台 |
787 | * @param params | 791 | * @param params |
... | @@ -815,8 +819,8 @@ public class SpdControlller { | ... | @@ -815,8 +819,8 @@ public class SpdControlller { |
815 | interfaceLogService.setResultLog(response, logId, exception); | 819 | interfaceLogService.setResultLog(response, logId, exception); |
816 | return result; | 820 | return result; |
817 | } | 821 | } |
818 | 822 | ||
819 | 823 | ||
820 | /** | 824 | /** |
821 | * 推送证照图片数据到平台 | 825 | * 推送证照图片数据到平台 |
822 | * @param params | 826 | * @param params |
... | @@ -831,29 +835,29 @@ public class SpdControlller { | ... | @@ -831,29 +835,29 @@ public class SpdControlller { |
831 | PlatFormResponse response = new PlatFormResponse(); | 835 | PlatFormResponse response = new PlatFormResponse(); |
832 | interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId); | 836 | interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId); |
833 | try { | 837 | try { |
834 | if (file!=null) { | 838 | if (file!=null) { |
835 | HttpClient client = HttpClients.createDefault(); | 839 | HttpClient client = HttpClients.createDefault(); |
836 | HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");// | 840 | HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");// |
837 | File newfile = new File("/usr/local/img/"+file.getOriginalFilename()); | 841 | File newfile = new File("/usr/local/img/"+file.getOriginalFilename()); |
838 | file.transferTo(newfile); | 842 | file.transferTo(newfile); |
839 | FileBody bin = new FileBody(newfile); | 843 | FileBody bin = new FileBody(newfile); |
840 | HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build(); | 844 | HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build(); |
841 | post.setEntity(reqEntity); | 845 | post.setEntity(reqEntity); |
842 | HttpResponse htppresponse = client.execute(post); | 846 | HttpResponse htppresponse = client.execute(post); |
843 | HttpEntity resEntity = htppresponse.getEntity(); | 847 | HttpEntity resEntity = htppresponse.getEntity(); |
844 | result = EntityUtils.toString(resEntity, "UTF-8"); | 848 | result = EntityUtils.toString(resEntity, "UTF-8"); |
845 | JSONObject jsonObject = JSONObject.parseObject(result); | 849 | JSONObject jsonObject = JSONObject.parseObject(result); |
846 | if(!"Y".equals(jsonObject.getString("FLAG"))){ | 850 | if(!"Y".equals(jsonObject.getString("FLAG"))){ |
847 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); | 851 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); |
848 | }else { | 852 | }else { |
849 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode); | 853 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode); |
850 | } | 854 | } |
851 | response.setMsg(jsonObject.toJSONString()); | 855 | response.setMsg(jsonObject.toJSONString()); |
852 | if (newfile.exists()) { | 856 | if (newfile.exists()) { |
853 | newfile.delete(); | 857 | newfile.delete(); |
854 | } | 858 | } |
855 | } | 859 | } |
856 | 860 | ||
857 | } catch (Exception e) { | 861 | } catch (Exception e) { |
858 | logger.error(e.getMessage()); | 862 | logger.error(e.getMessage()); |
859 | exception = e.getMessage(); | 863 | exception = e.getMessage(); |
... | @@ -864,66 +868,136 @@ public class SpdControlller { | ... | @@ -864,66 +868,136 @@ public class SpdControlller { |
864 | interfaceLogService.setResultLog(response, logId, exception); | 868 | interfaceLogService.setResultLog(response, logId, exception); |
865 | return result; | 869 | return result; |
866 | } | 870 | } |
867 | 871 | ||
868 | 872 | ||
869 | 873 | ||
870 | @RequestMapping(value="/CancelMedPlan") | 874 | @RequestMapping(value="/CancelMedPlan") |
871 | @ResponseBody | 875 | @ResponseBody |
872 | public String CancelMedPlan(HttpServletRequest request, @RequestBody String param){ | 876 | public String CancelMedPlan(HttpServletRequest request, @RequestBody String param){ |
873 | logger.debug("补货计划作废接口请求参数:{}",param); | 877 | logger.debug("补货计划作废接口请求参数:{}",param); |
874 | String result = ""; | 878 | String result = ""; |
875 | String logId = IdUtil.uuid(); | 879 | String logId = IdUtil.uuid(); |
876 | String exception = ""; | 880 | String exception = ""; |
877 | interfaceLogService.saveLog("CancelMedPlan:(补货计划作废接口)", param, logId); | 881 | interfaceLogService.saveLog("CancelMedPlan:(补货计划作废接口)", param, logId); |
878 | PlatFormResponse response = new PlatFormResponse(); | 882 | PlatFormResponse response = new PlatFormResponse(); |
879 | try { | 883 | try { |
880 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"CancelMedPlan", param); | 884 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"CancelMedPlan", param); |
881 | JSONObject jsonObject = JSONObject.parseObject(result); | 885 | JSONObject jsonObject = JSONObject.parseObject(result); |
882 | response.setFlag( jsonObject.getString("FLAG")); | 886 | response.setFlag( jsonObject.getString("FLAG")); |
883 | response.setMsg(jsonObject.getString("message")); | 887 | response.setMsg(jsonObject.getString("message")); |
884 | } catch (Exception e) { | 888 | } catch (Exception e) { |
885 | logger.error(e.getMessage()); | 889 | logger.error(e.getMessage()); |
886 | exception = e.getMessage(); | 890 | exception = e.getMessage(); |
887 | response.setFlag("E"); | 891 | response.setFlag("E"); |
888 | response.setMsg(e.getMessage()); | 892 | response.setMsg(e.getMessage()); |
889 | result = JSON.toJSONString(response); | 893 | result = JSON.toJSONString(response); |
890 | } | 894 | } |
891 | interfaceLogService.setResultLog(response, logId, exception); | 895 | interfaceLogService.setResultLog(response, logId, exception); |
892 | return result; | 896 | return result; |
893 | } | 897 | } |
894 | 898 | ||
895 | /** | 899 | /** |
896 | * 推送证照数据到平台 | 900 | * 推送证照数据到平台 |
897 | * @param params | 901 | * @param params |
898 | * @return | 902 | * @return |
899 | */ | 903 | */ |
900 | @RequestMapping("/doBarcode") | 904 | @RequestMapping("/doBarcode") |
901 | @ResponseBody | 905 | @ResponseBody |
902 | public String doBarcode(@RequestBody String params){ | 906 | public String doBarcode(@RequestBody String params){ |
903 | logger.debug("供应商出库条码回传:{}", params); | 907 | logger.debug("供应商出库条码回传:{}", params); |
904 | String result = ""; | 908 | String result = ""; |
905 | String logId = IdUtil.uuid(); | 909 | String logId = IdUtil.uuid(); |
906 | String exception = ""; | 910 | String exception = ""; |
907 | interfaceLogService.saveLog("doBarcode:(供应商出库条码回传)", params, logId); | 911 | interfaceLogService.saveLog("doBarcode:(供应商出库条码回传)", params, logId); |
908 | PlatFormResponse response = new PlatFormResponse(); | 912 | PlatFormResponse response = new PlatFormResponse(); |
909 | try { | 913 | try { |
910 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "doBarcode", params);// | 914 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "doBarcode", params);// |
911 | JSONObject jsonObject = JSONObject.parseObject(result); | 915 | JSONObject jsonObject = JSONObject.parseObject(result); |
912 | if(jsonObject.getString("FLAG") != null){ | 916 | if(jsonObject.getString("FLAG") != null){ |
913 | response.setFlag(jsonObject.getString("FLAG")); | 917 | response.setFlag(jsonObject.getString("FLAG")); |
914 | response.setMsg(jsonObject.getString("MSG")); | 918 | response.setMsg(jsonObject.getString("MSG")); |
915 | }else{ | 919 | }else{ |
916 | response.setFlag("Y"); | 920 | response.setFlag("Y"); |
917 | response.setMsg("doBarcode:(供应商出库条码回传)返回值格式未对应"); | 921 | response.setMsg("doBarcode:(供应商出库条码回传)返回值格式未对应"); |
918 | } | ||
919 | } catch (Exception e) { | ||
920 | logger.error(e.getMessage()); | ||
921 | exception = e.getMessage(); | ||
922 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); | ||
923 | response.setMsg("doBarcode:(供应商出库条码回传)给SPD平台错误:" + e.getMessage()); | ||
924 | result = JSON.toJSONString(response); | ||
925 | } | 922 | } |
926 | interfaceLogService.setResultLog(response, logId, exception); | 923 | } catch (Exception e) { |
927 | return result; | 924 | logger.error(e.getMessage()); |
925 | exception = e.getMessage(); | ||
926 | response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode); | ||
927 | response.setMsg("doBarcode:(供应商出库条码回传)给SPD平台错误:" + e.getMessage()); | ||
928 | result = JSON.toJSONString(response); | ||
929 | } | ||
930 | interfaceLogService.setResultLog(response, logId, exception); | ||
931 | return result; | ||
932 | } | ||
933 | |||
934 | |||
935 | /** | ||
936 | * 库存查询接口 | ||
937 | * @param params | ||
938 | * @return | ||
939 | */ | ||
940 | @RequestMapping("/querystock") | ||
941 | @ResponseBody | ||
942 | public String querystock(@RequestBody String params){ | ||
943 | logger.debug("查询库存:{}", params); | ||
944 | String result = ""; | ||
945 | try { | ||
946 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Common_Url+"StoreDetail/queryDrugByDeptAll", params); | ||
947 | } catch (Exception e) { | ||
948 | result = e.getMessage(); | ||
928 | } | 949 | } |
950 | return result; | ||
951 | } | ||
952 | |||
953 | /** | ||
954 | * 近效期查询接口 | ||
955 | * @param params | ||
956 | * @return | ||
957 | */ | ||
958 | @RequestMapping("/queryexpir") | ||
959 | @ResponseBody | ||
960 | public String queryexpir(@RequestBody String params){ | ||
961 | logger.debug("查询近效期:{}", params); | ||
962 | String result = ""; | ||
963 | try { | ||
964 | result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Common_Url+"ypjxq/statics/list", params); | ||
965 | } catch (Exception e) { | ||
966 | result = e.getMessage(); | ||
967 | } | ||
968 | return result; | ||
969 | } | ||
970 | |||
971 | /** | ||
972 | * 呆滞品查询接口 | ||
973 | * @param params | ||
974 | * @return | ||
975 | */ | ||
976 | @RequestMapping("/querydetained") | ||
977 | @ResponseBody | ||
978 | public String querydetained(@RequestBody String params){ | ||
979 | logger.debug("查询近效期:{}", params); | ||
980 | String result = ""; | ||
981 | if (client == null){ | ||
982 | client = HttpClients.createDefault(); | ||
983 | } | ||
984 | try { | ||
985 | JSONObject objec = JSON.parseObject(params); | ||
986 | List<NameValuePair> param = new ArrayList<NameValuePair>(); | ||
987 | param.add(new BasicNameValuePair("depetCode",objec.getString("depetCode"))); | ||
988 | param.add(new BasicNameValuePair("pageNo",objec.getString("pageNo"))); | ||
989 | param.add(new BasicNameValuePair("pageSize",objec.getString("pageSize"))); | ||
990 | param.add(new BasicNameValuePair("startTime",objec.getString("startTime"))); | ||
991 | param.add(new BasicNameValuePair("endTime",objec.getString("endTime"))); | ||
992 | HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Common_Url+"statics/delayStore/list"); | ||
993 | post.setHeader("Content-Type", "application/x-www-form-urlencoded"); | ||
994 | post.setEntity(new UrlEncodedFormEntity(param)); | ||
995 | HttpResponse reponse = client.execute(post); | ||
996 | HttpEntity entity = reponse.getEntity(); | ||
997 | result = EntityUtils.toString(entity, "UTF-8"); | ||
998 | } catch (Exception e) { | ||
999 | result = e.getMessage(); | ||
1000 | } | ||
1001 | return result; | ||
1002 | } | ||
929 | } | 1003 | } | ... | ... |
... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy | ... | @@ -7,8 +7,11 @@ jdbc.password=BOE190326jdfyy |
7 | 7 | ||
8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ | 8 | spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/ |
9 | 9 | ||
10 | spd_common_url = http://10.146.9.50:8080/medicinal-web/a/ | ||
11 | |||
10 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ | 12 | huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/ |
11 | 13 | ||
14 | platform_url= http://61.190.54.189:8001/huarun/ | ||
12 | #spd服务地址 | 15 | #spd服务地址 |
13 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ | 16 | spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/ |
14 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | 17 | spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login | ... | ... |
-
Please register or sign in to post a comment