瀏覽代碼

Merge branch 'dev' of wangzhinan/wlyy2.0 into dev

wangzhinan 5 年之前
父節點
當前提交
865421c940

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java

@ -70,10 +70,12 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
     * @return
     */
    private Double getAvgScore(String startTime,String endTime,String area,int level){
        String sql = "select count(*) as total, sum(score) as score from base.base_evaluate_score o where";
        String sql = "select count(*) as total, sum(score) as score from base.base_evaluate_score o where ";
        if (level == 4){
            sql += " o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
        }if (level==2){
            sql += " 1=1 ";
        }else if (level == 5){
            sql += " o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
        }else if (level == 6){

+ 16 - 1
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -122,6 +122,8 @@ public class StatisticsEsService {
        String sql = "select count(*) as total from base.wlyy_consult_oupatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        if (level==4){
            sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
        }if (level==2){
            sql += " 1=1 ";
        }else if (level==5){
            sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
        }else if (level==6){
@ -2659,11 +2661,24 @@ public class StatisticsEsService {
            resultMaps.add(rs);
        }
        //根据为回复数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
       /* Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Double) o1.get("total") < (Double) o2.get("total") ? 1 : ((Double) o1.get("total") == (Double) o2.get("total") ? 0 : -1);
            }
        });*/
        Collections.sort(resultMaps, new Comparator<Map<String,Object>>() {
            @Override
            public int compare(Map<String,Object> o1, Map<String,Object> o2) {
                Double total1 = (Double) o1.get("total");
                Double total2 = (Double) o2.get("total");
                if (total1 - total2 > 0) {
                    return -1;
                } else if (total1 - total2 < 0) {
                    return 1;
                }
                return 0;
            }
        });
        result1.put("resultList", resultMaps);
        return result1;

+ 0 - 14
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -96,8 +96,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) String index,
            @RequestParam(required = false)int interval,
            @RequestParam(required = false) String level2_type) {
        //新版与旧版统计适配
        level = elasticsearchUtil.changeLevel(level);
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getPrescriptionLine(startDate, endDate, area, level, index, interval,level2_type);
@ -118,8 +116,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String level2_type) {
        //新版与旧版统计适配
        level = elasticsearchUtil.changeLevel(level);
        String[] indexes = index.split(",");
        JSONObject result = new JSONObject();
        try {
@ -141,8 +137,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String level2_type) {
        //新版与旧版统计适配
        level = elasticsearchUtil.changeLevel(level);
        String[] indexes = index.split(",");
        JSONObject result = new JSONObject();
        try {
@ -173,8 +167,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String level2_type) {
        //新版与旧版统计适配
        level = elasticsearchUtil.changeLevel(level);
        String[] indexes = index.split(",");
        JSONObject result = new JSONObject();
        try {
@ -206,8 +198,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String level2_type) {
        //新版与旧版统计适配
        level = elasticsearchUtil.changeLevel(level);
        String[] indexes = index.split(",");
        JSONObject result = new JSONObject();
        try {
@ -228,7 +218,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(required = true) String index,
                                          @RequestParam(required = false) String level2_type,
                                          @RequestParam(required = true) Integer flag) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getDoctorStatistics(startDate,endDate,area,level,index,level2_type,flag);
@ -248,7 +237,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(required = true) String index,
                                     @RequestParam(required = false) String level2_type,
                                     @RequestParam(required = true) Integer flag) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getDoctorTotal(startDate,endDate,area,level,index,level2_type,flag);
@ -267,7 +255,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(required = true) String index,
                                     @RequestParam(required = false) String level2_type,
                                     @RequestParam(required = true) Integer flag) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getDoctorStatisticsExcel(startDate,endDate,area,level,index,level2_type,flag);
@ -294,7 +281,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getSpecialConsultHead(startDate, endDate, area, level, index);