Przeglądaj źródła

运营管理综合检查情况统计表功能提交

huangchengzdm 8 lat temu
rodzic
commit
b3f7b0c471
14 zmienionych plików z 2586 dodań i 0 usunięć
  1. 209 0
      VisualInspection/fwq/js/statistics/operation_management_integration.js
  2. 1395 0
      VisualInspection/fwq/js/statistics/total_company_statistics.js
  3. 96 0
      VisualInspection/fwq/view/statistics/operation_management_integration.html
  4. 106 0
      VisualInspection/fwq/view/statistics/total_company_statistics.html
  5. 68 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_F.java
  6. 27 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/FileExcelController_F.java
  7. 15 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/dao/FwqStatisticsDao.java
  8. 25 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/mapper/master/StatisticsMapper.xml
  9. 11 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/StatisticsService_F.java
  10. 139 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsServiceImpl.java
  11. 216 0
      Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsService_FImpl.java
  12. BIN
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_operation_info.xls
  13. 267 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBean.java
  14. 12 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/StatisticsService_F.java

+ 209 - 0
VisualInspection/fwq/js/statistics/operation_management_integration.js

@@ -0,0 +1,209 @@
+var lianyungang_Station = new Array;
+var yancheng_Station = new Array;
+var nantong_Station = new Array;
+var r1 = new Array();
+var r2 = new Array();
+var r3 = new Array();
+var rank = new Array();
+/**
+ * 点击查询
+ */
+function queryTypeClick() {
+    //每次点击前清空表格数据
+    $(".table-tbody").empty('');
+    var start_date = $("#start-time").val();
+    var end_date = $("#end-time").val();
+    if (start_date == null || start_date == '' || start_date == undefined ||
+        end_date == null || end_date == '' || end_date == undefined) {
+        tip("请选择起止日期");
+        return;
+    } else {
+        start_date += " 23:00:00";
+        end_date += " 23:00:00";
+    }
+    var startStr = start_date.replace(/-/g, '/');
+    var endStr = end_date.replace(/-/g, '/');
+    var start = new Date(startStr);
+    //开始日期取前一天的23:00
+    start.setDate(start.getDate() - 1);
+    start_date = start.Format("yyyy-MM-dd HH:mm:ss");
+    var end = new Date(endStr);
+    if (start > end) {
+        tip("开始时间不能比结束时间大");
+        return;
+    }
+    var param = {
+        "dept_id": $("#fsList").val(),
+        "start_date": start_date,
+        "end_date": end_date,
+    }
+    var url = "f/statistics/operation/manage/integration";
+    var strTbody = '';
+    post_common_service(url, param, function(data) {
+        // 运营管理综合检查情况
+        check_operation_avg(data);
+    }, function(error) {
+        return "";
+    });
+}
+
+/**
+ * 表格初始化
+ */
+function initQueryType() {
+    // 默认初始化前一周查所有
+    var tdaytime = moment();
+    var start_time = "";
+    var end_time = "";
+    if (tdaytime.get('D') >= 26) {
+        start_time = tdaytime.set('date', 26).format("YYYY-MM-DD");
+        tdaytime = moment();
+        end_time = tdaytime.set('date', 25).add(1, 'M').format("YYYY-MM-DD");
+    } else {
+        start_time = tdaytime.set('date', 26).subtract(1, 'M').format("YYYY-MM-DD");
+        tdaytime = moment();
+        end_time = tdaytime.set('date', 25).format("YYYY-MM-DD");
+
+    }
+    // 默认初始化时间页面回显
+    $("#start-time").val(start_time);
+    $("#end-time").val(end_time);
+    var start_date = start_time + " 23:00:00";
+    var end_date = end_time + " 23:00:00";
+    var start = new Date(start_date);
+    //开始日期取前一天的23:00
+    start.setDate(start.getDate() - 1);
+    start_date = start.Format("yyyy-MM-dd HH:mm:ss");
+    var param = {
+        "start_date": start_date,
+        "end_date": end_date,
+    }
+    var url = "f/statistics/operation/manage/integration";
+    var strTbody = '';
+
+    post_common_service(url, param, function(data) {
+        // 运营管理综合检查情况
+        check_operation_avg(data);
+    }, function(error) {
+        return "";
+    });
+
+}
+
+/**
+ * 表格拼接及数据传入
+ * @param {*} data
+ * @param {*} i
+ * @param {*} avg
+ */
+function gethtml(data, i, avg, lists) {
+    var strTbody = "";
+
+    strTbody += "<tr><td width='8%'>" + data.company_ranking2 + "</td>";
+    strTbody += "<td width='8%'>" + data.name + "</td><td width='6%'>" + data.company_check_num +
+        "</td><td width='6%'>" + data.company_total_score + "</td><td width='6%'>" + data.third_check_num +
+        "</td><td width='6%'>" + data.third_total_score + "</td><td width='6%'>" + data.onsite_check_num +
+        "</td><td width='6%'>" + data.onsite_total_score + "</td><td width='8%'>" +
+        data.check_total_avg + "</td>" +
+        "<td width='8%'>" + data.score_avg + "</td>";
+    strTbody += "</tr>";
+    return strTbody;
+}
+
+function getTotalHtml(data) {
+    var html = "<tr><td>合计</td><td></td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyScore + "</td><td>" +
+        data.totalThirdNum + "</td><td>" + data.totalThirdScore + "</td><td>" + data.totalOnsiteNum + "</td><td>" + data.totalOnsiteScore +
+         "</td><td>-</td><td>-</td></tr>";
+    return html;
+}
+
+/**
+ * 管道中心受检人平均每人次扣分
+ * @param {*} data
+ */
+function check_operation_avg(data) {
+    var list = data.list;
+    var dataArray = new Array();
+    var sum = 0;
+    var sum1 = 0;
+    for (k = 0; k < list.length; k++) {
+        sum = parseFloat(sum) + parseFloat(list[k].check_total_avg);
+        sum1++;
+        if (k == 6) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+        if (k == 12) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+        if (k == 20) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+    }
+
+    for (i = 0; i < list.length; i++) {
+        $(".table-tbody").append(gethtml(list[i], i, dataArray[0], dataArray));
+    }
+    $(".table-tbody").append(getTotalHtml(data));
+}
+
+/**
+ * 过滤undefined
+ * @param {*} value
+ * @param {*} default_display_value
+ */
+function filter(value, default_display_value) {
+    if (value != '' && value != undefined) {
+        return value;
+    } else if (default_display_value != undefined) {
+        return default_display_value;
+    } else {
+        return "";
+    }
+}
+
+/**
+ * 过滤除数为0和保留二位小数时出现的0.00
+ * @param {*} value
+ * @param {*} default_display_value
+ */
+function filterByZeroHandle(value, default_display_value) {
+    if (isNaN(value)) {
+        return default_display_value;
+    } else {
+        if ((value + '').endsWith('.00')) {
+            return value.substring(0, value.length - 3);
+        }
+        return value;
+    }
+}
+
+function filterJudge(num1, num2) {
+    if (num2 == 0) {
+        return 0;
+    } else {
+        return (num1 / num2).toFixed(2);
+    }
+}
+
+function exportExcel() {
+    var start_date = $("#start-time").val();
+    var end_date = $("#end-time").val();
+    if (start_date == '' || end_date == '') {
+        tip("请选择起止日期");
+        return;
+    } else {
+        start_date += " 23:00:00";
+        end_date += " 23:00:00";
+        var start = new Date(start_date);
+        //开始日期取前一天的23:00
+        start.setDate(start.getDate() - 1);
+        start_date = start.Format("yyyy-MM-dd HH:mm:ss");
+    }
+    window.open(getExcelServeraddr() + "f/file/operation/manage/integration?start_date=" + start_date + "&end_date=" + end_date);
+}

+ 1395 - 0
VisualInspection/fwq/js/statistics/total_company_statistics.js

