Browse Source

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

yeshijie 7 năm trước cách đây
mục cha
commit
fb94766019

+ 50 - 7
common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java

@ -1,17 +1,14 @@
package com.yihu.wlyy.entity.job;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
/**
 * 计划任务
 */
@Entity
@Table(name = "wlyy_job_config")
@Table(name = "wlyy_job_config_new")
public class QuartzJobConfig implements java.io.Serializable {
	private String id;
@ -23,6 +20,11 @@ public class QuartzJobConfig implements java.io.Serializable {
	private String quartzCron;//quartz表达式
	private String status;//1 启动 0停止
	private String del;//是否删除 1正常 0删除
	private String sql;
	private String sqlCount;
	private String sqlDay;
	private String sqlYear;
	private String cacheKey;//缓存的key
	/** minimal constructor */
	public QuartzJobConfig() {
@ -31,7 +33,7 @@ public class QuartzJobConfig implements java.io.Serializable {
	/** full constructor */
	public QuartzJobConfig(String jobName, String jobInfo, String jobType,
						   String jobClass, String quartzCron, String status) {
                           String jobClass, String quartzCron, String status) {
		this.jobName = jobName;
		this.jobInfo = jobInfo;
		this.jobType = jobType;
@ -124,4 +126,45 @@ public class QuartzJobConfig implements java.io.Serializable {
	public void setDel(String del) {
		this.del = del;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	public String getSqlCount() {
		return sqlCount;
	}
	public void setSqlCount(String sqlCount) {
		this.sqlCount = sqlCount;
	}
	public String getSqlDay() {
		return sqlDay;
	}
	public void setSqlDay(String sqlDay) {
		this.sqlDay = sqlDay;
	}
	public String getSqlYear() {
		return sqlYear;
	}
	public void setSqlYear(String sqlYear) {
		this.sqlYear = sqlYear;
	}
	public String getCacheKey() {
		return cacheKey;
	}
	public void setCacheKey(String cacheKey) {
		this.cacheKey = cacheKey;
	}
}

+ 42 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/DataSourceConfig.java

@ -1,15 +1,22 @@
package com.yihu.wlyy.statistics.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import javax.sql.DataSource;
import java.sql.SQLException;
/**
 * Created by Administrator on 2016.10.20.
@ -50,6 +57,8 @@ public class DataSourceConfig {
    private Integer removeAbandonedTimeout;
    @Value("${spring.datasource.logAbandoned}")
    private Boolean logAbandoned;
    @Value("${spring.datasource.filters")
    private String filters;
@ -67,7 +76,7 @@ public class DataSourceConfig {
     */
    @Bean(name = "primaryReadWrite")
    @Primary//主库 默认不写名字用这个
    public DataSource primaryReadWriteDataSource() {
    public DataSource primaryReadWriteDataSource() throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadWriteUrl);
        datasource.setUsername(primaryReadWriteUsername);
@ -90,6 +99,7 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        return datasource;
    }
@ -103,7 +113,7 @@ public class DataSourceConfig {
    private String primaryReadPassword;
    @Bean(name = "primaryRead")
    public DataSource primaryReadDataSource() {
    public DataSource primaryReadDataSource() throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadUrl);
        datasource.setUsername(pprimaryReadUsername);
@ -126,6 +136,7 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        return datasource;
    }
@ -138,7 +149,7 @@ public class DataSourceConfig {
    @Value("${spring.datasource.im.password}")
    private String imPassword;
    @Bean(name = "imData")
    public DataSource imDataSource() {DruidDataSource datasource = new DruidDataSource();
    public DataSource imDataSource()throws SQLException  {DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(imUrl);
        datasource.setUsername(imUsername);
        datasource.setPassword(imPassword);
@ -160,9 +171,36 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        return datasource;
    }
    //------------------------------------druid 监控----------------------------------------------
    @Bean
    public ServletRegistrationBean statViewServlet(){
        //创建servlet注册实体
        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),"/druid/*");
        //设置ip白名单
        //servletRegistrationBean.addInitParameter("allow","127.0.0.1");
        //设置ip黑名单,如果allow与deny共同存在时,deny优先于allow
       // servletRegistrationBean.addInitParameter("deny","192.168.0.19");
        //设置控制台管理用户
        servletRegistrationBean.addInitParameter("loginUsername","jkzl");
        servletRegistrationBean.addInitParameter("loginPassword","jkzlehr");
        //是否可以重置数据
        servletRegistrationBean.addInitParameter("resetEnable","false");
        return servletRegistrationBean;
    }
    @Bean
    public FilterRegistrationBean statFilter(){
        //创建过滤器
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
        //设置过滤器过滤路径
        filterRegistrationBean.addUrlPatterns("/*");
        //忽略过滤的形式
        filterRegistrationBean.addInitParameter("exclusions","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
        return filterRegistrationBean;
    }
    //------------------------------------druid 监控----------------------------------------------
}

+ 2 - 0
patient-co/patient-co-statistics-es/src/main/resources/application.yml

@ -29,6 +29,8 @@ spring:
    removeAbandoned: false #超过时间限制是否回收
    removeAbandonedTimeout: 7200 #超时时间;单位为秒。180秒=3分钟
    logAbandoned: false #关闭abanded连接时输出错误日志
    #配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
    filters: stat, wall, log4j
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.

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

@ -8,6 +8,7 @@ import com.yihu.wlyy.entity.doctor.scheme.DoctorSchemeBloodPressure;
import com.yihu.wlyy.entity.doctor.scheme.DoctorSchemeBloodSugger;
import com.yihu.wlyy.entity.doctor.scheme.vo.DoctorSchemeBloodPressureVO;
import com.yihu.wlyy.entity.doctor.scheme.vo.DoctorSchemeBloodSuggerVO;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientSchemeList;
import com.yihu.wlyy.entity.patient.vo.PatientVO;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
@ -395,7 +396,7 @@ public class DoctorSchemeService {
//        List<Patient> patients = patientDao.findAllSignPatientTeamcode(teamCode,doctorcode);
        List<PatientVO> patients = new ArrayList<>();
        String patientsql = "select p.*,b.deviceType as deviceType,group_concat(sp.label) diseaseType from wlyy_patient p " +
        String patientsql = "select p.*,b.deviceType as deviceType,group_concat(sp.label) as disease from wlyy_patient p " +
                "  LEFT JOIN wlyy_sign_family s on s.patient = p.code " +
                "  RIGHT JOIN wlyy_sign_patient_label_info sp on sp.patient = p.code and sp.label_type = 3 and (sp.label = 1 or sp.label = 2) and sp.status =1" +
                "  LEFT JOIN (select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user) b on p.code = b.user " +

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -250,9 +250,9 @@ public class StatisticsESService {
        List<SaveModel> list = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            list = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, index, "1", lowLevel, level2_type);
            list = elasticsearchUtil.findListDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel, level2_type);
        } else {
            list = elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, index, "1", lowLevel);
            list = elasticsearchUtil.findListDateQuotaLevel0(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
        }
        if (org.springframework.util.StringUtils.isEmpty(year)) {
            year = Constant.getNowYear();

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PyhsicExamRemindController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.physicalExamination.PhysicalExamTeamRemindService;
import com.yihu.wlyy.service.app.physicalExamination.PhysicalExaminationRemindService;
import com.yihu.wlyy.web.BaseController;
@ -61,6 +62,7 @@ public class PyhsicExamRemindController extends BaseController{
    @RequestMapping(value = "singleRemindPhyExam", method = RequestMethod.POST)
    @ApiOperation("单个提醒居民")
    @ObserverRequired
    public String singleRemindPhyExam(@ApiParam(name = "patient", value = "居民code", defaultValue = "644")
                                      @RequestParam(value = "patient", required = true) String patient){
        try {
@ -77,6 +79,7 @@ public class PyhsicExamRemindController extends BaseController{
    @RequestMapping(value = "remindPhyExams", method = RequestMethod.POST)
    @ApiOperation("批量提醒居民")
    @ObserverRequired
    public String remindPhyExams(@ApiParam(name = "adminTeamCode", value = "行政团队编码", defaultValue = "644")
                                 @RequestParam(value = "adminTeamCode", required = true) Long adminTeamCode){
        try {

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

@ -845,7 +845,7 @@ public class SignPatientLabelInfoController extends BaseController {
            @ApiParam(name="startdate", value="体征数据开始时间yyyy-mm-dd hh:mm:ss") @RequestParam(value = "startdate",required = false,defaultValue = "2017-9-10 00:00:00")  String startdate,
            @ApiParam(name="enddate", value="体征数据结束时间yyyy-mm-dd hh:mm:ss") @RequestParam(value = "enddate",required = false,defaultValue = "2017-9-16 23:59:59")  String enddate){
        try {
            com.alibaba.fastjson.JSONObject result = doctorSchemeService.getSlowDiseaseTeaminfos(teamCode,getcolor,getstands,gethealthindex,startdate,enddate,getUID());
            com.alibaba.fastjson.JSONObject result = doctorSchemeService.getSlowDiseaseTeaminfos(teamCode,getcolor,getstands,gethealthindex,startdate,enddate,"zbqD201703150226");
            return write(200, "查询成功", "data", result);
        }catch (Exception e){
            //日志文件中记录异常信息

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -1421,6 +1421,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/is_patient_remind_expenses")
    @ResponseBody
    @ObserverRequired
    public String isPatientExpensesRemindToday(String patient) {
        try {
            if (StringUtils.isEmpty(patient)) {

+ 82 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -21,6 +21,7 @@ import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.template.DoctorFeldsherTemplateService;
import com.yihu.wlyy.task.DoctorStatisticsTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
@ -33,6 +34,8 @@ import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
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.Value;
import org.springframework.data.domain.Page;
@ -719,7 +722,7 @@ public class ConsultController extends WeixinBaseController {
     *
     * @param consult 咨询标识
     * @param content 追问内容
     * @param type    追问内容类型:1文字,2图片,3语音
     * @param type    追问内容类型:1文字,2图片,3语音  ... (im消息类型)
     * @return
     */
    @RequestMapping(value = "append")
@ -809,7 +812,6 @@ public class ConsultController extends WeixinBaseController {
                        String doctorOpenID = doctor.getOpenid();
                        if (StringUtils.isNotEmpty(doctorOpenID)) {
                                String title = "";
                                String repContent = "";
                                Consult consultSingle = consultDao.findByCode(log.getConsult());
                                if (consultSingle!=null){
                                    Integer singleType = consultSingle .getType();
@ -818,13 +820,7 @@ public class ConsultController extends WeixinBaseController {
                                    }else if(singleType != null && singleType !=8 ){
                                        title = consultSingle.getSymptoms();
                                    }
                                    if (type == 3){
                                        repContent = "语音消息";
                                    }else if (type == 2){
                                        repContent = "图片消息";
                                    }else {
                                        repContent = content;
                                    }
                                    String repContent = parseContentType(type+"",content);
                                    String first = "居民" +patient.getName()+"的健康咨询有新的回复。";
                                    String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                    List<NameValuePair> params = new ArrayList<>();
@ -1211,4 +1207,81 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    /**
     * 解析contentType
     *   PlainText: 1,   // 信息
     Image: 2,       // 图片信息
     Audio: 3,       // 语音信息
     Article: 4,     // 文章信息
     GoTo: 5,        // 跳转信息,求组其他医生或者邀请其他医生发送的推送消息
     TopicBegin: 6,  // 议题开始
     TopicEnd: 7,    // 议题结束 10 11 系统发送的会话消息
     TopicInto: 14,    // 进入议题 系统发送的会话消息
     Video:12,//视频
     System:13,//系统消息
     PrescriptionCheck:15,//续方审核消息消息
     PrescriptionBloodStatus:16,//续方咨询血糖血压咨询消息
     PrescriptionFollowupContent:17,//续方咨询随访问卷消息
     * @param contentType 消息类型
     * @return
     */
    private String parseContentType(String contentType,String content) {
        String responseContent = "";
        try {
            switch (contentType) {
                case "1":
                    responseContent = content;
                    break;
                case "2":
                    responseContent = "[图片消息]";
                    break;
                case "3":
                    responseContent = "[语音消息]";
                    break;
                case "4":
                    responseContent = "[文章消息]";
                    break;
                case "5":
                    responseContent = "[跳转链接消息]";
                    break;
                case "6":
                    responseContent = content;
                    break;
                case "7":
                    responseContent = content;
                    break;
                case "10":
                    responseContent = content;
                    break;
                case "11":
                    responseContent = content;
                    break;
                case "12":
                    responseContent = "[视频消息]";
                    break;
                case "13":
                    responseContent = content;
                    break;
                case "14":
                    responseContent = content;
                    break;
                case "15":
                    responseContent = "[续方审核消息]";
                    break;
                case "16":
                    responseContent = "[体征记录咨询消息]";
                    break;
                case "17":
                    responseContent = "[随访问卷咨询消息]";
                    break;
                default:
                    responseContent = "[咨询消息]";
                    break;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return responseContent;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -256,7 +256,7 @@ public class EsStatisticsController extends BaseController {
            List<JSONArray> jsonArrays = new ArrayList<>();
            /**新版统计代码start**/
            //咨询数-3 增量
            //咨询数-3 到达量71
            JSONArray jsonArray1 = statisticsESService.getLowLevelTotalDetail(endDate, area, level, indexes[0], sort, lowLevel, null, year);
            jsonArrays.add(jsonArray1);
            /**新版统计代码end**/

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

@ -124,4 +124,4 @@ activemq:
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy
  wlyy: http://59.61.92.90:8072/