|  | @ -13,10 +13,11 @@ import com.yihu.wlyy.service.app.sign.FamilyContractService;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.app.sign.SignWebService;
 | 
	
		
			
				|  |  | 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.IdcardValidator;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.util.RSAUtils;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.web.BaseController;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.web.WeixinBaseController;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
	
		
			
				|  | @ -33,7 +34,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.ResponseBody;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.net.URLDecoder;
 | 
	
		
			
				|  |  | import java.util.Calendar;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
	
		
			
				|  | @ -44,7 +44,7 @@ import java.util.List;
 | 
	
		
			
				|  |  | @Controller
 | 
	
		
			
				|  |  | @RequestMapping(value = "/patient/family_contract", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
 | 
	
		
			
				|  |  | @Api(description = "患者端-家庭签约")
 | 
	
		
			
				|  |  | public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  | public class FamilyContractController extends WeixinBaseController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private FamilyContractService familyContractService;
 | 
	
	
		
			
				|  | @ -60,6 +60,8 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |     private SignWebService signWebService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private RSAUtils rsaUtils;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private CommonUtil CommonUtil;
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 得到患者的签约的医生的信息
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -423,7 +425,8 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |     public String sign(@RequestParam(required = false)String doctor,
 | 
	
		
			
				|  |  |                        @RequestParam(required = false)String patient,
 | 
	
		
			
				|  |  |                        @RequestParam(required = false)String countryCode,
 | 
	
		
			
				|  |  |                        @RequestParam(required = true)String medicareNumber) {
 | 
	
		
			
				|  |  |                        @RequestParam(required = true)String medicareNumber,
 | 
	
		
			
				|  |  |                        @RequestParam(required = false)String sevId) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(doctor)) {
 | 
	
		
			
				|  |  |                 return error(-1, "签约医生不能为空");
 | 
	
	
		
			
				|  | @ -435,7 +438,7 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             //==1.3.7===end===
 | 
	
		
			
				|  |  |             //1.4.2加入MedicareNumber字段入参
 | 
	
		
			
				|  |  |             int result = familyContractService.sign(doctor,patient,countryCode,medicareNumber);
 | 
	
		
			
				|  |  |             int result = familyContractService.sign(doctor,patient,countryCode,medicareNumber,sevId);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             if (result == -1) {
 | 
	
		
			
				|  |  |                 return error(-1, "用户信息查询失败");
 | 
	
	
		
			
				|  | @ -444,6 +447,18 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |             } else if (result == -3) {
 | 
	
		
			
				|  |  |                 return error(-1, "医生信息查询失败");
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 //1.4.9.1加入证件说明
 | 
	
		
			
				|  |  |                 // 图片消息
 | 
	
		
			
				|  |  |                 String content = fetchWxImages();
 | 
	
		
			
				|  |  |                 // 将临时图片拷贝到正式存储路径下
 | 
	
		
			
				|  |  |                 if (StringUtils.isNotEmpty(content)) {
 | 
	
		
			
				|  |  |                     content = CommonUtil.copyTempImage(content);
 | 
	
		
			
				|  |  |                     if (StringUtils.isNotEmpty(content)) {
 | 
	
		
			
				|  |  |                         familyContractService.saveCertificate(patient,content,sevId);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 return write(200, "签约申请成功");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
	
		
			
				|  | @ -466,7 +481,8 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |                             @RequestParam(required = false) String patient,
 | 
	
		
			
				|  |  |                             @RequestParam(required = false) String reason,
 | 
	
		
			
				|  |  |                             @RequestParam(required = false) String countryCode,
 | 
	
		
			
				|  |  |                             @RequestParam(required = true) String medicareNumber) {
 | 
	
		
			
				|  |  |                             @RequestParam(required = true) String medicareNumber,
 | 
	
		
			
				|  |  |                             @RequestParam(required = false)String sevId) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(doctor)) {
 | 
	
		
			
				|  |  |                 return error(-1, "签约医生不能为空");
 | 
	
	
		
			
				|  | @ -481,7 +497,7 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  | //                result = familyContractService.signRenewOverdue(doctor,healthDoctor,patient,reason,countryCode,medicareNumber);
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  |             int result = -1;
 | 
	
		
			
				|  |  |             result = familyContractService.signRenewOverdue(doctor,healthDoctor,patient,reason,countryCode,medicareNumber);
 | 
	
		
			
				|  |  |             result = familyContractService.signRenewOverdue(doctor,healthDoctor,patient,reason,countryCode,medicareNumber,sevId);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             if (result == -1) {
 | 
	
		
			
				|  |  |                 return error(-1, "用户信息查询失败");
 | 
	
	
		
			
				|  | @ -494,6 +510,17 @@ public class FamilyContractController extends BaseController {
 | 
	
		
			
				|  |  |             } else if (result == -5) {
 | 
	
		
			
				|  |  |                 return error(-1, "未找到有效团队记录");
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 //1.4.9.1加入证件说明
 | 
	
		
			
				|  |  |                 // 图片消息
 | 
	
		
			
				|  |  |                 String content = fetchWxImages();
 | 
	
		
			
				|  |  |                 // 将临时图片拷贝到正式存储路径下
 | 
	
		
			
				|  |  |                 if (StringUtils.isNotEmpty(content)) {
 | 
	
		
			
				|  |  |                     content = CommonUtil.copyTempImage(content);
 | 
	
		
			
				|  |  |                     if (StringUtils.isNotEmpty(content)) {
 | 
	
		
			
				|  |  |                         familyContractService.saveCertificate(patient,content,sevId);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 return write(200, "签约申请成功");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 |