@@ -0,0 +1,1395 @@
+var year = new Date().getFullYear();
+var x_m_array = new Array();
+var x_m_array_temp = new Array();
+var date = new Date().getDate();
+var array_year_score = new Array();
+var array_points = new Array();
+var array_points2 = new Array();
+
+var array_road = new Array();
+var array_road_score = new Array();
+var array_road_score_temp = new Array();
+var array_allStation = new Array();
+var array_allStation_score = new Array();
+var array_allStation_score_temp = new Array();
+var array_check_type = new Array();
+
+var map_per_data = new HashMap();
+var map_month_data = new HashMap();
+var array_all_name = new Array()
+var array_all_deptname = new Array()
+
+
+
+var array_points_name = new Array();
+var array_points_pre = new Array();
+var arrar_points_month = new Array();
+var year_assess;
+var points_assess;
+var score_rank;
+var stationAll_rank;
+var check_type;
+var people_points;
+var flag = true;
+var min_year;
+var min_road;
+var min_allStation;
+var score_ranking = new Array();
+$(function() {
+    // 公用方法,根据当前年月动态将13个月push数组
+    month_method();
+    // 公用方法,月份下拉框
+    // select_option();
+    // 回显当前年月份
+    // $(".div-month select").val(initDate);
+    $.jeDate("#month_date", {
+        isinitVal: true,
+        format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
+    });
+
+    var p = $.zui.store.get('store_param_' + current_url);
+    $.zui.store.set('store_param_' + current_url, null)
+    if (p) {
+        $("#month_date").val(p.time)
+    }
+
+
+    refresh(true);
+    $(".query-company").click(function() {
+        // var select_month = $("#month_date").val();
+        // flag = false;
+        // console.log(select_month);
+
+        // // 加载图配置
+        // echart();
+        refresh(false);
+    });
+
+
+    function refresh(flag) {
+        // 加载图配置
+        echart(flag);
+        var select_month = $("#month_date").val();
+        // console.log(select_month);
+        init_company_year_assess(select_month.split('/')[0], select_month.split('/')[1]);
+        // 查询图二
+        //	init_company_points_assess("statistics/lost/score/rate",select_month+'');
+        init_company_points_assess("statistics/score/info", select_month.split('/')[0], select_month.split('/')[1]);
+        // 查询图三
+        init_road_manager_score_rank_three("statistics/score/center/manage/info", select_month + '');
+        // 查询图四
+        init_stationAll_rank_four("statistics/score/tollgate/info", select_month + '');
+        // 查询图五
+        init_server_check_type_five("statistics/lost/itemscore/rate", select_month + "");
+        // 查询图六
+        init_each_people_points_six("statistics/lost/twice/itemscore/rate", select_month + "");
+    }
+    /**
+     * 初始化图一
+     */
+    function init_company_year_assess(y, m) {
+
+        x_m_array = new Array();
+        for (var i = 1; i <= 12; i++) {
+            var month = parseInt(m) + i;
+            var starty = parseInt(y) - 1
+            if (month > 12) {
+                month = month - 12;
+                starty = y;
+            }
+            x_m_array.push(starty + "/" + (month >= 10 ? month : ("0" + month)));
+        }
+
+
+        var param = {
+            "start_date": (parseInt(y) - 1) + "-" + m + "-25" + " 23:00:00",
+            "end_date": y + "-" + (m) + "-25" + " 23:00:00"
+        }
+
+
+        initRqueset("statistics/score/year/info", param, 1);
+
+    }
+    // init_company_year_assess();
+    /**
+     * 初始化图二
+     */
+    function init_company_points_assess(url, y, mon) {
+        var starty = y;
+        var startm = parseInt(mon) - 1;
+
+        if (startm <= 0) {
+            startm = 12;
+            starty = parseInt(y) - 1;
+        }
+        var param = {
+            "start_date": starty + '-' + (startm >= 10 ? startm : ("0" + startm)) + '-25 23:00:00',
+            "end_date": y + '-' + mon + '-25 23:00:00'
+        }
+        initRqueset(url, param, 2);
+    }
+    // init_company_points_assess("statistics/lost/score/rate",initDate+"");
+
+
+    /**
+     * 初始化图三
+     */
+    function init_road_manager_score_rank_three(url, mon) {
+        var param = {
+            "mth": mon
+        };
+        initRqueset(url, param, 3);
+    }
+    // init_road_manager_score_rank_three("statistics/score/center/manage/info",initDate+"");
+
+    /**
+     * 初始化图四
+     */
+    function init_stationAll_rank_four(url, mon) {
+        var param = {
+            "mth": mon
+        };
+        initRqueset(url, param, 4);
+    }
+    // init_stationAll_rank_four("statistics/score/tollgate/info",initDate+"");
+
+    /**
+     * 初始化图五
+     */
+    function init_server_check_type_five(url, mon) {
+        var param = {
+            "mth": mon,
+            "queryType": 0
+        };
+        initRqueset(url, param, 5);
+    }
+    // init_server_check_type_five("statistics/lost/itemscore/rate",initDate+"");
+
+    /**
+     * 初始化图六
+     */
+    function init_each_people_points_six(url, mon) {
+        var prev_mth;
+        // 判断当前年月是否为一月
+        if (parseInt((mon + '').substr(5)) == 1) {
+            prev_mth = ((parseInt((mon + '').substr(0, 4))) - 1) + "/12";
+        } else {
+            var m = (parseInt((mon + '').substr(5)) - 1);
+            if ((parseInt((mon + '').substr(5)) + '').length == 1) {
+                prev_mth = (mon + '').substr(0, 4) + '/' + (m > 9 ? m : "0" + m);
+            } else {
+                prev_mth = (mon + '').substr(0, 4) + '/' + (m > 9 ? m : "0" + m);
+            }
+
+        }
+        var param = {
+            "mth": mon,
+            "prev_mth": prev_mth,
+            "queryType": 0
+        };
+        initRqueset(url, param, 6);
+    }
+    // init_each_people_points_six("statistics/lost/twice/itemscore/rate",initDate+"");
+
+    /**
+     * 请求
+     * @param {*} url
+     * @param {*} param
+     * @param {*} type
+     */
+    function initRqueset(url, param, type) {
+        post_common_service(url, param, function(data) {
+            data_array(data, type);
+            if (type == 1) {
+                // 画图
+                year_assess.setOption(company_year_assess_one());
+            } else if (type == 2) {
+                //array_points= [];
+                // 画图
+                points_assess.setOption(company_points_assess_two());
+            } else if (type == 3) {
+                // 画图
+                score_rank.setOption(road_manager_score_rank_three());
+            } else if (type == 4) {
+                // 画图
+                stationAll_rank.setOption(company_stationAll_rank_four());
+            } else if (type == 5) {
+                // 画图
+                check_type.setOption(server_check_type_five());
+            } else if (type == 6) {
+                // 画图
+                people_points.setOption(each_people_points_six());
+            }
+        }, function(error) {
+            return "";
+        });
+    }
+
+
+    function pushDate(data, names, appendname) {
+        var temp = [0, 0, 0];
+        for (var i = 0; i < data.list.length; i++) {
+            if (i < 7) {
+                temp[0] += data.list[i][names];
+
+            } else if (i < 13) {
+                temp[1] += data.list[i][names];
+            } else if (i < 21) {
+                temp[2] += data.list[i][names];
+            }
+        }
+
+        var color1 = "red"
+        var color2 = "red"
+        var color3 = "red"
+        if (appendname == "0-15分") {
+            color1 = "#56A5EC"
+            color2 = "#5CB3FF"
+            color3 = "#82CAFA"
+
+        }
+        if (appendname == "15-50分") {
+            color1 = "#FDD017"
+            color2 = "#FBB917"
+            color3 = "#FFA62F"
+
+        }
+        if (appendname == "50分以上") {
+            color1 = "#8E35EF"
+            color2 = "#8467D7"
+            color3 = "#D462FF"
+        }
+
+
+
+        if (temp[0] != 0) {
+            array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": color1 } } });
+        }
+        if (temp[1] != 0) {
+            array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": color2 } } });
+        }
+        if (temp[2] != 0) {
+            array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": color3 } } });
+        }
+    }
+
+    /**
+     * 数组数据
+     * @param {*} data
+     * @param {*} type
+     */
+    function data_array(data, type) {
+        if (type == 1) {
+
+            array_year_score.length = 0;
+            if (data != '' && data.length != 0) {
+
+                x_m_array_temp = new Array();
+                for (var i = 0; i < x_m_array.length; i++) {
+
+                    var index = -1;
+                    for (var j = 0; j < data.length; j++) {
+                        if (x_m_array[i] == data[j].mth) {
+                            index = j;
+                            break;
+                        }
+                    }
+                    if (index < 0) {
+
+                    } else {
+
+                        x_m_array_temp.push(x_m_array[i]);
+                        array_year_score.push(
+                            (1000 - (filter_handler(data[index].all_check_score, data[index].checked_num, 1.0, 0))));
+                    }
+                }
+            } else {
+                array_year_score.length = 0;
+                x_m_array = new Array();
+                x_m_array_temp = new Array();
+            }
+
+
+            if (eval("Math.min(" + array_year_score.toString() + ")") == 0)
+                min_year = 0;
+            else
+                min_year = eval("Math.min(" + array_year_score.toString() + ")").toFixed(0) - 10;
+        } else if (type == 2) {
+            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];
+
+                // 满分
+                for (var i = 0; i < data.list.length; i++) {
+                    if (i < 7) {
+                        temp[0] += data.list[i].checked_people_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+
+                    } else if (i < 13) {
+                        temp[1] += data.list[i].checked_people_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                    } else if (i < 21) {
+                        temp[2] += data.list[i].checked_people_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, 'score_fifteen', '0-15分');
+                pushDate(data, 'score_fifty', '15-50分');
+                pushDate(data, 'score_over_fifty', '50分以上');
+            } else {
+                array_points.length = 0;
+            }
+        } else if (type == 3) {
+            array_road.length = 0;
+            array_road_score.length = 0;
+            for (var i = 0; i < data.length; i++) {
+                if (data != '') {
+                    array_road_score.push((1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, 1.0, 0))));
+                } else {
+                    array_road.length = 0;
+                    array_road_score.length = 0;
+                }
+            }
+            if (eval("Math.min(" + array_road_score.toString() + ")") == 0)
+                min_road = 0;
+            else
+                min_road = eval("Math.min(" + array_road_score.toString() + ")").toFixed(0) - 10;
+
+            // 给道管中心排名次
+            var rank = new Array();
+            rank[0] = 1;
+            for (var i = 1; i < array_road_score.length; i++) {
+                if (array_road_score[i - 1] == array_road_score[i]) {
+                    rank[i] = rank[i - 1];
+                } else {
+                    rank[i] = i + 1;
+                }
+            }
+            array_road_score_temp = new Array();
+            for (var i = 0; i < array_road_score.length; i++) {
+                array_road.push(data[i].feeStationName + "\n" + (rank[i]));
+                array_road_score_temp.push({ value: array_road_score[i], name: data[i].feeStationName })
+            }
+        } else if (type == 4) {
+            array_allStation_score.length = 0;
+            array_allStation.length = 0;
+            for (var i = 0; i < data.length; i++) {
+                if (data != '' && data.length != 0) {
+
+                    array_allStation_score.push((1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, 1.0, 0))));
+                } else {
+                    array_allStation_score.length = 0;
+                    array_allStation.length = 0;
+                }
+            }
+
+            if (eval("Math.min(" + array_allStation_score.toString() + ")") == 0)
+                min_allStation = 0;
+            else
+                min_allStation = eval("Math.min(" + array_allStation_score.toString() + ")").toFixed(0) - 10;
+
+            // 给收费站排名次
+            var rank = new Array();
+            rank[0] = 1;
+            for (var i = 1; i < array_allStation_score.length; i++) {
+                if (array_allStation_score[i - 1] == array_allStation_score[i]) {
+                    rank[i] = rank[i - 1];
+                } else {
+                    rank[i] = i + 1;
+                }
+            }
+            array_allStation_score_temp = new Array();
+            for (var i = 0; i < array_allStation_score.length; i++) {
+                array_allStation.push(data[i].feeStationName.substr(0, data[i].feeStationName.length - 3) + "\n" + (rank[i]));
+                array_allStation_score_temp.push({ value: array_allStation_score[i], name: data[i].feeStationName })
+            }
+        } else if (type == 5) {
+            array_check_type = [];
+            if (data.length != 0) {
+                var map = new HashMap();
+                for (var i = 0; i < data.length; i++) {
+                    if (map.get(data[i].name) == null) {
+                        map.set(data[i].name, data[i].all_check_score)
+                    } else {
+                        map.set(data[i].name, data[i].all_check_score + map.get(data[i].name))
+                    }
+
+                }
+
+                map.forEach(function(value, key) {
+                    array_check_type.push({ "value": value, "name": key });
+                });
+            } else {
+                array_check_type.length = 0;
+            }
+        } else if (type == 6) {
+            array_all_deptname = new Array();
+            map_month_data = new HashMap();
+            map_per_data = new HashMap();
+
+            // array_points_name.length = 0;
+            // array_points_pre.length = 0;
+            // arrar_points_month.length = 0;
+            if (data != '' && data.Pmth.length != 0 || data.Tmth.length != 0) {
+                data_each_people_points(data);
+            } else {
+                // array_points_name.length = 0;
+                // array_points_pre.length = 0;
+                // arrar_points_month.length = 0;
+            }
+        }
+    }
+
+    function data_each_people_points(data) {
+        var flag = false;
+        var name = ['环境卫生', '仪容仪表着装', '表情', '动作', '文明用语', '工作纪律及行为举止', '便民服务', '安全管理']
+        array_all_name = name;
+        // array_all_deptname = ["连云港道管", "盐城道管", "南通道管"];
+        var Tmth = data.Tmth;
+        var Pmth = data.Pmth;
+        // var Ntemp = new Array();
+        // var Ptemp = new Array();
+        // var Ttemp = new Array();
+
+        for (var i = 0; i < name.length; i++) {
+            //     var temp_map_m = new HashMap();
+            //     var temp_map_p = new HashMap();
+
+            for (var j = 0; j < Tmth.length; j++) {
+                flag = false;
+                if (array_all_deptname.length > 0) {
+                    for (var p = 0; p < array_all_deptname.length; p++) {
+                        if (array_all_deptname[p] == Tmth[j].pfeeStationName) {
+                            flag = true;
+                            break;
+                        }
+                    }
+                }
+                if (!flag) {
+                    array_all_deptname.push(Tmth[j].pfeeStationName);
+                }
+
+                if (name[i] == Tmth[j].name) {
+                    if (map_month_data.get(Tmth[j].pfeeStationName) != null) {
+                        var map = map_month_data.get(Tmth[j].pfeeStationName)
+                        if (map.get(name[i]) != null) {
+                            map.set(name[i], map.get(name[i]) + Tmth[j].all_check_score);
+                        } else {
+                            map.set(name[i], Tmth[j].all_check_score);
+                        }
+                        map_month_data.set(Tmth[j].pfeeStationName, map);
+                    } else {
+                        var map = new HashMap();
+                        map.set(name[i], Tmth[j].all_check_score);
+                        map_month_data.set(Tmth[j].pfeeStationName, map);
+                    }
+                }
+
+            }
+
+            for (var j = 0; j < Pmth.length; j++) {
+                flag = false;
+                if (array_all_deptname.length > 0) {
+                    for (var p = 0; p < array_all_deptname.length; p++) {
+                        if (array_all_deptname[p] == Pmth[j].pfeeStationName) {
+                            flag = true;
+                            break;
+                        }
+                    }
+                }
+                if (!flag) {
+                    array_all_deptname.push(Pmth[j].pfeeStationName);
+                }
+                if (name[i] == Pmth[j].name) {
+                    if (map_per_data.get(Pmth[j].pfeeStationName) != null) {
+                        var map = map_per_data.get(Pmth[j].pfeeStationName)
+                        if (map.get(name[i]) != null) {
+                            map.set(name[i], map.get(name[i]) + Pmth[j].all_check_score);
+                        } else {
+                            map.set(name[i], Pmth[j].all_check_score);
+                        }
+                        map_per_data.set(Pmth[j].pfeeStationName, map);
+                    } else {
+                        var map = new HashMap();
+                        map.set(name[i], Pmth[j].all_check_score);
+                        map_per_data.set(Pmth[j].pfeeStationName, map);
+                    }
+                }
+            }
+
+            //     map_month_data.set(name[i], temp_map_m)
+            //     map_pre_data.set(name[i], temp_map_p)
+        }
+        // console.log(Tmth)
+        // console.log(map_month_data)
+
+
+        // flag = true;
+        // if (Tmth.length > 0) {
+        //     for (var j = 0; j < Tmth.length; j++) {
+        //         if (name[i] == Tmth[j].name && Tmth[j].all_check_score != null) {
+        //             //		Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
+        //             Ttemp[i] = Tmth[j].all_check_score;
+        //             break;
+        //         } else {
+        //             Ttemp[i] = 0;
+        //         }
+        //     }
+        // } else {
+        //     Ttemp[i] = 0;
+        // }
+        // if (Pmth.length > 0) {
+        //     for (var m = 0; m < Pmth.length; m++) {
+        //         if (name[i] == Pmth[m].name && Pmth[m].all_check_score != null) {
+        //             //	Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
+        //             Ptemp[i] = Pmth[m].all_check_score;
+        //             break;
+        //         } else {
+        //             Ptemp[i] = 0;
+        //         }
+        //     }
+        // } else {
+        //     Ptemp[i] = 0;
+        // }
+        // if (Ttemp[i] == 0 && Ptemp[i] == 0) {
+        //     name[i] = "";
+        //     flag = null;
+        // }
+        // if (name[i] != "") {
+        //     if (name[i] == '仪容仪表着装') {
+        //         name[i] = '仪表';
+        //     }
+        //     if (name[i] == '工作纪律及行为举止') {
+        //         name[i] = '行为';
+        //     }
+        //     array_points_name.push(name[i]);
+        // }
+
+        // if (flag) {
+        //     array_points_pre.push(Ptemp[i]);
+        //     arrar_points_month.push(Ttemp[i]);
+        // }
+        // }
+    }
+
+    /**
+     * 除数为0处理
+     * @param {*} num
+     * @param {*} num1
+     * @param {*} num2
+     * @param {*} num4
+     */
+    function filter_handler(num, num1, num2, num4) {
+        if (num1 == 0 || num2 == 0) {
+            return num4;
+        } else {
+            return ((num / num1) / num2).toFixed(2);
+        }
+    }
+
+    /**
+     * 图配置
+     */
+    function echart(flag) {
+        // 路径配置
+        require.config({
+            paths: {
+                echarts: '/js/lib/echarts/build/dist'
+            }
+        });
+        // 使用
+        require(
+            [
+                'echarts',
+                'echarts/theme/macarons',
+                'echarts/chart/line',
+                'echarts/chart/bar',
+                'echarts/chart/pie',
+                'echarts/config'
+            ],
+            function(ec, theme) {
+
+                // 基于准备好的dom,初始化echarts图表
+                if (flag) {
+                    year_assess = ec.init(document.getElementById('company-year-assess'), theme);
+                }
+                points_assess = ec.init(document.getElementById('company-points-assess'), theme);
+                score_rank = ec.init(document.getElementById('roadManager-score-rank'));
+                stationAll_rank = ec.init(document.getElementById('company-stationAll-rank'));
+                check_type = ec.init(document.getElementById('server-check-type'), theme);
+                people_points = ec.init(document.getElementById('each-people-points'));
+
+
+                points_assess.on(ecConfig.EVENT.CLICK, point_c)
+                score_rank.on(ecConfig.EVENT.CLICK, score_c)
+                stationAll_rank.on(ecConfig.EVENT.CLICK, station_c)
+
+
+            }
+        );
+    }
+
+    /**
+     * 图一
+     */
+    function company_year_assess_one() {
+        //debugger;
+        option = {
+            color: ['#00ced1'],
+            tooltip: {
+                trigger: 'axis'
+            },
+            noDataLoadingOption: {
+                text: '暂无数据',
+                effect: 'bubble',
+                effectOption: {
+                    effect: {
+                        n: 0 //气泡个数为0
+                    }
+                },
+                textStyle: {
+                    fontSize: 20,
+                    fontFamily: 'cursive',
+                    fontWeight: 'bold'
+                }
+            },
+            legend: {
+                data: ['公司得分']
+            },
+            toolbox: {
+                show: true,
+            },
+            calculable: true,
+            xAxis: [{
+                type: 'category',
+                boundaryGap: false,
+                data: x_m_array_temp
+            }],
+            yAxis: [{
+                type: 'value',
+                min: min_year,
+                max: 1000,
+                axisLabel: {
+                    formatter: '{value}'
+                }
+            }],
+            series: [{
+                    name: '公司得分',
+                    type: 'line',
+                    data: array_year_score,
+                    markPoint: {
+                        data: [
+                            { type: 'max', name: '最大值' },
+                            { type: 'min', name: '最小值' }
+                        ]
+                    },
+                    markLine: {
+                        data: [
+                            { type: 'average', name: '平均值' }
+                        ]
+                    }
+                },
+
+            ]
+        };
+        return option;
+    }
+
+
+    /**
+     * 图二
+     */
+    function company_points_assess_two() {
+        /*option = {
+        	tooltip : {
+        		trigger: 'item',
+        		formatter:  "公司考核扣分占比 <br/>{b} : {c}人 ({d}%)"
+        	},
+        	noDataLoadingOption :{
+        	text: '暂无数据',
+        	effect:'bubble',
+        	effectOption : {
+        		effect: {
+        			n: 0 //气泡个数为0
+        		}
+        	},
+        	textStyle: {
+        		fontSize: 20,
+        		fontFamily:'cursive',
+        		fontWeight: 'bold'
+        	}
+        	},
+        	toolbox: {
+        		show : true,
+        		feature : {
+
+        			magicType : {
+
+        				type: ['pie', 'funnel'],
+        				option: {
+        					funnel: {
+        						x: '25%',
+        						width: '50%',
+        						funnelAlign: 'left',
+        						max: 1548
+        					}
+        				}
+        			},
+        		}
+        	},
+        	calculable : true,
+        	series : [
+        		{
+        			name:'访问来源',
+        			type:'pie',
+        			radius : '55%',
+        			center: ['50%', '50%'],
+        			data:array_points,
+        			itemStyle:{
+        			normal:{
+        				label:{
+        					show: true,
+        				    formatter: '{b} :\n{c}人 ({d}%)'
+        				},
+        				labelLine :{show:true}
+        				}
+        			}
+        		}
+        	]
+        };*/
+
+        option = {
+            tooltip: {
+                trigger: 'item',
+                formatter: "公司考核扣分占比 <br/>{b} : {c}人 ({d}%)"
+            },
+
+            toolbox: {
+                show: true,
+            },
+            calculable: false,
+            series: [{
+                    name: '访问来源',
+                    type: 'pie',
+                    selectedMode: 'single',
+                    radius: [0, 80],
+
+                    // for funnel
+                    x: '20%',
+                    width: '40%',
+                    funnelAlign: 'right',
+                    max: 1548,
+
+                    itemStyle: {
+                        normal: {
+                            label: {
+                                show: true,
+                                formatter: '{b}:\n{c}人({d}%)',
+                                textStyle: {
+                                    alias: 'center',
+                                    fontSize: 10,
+                                    color: '#888'
+                                }
+                            },
+                            labelLine: {
+                                show: true,
+                                length: 50,
+                                lineStyle: {
+                                    color: '#888'
+                                }
+
+                            }
+                        }
+                    },
+                    data: array_points
+                },
+                {
+                    name: '访问来源',
+                    type: 'pie',
+                    radius: [100, 125],
+
+                    // for funnel
+                    x: '60%',
+                    width: '35%',
+                    funnelAlign: 'left',
+                    max: 1048,
+                    itemStyle: {
+                        normal: {
+                            label: {
+                                show: false,
+                                formatter: '{b}:{c}人({d}%)'
+                            },
+                            labelLine: {
+                                show: false
+                            }
+                        }
+                    },
+                    data: array_points2
+                }
+            ]
+        };
+
+
+        return option;
+    }
+
+    /**
+     * 图三
+     */
+    function road_manager_score_rank_three() {
+        option = {
+            color: ['#00ced1'], // 条形图颜色
+            tooltip: {
+                trigger: 'axis'
+            },
+            noDataLoadingOption: {
+                text: '暂无数据',
+                effect: 'bubble',
+                effectOption: {
+                    effect: {
+                        n: 0 //气泡个数为0
+                    }
+                },
+                textStyle: {
+                    fontSize: 20,
+                    fontFamily: 'cursive',
+                    fontWeight: 'bold'
+                }
+            },
+            grid: {
+                width: "75%",
+
+            },
+            calculable: true,
+            xAxis: [{
+                axisLabel: {
+                    interval: 0
+                },
+                type: 'category',
+                data: array_road
+            }],
+            yAxis: [{
+                type: 'value',
+                min: min_road,
+                max: 1000
+            }],
+            series: [{
+
+                type: 'bar',
+                data: array_road_score_temp,
+                itemStyle: {
+                    normal: {
+                        label: {
+                            show: true,
+                            position: 'insideTop'
+                        }
+                    }
+                },
+                markLine: {
+                    data: [
+                        { type: 'average', name: '平均值' }
+                    ]
+                }
+            }]
+        };
+
+        return option;
+    }
+
+    /**
+     * 图四
+     */
+    function company_stationAll_rank_four() {
+        option = {
+            color: ['#00ced1'], // 条形图颜色
+            tooltip: {
+                trigger: 'axis'
+            },
+            noDataLoadingOption: {
+                text: '暂无数据',
+                effect: 'bubble',
+                effectOption: {
+                    effect: {
+                        n: 0 //气泡个数为0
+                    }
+                },
+                textStyle: {
+                    fontSize: 20,
+                    fontFamily: 'cursive',
+                    fontWeight: 'bold'
+                }
+            },
+            legend: {
+                data: ['公司全体收费站得分']
+            },
+            calculable: true,
+            xAxis: [{
+                axisLabel: {
+                    interval: 0
+                },
+                type: 'category',
+                data: array_allStation
+            }],
+            yAxis: [{
+                type: 'value',
+                min: min_allStation,
+                max: 1000
+            }],
+            series: [{
+                name: '公司全体收费站得分',
+                type: 'bar',
+                data: array_allStation_score_temp,
+                itemStyle: {
+                    normal: {
+                        label: {
+                            show: true,
+                            position: 'insideTop'
+                        }
+                    }
+                },
+                markLine: {
+                    data: [
+                        { type: 'average', name: '平均值' }
+                    ]
+                }
+            }]
+        };
+
+        return option;
+    }
+
+    /**
+     * 图五
+     */
+    function server_check_type_five() {
+        option = {
+            tooltip: {
+                trigger: 'item',
+                formatter: "温馨服务检查占比 <br/>{b} : {c}分 ({d}%)"
+            },
+            noDataLoadingOption: {
+                text: '暂无数据',
+                effect: 'bubble',
+                effectOption: {
+                    effect: {
+                        n: 0 //气泡个数为0
+                    }
+                },
+                textStyle: {
+                    fontSize: 20,
+                    fontFamily: 'cursive',
+                    fontWeight: 'bold'
+                }
+            },
+            toolbox: {
+                show: true,
+                feature: {
+
+                    magicType: {
+
+                        type: ['pie', 'funnel'],
+                        option: {
+                            funnel: {
+                                x: '25%',
+                                width: '50%',
+                                funnelAlign: 'left',
+                                max: 1548
+                            }
+                        }
+                    },
+                }
+            },
+            calculable: true,
+            series: [{
+                name: '访问来源',
+                type: 'pie',
+                radius: '55%',
+                center: ['50%', '50%'],
+                data: array_check_type,
+                itemStyle: {
+                    normal: {
+                        label: {
+                            show: true,
+                            formatter: '{b} :\n{c}分 ({d}%)'
+                        },
+                        labelLine: { show: true }
+                    }
+                }
+            }]
+        };
+        return option;
+    }
+
+    /**
+     * 图六
+     */
+    function each_people_points_six() {
+
+        var t_map_p = new HashMap();
+        var t_map_c = new HashMap();
+
+
+        var sdata = new Array();
+
+        for (var j = 0; j < array_all_deptname.length; j++) {
+            var dept = array_all_deptname[j]
+
+            if (map_per_data.get(dept) != null) {
+                var data_a = new Array();
+                var d_t = map_per_data.get(dept);
+                for (var i = 0; i < array_all_name.length; i++) {
+                    var name = array_all_name[i];
+                    data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
+
+                    if (t_map_p.get(name) == null) {
+                        t_map_p.set(name, d_t.get(name) == null ? 0 : d_t.get(name))
+                    } else {
+                        t_map_p.set(name, t_map_p.get(name) + (d_t.get(name) == null ? 0 : d_t.get(name)));
+                    }
+                }
+                var d_tt = {
+                    name: dept,
+                    type: 'bar',
+                    stack: '上月',
+                    barGap: 5,
+                    barCategoryGap: 20,
+                    data: data_a
+                }
+                if (j == array_all_deptname.length - 1) {
+                    d_tt['itemStyle'] = {
+                        normal: {
+                            label: {
+                                show: true,
+                                position: 'top',
+                                formatter: function(params) {
+                                    var name = params.name
+                                    if (name == '仪表') {
+                                        name = '仪容仪表着装';
+                                    }
+                                    if (name == '行为') {
+                                        name = '工作纪律及行为举止';
+                                    }
+
+                                    var v = t_map_p.get(name);
+                                    if (isNaN(v)) v = 0;
+                                    return '上月\n' + v;
+                                },
+                                textStyle: {
+                                    color: 'blue'
+                                }
+                            }
+                        }
+                    }
+                }
+                sdata.push(d_tt);
+            } else {
+                var data_a = new Array();
+                for (var i = 0; i < array_all_name.length; i++) {
+                    var name = array_all_name[i];
+                    data_a.push(0);
+
+                    if (t_map_p.get(name) == null) {
+                        t_map_p.set(name, 0)
+                    } else {
+                        t_map_p.set(name, t_map_p.get(i) + 0);
+                    }
+                }
+                var d_tt = {
+                    name: dept,
+                    type: 'bar',
+                    stack: '上月',
+                    data: data_a
+                }
+                if (j == array_all_deptname.length - 1) {
+                    d_tt['itemStyle'] = {
+                        normal: {
+                            label: {
+                                show: true,
+                                position: 'top',
+                                formatter: function(params) {
+                                    var name = params.name
+                                    if (name == '仪表') {
+                                        name = '仪容仪表着装';
+                                    }
+                                    if (name == '行为') {
+                                        name = '工作纪律及行为举止';
+                                    }
+                                    var v = t_map_p.get(name);
+                                    if (isNaN(v)) v = 0;
+                                    return '上月\n' + v;
+                                },
+                                textStyle: {
+                                    color: 'blue'
+                                }
+                            }
+                        }
+                    }
+                }
+                sdata.push(d_tt);
+            }
+            if (map_month_data.get(dept) != null) {
+                var data_a = new Array();
+                var d_t = map_month_data.get(dept);
+                for (var i = 0; i < array_all_name.length; i++) {
+                    var name = array_all_name[i];
+                    data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
+
+                    if (t_map_c.get(name) == null) {
+                        t_map_c.set(name, d_t.get(name) == null ? 0 : d_t.get(name))
+                    } else {
+                        t_map_c.set(name, t_map_c.get(name) + (d_t.get(name) == null ? 0 : d_t.get(name)));
+                    }
+                }
+                var d_tt = {
+                    name: dept,
+                    type: 'bar',
+                    stack: '本月',
+                    data: data_a
+                }
+                if (j == array_all_deptname.length - 1) {
+                    d_tt['itemStyle'] = {
+
+                        normal: {
+                            label: {
+                                show: true,
+                                position: 'top',
+                                formatter: function(params) {
+                                    var name = params.name
+                                    if (name == '仪表') {
+                                        name = '仪容仪表着装';
+                                    }
+                                    if (name == '行为') {
+                                        name = '工作纪律及行为举止';
+                                    }
+
+                                    var v = t_map_c.get(name);
+                                    if (isNaN(v)) v = 0;
+                                    return '本月\n' + v;
+                                },
+                                textStyle: {
+                                    color: 'red'
+                                }
+                            }
+                        }
+                    }
+                }
+                sdata.push(d_tt);
+            } else {
+                var data_a = new Array();
+                for (var i = 0; i < array_all_name.length; i++) {
+                    var name = array_all_name[i];
+                    data_a.push(0);
+                    if (t_map_c.get(name) == null) {
+                        t_map_c.set(name, 0)
+                    } else {
+                        t_map_c.set(name, t_map_c.get(name) + 0);
+                    }
+                }
+                var d_tt = {
+                    name: dept,
+                    type: 'bar',
+                    stack: '本月',
+                    data: data_a
+                }
+                if (j == array_all_deptname.length - 1) {
+                    d_tt['itemStyle'] = {
+                        normal: {
+                            label: {
+                                show: true,
+                                position: 'top',
+                                formatter: function(params) {
+                                    var name = params.name
+                                    if (name == '仪表') {
+                                        name = '仪容仪表着装';
+                                    }
+                                    if (name == '行为') {
+                                        name = '工作纪律及行为举止';
+                                    }
+                                    var v = t_map_c.get(name);
+                                    if (isNaN(v)) v = 0;
+
+                                    return '本月\n' + v;
+                                },
+                                textStyle: {
+                                    color: 'red'
+                                }
+                            }
+                        }
+                    }
+                }
+                sdata.push(d_tt);
+            }
+        }
+
+        var maxvaluedata = 0;
+        t_map_c.forEach(function(value, key) {
+            if (value > maxvaluedata) maxvaluedata = value;
+        })
+        t_map_p.forEach(function(value, key) {
+            if (value > maxvaluedata) maxvaluedata = value;
+        })
+
+
+
+        var namelist = new Array();
+        for (var i = 0; i < array_all_name.length; i++) {
+            var name = array_all_name[i];
+            if (name == '仪容仪表着装') {
+                name = '仪表';
+            }
+            if (name == '工作纪律及行为举止') {
+                name = '行为';
+            }
+            namelist.push(name);
+        }
+
+
+        option = {
+            tooltip: {
+                trigger: 'axis',
+                axisPointer: { // 坐标轴指示器,坐标轴触发有效
+                    type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+                },
+                formatter: function(params, ticket, callback) {
+                    var name = "";
+                    var content = "";
+                    if (params.length > 0) {
+                        for (var i = 0; i < params.length; i++) {
+                            var p = params[i];
+                            name = p.name;
+                            if (p.series.stack == "本月") {
+                                content += "<br>本月 " + p.seriesName.replace("道管中心", "") + ":" + p.value + "分"
+                            } else {
+                                content += "<br>上月 " + p.seriesName.replace("道管中心", "") + ":" + p.value + "分"
+                            }
+                        }
+                    }
+                    return name + content;
+                }
+            },
+            noDataLoadingOption: {
+                text: '暂无数据',
+                effect: 'bubble',
+                effectOption: {
+                    effect: {
+                        n: 0 //气泡个数为0
+                    }
+                },
+                textStyle: {
+                    fontSize: 20,
+                    fontFamily: 'cursive',
+                    fontWeight: 'bold'
+                }
+            },
+            grid: {
+                width: "80%",
+            },
+            legend: {
+                data: array_all_deptname
+            },
+            calculable: true,
+            xAxis: [{
+                type: 'category',
+                data: namelist
+            }],
+            yAxis: [{
+                type: 'value',
+                max: (maxvaluedata + 200)
+            }],
+            series: sdata
+        };
+        return option;
+    }
+
+
+});
+
+var ecConfig = require('echarts/config');
+
+
+// var temp_time = null;
+// var road_p = null;
+// var station_p = null;
+
+function point_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+
+        var pdata = {
+            time: $("#month_date").val()
+        }
+
+        $.zui.store.set('page_data_param_temp_time', $("#month_date").val());
+
+        $.zui.store.set('store_param_' + current_url, pdata);
+        isnew = false;
+        changePage("/view/statistics/assess_situation.html");
+
+    }
+}
+
+function score_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+
+        var pdata = {
+            time: $("#month_date").val()
+        }
+
+        $.zui.store.set('page_data_param_temp_time', $("#month_date").val());
+        $.zui.store.set('page_data_param_road_p', param.data.name);
+
+        $.zui.store.set('store_param_' + current_url, pdata);
+        isnew = false;
+        changePage("/view/statistics/road_manage_statistics.html");
+    }
+}
+
+function station_c(param) {
+    if (typeof param.seriesIndex == 'undefined') {
+        return;
+    }
+    if (param.type == 'click') {
+        var pdata = {
+            time: $("#month_date").val()
+        }
+        $.zui.store.set('page_data_param_temp_time', $("#month_date").val());
+
+
+
+        var stationlist = $.zui.store.get("cache_fee_station_list");
+        var roadlist = $.zui.store.get("cache_road_manager_list");
+
+        for (var i in stationlist) {
+            if (stationlist[i].name == param.data.name) {
+                for (var j in roadlist) {
+                    if (roadlist[j].deptid == stationlist[i].parentid) {
+                        $.zui.store.set('page_data_param_road_p', roadlist[j].name);
+                        break;
+                    }
+                }
+                break;
+            }
+        }
+        $.zui.store.set('page_data_param_station_p', param.data.name);
+        $.zui.store.set('store_param_' + current_url, pdata);
+        isnew = false;
+        changePage("/view/statistics/toll_station_statistics.html");
+    }
+}

