瀏覽代碼

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

huangwenjie 7 年之前
父節點
當前提交
5554113d76
共有 35 個文件被更改,包括 579 次插入162 次删除
  1. 50 7
      common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java
  2. 13 24
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java
  3. 3 3
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  4. 6 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  5. 3 1
      patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml
  6. 3 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java
  7. 83 10
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/DataSourceConfig.java
  8. 3 2
      patient-co/patient-co-statistics-es/src/main/resources/application.yml
  9. 45 0
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/FollowupPlanJob.java
  10. 33 0
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/HealthMessageJob.java
  11. 9 0
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/doctor/Doctor.java
  12. 13 0
      patient-co/patient-co-statistics/src/main/resources/application.yml
  13. 1 2
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/HealthMessageJob.java
  14. 9 4
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java
  15. 29 29
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java
  16. 14 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  17. 5 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/ehc/PatientEHCService.java
  18. 24 24
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java
  19. 43 13
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java
  20. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java
  21. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  22. 5 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  23. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  24. 30 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java
  25. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java
  26. 18 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java
  27. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PyhsicExamRemindController.java
  28. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  29. 1 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java
  30. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  31. 84 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java
  32. 19 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  33. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java
  34. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  35. 8 2
      patient-co/patient-co-wlyy/src/main/resources/config/fdfs_client.conf

+ 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;
	}
}

+ 13 - 24
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java

@ -3,7 +3,6 @@ package com.yihu.wlyy.service.manager.feedback;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.entity.Message;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.SMS;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.repository.DoctorDao;
import com.yihu.wlyy.repository.MessageDao;
@ -17,7 +16,6 @@ import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -59,6 +57,8 @@ public class AppealService extends BaseService {
    private MessageDao messageDao;
    @Value("${image.imgUrlDomain}")
    private String imgUrlDomain;
    @Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
    private String messageApi;
    /**
     * 分页查找问题
@ -214,29 +214,18 @@ public class AppealService extends BaseService {
                msgContent.append("i健康应用");
            }
            msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
            JSONObject json = smsService.sendMsg(appeal.getPhone(), msgContent.toString());
        SMS sms = new SMS();
        Date date = new Date();
        // 延后5分钟
        sms.setContent(msgContent.toString());
        sms.setDeadline(date);
        sms.setCzrq(date);
        sms.setMobile(appeal.getPhone());
        sms.setIp("127.0.0.1");
        sms.setType(11);
        sms.setStatus(1);
        sms.setCaptcha("");
        smsDao.save(sms);
        if (json == null) {
            // 发送失败
            logger.error("申诉处理完成:短信发送失败");
        } else if (json.getInt("result") != 0) {
            logger.error("申诉处理完成:短信发送失败"+json.getString("description"));
        } else {
            //发送成功,保存到数据库
            smsDao.save(sms);
        }
            List<NameValuePair> par = new ArrayList<NameValuePair>();
            par.add(new BasicNameValuePair("mobiles", appeal.getPhone()));
            par.add(new BasicNameValuePair("content", msgContent.toString()));
            try {
                logger.info("====================================================================");
                String smsresult = HttpClientUtil.post(messageApi+"/sendMessage",par,"UTF-8");
                logger.info("发送短信消息返回结果:"+smsresult);
                logger.info("======================================================================");
            }catch (Exception e){
                e.printStackTrace();
            }
            if (appeal.getIdentity() == 2) {
                String creater = appeal.getCreater();

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -119,15 +119,15 @@ spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    device:
      url: jdbc:mysql://59.61.92.90:8079/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    medicine:
      url: jdbc:mysql://59.61.92.90:8079/medicine?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/medicine?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
  sms: # SMS短信配置

+ 6 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -48,6 +48,8 @@ public class PushMsgTask {
    private String template_consult_reply;
    @Value("${wechat.message.template_schedule_remind}")
    private String template_schedule_remind;
    @Value("${wechat.message.template_service_remind}")
    private String template_service_remind;
    @Value("${pushMes.method}")
    private String putMesMethod;
    @Value("${pushMes.redis_prescription_title}")
@ -87,6 +89,7 @@ public class PushMsgTask {
     *
     * @param access_token
     * @param type         1:处方待处理提醒  2:服务状态提醒  3:居民体征异常提醒  4:咨询请求通知  5:签约申请通知  6:随访提醒  7:处理结果通知 8 咨询回复提醒 9 代办事项提醒
     *                     10:服务待处理提醒
     * @param openid       发送对象openID
     * @param url          模板消息跳转链接
     * @param first        消息头
@ -329,6 +332,9 @@ public class PushMsgTask {
            case 9:
                templateId = template_schedule_remind;
                break;
            case 10:
                templateId = template_service_remind;
                break;
        }
        return templateId;
    }

+ 3 - 1
patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml

@ -48,7 +48,9 @@ wechat:
   #咨询回复提醒
   template_consult_reply:  sjnflOikO0WqMp4e338G8I0eFUXd6h8ljwgAlPZj5Tw
   #代办事项提醒
   template_schedule_remind:  sjnflOikO0WqMp4e338G8I0eFUXd6h8ljwgAlPZj5Tw
   template_schedule_remind:  9l1CBFlnJJaqWXW2UVQfgUidhtt5Fff_1L50RgXpIY8
   #服务待处理提醒
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/

+ 3 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java

@ -1,8 +1,11 @@
package com.yihu.wlyy;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.web.ErrorPageFilter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@ -18,7 +21,6 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
        transactionManagerRef = "wlyyTransactionManager")
public class Application {
    public static ApplicationContext ctx = null;
    public static void main(String[] args) {
        ctx = SpringApplication.run(Application.class, args);
    }

+ 83 - 10
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.filter.stat.StatFilter;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
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 javax.sql.DataSource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
 * Created by Administrator on 2016.10.20.
@ -50,9 +57,8 @@ public class DataSourceConfig {
    private Integer removeAbandonedTimeout;
    @Value("${spring.datasource.logAbandoned}")
    private Boolean logAbandoned;
    @Value("${spring.datasource.filters")
    private String filters;
    @Value("${spring.datasource.primaryReadWrite.url}")
@ -61,13 +67,15 @@ public class DataSourceConfig {
    private String primaryReadWriteUsername;
    @Value("${spring.datasource.primaryReadWrite.password}")
    private String primaryReadWritePassword;
    /**
     *  主数据源
     * 主数据源
     *
     * @return
     */
    @Bean(name = "primaryReadWrite")
    @Primary//主库 默认不写名字用这个
    public DataSource primaryReadWriteDataSource() {
    public DataSource primaryReadWriteDataSource(StatFilter statFilter) throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadWriteUrl);
        datasource.setUsername(primaryReadWriteUsername);
@ -90,11 +98,17 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        datasource.setConnectProperties(properties());//;# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
        datasource.setUseGlobalDataSourceStat(true);// 合并多个DruidDataSource的监控数据
        List proxyFilters = new ArrayList<>();
        proxyFilters.add(statFilter);
        datasource.setProxyFilters(proxyFilters);
        return datasource;
    }
    @Value("${spring.datasource.primaryRead.url}")
    private String primaryReadUrl;
    @Value("${spring.datasource.primaryRead.username}")
