| 
					
				 | 
			
			
				@ -5,6 +5,7 @@ import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.message.Message; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.app.account.PatientInfoService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.json.JSONArray; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -23,11 +24,6 @@ import com.yihu.wlyy.entity.patient.SignFamily; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.app.sign.FamilyContractService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.DoctorService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.PatientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.CommonUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.IdcardInfoExtractor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.IdcardValidator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.util.RSAUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.web.WeixinBaseController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -277,6 +273,17 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int type, String group, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(required = false, defaultValue = "0") String expenses) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String checkUrl = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + patientIDcard, ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject checkJson = new JSONObject(jsonString); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (checkJson.getInt("status") == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject jsonData = checkJson.getJSONObject("data"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (jsonData.getString("status").equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return error(-1,"此身份证号已签约"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int res = familyContractService.handleSign(signType, getAccessToken(), healthDoctor, healthDoctorName, msgid, patientIDcard, type, disease, majorDoctor, majorDoctorName, group, expenses); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (res == -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return error(-1, "未知的处理类型!"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -459,7 +466,25 @@ public class DoctorFamilyContractController extends WeixinBaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return error(-1, "请输入身份证号!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject result = familyContractService.getSanshiSingInfoByPatientIdCard(idCard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String checkUrl = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idCard, ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject checkJson = new JSONObject(jsonString); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (checkJson.getInt("status") == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject jsonData = checkJson.getJSONObject("data"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (jsonData.getString("status").equals("1")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    result.put("signStatus", "2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    result.put("msg", "病人已申请过家庭签约!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return write(200, "查询成功!", "data", result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return error(-1,"签约验证异常!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result = familyContractService.getSanshiSingInfoByPatientIdCard(idCard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(200, "查询成功!", "data", result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 |