Bladeren bron

修改公司总览第二个饼图

huangchengzdm 7 jaren geleden
bovenliggende
commit
168d9212e2

+ 47 - 38
VisualInspection/fwq/js/statistics/total_company_statistics.js

@@ -315,47 +315,46 @@ $(function() {
                 min_year = eval("Math.min(" + array_year_score.toString() + ")").toFixed(0) - 10;
         } else if (type == 2) {
             // 获得各个道管下面所有服务区的数量
-            debugger
-            var organList = data.organList;
-            var organArray = new Array();
-            var organCount = 0;
-            for (h=0;h<organList.length;h++) {
-                organCount += organList[h].sacount;
-                organArray.push(organCount);
-            }
+            // var organList = data.organList;
+            // var organArray = new Array();
+            // var organCount = 0;
+            // for (h=0;h<organList.length;h++) {
+            //     organCount += organList[h].sacount;
+            //     organArray.push(organCount);
+            // }
 
             array_points2 = [];
             array_points = [];
             // console.log(data);
             if (data != null) {
-                array_points.push({ "value": (data.total0), "name": '满分', "itemStyle": { "normal": { "color": '#48CCCD' } } });
-                array_points.push({ "value": data.total15, "name": '0-15分', "itemStyle": { "normal": { "color": '#38ACEC' } } });
-                array_points.push({ "value": data.total50, "name": '15-50分', "itemStyle": { "normal": { "color": '#FFD801' } } });
-                array_points.push({ "value": data.totalOver50, "name": '50分以上', "itemStyle": { "normal": { "color": '#7F38EC' } } });
-                var temp = [0, 0, 0];
+                array_points.push({ "value": (data.total0), "name": '满分', "area":data.total0Area, "itemStyle": { "normal": { "color": '#48CCCD' } } });
+                array_points.push({ "value": data.total15, "name": '0-15分', "area":data.total15Area, "itemStyle": { "normal": { "color": '#38ACEC' } } });
+                array_points.push({ "value": data.total50, "name": '15-50分', "area":data.total50Area, "itemStyle": { "normal": { "color": '#FFD801' } } });
+                array_points.push({ "value": data.totalOver50, "name": '50分以上', "area":data.totalOver50Area, "itemStyle": { "normal": { "color": '#7F38EC' } } });
+                // var temp = [0, 0, 0];
 
                 // 满分
-                for (var i = 0; i < data.list.length; i++) {
-                    if (i < organArray[0]) {
-                        temp[0] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    } else if (i < organArray[1]) {
-                        temp[1] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    } else if (i < organArray[2]) {
-                        temp[2] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    }
-                }
-                if (temp[0] != 0) {
-                    array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
-                }
-                if (temp[1] != 0) {
-                    array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": '#3EA99F' } } });
-                }
-                if (temp[2] != 0) {
-                    array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": '#008080' } } });
-                }
-                pushDate(data, organArray, 'score_fifteen', '0-15分');
-                pushDate(data, organArray, 'score_fifty', '15-50分');
-                pushDate(data, organArray, 'score_over_fifty', '50分以上');
+                // for (var i = 0; i < data.list.length; i++) {
+                //     if (i < organArray[0]) {
+                //         temp[0] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     } else if (i < organArray[1]) {
+                //         temp[1] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     } else if (i < organArray[2]) {
+                //         temp[2] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     }
+                // }
+                // if (temp[0] != 0) {
+                //     array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
+                // }
+                // if (temp[1] != 0) {
+                //     array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": '#3EA99F' } } });
+                // }
+                // if (temp[2] != 0) {
+                //     array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": '#008080' } } });
+                // }
+                // pushDate(data, organArray, 'score_fifteen', '0-15分');
+                // pushDate(data, organArray, 'score_fifty', '15-50分');
+                // pushDate(data, organArray, 'score_over_fifty', '50分以上');
             } else {
                 array_points.length = 0;
             }
@@ -593,7 +592,6 @@ $(function() {
      * 图一
      */
     function company_year_assess_one() {
-        //debugger;
         option = {
             color: ['#00ced1'],
             tooltip: {
@@ -663,7 +661,18 @@ $(function() {
         option = {
             tooltip: {
                 trigger: 'item',
-                formatter: "公司考核扣分占比 <br/>{b} : {c}次 ({d}%)"
+                // formatter: "公司考核扣分占比 <br/>{b} : {c}个服务区 ({d}%)"
+                formatter: function(params){
+                    var res = '包含的服务区<br/>';
+                    var myseries = option.series[0];
+                    for(var j=0;j<myseries.data.length;j++){
+                        if(myseries.data[j].name==params.name){
+                            var area = myseries.data[j].area;
+                            res+=myseries.data[j].name +' : '+area+'</br>';
+                        }
+                    }
+                    return res;
+                }
             },
 
             toolbox: {
@@ -686,7 +695,7 @@ $(function() {
                         normal: {
                             label: {
                                 show: true,
-                                formatter: '{b}:\n{c}({d}%)',
+                                formatter: '{b}:\n{c}个服务区({d}%)',
                                 textStyle: {
                                     alias: 'center',
                                     fontSize: 10,
@@ -719,7 +728,7 @@ $(function() {
                         normal: {
                             label: {
                                 show: false,
-                                formatter: '{b}:{c}({d}%)'
+                                formatter: '{b}:{c}个服务区({d}%)'
                             },
                             labelLine: {
                                 show: false

+ 50 - 24
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_F.java

@@ -157,8 +157,8 @@ public class StatisticsController_F extends BaseController {
      * 服务区数据查询分析---->获取服务区的12月情况
      */
     @RequestMapping(value = "/one/serviceArea/year/info")
-    public String getSaOnePersonInfo(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> returnList=  statisticsService_f.getOneSACheckedInfo(obj);
+    public String getSaOnePersonInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> returnList = statisticsService_f.getOneSACheckedInfo(obj);
         return super.returnSuccessResult(returnList);
     }
 
@@ -166,8 +166,8 @@ public class StatisticsController_F extends BaseController {
      * 服务区数据查询分析---->获取服务区各项扣分情况
      */
     @RequestMapping(value = "/one/serviceArea/checkedItem/info")
-    public String getFsOneServiceAreaCheckedItemInfo(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> returnList=  statisticsService_f.getOneCheckedItemInfo(obj);
+    public String getFsOneServiceAreaCheckedItemInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> returnList = statisticsService_f.getOneCheckedItemInfo(obj);
         return super.returnSuccessResult(returnList);
     }
 
@@ -175,37 +175,63 @@ public class StatisticsController_F extends BaseController {
      * 公司总览--->12个月考核得分总体
      */
     @RequestMapping(value = "/score/year/info")
-    public String selectYearScoreChange(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> lists=  statisticsService_f.getYearScoreChange(obj);
+    public String selectYearScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getYearScoreChange(obj);
         return super.returnSuccessResult(lists);
     }
 
     /**
      * 公司总览--->公司考核扣分情况占比
+     *
      * @param obj
      * @return
      */
     @RequestMapping(value = "/score/info")
-    public String getScoreInfo(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> lists=  statisticsService_f.getFeeStationCheckedScore(obj);
-        int totalcheckedCount=0,total0=0,total15=0,total50=0,totalOver50=0,totalAll = 0;
-        for(FwqStatisticsBean bean:lists){
+    public String getScoreInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getFeeStationCheckedScore(obj);
+        int totalcheckedCount = 0, total0 = 0, total15 = 0, total50 = 0, totalOver50 = 0;
+        StringBuffer total0Area = new StringBuffer();
+        StringBuffer total15Area = new StringBuffer();
+        StringBuffer total50Area = new StringBuffer();
+        StringBuffer totalOver50Area = new StringBuffer();
+
+        /*for(FwqStatisticsBean bean:lists){
             totalcheckedCount+=bean.getChecked_num();
             total0+=(bean.getChecked_num()-bean.getScore_fifteen()-bean.getScore_fifty()-bean.getScore_over_fifty());
             total15+=bean.getScore_fifteen();
             total50+=bean.getScore_fifty();
             totalOver50+=bean.getScore_over_fifty();
             totalAll+=bean.getAll_check_score();
+        }*/
+        totalcheckedCount = lists.size();
+        for (FwqStatisticsBean bean : lists) {
+            if (bean.getAll_check_score() == 0) {
+                total0 += 1;
+                total0Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 0 && bean.getAll_check_score() <= 15) {
+                total15 += 1;
+                total15Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 15 && bean.getAll_check_score() <= 50) {
+                total50 += 1;
+                total50Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 50) {
+                totalOver50 += 1;
+                totalOver50Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            }
         }
-        Map<String,Object> resultMap = new HashMap<>();
+        Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("list", lists);
         resultMap.put("totalcheckedCount", totalcheckedCount);
         resultMap.put("total0", total0);
         resultMap.put("total15", total15);
         resultMap.put("total50", total50);
         resultMap.put("totalOver50", totalOver50);
-        resultMap.put("totalAll", totalAll);
-        resultMap.put("organList", departmentDao.getOrganToSaCount());
+        resultMap.put("total0Area", total0Area);
+        resultMap.put("total15Area", total15Area);
+        resultMap.put("total50Area", total50Area);
+        resultMap.put("totalOver50Area", totalOver50Area);
+//        resultMap.put("totalAll", totalAll);
+//        resultMap.put("organList", departmentDao.getOrganToSaCount());
         return super.returnSuccessResult(resultMap);
     }
 
@@ -213,8 +239,8 @@ public class StatisticsController_F extends BaseController {
      * 公司总览--->道管中心得分排名
      */
     @RequestMapping(value = "/score/center/manage/info")
-    public String selectCentermanageScoreChange(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> lists=  statisticsService_f.getCenterManageScoreInfo(obj);
+    public String selectCentermanageScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getCenterManageScoreInfo(obj);
         return super.returnSuccessResult(lists);
     }
 
@@ -222,8 +248,8 @@ public class StatisticsController_F extends BaseController {
      * 公司总览--->公司全体服务区排名
      */
     @RequestMapping(value = "/score/tollgate/info")
-    public String selectTollgateScoreChange(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> lists=  statisticsService_f.getFeeStationScoreInfo(obj);
+    public String selectTollgateScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getFeeStationScoreInfo(obj);
         return super.returnSuccessResult(lists);
     }
 
@@ -231,8 +257,8 @@ public class StatisticsController_F extends BaseController {
      * 公司总览--->温馨服务检查问题类别占比
      */
     @RequestMapping(value = "/lost/itemscore/rate")
-    public String getCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> returnList=  statisticsService_f.getCheckedItemScoreInfo(obj);
+    public String getCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> returnList = statisticsService_f.getCheckedItemScoreInfo(obj);
         return super.returnSuccessResult(returnList);
     }
 
@@ -240,9 +266,9 @@ public class StatisticsController_F extends BaseController {
      * 公司总览--->各个问题类别的扣分情况
      */
     @RequestMapping(value = "/lost/twice/itemscore/rate")
-    public String getTwiceCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj){
-        Map<String,Object> resultMap = new HashMap<>();
-        Map<String,List<FwqStatisticsBean>> returnMap=  statisticsService_f.get2CheckedItemScoreInfo(obj);
+    public String getTwiceCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj) {
+        Map<String, Object> resultMap = new HashMap<>();
+        Map<String, List<FwqStatisticsBean>> returnMap = statisticsService_f.get2CheckedItemScoreInfo(obj);
         resultMap.put("itemList", commonService.getCheckItemName(28L));
         resultMap.put("list", returnMap);
         return super.returnSuccessResult(resultMap);
@@ -252,8 +278,8 @@ public class StatisticsController_F extends BaseController {
      * 服务区连续月统计
      */
     @RequestMapping(value = "/user/score")
-    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody ServiceAreaStatistic obj){
-        List<FwqStatisiticPojo> returnList=  statisticsService_f.getFwqStatistic(obj);
+    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody ServiceAreaStatistic obj) {
+        List<FwqStatisiticPojo> returnList = statisticsService_f.getFwqStatistic(obj);
         return super.returnSuccessResult((returnList));
     }
 }

+ 46 - 45
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsServiceImpl.java

@@ -790,14 +790,15 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
             obj2.setName(sta.getName());
-            // 30:连云港道管;31:盐城道管;32:南通道管
-            if ("30".equals(sta.getParentid())) {
-                obj2.setId(1);
-            } else if ("31".equals(sta.getParentid())) {
-                obj2.setId(2);
-            } else if ("32".equals(sta.getParentid())) {
-                obj2.setId(3);
-            }
+//            // 30:连云港道管;31:盐城道管;32:南通道管
+//            if ("30".equals(sta.getParentid())) {
+//                obj2.setId(1);
+//            } else if ("31".equals(sta.getParentid())) {
+//                obj2.setId(2);
+//            } else if ("32".equals(sta.getParentid())) {
+//                obj2.setId(3);
+//            }
+            obj2.setChecked_num(15);
             mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
         }
 
@@ -808,13 +809,13 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             }
         }
 
-        // 检查次数
-        List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
-        for (FwqStatisticsBean sta : listCheckNum) {
-            if (mapStationInfos.containsKey(sta.getDept_id())) {
-                mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
-            }
-        }
+        // 检查次数     此处注释是为了统一每个服务区的检查次数都是15次
+//        List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
+//        for (FwqStatisticsBean sta : listCheckNum) {
+//            if (mapStationInfos.containsKey(sta.getDept_id())) {
+//                mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
+//            }
+//        }
 
         List<FwqStatisticsBo> list = getEmployeeCheckedInfo(obj);
         Map<Integer, FwqStatisticsBo> listmap = new HashMap<>();
@@ -849,36 +850,36 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
         List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
 
-        sortList.sort(new Comparator<FwqStatisticsBean>() {
-            @Override
-            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
-                if (o1.getId() > o2.getId()) {
-                    return 1;
-                } else if (o1.getId().equals(o2.getId())) {
-                    if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
-                        if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) > o2.getAll_check_score()
-                                / (o2.getChecked_num() + 0.0)) {
-                            return 1;
-                        } else if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) < o2.getAll_check_score()
-                                / (o2.getChecked_num() + 0.0)) {
-                            return -1;
-                        } else {
-                            return 0;
-                        }
-                    } else {
-                        if (o1.getChecked_num() == 0) {
-                            return -1;
-                        } else if (o2.getChecked_num() == 0) {
-                            return 1;
-                        } else {
-                            return 0;
-                        }
-                    }
-                } else {
-                    return -1;
-                }
-            }
-        });
+//        sortList.sort(new Comparator<FwqStatisticsBean>() {
+//            @Override
+//            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
+//                if (o1.getId() > o2.getId()) {
+//                    return 1;
+//                } else if (o1.getId().equals(o2.getId())) {
+//                    if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
+//                        if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) > o2.getAll_check_score()
+//                                / (o2.getChecked_num() + 0.0)) {
+//                            return 1;
+//                        } else if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) < o2.getAll_check_score()
+//                                / (o2.getChecked_num() + 0.0)) {
+//                            return -1;
+//                        } else {
+//                            return 0;
+//                        }
+//                    } else {
+//                        if (o1.getChecked_num() == 0) {
+//                            return -1;
+//                        } else if (o2.getChecked_num() == 0) {
+//                            return 1;
+//                        } else {
+//                            return 0;
+//                        }
+//                    }
+//                } else {
+//                    return -1;
+//                }
+//            }
+//        });
 
         return sortList;
     }