+ 96 - 0
VisualInspection/fwq/view/statistics/operation_management_integration.html

@@ -0,0 +1,96 @@
+<!--服务区-营运管理综合检查情况统计-->
+<script src="/fwq/js/statistics/operation_management_integration.js?__inline"></script>
+<link rel="stylesheet" type="text/css" href="/css/statistics/assess_situation.css?__inline">
+<div class="container-fluid ">
+    <div class="form-div">
+        <form  class="form-horizontal">
+            <div class="form-group">
+                <div class="from-label"><label>查询日期</label></div>
+                <div class="col-sm-2">
+                    <input type="text" id="start-time" class="form-control form-date" placeholder="开始日期">
+                </div>
+                <div class="col-sm-2">
+                    <input type="text" id="end-time" class="form-control form-date" placeholder="结束日期">
+                </div>
+                <div class="col-sm-1">
+                    <button class="btn btn-primary " type="button" onclick="queryTypeClick()">查询</button>
+                </div>
+                <div class="col-sm-1">
+                    <button class="btn btn-primary " type="button" onclick="exportExcel()" >导出Excel</button>
+                </div>
+            </div>
+        </form>
+    </div>
+    <div class="table-title"><span>运营管理综合检查情况统计表</span></div>
+
+    <div class="row">
+          <!-- 使用一个div来显示数据表格 -->
+          <div class="datatable" data-checkable="false" data-sortable="false"  style="margin-bottom:0px;">
+              <div class="table-head" ><table border="1" width="100%" height="90px" align="center">
+                 <thead>
+                        <tr>
+                        <!--<th rowspan="3" width="6%">排名</th><th rowspan="3" width="6%">道管</th>-->
+                        <th rowspan="3" width="8%">排名</th>
+                        <!--<th rowspan="3" width="6%">道管内排名</th>-->
+                        <th rowspan="3" width="8%">服务区</th><th colspan="4" width="24%" height="40px">温馨服务</th>
+                        <th colspan="2" width="12%" height="40px">现场检查</th><th rowspan="3" width="8%">总平均扣分</th>
+                        <th rowspan="3" width="8%">平均得分</th>
+                        </tr>
+                        <tr> 
+                        <th colspan="2">公司检查</th><th colspan="2">第三方暗访</th>
+                        <th rowspan="2" width="54px">受检次数</th><th rowspan="2" width="54px">扣分合计</th>
+                        </tr>
+                        <tr> 
+                        <th width="54px">受检次数</th><th width="54px">扣分合计</th>
+                        <th width="54px">受检次数</th><th width="54px">扣分合计</th>
+                        </tr>
+                 </thead>
+                    <!-- <tbody class="table-tbody" style="background:white" align="center">
+               
+                    </tbody> -->
+                </table></div>
+          </div>
+          <div id="scrollTable" style="height:300px;overflow:scroll;margin-right:-10px;">
+              <div class="table-head" style="margin:0px;">
+                  <table border="1" width="100%" height="90px" align="center" style="border-top:0px;">
+                    <tbody class="table-tbody" style="background:white" align="center">
+               
+                    </tbody>
+                  </table></div>
+          </div>
+    </div>
+</div>
+<script>
+   
+    $(document).ready(function() {
+        // 设置滚动表格的高度
+        $("#scrollTable").height($(window).height() - 360);
+        // 仅选择日期
+        $("#start-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+        // 仅选择日期
+        $("#end-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+        initQueryType();
+    });
+</script>

+ 106 - 0
VisualInspection/fwq/view/statistics/total_company_statistics.html

@@ -0,0 +1,106 @@
+<script src="/js/lib/echarts/build/dist/echarts.js"></script>
+<script src="/js/statistics/common_statistic.js?__inline"></script>
+<script src="/fwq/js/statistics/total_company_statistics.js"></script>
+<link rel="stylesheet" type="text/css" href="/css/statistics/total_company_statistics.css">
+<div class="container-fluid statistic-panel">
+    <!--<div class="row-1"><span>公司统计</span></div>
+    <div class="line-1"></div>-->
+    <div class="row">
+        <div class="div-month col-sm-1">
+            <!--<select>-->
+            <!--<option value="1">一月</option>
+            <option value="2">二月</option>
+            <option value="3">三月</option>
+            <option value="4">四月</option>
+            <option value="5">五月</option>
+            <option value="6">六月</option>
+            <option value="7">七月</option>
+            <option value="8">八月</option>
+            <option value="9">九月</option>
+            <option value="10">十月</option>
+            <option value="11">十一月</option>
+            <option value="12">十二月</option>-->
+            <!--</select>-->
+            <input id="month_date" class="form-control form-date" type="text" placeholder="请选择" style="height:30px;">
+        </div>
+        <div class="col-sm-2"><button class="btn btn-info2 col-sm-6 query-company">查询</button></div>
+    </div>
+    <!-- <div class="line-1"></div> -->
+
+    <div class="border-line">
+        <div class="row-3">
+            <div class="title-div"><span>公司12个月考核得分总体变化趋势分析</span></div>
+        </div>
+        <div id="company-year-assess" style="height: 100%;height:400px;"></div>
+    </div>
+
+    <div class="row">
+        <div class="col-sm-6">
+            <div class="border-no">
+                <div class="title-div"><span>公司考核扣分情况占比</span></div>
+                <div id="company-points-assess" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
+            </div>
+        </div>
+        <!-- <div class="line-3"></div> -->
+        <div class="col-sm-6">
+            <div class="border-no">
+                <div class="title-div"><span class="title-span">道管中心得分排名</span></div>
+                <div id="roadManager-score-rank" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
+            </div>
+        </div>
+    </div>
+    <!-- <div class="border-line">
+        <div class="row-4">
+            <div class="col-sm-6"><span>公司考核扣分情况占比</span></div>
+             <div class="line-2"></div>
+            <div class="col-sm-6"><span>道管中心得分排名</span></div>
+        </div>
+        <div class="row-5">
+            <div id="company-points-assess" style="width:49%;height:400px;float:left;"></div>
+             <div class="line-3"></div>
+            <div id="roadManager-score-rank" style="width:49%;height:400px;float:left;"></div>
+        </div>
+    </div> -->
+
+
+
+    <div class="border-line">
+        <div class="row-6">
+            <div class="title-div"><span>公司全体服务区排名</span></div>
+        </div>
+        <div id="company-stationAll-rank" style="width:100%;height:400px;"></div>
+    </div>
+
+    <div class="row">
+        <div class="col-sm-6">
+            <div class="border-no">
+                <div class="title-div"><span>温馨服务检查问题类别占比</span></div>
+                <div id="server-check-type" style="width:100%;height:400px;float:left;"></div>
+            </div>
+        </div>
+        <div class="col-sm-6">
+            <div class="border-no">
+                <div class="title-div"><span>各个问题类别的扣分情况</span></div>
+                <div id="each-people-points" style="width:100%;height:400px;float:left;"></div>
+            </div>
+        </div>
+    </div>
+    <!-- <div class="border-line">
+        <div class="row-7">
+            <div class="col-1"><span>温馨服务检查问题类别占比</span></div>
+            <div class="line-2"></div>
+            <div class="col-1"><span>各个问题类别的扣分情况</span></div>
+        </div>
+        <div class="row-8">
+            <div id="server-check-type" style="width:49%;height:400px;float:left;"></div>
+            <div class="line-3"></div>
+            <div id="each-people-points" style="width:49%;height:400px;float:left;"></div>
+        </div>
+    </div> -->
+
+</div>
+<script>
+    $(document).ready(function() {
+
+    });
+</script>

+ 68 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_F.java

@@ -0,0 +1,68 @@
+package com.xintong.visualinspection.controller.gettway;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.controller.BaseController;
+import com.xintong.visualinspection.service.StatisticsService_F;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author huangcheng
+ * @since 2018/5/9
+ */
+@RestController
+@RequestMapping("/f/statistics")
+public class StatisticsController_F extends BaseController {
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private StatisticsService_F statisticsService_f;
+
+    /**
+     * 公司12个月考核得分总体变化趋势分析
+     */
+//    @RequestMapping(value = "/score/year/info")
+//    public String selectYearScoreChange(@RequestBody FwqStatisticsBean fwqStatisticsBean){
+//        List<FwqStatisticsBean> lists=  statisticsService_f.getYearScoreChange(fwqStatisticsBean);
+//        return super.returnSuccessResult(lists);
+//    }
+
+    /**
+     * 运营管理综合检查情况统计表
+     */
+    @RequestMapping(value = "/operation/manage/integration")
+    public String getOperationInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getOperationInfo(obj);
+        int totalCompanyNum = 0,
+                totalCompanyScore = 0,
+                totalThirdNum = 0,
+                totalThirdScore = 0,
+                totalOnsiteNum = 0,
+                totalOnsiteScore = 0;
+
+        for (FwqStatisticsBean bean : lists) {
+            totalCompanyNum += bean.getCompany_check_num();
+            totalCompanyScore += bean.getCompany_total_score();
+            totalThirdNum += bean.getThird_check_num();
+            totalThirdScore += bean.getThird_total_score();
+            totalOnsiteNum += bean.getOnsite_check_num();
+            totalOnsiteScore += bean.getOnsite_total_score();
+        }
+        Map<String, Object> resultMap = new HashMap<String, Object>();
+        resultMap.put("list", lists);
+        resultMap.put("totalCompanyNum", totalCompanyNum);
+        resultMap.put("totalCompanyScore", totalCompanyScore);
+        resultMap.put("totalThirdNum", totalThirdNum);
+        resultMap.put("totalThirdScore", totalThirdScore);
+        resultMap.put("totalOnsiteNum", totalOnsiteNum);
+        resultMap.put("totalOnsiteScore", totalOnsiteScore);
+        return super.returnSuccessResult(resultMap);
+    }
+}

+ 27 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/controller/FileExcelController_F.java

@@ -1,14 +1,19 @@
 package com.xintong.visualinspection.visuallnspection_fjq.controller;
 
 import com.xintong.visualinspection.bean.FwqCheckOther;
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.util.DateUtil;
 import com.xintong.visualinspection.visuallnspection_fjq.service.CheckOtherService_F;
+import com.xintong.visualinspection.visuallnspection_fjq.service.StatisticsService_F;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
 
 @RestController
 @RequestMapping("/f/file")
@@ -16,6 +21,8 @@ public class FileExcelController_F extends BaseController {
 
     @Autowired
     private CheckOtherService_F checkOtherService_f;
+    @Autowired
+    private StatisticsService_F statisticsService_f;
 
     /**
      * 稽查管理导出
@@ -45,4 +52,24 @@ public class FileExcelController_F extends BaseController {
         return super.returnSuccessResult(null);
     }
 
+    /**
+     * 服务区-营运管理综合检查情况统计导出
+     * @param req
+     * @param resp
+     * @param start_date
+     * @param end_date
+     * @return
+     */
+    @RequestMapping(value = "/operation/manage/integration",method=RequestMethod.GET)
+    public String getOperationInfo(HttpServletRequest req, HttpServletResponse resp,
+                                   @RequestParam String start_date, @RequestParam String end_date){
+        FwqStatisticsBean obj = new FwqStatisticsBean();
+        Date start = DateUtil.strParseDate(start_date);
+        Date end = DateUtil.strParseDate(end_date);
+        obj.setStart_date(start);
+        obj.setEnd_date(end);
+        statisticsService_f.getOperationInfo(obj, req, resp);
+        return super.returnSuccessResult(null);
+    }
+
 }

+ 15 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/dao/FwqStatisticsDao.java

@@ -0,0 +1,15 @@
+package com.xintong.visualinspection.visuallnspection_fjq.dao;
+
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 文件名:FwqCheckOtherDao
+ * 版本信息:日期:2018/5/2 Copyright 江苏省交通规划设计院 Corporation 2018 版权所有.
+ */
+@Mapper
+public interface FwqStatisticsDao {
+    List<FwqStatisticsBean> getselectFeeStationOperationScoreDetail(FwqStatisticsBean obj);
+}

+ 25 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/mapper/master/StatisticsMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xintong.visualinspection.visuallnspection_fjq.dao.FwqStatisticsDao">
+
+    <select id="getselectFeeStationOperationScoreDetail"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT
+        o.dept_id,
+        COUNT(1) checked_num,
+        SUM(o.check_score) check_total_score
+        FROM
+        other_check o
+        WHERE
+        o.check_type = #{check_type}
+        <if test="start_date!=null and end_date != null">
+            AND o.check_time &gt;= #{start_date} AND o.check_time &lt; #{end_date}
+        </if>
+        GROUP BY
+        dept_id
+    </select>
+
+</mapper>
+
+

+ 11 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/StatisticsService_F.java

@@ -0,0 +1,11 @@
+package com.xintong.visualinspection.visuallnspection_fjq.service;
+
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public interface StatisticsService_F {
+
+    void getOperationInfo(FwqStatisticsBean obj, HttpServletRequest req, HttpServletResponse resp);
+}

+ 139 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsServiceImpl.java

@@ -0,0 +1,139 @@
+package com.xintong.visualinspection.visuallnspection_fjq.service.impl;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import com.xintong.visualinspection.bean.FeeStation;
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.service.CommonService;
+import com.xintong.visualinspection.service.StatisticsService_F;
+import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqStatisticsDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 文件名:OtherCheckServiceImpl_F
+ * 版本信息:日期:2017/4/7 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ *
+ * @author wenhongquan
+ * @date 2018/05/02
+ */
+
+@com.alibaba.dubbo.config.annotation.Service(
+        version = "1.0.0",
+        application = "${dubbo.application.id}",
+        protocol = "${dubbo.protocol.id}",
+        registry = "${dubbo.registry.id}"
+)
+public class StatisticsServiceImpl implements StatisticsService_F {
+
+    private static final Logger logger = LoggerFactory.getLogger(StatisticsServiceImpl.class);
+
+    @Autowired
+    private FwqStatisticsDao fwqStatisticsDao;
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private CommonService commonService;
+
+
+    @Override
+    public List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj) {
+
+        // 获得所有服务区数据
+        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
+        for (FeeStation sta : saList) {
+            FwqStatisticsBean obj2 = new FwqStatisticsBean();
+            obj2.setDept_id(Long.valueOf(sta.getDeptid()));
+            obj2.setName(sta.getName());
+            mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
+        }
+
+        // 获取第三方暗访稽查的某个服务区的受检次数和扣分合计
+        obj.setCheck_type(8);
+        List<FwqStatisticsBean> third_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+        // 获取现场稽查的某个服务区的受检次数和扣分合计
+        obj.setCheck_type(9);
+        List<FwqStatisticsBean> onsite_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+
+        for (FwqStatisticsBean third_bean : third_beans) {
+            mapStationInfos.get(third_bean.getDept_id()).setThird_check_num(third_bean.getChecked_num()>1?1:third_bean.getChecked_num());
+            mapStationInfos.get(third_bean.getDept_id()).setThird_total_score(third_bean.getCheck_total_score());
+        }
+
+        for (FwqStatisticsBean onsite_bean : onsite_beans) {
+            mapStationInfos.get(onsite_bean.getDept_id()).setOnsite_check_num(onsite_bean.getChecked_num()>1?1:onsite_bean.getChecked_num());
+            mapStationInfos.get(onsite_bean.getDept_id()).setOnsite_total_score(onsite_bean.getCheck_total_score());
+        }
+        // 计算出每个收费站的总平均扣分和平均得分
+        Set<Map.Entry<Long, FwqStatisticsBean>> stationInfos = mapStationInfos.entrySet();
+        // 保留二位小数
+        DecimalFormat df = new DecimalFormat("0.00");
+        for (Map.Entry<Long, FwqStatisticsBean> station : stationInfos) {
+            float avg = 0;
+            FwqStatisticsBean value = station.getValue();
+            value.setThird_check_num(1);
+            value.setOnsite_check_num(1);
+            // 设置总平均扣分
+            if (value.getCompany_check_num() > 0 || value.getThird_check_num() > 0) {
+                avg += (value.getCompany_total_score() +value.getThird_total_score())  /2.0/ (value.getCompany_check_num()+value.getThird_check_num());
+            }
+            if (value.getOnsite_check_num() > 0) {
+                avg += value.getOnsite_total_score() /2.0/ value.getOnsite_check_num();
+            }
+            value.setCheck_total_avg(df.format(avg ));
+            // 设置平均得分
+            Float score_avg = (1000 - Float.valueOf(df.format(avg )));
+            value.setScore_avg(score_avg.toString());
+        }
+        List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
+        sortList.sort(new Comparator<FwqStatisticsBean>() {
+            @Override
+            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
+                return o1.compare3To(o2);
+            }
+        });
+
+        List<FwqStatisticsBean> temp = new ArrayList<>();
+        temp.addAll(sortList);
+        Map<Long, Organ> deptMap = commonService.getDeptMap();
+        for (FwqStatisticsBean aSortList : sortList) {
+            if (deptMap.get(aSortList.getDept_id()) != null) {
+                if (deptMap.get(aSortList.getDept_id()).getCreattime().getTime() > obj.getEnd_date().getTime()) {
+                    temp.remove(aSortList);
+                }
+            }
+
+        }
+        sortList = temp;
+
+        for(int j=0;j<sortList.size();j++){
+            FwqStatisticsBean statisticsBean = sortList.get(j);
+            // 公司排名
+            if (j == 0) {
+                statisticsBean.setCompany_ranking2(1);
+            } else {
+                FwqStatisticsBean bean = sortList.get(j - 1);
+                if (statisticsBean.compare3To(bean) == 0) {
+                    statisticsBean.setCompany_ranking2(bean.getCompany_ranking2());
+                } else {
+                    statisticsBean.setCompany_ranking2(j + 1);
+                }
+            }
+        }
+
+//        threadTaskService.saveDeptStatic(sortList,obj.getStart_date().getTime(),obj.getEnd_date().getTime());
+
+        return sortList;
+    }
+}