@ -103,7 +117,7 @@ public class DataSourceConfig {
    private String primaryReadPassword;
    @Bean(name = "primaryRead")
    public DataSource primaryReadDataSource() {
    public DataSource primaryReadDataSource(StatFilter statFilter) throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadUrl);
        datasource.setUsername(pprimaryReadUsername);
@ -126,7 +140,13 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        datasource.setConnectProperties(properties());//;# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
        datasource.setUseGlobalDataSourceStat(true);// 合并多个DruidDataSource的监控数据
        List proxyFilters = new ArrayList<>();
        proxyFilters.add(statFilter);
        datasource.setProxyFilters(proxyFilters);
        return datasource;
    }
@ -137,8 +157,10 @@ public class DataSourceConfig {
    private String imUsername;
    @Value("${spring.datasource.im.password}")
    private String imPassword;
    @Bean(name = "imData")
    public DataSource imDataSource() {DruidDataSource datasource = new DruidDataSource();
    public DataSource imDataSource(StatFilter statFilter) throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(imUrl);
        datasource.setUsername(imUsername);
        datasource.setPassword(imPassword);
@ -160,9 +182,60 @@ public class DataSourceConfig {
        datasource.setRemoveAbandoned(removeAbandoned);
        datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
        datasource.setLogAbandoned(logAbandoned);
        datasource.setFilters(filters);
        datasource.setConnectProperties(properties());//;# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
        datasource.setUseGlobalDataSourceStat(true);// 合并多个DruidDataSource的监控数据
        List proxyFilters = new ArrayList<>();
        proxyFilters.add(statFilter);
        datasource.setProxyFilters(proxyFilters);
        return datasource;
    }
    private Properties properties() {
        Properties properties = new Properties();
        properties.put("druid.stat.mergeSql", "true");
        properties.put("slowSqlMillis", "1000");
        return properties;
    }
    //------------------------------------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 filterRegistrationBean(WebStatFilter webStatFilter) {
        //创建过滤器
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(webStatFilter);
        //设置过滤器过滤路径
        filterRegistrationBean.addUrlPatterns("/*");
        //忽略过滤的形式
        filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
        return filterRegistrationBean;
    }
    @Bean
    public StatFilter statFilter() {
        return new StatFilter();
    }
    @Bean
    public WebStatFilter webStatFilter() {
        return new WebStatFilter();
    }
    //------------------------------------druid 监控----------------------------------------------
}

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

@ -24,11 +24,12 @@ spring:
    testWhileIdle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    minEvictableIdleTimeMillis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    timeBetweenEvictionRunsMillis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    poolPreparedStatements: false # 打开PSCache,并且指定每个连接上PSCache的大小
    poolPreparedStatements: true # 打开PSCache,并且指定每个连接上PSCache的大小
    maxPoolPreparedStatementPerConnectionSize: 50
    removeAbandoned: false #超过时间限制是否回收
    removeAbandonedTimeout: 7200 #超时时间;单位为秒。180秒=3分钟
    logAbandoned: false #关闭abanded连接时输出错误日志
    filters: stat,wall,logback #配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
@ -63,7 +64,7 @@ logging:
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: false
  show_sql: true
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy

+ 45 - 0
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/FollowupPlanJob.java

