Browse Source

代码优化

chenweida 7 years ago
parent
commit
8aa5f9bd0a

+ 12 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/medical/DoctorMedicalRecordController.java

@ -5,6 +5,7 @@ import java.util.List;
import com.yihu.wlyy.aop.ObserverRequired;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -54,6 +55,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "part_list")
	@ResponseBody
	@ApiOperation("查询患者片段记录列表")
	public String partList(String patient, long id, int pagesize) {
		try {
			JSONArray array = new JSONArray();
@ -98,6 +100,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "record_list")
	@ResponseBody
	@ApiOperation("查询患者病历记录列表")
	public String recordList(String patient, long id, int pagesize) {
		try {
			JSONArray array = new JSONArray();
@ -133,6 +136,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "info")
	@ResponseBody
	@ApiOperation("查询病历记录明细")
	public String info(String record) {
		try {
			JSONObject jsonObject = new JSONObject();
@ -175,6 +179,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "consult_list")
	@ResponseBody
	@ApiOperation("患者咨询记录查询接口")
	public String consultList(String patient, long id, int pagesize) {
		try {
			JSONArray array = new JSONArray();
@ -211,6 +216,7 @@ public class DoctorMedicalRecordController extends BaseController {
	 */
	@RequestMapping(value = "parts")
	@ResponseBody
	@ApiOperation("查询医生片段信息")
	public String parts() {
		try {
			return write(200, "查询成功!", "list", medicalRecordsService.findAllDoctorParts(getUID()));
@ -228,6 +234,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "add_part")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("添加医生片段信息")
	public String addPart(String name) {
		try {
			DoctorMedicalRecordsPart part = medicalRecordsService.addPart(getUID(), name);
@ -251,6 +258,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "add_part_item")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("添加片段内容")
	public String addPartItem(String part, String content) {
		try {
			DoctorMedicalRecordsPartItem item = medicalRecordsService.addPartItem(getUID(), part, content);
@ -275,6 +283,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "add_part_record")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("添加患者片段记录")
	public String addPartRecord(String patient, String part, String content) {
		try {
			medicalRecordsService.addPartRecord(getUID(), patient, part, content);
@ -294,6 +303,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "modify_part_record")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("患者片段记录修改接口")
	public String modifyPartRecord(String record, String content) {
		try {
			// 查询片段记录内容
@ -321,6 +331,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "del_part_record")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("删除指定的患者片段记录")
	public String delPartRecord(String record) {
		try {
			PatientMedicalRecords temp = medicalRecordsService.findRecordByCode(record);
@ -352,6 +363,7 @@ public class DoctorMedicalRecordController extends BaseController {
	@RequestMapping(value = "add_record")
	@ResponseBody
	@ObserverRequired
	@ApiOperation("添加病历记录")
	public String addRecord(String patient, String consult, String title, String parts) {
		try {
			PatientMedicalRecords temp = medicalRecordsService.addRecord(getUID(), patient, consult, title, parts);

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -53,6 +53,7 @@ public class DoctorMessageController extends BaseController {
     */
    @RequestMapping(value = "amount")
    @ResponseBody
    @ApiOperation("医生消息总数统计接口")
    public String amount() {
        try {
            JSONObject json = messageService.findDoctorAllMessageAmount(getUID());
@ -76,6 +77,7 @@ public class DoctorMessageController extends BaseController {
     */
    @RequestMapping(value = "consults")
    @ResponseBody
    @ApiOperation("健康咨询消息列表查询接口")
    public String consultList(long id, int pagesize) {
        try {
            JSONArray array = new JSONArray();

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/DoctorPatientGroupController.java

@ -17,6 +17,7 @@ import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -70,6 +71,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "amount")
    @ResponseBody
    @ApiOperation("医生管理的患者总数")
    public String amount() {
        try {
            // 获取医生下的患者
@ -88,6 +90,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "patients")
    @ResponseBody
    @ApiOperation("我的患者查询接口")
    public String patients() {
        try {
            System.out.println("patients_start:" + new Date());
@ -211,6 +214,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "/patients_disease")
    @ResponseBody
    @ApiOperation("查询患者按疾病分组")
    public String patientsByDisease(String type, String patientName) {
        try {
            System.out.println("patients_disease_start:" + new Date());
@ -445,6 +449,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "/patientcount")
    @ResponseBody
    @ApiOperation("查询医生患者分组统计")
    public String groupPatientsCount() {
        try {
            JSONArray array = new JSONArray();
@ -469,6 +474,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "patientsByName")
    @ResponseBody
    @ApiOperation("根据患者姓名查询分组信息")
    public String patientsByName(String patientName) {
        try {
            System.out.println("patients_by_name_start:" + new Date());
@ -596,6 +602,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "patient")
    @ResponseBody
    @ApiOperation("患者信息查询接口")
    public String patient(String code, String jyStatus) {
        try {
            Patient temp = patientInfoService.findByCode(code);
@ -703,6 +710,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "groups")
    @ResponseBody
    @ApiOperation("患者分组查询接口")
    public String groups() {
        try {
            List<DoctorPatientGroup> groups = doctorPatientGroupService.groups(getUID());
@ -738,6 +746,7 @@ public class DoctorPatientGroupController extends BaseController {
    @RequestMapping(value = "add_group")
    @ResponseBody
    @ObserverRequired
    @ApiOperation("新建分组")
    public String addGroup(String name) {
        try {
            if (doctorPatientGroupService.addGroup(getUID(), name) != null) {
@ -760,6 +769,7 @@ public class DoctorPatientGroupController extends BaseController {
    @RequestMapping(value = "del_group")
    @ResponseBody
    @ObserverRequired
    @ApiOperation("删除组名")
    public String deleteGroup(String group) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -793,6 +803,7 @@ public class DoctorPatientGroupController extends BaseController {
    @RequestMapping(value = "modify_group")
    @ResponseBody
    @ObserverRequired
    @ApiOperation("修改组名")
    public String modifyGroup(String group, String name) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -828,6 +839,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "other_patients")
    @ResponseBody
    @ApiOperation("查询其他分组及患者")
    public String otherPatients(String group) {
        try {
            System.out.println("other_patient_start:" + new Date());
@ -944,6 +956,7 @@ public class DoctorPatientGroupController extends BaseController {
    @RequestMapping(value = "add_patients")
    @ResponseBody
    @ObserverRequired
    @ApiOperation("添加患者到指定分组")
    public String addGroupPatients(String group, String patients) {
        try {
            if (StringUtils.equals(group, "1") || StringUtils.equals(group, "2") || StringUtils.equals(group, "3")) {
@ -1002,6 +1015,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "/patientsWithFilter")
    @ResponseBody
    @ApiOperation("带参数的我的患者查询接口")
    public String getPatientsWithFilter(String patientName, String groups, String signType, String diseaseCondition, String orderDiseaseCondition) {
        try {
            System.out.println("patients_filter_start:" + new Date());
@ -1150,6 +1164,7 @@ public class DoctorPatientGroupController extends BaseController {
    @RequestMapping(value = "sign_doctors")
    @ResponseBody
    @ObserverRequired
    @ApiOperation("查询指定患者的家庭医生或三师医生列表")
    public String signDoctors(String patient) {
        try {
            JSONObject data = new JSONObject();
@ -1257,6 +1272,7 @@ public class DoctorPatientGroupController extends BaseController {
     */
    @RequestMapping(value = "checkMobile")
    @ResponseBody
    @ApiOperation("校验患者手机号是否呗注册")
    public String checkMobile(String mobile) {
        try {
            if (StringUtils.isEmpty(mobile)) {

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientDiseaseController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.patient.PatientDisease;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.jce.provider.symmetric.ARC4;
import org.json.JSONArray;
@ -41,6 +42,7 @@ public class PatientDiseaseController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/disease")
    @ApiOperation("查询患者的疾病")
    public String getPatientDisease(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
@ -64,6 +66,7 @@ public class PatientDiseaseController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/disease_sanshi")
    @ApiOperation("查询患者的三师疾病")
    public String getPatientSsDisease(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
@ -87,6 +90,7 @@ public class PatientDiseaseController extends BaseController {
     */
    @RequestMapping(value = "/disease_update")
    @ObserverRequired
    @ApiOperation("更新患者疾病")
    public String updatePatientDisease(String patient, String disease) {
        try {
            List<PatientDisease> diseases = patientDiseaseService.getPatientDiseaseSs(patient);

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -14,6 +14,7 @@ import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -49,6 +50,7 @@ public class PatientInfoController extends BaseController {
     */
    @RequestMapping(value = "info")
    @ResponseBody
    @ApiOperation("获取患者基本信息")
    public String getPatient(String patient) {
        try {
            // 获取医生下的患者

+ 8 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelController.java

@ -59,6 +59,7 @@ public class SignPatientLabelController extends BaseController {
     */
    @RequestMapping(value = "/add")
    @ObserverRequired
    @ApiOperation("添加标签")
    public String addPatientLabel(String labelName, Long teamCode) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -99,6 +100,7 @@ public class SignPatientLabelController extends BaseController {
     */
    @RequestMapping(value = "/add/teams")
    @ObserverRequired
    @ApiOperation("添加标签")
    public String addTeamsLabel(@RequestParam String labelName, @RequestParam String teamCode) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -134,6 +136,7 @@ public class SignPatientLabelController extends BaseController {
     */
    @RequestMapping(value = "/modify")
    @ObserverRequired
    @ApiOperation("更新标签")
    public String modifyPatientLabel(String labelCode, String newName) {
        try {
            if (StringUtils.isEmpty(labelCode)) {
@ -165,6 +168,7 @@ public class SignPatientLabelController extends BaseController {
     */
    @RequestMapping(value = "/delete")
    @ObserverRequired
    @ApiOperation("删除标签")
    public String deletePatientLabel(String labelCode) {
        try {
            if (StringUtils.isEmpty(labelCode)) {
@ -193,6 +197,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/all_labels")
    @ApiOperation("获取团队所有标签")
    public String getTeamAllLabels(Long teamCode) {
        try {
            if (teamCode == null || teamCode <= 0) {
@ -214,6 +219,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/labels_sort")
    @ApiOperation("自定义标签排序")
    public String labelSort(String labels) {
        try {
            if (StringUtils.isEmpty(labels)) {
@ -245,6 +251,7 @@ public class SignPatientLabelController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/labels_by_type")
    @ApiOperation("获取某个标签类型所有标签")
    public String getLabelsByTypeAndTeam(@RequestParam String labelType, @RequestParam(required = false) String teamCode) {
        try {
            if (StringUtils.isEmpty(labelType)) {
@ -263,6 +270,7 @@ public class SignPatientLabelController extends BaseController {
    }
    @RequestMapping(value = "/patient_teams")
    @ApiOperation("patient_teams")
    public String getTeamsLabelsByPatient(@RequestParam String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {

+ 15 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -119,6 +119,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient")
    @ApiOperation("查询居民信息")
    public String getPatient(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {
@ -142,6 +143,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patients_by_label")
    @ApiOperation("查询某个团队的某个标签下的患者信息")
    public String getPatientInfoByLabel(@RequestParam(required = false) String labelCode,
                                        @RequestParam(required = false) String labelType,
                                        @RequestParam(required = false)Long teamCode,
@ -183,6 +185,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patients_by_team")
    @ApiOperation("获取团队下的居民(当前医生下)")
    public String getPatientInfoByTeam(Long teamCode,
                                       @RequestParam(required = false) String exLabelCode,
                                       @RequestParam(required = false) String exLabelType,
@ -215,6 +218,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/team_patient")
    @ApiOperation("获取团队下的居民")
    public String getTeamPatient(@RequestParam(required = true) Long teamCode,
                                 @RequestParam(required = false) String labelCode,
                                 @RequestParam(required = false) String labelType,
@ -267,6 +271,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/label_patient_amount")
    @ApiOperation("查询某个团队的某个标签类型下各标签患者数")
    public String getPatientAmountByLabelType(@RequestParam(required = false)String labelType, @RequestParam(required = false) Long teamCode) {
        try {
            if (StringUtils.isEmpty(labelType)) {
@ -307,6 +312,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/label_team_amount")
    @ApiOperation("查询某个团队的某个标签类型下各标签患者数/分组统计")
    public String getPatientAmountByTeam(@RequestParam(required = false) String labelType, @RequestParam(required = true) Long teamCode) {
        try {
            if (StringUtils.isEmpty(labelType)) {
@ -341,6 +347,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/team_amount")
    @ApiOperation("查询某个团队的患者数/汇总")
    public String getAmountByTeam(@RequestParam(required = true) Long teamCode) {
        try {
            int result = labelInfoService.getPatientAmountByTeam(teamCode);
@ -366,6 +373,7 @@ public class SignPatientLabelInfoController extends BaseController {
     */
    @RequestMapping(value = "/patient_label_update")
    @ObserverRequired
    @ApiOperation("患者标签更新")
    public String setPatientLabels(@RequestParam(required = false) String patient,
                                   @RequestParam(required = false) String health,
                                   @RequestParam(required = false) String disease,
@ -416,6 +424,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_label")
    @ApiOperation("查询某个患者的某类标签")
    public String getPatientLabelByLabelType(@RequestParam String patient,
                                             @RequestParam(required = false) String labelType,
                                             @RequestParam(required = false, defaultValue = "0") Long teamCode) {
@ -440,6 +449,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_search")
    @ApiOperation("查询某个患者的某类标签根据团队和当前医生")
    public String searchPatientByNameOrLabel(@RequestParam(required = true) String filter,
                                             @RequestParam(required = false) String labelCode,
                                             @RequestParam(required = false) String labelType,
@ -482,6 +492,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_search_Overdue")
    @ApiOperation("查询某个患者的某类标签根据团队和当前医生")
    public String searchPatientByNameOrLabelOverdue(@RequestParam(required = true) String filter,
                                             @RequestParam(required = false) String labelCode,
                                             @RequestParam(required = false) String labelType,
@ -546,6 +557,7 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_search_exitdoc")
    @ApiOperation("查询某个患者的某类标签(根据团队)")
    public String searchPatientByNameOrLabelExitDoc(@RequestParam(required = true) String filter,
                                                    @RequestParam(required = false) String labelCode,
                                                    @RequestParam(required = false) String labelType,
@ -636,6 +648,7 @@ public class SignPatientLabelInfoController extends BaseController {
     */
    @RequestMapping(value = "/patient_label_add")
    @ObserverRequired
    @ApiOperation("添加居民到某个标签")
    public String addPatientLabel(String patient, String labelCode, String labelType) {
        try {
            if (StringUtils.isEmpty(String.valueOf(patient))) {
@ -676,6 +689,7 @@ public class SignPatientLabelInfoController extends BaseController {
     */
    @RequestMapping(value = "/label_and_patients_add")
    @ObserverRequired
    @ApiOperation("新增标签并分配患者")
    public String addLabelAndPatient(String labelName, Long teamCode, @RequestParam(required = false) String patients) {
        try {
            if (StringUtils.isEmpty(labelName)) {
@ -712,6 +726,7 @@ public class SignPatientLabelInfoController extends BaseController {
     */
    @RequestMapping(value = "/patient_label_delete")
    @ObserverRequired
    @ApiOperation("删除居民某个标签")
    public String deletePatientLabel(String patient, String labelCode, String labelType) {
        try {
            if (StringUtils.isEmpty(String.valueOf(patient))) {

+ 18 - 86
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -66,6 +66,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "getSignMessage")
    @ResponseBody
    @ApiOperation("得到患者的签约的医生的信息")
    public String getSignDoctorMessage(String patientCode) {
        try {
@ -80,6 +81,7 @@ public class FamilyContractController extends BaseController {
    @RequestMapping(value = "getSignMessageOverdue")
    @ResponseBody
    @ApiOperation("")
    public String getSignDoctorMessageOverDue(String patientCode) {
        try {
@ -104,6 +106,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "hospitals")
    @ResponseBody
    @ApiOperation("社区医院列表查询接口")
    public String hospitals(
            int type,
            @RequestParam(required = false) String province,
@ -156,6 +159,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "doctors")
    @ResponseBody
    @ApiOperation("社区医院下医生列表查询接口")
    public String hospitalList(String hospital, long id, int pagesize) {
        try {
            JSONArray array = new JSONArray();
@ -201,6 +205,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "homepage")
    @ResponseBody
    @ApiOperation("医生主页信息查询接口")
    public String homepage(String doctor) {
        try {
            JSONObject json = familyContractService.findDoctorMainPage(getRepUID(), doctor);
@ -224,6 +229,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "status")
    @ResponseBody
    @ApiOperation("与指定医生的签约状态查询接口")
    public String signStatus(String doctor) {
        try {
            // -1未签约,0待签约,1已签约,2患者申请取消签约,3医生申请取消签约
@ -245,6 +251,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "getPatientSign")
    @ResponseBody
    @ApiOperation("得到患者的签约信息")
    public String getPatientSign(
            String homePageDoctorCode,//主页医生code
            String invitePatientCode //邀请患者
@ -310,6 +317,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "checkOpenid")
    @ResponseBody
    @ApiOperation("校验openid是否有签约信息")
    public String checkOpenid() {
        try {
            if (StringUtils.isEmpty(getOpenid())) {
@ -332,6 +340,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "check")
    @ResponseBody
    @ApiOperation("校验是否有签约信息")
    public String checkSign(String idcard) {
        try {
            if (StringUtils.isEmpty(idcard)) {
@ -370,92 +379,6 @@ public class FamilyContractController extends BaseController {
        }
    }
//    /**
//     * 发送签约申请
//     *
//     * @param province     省代码
//     * @param provinceName 省名称
//     * @param city         城市代码
//     * @param cityName     城市名称
//     * @param town         区县代码
//     * @param townName     区县名称
//     * @param address      详细地址
//     * @param name         患者姓名
//     * @param doctor       医生标识
//     * @param idcard       患者身份证号
//     * @param ssc          患者社保卡号
//     * @param mobile       患者手机号
//     * @param emerMobile   患者紧急联系人
//     */
//    @RequestMapping(value = "sign")
//    @ResponseBody
//    public String sign(
//            @RequestParam(required = false) String province,
//            @RequestParam(required = false) String provinceName,
//            @RequestParam(required = false) String city,
//            @RequestParam(required = false) String cityName,
//            @RequestParam(required = false) String town,
//            @RequestParam(required = false) String townName,
//            @RequestParam(required = false) String address,
//            String name,
//            String doctor,
//            String doctorName,
//            @RequestParam(required = false) String patientCode,
//            @RequestParam(required = false) String idcard,
//            String ssc,
//            @RequestParam(required = false) String mobile,
//            @RequestParam(required = false) String emerMobile) {
//        try {
//            // String openid = getOpenid();
//            // String uid = getUID();
//            // if (StringUtils.isEmpty(openid) && StringUtils.isEmpty(uid)) {
//            // return error(-1, "无效的用户请求!");
//            // }
//            // if (StringUtils.isEmpty(idcard)) {
//            // return error(-1, "身份证号不允许为空!");
//            // }
//            // // 解密身份证号
////			 idcard = RSAUtils.getInstance(familyContractService).decryptString(idcard);
////			 idcard = URLDecoder.decode(idcard, "UTF-8");
////			 idcard = StringUtils.reverse(idcard);
//            if (StringUtils.isEmpty(patientCode)) {
//                patientCode = getUID();
//            }
//            Patient patient = patientService.findByCode(patientCode);
//            int amount = familyContractService.hasSingStatus(patient.getIdcard());
//            if (amount > 0) {
//                return error(-1, "只可以签约一个家庭医生!");
//            }
//            JSONObject json = familyContractService.sign(patient.getProvince(), patient.getProvinceName(),
//                    patient.getCity(), patient.getCityName(), patient.getTown(), patient.getTownName(), patient.getAddress(),
//                    patient.getName(), doctor, patient.getOpenid(), patient.getCode(), patient.getIdcard(), patient.getSsc(), patient.getMobile(), emerMobile);
//            int res = json.getInt("res");
//            if (res == -2) {
//                return error(-1, "身份证号与当前登录用户的身份证号不匹配!");
//            } else if (res == -3) {
//                return error(-1, "身份证号已经注册!");
//            }
//            //更新患者信息
////			if (StringUtils.isEmpty(name) ) {
////				patient.setName(name);
////			}
////			if (StringUtils.isEmpty(idcard) ) {
////				patient.setIdcard(idcard);
////			}
//            if (StringUtils.isEmpty(ssc)) {
//                patient.setSsc(ssc);
//            }
////			if (StringUtils.isEmpty(mobile) ) {
////				patient.setMobile(mobile);
////			}
//            patientService.updatePatientInfo(patient);
//            return write(200, "签约申请已发送!", "data", json);
//        } catch (Exception e) {
//            error(e);
//            return error(-1, "签约申请发送失败!");
//        }
//    }
    /**
     * 签约申请
     *
@ -464,6 +387,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "sign")
    @ResponseBody
    @ApiOperation("签约申请")
    public String sign(@RequestParam(required = false)String doctor,
                       @RequestParam(required = false)String patient,
                       @RequestParam(required = false)String countryCode) {
@ -497,6 +421,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "signRenew")
    @ResponseBody
    @ApiOperation("续签申请")
    public String signRenew(@RequestParam(required = true) String doctor,
                            @RequestParam(required = false) String healthDoctor,
                            @RequestParam(required = false) String patient,
@ -544,6 +469,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "unsign")
    @ResponseBody
    @ApiOperation("取消签约申请")
    public String unsign(
            String doctor,
            @RequestParam(required = false) String patientCode
@ -573,6 +499,7 @@ public class FamilyContractController extends BaseController {
    @RequestMapping(value = "unsignRenew")
    @ResponseBody
    @ApiOperation("取消续签约申请")
    public String unsignRenew(
            String doctor,
            @RequestParam(required = false) String patientCode
@ -603,6 +530,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "surrender")
    @ResponseBody
    @ApiOperation("申请解约")
    public String surrender(String doctor, String doctorName, String reason,
                            @RequestParam(required = false) String patientCode) {
        try {
@ -628,6 +556,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "messages")
    @ResponseBody
    @ApiOperation("查询患者相关的签约消息")
    public String messages(long id, int pagesize) {
        try {
            JSONArray array = new JSONArray();
@ -679,6 +608,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "/doctor_sign_exist", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("查询居民是否与某个医生存在签约关系")
    public String isPatientAndDoctorExistSign(@RequestParam(required = true) String doctor) {
        try {
            if (StringUtils.isEmpty(doctor)) {
@ -701,6 +631,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "/doctor_can_sign", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("查询居民与某个医生是否可签约")
    public String isPatientAndDoctorCanSign(@RequestParam(required = true) String doctor) {
        try {
            if (StringUtils.isEmpty(doctor)) {
@ -722,6 +653,7 @@ public class FamilyContractController extends BaseController {
     */
    @RequestMapping(value = "/checkCanRenew", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("验证是否允许签约")
    public String checkCanRenew(@RequestParam(required = true) String patient){
        try {
            JSONObject result = patientService.checkCanSignRenew(patient);

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyWithoutFilterController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.patient.sign;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -28,6 +29,7 @@ public class FamilyWithoutFilterController extends BaseController {
     */
    @RequestMapping(value = "homepage")
    @ResponseBody
    @ApiOperation("医生主页信息查询接口—没有过滤器")
    public String homepage(String doctor) {
        try {
            JSONObject json = familyContractService.findDoctorMainPage(getRepUID(), doctor);

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

@ -34,6 +34,7 @@ public class PatientSignController extends BaseController {
     * @return 申请结果
     */
    @RequestMapping("/sign_doctor")
    @ApiOperation("个人医生签约")
    public String signDoctor(@RequestParam(value = "doctor") String doctor,
                             @RequestParam(value = "startTime", required = false) String startTime,
                             @RequestParam(value = "endTime", required = false) String endTime) {
@ -97,6 +98,7 @@ public class PatientSignController extends BaseController {
     * @return
     */
    @RequestMapping("/update_status")
    @ApiOperation("修改家庭签约状态")
    public String updateSignWeb(@RequestParam(value = "code") String code,
                                @RequestParam(value = "status") int status,
                                @RequestParam(value = "startDate", required = false) String startDate,
@ -190,6 +192,7 @@ public class PatientSignController extends BaseController {
     * @return
     */
    @RequestMapping("/sign_info")
    @ApiOperation("获取签约医生信息  状态未传查全部签约信息")
    public String getSignInfo(@RequestParam(required = false) String status, @RequestParam(defaultValue = "0") long id, int pageSize) {
        try {
            int iStatus = 0;
@ -314,6 +317,7 @@ public class PatientSignController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/signInfo",method = RequestMethod.GET)
    @ApiOperation("根据签约code查询签约详情")
    public String getSignInfo(@RequestParam String code) {
        try {
            JSONObject jsonArray = signWebService.getSignInfo(code);
@ -331,6 +335,7 @@ public class PatientSignController extends BaseController {
     */
    @RequestMapping(value = "/getRenewChangeReason", method = {RequestMethod.GET})
    @ResponseBody
    @ApiOperation("获取转签原因字段")
    public String getRenewChangeReason() {
        try {
            JSONArray rs = signWebService.getRenewChangeReason();
@ -346,6 +351,7 @@ public class PatientSignController extends BaseController {
     */
    @RequestMapping(value = "/getTownList", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("获取厦门市区")
    public String getTownList(){
        try {
            return write(200, "查询成功", "data", signWebService.getTownList());
@ -362,6 +368,7 @@ public class PatientSignController extends BaseController {
     */
    @RequestMapping(value = "/getCountryListByStreet", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("获取街道下居委会")
    public String getCountryListByStreet(@RequestParam(required = true)String street){
        try {
            return write(200, "查询成功", "data", signWebService.getCountryListByStreet(street));
@ -378,6 +385,7 @@ public class PatientSignController extends BaseController {
     */
    @RequestMapping(value = "/updatePatientCountry", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("获取居委会字段")
    public String setPatientCountry(@RequestParam(required = true)String countryCode){
        try {
            return write(200, "保存成功", "data", signWebService.setPatientCountry(countryCode,getRepUID()));
@ -394,6 +402,7 @@ public class PatientSignController extends BaseController {
     */
    @RequestMapping(value = "/getStreetListByTown", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ApiOperation("获取区域下街道")
    public String getStreetListByTown(@RequestParam(required = true)String town){
        try {
            return write(200, "查询成功", "data", signWebService.getStreetListByTown(town));