+ 216 - 0
Visuallnspection_fjq/visuallnspection_fjq/src/main/java/com/xintong/visualinspection/visuallnspection_fjq/service/impl/StatisticsService_FImpl.java

@@ -0,0 +1,216 @@
+package com.xintong.visualinspection.visuallnspection_fjq.service.impl;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import com.xintong.visualinspection.bean.FeeStation;
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.service.CommonService;
+import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqStatisticsDao;
+import com.xintong.visualinspection.visuallnspection_fjq.service.StatisticsService_F;
+import org.jxls.common.Context;
+import org.jxls.util.JxlsHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 文件名:OtherCheckServiceImpl_F
+ * 版本信息:日期:2017/4/7 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ *
+ * @author wenhongquan
+ * @date 2018/05/02
+ */
+
+@Service
+public class StatisticsService_FImpl implements StatisticsService_F {
+
+    private static final Logger logger = LoggerFactory.getLogger(StatisticsService_FImpl.class);
+
+    @Autowired
+    private FwqStatisticsDao fwqStatisticsDao;
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private CommonService commonService;
+
+    public List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj) {
+
+        // 获得所有服务区数据
+        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
+        for (FeeStation sta : saList) {
+            FwqStatisticsBean obj2 = new FwqStatisticsBean();
+            obj2.setDept_id(Long.valueOf(sta.getDeptid()));
+            obj2.setName(sta.getName());
+            mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
+        }
+
+        // 获取第三方暗访稽查的某个服务区的受检次数和扣分合计
+        obj.setCheck_type(8);
+        List<FwqStatisticsBean> third_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+        // 获取现场稽查的某个服务区的受检次数和扣分合计
+        obj.setCheck_type(9);
+        List<FwqStatisticsBean> onsite_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+
+        for (FwqStatisticsBean third_bean : third_beans) {
+            mapStationInfos.get(third_bean.getDept_id()).setThird_check_num(third_bean.getChecked_num()>1?1:third_bean.getChecked_num());
+            mapStationInfos.get(third_bean.getDept_id()).setThird_total_score(third_bean.getCheck_total_score());
+        }
+
+        for (FwqStatisticsBean onsite_bean : onsite_beans) {
+            mapStationInfos.get(onsite_bean.getDept_id()).setOnsite_check_num(onsite_bean.getChecked_num()>1?1:onsite_bean.getChecked_num());
+            mapStationInfos.get(onsite_bean.getDept_id()).setOnsite_total_score(onsite_bean.getCheck_total_score());
+        }
+        // 计算出每个收费站的总平均扣分和平均得分
+        Set<Map.Entry<Long, FwqStatisticsBean>> stationInfos = mapStationInfos.entrySet();
+        // 保留二位小数
+        DecimalFormat df = new DecimalFormat("0.00");
+        for (Map.Entry<Long, FwqStatisticsBean> station : stationInfos) {
+            float avg = 0;
+            FwqStatisticsBean value = station.getValue();
+            value.setThird_check_num(1);
+            value.setOnsite_check_num(1);
+            // 设置总平均扣分
+            if (value.getCompany_check_num() > 0 || value.getThird_check_num() > 0) {
+                avg += (value.getCompany_total_score() +value.getThird_total_score())  /2.0/ (value.getCompany_check_num()+value.getThird_check_num());
+            }
+            if (value.getOnsite_check_num() > 0) {
+                avg += value.getOnsite_total_score() /2.0/ value.getOnsite_check_num();
+            }
+            value.setCheck_total_avg(df.format(avg ));
+            // 设置平均得分
+            Float score_avg = (1000 - Float.valueOf(df.format(avg )));
+            value.setScore_avg(score_avg.toString());
+        }
+        List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
+        sortList.sort(new Comparator<FwqStatisticsBean>() {
+            @Override
+            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
+                return o1.compare3To(o2);
+            }
+        });
+
+        List<FwqStatisticsBean> temp = new ArrayList<>();
+        temp.addAll(sortList);
+        Map<Long, Organ> deptMap = commonService.getDeptMap();
+        for (FwqStatisticsBean aSortList : sortList) {
+            if (deptMap.get(aSortList.getDept_id()) != null) {
+                if (deptMap.get(aSortList.getDept_id()).getCreattime().getTime() > obj.getEnd_date().getTime()) {
+                    temp.remove(aSortList);
+                }
+            }
+
+        }
+        sortList = temp;
+
+        for(int j=0;j<sortList.size();j++){
+            FwqStatisticsBean statisticsBean = sortList.get(j);
+            // 公司排名
+            if (j == 0) {
+                statisticsBean.setCompany_ranking2(1);
+            } else {
+                FwqStatisticsBean bean = sortList.get(j - 1);
+                if (statisticsBean.compare3To(bean) == 0) {
+                    statisticsBean.setCompany_ranking2(bean.getCompany_ranking2());
+                } else {
+                    statisticsBean.setCompany_ranking2(j + 1);
+                }
+            }
+        }
+
+//        threadTaskService.saveDeptStatic(sortList,obj.getStart_date().getTime(),obj.getEnd_date().getTime());
+
+        return sortList;
+    }
+
+    @Override
+    public void getOperationInfo(FwqStatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
+        List<FwqStatisticsBean> lists= getOperationInfo(obj);
+        int totalCompanyNum = 0,
+                totalCompanyScore = 0,
+                totalThirdNum = 0,
+                totalThirdScore = 0,
+                totalOnsiteNum = 0,
+                totalOnsiteScore = 0;
+        for(FwqStatisticsBean bean:lists){
+            totalCompanyNum += bean.getCompany_check_num();
+            totalCompanyScore += bean.getCompany_total_score();
+            totalThirdNum += bean.getThird_check_num();
+            totalThirdScore += bean.getThird_total_score();
+            totalOnsiteNum += bean.getOnsite_check_num();
+            totalOnsiteScore += bean.getOnsite_total_score();
+        }
+        Map<String,Object> map = new HashMap<>(5);
+        map.put("list", lists);
+        map.put("totalCompanyNum", totalCompanyNum);
+        map.put("totalCompanyScore", totalCompanyScore);
+        map.put("totalThirdNum", totalThirdNum);
+        map.put("totalThirdScore", totalThirdScore);
+        map.put("totalOnsiteNum", totalOnsiteNum);
+        map.put("totalOnsiteScore", totalOnsiteScore);
+        exportExcel("运营管理综合检查情况统计表", "fwq_operation_info", map, resp);
+    }
+
+    private void exportExcel(String fileName, String excelTemplateName, Map<String, Object> map,
+                             HttpServletResponse resp) {
+        String path = "./" + fileName + ".xls";
+        try (InputStream is = this.getClass().getResourceAsStream("/" + excelTemplateName + ".xls")) {
+            try (OutputStream os = new FileOutputStream(path)) {
+                Context context = new Context();
+                // context.putVar("list", map.get("list"));
+                // context.putVar("totalMan", map.get("totalMan"));
+                for (String key : map.keySet()) {
+                    context.putVar(key, map.get(key));
+                }
+                JxlsHelper.getInstance().processTemplate(is, os, context);
+            }
+            Thread.sleep(1000);
+            // path是指欲下载的文件的路径。
+            File file = new File(path);
+            // 取得文件名。
+            String filename = file.getName();
+            // 以流的形式下载文件。
+            InputStream bis = new BufferedInputStream(new FileInputStream(file));
+            byte[] buffer = new byte[bis.available()];
+            bis.read(buffer);
+            bis.close();
+            // 清空response
+            resp.reset();
+            // 设置response的Header
+            resp.addHeader("Content-Disposition",
+                    "attachment;filename=" + new String(filename.getBytes("gb2312"), "ISO8859-1"));
+            resp.addHeader("Content-Length", "" + file.length());
+            OutputStream toClient = new BufferedOutputStream(resp.getOutputStream());
+            resp.setContentType("application/vnd.ms-excel;charset=gb2312");
+            toClient.write(buffer);
+            toClient.flush();
+            toClient.close();
+            // 删除生成的临时文件
+            if (file.exists()) {
+                file.delete();
+            }
+
+        } catch (Exception e) {
+            logger.error(e.toString());
+        }
+    }
+}

