Pārlūkot izejas kodu

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 7 gadi atpakaļ
vecāks
revīzija
cfb6b6c591
15 mainītis faili ar 156 papildinājumiem un 182 dzēšanām
  1. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java
  2. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/PatientHealthIndexDao.java
  3. 4 4
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  4. 10 161
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/template/DoctorFeldsherTemplateService.java
  5. 6 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  6. 60 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorFeldsherTemplateController.java
  7. 45 5
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java
  8. 1 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml
  9. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/EncodingFilter.java
  10. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  11. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java
  12. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java
  13. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/RSAUtils.java
  14. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  15. 4 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -147,7 +147,7 @@ public class CustomerService{
			try {
				logger.info("====================================================================");
				String result = HttpClientUtil.post(messageApi+"/sendMobileMessage",par,"UTF-8");
				String result = HttpClientUtil.post(messageApi+"/sendMessage",par,"UTF-8");
				logger.info("发送短信消息返回结果:"+result);
				logger.info("======================================================================");
				JSONObject resultJson = new JSONObject(result);

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/PatientHealthIndexDao.java

@ -55,7 +55,7 @@ public interface PatientHealthIndexDao
	@Query("select a from PatientHealthIndex a where a.user = ?1 and a.type =?2  order by recordDate desc ")
    List<PatientHealthIndex> findByPatientAndType(String patientCode, int type, Pageable pageable);
	@Query("select count(a) from DevicePatientHealthIndex a where a.recordDate >= ?1 and a.recordDate <= ?2 and a.type in (1,2) and a.status = ?3 and a.del = '1' and user = ?4")
	@Query("select count(a) from PatientHealthIndex a where a.recordDate >= ?1 and a.recordDate <= ?2 and a.type in (1,2) and a.status = ?3 and a.del = '1' and user = ?4")
	int getCountByTimeAndStatus(Date start, Date end, int status, String patientCode);
	@Query(value="select * from device.wlyy_patient_health_index where user = ?1 and type = ?2 ORDER BY record_date desc limit 0 ,5",nativeQuery = true)

+ 4 - 4
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -427,7 +427,7 @@ public class DeviceService {
                //连续3次异常,修改用户为预警状态
                if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3) && 0 == patient.getStandardStatus()){
                if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3) && (patient.getStandardStatus() == null || 0 == patient.getStandardStatus())){
                    patient.setStandardStatus(1);
                }else{
                    Date end = new Date();
@ -442,15 +442,15 @@ public class DeviceService {
                //连续5次正常,修改用户为非预警状态
                if(patient.getDisease() != null){
                    if( 1 == patient.getDisease()){
                        if(0 == bloodPressureBbnormalCount && 1 == patient.getStandardStatus()){
                        if(0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                            patient.setStandardStatus(0);
                        }
                    }else if(2 == patient.getDisease()){
                        if(0 == bloodSuggurBbnormalCount && 1 == patient.getStandardStatus()){
                        if(0 == bloodSuggurBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                            patient.setStandardStatus(0);
                        }
                    }else if( 3 == patient.getDisease()){
                        if( (0 == bloodSuggurBbnormalCount|| 0 == bloodPressureBbnormalCount)&& 1 == patient.getStandardStatus()){
                        if( 0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                            patient.setStandardStatus(0);
                        }
                    }

+ 10 - 161
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/template/DoctorFeldsherTemplateService.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -42,6 +43,11 @@ public class DoctorFeldsherTemplateService extends BaseService {
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
    private ImUtill imUtill;
    @Autowired
    private WeiXinTempMsgSendUtils weiXinTempMsgSendUtils;
    @Value("${wechat.message.template_consult_notice}")
    private String templateId;
    @Value("${server.server_url}")
    private String server_url;
@ -91,159 +97,6 @@ public class DoctorFeldsherTemplateService extends BaseService {
        logger.info("sendJson: " + sendJson);
    }
    /**
     * 发送给医生的模板消息提醒
     *
     * @param patientCode 居民code
     * @param doctorCode  医生code
     * @throws Exception
     */
    public void sendDoctorTemplate(String patientCode, String doctorCode, int type) throws Exception {
        int num = 0;
        int num1 = 0;
        int num2 = 0;
        int num3 = 0;
        int num4 = 0;
        int num5 = 0;
        int num6 = 0;
        Date date = new Date();
        Date date1 = new Date();
        String content1 = "";
        String contetn2 = "";
        Patient people = patientDao.findByCode(patientCode);
        String patientOpenId = people.getOpenid();
        String patientName = people.getName();
        int patientSex = people.getSex();
        Doctor doctor = doctorDao.findByCode(doctorCode);
        String doctorName = doctor.getName();
        String doctorOpenId = doctor.getOpenid();
        //使用微信应用宝跳转APP的功能。点击后跳转APP消息页。
        String url = "";
        String first = "";
        String remark = "请进入手机APP查看,如尚未安装APP请点击详情下载安装";
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
        JSONObject sendJson = new JSONObject();
        switch (type) {
            case 1:
                first = doctorName + "医生您好,你有一条新的签约申请待处理";
                sendJson.put("keyword1", patientName);
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 2:
                first = doctorName + "医生,您的签约居民" + patientName + "有" + num + "条未读的体征异常消息";
                sendJson.put("keyword1", patientName);
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 3:
                first = doctorName + "医生您好。" + date + "新增1个签约居民待分配健管师,截至目前共有 " + num1 + " 人待处理";
                sendJson.put("keyword1", "分配健管师");
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 4:
                first = "您今日有" + num3 + "个随访计划待处理";
                sendJson.put("keyword1", patientName);
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 5:
                first = doctorName + "医生您好,有患者向您发起咨询";
                sendJson.put("keyword1", patientName);
                sendJson.put("keyword2", patientSex == 1 ? "男" : "女");
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 6:
                first = "居民" + patientName + "的健康咨询有新的回复";
                sendJson.put("keyword1", content1);
                sendJson.put("keyword2", contetn2);
                sendJson.put("keyword3", doctorName);
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 7:
                first = doctorName + "医生您好。您的签约居民" + patientName + "申请线上续方,请尽快审核";
                sendJson.put("keyword1", "续方审核");
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 8:
                first = doctorName + "医生您好。" + date1 +
                        "新增1个续方订单待分配配送员,目前共" + num4 +
                        "人待分配,一个尽快分配";
                sendJson.put("keyword1", "分配配送员");
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 9:
                first = doctorName + "医生您好。您有一个您有1个续方申请处方开立失败";
                sendJson.put("keyword1", doctorName);
                sendJson.put("keyword2", patientName);
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 10:
                first = doctorName + "医生您好。您有1个续方申请已在线下调整完成,请尽快进行CA认证";
                sendJson.put("keyword1", "续方审核CA认证");
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
            case 11:
                first = doctorName + "医生您好,你有一条新的续签申请待处理";
                sendJson.put("keyword1", patientName);
                sendJson.put("keyword2", dateFormat.format(new Date()));
                sendJson.put("first", first);
                sendJson.put("remark", remark);
                sendJson.put("url", url);//带参数的模板跳转链接
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 0, doctorOpenId, doctorName, sendJson);
                logger.info("sendJson: " + sendJson);
                break;
        }
    }
    /**
     * 拼装医生助手 医生类模板消息并发送
     *
@ -260,19 +113,15 @@ public class DoctorFeldsherTemplateService extends BaseService {
            String remark = "请进入手机APP查看,如尚未安装APP请点击详情下载安装";
            String url = server_url + "wx_doctor/html/home/html/jumpApp.html";
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
            JSONObject sendJson = new JSONObject();
            Doctor doctor = doctorDao.findByCode(doctorCode);
            String doctorName = doctor.getName();
            String doctorOpenId = doctor.getOpenid();
            String first = businessType;
            sendJson.put("keyword1", content);
            sendJson.put("keyword2", dateFormat.format(new Date()));
            sendJson.put("first", first);
            sendJson.put("remark", remark);
            sendJson.put("url", url);//带参数的模板跳转链接
            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 11, doctorOpenId, doctorName, sendJson);
            JSONObject sendJson = weiXinTempMsgSendUtils.packageTemplate(businessType, remark, content, dateFormat.format(new Date()));
            Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, doctorOpenId, url, sendJson);
            logger.info("send wechat message param : " + doctorOpenId+" =======> "+content);
            logger.info("send wechat message retuen : " + flag+" =======> "+flag);
            logger.info("sendJson: " + sendJson);
            return true;
        } catch (Exception e) {

+ 6 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -248,6 +248,12 @@ public class LoginController extends BaseController {
                        return error(-1, errorMessage);
                    }
                    loginLogService.saveLog(loginLog);
                    if(StringUtils.isNotBlank(openid)){
                        doctor.setOpenid(openid);
                        doctorService.save(doctor);
                    }
                    return write(200, "登录成功", "data", map);
                }
            }

+ 60 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorFeldsherTemplateController.java

@ -0,0 +1,60 @@
package com.yihu.wlyy.web.doctor.template;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.service.template.DoctorFeldsherTemplateService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * 医生健康指导模板
 * <p>
 * Created by Reece on 2017/9/14.
 */
@RestController
@RequestMapping(value = "/doctor/feldsher")
@Api(description = "医生健康指导模板")
public class DoctorFeldsherTemplateController extends BaseController {
    @Autowired
    private DoctorFeldsherTemplateService feldsherTemplateService;
    @Autowired
    DoctorGuidanceTempDao guidanceTempDao;
    /**
     * @param doctorCode   医生code
     * @param sessionId    会话Id
     * @param sessionType  会话类型
     * @param businessType 消息类型
     * @param from         发送者
     * @param content      消息内容
     * @return
     */
    @RequestMapping(value = "/sendDoctorTemplate", method = RequestMethod.GET)
    @ApiOperation(value = "医生助手给医生发送模板消息")
    public String sendDoctorTemplate(@RequestParam @ApiParam(value = "医生code") String doctorCode,
                                     @RequestParam @ApiParam(value = "会话Id", required = false) String sessionId,
                                     @RequestParam @ApiParam(value = "会话类型", required = false) String sessionType,
                                     @RequestParam @ApiParam(value = "消息类型") String businessType,
                                     @RequestParam @ApiParam(value = "发送者", required = false) String from,
                                     @RequestParam @ApiParam(value = "消息内容") String content) {
        try {
            Boolean flag = feldsherTemplateService.sendDoctorTemplate(doctorCode, sessionId, sessionType, businessType, from, content);
            if (flag){
                return write(200, "发送成功!");
            }else {
                return write( -1, "发送失败!");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return invalidUserException(e, -1, "发送失败!");
        }
    }
}

+ 45 - 5
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java

@ -48,7 +48,7 @@ public class GcMessageController {
    private SMSService smsService;
    @Autowired
    private DoctorDao doctorDao;
    @Value("${wechat.message.template_doctor_survey}")
    @Value("${wechat.message.template_consult_notice}")
    private String templateId;
    @Value("${server.server_url}")
    private String server_url;
@ -117,13 +117,13 @@ public class GcMessageController {
    /**
     * 客服系统发送消息接口
     *
     * @param openIds      微信openid
     * @param content     消息内容限制字数70
     * @param openIds 微信openid
     * @param content 消息内容限制字数70
     * @return
     */
    @RequestMapping(value = "/sendWechatMessage", method = RequestMethod.POST)
    @ApiOperation("客服系统发送微信模板消息接口")
    public ResultBatchModel sendMessage(
    public ResultBatchModel sendWechatMessage(
            @ApiParam(name = "openIds", value = "微信openid", required = true) @RequestParam(value = "openIds", required = true) String openIds,
            @ApiParam(name = "content", value = "消息内容", required = true) @RequestParam(value = "content", required = true) String content) {
        Integer success = 0;
@ -135,9 +135,12 @@ public class GcMessageController {
            for (String openId : codeArr) {
                try {
                    JSONObject sendJson = weiXinTempMsgSendUtils.packageTemplate("消息头", "备注", content, "2017年9月16日 18:00");
                    weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, sendJson);
                    Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, sendJson);
                    logger.info("send wechat message param : " + openId+" =======> "+content);
                    logger.info("send wechat message retuen : " + openId+" =======> "+flag);
                    success++;
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("openids " + openIds + " send Template error:" + e.getMessage());
                    error++;
                    errorLiust.add(openIds);
@ -150,4 +153,41 @@ public class GcMessageController {
        }
    }
    /**
     * 客服系统发送消息接口 居民没有有openID只发手机短信 有openID发微信模板消息、手机短信 没有IP次数限制
     *
     * @param mobiles 手机号.多个用逗号分隔
     * @param content
     * @return
     */
    @RequestMapping(value = "/sendMessage", method = RequestMethod.POST)
    @ApiOperation("客服系统发送短信接口")
    public ResultBatchModel sendMessage(
            @ApiParam(name = "mobiles", value = "手机号(批量逗号分割)", required = true) @RequestParam(value = "mobiles", required = true) String mobiles,
            @ApiParam(name = "content", value = "消息内容", required = true) @RequestParam(value = "content", required = true) String content) {
        Integer success = 0;
        Integer error = 0;
        List<String> errorLiust = new ArrayList<>();
        try {
            String[] codeArr = mobiles.split(",");
            for (String mobile : codeArr) {
                try {
                    JSONObject result = smsService.sendMsg(mobile, content);
                    logger.info("send mobile message param : "+mobile+" ====> "+content);
                    logger.info("send mobile message return : "+result);
                    success++;
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("mobile " + mobile + " send message error:" + e.getMessage());
                    error++;
                    errorLiust.add(mobile);
                }
            }
            return new ResultBatchModel(success, error, errorLiust);
        } catch (Exception e) {
            e.printStackTrace();
            return new ResultBatchModel(-1, "发送失败!", success, error, errorLiust);
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml

@ -83,7 +83,7 @@ images:
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
  check_upload: http://59.61.92.90:8087/wlyy_service

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/EncodingFilter.java

@ -38,6 +38,7 @@ public class EncodingFilter implements Filter {
            for (int i = 0; i < values.length; i++) {
                String value = values[i];
                newRequest.removeAttribute(key);
                System.out.println("key:"+key+"value:"+value+" reqURL:"+request.getRequestURI());
//                解决%、+后中文以英文编码传入URLDecoder异常
                value = CodeFomat.dateToChinese(value);
                newRequest.addParameter(key, URLDecoder.decode((value),"utf-8"));

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -891,7 +891,7 @@ public class PatientHealthIndexService extends BaseService {
        //连续3次异常,修改用户为预警状态
        if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3) && 0 == patient.getStandardStatus()){
        if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3) && (patient.getStandardStatus() == null || 0 == patient.getStandardStatus())){
            patient.setStandardStatus(1);
        }else{
            Date end = new Date();
@ -906,15 +906,15 @@ public class PatientHealthIndexService extends BaseService {
        //连续5次正常,修改用户为非预警状态
        if(patient.getDisease() != null){
            if( 1 == patient.getDisease()){
                if(0 == bloodPressureBbnormalCount && 1 == patient.getStandardStatus()){
                if(0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    patient.setStandardStatus(0);
                }
            }else if(2 == patient.getDisease()){
                if(0 == bloodSuggurBbnormalCount && 1 == patient.getStandardStatus()){
                if(0 == bloodSuggurBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    patient.setStandardStatus(0);
                }
            }else if( 3 == patient.getDisease()){
                if( (0 == bloodSuggurBbnormalCount|| 0 == bloodPressureBbnormalCount)&& 1 == patient.getStandardStatus()){
                if( 0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    patient.setStandardStatus(0);
                }
            }

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -82,7 +82,9 @@ public class DoctorSchemeService {
        sql = sql+ " JOIN wlyy_sign_family sf on sf.patient = p.code where sf.admin_team_code = "+teamCode;
        if(-1 != disease){
            sql = sql + " and p.disease ="+disease;
            sql = sql + " and (p.disease ="+disease+" or p.disease = 3) ";
        }else{
            sql = sql + " and p.disease >0 ";
        }
        if(StringUtils.isNotBlank(diseaseCondition) && !"-1".equals(diseaseCondition)){
@ -99,7 +101,7 @@ public class DoctorSchemeService {
        }
        sql = sql + " and (sf.doctor = "+doctorcode+" or sf.doctor_health ="+doctorcode+")";
        sql = sql + " and (sf.doctor = '"+doctorcode+"' or sf.doctor_health ='"+doctorcode+"')";
        sql = sql + " and p.status > 0 and p.disease > 0 ";

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -861,6 +861,11 @@ public class PatientService extends TokenService {
        //获取微信关注量分组数量
        fousGSql = fousGSql +"   AND p.openid IS NOT NULL AND p.openid <>'' " ;
        //判断是否是慢病管理
        if(isSlowDisease){
            fousGSql = fousGSql + " AND p.disease >0 AND p.status > 0 ";
        }
        if(StringUtils.isNotBlank(diseaseCondition)){
            fousGSql = fousGSql +"   AND p.disease_condition = "+diseaseCondition;
        }

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/RSAUtils.java

@ -376,4 +376,8 @@ public class RSAUtils {
            e.printStackTrace();
        }
    }
    public void setBaseService(BaseService baseService) {
        this.baseService = baseService;
    }
}

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -69,6 +69,8 @@ public class LoginController extends BaseController {
    private RoleService roleService;
    @Autowired
    private LoginLogService loginLogService;
    @Autowired
    private RSAUtils rsaUtils;
    /**
     * 公钥生成并返回接口
@ -79,8 +81,10 @@ public class LoginController extends BaseController {
    @ResponseBody
    public String publicKey() {
        try {
            String modulus = RSAUtils.getInstance(smsService).getModulus();
            String exponent = RSAUtils.getInstance(smsService).getExponent();
            //String modulus = RSAUtils.getInstance(smsService).getModulus();
            rsaUtils.setBaseService(smsService);
            String modulus = rsaUtils.getModulus();
            String exponent = rsaUtils.getExponent();
            if (StringUtils.isEmpty(modulus) || StringUtils.isEmpty(exponent)) {
                return error(-1, "公钥获取失败!");
            } else {

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -70,6 +70,8 @@ public class WechatController extends WeixinBaseController {
    private PushMsgTask pushMsgTask;
    @Autowired
    private WeiXinTagUtil weiXinTagUtil;
    @Autowired
    private RSAUtils rsaUtils;
    /**
@ -360,7 +362,8 @@ public class WechatController extends WeixinBaseController {
                }
                loginLog.setUserCode(p.getCode());
                //解密
                password = RSAUtils.getInstance(patientService).decryptString(password);
                rsaUtils.setBaseService(patientService);
                password = rsaUtils.decryptString(password);
                password = StringUtils.reverse(password);
                //生成MD5
                String loginPassword = MD5.GetMD5Code(password + p.getSalt());