Explorar o código

服务区数据查询分析功能

huangchengzdm %!s(int64=8) %!d(string=hai) anos
pai
achega
8778350b6d

+ 0 - 2
VisualInspection/fwq/js/statistics/assess_type.js

@@ -118,7 +118,6 @@ function getHeadHtml(data) {
  */
 function gethtml(data, i, organList, avg, lists) {
     var strTbody = "";
-    debugger;
     if (i == 0 || i == organList[0] || i == organList[1]) {
 
         var ranking;
@@ -238,7 +237,6 @@ function check_people_avg(data) {
 
     // 道管下的服务区排名
     ranking_method(list,organArray);
-    debugger;
     for (i = 0; i < list.length; i++) {
         if (i == 0) {
             $(".table-tbody").append(gethtml(list[i], i, organArray, dataArray[0], dataArray));

+ 746 - 0
VisualInspection/fwq/js/statistics/service_area_data_statistics.js

@@ -0,0 +1,746 @@
+var year = new Date().getFullYear();
+var x_m_array = new Array();
+var x_m_array_temp = new Array();
+var months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
+var monthsCH = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
+var array_year_score = new Array();
+var array_check_type = new Array();
+var score_statistics;
+var check_type;
+var cur_status;
+var hide = false;
+
+var array_points = new Array();
+var array_points2 = new Array();
+
+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', 26).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', 26).format("YYYY-MM-DD");
+}
+
+
+// 默认初始化日期一个月
+$(".div-start input").val(start_time);
+$(".div-end input").val(end_time);
+
+var start_date = moment($(".div-start input").val() + " 00:00:00");
+
+var end_date = $(".div-end input").val() + " 23:59:59";
+
+/**
+ * 预加载方法
+ */
+$(function() {
+    setVisit();
+
+
+    var temp_time = $.zui.store.get('page_data_param_temp_time');
+    if (temp_time) {
+
+        var year = temp_time.split('/')[0];
+        var month = temp_time.split('/')[1];
+
+        var starty = year;
+        var startm = parseInt(month) - 1;
+
+        if (startm <= 0) {
+            startm = 12;
+            starty = parseInt(year) - 1;
+        }
+
+        $(".div-start input").val(starty + '-' + (startm >= 10 ? startm : ("0" + startm)) + '-26');
+        $(".div-end input").val(year + '-' + month + '-25');
+        $.zui.store.set('page_data_param_temp_time', null)
+    }
+
+
+
+    //*************************************数据表格******************************************
+    function initAppealPage(start_date, end_date, dept_id) {
+        initQueryParams();
+        queryAppeal(start_date, end_date, dept_id);
+    }
+
+    function initQueryParams() {
+        //获取页面参数
+        var page_params = $.zui.store.get("page_params");
+        if (page_params && page_params.status) {
+            cur_status = page_params.status;
+        }
+    }
+
+    function queryAppeal(start_date, end_date, dept_id) {
+
+        $("#station_name").html($("#select-dept").find("option:selected").text())
+
+        // $("#station_user_name").html("-")
+
+        //请求数据
+        var data_t = {
+            "start_date": start_date,
+            "end_date": end_date,
+            "dept_id": dept_id
+        }
+        var url_t = "f/statistics/employee/order/detail"
+        post_common_service(url_t, data_t, function(res) {
+
+            $("#c_dept_ranking").html("-");
+            $("#c_road_ranking").html("-");
+            $("#c_com_ranking").html("-");
+            $("#c_score_ranking").html("-");
+            $("#l_dept_ranking").html("-");
+            $("#l_road_ranking").html("-");
+            $("#l_com_ranking").html("-");
+            $("#l_score_ranking").html("-");
+
+            var isshow_c = false;
+            var isshow_l = false;
+            if (typeof(res.currentP) != undefined && res.currentP != null) {
+                var p = res.currentP;
+                $("#c_dept_ranking").html(p.service_area_ranking == undefined ? "-" : p.service_area_ranking);
+                $("#c_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
+                $("#c_score_ranking").html(p.check_all_score + p.check_all_m_score);
+                $("#c_road_ranking").html(p.center_ranking == undefined ? "-" : p.center_ranking);
+                isshow_c = true;
+            }
+            if (typeof(res.lastP) != undefined && res.lastP != null) {
+                var p = res.lastP;
+                $("#l_dept_ranking").html(p.service_area_ranking == undefined ? "-" : p.service_area_ranking);
+                $("#l_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
+                $("#l_score_ranking").html(p.check_all_score + p.check_all_m_score);
+                $("#l_road_ranking").html(p.center_ranking == undefined ? "-" : p.center_ranking);
+                isshow_l = true;
+            }
+
+            if (isshow_c && isshow_l) {
+                var p_c = res.currentP;
+                var p_l = res.lastP;
+                if (p_c.service_area_ranking != undefined && p_l.service_area_ranking != undefined) {
+                    var dept_r = p_c.service_area_ranking - p_l.service_area_ranking;
+                    if (dept_r != 0) {
+                        $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (dept_r > 0 ? "down" : "up") + "'>" + Math.abs(dept_r) + "</i>");
+                    }
+                    var com_r = p_c.company_ranking - p_l.company_ranking;
+                    if (com_r != 0) {
+                        $("#c_com_ranking").html($("#c_com_ranking").html() + "<i style='margin-left:10px;color:" + (com_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
+                    }
+                    var road_r = p_c.center_ranking - p_l.center_ranking;
+                    if (road_r != 0) {
+                        $("#c_road_ranking").html($("#c_road_ranking").html() + "<i style='margin-left:10px;color:" + (road_r > 0 ? "red" : "#0aef3d") + "' class='icon icon-long-arrow-" + (road_r > 0 ? "down" : "up") + "'>" + Math.abs(road_r) + "</i>");
+                    }
+                }
+            }
+        }, function(error) {})
+
+        $.ajax({
+            type: "OPTIONS",
+            url: base_ui_url,
+            complete: function(x) {
+
+                //计算当前周期
+                var now_date_time = moment(new Date(x.getResponseHeader("Date")))
+                var current_start_date = null;
+
+                if (now_date_time.date() >= 26) {
+                    current_start_date = moment(now_date_time.format("YYYY-MM") + "-26 00:00:00Z").subtract(0, "month");
+                } else {
+                    current_start_date = moment(now_date_time.format("YYYY-MM") + "-26 00:00:00Z").subtract(1, "month");
+                }
+                var end_date_time = moment(end_date + "Z");
+
+                if (end_date_time.valueOf() > current_start_date.valueOf()) {
+                    if (hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || roleContains('STATION')) {
+                        $(".score-select").val(1)
+                    }
+                }
+
+                var data = {
+                    "start_date": start_date,
+                    "end_date": end_date,
+                    "dept_id": dept_id,
+                    "queryType": 0,
+                }
+                if ($(".score-select").val() == "0") {
+                    data["score_flag"] = 0;
+                }
+                if ($(".score-select").val() == "1") {
+                    data["score_flag"] = 1;
+                }
+
+                if (hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) || hasRole(ROLE_JICHA) || roleContains('STATION')) {
+                    hide = true;
+                }
+
+                var cols = [
+                    { width: 50, text: '序号', flex: true, colClass: 'text-center', field: 'num' },
+                    { width: 100, text: '时间段', flex: true, colClass: 'text-center', field: 'check_task_time_name' },
+                    // { width: 80, text: '扣分人', flex: true, colClass: 'text-center', field: 'checked_name' },
+                    {
+                        width: 100,
+                        text: '服务区',
+                        flex: true,
+                        colClass: 'text-center',
+                        field: 'dept_id',
+                        func: function(value) {
+                            return getfeeName(value);
+                        }
+                    },
+                    { width: 40, text: '扣分数', flex: true, colClass: 'text-center', field: 'score', nullvalue: '0' },
+                    { width: 120, text: '考核类型', flex: true, colClass: 'text-center', sort: 'down', field: 'parent_name' },
+                    { width: 120, text: '考核项', flex: true, colClass: 'text-center', sort: 'down', field: 'name' },
+                    { width: 120, text: '扣分凭证', type: 'imagedd', flex: true, hide: hide, field: 'pics' },
+                ];
+                if (cur_status == 12 || cur_status == 13) {
+                    data.check_status_arr = [12, 13];
+                }
+                $('#personal_data_table').mytable({
+                    'cols': cols,
+                    'url': "f/statistics/one/checkedItem/detail/info",
+                    'param': data
+                });
+            }
+        })
+    }
+
+    function getfeeName(id) {
+        for (var i in feeList) {
+            var fee = feeList[i];
+            if (fee.deptid == id) {
+                return fee.name;
+            }
+        }
+    }
+
+
+
+
+
+    //*************************************画图******************************************
+
+    // 加载图配置
+    echart();
+
+    $(".query button").click(function() {
+        // var user_id = $("#select-personal").val();
+        var dept_id = $("#select-dept").val();
+        var start_date = new Date($(".div-start input").val() + " 00:00:00") + "";
+        var end_date = $(".div-end input").val() + " 23:59:59";
+        var startStr = start_date.replace(/-/g, '/');
+        var endStr = end_date.replace(/-/g, '/');
+        var start = new Date(startStr);
+        var end = new Date(endStr);
+        if (start > end) {
+            tip("开始时间不能比结束时间大");
+            return;
+        }
+        start_date = start.Format("yyyy-MM-dd HH:mm:ss")
+        
+        // 查询图一
+        init_personal_score_statistics("f/statistics/one/serviceArea/year/info", dept_id);
+        // 查询图二
+        init_personal_check_type("f/statistics/one/serviceArea/checkedItem/info", dept_id, start_date, end_date);
+        // 表格
+        initAppealPage(start_date, end_date, dept_id);
+        // 加载图配置
+        echart();
+    });
+
+    /**
+     * 初始化图一(服务区得分统计)
+     * @param {*} url
+     * @param {*} dept_id
+     */
+    function init_personal_score_statistics(url, dept_id) {
+
+        var end_date = $(".div-end input").val() + " 23:59:59";
+        var date = moment(end_date);
+        var y = date.get('y');
+        var m = date.get('M') + 1;
+
+
+
+
+        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": (y - 1) + "-" + new Date().getMonth() + "-26" + " 00:00:00",
+            "end_date": y + "-" + (new Date().getMonth() + 1) + "-26" + " 00:00:00",
+            "dept_id": dept_id
+        }
+
+        initRqueset(url, param, 1);
+    }
+
+
+    /**
+     * 初始化图二
+     * @param {*} url
+     * @param {*} dept_id
+     */
+    function init_personal_check_type(url, dept_id, start_date, end_date) {
+        var param = {
+            "start_date": start_date,
+            "end_date": end_date,
+            "dept_id": dept_id
+        }
+        initRqueset(url, param, 2);
+    }
+
+
+    /**
+     * 请求
+     * @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) {
+                // 画图
+                score_statistics.setOption(personal_score_statistics());
+            } else if (type == 2) {
+                // 画图
+                check_type.setOption(personal_check_type());
+            }
+        }, function(error) {
+            return "";
+        });
+    }
+
+    function getsymbol(score) {
+        var sy = 'Circle';
+        var col = 'green'
+
+        if (score == 1000) {
+            sy = "star"
+            col = 'red'
+        } else
+        if (score > 990) {
+            sy = "star"
+            col = 'orange'
+        } else {
+            sy = "Triangle"
+            col = 'green'
+        }
+
+
+
+        // itemStyle: {        // 数据级个性化折线样式
+        //   normal: {
+        //       color: 'yellowgreen'
+        //   },
+        // }
+
+        return { value: (score), symbol: sy, symbolSize: 5, itemStyle: { normal: { color: col } } };
+
+    }
+
+    /**
+     * 数组数据
+     * @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]);
+                        var score = (1000 - (filter(data[index].all_check_score, data[index].checked_num, 1.0, 0)));
+                        var data_s = getsymbol(score)
+
+                        // console.log(data_s)
+                        array_year_score.push(data_s);
+                    }
+                }
+            } else {
+                array_year_score.length = 0;
+                x_m_array = new Array();
+                x_m_array_temp = new Array();
+            }
+
+        } else if (type == 2) {
+            array_points = new Array();
+            array_points2 = new Array();
+            var map = new HashMap();
+
+            if (data.length != 0) {
+                for (var i = 0; i < data.length; i++) {
+                    if (typeof(data[i].all_check_score) == "undefined" || data[i].all_check_score == null) continue;
+                    if (map.get(data[i].name) == null) {
+                        map.set(data[i].name, data[i].all_check_score);
+                    } else {
+                        map.set(data[i].name, map.get(data[i].name) + data[i].all_check_score);
+                    }
+                    array_points2.push({ "value": (data[i].all_check_score), "name": data[i].name, "itemStyle": { "normal": { "color": getchildColor(data[i].name, i).hexStr() } } });
+                }
+            }
+            map.forEach(function(value, key) {
+                array_points.push({ "value": value, "name": key, "itemStyle": { "normal": { "color": getColor(key).hexStr() } } });
+            });
+        }
+    }
+
+    // var userid_t = $.zui.store.get("page_params").userid
+    var dept_t = $.zui.store.get("page_params").deptid
+
+
+    // 收费站下拉框
+    var dept;
+    // if (roleContains("STATION")) {
+    //     dept = getCurrentUser().organid;
+    // }
+    if (dept_t) {
+        dept = dept_t;
+    }
+
+    // var roadManager;
+    // if (roleContains("ROAD_MANAGER")) {
+    //     roadManager = getCurrentUser().organid;
+    // }
+    var feeList = $.zui.store.get("cache_service_area_list");
+    // if (roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
+    setSASelectValueNoAll2(feeList, "#select-dept", dept);
+
+    getInit();
+    // setSecond();
+    /**
+     * 部门人员下拉框
+     */
+    // function setSecond() {
+    //     var select_road = $("#select-dept").val();
+    //     var sec = document.getElementById('select-personal');
+    //     var tempStr = ''
+    //     var param = {
+    //         "organid": select_road
+    //     }
+    //     post_common_service("user/getFsUserList", param, function(data) {
+    //         if (data.length != 0) {
+    //             var userId;
+    //             if (hasRole("ROLE_STATION")) {
+    //                 userId = getCurrentUser().id;
+    //             }
+    //             if (userid_t) {
+    //                 userId = userid_t;
+    //             }
+
+    //             for (var i = 0; i < data.length; i++) {
+    //                 for (var j = 33; j <= 100; j++) {
+    //                     if (select_road == j) {
+    //                         if (data[i].id == userId) {
+    //                             tempStr += "<option value=" + data[i].id + " selected='selected'>" + data[i].truename + "</option>";
+    //                         } else {
+    //                             tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
+    //                         }
+    //                     }
+    //                 }
+    //                 sec.innerHTML = tempStr;
+    //             }
+
+    //         } else {
+    //             sec.innerHTML = '';
+    //         }
+    //         // 请求数据
+    //         getInit();
+    //     }, function(error) {
+    //         return "";
+    //     });
+    // }
+
+    function getInit() {
+        var start_date = $(".div-start input").val() + " 00:00:00";
+        var end_date = $(".div-end input").val() + " 00:00:00";
+        // var user_id = $("#select-personal").val();
+        var dept_id = $("#select-dept").val();
+        // 页面初始化
+        echart();
+        initAppealPage(start_date, end_date, dept_id);
+        init_personal_score_statistics("f/statistics/one/serviceArea/year/info", dept_id);
+        init_personal_check_type("f/statistics/one/serviceArea/checkedItem/info", dept_id, start_date, end_date);
+    }
+
+
+    // $("#select-dept").change(function() {
+    //     setSecond();
+    // });
+
+    // $("#select-personal").change(function() {
+    //     getInit();
+    // })
+    $("#select-dept").change(function() {
+        getInit();
+    });
+
+
+    /**
+     * 除数为0处理
+     * @param {*} num
+     * @param {*} num1
+     * @param {*} num2
+     * @param {*} num4
+     */
+    function filter(num, num1, num2) {
+        if (num1 == 0) {
+            return num2;
+        } else {
+            return (num / num1).toFixed(2);
+        }
+    }
+
+    function echart() {
+        // 路径配置
+        require.config({
+            paths: {
+                echarts: '/js/lib/echarts/build/dist'
+            }
+        });
+        // 使用
+        require(
+            [
+                'echarts',
+                'echarts/theme/macarons',
+                'echarts/chart/line',
+                'echarts/chart/pie'
+            ],
+            function(ec, theme) {
+                // 基于准备好的dom,初始化echarts图表
+                score_statistics = ec.init(document.getElementById('personal-score-statistics'), theme);
+                check_type = ec.init(document.getElementById('personal-check-type'), theme);
+            }
+        );
+    }
+
+    /**
+     * 图一
+     */
+    function personal_score_statistics() {
+        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%"
+            },
+            toolbox: {
+                show: true,
+            },
+            calculable: true,
+            xAxis: [{
+                type: 'category',
+                boundaryGap: false,
+                data: x_m_array_temp
+            }],
+            yAxis: [{
+                type: 'value',
+                min: 700,
+                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 personal_check_type() {
+
+        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,
+            },
+            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: 80,
+                                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 setVisit() {
+    if (roleContains("STATION")) {
+        $("#select-dept").attr("disabled", "disabled");
+    }
+}
+
+function getColor(name) {
+
+    var color = new $.zui.Color('#52D017');
+    switch (name) {
+        case "环境卫生":
+            { color = new $.zui.Color('#52D017'); break; }
+        case "仪容仪表着装":
+            { color = new $.zui.Color('#00FFFF'); break; }
+        case "动作":
+            { color = new $.zui.Color('#7F38EC'); break; }
+        case "表情":
+            { color = new $.zui.Color('#FFA500'); break; }
+        case "文明用语":
+            { color = new $.zui.Color('#0000A0'); break; }
+        case "环境卫生":
+            { color = new $.zui.Color('#52D017'); break; }
+        case "工作纪律及行为举止":
+            { color = new $.zui.Color('#48CCCD'); break; }
+        case "便民服务":
+            { color = new $.zui.Color('#FFFF00'); break; }
+        case "安全管理":
+            { color = new $.zui.Color('#00FF00'); break; }
+    }
+    return color;
+}
+
+function getchildColor(name, p) {
+    var color1 = getColor(name);
+
+
+    var color = new $.zui.Color(color1.r - p * 20, color1.g - p * 20, color1.b - p * 20);
+
+    return color;
+}

+ 125 - 0
VisualInspection/fwq/view/statistics/service_area_data_statistics.html

@@ -0,0 +1,125 @@
+<!--服务区数据查询分析-->
+<script src="/js/lib/echarts/build/dist/echarts.js"></script>
+<script src="/js/statistics/common_statistic.js?__inline"></script>
+<script src="/fwq/js/statistics/service_area_data_statistics.js"></script>
+<link rel="stylesheet" type="text/css" href="/css/statistics/personal_data_statistics.css">
+<div class="container-fluid">
+    <!--<div class="row-1"><span>个人数据统计</span></div>
+    <div class="line-1"></div>-->
+    <div class="row">
+        <!--<div class="name"><span>刘娟</span></div>
+            <div class="div-select div-button"><button>选择人员</button></div>-->
+        <!--<div class="name1"><span  for="exampleInputAccount1">请选择收费站:</span></div>-->
+        <div class="div-select col-sm-2"><select class="form-control" id="select-dept"></select></button>
+        </div>
+        <!-- <div class="div-select col-sm-2"><select class="form-control" id="select-personal"></select></button>
+        </div> 2期无人员-->
+        <div class="col-sm-4">
+            <div class="div-start col-sm-5"><input class="form-control" placeholder="请选择考核开始时间"></input>
+            </div>
+            <div class="div-to col-sm-1"><label for="exampleInputAccount1">-</label></div>
+            <div class="div-end col-sm-5"><input class="form-control" placeholder="请选择考核结束时间"></input>
+            </div>
+        </div>
+        <div class="div-select col-sm-1">
+            <select class="form-control score-select" id="score_select">
+                    <option value="2">全部</option><option value="1" selected>扣分</option><option value="0">不扣分</option>
+                </select>
+        </div>
+        <div class="query div-button col-sm-2"><button class="btn-info2">查询</button></div>
+        <!--<div class="export div-button"><button>导出</button></div>-->
+    </div>
+    <div class="line-1"></div>
+    <div class="row-3" style="background: #fff;">
+        <div class="dept">
+            <div style="margin-top:14px;">
+                <span>部门</span><br/><br/>
+                <span class="s_d_name" id='station_name'>服务区</span>
+            </div>
+        </div>
+        <!-- <div class="line-4"></div>
+        <div class="job">
+            <div style="margin-top:14px;">
+                <span>职务</span><br/><br/>
+                <span class="s_d_name" id='station_user_name'>收费员</span>
+            </div>
+        </div> -->
+        <div class="line-5"></div>
+        <div class="current-month">
+            <span style="margin-left:20px;">本月:</span>
+            <span style="margin-left:50px;">区内排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="c_dept_ranking">-</span>
+            <span>道管排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="c_road_ranking">-</span>
+            <span>公司排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="c_com_ranking">-</span>
+            <span>总扣分:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="c_score_ranking">-</span>
+
+        </div>
+        <div class="line-6"></div>
+        <div class="next-month">
+            <span style="margin-left:20px;">上月:</span>
+            <span style="margin-left:50px;">区内排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="l_dept_ranking">-</span>
+            <span>道管排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="l_road_ranking">-</span>
+            <span>公司排名:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="l_com_ranking">-</span>
+            <span>总扣分:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="l_score_ranking">-</span>
+
+        </div>
+    </div>
+
+
+
+    <div class="row">
+        <div class="col-sm-6" style="padding:0 5px;">
+            <div class="border-no">
+                <div class="title-div"><span>服务区得分统计</span></div>
+                <div class="row" style="padding:10px;width: 100%;position: absolute;">
+                    <div class="col-sm-4"><span style="color:red">★</span><span> 1000分</span></div>
+                    <div class="col-sm-4"><span style="color:orange">★</span><span> 990-1000分</span></div>
+                    <div class="col-sm-4"><span style="color:green">▲</span><span> 990分以下</span></div>
+                </div>
+                <div id="personal-score-statistics" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
+            </div>
+        </div>
+        <!-- <div class="line-3"></div> -->
+        <div class="col-sm-6" style="padding:0 5px;">
+            <div class="border-no">
+                <div class="title-div"><span class="title-span">服务区温馨服务检查问题类别占比</span></div>
+                <div id="personal-check-type" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
+            </div>
+        </div>
+    </div>
+
+    <div class="row" style="width:100%;margin:0 auto;">
+        <!-- 使用一个div来显示数据表格 -->
+        <div id="personal_data_table" style="margin-top:10px;" class="datatable" data-checkable="true" data-sortable="true"></div>
+    </div>
+    <!-- <div class="border-line">
+        <div class="row-7">
+            <div class="col-1"><span style="font-family: '宋体';font-size:15px;">个人得分统计</span></div>
+            <div class="line-2"></div>
+            <div class="col-1"><span style="font-family: '宋体';font-size:15px;">个人温馨服务检查问题类别占比</span>
+
+            </div>
+        </div>
+        <div class="row-8">
+            <div id="personal-score-statistics" style="width:49%;height:400px;float:left;"></div>
+            <div class="line-3"></div>
+            <div id="personal-check-type" style="width:49%;height:400px;float:left;"></div>
+        </div>
+    </div> -->
+</div>
+<script>
+    $(document).ready(function() {
+
+        // 仅选择日期
+        $(".div-start input,.div-end input").datetimepicker({
+            language: "zh-CN",
+            weekStart: 1,
+            todayBtn: 1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+    });
+</script>

+ 12 - 0
VisualInspection/js/util/util.js

@@ -301,6 +301,18 @@ function setSASelectValueNoAll(data, div, selectId) {
     $(div).html(optStr);
 }
 
+function setSASelectValueNoAll2(data, div, selectId) {
+    var optStr = '';
+    for (var i in data) {
+        if (data[i].deptid == selectId)
+            optStr += '<option value="' + data[i].deptid + '" selected="selected">' + data[i].name + '</option>';
+        else
+            optStr += '<option value="' + data[i].deptid + '">' + data[i].name + '</option>';
+    }
+    $(div).html('');
+    $(div).html(optStr);
+}
+
 function setFeeSelectValue(data, div, selectId) {
     var optStr = '<option value="">全部</option>';
     for (var i in data) {

+ 55 - 13
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_F.java

@@ -5,9 +5,11 @@ import com.xintong.visualinspection.bean.FwqDeptStatistic;
 import com.xintong.visualinspection.bean.FwqStatisticsBean;
 import com.xintong.visualinspection.controller.BaseController;
 import com.xintong.visualinspection.dao.cluster.DepartmentDao;
+import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
 import com.xintong.visualinspection.service.CommonService;
 import com.xintong.visualinspection.service.StatisticsService_F;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -92,32 +94,33 @@ public class StatisticsController_F extends BaseController {
 
     /**
      * 考核问题分布报表
+     *
      * @param obj
      * @return
      */
     @RequestMapping(value = "/score/item/info")
-    public String getScoreItemInfo(@RequestBody FwqStatisticsBean obj){
-        List<FwqStatisticsBean> lists=  statisticsService_f.getFeeStationCheckItemScore(obj);
-        int totalcheckedCount=0,
-                totalAll=0;
-        Map<String,Integer> scoreTypeMap = new HashMap<>();
-        for(FwqStatisticsBean bean:lists){
-            totalcheckedCount+=bean.getChecked_num();
-            totalAll+=bean.getAll_check_score();
+    public String getScoreItemInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getFeeStationCheckItemScore(obj);
+        int totalcheckedCount = 0,
+                totalAll = 0;
+        Map<String, Integer> scoreTypeMap = new HashMap<>();
+        for (FwqStatisticsBean bean : lists) {
+            totalcheckedCount += bean.getChecked_num();
+            totalAll += bean.getAll_check_score();
             List<String> names = bean.getChecked_socre_name();
             List<Integer> scores = bean.getChecked_score();
-            for(int i=0;i<names.size();i++){
+            for (int i = 0; i < names.size(); i++) {
                 Integer score = scoreTypeMap.get(names.get(i));
-                if(score==null) {
+                if (score == null) {
                     score = 0;
                 }
-                score+=scores.get(i);
-                if(names.get(i)!=null){
+                score += scores.get(i);
+                if (names.get(i) != null) {
                     scoreTypeMap.put(names.get(i), score);
                 }
             }
         }
-        Map<String,Object> resultMap = new HashMap<>();
+        Map<String, Object> resultMap = new HashMap<>();
         resultMap.put("list", lists);
         resultMap.put("totalcheckedCount", totalcheckedCount);
         resultMap.put("totalAll", totalAll);
@@ -126,4 +129,43 @@ public class StatisticsController_F extends BaseController {
         resultMap.putAll(scoreTypeMap);
         return super.returnSuccessResult(resultMap);
     }
+
+    /**
+     * 服务区数据查询分析---->获取服务区排名详情
+     *
+     * @param obj
+     * @return
+     */
+    @RequestMapping(value = "/employee/order/detail")
+    public String getEmployeeOrderByDeptId(@RequestBody FwqStatisticsBean obj) {
+        FwqRankingData fwqRankingData = statisticsService_f.getEmployeeRankingData(obj);
+        return super.returnSuccessResult(fwqRankingData);
+    }
+
+    /**
+     * 服务区数据查询分析---->获取收费站具体某个人的扣分详情
+     */
+    @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
+    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody FwqStatisticsBean obj, @PathVariable Integer page, @PathVariable Integer size) {
+        Object returnList = statisticsService_f.getOneCheckedDetailInfo(page, size, obj);
+        return super.returnSuccessResult(returnList);
+    }
+
+    /**
+     * 服务区数据查询分析---->获取服务区的12月情况
+     */
+    @RequestMapping(value = "/one/serviceArea/year/info")
+    public String getSaOnePersonInfo(@RequestBody FwqStatisticsBean obj){
+        List<FwqStatisticsBean> returnList=  statisticsService_f.getOneSACheckedInfo(obj);
+        return super.returnSuccessResult(returnList);
+    }
+
+    /**
+     * 服务区数据查询分析---->获取服务区各项扣分情况
+     */
+    @RequestMapping(value = "/one/serviceArea/checkedItem/info")
+    public String getFsOneServiceAreaCheckedItemInfo(@RequestBody FwqStatisticsBean obj){
+        List<FwqStatisticsBean> returnList=  statisticsService_f.getOneCheckedItemInfo(obj);
+        return super.returnSuccessResult(returnList);
+    }
 }

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

@@ -16,4 +16,14 @@ public interface FwqStatisticsDao {
     List<FwqStatisticsBean> selectFeeStationCheckNum(FwqStatisticsBean obj);
 
     List<FwqStatisticsBean> selectFeeStationCheckedPersonScoreDetail(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean> selectStatistics(FwqStatisticsBean obj);
+
+    FwqStatisticsBean selectCheckedTimes(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean> selectOneCheckedDetailInfo(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean> selectOneCheckedInfoData(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean> selectOneCheckedItemInfo(FwqStatisticsBean obj);
 }

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

@@ -44,7 +44,7 @@
         t.check_item_id,
         t.check_item_score AS score
         FROM check_score t
-        LEFT JOIN view_check_task ct ON ct.id = t.task_id
+        JOIN view_check_task ct ON ct.id = t.task_id
         WHERE t.check_item_score IS NOT NULL
         <if test="start_date!=null and end_date != null">
             AND ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date}
@@ -54,6 +54,179 @@
         </if>
     </select>
 
+    <select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT
+        u.dept_id,
+        u.check_item_id,
+        sum(u.score) AS score
+        FROM (
+        SELECT
+        t.checked_dept  dept_id,
+        t.check_item_id,
+        t.check_item_score AS score
+        FROM check_score t
+        JOIN view_check_task ct ON ct.id = t.task_id
+        WHERE 1 = 1
+        <if test="start_date!=null and end_date != null">
+            AND ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date}
+        </if>
+        <if test="dept_id!=null">
+            AND t.checked_dept =#{dept_id}
+        </if>
+        )
+        u GROUP BY check_item_id
+    </select>
+
+    <select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT COUNT(1) AS checked_num , t.checked_dept dept_id FROM view_check_task t
+        WHERE t.checked_dept =#{dept_id}
+        <if test="start_date!=null and end_date != null">
+            AND t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date}
+        </if>
+    </select>
+
+    <select id="selectOneCheckedDetailInfo" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT
+        t.name              AS check_task_name,
+        t.start_time        AS start_date,
+        t.end_time          AS end_date,
+        cs.check_item_score AS score,
+        cs.pics,
+        t.checkman          AS checkman_id,
+        t.checked_dept      AS dept_id,
+        cs.check_item_id
+        <if test="queryType!=null and queryType==1">
+            ,cst.update_time,t.id as task_id
+        </if>
+        FROM
+        <if test="queryType!=null and queryType==0">
+            view_check_task
+        </if>
+        <if test="queryType==null or (queryType!=null and queryType==1) ">
+            v_check_task
+        </if>
+        t
+        LEFT JOIN check_score cs ON t.id = cs.task_id
+        <if test="queryType!=null and queryType==1">
+            left join ( select task_id,max(update_time) as update_time from check_task_status where check_status =4 or
+            check_status = 14 GROUP BY task_id ) cst on t.id = cst.task_id
+        </if>
+        where 1=1
+        <if test="dept_id != null and dept_id != ''">
+            AND t.checked_dept = #{dept_id}
+        </if>
+        <if test="start_date !=null and end_date !=null and queryType ==1">
+            AND t.check_time >= #{start_date} AND t.check_time &lt; #{end_date}
+        </if>
+        <if test="start_date !=null and queryType == 0">
+            AND t.start_time >= #{start_date}
+        </if>
+        <if test="end_date !=null and queryType == 0">
+            AND t.end_time &lt; #{end_date}
+        </if>
+        <if test="score_flag!=null and score_flag == 1">
+            AND cs.check_item_score IS NOT NULL
+        </if>
+        <if test="score_flag!=null and score_flag == 0">
+            AND cs.check_item_score IS NULL
+        </if>
+
+        <if test="queryType!=null and queryType==1">
+            ORDER BY cst.update_time desc
+        </if>
+    </select>
+
+    <select id="selectOneCheckedInfoData" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT * FROM (
+        <include refid="selectOneAllCheckedInfoData"/>
+        ) t
+    </select>
+
+    <select id="selectOneCheckedItemInfo" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT
+        a.*
+        FROM (
+        SELECT
+        count(t.id)     AS checked_num,
+        sum(cs.check_item_score) AS all_check_score,
+        cs.check_item_id,
+        cs.checked_dept as dept_id
+        FROM
+        view_check_task t
+        LEFT JOIN check_score cs ON cs.task_id = t.id
+        WHERE
+        1 = 1
+        and cs.checked_dept = #{dept_id}
+        <if test="start_date !=null">
+            AND t.start_time >= #{start_date}
+        </if>
+        <if test="end_date !=null">
+            AND t.end_time &lt; #{end_date}
+        </if>
+        GROUP BY
+        check_item_id
+        ) a where a.all_check_score is not null
+    </select>
+
+    <sql id="selectOneAllCheckedInfoData">
+        SELECT
+        check_num_t.checked_num,
+        check_num_t.mth,
+        IFNULL(checked_score_t.checkd_all_score, 0) AS all_check_score,
+        check_num_t.checked_dept
+        FROM
+        (
+        SELECT
+        COUNT(t.id)             AS checked_num,
+        monthfunc(t.start_time) AS mth,
+        t.checked_dept
+        FROM
+        view_check_task t
+        WHERE 1 = 1
+        <if test="start_date !=null">
+            AND t.start_time &gt;= #{start_date}
+        </if>
+        <if test="end_date !=null">
+            AND t.end_time &lt; #{end_date}
+        </if>
+        <if test="dept_id !=null ">
+            AND t.checked_dept = #{dept_id}
+        </if>
+        GROUP BY mth
+        ) check_num_t
+            LEFT JOIN (
+            SELECT
+            monthfunc(t.start_time) AS mth,
+            sum(m.check_item_score) AS checkd_all_score,
+            m.*
+            FROM
+            check_score m INNER JOIN
+            (SELECT *
+            FROM view_check_task t
+            WHERE 1 = 1
+        <if test="start_date !=null">
+            AND t.start_time &gt;= #{start_date}
+        </if>
+        <if test="end_date !=null">
+            AND t.end_time &lt; #{end_date}
+        </if>
+        ) t
+        ON m.task_id = t.id
+        WHERE 1=1
+        <if test="dept_id !=null ">
+            AND m.checked_dept = #{dept_id}
+        </if>
+        GROUP BY mth
+
+        ) checked_score_t ON checked_score_t.checked_dept = check_num_t.checked_dept
+        AND check_num_t.mth = checked_score_t.mth
+    </sql>
+
 </mapper>
 
 

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

@@ -1,12 +1,16 @@
 package com.xintong.visualinspection.visuallnspection_fjq.service.impl;
 
 import com.alibaba.dubbo.config.annotation.Reference;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.xintong.visualinspection.bean.CheckTaskPeriod;
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.FwqDeptStatistic;
 import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.bean.FwqStatisticsBo;
 import com.xintong.visualinspection.bean.Item;
 import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
 import com.xintong.visualinspection.service.CommonService;
 import com.xintong.visualinspection.service.StatisticsService_F;
 import com.xintong.visualinspection.visuallnspection_fjq.dao.FwqCheckDeptStatisticsDao;
@@ -19,6 +23,7 @@ import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Comparator;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -448,4 +453,282 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         return sortList;
 
     }
+
+    @Override
+    public FwqRankingData getEmployeeRankingData(FwqStatisticsBean obj) {
+        FwqRankingData data = new FwqRankingData();
+
+        CheckTaskPeriod lastTaskPeriod = commonService.getCheckTaskPeriod(obj.getStart_date().getTime(), obj.getEnd_date().getTime());
+        if (lastTaskPeriod != null) {
+            FwqStatisticsBean temp = new FwqStatisticsBean();
+            temp.setStart_date(new Date(lastTaskPeriod.getStarttime().getTime()));
+            temp.setEnd_date(new Date(lastTaskPeriod.getEndtime().getTime()));
+            List<FwqStatisticsBo> list = getEmployeeCheckedInfo(temp);
+            if (list == null || list.size() < 1) {
+                return data;
+            }
+            for (FwqStatisticsBo b : list) {
+                if (b.getDept_id().intValue() == obj.getDept_id().intValue()) {
+                    data.setLastP(b);
+                    break;
+                }
+            }
+        }
+        List<FwqStatisticsBo> list = getEmployeeCheckedInfo(obj);
+        if (list == null || list.size() < 1) {
+            return data;
+        }
+        for (FwqStatisticsBo b : list) {
+            if (b.getDept_id().intValue() == obj.getDept_id().intValue()) {
+                data.setCurrentP(b);
+                break;
+            }
+        }
+
+        return data;
+    }
+
+    @Override
+    public Object getOneCheckedDetailInfo(Integer page, Integer size, FwqStatisticsBean obj) {
+        if (!(page.equals(0) && size.equals(0))) {
+            PageHelper.startPage(page, size);
+        }
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectOneCheckedDetailInfo(obj);
+        Map<Long, Item> itemMap = commonService.getItemMap();
+
+        for (FwqStatisticsBean sta : list) {
+            // 组装扣分类型内容
+            if (sta.getCheck_item_id() != null) {
+                if (itemMap.get(sta.getCheck_item_id().longValue()) != null) {
+                    sta.setName(itemMap.get(sta.getCheck_item_id().longValue()).getName());
+                    if (itemMap.get(sta.getCheck_item_id().longValue()).getParent_id() != null) {
+                        if (itemMap.get(sta.getCheck_item_id().longValue()).getScore() == null) {
+                            sta.setParent_name(itemMap.get(sta.getCheck_item_id().longValue()).getName());
+                        } else {
+                            sta.setParent_name(itemMap.get(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id()).getName());
+                        }
+                    }
+                }
+            }
+        }
+
+        if (obj.getQueryType() == 0) {
+            for (FwqStatisticsBean sta : list) {
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                SimpleDateFormat formatter2 = new SimpleDateFormat("- HH:mm");
+                sta.setCheck_task_time_name(
+                        formatter.format(sta.getStart_date()) + formatter2.format(sta.getEnd_date()));
+//                if (sta.getDept_id() != null && obj.getDept_id() != null) {
+//                    sta.setChecked_name(CacheUtil.getUserFromMap(sta.getUser_id()).getTruename()
+//                            + (obj.getUser_id().intValue() == sta.getUser_id().intValue() ? "" : "(组员)"));
+//
+//                }
+            }
+        } /*else if (obj.getQueryType() == 1) {
+            for (FwqStatisticsBean sta : list) {
+                sta.setCheckman_name(CacheUtil.getUserFromMap(sta.getCheckman_id() + 0L).getTruename());
+                sta.setChecked_name(CacheUtil.getUserFromMap(sta.getUser_id() + 0L).getTruename());
+                sta.setFeeStationName(CacheUtil.getOrganFromMap(sta.getDept_id()).getOrganname());
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                SimpleDateFormat formatter2 = new SimpleDateFormat("- HH:mm");
+                sta.setCheck_task_time_name(
+                        formatter.format(sta.getStart_date()) + formatter2.format(sta.getEnd_date()));
+
+                if (sta.getUser_id() != null && obj.getUser_id() != null && obj.getQueryType() != null
+                        && obj.getQueryType().intValue() == 0) {
+                    sta.setChecked_name(CacheUtil.getUserFromMap(sta.getUser_id()).getTruename()
+                            + (obj.getUser_id().intValue() == sta.getUser_id().intValue() ? "" : "(组员)"));
+
+                }
+            }
+        }*/
+
+        if (!(page.equals(0) && size.equals(0))) {
+            return new PageInfo<FwqStatisticsBean>(list);
+        }
+        return list;
+    }
+
+    @Override
+    public List<FwqStatisticsBean> getOneSACheckedInfo(FwqStatisticsBean obj) {
+        return fwqStatisticsDao.selectOneCheckedInfoData(obj);
+    }
+
+    @Override
+    public List<FwqStatisticsBean> getOneCheckedItemInfo(FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectOneCheckedItemInfo(obj);
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        // 处理同一个服务区中,如果item的parent_id是一样的话,将这些数据结合在一起
+        for (FwqStatisticsBean sta : listCheckedScore) {
+            sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
+            if (itemMap.get(sta.getCheck_item_id().longValue()).getScore() == null) {
+                sta.setName(itemMap.get(sta.getCheck_item_id().longValue()).getName());
+            } else {
+                sta.setName(itemMap.get(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id()).getName());
+            }
+        }
+        for (int i = 0; i < listCheckedScore.size(); i++) {
+            for (int j = listCheckedScore.size() - 1; j > i; j--) {
+                if (listCheckedScore.get(j).getDept_id().equals(listCheckedScore.get(i).getDept_id()) && listCheckedScore.get(j).getItem_id().equals(listCheckedScore.get(i).getItem_id())) {
+                    listCheckedScore.get(i).setAll_check_score(listCheckedScore.get(i).getAll_check_score() + listCheckedScore.get(j).getAll_check_score());
+                    listCheckedScore.remove(j);
+                }
+            }
+        }
+        return listCheckedScore;
+    }
+
+    @Override
+    public List<FwqStatisticsBo> getEmployeeCheckedInfo(FwqStatisticsBean obj) {
+
+        // 将检索出来的数据放到如map中
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectStatistics(obj);
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        Map<Long, Organ> deptMap = commonService.getDeptMap();
+        // 将list中的数据找到项目的父项目,然后去除重复的
+        for (FwqStatisticsBean sta : list) {
+            sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
+        }
+        for (int i = 0; i < list.size(); i++) {
+            for (int j = list.size() - 1; j > i; j--) {
+                if (list.get(j).getDept_id().equals(list.get(i).getDept_id()) && list.get(j).getItem_id().equals(list.get(i).getItem_id())) {
+                    list.get(i).setScore(list.get(i).getScore() + list.get(j).getScore());
+                    list.remove(j);
+                }
+            }
+        }
+
+        // 查询服务区受检次数
+        FwqStatisticsBean timesList = fwqStatisticsDao.selectCheckedTimes(obj);
+
+        Map<Long, FwqStatisticsBo> statisticBoMap = new HashMap<>();
+
+        // 获得所有服务区数据,将服务区数据保存在map中
+        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        for (FeeStation sta : saList) {
+            FwqStatisticsBo obj2 = new FwqStatisticsBo();
+            obj2.setDept_id(Long.valueOf(sta.getDeptid()));
+            obj2.setName(sta.getName());
+            // 30:连云港道管;31:盐城道管;32:南通道管
+            if ("30".equals(sta.getParentid())) {
+                obj2.setId(1);
+            } else if ("31".equals(sta.getParentid())) {
+                obj2.setId(2);
+            } else if ("32".equals(sta.getParentid())) {
+                obj2.setId(3);
+            }
+            statisticBoMap.put(Long.valueOf(sta.getDeptid()), obj2);
+        }
+
+        for (FwqStatisticsBean statisticsBean : list) {
+            if (statisticBoMap.containsKey(statisticsBean.getDept_id())) {
+                FwqStatisticsBo tmp = statisticBoMap.get(statisticsBean.getDept_id());
+                // 组装扣分类型内容
+                if (itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id() != null) {
+                    statisticsBean.setId(itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id().intValue());
+                    if (itemMap.get(statisticsBean.getCheck_item_id().longValue()).getScore() == null) {
+                        statisticsBean.setName(itemMap.get(statisticsBean.getCheck_item_id().longValue()).getName());
+                    } else {
+                        statisticsBean.setName(itemMap.get(itemMap.get(statisticsBean.getCheck_item_id().longValue()).getParent_id()).getName());
+                    }
+                }
+                tmp.getChecked_socre_name().add(statisticsBean.getName());
+                tmp.getChecked_score().add(statisticsBean.getScore());
+                tmp.setCheck_all_score(tmp.getCheck_all_score() + statisticsBean.getScore());
+            }
+        }
+
+        if (statisticBoMap.containsKey(timesList.getDept_id())) {
+            FwqStatisticsBo tmp = statisticBoMap.get(timesList.getDept_id());
+            tmp.setChecked_num(timesList.getChecked_num());
+        }
+
+        List<FwqStatisticsBo> lists = new ArrayList<>(statisticBoMap.values());
+        // 进行排序
+        lists.sort(new Comparator<FwqStatisticsBo>() {
+            @Override
+            public int compare(FwqStatisticsBo o1, FwqStatisticsBo o2) {
+                return o1.compareTo(o2);
+            }
+        });
+        // 道管Map
+        // 排名
+        Map<String, Integer> center_ranking = new HashMap<>();
+        // 留last
+        Map<String, FwqStatisticsBo> center_ranking2 = new HashMap<>();
+        center_ranking.put("30", 1);
+        center_ranking.put("31", 1);
+        center_ranking.put("32", 1);
+
+        center_ranking2.put("30", null);
+        center_ranking2.put("31", null);
+        center_ranking2.put("32", null);
+
+        Map<String, Integer> service_area_ranking = new HashMap<>();
+        Map<String, FwqStatisticsBo> service_area_ranking2 = new HashMap<>();
+        // 这边需要对道管和服务区进行排名
+        for (FeeStation fee : saList) {
+            service_area_ranking.put(fee.getDeptid(), 1);
+            service_area_ranking2.put(fee.getDeptid(), null);
+        }
+
+        for (int i = 0; i < lists.size(); i++) {
+
+            FwqStatisticsBo statisticsBo = lists.get(i);
+            if (statisticsBo.getChecked_num() + statisticsBo.getChecked_m_num() == 0) {
+                continue;
+            }
+            // 计算平均扣分
+            DecimalFormat df = new DecimalFormat(".##");
+            double count = statisticsBo.getChecked_num() + statisticsBo.getChecked_m_num();
+            Double sc = (statisticsBo.getCheck_all_score() + statisticsBo.getCheck_all_m_score()) * 1.00
+                    / (count == 0 ? 1 : count);
+            statisticsBo.setCheck_score_avg(sc == 0 ? "0" : df.format(sc));
+
+            // 累计道管排名
+            // 获取道管id
+            String centerId = deptMap.get(statisticsBo.getDept_id()).getParentid().toString();
+
+            if (center_ranking2.get(centerId) == null) {
+                statisticsBo.setCenter_ranking(center_ranking.get(centerId));
+            } else {
+                center_ranking.put(centerId, center_ranking.get(centerId) + 1);
+                if (statisticsBo.compareTo(center_ranking2.get(centerId)) == 0) {
+                    statisticsBo.setCenter_ranking(center_ranking2.get(centerId).getCenter_ranking());
+                } else {
+                    statisticsBo.setCenter_ranking(center_ranking.get(centerId));
+                }
+            }
+            center_ranking2.put(centerId, statisticsBo);
+
+            // 累计服务区的排名
+            String serviceAreaId = statisticsBo.getDept_id().toString();
+
+            if (service_area_ranking2.get(serviceAreaId) == null) {
+                statisticsBo.setService_area_ranking(service_area_ranking.get(serviceAreaId));
+            } else {
+                service_area_ranking.put(serviceAreaId, service_area_ranking.get(serviceAreaId) + 1);
+                if (statisticsBo.compareTo(service_area_ranking2.get(serviceAreaId)) == 0) {
+                    statisticsBo.setService_area_ranking(service_area_ranking2.get(serviceAreaId).getService_area_ranking());
+                } else {
+                    statisticsBo.setService_area_ranking(service_area_ranking.get(serviceAreaId));
+                }
+            }
+            service_area_ranking2.put(serviceAreaId, statisticsBo);
+
+            // 公司排名s
+            if (i == 0) {
+                statisticsBo.setCompany_ranking(1);
+            } else {
+                FwqStatisticsBo lastbo = lists.get(i - 1);
+                if (statisticsBo.compareTo(lastbo) == 0) {
+                    statisticsBo.setCompany_ranking(lastbo.getCompany_ranking());
+                } else {
+                    statisticsBo.setCompany_ranking(i + 1);
+                }
+            }
+        }
+
+        return lists;
+    }
 }

+ 147 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBo.java

@@ -0,0 +1,147 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 文件名:Job
+ * 版本信息:日期:2017/4/18 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class FwqStatisticsBo implements Serializable {
+    //编号
+    private Integer id;
+
+    // 部门id
+    private Long dept_id;
+
+    private String name;
+
+    private int checked_num = 0;
+
+    private int checked_m_num = 0;
+
+    private int check_all_m_score = 0;
+
+    private int check_all_score = 0;
+
+    private List<String> checked_socre_name = new ArrayList<>();
+
+    private List<Integer> checked_score = new ArrayList<>();
+
+    private List<Integer> emp_item_score = new ArrayList<>();
+
+    private String check_score_avg;
+
+    private String check_score;
+
+    // 公司排名
+    private Integer company_ranking;
+
+    // 道管排名
+    private Integer center_ranking;
+
+    // 服务区排名
+    private Integer service_area_ranking;
+
+    private int score = 0;
+
+    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 period_id;
+
+    // 比较大小 1 小 , -1 大
+    public int compareTo(FwqStatisticsBo o2) {
+        double a = 1000.0, b = 1000.0;
+        int a_c = this.getChecked_num() + this.getChecked_m_num();
+        int b_c = o2.getChecked_num() + o2.getChecked_m_num();
+        if (a_c != 0) {
+            a = (this.getCheck_all_score() + this.getCheck_all_m_score()) / (a_c + 0.00);
+        }
+        if (b_c != 0) {
+            b = (o2.getCheck_all_score() + o2.getCheck_all_m_score()) / (b_c + 0.00);
+        }
+
+        if (a > b) {
+            return 1;
+        } else if (a < b) {
+            return -1;
+        } else {
+            if (a_c == 0 && b_c != 0) {
+                return -1;
+            } else if (b_c == 0 && a_c != 0) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+    public int compareTo2(FwqStatisticsBo o2) {
+        double a = 1000.0, b = 1000.0;
+        int a_c = this.getCheck_all_num();
+        int b_c = o2.getCheck_all_num();
+        if (a_c != 0) {
+            a = (this.getCheck_all_score()) / (a_c + 0.00);
+        }
+        if (b_c != 0) {
+            b = (o2.getCheck_all_score()) / (b_c + 0.00);
+        }
+
+        if (a > b) {
+            return 1;
+        } else if (a < b) {
+            return -1;
+        } else {
+            if (a_c == 0 && b_c != 0) {
+                return -1;
+            } else if (b_c == 0 && a_c != 0) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+    public int compareTo3(FwqStatisticsBo o2) {
+        double a = 1000.0, b = 1000.0;
+        double a_c = this.getCheck_all_num();
+        double b_c = o2.getCheck_all_num();
+        if (a_c != 0) {
+            a = Double.parseDouble(this.getCheck_score_avg());
+        }
+        if (b_c != 0) {
+            b = Double.parseDouble(o2.getCheck_score_avg());
+        }
+
+        if (a > b) {
+            return 1;
+        } else if (a < b) {
+            return -1;
+        } else {
+            if (a_c == 0 && b_c != 0) {
+                return -1;
+            } else if (b_c == 0 && a_c != 0) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
+
+}

+ 16 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/pojo/fwq/FwqRankingData.java

@@ -0,0 +1,16 @@
+package com.xintong.visualinspection.pojo.fwq;
+
+import com.xintong.visualinspection.bean.FwqStatisticsBo;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 文件名:FwqRankingData
+ * 版本信息:日期:2018/5/16 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class FwqRankingData implements Serializable {
+    private FwqStatisticsBo lastP;
+    private FwqStatisticsBo currentP;
+}

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

@@ -2,6 +2,8 @@ package com.xintong.visualinspection.service;
 
 import com.xintong.visualinspection.bean.FwqDeptStatistic;
 import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.bean.FwqStatisticsBo;
+import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
 
 import java.util.List;
 import java.util.Map;
@@ -17,4 +19,17 @@ public interface StatisticsService_F {
     // 考核问题分布报表数据
     List<FwqStatisticsBean> getFeeStationCheckItemScore(FwqStatisticsBean obj);
 
+    FwqRankingData getEmployeeRankingData(FwqStatisticsBean obj);
+
+    // 个人扣分情况 / 个人稽查情况
+    Object getOneCheckedDetailInfo(Integer page, Integer size, FwqStatisticsBean obj);
+
+    // 服务区的一年得分情况
+    List<FwqStatisticsBean> getOneSACheckedInfo(FwqStatisticsBean obj);
+
+    // 服务区各项扣分情况
+    List<FwqStatisticsBean> getOneCheckedItemInfo(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBo> getEmployeeCheckedInfo(FwqStatisticsBean obj);
+
 }