Prechádzať zdrojové kódy

Merge branch 'dev' of zd_123/patient-co-management into dev

yeshijie 7 rokov pred
rodič
commit
f9320ca360

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

@ -459,7 +459,7 @@ public class PrescriptionService extends BaseService {
            sql += " AND LEFT(p.hospital, 6) = '"+area+"' ";
            //机构
        }else if("2".equals(level)){
            sql += "AND p.hospital = '"+area+"' ";
            sql += " AND p.hospital = '"+area+"' ";
        }
        List<Map<String,Object>> resultList = new ArrayList<>();
        int start = (pageNo-1)*pageSize;

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

@ -2045,6 +2045,8 @@ public class StatisticsService extends BaseService {
        String totalSql = "SELECT " +
                "  COUNT(1) total " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2058,7 +2060,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id ;
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        Long totalCount = 0L;
        if (totalList != null && totalList.size() > 0) {
@ -2068,6 +2073,8 @@ public class StatisticsService extends BaseService {
        String noReySql = "SELECT " +
                "  COUNT(1) noRey " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2083,7 +2090,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(noReySql);
        Long noReyCount = 0L;
        if (noReyList != null && noReyList.size() > 0) {
@ -2327,12 +2337,14 @@ public class StatisticsService extends BaseService {
     */
    public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
        String imDataBaseName = im_dataBase_name;
//        startDate = startDate + " 00:00:00";
//        endDate = endDate + " 23:59:59";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        //咨询量
        String consult_sql = "SELECT " +
                "  COUNT(1) consultCount " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2346,7 +2358,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'" +
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        //获取咨詢數
        Map<String, Object> consultCout = jdbcTemplate.queryForMap(consult_sql);
        if (consultCout.get("consultCount") == null) {
@ -2483,54 +2498,66 @@ public class StatisticsService extends BaseService {
        String sql;
        String totalSql;
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        if ("0".equals(type)) {
            //按周统计
            sql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
            sql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND c.type <> 8" +
                    " AND t. STATUS <> 10 " +
                    " AND t.`reply` = 0 " +
                    " AND p.session_id = t.session_id " +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t. STATUS <> 10  " +
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
            totalSql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) total " +
            totalSql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND p.session_id = t.session_id " +
                    " AND c.type <> 8" +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
        } else {
            //按月统计
            sql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS noRely " +
                    "  FROM " +
            sql = "SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS noRely " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2547,11 +2574,17 @@ public class StatisticsService extends BaseService {
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
            totalSql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS total " +
                    "  FROM " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
            totalSql="SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2566,7 +2599,10 @@ public class StatisticsService extends BaseService {
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
        }
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(sql);
@ -5176,11 +5212,7 @@ public class StatisticsService extends BaseService {
        if (interval==1){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,10) date  FROM wlyy_prescription p ";
            rs = DateUtil.findDates(startDate,endDate);
            //加入当天数据
            Map<String,Object> dateMap = new HashedMap();
            dateMap.put("date",sdf.format(endDate));
            dateMap.put("count", 0.0D);
            rs.add(dateMap);
            startTime = DateUtil.dateToStr(startDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }

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

@ -1315,7 +1315,12 @@ public class StatisticsESService {
        }
        if (resultList != null) {
            String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            String signTaskNum = "";
            if ("3".equals(lowCode)){
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17_65", year);//2017年65岁以上的目标量
            }else{
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            }
            String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
            DecimalFormat df = new DecimalFormat("0.0000");
            for (Map<String, Object> map : resultList) {

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

@ -901,7 +901,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
            //return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1363,7 +1363,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队健康
     * 获取团队健康.
     *
     * @param teamCode
     * @param startDate