BIN
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_operation_info.xls


+ 267 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBean.java

@@ -0,0 +1,267 @@
+package com.xintong.visualinspection.bean;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.xintong.visualinspection.util.CustomJsonDateDeserializer;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 文件名:Job
+ * 版本信息:日期:2017/4/18 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class FwqStatisticsBean implements Serializable {
+    //编号
+    private Integer id;
+
+    // 父部门id
+    private Long parent_dept_id;
+
+    // 部门id
+    private Long dept_id;
+
+    //开始日期
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonDeserialize(using = CustomJsonDateDeserializer.class)
+    private Date start_date;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonDeserialize(using = CustomJsonDateDeserializer.class)
+    private Date end_date;
+
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonDeserialize(using = CustomJsonDateDeserializer.class)
+    private Date update_time;
+
+    private Long task_id;
+
+    private String name;
+
+    private String parent_name;
+
+    private int score;
+
+    private Integer item_id;
+
+    private int checked_num;
+
+    private int checked_people_num;
+
+//    private int people_num;
+
+    private int score_fifteen;
+
+    private int score_fifty;
+
+    private int score_over_fifty;
+
+    private int all_check_score;
+
+    // 满分
+    private int check_no_score;
+
+    // 平均得分
+    private String score_avg;
+
+    // 平均人均扣分
+    private float check_score_avg;
+
+    private List<String> checked_socre_name = new ArrayList<>();
+
+    private List<Integer> checked_score = new ArrayList<>();
+
+    private List<Integer> seq_checked_score = new ArrayList<>();
+
+    private List<Organ> dept_list;
+    private List<Integer> checked_score_ids = new ArrayList<>();
+
+
+    private String start_score;
+    private String end_score;
+
+    // 查询标记
+    private Integer queryType;
+
+    // 月份
+    private String mth;
+
+    // 上月
+    private String prev_mth;
+
+    // 收费站名称
+    private String feeStationName;
+    private String pfeeStationName;
+
+    private User user;
+
+    // 
+    private Integer order_type;
+
+    // 排名
+    private Integer ranking;
+
+    // 排名变化
+    private Integer ranking_change;
+
+    // 照片
+    private String pics;
+
+    // 稽查人员id
+    private Integer checkman_id;
+
+    private String checkman_name;
+
+    // 被考核人的姓名
+    private String checked_name;
+
+
+    private String check_task_name;
+
+    private String check_task_time_name;
+
+    private List<Integer> position_ids;
+
+    private Integer score_flag;
+
+    // 其他稽查不同类型
+    private Integer check_type;
+    // 扣分合计
+    private Integer check_total_score = 0;
+    // 公司受检次数
+    private Integer company_check_num = 0;
+    // 公司扣分合计
+    private Integer company_total_score= 0;
+    // 第三方暗访受检次数
+    private Integer third_check_num = 0;
+    // 第三方暗访扣分合计
+    private Integer third_total_score = 0;
+    // 现场受检次数
+    private Integer onsite_check_num = 0;
+    // 现场扣分合计
+    private Integer onsite_total_score = 0;
+
+    // 其他
+    private Integer other_check_num = 0;
+    private Integer other_total_score = 0;
+
+    // 总平均扣分
+    private String check_total_avg = "0";
+    // 公司排名
+    private Integer company_ranking2;
+    // 道管排名
+    private Integer fee_station_ranking2;
+
+    private Integer check_t_num = 0;
+
+    private Integer check_t_score = 0;
+
+    private Integer check_x_num = 0;
+
+    private Integer check_x_score = 0;
+
+    private Integer check_s_num = 0;
+
+    private Integer check_s_score = 0;
+
+    private Integer check_all_num = 0;
+
+    private Integer check_all_score = 0;
+
+    private Integer period_id = 0;
+
+    // 比较大小 1 小 , -1 大
+    public int compareTo(FwqStatisticsBean o2) {
+        if (this.getChecked_num() != 0 && o2.getChecked_num() != 0) {
+            double a = this.getAll_check_score() / (this.getChecked_num() + 0.00) /*/ this.getPeople_num()*/;
+            double b = o2.getAll_check_score() / (o2.getChecked_num() + 0.00) /*/ o2.getPeople_num()*/;
+            if (a > b) {
+                return 1;
+            } else if (a < b) {
+                return -1;
+            } else {
+                return 0;
+            }
+        } else {
+            if (this.getChecked_num() == 0 && o2.getChecked_num() != 0) {
+                return -1;
+            } else if (o2.getChecked_num() == 0 && this.getChecked_num() != 0) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+    // 比较大小 1 小 , -1 大 
+    // 方法2
+    public int compare2To(FwqStatisticsBean o2) {
+        double a = -1, b = -1;
+        if (this.getChecked_num() != 0) {
+            a = this.getAll_check_score() / (this.getChecked_num() + 0.00);
+        }
+        if (o2.getChecked_num() != 0) {
+            b = o2.getAll_check_score() / (o2.getChecked_num() + 0.00);
+        }
+        if (a > b) {
+            return 1;
+        } else if (a < b) {
+            return -1;
+        } else {
+            return 0;
+        }
+    }
+
+    //比较大小 1 小 , -1 大 
+    // 方法3
+    public int compare3To(FwqStatisticsBean o2) {
+        double a = -1, b = -1;
+        if (Float.valueOf(this.getCheck_total_avg()) != 0) {
+            a = Float.valueOf(this.getCheck_total_avg());
+        }
+        if (Float.valueOf(o2.getCheck_total_avg()) != 0) {
+            b = Float.valueOf(o2.getCheck_total_avg());
+        }
+        if (a > b) {
+            return 1;
+        } else if (a < b) {
+            return -1;
+        } else {
+            return 0;
+        }
+    }
+
+    //比较大小 1 小 , -1 大
+    // 方法3
+    public int compare4To(FwqStatisticsBean o2) {
+        if (this.getId() > o2.getId()) {
+            return 1;
+        } else if (this.getId().equals(o2.getId())) {
+            if (Float.valueOf(this.getCheck_total_avg()) != 0 && Float.valueOf(o2.getCheck_total_avg()) != 0) {
+                if (Float.valueOf(this.getCheck_total_avg()) < Float.valueOf(o2.getCheck_total_avg())) {
+                    return -1;
+                } else if (Float.valueOf(this.getCheck_total_avg()) > Float.valueOf(o2.getCheck_total_avg())) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            } else {
+                if (Float.valueOf(this.getCheck_total_avg()) == 0) {
+                    return -1;
+                } else if (Float.valueOf(o2.getCheck_total_avg()) == 0) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+        } else {
+            return -1;
+        }
+    }
+
+}

+ 12 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/StatisticsService_F.java

@@ -0,0 +1,12 @@
+package com.xintong.visualinspection.service;
+
+import com.xintong.visualinspection.bean.FwqStatisticsBean;
+
+import java.util.List;
+
+public interface StatisticsService_F {
+
+    // 运营管理综合检查情况统计表
+    List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj);
+
+}