Selaa lähdekoodia

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

yeshijie 7 vuotta sitten
vanhempi
commit
4d25a69cbd
43 muutettua tiedostoa jossa 762 lisäystä ja 289 poistoa
  1. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/reply/DoctorQuickReply.java
  2. 3 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionFollowupContent.java
  3. 43 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java
  4. 45 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallService.java
  5. 58 14
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java
  6. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/sign/SignFamilyService.java
  7. 2 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/team/patient/sign_family_allocate_js.jsp
  8. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/ConsultTeamDao.java
  9. 4 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java
  10. 109 7
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/DataSourceConfig.java
  11. 27 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/HibernateProperties.java
  12. 60 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/WlyyJpa.java
  13. 1 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/ConvertHelper.java
  14. 65 32
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DiseaseConvert.java
  15. 5 5
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DispensaryTypeConvert.java
  16. 5 5
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionStatusConvert.java
  17. 5 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java
  18. 1 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java
  19. 2 2
      patient-co/patient-co-statistics-es/src/main/resources/application-prod.yml
  20. 16 51
      patient-co/patient-co-statistics-es/src/main/resources/application.yml
  21. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java
  22. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorQuickReplyDao.java
  23. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java
  24. 53 39
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  25. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java
  26. 14 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  27. 4 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  28. 136 59
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java
  29. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  30. 16 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java
  31. 15 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  32. 8 24
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  33. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java
  34. 6 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java
  35. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  36. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  37. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java
  38. 1 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java
  39. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionFollowupContentController.java
  40. 7 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  41. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java
  42. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduDoctorArticleController.java
  43. 4 3
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/reply/DoctorQuickReply.java

