Преглед изворни кода

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

trick9191 пре 7 година
родитељ
комит
4f34841f21
28 измењених фајлова са 397 додато и 177 уклоњено
  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. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/sign/SignFamilyService.java
  4. 2 2
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/appeal/appeal_detail.jsp
  5. 4 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/appeal/appeal_detail_js.jsp
  6. 4 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/feedback/feedback_detail_js.jsp
  7. 2 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/team/patient/sign_family_allocate_js.jsp
  8. 4 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java
  9. 27 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/HibernateProperties.java
  10. 60 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/jpa/WlyyJpa.java
  11. 2 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DiseaseConvert.java
  12. 2 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DispensaryTypeConvert.java
  13. 2 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionStatusConvert.java
  14. 1 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java
  15. 2 2
      patient-co/patient-co-statistics-es/src/main/resources/application-prod.yml
  16. 22 51
      patient-co/patient-co-statistics-es/src/main/resources/application.yml
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorQuickReplyDao.java
  18. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java
  19. 57 40
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java
  21. 148 59
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java
  22. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  23. 16 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java
  24. 6 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java
  25. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java
  26. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionFollowupContentController.java
  27. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  28. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduDoctorArticleController.java

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

+ 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 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/appeal/appeal_detail.jsp

@ -150,7 +150,7 @@
        <div class="m-form-group">
            <label class="label_title fd-padl fd-label">申诉详情描述:</label>
            <div class="fd-pd">
                <textarea class="fd-input fd-autoh" id="description" style="width: 600px; height: 100px"></textarea>
                <textarea id="description" style="width: 600px; height: 100px"></textarea>
            </div>
        </div>
        <div class="fd-group">
@ -162,7 +162,7 @@
        <div class="m-form-group ad-result" id="dealResult" style="display: none;">
            <label class="label_title ad-label">处理结果:</label>
            <div class="ad-pd">
                <textarea class="fd-input fd-autoh"  id="result1" style="width: 600px; height: 100px"></textarea>
                <textarea id="result1" style="width: 600px; height: 100px"></textarea>
            </div>
        </div>
        <div class="m-form-group" style="text-align: center;margin-top:30px;">

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/appeal/appeal_detail_js.jsp

@ -101,11 +101,13 @@
                });
                $("#sure").click(function () {
                    $("#sure").css("pointer-events", "none");
                    var result = $("#result").val();
                    var id = $("#id").val();
                    if (isNoEmpty(result)) {
                        if(result.length>400){
                            $.Notice.error("最多只能填写400个字");
                            $("#sure").css("pointer-events", "");
                        }else {
                            $.ajax({
                                url: ctx + "/admin/appeal/dealAppeal",
@ -121,6 +123,7 @@
                                        parent.window.closeParentInfoDialog();
                                    }else{
                                        $.Notice.error(result.msg);
                                        $("#sure").css("pointer-events", "");
                                    }
                                },
                            })
@ -128,6 +131,7 @@
                    }else{
                        //todo
                        $.Notice.error("请输入处理结果");
                        $("#sure").css("pointer-events", "");
                    }
                });
                $("#cancle").click(function () {

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/feedback/feedback_detail_js.jsp

@ -104,11 +104,13 @@
                    parent.window.closeParentInfoDialog();
                });
                $("#sure").click(function () {
                    $("#sure").css("pointer-events", "none");
                    var result = $("#result").val();
                    var id = $("#id").val();
                    if (isNoEmpty(result)) {
                        if(result.length>400){
                            $.Notice.error("最多只能填写400个字");
                            $("#sure").css("pointer-events", "");
                        }else {
                            $.ajax({
                                url: ctx + "/admin/feedback/dealFeedback",
@ -124,6 +126,7 @@
                                        parent.window.closeParentInfoDialog();
                                    }else{
                                        $.Notice.error(result.msg);
                                        $("#sure").css("pointer-events", "");
                                    }
                                },
                            })
@ -132,6 +135,7 @@
                    }else{
                        //todo
                        $.Notice.error("请输入处理结果");
                        $("#sure").css("pointer-events", "");
                    }
                });
                $("#cancle").click(function () {

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

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

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

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

@ -54,7 +54,7 @@ public class DiseaseConvert implements Convert {
//                });
//            }
        }
        return oneList;
        return returnList;
    }
    private List<String> initHealthLabesMap(JdbcTemplate jdbcTemplate, WlyyDimensionQuota temp,DataModel dataModel) {
@ -85,7 +85,7 @@ public class DiseaseConvert implements Convert {
                "  WHERE " +
                "  prescription_code = '"+dataModel.getPrescriptionCode() +"'";
        List<Map<String, Object>>  diagnosisList =jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> dictList = jdbcTemplate.queryForList(temp.getDictSql());
//        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){

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

@ -14,7 +14,7 @@ import java.util.List;
 */
public class DispensaryTypeConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
        for(DataModel one:oneList){
            try {
//                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方配送方式
@ -25,7 +25,7 @@ public class DispensaryTypeConvert implements Convert {
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        };
        return oneList;
    }
}

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

@ -20,7 +20,7 @@ import java.util.Map;
 */
public class PrescriptionStatusConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
        for(DataModel one:oneList){
            try {
//                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方状态
@ -33,7 +33,7 @@ public class PrescriptionStatusConvert implements Convert {
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        };
        return oneList;
    }

+ 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库:

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

@ -13,57 +13,22 @@ 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小
    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小
    # REDIS
  redis:
@ -97,6 +62,12 @@ logging:
  level:
    root: INFO
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: false
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
JobService:
  sleepTime: 30000

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

+ 57 - 40
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,23 @@ 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", "请填写您近期体征及生活方式调查问卷");
        }
        contentDoctor.put("type",type);
            contentobj.put("text","请填写您近期体征及生活方式调查问卷");
        }
        contentobj.put("doctorremind","已向居民发送问卷填写请求,填写完成后您将收到消息提醒");
        contentobj.put("patientremind","填写完成并提交后,医生将可以查看您的问卷内容");
        contentobj.put("sender_id",prescription.getDoctor());
        contentobj.put("sender_name",prescription.getDoctorName());
        contentobj.put("content_type","17");
        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 {
                    }

+ 148 - 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,21 @@ 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","您未绑定血糖智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				
				//医生发送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 +386,25 @@ 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);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				//医生发送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 +430,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,29 +441,32 @@ 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","您未绑定血压智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
@ -404,6 +476,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 +485,31 @@ 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);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				//医生发送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 +559,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 +575,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);
        }

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

+ 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();

+ 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){
			//日志文件中记录异常信息

+ 2 - 1
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;
@ -260,7 +261,7 @@ public class EsStatisticsController extends BaseController {
            /**旧版统计代码start**/
            //未回复-22 到达量
            JSONArray jsonArray2 = null;
            if (Constant.getNowYearByDate(endDate).equals(year)) {
            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";

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