|  | @ -1,9 +1,11 @@
 | 
	
		
			
				|  |  | package com.yihu.wlyy.service.third.jw;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.prescription.Prescription;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.prescription.PrescriptionDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.util.HttpClientUtil;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.apache.http.NameValuePair;
 | 
	
		
			
				|  |  | import org.apache.http.message.BasicNameValuePair;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
	
		
			
				|  | @ -170,22 +172,36 @@ public class JwPrescriptionService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 挂号作废处方接口
 | 
	
		
			
				|  |  |      * @param visitNo 挂号号
 | 
	
		
			
				|  |  |      * @param fadeDept 作废科室编码
 | 
	
		
			
				|  |  |      * @param fadeOperator 作废人员编码
 | 
	
		
			
				|  |  |      * @param prescriptionCode 续方号码
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String fadeRecipe(String prescriptionCode)throws Exception{
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
 | 
	
		
			
				|  |  |         String url = jwUrl + "/third/prescription/fadeRecipe";
 | 
	
		
			
				|  |  |         List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("visitNo", prescription.getVisitNo()));//挂号号
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("fadeDept", prescription.getJwDeptCode()));//作废科室编码
 | 
	
		
			
				|  |  |         params.add(new BasicNameValuePair("fadeOperator", prescription.getJwDoctorCode()));//作废人员编码
 | 
	
		
			
				|  |  |         String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(StringUtils.isNotBlank(prescription.getVisitNo())){
 | 
	
		
			
				|  |  |             String url = jwUrl + "/third/prescription/fadeRecipe";
 | 
	
		
			
				|  |  |             List<NameValuePair> params = new ArrayList<>();
 | 
	
		
			
				|  |  |             params.add(new BasicNameValuePair("visitNo", prescription.getVisitNo()));//挂号号
 | 
	
		
			
				|  |  |             params.add(new BasicNameValuePair("fadeDept", prescription.getJwDeptCode()));//作废科室编码
 | 
	
		
			
				|  |  |             params.add(new BasicNameValuePair("fadeOperator", prescription.getJwDoctorCode()));//作废人员编码
 | 
	
		
			
				|  |  |             String response = httpClientUtil.post(url, params, "UTF-8");
 | 
	
		
			
				|  |  |             if(StringUtils.isNotBlank(response)){
 | 
	
		
			
				|  |  |                 JSONObject reobj =  JSON.parseObject(response);
 | 
	
		
			
				|  |  |                 Integer status = reobj.getInteger("status");
 | 
	
		
			
				|  |  |                 String errmsg = reobj.getString("msg");
 | 
	
		
			
				|  |  |                 if(-1 == status){
 | 
	
		
			
				|  |  |                     throw new Exception("基卫接口(挂号作废)请求失败,"+errmsg);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 throw new Exception("基卫接口(挂号作废)请求失败,无数据返回!");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return response;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return "";
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 |