@ -25,7 +25,7 @@ public class DoctorQuickReply extends IdEntity {
    private Integer status;
    // 类型 0为健康教育,1为续方咨询
    private Integer type;
    // 0为自定义消息  大于0的为系统消息
    // 0为自定义消息  大于1为系统消息(1体征和生活方式 2症状 3血糖 4血压)
    private Integer systag;
    public String getDoctor() {

+ 3 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionFollowupContent.java

@ -1,10 +1,10 @@
package com.yihu.wlyy.entity.patient.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Date;
/**
 * 续方咨询随访问卷表
@ -85,6 +85,7 @@ public class PrescriptionFollowupContent extends IdEntity {
	
	@Basic
	@Column(name = "create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}

+ 43 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -0,0 +1,43 @@
package com.yihu.wlyy.entity.call;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2017/11/9.
 */
@Entity
@Table(name = "manage_call_record")
public class CallRecord extends IdEntity {
    private String  code; //业务关联标识
    private String  callerNumber; //主叫号码
    private String  recipientNumber;//被叫号码
    private Integer  answerStatus;//接听状态: 1.接通,2. 队列中放弃,3.接通
    private Integer  serviceType; //服务类型:1.医生转接 2.代理咨询
    private String  serviceContent; //服务内容
    private Date createTime; //创建时间
    private Date  endTime; //通话结束时间
    private Date  updateTime; //更新时间
    private Date  callTime; //呼叫时间
    private String  talkTime; //通话时长(单位秒)格式 hh:mm:ss
    private String  userCode; //客服编码
    private String  userName; //客服名称
    private String  patient; //居民
    private String  patientName; //居民姓名
    private String  idcard; //身份证号
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 45 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallService.java

@ -0,0 +1,45 @@
package com.yihu.wlyy.entity.call;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2017/11/9.
 */
@Entity
@Table(name = "manage_call_service")
public class CallService extends IdEntity {
    private String code; //服务编号
    private String callCode; //关联通话记录
    private Integer serverType; //服务类型:0.医生咨询,1.预约挂号
    private String patient; //服务对象(患者code)
    private String patientName; // 服务对象名称(患者名称)
    private String ssc; // 社保卡号
    private String Idcard;  // 居民身份证号
    private String phone;  // 手机号
    private String doctor; // 医生code
    private String doctorName; //医生姓名
    private String serverContent; //服务内容
    private Integer state; //订单状态:0.草稿,1.待处理,2.完成
    private Date createTime; //创建时间
    private Date updateTime; //更新时间
    private String remark; //备注
    private Integer type; //服务类型:0.咨询,2.预约
    private Integer dealType; //处理方式:1.电话回复,2.客服回复
    private Date dealTime; //处理时间
    private Integer dealState; // 处理结果:1.完成,2.无法联系居民
    private String dealContent; // 处理内容
    private Integer dealReason; // 处理取消原因:0.没有号源、1.病人取消
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

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

@ -1,16 +1,21 @@
package com.yihu.wlyy.service.manager.feedback;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.entity.Message;
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;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.SMSDao;
import com.yihu.wlyy.repository.feedback.AppealDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.SMSService;
import com.yihu.wlyy.util.DateUtil;
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;
@ -25,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -46,6 +52,10 @@ public class AppealService extends BaseService {
    private SMSService smsService;
    @Autowired
    private SMSDao smsDao;
    @Value("${wlyyService.api}")
    private String wlyyService;
    @Autowired
    private MessageDao messageDao;
    @Value("${image.imgUrlDomain}")
    private String imgUrlDomain;
@ -190,19 +200,20 @@ public class AppealService extends BaseService {
        appeal.setStatus(2);
        appealDao.save(appeal);
        //发送处理完成短信
        //您某年某月某日在i健康平台提交的账号申诉已处理,请使用i健康应用(微信公众号)查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录
        //医生和居民用不同的内容,医生是i健康应用,居民是i健康微信公众号
        StringBuffer msgContent = new StringBuffer("您");
        msgContent.append(DateUtil.getYMD(appeal.getCreateTime()));
        msgContent.append("在i健康平台提交的账号申诉已处理,请使用");
        if(appeal.getIdentity()==1){
            msgContent.append("微信公众号");
        }else {
            msgContent.append("i健康应用");
        }
        msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
        JSONObject json = smsService.sendMsg(appeal.getPhone(),msgContent.toString());
        try {
            //发送处理完成短信
            //您某年某月某日在i健康平台提交的账号申诉已处理,请使用i健康应用(微信公众号)查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录
            //医生和居民用不同的内容,医生是i健康应用,居民是i健康微信公众号
            StringBuffer msgContent = new StringBuffer("您");
            msgContent.append(DateUtil.getYMD(appeal.getCreateTime()));
            msgContent.append("在i健康平台提交的账号申诉已处理,请使用");
            if (appeal.getIdentity() == 1) {
                msgContent.append("微信公众号");
            } else {
                msgContent.append("i健康应用");
            }
            msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
            JSONObject json = smsService.sendMsg(appeal.getPhone(), msgContent.toString());
        SMS sms = new SMS();
        Date date = new Date();
@ -226,5 +237,38 @@ public class AppealService extends BaseService {
            smsDao.save(sms);
        }
            if (appeal.getIdentity() == 2) {
                String creater = appeal.getCreater();
                SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                String newDate = formatDate.format(new Date());
                String title = "新增系统消息";
                String content = "您在" + newDate + "提交的意见反馈已处理,您可点此查看处理结果";
                Message message = new Message();
                message.setType(10);
                message.setCode(UUID.randomUUID().toString());
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setContent(content);
                message.setRead(1);//设置未读
                message.setReceiver(creater);//设置接受医生的code
                message.setSender("system");//设置发送的用户
                message.setTitle(title);
                message.setReadonly(1);//是否只读消息
                //wlyy给医生发送系统消息
                Doctor doctor = doctorDao.findByCode(creater);
                String doctorOpenID = doctor.getOpenid();
                String url = wlyyService + "/patient/feedback/sendMessage";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("receiver", creater));
                params.add(new BasicNameValuePair("title", title));
                params.add(new BasicNameValuePair("content", content));
                HttpClientUtil.post(url, params, "UTF-8");
                messageDao.save(message);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
}

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

@ -343,7 +343,7 @@ public class SignFamilyService extends BaseJpaService<SignFamily,Long> {
            }
            //更新IM内医生信息
            String sessionId = signFamily.getPatient()+"_consult_"+signFamily.getType();
            String imAddr = imUrl+"sessions/"+sessionId+"/participant/update";
            String imAddr = imUrl+"/sessions/"+sessionId+"/participant/update";
            JSONObject healthyparams = new JSONObject();
            if(!StringUtils.isEmpty(doctorHealth)) {
                healthyparams.put("user_id", signFamily.getDoctorHealth());

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/team/patient/sign_family_allocate_js.jsp

@ -253,7 +253,8 @@
									parent.window.closeAllocateDialog(res.msg);
									//$.Notice.success(data.msg);
								} else {
									$.Notice.error(data.msg);
									$.Notice.error(res.msg);
//									$.Notice.error(data.msg);
								}
							},
							error: function (data) {

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

@ -14,6 +14,6 @@ import java.util.List;
public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam, Long>, JpaSpecificationExecutor<ConsultTeam> {
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0")
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0 and a.type = 8")
	List<ConsultTeam> findUnfinishedConsult(String patient);
}

+ 4 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java

@ -7,11 +7,15 @@ import org.springframework.boot.context.web.ErrorPageFilter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
/**
 * Created by Administrator on 2016.10.12.
 */
@SpringBootApplication
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyEntityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager")
public class Application {
    public static ApplicationContext ctx = null;

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

@ -1,6 +1,8 @@
package com.yihu.wlyy.statistics.config;
import com.alibaba.druid.pool.DruidDataSource;
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.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
@ -15,27 +17,127 @@ import javax.sql.DataSource;
 */
@Configuration
public class DataSourceConfig {
    @Value("${spring.datasource.driverClassName}")
    private String driverClassName;
    @Value("${spring.datasource.initialSize}")
    private int initialSize;
    @Value("${spring.datasource.minIdle}")
    private int minIdle;
    @Value("${spring.datasource.maxActive}")
    private int maxActive;
    @Value("${spring.datasource.maxWait}")
    private int maxWait;
    @Value("${spring.datasource.timeBetweenEvictionRunsMillis}")
    private int timeBetweenEvictionRunsMillis;
    @Value("${spring.datasource.minEvictableIdleTimeMillis}")
    private int minEvictableIdleTimeMillis;
    @Value("${spring.datasource.validationQuery}")
    private String validationQuery;
    @Value("${spring.datasource.testWhileIdle}")
    private boolean testWhileIdle;
    @Value("${spring.datasource.testOnBorrow}")
    private boolean testOnBorrow;
    @Value("${spring.datasource.testOnReturn}")
    private boolean testOnReturn;
    @Value("${spring.datasource.primaryReadWrite.url}")
    private String primaryReadWriteUrl;
    @Value("${spring.datasource.primaryReadWrite.username}")
    private String primaryReadWriteUsername;
    @Value("${spring.datasource.primaryReadWrite.password}")
    private String primaryReadWritePassword;
    /**
     *  主数据源
     * @return
     */
    @Bean(name = "primaryReadWrite")
    @Primary//主库 默认不写名字用这个
    @ConfigurationProperties(prefix="spring.datasource.primaryReadWrite")
    public DataSource primaryReadWriteDataSource() {
        return DataSourceBuilder.create().build();
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadWriteUrl);
        datasource.setUsername(primaryReadWriteUsername);
        datasource.setPassword(primaryReadWritePassword);
        datasource.setDriverClassName(driverClassName);
        //configuration
        datasource.setInitialSize(initialSize);
        datasource.setMinIdle(minIdle);
        datasource.setMaxActive(maxActive);
        datasource.setMaxWait(maxWait);
        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
        datasource.setValidationQuery(validationQuery);
        datasource.setTestWhileIdle(testWhileIdle);
        datasource.setTestOnBorrow(testOnBorrow);
        datasource.setTestOnReturn(testOnReturn);
        return datasource;
    }
    @Value("${spring.datasource.primaryRead.url}")
    private String primaryReadUrl;
    @Value("${spring.datasource.primaryRead.username}")
    private String pprimaryReadUsername;
    @Value("${spring.datasource.primaryRead.password}")
    private String primaryReadPassword;
    @Bean(name = "primaryRead")
    @ConfigurationProperties(prefix="spring.datasource.primaryRead")
    public DataSource primaryReadDataSource() {
        return DataSourceBuilder.create().build();
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(primaryReadUrl);
        datasource.setUsername(pprimaryReadUsername);
        datasource.setPassword(primaryReadPassword);
        datasource.setDriverClassName(driverClassName);
        //configuration
        datasource.setInitialSize(initialSize);
        datasource.setMinIdle(minIdle);
        datasource.setMaxActive(maxActive);
        datasource.setMaxWait(maxWait);
        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
        datasource.setValidationQuery(validationQuery);
        datasource.setTestWhileIdle(testWhileIdle);
        datasource.setTestOnBorrow(testOnBorrow);
        datasource.setTestOnReturn(testOnReturn);
        return datasource;
    }
    @Value("${spring.datasource.im.url}")
    private String imUrl;
    @Value("${spring.datasource.im.username}")
    private String imUsername;
    @Value("${spring.datasource.im.password}")
    private String imPassword;
    @Bean(name = "imData")
    @ConfigurationProperties(prefix="spring.datasource.im")
    public DataSource imDataSource() {
        return DataSourceBuilder.create().build();
    public DataSource imDataSource() {DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(imUrl);
        datasource.setUsername(imUsername);
        datasource.setPassword(imPassword);
        datasource.setDriverClassName(driverClassName);
        //configuration
        datasource.setInitialSize(initialSize);
        datasource.setMinIdle(minIdle);
        datasource.setMaxActive(maxActive);
        datasource.setMaxWait(maxWait);
        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
        datasource.setValidationQuery(validationQuery);
        datasource.setTestWhileIdle(testWhileIdle);
        datasource.setTestOnBorrow(testOnBorrow);
        datasource.setTestOnReturn(testOnReturn);
        return datasource;
    }

+ 27 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/HibernateProperties.java

@ -0,0 +1,27 @@
package com.yihu.wlyy.statistics.config.jpa;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Properties;
/**
 * Created by chenweida on 2017/4/6.
 */
@Component
public class HibernateProperties {
    @Value("${hibernate.dialect}")
    private String dialect;
    @Value("${hibernate.show_sql}")
    private String show_sql;
    @Value("${hibernate.ejb.naming_strategy}")
    private String naming_strategy;
    public  Properties hibProperties() {
        Properties properties = new Properties();
        properties.put("hibernate.dialect",dialect);
        properties.put("hibernate.show_sql", show_sql);
        properties.put("hibernate.ejb.naming_strategy", naming_strategy);
        return properties;
    }
}

+ 60 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/WlyyJpa.java

@ -0,0 +1,60 @@
package com.yihu.wlyy.statistics.config.jpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
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 org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyEntityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager",
        basePackages = {"com.yihu.wlyy.statistics.dao"})   //设置Repository所在位置
public class WlyyJpa {
    @Autowired
    private HibernateProperties hibernateProperties;
    @Bean(name = "wlyyEntityManagerFactory")
    @Primary
    public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary(
            DataSource dataSource) {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.wlyy");
        emfb.setPersistenceUnitName("wlyy");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);
        emfb.setJpaProperties(hibernateProperties.hibProperties());
        return emfb;
    }
    @Bean(name = "wlyyTransactionManager")
    @Primary
    JpaTransactionManager transactionManagerSecondary(
            @Qualifier("wlyyEntityManagerFactory") EntityManagerFactory builder) {
        return new JpaTransactionManager(builder);
    }
}

+ 1 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/ConvertHelper.java

@ -46,9 +46,9 @@ public class ConvertHelper {
                Object obj = Class.forName(clazz).newInstance();
                Method method = obj.getClass().getMethod("convert", JdbcTemplate.class, List.class, String.class, WlyyDimensionQuota.class);
                data = (List<DataModel>) method.invoke(obj, jdbcTemplate, data, String.valueOf(i + 1), temp);
                filterModel.setData(data);
            }
        }
        filterModel.setData(data);
        return filterModel;
    }
}

+ 65 - 32
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DiseaseConvert.java

@ -22,46 +22,79 @@ public class DiseaseConvert implements Convert {
    @Override
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp) {
        List<DataModel> returnList = new ArrayList<>();
        Map<String, List<String>> prescriptionDiseaseMap = new HashMap<>();//key是处方code value是处方标签 1高血压 2糖尿病
        //初始化标签Map
        initHealthLabesMap(jdbcTemplate, prescriptionDiseaseMap);
//        Map<String, Object> map = initHealthLabesMap(jdbcTemplate, temp);
        //把标签Map设置到对应的维度里面
        for (DataModel dataModel : oneList) {
            List<String> healthProblems = prescriptionDiseaseMap.get(dataModel.getPrescriptionCode());
            if (healthProblems != null && healthProblems.size() > 0) {
                healthProblems.stream().forEach(str -> {
                    try {
                        DataModel dataModelTemp = new DataModel();
                        BeanUtils.copyProperties(dataModel, dataModelTemp);
                        DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(dataModelTemp, str);
                        returnList.add(dataModelTemp);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                });
        List<String> keyList = null;
        for(DataModel one:oneList){
            try {
                keyList = initHealthLabesMap(jdbcTemplate, temp, one);
                for(String key:keyList){
                    DataModel dataModelTemp = new DataModel();
                    BeanUtils.copyProperties(one, dataModelTemp);
                    DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(dataModelTemp, key);
                    returnList.add(dataModelTemp);
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
//            List<String> healthProblems = prescriptionDiseaseMap.get(dataModel.getPrescriptionCode());
//            if (healthProblems != null && healthProblems.size() > 0) {
//                healthProblems.stream().forEach(str -> {
//                    try {
//                        DataModel dataModelTemp = new DataModel();
//                        BeanUtils.copyProperties(dataModel, dataModelTemp);
//                        DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(dataModelTemp, str);
//                        returnList.add(dataModelTemp);
//                    } catch (Exception e) {
//                        e.printStackTrace();
//                    }
//                });
//            }
        }
        return returnList;
    }
    private void initHealthLabesMap(JdbcTemplate jdbcTemplate, Map<String, List<String>> prescriptionDiseaseMap) {
        //得到长处方的疾病标签(只要高血压 糖尿病)
    private List<String> initHealthLabesMap(JdbcTemplate jdbcTemplate, WlyyDimensionQuota temp,DataModel dataModel) {
//        //得到长处方的疾病标签(只要高血压 糖尿病)
//        String sql = "SELECT " +
//                "  health_problem ," +
//                "  prescription_code " +
//                "FROM " +
//                "  wlyy_prescription_diagnosis " +
//                "WHERE " +
//                "  health_problem = 'HP0047' " +
//                "OR health_problem = 'HP0093' ";
//        List<PrescriptionDisease> prescriptionDiseases = jdbcTemplate.query(sql, new BeanPropertyRowMapper(PrescriptionDisease.class));
//        prescriptionDiseases.stream().forEach(one -> {
//            List<String> labels = prescriptionDiseaseMap.get(one.getPrescriptionCode());
//            if (labels == null) {
//                labels = new ArrayList<String>();
//            }
//            labels.add(one.getHealthProblem());
//            prescriptionDiseaseMap.put(one.getPrescriptionCode(), labels);
//        });
        List<String> key = new ArrayList<>();
        String sql = "SELECT " +
                "  health_problem ," +
                "  prescription_code " +
                "FROM " +
                "  health_problem AS healthProblem ," +
                "  prescription_code AS prescriptionCode " +
                "  FROM " +
                "  wlyy_prescription_diagnosis " +
                "WHERE " +
                "  health_problem = 'HP0047' " +
                "OR health_problem = 'HP0093' ";
        List<PrescriptionDisease> prescriptionDiseases = jdbcTemplate.query(sql, new BeanPropertyRowMapper(PrescriptionDisease.class));
        prescriptionDiseases.stream().forEach(one -> {
            List<String> labels = prescriptionDiseaseMap.get(one.getPrescriptionCode());
            if (labels == null) {
                labels = new ArrayList<String>();
            }
            labels.add(one.getHealthProblem());
            prescriptionDiseaseMap.put(one.getPrescriptionCode(), labels);
        });
                "  WHERE " +
                "  prescription_code = '"+dataModel.getPrescriptionCode() +"'";
        List<Map<String, Object>>  diagnosisList =jdbcTemplate.queryForList(sql);
//        List<Map<String, Object>> dictList = jdbcTemplate.queryForList(temp.getDictSql());
        for (Map<String, Object> map:diagnosisList){
//            String diagnosis = map.get("healthProblem")+"";
//            for(Map<String, Object> dict:dictList){
//                if(diagnosis.equals(dict.get("code"))){
//                    key.add()
//                }
//            }
            key.add(map.get("healthProblem").toString());
        }
        return key;
    }
}

+ 5 - 5
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DispensaryTypeConvert.java

@ -13,19 +13,19 @@ import java.util.List;
 * Created by zhangdan on 2017/10/26.
 */
public class DispensaryTypeConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        for(DataModel one:oneList){
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
//                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方配送方式
                String sql ="SELECT dispensary_type FROM wlyy_prescription WHERE code=?";
                Object[] args = {value};
                Object[] args = {one.getPrescriptionCode()};
                String type=jdbcTemplate.queryForObject(sql,args,String.class);
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, type);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        };
        return oneList;
    }
}

+ 5 - 5
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionStatusConvert.java

@ -19,21 +19,21 @@ import java.util.Map;
 * Created by zhangdan on 2017/10/26.
 */
public class PrescriptionStatusConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        for(DataModel one:oneList){
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
//                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方状态
                String sql ="SELECT status FROM wlyy_prescription WHERE code=?";
                //int status = jdbcTemplate.queryForObject(sql, Integer.class);
                Object[] args = {value};
                Object[] args = {one.getPrescriptionCode()};
                int status=jdbcTemplate.queryForObject(sql,args,Integer.class);
                String key = getStatusCode(status);
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, key);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        };
        return oneList;
    }

+ 5 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java

@ -193,8 +193,12 @@ public class ExtractDataService {
            //
            quotaResults.stream().forEach(one -> {
                SaveModel saveModelTemp = new SaveModel();
                if("25".equals(one.getQuatoCode())){
                    //25的咨询到达量 存到3的到达量去
                    saveModelTemp.setQuotaCode("3");
                }else{
                saveModelTemp.setQuotaCode(one.getQuatoCode());
                }
                saveModelTemp.setQuotaDate(one.getQuotaDate());
                saveModelTemp.setCreateTime(one.getCreateTime());
                saveModelTemp.setCity(one.getCity());

+ 1 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -300,6 +300,7 @@ public class JobService {
        int day = daysBetween(startDate, endDate);
        for (int i = 0; i < day; i++) {
            Cache.cleanCache();//清空缓存
            Thread.sleep(60000L);//休息60秒
            productDataByOneDay(getYesterday(i, startDate));
        }
    }

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

@ -3,11 +3,11 @@ spring:
  datasource:
    primaryReadWrite:
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      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:8079/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库:

+ 16 - 51
patient-co/patient-co-statistics-es/src/main/resources/application.yml

@ -13,57 +13,17 @@ spring:
        service-url: http://localhost:8082
  datasource:
    primaryReadWrite:
      driver-class-name: com.mysql.jdbc.Driver
      max-active: 50
      max-idle: 50 #最大空闲连接
      min-idle: 10 #最小空闲连接
      validation-query-timeout: 20
      log-validation-errors: true
      validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
      validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
      test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
      test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
      idle-timeout: 30000
      connection-test-query: SELECT 1
      num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
      test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
      min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
      time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    primaryRead:
      driver-class-name: com.mysql.jdbc.Driver
      max-active: 50
      max-idle: 50 #最大空闲连接
      min-idle: 10 #最小空闲连接
      validation-query-timeout: 20
      log-validation-errors: true
      validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
      validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
      test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
      test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
      idle-timeout: 30000
      connection-test-query: SELECT 1
      num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
      test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
      min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
      time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    im:
      driver-class-name: com.mysql.jdbc.Driver
      max-active: 50
      max-idle: 50 #最大空闲连接
      min-idle: 10 #最小空闲连接
      validation-query-timeout: 20
      log-validation-errors: true
      validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
      validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
      test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
      test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
      idle-timeout: 30000
      connection-test-query: SELECT 1
      num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
      test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
      min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
      time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    driverClassName: com.mysql.jdbc.Driver
    initialSize: 20
    maxActive: 50
    minIdle: 50 #最大空闲连接
    maxWait: 10
    validationQuery: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    testOnBorrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    testOnReturn: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    testWhileIdle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    minEvictableIdleTimeMillis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    timeBetweenEvictionRunsMillis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    # REDIS
  redis:
@ -97,6 +57,11 @@ logging:
  level:
    root: INFO
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: false
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
JobService:
  sleepTime: 30000

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -293,4 +293,7 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("select a.doctor from ConsultTeam a where team = ?1  and del = '1' and type=?2 ")
	List<Object> findByTeamAndType(String fromConsult, int type);
	
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0 and a.type = 8")
	List<ConsultTeam> findUnfinishedConsultPrescription(String code);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorQuickReplyDao.java

@ -32,6 +32,6 @@ public interface DoctorQuickReplyDao extends PagingAndSortingRepository<DoctorQu
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.status = 1")
    List<DoctorQuickReply> findDoctorReplies(String doctor, Sort sort);
    
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.status = 1")
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.type = ?2 and q.status = 1")
    List<DoctorQuickReply> findDoctorRepliesByType(String doctor, Integer type ,Sort sort);
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java

@ -9,6 +9,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -71,4 +72,8 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
     */
    @Query("select a from Followup a where a.prescriptionCode = ?1 and a.status <> '0'")
	Followup getFollowupByPrescriptionCode(String prescriptionCode);
    
    @Modifying
    @Query("update Followup a set a.status=?2 where a.prescriptionCode = ?1 ")
    void updateStatusByPrescriptionCode(String prescriptionCode, Integer status);
}

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

@ -1009,38 +1009,38 @@ public class ConsultTeamService extends ConsultService {
            //3、获取上次续方时间:与平安的“智慧医保的审方系统”对接,判断居民上次续方时间,点击跳转上次续方记录。(此功能需与第三方系统对接,如果本次版本无法实现,则消息中不显示此条信息)
            jsonObject.put("lastTime","");
    
            //--增加问卷填写情况---huangwenjie--2017.11.01
            List<PrescriptionFollowupContent> prescriptionFollowupContents =prescriptionFollowupContentDao.findByPrescriptionCode(prescription.getCode());
            boolean zzFlag = false;//是否填写症状问卷
            boolean tzssFlag = false;//是否填写体征和生活问卷
            for (PrescriptionFollowupContent prescriptionFollowupContent: prescriptionFollowupContents) {
                if(!zzFlag && "1".equals(prescriptionFollowupContent.getFollowupProject())){
                    zzFlag = true;
                }
    
                if(!tzssFlag &&
                        ("2".equals(prescriptionFollowupContent.getFollowupProject())
                                || "4".equals(prescriptionFollowupContent.getFollowupProject()))
                        ){
                    zzFlag = true;
                }
                
                if(zzFlag && tzssFlag){
                    break;
                }
            }
            if(zzFlag){
                jsonObject.put("zzMsg","居民已填写问卷");
            }else{
                jsonObject.put("zzMsg","居民未填写问卷");
            }
            if(tzssFlag){
                jsonObject.put("tzssMsg","居民已填写问卷");
            }else{
                jsonObject.put("tzssMsg","居民未填写问卷");
            }
            jsonObject.put("zzFlag",zzFlag);
            jsonObject.put("tzssFlag",tzssFlag);
//            //--增加问卷填写情况---huangwenjie--2017.11.01---已和产品确认,这块消息不在续方咨询消息中添加
//            List<PrescriptionFollowupContent> prescriptionFollowupContents =prescriptionFollowupContentDao.findByPrescriptionCode(prescription.getCode());
//            boolean zzFlag = false;//是否填写症状问卷
//            boolean tzssFlag = false;//是否填写体征和生活问卷
//            for (PrescriptionFollowupContent prescriptionFollowupContent: prescriptionFollowupContents) {
//                if(!zzFlag && "1".equals(prescriptionFollowupContent.getFollowupProject())){
//                    zzFlag = true;
//                }
//
//                if(!tzssFlag &&
//                        ("2".equals(prescriptionFollowupContent.getFollowupProject())
//                                || "4".equals(prescriptionFollowupContent.getFollowupProject()))
//                        ){
//                    zzFlag = true;
//                }
//
//                if(zzFlag && tzssFlag){
//                    break;
//                }
//            }
//            if(zzFlag){
//                jsonObject.put("zzMsg","居民已填写问卷");
//            }else{
//                jsonObject.put("zzMsg","居民未填写问卷");
//            }
//            if(tzssFlag){
//                jsonObject.put("tzssMsg","居民已填写问卷");
//            }else{
//                jsonObject.put("tzssMsg","居民未填写问卷");
//            }
//            jsonObject.put("zzFlag",zzFlag);
//            jsonObject.put("tzssFlag",tzssFlag);
            
            
            
@ -1141,20 +1141,27 @@ public class ConsultTeamService extends ConsultService {
            followup.setPatientCode(patient);
            followup.setPatientName(patientObj.getName());
            followup.setIdcard(patientObj.getIdcard());
            followup.setFollowupType(String.valueOf(type));
            
            if(3 == type){
                followup.setFollowupType("1,2");
            }else{
                followup.setFollowupType(String.valueOf(type));
            }
            
            if(2 == doctor.getLevel()){//全科
                followup.setFollowupClass("22");
            }else if(3 == doctor.getLevel()){//健管
                followup.setFollowupClass("10");
            }
            followup.setDataFrom("2");//数据来源 1基卫 2APP
            followup.setStatus("3");     //状态 0取消 1已完成 2未开始 3进行中
            followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
            followup.setCreateTime(new Date());
            followup.setCreater(doctorCode);
            followup.setAdminTeamCode(signFamily.getAdminTeamId());
            followup.setSignType(2);
            //保存质询code
            followup.setSignCode(patientService.getSignCodeByPatient(patient));
            followup.setPrescriptionCode(prescription.getCode());
            followupDao.save(followup);
            return 1;
@ -2624,11 +2631,13 @@ public class ConsultTeamService extends ConsultService {
     * @param type
     */
    public void addPrescriptionBloodStatusConsult(String prescriptionCode, String type,String followupid) throws Exception {
        
        if("1".equals(type)){//血压
            prescriptionFollowupContentService.importPatientBloodPressureToFollowup(prescriptionCode,followupid,true);
        }else if("2".equals(type)){//血糖
            prescriptionFollowupContentService.importPatientBloodSugarToFollowup(prescriptionCode,followupid,true);
        }
        
    }
    
    /**
@ -2638,15 +2647,20 @@ public class ConsultTeamService extends ConsultService {
     */
    public void addPrescriptionFollowupContentConsult(String prescriptionCode, String type, String followupid) throws Exception {
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        org.json.JSONObject contentDoctor = new org.json.JSONObject();
        org.json.JSONObject contentobj = new org.json.JSONObject();
        //医生发送的消息
        if("1".equals(type)){
            contentDoctor.put("text", "请填写您近期身份异常症状问卷");
            contentobj.put("text","请填写您近期身份异常症状问卷");
        }else{
            contentDoctor.put("text", "请填写您近期体征及生活方式调查问卷");
            contentobj.put("text","请填写您近期体征及生活方式调查问卷");
        }
        contentDoctor.put("type",type);
        contentobj.put("doctorremind","已向居民发送问卷填写请求,填写完成后您将收到消息提醒");
        contentobj.put("patientremind","填写完成并提交后,医生将可以查看您的问卷内容");
        contentobj.put("msgType",type);
        //医生发送Im消息
        ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "17", contentDoctor.toString(), null);
        ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "17", contentobj.toString(), null);
    
        //居民发送Im消息
        ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "17", contentobj.toString(), null);
    }
}

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

@ -309,7 +309,7 @@ public class FollowUpService extends BaseService {
                        followup.put("followupClassName", "高血压");
                    } else if (objArr[4].toString().equals("2")) {
                        followup.put("followupClassName", "糖尿病");
                    } else if (objArr[4].toString().equals("3")) {
                    } else if (objArr[4].toString().equals("1,2")) {
                        followup.put("followupClassName", "高血压,糖尿病");
                    } else {
                    }

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

@ -888,13 +888,17 @@ public class PatientHealthIndexService extends BaseService {
            }
    
            obj = patientHealthIndexDao.save(obj);
    
            //判断是否有未结束的续方咨询,发送消息给对应的医生
            sendPrescriptionHealthIndexMsgresult(obj,patient);
    
            //保存完后上传基卫
            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
//            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
        } else {
            throw new Exception("不存在该患者!");
        }
        return obj;
    }
    
@ -905,7 +909,7 @@ public class PatientHealthIndexService extends BaseService {
     */
    private void sendPrescriptionHealthIndexMsgresult(DevicePatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsult(patient.getCode());
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsultPrescription(patient.getCode());
        
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
@ -913,9 +917,11 @@ public class PatientHealthIndexService extends BaseService {
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1());
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1()+" mmol/L");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",1);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
@ -928,7 +934,9 @@ public class PatientHealthIndexService extends BaseService {
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",2);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -486,7 +486,8 @@ public class PrescriptionExpressageService extends BaseService {
                        "  p.patient AS patientCode, " +
                        "  py.charge_time AS chargeTime, " +
                        "  p.dispensary_type AS dispensaryType, " +
                        "  p.`status` " +
                        "  p.`status` ," +
                        "  p.code AS prescriptionCode " +
                        " FROM " +
                        " wlyy_prescription p " +
                        " JOIN wlyy_prescription_pay py ON py.prescription_code = p.`code` " +
@ -587,6 +588,8 @@ public class PrescriptionExpressageService extends BaseService {
                "  p.dispensary_type AS dispensaryType, " +
                "  p.drug_delivery_operator_name AS operatorName," +
                "  p.drug_delivery_flag AS drugDeliveryFlag, " +
                "  p.drug_delivery_time AS drugDeliveryTime," +
                "  p.code AS prescriptionCode," +
                "  p.`status` " +
                " FROM " +
                " wlyy_prescription p " +

+ 136 - 59
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java

@ -91,6 +91,7 @@ public class PrescriptionFollowupContentService extends BaseService {
		JSONArray objects = JSON.parseArray(followupProjectData);
		
		if(objects!= null & objects.size() >0){
			boolean isSendTZSHMsg = false;//是否已发送过体征和生活方式消息
			for (int i = 0; i < objects.size(); i++) {
				List<PrescriptionFollowupContent> savedatas = new ArrayList<>();
				JSONObject jsonObject = objects.getJSONObject(i);
@ -107,6 +108,7 @@ public class PrescriptionFollowupContentService extends BaseService {
							prescriptionFollowupContent.setFollowupKey(key);
							prescriptionFollowupContent.setFollowupValue(value);
							prescriptionFollowupContent.setPatientCode(patientCode);
							prescriptionFollowupContent.setCreateTime(new Date());
							savedatas.add(prescriptionFollowupContent);
						});
					}
@ -120,12 +122,19 @@ public class PrescriptionFollowupContentService extends BaseService {
						content.put("title", "【本消息为系统提醒】:");
						if("1".equals(followupProject)){
							content.put("text", "居民已填写《身份异常症状问卷》");
							content.put("msgType", 1);
						}else{
							if(isSendTZSHMsg){//判断是否已发送过,避免重复发送
								continue;
							}
							content.put("text", "居民已填写《体征及生活方式调查问卷》");
							isSendTZSHMsg = true;
							content.put("msgType", 2);
						}
						content.put("sysMsg","填写完成并提交后,医生将可以查看您的问卷内容");
						Prescription p = prescriptionDao.findByCode(prescriptioncode);
						ImUtill.sendTopicIM(p.getDoctor(), p.getDoctorName(), p.getConsult(), "17", content.toString(), null);
//						System.out.println(content.toString());
						ImUtill.sendTopicIM(p.getPatient(), p.getPatientName(), p.getConsult(), "17", content.toString(), null);
					}
				}
			}
@ -149,7 +158,7 @@ public class PrescriptionFollowupContentService extends BaseService {
		for (PrescriptionFollowupContent prescriptionFollowupContent: list) {
			
			if("1".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent1 != null){
				if(prescriptionFollowupContent1 == null){
					prescriptionFollowupContent1 = prescriptionFollowupContent;
				}else{
					continue;
@ -157,7 +166,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			}
			
			if("2".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent2 != null){
				if(prescriptionFollowupContent2 == null){
					prescriptionFollowupContent2 = prescriptionFollowupContent;
				}else{
					continue;
@ -165,7 +174,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			}
			
			if("4".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent2 != null){
				if(prescriptionFollowupContent2 == null){
					prescriptionFollowupContent2 = prescriptionFollowupContent;
				}else{
					continue;
@ -174,24 +183,33 @@ public class PrescriptionFollowupContentService extends BaseService {
		}
		
		JSONArray result = new JSONArray();
		
		JSONObject jsonObject1 = new JSONObject();
		if(prescriptionFollowupContent1 != null){
			JSONObject jsonObject1 = new JSONObject();
			jsonObject1.put("type","1");
			jsonObject1.put("name","身份异常症状问卷");
			jsonObject1.put("statue","1");//1已填写,2未填写
			jsonObject1.put("createtime",prescriptionFollowupContent1.getCreateTime());
			result.add(jsonObject1);
			jsonObject1.put("createtime",DateUtil.dateToStrLong(prescriptionFollowupContent1.getCreateTime()));
		}else{
			jsonObject1.put("type","1");
			jsonObject1.put("name","身份异常症状问卷");
			jsonObject1.put("statue","2");//1已填写,2未填写
			jsonObject1.put("createtime","");
		}
		result.add(jsonObject1);
		
		JSONObject jsonObject2 = new JSONObject();
		if(prescriptionFollowupContent2 != null){
			JSONObject jsonObject2 = new JSONObject();
			jsonObject2.put("type","2");
			jsonObject2.put("name","体征及生活方式调查问卷");
			jsonObject2.put("statue","1");//1已填写,2未填写
			jsonObject2.put("createtime",prescriptionFollowupContent1.getCreateTime());
			result.add(jsonObject2);
			jsonObject2.put("createtime",DateUtil.dateToStrLong(prescriptionFollowupContent2.getCreateTime()));
		}else{
			jsonObject2.put("type","2");
			jsonObject2.put("name","体征及生活方式调查问卷");
			jsonObject2.put("statue","2");//1已填写,2未填写
			jsonObject2.put("createtime","");
		}
		result.add(jsonObject2);
		
		return result;
	}
@ -259,9 +277,9 @@ public class PrescriptionFollowupContentService extends BaseService {
		
		Prescription prescription = prescriptionDao.findByCode(prescriptioncode);
		
		String patientCode = prescription.getParentCode();
		String patientCode = prescription.getPatient();
		
		String stardate = DateUtil.getNextMonth(new Date(),-30)+" 00:00:00";
		String stardate = DateUtil.getNextMonth(new Date(),-1)+" 00:00:00";
		String enddate = DateUtil.getStringDateShort()+" 23:59:59";
		
		List<Object> list = healthIndexService.findIndexByPatient2(patientCode, 1, stardate, enddate, 0, 2);
@ -272,7 +290,17 @@ public class PrescriptionFollowupContentService extends BaseService {
		org.json.JSONObject contentDoctor = new org.json.JSONObject();
		org.json.JSONObject contentPatient = new org.json.JSONObject();
		String imBloodSugarValue = "";
		String imBloodSugarDate = "";
		Date imBloodSugarDate = new Date();
		
		int total = 0;
		String sql = "select sum(category_code) amount FROM wlyy_patient_device WHERE user='"+prescription.getPatient()+"'";
		List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
		if (result != null && result.size() > 0) {
			total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
		}
		if(total != 1 || total != 3){
			contentDoctor.put("deviceMsg","您未绑定血糖智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
		}
		
		if(!list.isEmpty()){
			
@ -280,22 +308,52 @@ public class PrescriptionFollowupContentService extends BaseService {
				
				JSONObject obj = (JSONObject)o;
				
				imBloodSugarDate = obj.getString("recordDate");
				imBloodSugarDate = obj.getDate("recordDate");
				
				int index = Integer.valueOf(obj.getString("value2"));
				String value1 = obj.getString("value1");
				// 餐后
				if (index % 2 == 0) {
					if(StringUtils.isNotBlank(value1)){
						followupProjectData = "{'BS_FPG':'"+obj.getString("value1")+"'}";
						break;
					}
				} else { //餐前
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value1")+"'}";
				//餐前
				if(StringUtils.isNotBlank(obj.getString("value1"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value1")+"'}";
					imBloodSugarValue = obj.getString("value1");
					break;
				}
				
				if(StringUtils.isNotBlank(obj.getString("value3"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value3")+"'}";
					imBloodSugarValue = obj.getString("value3");
					break;
				}
				
				if(StringUtils.isNotBlank(obj.getString("value5"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value5")+"'}";
					imBloodSugarValue = obj.getString("value5");
					break;
				}
				//餐后
				if(StringUtils.isNotBlank(obj.getString("value2"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value2")+"'}";
					imBloodSugarValue = obj.getString("value2");
					break;
				}
				
				
				if(StringUtils.isNotBlank(obj.getString("value4"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value4")+"'}";
					imBloodSugarValue = obj.getString("value4");
					break;
				}
				
				if(StringUtils.isNotBlank(obj.getString("value6"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value6")+"'}";
					imBloodSugarValue = obj.getString("value6");
					break;
				}
				
				//随机血糖
				if(StringUtils.isNotBlank(obj.getString("value7"))){
					followupProjectData = "{'RANDOM_BLOOD_SUGAR':'"+obj.getString("value7")+"'}";
					imBloodSugarValue = obj.getString("value7");
					break;
				}
			}
			
			followUpService.esSaveFollowupProjectData(followup_id, "3", followupProjectData);
@ -304,26 +362,18 @@ public class PrescriptionFollowupContentService extends BaseService {
			if(sendIM){
				//医生发送的消息
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needupload",false);
				contentDoctor.put("needUpload","false");
				contentDoctor.put("type",2);
				int total = 0;
				String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user="+prescription.getPatient();
				List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
				if (result != null && result.size() > 0) {
					total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
				}
				if(total != 1 || total != 3){
					contentDoctor.put("deviceMsg","您未绑定血糖智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
				//患者发送的消息
				contentPatient.put("title", "【本消息为系统提醒】:");
				contentPatient.put("tzMsg", "体征记录:血糖"+imBloodSugarValue);
				contentPatient.put("tzTime", "检测时间:"+imBloodSugarDate);
				contentPatient.put("tzMsg", "体征记录:血糖 "+imBloodSugarValue+"mmol/L");
				contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStr(imBloodSugarDate,"yyyy-MM-dd HH:mm:ss"));
				contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
				contentPatient.put("needUpload","false");
				contentPatient.put("type",2);
				
				//患者发送Im消息
@ -333,9 +383,22 @@ public class PrescriptionFollowupContentService extends BaseService {
			//是否需要发送IM消息
			if(sendIM){
				//医生发送的消息
				contentDoctor.put("text", "居民近30天未上传血糖体征数据,已通知居民上传数据,请耐心等待");
				contentDoctor.put("needupload",true);
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needUpload","true");
				contentDoctor.put("type",2);
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
				//患者发送的消息
				contentPatient.put("title", "【本消息为系统提醒】:");
				contentPatient.put("tzMsg", "体征记录:无");
				contentPatient.put("tzTime", "检测时间:");
				contentPatient.put("tzAlert","温馨提示:居民近30天未上传血糖体征数据,已通知居民上传数据,请耐心等待");
				contentPatient.put("needUpload","true");
				contentPatient.put("type",2);
				
				//患者发送Im消息
				ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "16", contentPatient.toString(), null);
			}else{
				throw new Exception("未找到30天内的血糖记录!");
			}
@ -361,9 +424,9 @@ public class PrescriptionFollowupContentService extends BaseService {
		
		Prescription prescription = prescriptionDao.findByCode(prescriptioncode);
		
		String patientCode = prescription.getParentCode();
		String patientCode = prescription.getPatient();
		
		String stardate = DateUtil.getNextMonth(new Date(),-30)+" 00:00:00";
		String stardate = DateUtil.getNextMonth(new Date(),-1)+" 00:00:00";
		String enddate = DateUtil.getStringDateShort()+" 23:59:59";
		org.json.JSONArray jsonArray = healthIndexService.findIndexByPatient(patientCode, 2, stardate, enddate, 0, 2);
		
@ -372,30 +435,30 @@ public class PrescriptionFollowupContentService extends BaseService {
		org.json.JSONObject contentDoctor = new org.json.JSONObject();
		org.json.JSONObject contentPatient = new org.json.JSONObject();
		
		int total = 0;
		String sql = "select sum(category_code) amount FROM wlyy_patient_device WHERE user='"+prescription.getPatient()+"'";
		List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
		if (result != null && result.size() > 0) {
			total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
		}
		if(total != 2 || total != 3){
			contentDoctor.put("deviceMsg","您未绑定血压智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
		}
		
		if(jsonArray.length() > 0){
			
			org.json.JSONObject jsonObject = jsonArray.getJSONObject(0);
			
			followupProjectData = "{'BP_D':'"+jsonObject.getString("value1")+"'BP_U':'"+jsonObject.getString("value2")+"'}";
			followupProjectData = "{'BP_D':'"+jsonObject.getString("value1")+"','BP_U':'"+jsonObject.getString("value2")+"'}";
			followUpService.esSaveFollowupProjectData(followup_id, "2", followupProjectData);
			
			//是否需要发送IM消息
			if(sendIM){
				//医生发送的消息
				contentDoctor.put("text", "请提供您最近一次的血压检测数值及检测时间");
				contentDoctor.put("needUpload",false);
				contentDoctor.put("needUpload","false");
				contentDoctor.put("type",1);
				
				int total = 0;
				String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user="+prescription.getPatient();
				List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
				if (result != null && result.size() > 0) {
					total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
				}
				if(total != 2 || total != 3){
					contentDoctor.put("deviceMsg","您未绑定血压智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
@ -404,6 +467,7 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentPatient.put("tzMsg", "体征记录:血压"+jsonObject.getString("value1")+"/"+jsonObject.getString("value2")+" mmHg");
				contentPatient.put("tzTime", "检测时间:"+jsonObject.getString("date"));
				contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
				contentPatient.put("needUpload","false");
				contentPatient.put("type",1);
				
				//患者发送Im消息
@ -412,15 +476,28 @@ public class PrescriptionFollowupContentService extends BaseService {
		}else{
			//是否需要发送IM消息
			if(sendIM){
				
				//医生发送的消息
				contentDoctor.put("text", "居民近30天未上传血压体征数据,已通知居民上传数据,请耐心等待");
				contentDoctor.put("needupload",true);
				contentDoctor.put("text", "请提供您最近一次的血压检测数值及检测时间");
				contentDoctor.put("needUpload","true");
				contentDoctor.put("type",1);
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
				//患者发送Im消息
				contentPatient.put("title", "【本消息为系统提醒】:");
				contentPatient.put("tzMsg", "体征记录:无");
				contentPatient.put("tzTime", "检测时间:");
				contentPatient.put("tzAlert","温馨提示:居民近30天未上传血压体征数据,已通知居民上传数据,请耐心等待");
				contentPatient.put("needUpload","true");
				contentPatient.put("type",1);
				
				//患者发送Im消息
				ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "16", contentPatient.toString(), null);
			}else{
				throw new Exception("未找到30天内的血压记录!");
			}
		}
	
	}
	
@ -470,7 +547,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			}
			//近30天血压
			String stardate = DateUtil.getNextMonth(new Date(),-30)+" 00:00:00";
			String stardate = DateUtil.getNextMonth(new Date(),-1)+" 00:00:00";
			String enddate = DateUtil.getStringDateShort()+" 23:59:59";
			org.json.JSONArray jsonArray = healthIndexService.findIndexByPatient(patientCode, 2, stardate, enddate, 0, 2);
			if(jsonArray.length() > 0){
@ -486,7 +563,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			List<PrescriptionFollowupContent>  list3 = prescriptionFollowupContentDao.findByPrescriptionCodeAndFollowupProject(prescriptioncode,"4");
			
			if(!list3.isEmpty()){
				for (PrescriptionFollowupContent prescriptionFollowupContent: list2) {
				for (PrescriptionFollowupContent prescriptionFollowupContent: list3) {
					datamap3.put(prescriptionFollowupContent.getFollowupKey(),prescriptionFollowupContent.getFollowupValue());
				}
			}

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -10,6 +10,7 @@ import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
@ -96,6 +97,8 @@ public class PrescriptionInfoService extends BaseService {
    private PrescriptionReviewedReasonDao prescriptionReviewedReasonDao;
    @Autowired
    private PrescriptionAdjustReasonDao prescriptionAdjustReasonDao;
    @Autowired
    private FollowUpDao followUpDao;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
@ -649,7 +652,10 @@ public class PrescriptionInfoService extends BaseService {
                //获取智业待结算接口,更新药品金额
                prescriptionService.getPerscriptionInfoCostFromPayInfo(p.getCode());
                
                //更新随访记录的状态为完成
                followUpDao.updateStatusByPrescriptionCode(p.getCode(),1);
                
                //发送Im消息
                JSONObject content = new JSONObject();
                content.put("title", "我已经审核您" + DateUtil.dateToStr(p.getCreateTime(), "yyyy-MM-dd") + "发起的续方申请");
@ -877,6 +883,8 @@ public class PrescriptionInfoService extends BaseService {
                p.setJwDeptCode(dept);
                p.setJwRegisterFee(registerFee);
                p.setJwGisterTypeCode(rateTypeCode);//挂号类型
                
                
            } else {
                //审核不通过
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());

+ 16 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java

@ -41,6 +41,7 @@ public class DoctorQuickReplyService extends BaseService {
        reply.setSort(sort);
        reply.setUpdateTime(new Date());
        reply.setType(Integer.parseInt(type));
        reply.setSystag(0);
        return quickReplyDao.save(reply);
    }
@ -95,18 +96,28 @@ public class DoctorQuickReplyService extends BaseService {
     * @param doctor
     * @return
     */
    public List<DoctorQuickReply> getDoctorReplyList(String doctor,String type) {
    public List<DoctorQuickReply> getDoctorReplyList(String doctor,String type) throws Exception{
        Sort sort = new Sort(Sort.Direction.DESC, "sort");
        List<DoctorQuickReply> replies = quickReplyDao.findDoctorRepliesByType(doctor, Integer.parseInt(type),sort);
        
        if("1".equals(type)){
        if(replies.isEmpty() && "1".equals(type)){
            //如果是续方咨询,拿到的列表为空,则默认添加系统消息
            List<DoctorQuickReply> defaults = quickReplyDao.findDoctorReplies("default",sort);
    
            List<DoctorQuickReply> newList = new ArrayList<>();
            
            for (DoctorQuickReply doctorQuickReply:defaults) {
                doctorQuickReply.setId(null);
                doctorQuickReply.setDoctor(doctor);
                DoctorQuickReply doctorQuickReplyThis = new DoctorQuickReply();
                doctorQuickReplyThis.setDoctor(doctor);
                doctorQuickReplyThis.setType(doctorQuickReply.getType());
                doctorQuickReplyThis.setContent(doctorQuickReply.getContent());
                doctorQuickReplyThis.setSort(doctorQuickReply.getSort());
                doctorQuickReplyThis.setSystag(doctorQuickReply.getSystag());
                doctorQuickReplyThis.setStatus(doctorQuickReply.getStatus());
                doctorQuickReplyThis.setUpdateTime(new Date());
                newList.add(doctorQuickReplyThis);
            }
            quickReplyDao.save(defaults);
            quickReplyDao.save(newList);
    
            replies = quickReplyDao.findDoctorRepliesByType(doctor, Integer.parseInt(type),sort);
        }

+ 15 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -32,6 +32,7 @@ import com.yihu.wlyy.service.third.jw.JwArchivesService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.SignUploadTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.third.gateway.controller.doctor.GcDoctorController;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import org.apache.commons.lang3.StringUtils;
@ -39,6 +40,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;
@ -66,6 +69,7 @@ import java.util.*;
@Transactional
public class FamilyContractService extends BaseService {
    private Logger logger = LoggerFactory.getLogger(FamilyContractService.class);
    @Autowired
    private DoctorPatientDao doctorPatientDao;
    @Autowired
@ -680,12 +684,18 @@ public class FamilyContractService extends BaseService {
            message.setOver("1");//未处理
            message.setData(temp.getCode());
            messageDao.save(message);
            // 发送消息给医生
            JSONObject jsonObject = doctorWorkTimeService.isDoctorWorking(doctor);
            if (jsonObject.getString("status").equals("1")) {
                //如果在工作时间内就推送
                pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.D_SW_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.家庭签约.name(), "您有一条新的家庭签约申请!", patient);
            try {
                // 发送消息给医生
                JSONObject jsonObject = doctorWorkTimeService.isDoctorWorking(doctor);
                if (jsonObject.getString("status").equals("1")) {
                    //如果在工作时间内就推送
                    pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.D_SW_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.家庭签约.name(), "您有一条新的家庭签约申请!", patient);
                }
            }catch (Exception e){
                logger.info("发送医生消息失败:"+e.getMessage());
            }
            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(d.getOpenid())){
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";

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

@ -1587,7 +1587,7 @@ public class StatisticsESService {
     */
    public JSONArray getLowLevelIncrementDetail(String startDate, String endDate, String area, int level, String index, int sort, String low_level) throws Exception {
        List<Map<String, Object>> resultList = new ArrayList<>();
        List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, low_level);
        List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL, low_level);
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
@ -1718,11 +1718,11 @@ public class StatisticsESService {
        }
//        timeKey= "2017-11-01 00:00:00";
        //及时回复数
        List<SaveModel> relyVal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "23", "1", lowLevel);
        List<SaveModel> relyVal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "23", "2", lowLevel);
        //咨询总数
        List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "25", "1", lowLevel);
        List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "3", "2", lowLevel);
        //未回复数
        List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "22", "1", lowLevel);
        List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel0(null, timeKey, area, level, "22", "2", lowLevel);
//        JSONArray rely = new JSONArray(relyVal);
//        JSONArray total = new JSONArray(relyTotal);
//        JSONArray noRely = new JSONArray(noRelyTotal);
@ -1872,19 +1872,10 @@ public class StatisticsESService {
            }
        }
//        quotaTime = "2017-10-19 00:00:00";
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(null, quotaTime, area, Integer.parseInt(level), "24", "1");
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(null, quotaTime, area, Integer.parseInt(level), "24", "2");
        JSONArray array = new JSONArray();
        for (SaveModel saveModel : list) {
            JSONObject jsonObject = new JSONObject();
//            if(SaveModel.cityLevel.equals(level)){
//
//                jsonObject.put("code",saveModel.getCity());
//                jsonObject.put("name",saveModel.getCityName());
//            }else if(SaveModel.townLevel.equals(level)){
//                jsonObject.put("code",saveModel.getTown());
//                jsonObject.put("name",saveModel.getTownName());
//            }else if(SaveModel.OrgLevel.equals(level)){
//            }
            jsonObject.put("code", saveModel.getSlaveKey1());
            jsonObject.put("name", saveModel.getSlaveKey1Name());
            jsonObject.put("date", quotaTime);
@ -1909,27 +1900,21 @@ public class StatisticsESService {
            quotaDate = year + "-06-30";
        }
        SaveModel relyVal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "23", "1");
        SaveModel relyTotal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "25", "1");
        SaveModel onRelyTotal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "22", "1");
        SaveModel relyVal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "23", "2");
        SaveModel relyTotal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "3", "2");
        SaveModel onRelyTotal = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate, quotaDate, area, level, "22", "2");
        result.put("result", getCoutListTitle(level, relyVal, relyTotal, onRelyTotal));
        return result;
    }
    public List<Map<String, Object>> getCoutListTitle(Integer level, SaveModel rely, SaveModel total, SaveModel onRely) {
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> onRelyMap = new HashMap<>();
        JSONObject result = new JSONObject();
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        //合并结果集
        Map<String, Object> rs = new HashMap<>();
        Integer totalNm = total.getResult2().intValue();
        Integer relyNm = rely.getResult2().intValue();
        Integer noRelyNm = onRely.getResult2().intValue();
//        rs.put("name", rely.get(area + "Name"));
        if (SaveModel.cityLevel.equals(level + "")) {
            rs.put("code", rely.getCity());
            rs.put("name", rely.getCityName());
@ -1943,7 +1928,6 @@ public class StatisticsESService {
        rs.put("noRelyCount", noRelyNm);
        rs.put("relyCount", relyNm);
        rs.put("total", totalNm);
//        rs.put("code", key);
        if (totalNm != null && totalNm != 0) {
            if (relyNm != null && relyNm != 0) {
                double rr = (double) relyNm / totalNm * 100;

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

@ -233,7 +233,8 @@ public class OnePayService {
            Date begin = signFamily.getBegin();
            Date end = signFamily.getEnd();
            if (begin != null && end != null) {
                totalAmount = getTotalAmount(sdf.format(begin), sdf.format(end), "yyyy-MM-dd");
//                totalAmount = getTotalAmount(sdf.format(begin), sdf.format(end), "yyyy-MM-dd");
                totalAmount = getTotalAmount(sdf.format(new Date()), sdf.format(end), "yyyy-MM-dd"); // v1.4.0 开始时间为系统时间
            } else {
                return "-2";
            }
@ -314,7 +315,8 @@ public class OnePayService {
                familyContent.put("moRegOrgNo", sbCode); //签约机构 限长4
                familyContent.put("moRegDocNo", doctor.getIdcard());//签约医生编号 限长18 身份证号
                familyContent.put("moRegDocName", signFamily.getSignDoctorName()); //签约医生姓名
                familyContent.put("moRegTime", format.format(signFamily.getBegin())); //签约时间
//                familyContent.put("moRegTime", format.format(signFamily.getBegin())); //签约时间
                familyContent.put("moRegTime", format.format(new Date())); //签约时间 v1.4.0更改
                familyContent.put("moRegEndTime", format.format(signFamily.getEnd())); //签约截止时间
                familyContent.put("moRegTear", signFamily.getSignYear());//签约年度
                familyContent.put("moRegSource", signFamily.getSignSource()); //签约来源

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1101,4 +1101,10 @@ public class DateUtil {
		return date;
	}
	public static String getYear(String strDate, String format){
		Date date = strToDate(strDate,format);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		return calendar.get(Calendar.YEAR)+"";
	}
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.*;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.event.ApplicationEvent;
import com.yihu.wlyy.logs.BusinessLogs;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.consult.ConsultService;
@ -27,6 +28,8 @@ import org.htmlparser.util.ParserException;
import org.htmlparser.visitors.TextExtractingVisitor;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
@ -47,6 +50,7 @@ import java.util.*;
@Api(description = "健康教育")
public class DoctorHealthEduArticleController extends WeixinBaseController {
    private Logger logger = LoggerFactory.getLogger(DoctorHealthEduArticleController.class);
    @Autowired
    private HealthEduArticleService healthEduArticleService;
    @Autowired
@ -446,6 +450,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                        msgs.put(patientTemp.getCode(), content);
                    }
                }catch (Exception e){
                    logger.info("eduArticle_doctor:"+doctor.getCode()+" patient:"+p +" error:"+e.getMessage());
                    error(e);
                }
            }

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

@ -256,6 +256,7 @@ public class PrescriptionInfoController extends BaseController {
            PrescriptionPay prescriptionPay = prescriptionPayService.findByPrescriptionCode(prescriptionCode);
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionExpressage", prescriptionExpressage);

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java

@ -158,7 +158,8 @@ public class DoctorQuickReplyController extends BaseController {
    public String replyList(@ApiParam(name = "type", value = "快捷回复类型(1为续方咨询)", defaultValue = "0")
                                @RequestParam(value = "type", required = false, defaultValue = "0") String type) {
        try {
            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList(getUID(),type);
//            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList(getUID(),type);
            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList("xy201703150222",type);
            return write(200, "查询成功", "data", replies);
        } catch (Exception e) {
            e.printStackTrace();

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -395,8 +395,7 @@ public class PatientHealthController extends BaseController {
//                patient = getUID();
            }
            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, patient, null);
            
            //血糖和血压需要校验
            if (type.equals("1") || type.equals("2")) {
                healthIndexService.verifyHealthIndex(obj.getId());

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionFollowupContentController.java

@ -58,10 +58,10 @@ public class PatientPrescriptionFollowupContentController extends BaseController
	                       @RequestParam(value = "prescriptioncode", required = true) String prescriptioncode,
	                       @ApiParam(name = "followupProjectData", value = "调查分类数据", defaultValue = "[{\"followupProject\":\"1\",\"projectData\":{\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}}]")
	                       @RequestParam(value = "followupProjectData", required = true) String followupProjectData,
	                       @ApiParam(name = "sendIM", value = "是否发送IM消息", defaultValue = "false")
	                       @ApiParam(name = "sendIM", value = "是否发送IM消息", defaultValue ="false")
	                       @RequestParam(value = "sendIM", required = true) boolean sendIM){
		try {
			prescriptionFollowupContentService.saveInfo(prescriptioncode,followupProjectData,getUID(),false);
			prescriptionFollowupContentService.saveInfo(prescriptioncode,followupProjectData,getUID(),sendIM);
			return write(200, "请求成功!");
		}catch (Exception e){
			//日志文件中记录异常信息

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

@ -4,6 +4,7 @@ import com.yihu.wlyy.service.app.statistics.StatisticsAllService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.service.app.statisticsES.StatisticsESService;
import com.yihu.wlyy.util.Constant;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
@ -31,7 +32,7 @@ import java.util.TreeMap;
 * Created by chenweida on 2017/10/13.
 */
@Controller
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@Api(description = "ES统计查询")
public class EsStatisticsController extends BaseController {
@ -251,18 +252,20 @@ public class EsStatisticsController extends BaseController {
            List<JSONArray> jsonArrays = new ArrayList<>();
            /**新版统计代码start**/
            //咨询数-3 增量
            JSONArray jsonArray1 = statisticsESService.getLowLevelTotalDetail(endDate, area, level, indexes[0], sort, lowLevel, null, year);
            jsonArrays.add(jsonArray1);
            /**新版统计代码end**/
            /**旧版统计代码start**/
            //未回复-22 到达量
            JSONArray jsonArray2 = null;
            if (Constant.getNowYearByDate(endDate).equals(year)) {
                jsonArray2 = statisticsESService.getLowLevelIncrementDetail("", endDate, area, level, indexes[1], sort, lowLevel);
            if (DateUtil.getYear(endDate,"yyyy-MM-dd").equals(year)) {
                jsonArray2 = statisticsESService.getLowLevelIncrementDetail(endDate, endDate, area, level, indexes[1], sort, lowLevel);
            } else {
                String date = Integer.valueOf(year) + 1 + "-06-30";
                jsonArray2 = statisticsESService.getLowLevelIncrementDetail("", date, area, level, indexes[1], sort, lowLevel);
                jsonArray2 = statisticsESService.getLowLevelIncrementDetail(date, date, area, level, indexes[1], sort, lowLevel);
            }
            jsonArrays.add(jsonArray2);
            /**旧版统计代码end**/
@ -679,15 +682,7 @@ public class EsStatisticsController extends BaseController {
                lowlevel = elasticsearchUtil.changeLevel(Integer.parseInt(lowlevel))+"";
            }
            JSONObject data = null;
//            if (Constant.getNowYear().equals(year)) {
//                data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, null);
//            } else if (org.springframework.util.StringUtils.isEmpty(year)) {
//                data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, null);
////                data = statisticsService.getConsultingStatisticsListAll(level, area, lowlevel, year);
//            } else {
            data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, year);
//            }
            if (data != null) {
                return write(200, "查询成功", "data", data);
            } else {

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

@ -29,7 +29,7 @@ import java.util.*;
 * Created by lyr on 2016/08/16.
 */
@Controller
@RequestMapping(value = "/old/statistics", 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 = "统计")
public class StatisticsController extends BaseController {
@ -1661,6 +1661,7 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/getPrescriptionTotalCount")
    @ResponseBody
    @Deprecated
    public String getPrescriptionTotalCount(@ApiParam(name="startDate", value="开始时间 yyyy-MM-dd") @RequestParam(required = true)String startDate,
                                            @ApiParam(name="endDate", value="开始时间 yyyy-MM-dd") @RequestParam(required = true)String endDate,
                                            @ApiParam(name="adminTeamId", value="团队ID") @RequestParam(required = true)Integer adminTeamId){

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduDoctorArticleController.java

@ -460,6 +460,14 @@ public class EduDoctorArticleController extends BaseController{
    }
//    @RequestMapping(value = "/sendPatients", method = RequestMethod.POST)
//    @ResponseBody
//    @ApiOperation("文章群推送")
//    public void saveArticle(){
//
//
//    }
    /**
     * 获取要推送的患者
     * @param type
@ -482,4 +490,5 @@ public class EduDoctorArticleController extends BaseController{
        Map<String,Object> map = familyContractService.getPushPatientList(type,searchTypes,getUID(),"");
        return map;
    }*/
}

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

@ -97,19 +97,20 @@ pushMes:
  redis_prescription_title: redisPrescription
es:
  index:
    HealthEduArticlePatient: wlyy_quota_test
    HealthEduArticlePatient: health_edu_article_patient_test
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: wlyy_quota_test
    Statistics: wlyy_quota_test
    HealthEduArticlePatient: health_edu_article_patient_test
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl
#消息队列
activemq:
  username: admin