@ -1,9 +1,15 @@
package com.yihu.wlyy.statistics.job.message;
import com.yihu.wlyy.statistics.dao.DoctorDao;
import com.yihu.wlyy.statistics.dao.MessageDao;
import com.yihu.wlyy.statistics.model.doctor.Doctor;
import com.yihu.wlyy.statistics.model.signfamily.Message;
import com.yihu.wlyy.statistics.task.PushMsgTask;
import com.yihu.wlyy.statistics.util.DateUtil;
import com.yihu.wlyy.statistics.util.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@ -15,6 +21,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import javax.transaction.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
@ -32,6 +39,12 @@ public class FollowupPlanJob implements Job {
    @Autowired
    private MessageDao messageDao;
    @Value("${doctorAssistant.api}")
    private String doctorAssistant;
    @Value("${doctorAssistant.target_url}")
    private String targetUrl;
    @Autowired
    private DoctorDao doctorDao;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
@ -86,6 +99,38 @@ public class FollowupPlanJob implements Job {
                    PushMsgTask.url= url;
                    // 推送消息给医生
                    PushMsgTask.getInstance().put(doctor,"4",title,content,"");
                    try {
                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        String hql = "SELECT a.patient_name patientName,a.patient_code patientCode,count(1) amount FROM wlyy_followup a WHERE a.doctor_code = ? " +
                                " AND a.followup_plan_date BETWEEN ? AND ? AND a. STATUS NOT IN ('0', '1') GROUP BY a.patient_code;";
                        //获取所有未执行随访计划
                        List<Map<String, Object>> followups = jdbcTemplate.queryForList(hql,doctor,format.parse(start),format.parse(end));
                        for (Map<String,Object> followup:followups) {
                            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                            String patientName = String.valueOf(followup.get("patientName"));
                            String patientCount = String.valueOf(followup.get("amount"));
                            Doctor doctor1 = doctorDao.findByCode(doctor);
                            String doctorOpenID = doctor1.getOpenid();
                            if (StringUtils.isNotEmpty(doctorOpenID)) {
                                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                List<NameValuePair> params = new ArrayList<>();
                                params.add(new BasicNameValuePair("type", "6"));
                                params.add(new BasicNameValuePair("openId", doctorOpenID));
                                params.add(new BasicNameValuePair("url", targetUrl));
                                params.add(new BasicNameValuePair("first", "您今日有"+patientCount+"个随访计划待处理"));
                                params.add(new BasicNameValuePair("remark", ""));
                                SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                                String newDate = formatDate.format(new Date());
                                String keywords = patientName+ "," + newDate + "," + "请进入手机APP查看";
                                params.add(new BasicNameValuePair("keywords", keywords));
                                HttpClientUtil.post(url, params, "UTF-8");
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                messageDao.save(list);

+ 33 - 0
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/HealthMessageJob.java

@ -1,14 +1,19 @@
package com.yihu.wlyy.statistics.job.message;
import com.yihu.wlyy.statistics.dao.DoctorDao;
import com.yihu.wlyy.statistics.dao.MessageDao;
import com.yihu.wlyy.statistics.etl.extract.DBExtract;
import com.yihu.wlyy.statistics.etl.storage.DBStorage;
import com.yihu.wlyy.statistics.model.doctor.Doctor;
import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
import com.yihu.wlyy.statistics.model.signfamily.Message;
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
import com.yihu.wlyy.statistics.task.PushMsgTask;
import com.yihu.wlyy.statistics.util.HttpClientUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@ -43,6 +48,12 @@ public class HealthMessageJob implements Job {
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private DBStorage dbStorage;
    @Value("${doctorAssistant.api}")
    private String doctorAssistant;
    @Value("${doctorAssistant.target_url}")
    private String targetUrl;
    @Autowired
    private DoctorDao doctorDao;
    @Transactional
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
@ -112,6 +123,28 @@ public class HealthMessageJob implements Job {
                message.setReceiver(teamLeader);
                messageDao.save(message);
                try {
                    //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                    Doctor doctor = doctorDao.findByCode(teamLeader);
                    String doctorOpenID = doctor.getOpenid();
                    if (!StringUtils.isEmpty(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查看"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        String keywords = "分配健管师" + "," +doctor.getHosptialName()+","+ doctor.getName()  ;
                        sendParams.add(new BasicNameValuePair("keywords", keywords));
                        HttpClientUtil.post(url, sendParams, "UTF-8");
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                // 异常通知
                JSONObject json = new JSONObject();

+ 9 - 0
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/model/doctor/Doctor.java

@ -59,6 +59,15 @@ public class Doctor extends IdEntity {
	private String idcard;          //身份证号
	private Integer isFamous;       //是否是名医 1是  0或者空不是
	private String isPasswordPrompt;// 是否提示密码信息 1是 0或者空是否
	private String openid; //医生微信openID
	public String getOpenid() {
		return openid;
	}
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	public Doctor() {}

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

@ -160,6 +160,11 @@ spring:
systemConfig:
  msg_push_server: http://127.0.0.1:3000
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://172.19.103.88:443/assistant/
  target_url: home/html/unreadMessageStatistic.html
---
spring:
@ -191,6 +196,10 @@ spring:
systemConfig:
  msg_push_server: http://127.0.0.1:3000
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://www.xmtyw.cn/assistant/
  target_url: home/html/unreadMessageStatistic.html
---
spring:
@ -236,6 +245,10 @@ fv:
systemConfig:
  msg_push_server: http://172.19.103.76:3000
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://192.168.131.113:8080/
  target_url: home/html/unreadMessageStatistic.html
---
spring:

+ 1 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/HealthMessageJob.java

@ -138,8 +138,7 @@ public class HealthMessageJob implements Job {
                        sendParams.add(new BasicNameValuePair("first", doctor.getName()+"医生您好。" + content));
                        sendParams.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        String date = format.format(new Date());
                        String keywords = "分配健管师" + "," + date  ;
                        String keywords = "分配健管师" + "," + doctor.getHospitalName()+ "," + doctor.getName();
                        sendParams.add(new BasicNameValuePair("keywords", keywords));
                        httpClientUtil.post(url, sendParams, "UTF-8");

+ 9 - 4
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -694,9 +694,14 @@ public class FollowUpService extends BaseService {
                    try {
                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        List<Followup> followups = followupDao.getByDoctorPlan(doctor,format.parse(start),format.parse(end));
                        for (Followup followup:followups) {
                        String hql = "SELECT a.patient_name patientName,a.patient_code patientCode,count(1) amount FROM wlyy_followup a WHERE a.doctor_code = ? " +
                                " AND a.followup_plan_date BETWEEN ? AND ? AND a. STATUS NOT IN ('0', '1') GROUP BY a.patient_code;";
                        //获取所有未执行随访计划
                        List<Map<String, Object>> followups = jdbcTemplate.queryForList(hql,doctor,format.parse(start),format.parse(end));
                        for (Map<String,Object> followup:followups) {
                            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                            String patientName = String.valueOf(followup.get("patientName"));
                            String patientCount = String.valueOf(followup.get("amount"));
                            Doctor doctor1 = doctorDao.findByCode(doctor);
                            String doctorOpenID = doctor1.getOpenid();
                            if (StringUtils.isNotEmpty(doctorOpenID)) {
@ -705,11 +710,11 @@ public class FollowUpService extends BaseService {
                                params.add(new BasicNameValuePair("type", "6"));
                                params.add(new BasicNameValuePair("openId", doctorOpenID));
                                params.add(new BasicNameValuePair("url", targetUrl));
                                params.add(new BasicNameValuePair("first", "您今日有"+count+"个随访计划待处理"));
                                params.add(new BasicNameValuePair("first", "您今日有"+patientCount+"个随访计划待处理"));
                                params.add(new BasicNameValuePair("remark", ""));
                                SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                                String newDate = formatDate.format(new Date());
                                String keywords = followup.getPatientName() + newDate + "," + "请进入手机APP查看";
                                String keywords = patientName+ "," + newDate + "," + "请进入手机APP查看";
                                params.add(new BasicNameValuePair("keywords", keywords));
                                httpClientUtil.post(url, params, "UTF-8");

+ 29 - 29
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java

@ -11,43 +11,43 @@ import java.util.Date;
import java.util.List;
public interface DevicePatientHealthIndexDao
        extends PagingAndSortingRepository<DevicePatientHealthIndex, Long>, JpaSpecificationExecutor<DevicePatientHealthIndex> {
		extends PagingAndSortingRepository<DevicePatientHealthIndex, Long>, JpaSpecificationExecutor<DevicePatientHealthIndex> {
    List<DevicePatientHealthIndex> findByIdcardAndType(String idcard, Integer type);
	List<DevicePatientHealthIndex> findByIdcardAndType(String idcard, Integer type);
    /**
     * 按录入时间和患者标识查询健康记录
     *
     * @param patientCode
     * @param date
     * @return
     */
    @Query("select a from DevicePatientHealthIndex a where a.user = ?1 and type = ?2 and a.recordDate = ?3 and a.del = '1'")
    Iterable<DevicePatientHealthIndex> findByPatienDate(String patientCode, int type, Date date);
	/**
	 * 按录入时间和患者标识查询健康记录
	 *
	 * @param patientCode
	 * @param date
	 * @return
	 */
	@Query("select a from DevicePatientHealthIndex a where a.user = ?1 and type = ?2 and a.recordDate = ?3 and a.del = '1'")
	Iterable<DevicePatientHealthIndex> findByPatienDate(String patientCode, int type, Date date);
    @Query("select a from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate between ?3 and ?4 and a.del = '1' group by recordDate order by recordDate asc")
    Iterable<DevicePatientHealthIndex> findByPatient(String user, int type, Date begin, Date end);
	@Query("select a from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate between ?3 and ?4 and a.del = '1' group by recordDate order by recordDate asc")
	Iterable<DevicePatientHealthIndex> findByPatient(String user, int type, Date begin, Date end);
    @Query("select a.value1 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value1 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue1ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value1 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value1 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue1ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value2 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value2 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue2ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value2 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value2 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue2ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value3 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value3 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue3ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value3 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value3 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue3ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value4 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value4 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue4ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value4 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value4 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue4ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value5 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value5 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue5ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value5 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value5 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue5ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value6 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value6 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue6ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value6 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value6 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue6ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
    @Query("select a.value7 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value7 > 0 and a.del = '1' order by recordDate desc")
    Page<String> findValue7ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a.value7 from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate < ?3 and a.value7 > 0 and a.del = '1' order by recordDate desc")
	Page<String> findValue7ByPatient(String user, int type, Date recordDate, Pageable pageRequest);
	@Query("select a from DevicePatientHealthIndex a where a.user = ?1 and a.type = ?2 and a.recordDate >= ?3 and a.recordDate <= ?4 and a.del = '1'")
	Page<DevicePatientHealthIndex> findIndexByPatient(String patient, int type, Date start, Date end, Pageable pageRequest);
@ -67,7 +67,7 @@ public interface DevicePatientHealthIndexDao
	/**
	 * 获取患者一天血糖值
     */
	 */
	@Query("select a from DevicePatientHealthIndex a where a.type=1 and a.user = ?1 and DATE_FORMAT(a.recordDate,'%Y-%m-%d') = ?2 and a.del = '1' order by a.recordDate,a.id")
	List<DevicePatientHealthIndex> findByDate(String patient, String date);
@ -76,7 +76,7 @@ public interface DevicePatientHealthIndexDao
	/**
	 * 上次血糖值
     */
	 */
	@Query(value = "select a.value1 from device.wlyy_patient_health_index a where a.type=1 and a.user = ?1 and a.id<?2 and a.value2 = ?3 and a.del = '1' order by a.sort_date desc ,record_date desc limit 0,1",nativeQuery = true)
	String getPreValue(String user,Long id,String value2);

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -2672,4 +2672,18 @@ public class ConsultTeamService extends ConsultService {
//        //居民发送Im消息
//        ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "17", contentobj.toString(), null);
    }
    /**
     * 根据续方code获取咨询
     * @param prescriptionCode
     * @return
     */
    public ConsultTeam getConsultStatus(String prescriptionCode){
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        if(prescription!=null){
            return consultTeamDao.findByConsult(prescription.getConsult());
        }
        return null;
    }
}

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/ehc/PatientEHCService.java

@ -63,6 +63,7 @@ public class PatientEHCService extends BaseService {
            String idcard = patient.getIdcard();
            String name = patient.getName();
            Integer sex = patient.getSex();//1男,2女
            String mobile = patient.getMobile();
            if (StringUtils.isEmpty(openId)) {
                return "-1";
            }
@ -72,12 +73,14 @@ public class PatientEHCService extends BaseService {
            if (StringUtils.isEmpty(name)) {
                return "-1";
            }
            if (StringUtils.isEmpty(mobile)) {
                return "-1";
            }
            if (sex == null) {
                return "-1";
            }
            Date birthday = patient.getBirthday();
            String mobile = patient.getMobile();
            String phone = patient.getPhone();
            String provinceName = patient.getProvinceName();
            String cityName = patient.getCityName();
@ -95,9 +98,9 @@ public class PatientEHCService extends BaseService {
            bizContent.put("id_no", idcard);
            bizContent.put("user_name", name);
            bizContent.put("user_sex", "" + sex);
            bizContent.put("mobile_phone", mobile);
            bizContent.put("birthday", DateUtil.dateToStr(birthday, format));
            bizContent.put("mobile_phone", mobile);
            bizContent.put("telephone", phone);
            bizContent.put("address", address);
            bizContent.put("work_unit", provinceName + cityName + townName + streetName);

+ 24 - 24
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -332,11 +332,11 @@ public class SignPatientLabelInfoService extends BaseService {
                sql = sql + " LEFT JOIN wlyy_patient p on p.code = t1.patient  ";
            }
            sql = sql + " WHERE t2.label = ?";
    
            if(StringUtils.isNotBlank(diseaseCondition)) {
                sql = sql + " AND p.disease_condition = ? ";
            }
    
            sql = sql + "    AND t2.label_type = ? " +
                    "    AND t2.status = 1 " +
                    "    AND t1.patient = t2.patient " +
@ -394,7 +394,7 @@ public class SignPatientLabelInfoService extends BaseService {
//                if (p == null) {
//                    continue;
//                }
    
                PatientVO p = new PatientVO();
                if(sign.get("patient") != null){
                    String patientsql = "select a.*,b.deviceType as deviceType,c.disease as disease from wlyy_patient a" +
@ -402,7 +402,7 @@ public class SignPatientLabelInfoService extends BaseService {
                            "  left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
                            " and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
                            " where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
        
                    p = (PatientVO)jdbcTemplate.queryForObject(patientsql,new BeanPropertyRowMapper(PatientVO.class));
                }else{
                    continue;
@ -506,7 +506,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    json.put("expensesStatus", "1");
                }
                 //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                json.put("disease",p.getDisease());
                // 病情:0绿标,1黄标,2红标,
                json.put("diseaseCondition",p.getDiseaseCondition());
@ -1062,14 +1062,14 @@ public class SignPatientLabelInfoService extends BaseService {
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                if (labelType.equals("5")) {
    
                    sql = "select count(DISTINCT t1.patient) count" +
                            " from " +
                            "     wlyy_sign_family t1," +
                            "     wlyy_patient t3 " +
                            " where t1.patient = t3.code AND (t1.doctor = ? or t1.doctor_health = ?) and t1.status > 0 " +
                            (teamCode > 0 ? " and t1.admin_team_code = ? " : "");
    
                    if (label.getLabelCode().equals("1")) {
                        int week = today.get(Calendar.DAY_OF_WEEK) - 2;
                        if (week == -1) {
@ -1095,7 +1095,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        args = new Object[]{doctor, doctor};
                    }
                }else if(labelType.equals("3") && isSlowDisease) {
                    
                    if("1".equals(label.getLabelCode()) ||  "2".equals(label.getLabelCode())){
                        sql = " SELECT " +
                                "     count(DISTINCT t1.patient) count" +
@ -1112,7 +1112,7 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     AND t1.status > 0 " +
                                (teamCode > 0 ? "    AND t1.admin_team_code = ? " : "")+
                                "     AND t3.disease_condition = ? ";
    
                        if (teamCode > 0) {
                            args = new Object[]{label.getLabelCode(), labelType, doctor, doctor, teamCode,diseaseCondition};
                        } else {
@ -1183,7 +1183,7 @@ public class SignPatientLabelInfoService extends BaseService {
                }else{
                    sql += labelType.equals("5") ? " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 " : " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 ";
                }
                
                List<Map<String, Object>> focusCount = jdbcTemplate.queryForList(sql, args);
                if (focusCount != null && focusCount.size() > 0 && focusCount.get(0).containsKey("count")) {
@ -2452,10 +2452,10 @@ public class SignPatientLabelInfoService extends BaseService {
     * @throws Exception
     */
    public JSONArray searchPatientByNameOrLabelOverdue(String doctor, String filter,
                                                String labelCode, String labelType, long teamCode,
                                                String exLabelCode,
                                                String exLabelType,
                                                int page, int pagesize) throws Exception {
                                                       String labelCode, String labelType, long teamCode,
                                                       String exLabelCode,
                                                       String exLabelType,
                                                       int page, int pagesize) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
@ -3740,11 +3740,11 @@ public class SignPatientLabelInfoService extends BaseService {
                sql = sql + ", wlyy_patient p ";
            }
            sql = sql + " WHERE t2.label = ?";
    
            if(StringUtils.isNotBlank(diseaseCondition)) {
                sql = sql + " AND p.disease_condition = ? ";
            }
    
            sql = sql + "    AND t2.label_type = ? " +
                    "    AND t2.status = 1 " +
                    "    AND t1.patient = t2.patient " +
@ -3816,7 +3816,7 @@ public class SignPatientLabelInfoService extends BaseService {
        if (signList != null && signList.size() > 0) {
            for (Map<String, Object> sign : signList) {
            
//                Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
//                if (p == null) {
//                    continue;
@ -3829,7 +3829,7 @@ public class SignPatientLabelInfoService extends BaseService {
                            "  left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 AND status =1 " +
                            " and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
                            " where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
    
                    p = (PatientVO)jdbcTemplate.queryForObject(patientsql,new BeanPropertyRowMapper(PatientVO.class));
                }else{
                    continue;
@ -3934,7 +3934,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    json.put("expensesStatus", "1");
                }
                 //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                json.put("disease",p.getDisease());
                // 病情:0绿标,1黄标,2红标,
                json.put("diseaseCondition",p.getDiseaseCondition());
@ -3981,7 +3981,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    //患者預警狀態
                    int standardStatus1 = o1.has("standardStatus")?o1.getInt("standardStatus"):0;
                    int standardStatus2 = o2.has("standardStatus")?o2.getInt("standardStatus"):0;
    
                    //疾病种类
                    int disease1 = 0;
                    if(o1.has("disease")){
@ -4267,7 +4267,7 @@ public class SignPatientLabelInfoService extends BaseService {
                            "  left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
                            " and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
                            " where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
        
                    p = (PatientVO)jdbcTemplate.queryForObject(patientsql,new BeanPropertyRowMapper(PatientVO.class));
                }else{
                    continue;
@ -4395,7 +4395,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    json.put("expensesStatus", "1");
                }
                 //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                json.put("disease",p.getDisease());
                // 病情:0绿标,1黄标,2红标,
                json.put("diseaseCondition",p.getDiseaseCondition());
@ -4471,7 +4471,7 @@ public class SignPatientLabelInfoService extends BaseService {
                            "  left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
                            " and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
                            " where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
        
                    p = (PatientVO)jdbcTemplate.queryForObject(patientsql,new BeanPropertyRowMapper(PatientVO.class));
                }else{
                    continue;
@ -4582,7 +4582,7 @@ public class SignPatientLabelInfoService extends BaseService {
                    json.put("expensesStatus", "1");
                }
                 //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
                json.put("disease",p.getDisease());
                // 病情:0绿标,1黄标,2红标,
                json.put("diseaseCondition",p.getDiseaseCondition());

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

@ -766,9 +766,7 @@ public class PatientPrescriptionPayService extends BaseService {
                                        sendParams.add(new BasicNameValuePair("url", targetUrl));
                                        sendParams.add(new BasicNameValuePair("first", doctor.getName()+"医生您好。" + content + ",一个尽快分配。"));
                                        sendParams.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                                        String date = format.format(new Date());
                                        String keywords = "分配配送员" + "," + date  ;
                                        String keywords = "分配配送员" + "," + doctor.getHospitalName() + "," +doctor.getName();
                                        sendParams.add(new BasicNameValuePair("keywords", keywords));
                                        httpClientUtil.post(url, sendParams, "UTF-8");
@ -1050,11 +1048,32 @@ public class PatientPrescriptionPayService extends BaseService {
            String ssc = card.getAttachCardNo();
            String idType = card.getAttachIdType();
            String idNo = card.getAttachIdNo();
            logger.info("================================>" + "after get BindCard");
//            验证续方人与绑卡人是否一致
            if (!(payName.equals(name) && paySsc.equals(ssc) && payIdcard.equals(idNo))) {
                resultMap.put("status", "-1");
                return resultMap;
            String resName = "";
            String resSsc = "";
            String resIdNo = "";
            if (!patient.equals(repUid)){
                List<BindCard> bindCard = onePayService.bindCardList(openid);
                for (BindCard cards : bindCard) {
                    String attachCardNo = cards.getAttachCardNo();
                    if (StringUtil.isNotEmpty(attachCardNo) && StringUtil.isNotEmpty(paySsc) && paySsc.equals(attachCardNo)) {
                        resIdNo = cards.getAttachIdNo();
                        resName = cards.getAttachName();
                        resSsc = cards.getAttachCardNo();
                    }
                }
                //            验证续方人与绑卡人(或代理人)是否一致
                if (!(payName.equals(resName) && paySsc.equals(resSsc) && payIdcard.equals(resIdNo))) {
                    resultMap.put("status", "-1");
                    return resultMap;
                }
            }else {
                logger.info("================================>" + "after get BindCard");
//            验证续方人与绑卡人(或代理人)是否一致
                if (!(payName.equals(name) && paySsc.equals(ssc) && payIdcard.equals(idNo))) {
                    resultMap.put("status", "-1");
                    return resultMap;
                }
            }
            prescriptionPay.setCardNo(ssc);//医保卡号
@ -1101,12 +1120,22 @@ public class PatientPrescriptionPayService extends BaseService {
            String visitNo = prescription.getVisitNo();//续方挂号号
            String recipeNo = prescription.getRecipeNo();//基位处方code(开方成功后返回)
            logger.debug("======================> getPayInfo " + ssc + visitNo);
            if (visitNo == null || ssc == null || recipeNo == null) {
                resultMap.put("status", "-2");
                return resultMap;
            JSONObject jsonParams = null;
            if (!patient.equals(repUid)){
                logger.debug("======================> getPayInfo " + resSsc + visitNo);
                if (visitNo == null || resSsc == null || recipeNo == null) {
                    resultMap.put("status", "-2");
                    return resultMap;
                }
                jsonParams = prescriptionService.getPayInfo(resSsc, visitNo, recipeNo);
            }else{
                logger.debug("======================> getPayInfo " + ssc + visitNo);
                if (visitNo == null || ssc == null || recipeNo == null) {
                    resultMap.put("status", "-2");
                    return resultMap;
                }
                jsonParams = prescriptionService.getPayInfo(ssc, visitNo, recipeNo);
            }
            JSONObject jsonParams = prescriptionService.getPayInfo(ssc, visitNo, recipeNo);
            if (!jsonParams.containsKey("recipeContent") || !jsonParams.containsKey("zdlist") || !jsonParams.containsKey("mxlist")) {
                resultMap.put("status", "-3");
@ -1134,6 +1163,7 @@ public class PatientPrescriptionPayService extends BaseService {
            map.put("settleType", "01"); //诊间医保结算
//            易联众新增字段代支付v1.3.7
            map.put("principalCardNo", ssc); //实际结算卡号( 默认为绑卡主体卡号)
            prescriptionPay.setPrincipalCardNo(ssc);
            if (!patient.equals(repUid)) {
                String principalCardNo = null;
                Patient person = patientDao.findByCode(repUid);

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

@ -80,7 +80,7 @@ public class DoctorSchemeService {
        if(-1 != deviceType){
            sql = sql + " LEFT JOIN wlyy_patient_device dev on dev.user = p.code ";
        }
    
        sql = sql+ " RIGHT JOIN wlyy_sign_patient_label_info sp on sp.patient = p.code and sp.status =1 ";
        sql = sql+ " LEFT JOIN wlyy_sign_family sf on sf.patient = p.code where sf.admin_team_code = "+teamCode;
@ -394,7 +394,7 @@ public class DoctorSchemeService {
    public JSONObject getSlowDiseaseTeaminfos(String teamCode, int getcolor, int getstands, int gethealthindex, String startdate, String enddate,String doctorcode) throws Exception{
//        List<Patient> patients = patientDao.findAllSignPatientTeamcode(teamCode,doctorcode);
    
        List<PatientVO> patients = new ArrayList<>();
        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 " +
@ -403,8 +403,8 @@ public class DoctorSchemeService {
                "WHERE s.status > 0 and s.admin_team_code ='"+teamCode+"' and (s.doctor = '"+doctorcode+"' or s.doctor_health ='"+doctorcode+"') GROUP BY p.code";
        patients= jdbcTemplate.query(patientsql,new BeanPropertyRowMapper(PatientVO.class));
        
        
        JSONObject result = new JSONObject();
        JSONObject green = new JSONObject();//绿标

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -2241,12 +2241,12 @@ public class StatisticsService extends BaseService {
        //待预约量排行
        String resrc_sql = "SELECT s.rowno AS reservationRK from " +
                "( " +
                "  SELECT (@rowNum :=@rowNum + 1) AS rowno,t.reservationCount,t.admin_team_code \n" +
                "  SELECT (@rowNum :=@rowNum + 1) AS rowno,t.reservationCount,t.admin_team_code " +
                "   FROM ( " +
                "   SELECT COUNT(1) AS reservationCount,w.admin_team_code " +
                "   FROM wlyy_patient_reservation  w " +
                "   FROM wlyy_patient_reservation  w JOIN wlyy_admin_team at ON w.admin_team_code = at.id " +
                "   WHERE w.czrq>='" + startDate + " 00:00:00' AND w.czrq <='" + endDate + " 23:59:59' AND " +
                "   w.org_code ='" + orgcode + "'" +
                "   at.org_code ='" + orgcode + "'" +
                "   AND w.doctor is not null " +
                "   AND w.admin_team_code IS NOT NULL " +
                "   GROUP BY w.admin_team_code " +

+ 5 - 4
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();
@ -2918,7 +2918,7 @@ public class StatisticsESService {
    }
    /**
     * 获取咨询数和未回复数..
     * 获取咨询数和未回复数.(决定用旧版,先弃用17-11-22)
     *
     * @param doctor
     * @param startDate
@ -2995,7 +2995,7 @@ public class StatisticsESService {
    }
    /**
     * 获取团队月或周咨询未回复和总数折线图
     * 获取团队月或周咨询未回复和总数折线图(后面决定用旧版的service先弃用17-11-22)
     *
     * @param teamCode
     * @param startDate
@ -3130,6 +3130,7 @@ public class StatisticsESService {
    /**
     * 团队报告--长处方
     * 备注:决定用旧版,先弃用(17-11-23)
     *
     * @param startDate
     * @param endDate

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -171,7 +171,7 @@ public class JwPrescriptionService {
            }
        }
        re.put("list",jsonArray);
        re.put("totalCount",totalCount);
        re.put("totalCount",jsonArray.size());
        re.put("errorMsg",errorMsg);
        return re;

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

@ -255,11 +255,35 @@ public class OnePayService {
            charge.setSubject(subject);
            charge.setTotalAmount(Integer.parseInt(totalAmount));  //  交易总金额
            BindCard card = ownerCard(openid);
            String name = card.getAttachName();
            String ssc = card.getAttachCardNo();
            String idType = card.getAttachIdType();
            String idNo = card.getAttachIdNo();
//            BindCard card = ownerCard(openid);
            Patient uid = patientDao.findByCode(patient);
            String name = uid.getName();
            String ssc = uid.getSsc();
            String idType = "01";
            String idNo = uid.getIdcard();
            List<BindCard> bindCards = bindCardList(openid);
            String payName = "";
            String paySsc = "";
            String payIdType = "";
            String payIdNo = "";
            for (BindCard bind :bindCards) {
                String attachCardNo = bind.getAttachCardNo();
                if (StringUtil.isNotEmpty(attachCardNo) && StringUtil.isNotEmpty(ssc) && ssc.equals(attachCardNo)) {
                    payName = bind.getAttachName();
                    paySsc = bind.getAttachCardNo();
                    payIdType = bind.getAttachIdType();
                    payIdNo = bind.getAttachIdNo();
                }
            }
            //            验证登录人与绑卡人(或代理人)是否一致
            if (!(name.equals(payName) && ssc.equals(paySsc) && idNo.equals(payIdNo))) {
                return "-1";
            }else{
                name = payName;
                ssc = paySsc;
                idNo = payIdNo;
                idType = payIdType;
            }
            charge.setName(name);
            charge.setIdType(idType);
            charge.setIdNo(idNo);
@ -698,7 +722,7 @@ public class OnePayService {
                    p.setOpenid(openid);
                }
//            增加绑定电子社保卡信息
                if (!"1".equals(p.getSicardStatus())){
                if (p.getSicardStatus()!=null && p.getSicardStatus()!=1){
                    p.setSicardTime(new Date());
                }
                patientDao.save(p);

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -501,14 +501,22 @@ public class FileUploadController extends BaseController {
     */
    private String toNeiWang(HttpServletRequest request, HttpServletResponse response) {
        try {
            logger.info(" picture to neiwang start");
            MultipartRequest multipartRequest= (MultipartRequest) request;
            String url = neiwangWlyy + request.getRequestURI();//uri请求路径 http://172.19.103.88/wlyy/upload/chat
            String responseEntity =null;
            logger.info(" picture to neiwang url:"+url);
            for(Map.Entry<String,List<MultipartFile >> one:multipartRequest.getMultiFileMap().entrySet()){
                 responseEntity = request(url,one.getValue().get(0));
                MultipartFile multipartFile=one.getValue().get(0);
                logger.info(" picture to neiwang file size:"+multipartFile.getSize());
                logger.info(" picture to neiwang file name:"+multipartFile.getName());
                 responseEntity = request(url,multipartFile);
            }
            logger.info(" picture to neiwang responseEntity:"+responseEntity);
            logger.info(" picture to neiwang end");
            return responseEntity;
        } catch (Exception e) {
            logger.error(" picture to neiwang error");
            error(e);
            return error(-1, "上传失败");
        }

+ 18 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -772,6 +772,24 @@ public class DoctorConsultController extends WeixinBaseController {
        }
    }
    @ApiOperation("咨询是否结束")
    @RequestMapping(value = "/getConsultStatusByPrescription",method = RequestMethod.GET)
    @ResponseBody
    public String getConsultStatusByPrescription(@ApiParam(name = "prescriptionCode", value = "续方code")
                                                 @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode){
        try {
            ConsultTeam consultTeam =  consultTeamService.getConsultStatus(prescriptionCode);
            if(consultTeam!=null){
                return write(200, "查询成功", "data", consultTeam.getStatus());
            }else {
                return error(-1, "咨询不存在");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 查询与某个医生是否存在未结束的咨询

+ 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 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java

@ -78,8 +78,7 @@ public class PrescriptionAdjustController extends BaseController {
                    params.add(new BasicNameValuePair("first", doctor.getName() + "医生您好。您有1个续方申请已在线下调整完成,请尽快进行CA认证."));
                    params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                    SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    String date = format.format(new Date());
                    String keywords = "续方审核CA认证" +"," + date;
                    String keywords = "续方审核CA认证" +"," + doctor.getHospitalName() + "," +doctor.getName();
                    params.add(new BasicNameValuePair("keywords", keywords));
                    httpClientUtil.post(url, params, "UTF-8");

+ 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)) {

+ 84 - 4
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")
@ -817,6 +820,7 @@ public class ConsultController extends WeixinBaseController {
                                    }else if(singleType != null && singleType !=8 ){
                                        title = consultSingle.getSymptoms();
                                    }
                                    String repContent = parseContentType(type+"",content);
                                    String first = "居民" +patient.getName()+"的健康咨询有新的回复。";
                                    String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                                    List<NameValuePair> params = new ArrayList<>();
@ -825,7 +829,7 @@ public class ConsultController extends WeixinBaseController {
                                    params.add(new BasicNameValuePair("url", targetUrl));
                                    params.add(new BasicNameValuePair("first",  first));
                                    params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                                    String keywords = title + "," + content +","+ doctor.getName();
                                    String keywords = title + "," + repContent +","+ doctor.getName();
                                    params.add(new BasicNameValuePair("keywords", keywords));
                                    httpClientUtil.post(url, params, "UTF-8");
@ -1113,8 +1117,7 @@ public class ConsultController extends WeixinBaseController {
                        params.add(new BasicNameValuePair("first", doctor1.getName() + "医生您好。您的签约居民"+patient.getName()+"申请线上续方,请尽快审核。"));
                        params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        String date = format.format(new Date());
                        String keywords = "续方审核" + "," + date;
                        String keywords = "续方审核" + "," + doctor1.getHospitalName()+","+doctor1.getName();
                        params.add(new BasicNameValuePair("keywords", keywords));
                        httpClientUtil.post(url, params, "UTF-8");
@ -1204,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;
    }
}

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

@ -32,7 +32,7 @@ import java.util.TreeMap;
 * Created by chenweida on 2017/10/13
 */
@Controller
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@Api(description = "ES统计查询")
public class EsStatisticsController extends BaseController {
@ -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**/
@ -885,7 +885,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取咨询数和未回复数
     * 获取咨询数和未回复数(决定用旧版的service)
     *
     * @param startDate
     * @param endDate
@ -898,7 +898,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String endDate,
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
@ -919,7 +919,7 @@ public class EsStatisticsController extends BaseController {
                                        @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getServiceRankingList(getUID(), startDate, endDate));
            //return write(200, "查询成功", "data", statisticsService.getServiceRankingList("xh1D201703150222",startDate,endDate));
            //return write(200, "查询成功", "data", statisticsService.getServiceRankingList("xh1D2017031502222",startDate,endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -966,7 +966,7 @@ public class EsStatisticsController extends BaseController {
    /**
     * 获取团队月或周咨询未回复和总数折线图
     *
     * 备注:决定用旧版的service(17-11-22)
     * @param teamCode  团队id
     * @param startDate
     * @param endDate
@ -980,7 +980,7 @@ public class EsStatisticsController extends BaseController {
                                      @RequestParam(required = true) String endDate,
                                      @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsESService.getTeamConsultCount(teamCode, startDate, endDate, type));
            return write(200, "查询成功", "data", statisticsService.getTeamConsultCount(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1633,7 +1633,7 @@ public class EsStatisticsController extends BaseController {
                                            @ApiParam(name="endDate", value="开始时间 yyyy-MM-dd") @RequestParam(required = true)String endDate,
                                            @ApiParam(name="adminTeamId", value="团队ID") @RequestParam(required = true)Integer adminTeamId){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalCount(startDate,endDate,adminTeamId));
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalCount(startDate,endDate,adminTeamId));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1720,6 +1720,14 @@ public class EsStatisticsController extends BaseController {
        }
    }
    /**
     * 业务要求:这个接口要是实时的接口
     * @param level
     * @param area
     * @param disease
     * @param type
     * @return
     */
    @RequestMapping("/getPrescriptionTotalHistogram")
    @ResponseBody
    @ApiOperation("订单统计-中部树状图获取")
@ -1728,7 +1736,9 @@ public class EsStatisticsController extends BaseController {
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalHistogram(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease,type));
            return write(200, "查询成功", "data", statisticsService.getPrescriptionTotalHistogram(level,area,disease,type));
           // return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalHistogram(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -26,10 +26,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
/**
 * Created by lyr on 2016/08/16.
 * Created by lyr on 2016/08/16
 */
@Controller
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/oldstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@Api(description = "统计")
public class StatisticsController extends BaseController {

+ 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/

+ 8 - 2
patient-co/patient-co-wlyy/src/main/resources/config/fdfs_client.conf

@ -9,8 +9,14 @@ http.secret_key = FastDFS1234567890
#tracker_server = 172.19.103.54:22122
#-------------测试环境---------------#
tracker_server = 172.19.103.54:22122
#tracker_server = 172.19.103.54:22122
#-------------正式环境---------------#
#tracker_server = 192.168.120.172:22122
#外网项目地址
tracker_server = 192.168.120.172:22122
#网闸
#tracker_server = 59.61.92.90:9055
#内网项目地址
#tracker_server = 10.95.22.139:22122