浏览代码

Merge branch 'dev' of wujunjie/patient-co-management into dev

trick9191 7 年之前
父节点
当前提交
c25c0b7bd5

+ 62 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/charge/PatientPopups.java

@ -0,0 +1,62 @@
package com.yihu.wlyy.entity.charge;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 居民支付弹窗设置
 * @author Reece 2017.11.29
 */
@Entity
@Table(name = "wlyy_patient_popups")
public class PatientPopups extends IdEntity {
    private String patient; //支付主体居民code
    private int type;  //弹窗类型(0签约支付 1续方支付)
    private String status;  //弹出状态(0不弹出 1弹出)
    private Date createTime;
    private Date czrq;
    public String getPatient() {
        return patient;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/physicalExamination/PatientPhysicalExaminationService.java

@ -58,7 +58,7 @@ public class PatientPhysicalExaminationService extends BaseService {
        Date yesteryear = c.getTime();
        Date yesteryear = c.getTime();
        JSONObject json = new JSONObject();
        JSONObject json = new JSONObject();
        String first = "温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行免费的健康体检哟~";
        String first = "温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行65岁以上老年人的免费健康体检哟~(如今年已体检请忽略)";
        json.put("remark", "");
        json.put("remark", "");
        json.put("keyword1", "健康体检");
        json.put("keyword1", "健康体检");
        json.put("keyword2", format.format(new Date()));
        json.put("keyword2", format.format(new Date()));

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/charge/PopupsDao.java

@ -0,0 +1,19 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository.charge;
import com.yihu.wlyy.entity.charge.PatientPopups;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface PopupsDao extends PagingAndSortingRepository<PatientPopups, Long>, JpaSpecificationExecutor<PatientPopups> {
    //根据居民code和type查询弹窗设置
    @Query("select a from PatientPopups a where a.patient = ?1 and a.type = ?2 ")
    PatientPopups findByCodeAndType(String patient,int type);
}

+ 6 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/physicalExamination/PhysicalExaminationRemindService.java

@ -336,13 +336,13 @@ public class PhysicalExaminationRemindService extends BaseService {
        Boolean flag = true;
        Boolean flag = true;
        // 推送消息给微信端
        // 推送消息给微信端
        String url = "jkda/html/jiankangtijian.html?openid=" + patient.getOpenid() +"&toUser="+patient.getCode()+"&toName=" + patient.getName();
        String url = "jkda/html/jiankangtijian.html?openid=" + patient.getOpenid() +"&toUser="+patient.getCode()+"&toName=" + patient.getName();
        String first = "您的家庭医生" + doctName + "提醒,您可以到签约社区进行免费的健康体检啦~";
        String first = "您的家庭医生" + doctName + "提醒,您可以到签约社区进行65岁以上老年人的免费健康体检啦~";
        JSONObject json = new org.json.JSONObject();
        JSONObject json = new org.json.JSONObject();
        json.put("first",first);
        json.put("first",first);
        json.put("url",url);
        json.put("url",url);
        json.put("keyword1", "健康体检");
        json.put("keyword1", "健康体检");
        json.put("keyword2", format.format(new Date()));
        json.put("keyword2", format.format(new Date()));
        json.put("remark", "为了您和您的家庭医生了解您近期的健康状况,请及时到您签约的社区体检哟~");
        json.put("remark", "为了您和您的家庭医生了解您近期的健康状况,请及时到您签约的社区体检哟~(如已体检请忽略)");
        if (StringUtils.isNotBlank(patient.getOpenid())) {
        if (StringUtils.isNotBlank(patient.getOpenid())) {
            pushMsgTask.putWxMsg(accessToken, 11, patient.getOpenid(), patient.getName(), json);
            pushMsgTask.putWxMsg(accessToken, 11, patient.getOpenid(), patient.getName(), json);
            flag = false;
            flag = false;
@ -372,7 +372,7 @@ public class PhysicalExaminationRemindService extends BaseService {
        }
        }
//        微信发送失败发送短信
//        微信发送失败发送短信
        if (flag && StringUtils.isNotEmpty(mobile)) {
        if (flag && StringUtils.isNotEmpty(mobile)) {
            smsService.sendMsg(mobile, "厦门i健康家庭医生温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行免费的健康体检");
            smsService.sendMsg(mobile, "厦门i健康家庭医生温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行免费的健康体检(如已体检请忽略)");
        }
        }
        //保存发送提醒
        //保存发送提醒
@ -401,7 +401,7 @@ public class PhysicalExaminationRemindService extends BaseService {
        JSONObject json = new org.json.JSONObject();
        JSONObject json = new org.json.JSONObject();
        json.put("keyword1", "健康体检");
        json.put("keyword1", "健康体检");
        json.put("keyword2", format.format(new Date()));
        json.put("keyword2", format.format(new Date()));
        json.put("remark", "为了您和您的家庭医生了解您近期的健康状况,请及时到您签约的社区体检哟~");
        json.put("remark", "为了您和您的家庭医生了解您近期的健康状况,请及时到您签约的社区体检哟~(如已体检请忽略)");
        Calendar c = Calendar.getInstance();
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        c.setTime(new Date());
@ -410,7 +410,7 @@ public class PhysicalExaminationRemindService extends BaseService {
        List<Patient> patients = patientDao.findExaminationRemind(teamId, yesteryear);
        List<Patient> patients = patientDao.findExaminationRemind(teamId, yesteryear);
        for (Patient patient : patients) {
        for (Patient patient : patients) {
            String url = "jkda/html/jiankangtijian.html?openid=" + patient.getOpenid() +"&toUser="+patient.getCode()+"&toName=" + patient.getName();
            String url = "jkda/html/jiankangtijian.html?openid=" + patient.getOpenid() +"&toUser="+patient.getCode()+"&toName=" + patient.getName();
            String first = "您的家庭医生" + doctName + "提醒,您可以到签约社区进行免费的健康体检啦~";
            String first = "您的家庭医生" + doctName + "提醒,您可以到签约社区进行65岁以上老年人的免费健康体检啦~";
            json.put("first",first);
            json.put("first",first);
            json.put("url",url);
            json.put("url",url);
            String mobile = patient.getMobile();
            String mobile = patient.getMobile();
@ -447,7 +447,7 @@ public class PhysicalExaminationRemindService extends BaseService {
            }
            }
            //        微信发送失败发送短信
            //        微信发送失败发送短信
            if (flag && StringUtils.isNotEmpty(mobile)) {
            if (flag && StringUtils.isNotEmpty(mobile)) {
                smsService.sendMsg(mobile, "厦门i健康家庭医生温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行免费的健康体检");
                smsService.sendMsg(mobile, "厦门i健康家庭医生温馨提醒,您已经超过一年没有到社区进行健康体检啦,为了您和您的家庭医生了解您近期的健康状况,请及时到签约社区进行免费的健康体检(如已体检请忽略)");
            }
            }
            flag = true;
            flag = true;
            //保存发送提醒
            //保存发送提醒

+ 87 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.charge.PatientPopups;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.Message;
@ -16,6 +17,7 @@ import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.entity.ylz.PayConfigura;
import com.yihu.wlyy.entity.ylz.PayConfigura;
import com.yihu.wlyy.entity.zydict.ZyPushLog;
import com.yihu.wlyy.entity.zydict.ZyPushLog;
import com.yihu.wlyy.repository.charge.ChargeDao;
import com.yihu.wlyy.repository.charge.ChargeDao;
import com.yihu.wlyy.repository.charge.PopupsDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
@ -130,6 +132,8 @@ public class PatientPrescriptionPayService extends BaseService {
    private PushMsgTask pushMsgTask;
    private PushMsgTask pushMsgTask;
    @Autowired
    @Autowired
    private PrescriptionDispensaryCodeService codeService;
    private PrescriptionDispensaryCodeService codeService;
    @Autowired
    private PopupsDao popupsDao;
    /**
    /**
     * 长处方配送信息查询接口
     * 长处方配送信息查询接口
@ -759,17 +763,17 @@ public class PatientPrescriptionPayService extends BaseService {
                                Doctor doctor = doctorDao.findByCode(receiver);
                                Doctor doctor = doctorDao.findByCode(receiver);
                                String doctorOpenID = doctor.getOpenid();
                                String doctorOpenID = doctor.getOpenid();
                                if (StringUtils.isNotEmpty(doctorOpenID)) {
                                if (StringUtils.isNotEmpty(doctorOpenID)) {
                                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                        List<NameValuePair> sendParams = new ArrayList<>();
                                        sendParams.add(new BasicNameValuePair("type", "9"));
                                        sendParams.add(new BasicNameValuePair("openId", doctorOpenID));
                                        sendParams.add(new BasicNameValuePair("url", targetUrl));
                                        sendParams.add(new BasicNameValuePair("first", doctor.getName()+"医生您好。" + content + ",一个尽快分配。"));
                                        sendParams.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                                        String keywords = "分配配送员" + "," + doctor.getHospitalName() + "," +doctor.getName();
                                        sendParams.add(new BasicNameValuePair("keywords", keywords));
                                        httpClientUtil.post(url, sendParams, "UTF-8");
                                    String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                    List<NameValuePair> sendParams = new ArrayList<>();
                                    sendParams.add(new BasicNameValuePair("type", "9"));
                                    sendParams.add(new BasicNameValuePair("openId", doctorOpenID));
                                    sendParams.add(new BasicNameValuePair("url", targetUrl));
                                    sendParams.add(new BasicNameValuePair("first", doctor.getName() + "医生您好。" + content + ",一个尽快分配。"));
                                    sendParams.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                                    String keywords = "分配配送员" + "," + doctor.getHospitalName() + "," + doctor.getName();
                                    sendParams.add(new BasicNameValuePair("keywords", keywords));
                                    httpClientUtil.post(url, sendParams, "UTF-8");
                                }
                                }
                            } catch (Exception e) {
                            } catch (Exception e) {
                                e.printStackTrace();
                                e.printStackTrace();
@ -1052,7 +1056,7 @@ public class PatientPrescriptionPayService extends BaseService {
            String resName = "";
            String resName = "";
            String resSsc = "";
            String resSsc = "";
            String resIdNo = "";
            String resIdNo = "";
            if (!patient.equals(repUid)){
            if (!patient.equals(repUid)) {
                List<BindCard> bindCard = onePayService.bindCardList(openid);
                List<BindCard> bindCard = onePayService.bindCardList(openid);
                for (BindCard cards : bindCard) {
                for (BindCard cards : bindCard) {
                    String attachCardNo = cards.getAttachCardNo();
                    String attachCardNo = cards.getAttachCardNo();
@ -1067,7 +1071,7 @@ public class PatientPrescriptionPayService extends BaseService {
                    resultMap.put("status", "-1");
                    resultMap.put("status", "-1");
                    return resultMap;
                    return resultMap;
                }
                }
            }else {
            } else {
                logger.info("================================>" + "after get BindCard");
                logger.info("================================>" + "after get BindCard");
//            验证续方人与绑卡人(或代理人)是否一致
//            验证续方人与绑卡人(或代理人)是否一致
                if (!(payName.equals(name) && paySsc.equals(ssc) && payIdcard.equals(idNo))) {
                if (!(payName.equals(name) && paySsc.equals(ssc) && payIdcard.equals(idNo))) {
@ -1121,14 +1125,14 @@ public class PatientPrescriptionPayService extends BaseService {
            String visitNo = prescription.getVisitNo();//续方挂号号
            String visitNo = prescription.getVisitNo();//续方挂号号
            String recipeNo = prescription.getRecipeNo();//基位处方code(开方成功后返回)
            String recipeNo = prescription.getRecipeNo();//基位处方code(开方成功后返回)
            JSONObject jsonParams = null;
            JSONObject jsonParams = null;
            if (!patient.equals(repUid)){
            if (!patient.equals(repUid)) {
                logger.debug("======================> getPayInfo " + resSsc + visitNo);
                logger.debug("======================> getPayInfo " + resSsc + visitNo);
                if (visitNo == null || resSsc == null || recipeNo == null) {
                if (visitNo == null || resSsc == null || recipeNo == null) {
                    resultMap.put("status", "-2");
                    resultMap.put("status", "-2");
                    return resultMap;
                    return resultMap;
                }
                }
                jsonParams = prescriptionService.getPayInfo(resSsc, visitNo, recipeNo);
                jsonParams = prescriptionService.getPayInfo(resSsc, visitNo, recipeNo);
            }else{
            } else {
                logger.debug("======================> getPayInfo " + ssc + visitNo);
                logger.debug("======================> getPayInfo " + ssc + visitNo);
                if (visitNo == null || ssc == null || recipeNo == null) {
                if (visitNo == null || ssc == null || recipeNo == null) {
                    resultMap.put("status", "-2");
                    resultMap.put("status", "-2");
@ -1175,10 +1179,10 @@ public class PatientPrescriptionPayService extends BaseService {
                        principalCardNo = repSsc;
                        principalCardNo = repSsc;
                    }
                    }
                }
                }
                if (StringUtils.isNotEmpty(principalCardNo)){
                if (StringUtils.isNotEmpty(principalCardNo)) {
                    map.put("principalCardNo", principalCardNo); //实际签约卡号( 默认为绑卡主体卡号)
                    map.put("principalCardNo", principalCardNo); //实际签约卡号( 默认为绑卡主体卡号)
                    prescriptionPay.setPrincipalCardNo(principalCardNo);
                    prescriptionPay.setPrincipalCardNo(principalCardNo);
                }else {
                } else {
                    resultMap.put("status", "-4");
                    resultMap.put("status", "-4");
                    return resultMap;
                    return resultMap;
                }
                }
@ -1553,5 +1557,71 @@ public class PatientPrescriptionPayService extends BaseService {
        return result;
        return result;
    }
    }
    /**
     * 保存及修改居民支付弹窗设置
     *
     * @param type    弹窗类型
     * @param patient 支付主体code
     * @param status  弹窗状态
     * @return
     * @throws Exception
     */
    public void savePopups(int type, String patient, String status) throws Exception {
        try {
            Date today = new Date();
            PatientPopups popups = popupsDao.findByCodeAndType(patient, type);
            if (popups == null) {
                popups = new PatientPopups();
                popups.setPatient(patient);
                popups.setType(type);
                popups.setCreateTime(today);
            }
            popups.setStatus(status);
            popups.setCzrq(today);
            popupsDao.save(popups);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 查询居民支付弹窗设置
     *
     * @param type    弹窗类型
     * @param patient 支付主体code
     * @return
     * @throws Exception
     */
    public PatientPopups getPopups(int type, String patient) throws Exception {
        PatientPopups popups = null;
        try {
            popups = popupsDao.findByCodeAndType(patient, type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return popups;
    }
    /**
     * 查询居民支付弹窗设置
     *
     * @param user 需要缴费的患者code(共济支付为被代理人)
     * @return
     * @throws Exception
     */
    public String getPatientMobile(String user) throws Exception {
        String mobile = null;
        try {
            Patient patient = patientDao.findByCode(user);
            if (patient != null) {
                mobile = patient.getMobile();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mobile;
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java

@ -335,7 +335,7 @@ public class OnePayService {
                familyContent.put("moRegNo", moregNo);//医院签约号限长20  signFamily code
                familyContent.put("moRegNo", moregNo);//医院签约号限长20  signFamily code
                familyContent.put("moRegName", signFamily.getName()); //签约人姓名
                familyContent.put("moRegName", signFamily.getName()); //签约人姓名
                familyContent.put("moRegAddr", user.getAddress()); //签约人地址
                familyContent.put("moRegAddr", user.getAddress()); //签约人地址
                familyContent.put("moRegTelephone", signFamily.getMobile());//签约人联系电话
                familyContent.put("moRegTelephone", user.getMobile());//签约人联系电话
                familyContent.put("moRegOrgNo", sbCode); //签约机构 限长4
                familyContent.put("moRegOrgNo", sbCode); //签约机构 限长4
                familyContent.put("moRegDocNo", doctor.getIdcard());//签约医生编号 限长18 身份证号
                familyContent.put("moRegDocNo", doctor.getIdcard());//签约医生编号 限长18 身份证号
                familyContent.put("moRegDocName", signFamily.getSignDoctorName()); //签约医生姓名
                familyContent.put("moRegDocName", signFamily.getSignDoctorName()); //签约医生姓名

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -18,6 +18,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
@ -56,6 +58,8 @@ public class PatientInfoController extends BaseController {
    @Autowired
    @Autowired
    private SendMessageService sendMessageService;
    private SendMessageService sendMessageService;
    private static Logger logger = LoggerFactory.getLogger(PatientInfoController.class);
    /**
    /**
     * 获取患者基本信息
     * 获取患者基本信息
     *
     *
@ -416,7 +420,8 @@ public class PatientInfoController extends BaseController {
                Boolean mark = sendMessageService.sendTemplate(10,patient,url,first,remark,patientName,format.format(new Date()),keyword);
                Boolean mark = sendMessageService.sendTemplate(10,patient,url,first,remark,patientName,format.format(new Date()),keyword);
                if (!mark){
                if (!mark){
                    String msg = patientName+",您好!您的家庭医生已将您账号关联的手机号码变更:"+keyword+".您可以使用新手机号码登录i健康平台.";
                    String msg = patientName+",您好!您的家庭医生已将您账号关联的手机号码变更:"+keyword+".您可以使用新手机号码登录i健康平台.";
                    sendMessageService.sendMessage(newMobile,msg);
                    String response = sendMessageService.sendMessage(newMobile,msg);
                    logger.info("message response : "+response);
                }
                }
                return write(200, "手机号更新成功");
                return write(200, "手机号更新成功");
            } else {
            } else {

+ 88 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionPayController.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.web.patient.prescription;
package com.yihu.wlyy.web.patient.prescription;
import com.yihu.wlyy.entity.charge.PatientPopups;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdressService;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdressService;
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
@ -9,6 +11,7 @@ import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
@ -19,6 +22,8 @@ import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
import static com.yihu.wlyy.interceptors.GateWayInterceptor.status;
/**
/**
 * Created by Reece on 2017/7/28.
 * Created by Reece on 2017/7/28.
 */
 */
@ -215,24 +220,26 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            return error(-1, "发送失败!");
            return error(-1, "发送失败!");
        }
        }
    }
    }
//===========================v1.3.9======================================================================
    //===========================v1.3.9======================================================================
    @RequestMapping(value = "/getAddressList", method = RequestMethod.POST)
    @RequestMapping(value = "/getAddressList", method = RequestMethod.POST)
    @ApiOperation(value = "获取患者所有地址")
    @ApiOperation(value = "获取患者所有地址")
    public String getAdressList( @ApiParam(name = "patient", value = "居民code")
                                     @RequestParam(value = "patient", required = true)String patient){
    public String getAdressList(@ApiParam(name = "patient", value = "居民code")
                                @RequestParam(value = "patient", required = true) String patient) {
        try {
        try {
            return write(200, "获取成功!","data",prescriptionAdressService.getAdressList(patient));
            return write(200, "获取成功!", "data", prescriptionAdressService.getAdressList(patient));
        } catch (Exception e) {
        } catch (Exception e) {
            return error(-1, "获取失败!");
            return error(-1, "获取失败!");
        }
        }
    }
    }
    @RequestMapping(value = "/getDefAddress", method = RequestMethod.POST)
    @RequestMapping(value = "/getDefAddress", method = RequestMethod.POST)
    @ApiOperation(value = "获取患者默认地址")
    @ApiOperation(value = "获取患者默认地址")
    public String getDefAdress(String patient){
    public String getDefAdress(String patient) {
        try {
        try {
            return write(200, "获取成功!","data",prescriptionAdressService.getDefAdress(patient));
            return write(200, "获取成功!", "data", prescriptionAdressService.getDefAdress(patient));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "发送失败!");
            return error(-1, "发送失败!");
@ -242,7 +249,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    @RequestMapping(value = "/saveAddress", method = RequestMethod.POST)
    @RequestMapping(value = "/saveAddress", method = RequestMethod.POST)
    @ApiOperation(value = "保存地址")
    @ApiOperation(value = "保存地址")
    public String saveAdress(@ApiParam(name = "addressJson", value = "实体json串")
    public String saveAdress(@ApiParam(name = "addressJson", value = "实体json串")
                             @RequestParam(value = "addressJson", required = true)String addressJson){
                             @RequestParam(value = "addressJson", required = true) String addressJson) {
        try {
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.saveAdress(addressJson));
            return write(200, "获取成功!", "data", prescriptionAdressService.saveAdress(addressJson));
@ -251,10 +258,11 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            return error(-1, "获取失败!");
            return error(-1, "获取失败!");
        }
        }
    }
    }
    @RequestMapping(value = "/delAddress", method = RequestMethod.POST)
    @RequestMapping(value = "/delAddress", method = RequestMethod.POST)
    @ApiOperation(value = "删除地址")
    @ApiOperation(value = "删除地址")
    public String delAdress(@ApiParam(name = "id", value = "主键")
    public String delAdress(@ApiParam(name = "id", value = "主键")
                                @RequestParam(value = "id", required = true)Long id){
                            @RequestParam(value = "id", required = true) Long id) {
        try {
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.delAdress(id));
            return write(200, "获取成功!", "data", prescriptionAdressService.delAdress(id));
@ -266,7 +274,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    @RequestMapping(value = "/getProvince", method = RequestMethod.POST)
    @RequestMapping(value = "/getProvince", method = RequestMethod.POST)
    @ApiOperation(value = "获取省会")
    @ApiOperation(value = "获取省会")
    public String getProvince(){
    public String getProvince() {
        try {
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getProvince());
            return write(200, "获取成功!", "data", prescriptionAdressService.getProvince());
@ -279,7 +287,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    @RequestMapping(value = "/getCityByProvince", method = RequestMethod.POST)
    @RequestMapping(value = "/getCityByProvince", method = RequestMethod.POST)
    @ApiOperation(value = "根据省会获取城市")
    @ApiOperation(value = "根据省会获取城市")
    public String getCityByProvince(@ApiParam(name = "province", value = "省会code")
    public String getCityByProvince(@ApiParam(name = "province", value = "省会code")
                                        @RequestParam(value = "province", required = true)String province){
                                    @RequestParam(value = "province", required = true) String province) {
        try {
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getCityByProvince(province));
            return write(200, "获取成功!", "data", prescriptionAdressService.getCityByProvince(province));
@ -292,7 +300,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    @RequestMapping(value = "/getTowmByCity", method = RequestMethod.POST)
    @RequestMapping(value = "/getTowmByCity", method = RequestMethod.POST)
    @ApiOperation(value = "根据城市获取区")
    @ApiOperation(value = "根据城市获取区")
    public String getTowmByCity(@ApiParam(name = "city", value = "城市code")
    public String getTowmByCity(@ApiParam(name = "city", value = "城市code")
                                    @RequestParam(value = "city", required = true)String city){
                                @RequestParam(value = "city", required = true) String city) {
        try {
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getTowmByCity(city));
            return write(200, "获取成功!", "data", prescriptionAdressService.getTowmByCity(city));
@ -301,4 +309,73 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            return error(-1, "获取失败!");
            return error(-1, "获取失败!");
        }
        }
    }
    }
    /**
     * 保存居民支付弹窗设置
     *
     * @param type   弹窗类型(0:签约支付 1续方支付)
     * @param status 弹出状态(0不弹出 1弹出)
     * @return
     */
    @RequestMapping(value = "/savePopups", method = RequestMethod.POST)
    @ApiOperation(value = "保存居民支付弹窗设置")
    public String savePopups(@ApiParam(name = "type", value = "弹窗类型")
                             @RequestParam(value = "type", required = true) int type,
                             @ApiParam(name = "status", value = "弹窗状态")
                             @RequestParam(value = "status", required = true) String status) {
        try {
            payService.savePopups(type, getUID(), status);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "保存失败!");
        }
    }
    /**
     * 查询居民支付弹窗设置
     *
     * @param type 弹窗类型(0:签约支付 1续方支付)
     * @return
     */
    @RequestMapping(value = "/getPopups", method = RequestMethod.GET)
    @ApiOperation(value = "查询居民支付弹窗设置")
    public String getPopups(@ApiParam(name = "type", value = "弹窗类型")
                            @RequestParam(value = "type", required = true) int type) {
        try {
            String status = "1";
            PatientPopups popups = payService.getPopups(type, getUID());
            if (popups != null) {
                status = popups.getStatus();
                return write(200, "查询成功!", "data", status);
            } else {
                return write(200, "该居民未设置弹窗!", "data", status);
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    /**
     * 查询缴费居民手机绑定情况
     *
     * @return
     */
    @RequestMapping(value = "/getPatientMobile", method = RequestMethod.GET)
    @ApiOperation(value = "查询缴费居民手机绑定情况")
    public String getPatientMobile() {
        try {
            String status = "1";
            String mobile = payService.getPatientMobile(getRepUID());
            if (StringUtils.isEmpty(mobile)){
                status = "0";
            }
            return write(200, "查询成功!", "data", status);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}
}