فهرست منبع

Merge branch 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection

minitiger 8 سال پیش
والد
کامیت
a2258a8ffe
18فایلهای تغییر یافته به همراه2271 افزوده شده و 3354 حذف شده
  1. BIN
      .DS_Store
  2. 183 141
      VisualInspection/css/statistics/personal_data_statistics.css
  3. 11 6
      VisualInspection/js/statistics/change_attendance.js
  4. 14 7
      VisualInspection/js/statistics/common_attendance.js
  5. 462 407
      VisualInspection/js/statistics/personal_data_statistics.js
  6. 2 2
      VisualInspection/js/statistics/toll_station_statistics.js
  7. 44 43
      VisualInspection/view/statistics/personal_data_statistics.html
  8. 17 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckTaskPeriod.java
  9. 14 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java
  10. 24 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/CheckTaskPeriodDao.java
  11. 72 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckTaskPeriod.xml
  12. 54 58
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml
  13. 14 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/pojo/UserRankingData.java
  14. 20 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/CheckTaskPeriodService.java
  15. 4 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/StatisticsService.java
  16. 65 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckTaskPeriodServiceImpl.java
  17. 157 46
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java
  18. 1114 2643
      VisualInspection_server/visual/visual.log

BIN
.DS_Store


+ 183 - 141
VisualInspection/css/statistics/personal_data_statistics.css

@@ -1,247 +1,289 @@
-.container-right{
-    width:98%;
+.container-right {
+    width: 98%;
     padding-bottom: 0px;
     padding-bottom: 0px;
-    margin:15px auto;
-    border:1px solid #d9d9d9;
+    margin: 15px auto;
+    border: 1px solid #d9d9d9;
     font-family: '宋体';
     font-family: '宋体';
     border-radius: 4px;
     border-radius: 4px;
     font-size: 12px;
     font-size: 12px;
 }
 }
-.row-1{
-    width:100%;
-    height:35px;
+
+.row-1 {
+    width: 100%;
+    height: 35px;
     background-color: #fff;
     background-color: #fff;
 }
 }
-.row-2{
-    width:100%;
-    height:50px;
+
+.row-2 {
+    width: 100%;
+    height: 50px;
 }
 }
-.row-3{
-    width:100%;
-    height:80px;
+
+.row-3 {
+    width: 100%;
+    height: 80px;
 }
 }
-.col-1{
-    width:49%;
-    height:40px;
-    float:left;
+
+.col-1 {
+    width: 49%;
+    height: 40px;
+    float: left;
     line-height: 40px;
     line-height: 40px;
     text-align: center;
     text-align: center;
     font-weight: bold;
     font-weight: bold;
 }
 }
-.row-1 span{
+
+.row-1 span {
     margin-left: 20px;
     margin-left: 20px;
     line-height: 35px;
     line-height: 35px;
 }
 }
-.line-1{
-    width:100%;
+
+.line-1 {
+    width: 100%;
     height: 1px;
     height: 1px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
 }
 }
-.line-2{
-    width:1px;
-    height:40px;
+
+.line-2 {
+    width: 1px;
+    height: 40px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
-    float:left;
+    float: left;
 }
 }
-.line-3{
-    width:1px;
-    height:400px;
+
+.line-3 {
+    width: 1px;
+    height: 400px;
+    background-color: #d9d9d9;
+    float: left;
+}
+
+.line-4,
+.line-5 {
+    width: 1px;
+    height: 80px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
-    float:left;
+    float: left;
 }
 }
-.line-4,.line-5{
-    width:1px;
-    height:80px;
+
+.line-6 {
+    width: 79.8%;
+    height: 1px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
-    float:left;
-}
-.line-6{
-    width:79.8%;
-    height:1px;
-    background-color:#d9d9d9;
-    float:right;
-}
-.dept,.job{
-    width:10%;
-    height:80px;
-    float:left;
+    float: right;
+}
+
+.dept,
+.job {
+    width: 10%;
+    height: 80px;
+    float: left;
     text-align: center;
     text-align: center;
 }
 }
-.current-month{
-    width:79.8%;
-    height:40px;
-    float:right;
+
+.current-month {
+    width: 79.8%;
+    height: 40px;
+    float: right;
     line-height: 40px;
     line-height: 40px;
 }
 }
-.next-month{
-    width:79.8%;
-    height:40px;
-    float:right;
+
+.next-month {
+    width: 79.8%;
+    height: 40px;
+    float: right;
     line-height: 40px;
     line-height: 40px;
 }
 }
-.name{
-    width:30px;
-    height:50px;
-    float:left;
+
+.name {
+    width: 30px;
+    height: 50px;
+    float: left;
     margin-left: 20px;
     margin-left: 20px;
     line-height: 50px;
     line-height: 50px;
-}            
-.div-start{
-    width:120px;
-    height:50px;
-    float:left;
+}
+
+.div-start {
+    width: 120px;
+    height: 50px;
+    float: left;
     margin-left: 30px;
     margin-left: 30px;
     line-height: 50px;
     line-height: 50px;
 }
 }
-.div-to{
-    width:20px;
-    height:50px;
-    float:left;
+
+.div-to {
+    width: 20px;
+    height: 50px;
+    float: left;
     /*line-height: 50px;*/
     /*line-height: 50px;*/
 }
 }
-.div-start input,.div-end input{
-    width:100px;
-    height:30px;
+
+.div-start input,
+.div-end input {
+    width: 100px;
+    height: 30px;
     border: 1px solid #ccc;
     border: 1px solid #ccc;
     font-size: 14px;
     font-size: 14px;
     padding: 5px 8px;
     padding: 5px 8px;
     border-radius: 4px;
     border-radius: 4px;
 }
 }
-.div-end{
-    width:120px;
-    height:50px;
-    float:left;
+
+.div-end {
+    width: 120px;
+    height: 50px;
+    float: left;
     margin-left: 5px;
     margin-left: 5px;
     line-height: 50px;
     line-height: 50px;
 }
 }
-.div-check{
-    width:160px;
-    height:50px;
-    float:left;
+
+.div-check {
+    width: 160px;
+    height: 50px;
+    float: left;
     margin-left: 10px;
     margin-left: 10px;
     line-height: 50px;
     line-height: 50px;
     border-radius: 4px;
     border-radius: 4px;
 }
 }
-.div-check select{
-    width:160px;
-    height:30px;
+
+.div-check select {
+    width: 160px;
+    height: 30px;
     border: 1px solid #ccc;
     border: 1px solid #ccc;
     border-radius: 4px;
     border-radius: 4px;
 }
 }
-.div-select{
-    width:120px;
-    height:50px;
-    float:left;
+
+.div-select {
+    width: 120px;
+    height: 50px;
+    float: left;
     margin-left: 5px;
     margin-left: 5px;
     line-height: 50px;
     line-height: 50px;
 }
 }
-.div-select select{
-    width:120px; 
-    height:30px;
+
+.div-select select {
+    width: 120px;
+    height: 30px;
     border: 1px solid #ccc;
     border: 1px solid #ccc;
     border-radius: 4px;
     border-radius: 4px;
 }
 }
 
 
-.name1{
-    width:98px;
-    height:50px;
-    float:left;
+.name1 {
+    width: 98px;
+    height: 50px;
+    float: left;
     margin-left: 10px;
     margin-left: 10px;
     line-height: 50px;
     line-height: 50px;
-} 
-.query{
-    width:80px;
-    height:50px;
-    float:left;
+}
+
+.query {
+    width: 80px;
+    height: 50px;
+    float: left;
     margin-left: 20px;
     margin-left: 20px;
 }
 }
-.export{
-    width:80px;
-    height:50px;
-    float:right;
+
+.export {
+    width: 80px;
+    height: 50px;
+    float: right;
     margin-right: 20px;
     margin-right: 20px;
 }
 }
 
 
-.div-button button{
-    width:80px;
-    height:30px;
+.div-button button {
+    width: 80px;
+    height: 30px;
     color: #fff;
     color: #fff;
     background-color: #3280fc;
     background-color: #3280fc;
     border-color: #1970fc;
     border-color: #1970fc;
-    border:1px solid transparent;
+    border: 1px solid transparent;
     border-radius: 4px;
     border-radius: 4px;
     /*margin-top: 10px;*/
     /*margin-top: 10px;*/
 }
 }
-.row-7{
-    width:100%;
-    height:40px;
+
+.row-7 {
+    width: 100%;
+    height: 40px;
     background-color: #328dc7;
     background-color: #328dc7;
     color: white;
     color: white;
 }
 }
 
 
-.row-8{
+.row-8 {
     height: 100%;
     height: 100%;
-    height:400px;
+    height: 400px;
     background-color: #fff;
     background-color: #fff;
-}.container-right{
-    width:98%;
+}
+
+.container-right {
+    width: 98%;
     padding-bottom: 0px;
     padding-bottom: 0px;
-    margin:15px auto;
-    border:1px solid #d9d9d9;
+    margin: 15px auto;
+    border: 1px solid #d9d9d9;
     font-family: '宋体';
     font-family: '宋体';
 }
 }
-.row-1{
-    width:100%;
-    height:35px;
+
+.row-1 {
+    width: 100%;
+    height: 35px;
     background-color: #fff;
     background-color: #fff;
 }
 }
 
 
-.row-1 span{
+.row-1 span {
     margin-left: 20px;
     margin-left: 20px;
     line-height: 35px;
     line-height: 35px;
 }
 }
-.line-1{
-    width:100%;
+
+.line-1 {
+    width: 100%;
     height: 1px;
     height: 1px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
 }
 }
-.row-2{
-    width:100%;
-    height:50px;
+
+.row-2 {
+    width: 100%;
+    height: 50px;
 }
 }
 
 
-.row-7{
-    width:100%;
-    height:40px;
+.row-7 {
+    width: 100%;
+    height: 40px;
 }
 }
-.col-1{
-    width:49%;
-    height:40px;
-    float:left;
+
+.col-1 {
+    width: 49%;
+    height: 40px;
+    float: left;
     line-height: 40px;
     line-height: 40px;
     text-align: center;
     text-align: center;
     font-weight: bold;
     font-weight: bold;
 }
 }
-.line-2{
-    width:1px;
-    height:40px;
+
+.line-2 {
+    width: 1px;
+    height: 40px;
     background-color: #d9d9d9;
     background-color: #d9d9d9;
-    float:left;
+    float: left;
 }
 }
-.line-3{
-    width:1px;
-    height:400px;
+
+.line-3 {
+    width: 1px;
+    height: 400px;
     background-color: #328dc7;
     background-color: #328dc7;
-    float:left;
+    float: left;
 }
 }
-.row-8{
+
+.row-8 {
     height: 100%;
     height: 100%;
-    height:400px;
+    height: 400px;
     background-color: #fff;
     background-color: #fff;
 }
 }
-.border-line{
-    width:100%;
+
+.border-line {
+    width: 100%;
     height: 442px;
     height: 442px;
-    margin:15px auto;
-    border:1px solid #328dc7;
+    margin: 15px auto;
+    border: 1px solid #328dc7;
+}
+
+.s_d_name {
+    color: #3280fc
 }
 }

+ 11 - 6
VisualInspection/js/statistics/change_attendance.js

@@ -21,7 +21,7 @@ $(function(){
         getFsEmployee(GV("#fs_station"),function(obj){
         getFsEmployee(GV("#fs_station"),function(obj){
             $("#fs_employee").html(obj);
             $("#fs_employee").html(obj);
             // 检索
             // 检索
-            getFsWorkInfo();
+            getFsWorkInfo(0);
         });
         });
     });
     });
 
 
@@ -40,7 +40,7 @@ $(function(){
 
 
     // 根据月份确定天数
     // 根据月份确定天数
     monthChange();
     monthChange();
-     $("#month_name").html( $("#sel_month").find("option:selected").text());
+     $("#month_name").html( GV("#sel_month"));
 
 
 
 
     // 收费站中心选择
     // 收费站中心选择
@@ -74,8 +74,8 @@ $(function(){
 
 
     // 查询
     // 查询
     $("#searchBtn").click(function(){        
     $("#searchBtn").click(function(){        
-        $("#month_name").html( $("#sel_month").find("option:selected").text()  )
-        getFsWorkInfo();
+        $("#month_name").html( GV("#sel_month") )
+        getFsWorkInfo(1);
     })
     })
     // end
     // end
 })
 })
@@ -84,7 +84,7 @@ $(function(){
  * 检索出勤明细数据
  * 检索出勤明细数据
  * @param {*} param 
  * @param {*} param 
  */
  */
-function getFsWorkInfo(){
+function getFsWorkInfo(flag){
 
 
     var param = {
     var param = {
            "start_time": timeTranslate( GV("#sel_month") ) ,
            "start_time": timeTranslate( GV("#sel_month") ) ,
@@ -100,6 +100,9 @@ function getFsWorkInfo(){
     }
     }
 
 
     post_common_service("statistics/fs/unregular/work/info",param,function(data){
     post_common_service("statistics/fs/unregular/work/info",param,function(data){
+        if(flag == 0 && $("#ca-a-table").children().length > 0 ){
+            return ;
+        }
         // 月份变化
         // 月份变化
         monthChange();
         monthChange();
         $("#ca-a-table").empty();
         $("#ca-a-table").empty();
@@ -126,7 +129,9 @@ function getTableContent(obj,seq){
         if(obj.subStatisticsFsWork[z].check_id !=undefined){
         if(obj.subStatisticsFsWork[z].check_id !=undefined){
             map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
             map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
         }else{
         }else{
-            map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+            if(  map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] == null ){
+                map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+            }
         }
         }
     }
     }
     var class_html = [];
     var class_html = [];

+ 14 - 7
VisualInspection/js/statistics/common_attendance.js

@@ -26,7 +26,7 @@ $(function(){
         getFsEmployee(GV("#fs_station"),function(obj){
         getFsEmployee(GV("#fs_station"),function(obj){
             $("#fs_employee").html(obj);
             $("#fs_employee").html(obj);
             // 检索
             // 检索
-            getFsWorkInfo();
+            getFsWorkInfo(0);
         });
         });
     });
     });
 
 
@@ -36,13 +36,13 @@ $(function(){
     //     $("#sel_month").append('<option value= "'+ months[i]  +'">'+ months[i] +'</option>');
     //     $("#sel_month").append('<option value= "'+ months[i]  +'">'+ months[i] +'</option>');
     // }
     // }
 
 
-
     // 当前月份初始化
     // 当前月份初始化
     // $("#sel_month").val(months[months.length-1 ]);
     // $("#sel_month").val(months[months.length-1 ]);
 
 
     // 根据月份确定天数
     // 根据月份确定天数
     monthChange();
     monthChange();
-     $("#month_name").html( $("#sel_month").find("option:selected").text());
+ 
+     $("#month_name").html( GV("#sel_month"));
 
 
 
 
     // 收费站中心选择
     // 收费站中心选择
@@ -76,8 +76,8 @@ $(function(){
 
 
     // 查询
     // 查询
     $("#searchBtn").click(function(){        
     $("#searchBtn").click(function(){        
-        $("#month_name").html( $("#sel_month").find("option:selected").text()  )
-        getFsWorkInfo();
+        $("#month_name").html( GV("#sel_month") )
+        getFsWorkInfo(1);
     })
     })
     // end
     // end
 
 
@@ -85,7 +85,7 @@ $(function(){
      * 检索出勤明细数据
      * 检索出勤明细数据
      * @param {*} param 
      * @param {*} param 
      */
      */
-    function getFsWorkInfo(){
+    function getFsWorkInfo(flag){
 
 
         var param = {
         var param = {
             "start_time": timeTranslate( GV("#sel_month") ) ,
             "start_time": timeTranslate( GV("#sel_month") ) ,
@@ -101,6 +101,9 @@ $(function(){
         }
         }
 
 
         post_common_service("statistics/fs/work/info",param,function(data){
         post_common_service("statistics/fs/work/info",param,function(data){
+            if(flag == 0 && $("#c-a-tbody").children().length > 0 ){
+                return ;
+            }
             // 月份变化
             // 月份变化
             monthChange();
             monthChange();
             $("#c-a-tbody").empty();
             $("#c-a-tbody").empty();
@@ -127,9 +130,13 @@ function getTableContent(obj,seq){
     var map_class = {};
     var map_class = {};
     for(var z=0; z < obj.subStatisticsFsWork.length ;z++){
     for(var z=0; z < obj.subStatisticsFsWork.length ;z++){
         if(obj.subStatisticsFsWork[z].check_id !=undefined){
         if(obj.subStatisticsFsWork[z].check_id !=undefined){
+           
             map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
             map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
+        
         }else{
         }else{
-            map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+            if(  map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] == null ){
+                map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+            }
         }
         }
     }
     }
     var class_html = [];
     var class_html = [];

+ 462 - 407
VisualInspection/js/statistics/personal_data_statistics.js

@@ -1,442 +1,497 @@
 var year = new Date().getFullYear();
 var year = new Date().getFullYear();
-var months = ['1','2','3','4','5','6','7','8','9','10','11','12'];
-var monthsCH = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
+var months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
+var monthsCH = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
 var array_year_score = new Array();
 var array_year_score = new Array();
 var array_check_type = new Array();
 var array_check_type = new Array();
-var user_id = 2424;      // 用户假数据
+var user_id = 2424; // 用户假数据
 var score_statistics;
 var score_statistics;
 var check_type;
 var check_type;
 var cur_status;
 var cur_status;
 var hide = false;
 var hide = false;
 // 默认初始化日期一个月
 // 默认初始化日期一个月
-$(".div-start input").val(new Date().getFullYear()+"-"+new Date().getMonth()+"-26");
-$(".div-end input").val(new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-25");
-var start_date = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 ) ;
-var end_date = $(".div-end input").val()+" 23:00:00";
+$(".div-start input").val(new Date().getFullYear() + "-" + new Date().getMonth() + "-26");
+$(".div-end input").val(new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-25");
+var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
+var end_date = $(".div-end input").val() + " 23:00:00";
 
 
 /**
 /**
  * 预加载方法
  * 预加载方法
- */		
-$(function(){
-	setVisit();
-
-//*************************************数据表格******************************************
-	function initAppealPage(start_date,end_date,user_id) {
-		initQueryParams();
-		queryAppeal(start_date,end_date,user_id);
+ */
+$(function() {
+    setVisit();
+
+    //*************************************数据表格******************************************
+    function initAppealPage(start_date, end_date, user_id) {
+        initQueryParams();
+        queryAppeal(start_date, end_date, user_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, user_id) {
+
+        $("#station_name").html($("#select-dept").find("option:selected").text())
+        $("#station_user_name").html($("#select-personal").find("option:selected").text())
+
+
+        //请求数据
+        var data_t = {
+            "start_date": start_date,
+            "end_date": end_date,
+            "user_id": user_id
+        }
+        var url_t = "/statistics/employee/order/detail"
+        post_common_service(url_t, data_t, function(res) {
+
+            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.fee_station_ranking);
+                $("#c_com_ranking").html(p.company_ranking);
+                $("#c_score_ranking").html(p.check_all_score + p.check_all_m_score);
+                isshow_c = true;
+            }
+            if (typeof(res.lastP) != undefined && res.lastP != null) {
+                var p = res.lastP;
+                $("#l_dept_ranking").html(p.fee_station_ranking);
+                $("#l_com_ranking").html(p.company_ranking);
+                $("#l_score_ranking").html(p.check_all_score + p.check_all_m_score);
+                isshow_l = true;
+            }
+
+            if (isshow_c && isshow_l) {
+                var p_c = res.currentP;
+                var p_l = res.lastP;
+                var dept_r = p_c.fee_station_ranking - p_l.fee_station_ranking;
+                if (dept_r != 0) {
+                    $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "green") + "' 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" : "green") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
+                }
+
+
+
+            }
+
+
+
+
+
+
+        }, function(error) {
+
+        })
+
+
+
+        var data = {
+            "start_date": start_date,
+            "end_date": end_date,
+            "user_id": user_id,
+            "queryType": 0,
+            "score_flag": $(".score-select").val()
+        }
+        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: 60, text: '扣分数', flex: true, colClass: 'text-center', field: 'score', nullvalue: '0' },
+            { width: 100, text: '考核类型', flex: true, colClass: 'text-center', sort: 'down', field: 'parent_name' },
+            { width: 100, text: '考核项', flex: true, colClass: 'text-center', sort: 'down', field: 'name' },
+            { width: 100, 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': "/statistics/one/checkedItem/detail/info",
+            'param': data
+        });
     }
     }
 
 
-	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,user_id){
-
-		var data = {
-			"start_date":start_date,
-				"end_date":end_date,
-				"user_id":user_id,
-				"queryType":0,
-				"score_flag":$(".score-select").val()
-		}
-		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: 60, text: '扣分数',  flex: true, colClass: 'text-center',field:'score',nullvalue:'0'},
-					{width: 100, text: '考核类型',  flex: true, colClass: 'text-center',sort: 'down',field:'parent_name'},
-					{width: 100, text: '考核项',  flex: true, colClass: 'text-center',sort: 'down',field:'name'},
-					{width: 100, 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':"/statistics/one/checkedItem/detail/info",
-								'param':data}
-								);
-	}
-
-
-
-    
-
-//*************************************画图******************************************
-
-	// 加载图配置
-	echart();
-
-	$(".query button").click(function(){
+
+
+
+
+    //*************************************画图******************************************
+
+    // 加载图配置
+    echart();
+
+    $(".query button").click(function() {
         var user_id = $("#select-personal").val();
         var user_id = $("#select-personal").val();
-		var start_date = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 ) ;
-		var end_date = $(".div-end input").val()+" 23:00:00";
-		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;
-		}
-		if($("#select-personal").text()==''){
-             tip("请选择收费站");
-			 return;
-		}
-		// 查询图一
-		init_personal_score_statistics("statistics/one/person/year/info",user_id);
-		// 查询图二
-		init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);
-		// 表格
-	    initAppealPage(start_date,end_date,user_id);
-		// 加载图配置
-		echart();
-	});
+        var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
+        var end_date = $(".div-end input").val() + " 23:00:00";
+        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;
+        }
+        if ($("#select-personal").text() == '') {
+            tip("请选择收费站");
+            return;
+        }
+
+
+
+        // 查询图一
+        init_personal_score_statistics("statistics/one/person/year/info", user_id);
+        // 查询图二
+        init_personal_check_type("statistics/one/person/checkedItem/info", user_id, start_date, end_date);
+        // 表格
+        initAppealPage(start_date, end_date, user_id);
+        // 加载图配置
+        echart();
+    });
+
+    /**
+     * 初始化图一
+     * @param {*} url
+     * @param {*} dept_id
+     */
+    function init_personal_score_statistics(url, user_id) {
+        var param = {
+            "start_date": (year - 1) + "-" + new Date().getMonth() + "-25" + " 23:00:00",
+            "end_date": year + "-" + (new Date().getMonth() + 1) + "-25" + " 23:00:00",
+            "user_id": user_id
+        }
+        initRqueset(url, param, 1);
+    }
+
 
 
     /**
     /**
-	 * 初始化图一
-	 * @param {*} url 
-	 * @param {*} dept_id 
-	 */
-	function init_personal_score_statistics(url,user_id){
-		var param = {
-			"start_date":(year-1)+"-"+new Date().getMonth()+"-25"+" 23:00:00",
-			"end_date":year+"-"+(new Date().getMonth()+1)+"-25"+" 23:00:00",
-			"user_id":user_id
-		}
-		initRqueset(url,param,1);
-	}
-	
+     * 初始化图二
+     * @param {*} url
+     * @param {*} dept_id
+     */
+    function init_personal_check_type(url, user_id, start_date, end_date) {
+        var param = {
+            "start_date": start_date,
+            "end_date": end_date,
+            "user_id": user_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 "";
+        });
+    }
 
 
     /**
     /**
-	 * 初始化图二
-	 * @param {*} url 
-	 * @param {*} dept_id 
-	 */
-	function init_personal_check_type(url,user_id,start_date,end_date){
-		var param = {
-			"start_date":start_date,
-			"end_date":end_date,
-			"user_id":user_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 "" ;
-    	});
-	}
-
-	/**
-	 * 数组数据
-	 * @param {*} data 
-	 * @param {*} type 
-	 */
-	function data_array(data,type){
-		if(type == 1){
-			array_year_score.length = 0;
-			months.length = 0;
-			if(data.length!=0){
-				if(data.length<14){
-					for(var i=0;i<14-data.length;i++){
-						array_year_score.push(0)
-					}
-				}
-				var month_arr = month_method_2();
-				for(var i=0;i<data.length;i++){
-					if(month_arr.indexOf(parseInt(data[i].mth))){
-						// 指定位置插入值
-						array_year_score.splice(month_arr.indexOf(data[i].mth),0,
-						(1000-(filter(data[i].all_check_score,data[i].checked_num,0))));
-					}
-				}
-		    }else{
-				array_year_score.length = 0;
-			}	
-		}else if(type == 2){
-			array_check_type.length=0;
-                if(data.length != 0){
-					for(var i=0;i<data.length;i++){
-						array_check_type.push({"value": data[i].all_check_score,"name":data[i].name});
-				    } 
-				}else{
-					array_check_type.length=0;	
-				}
-		}
-	}
-
-	$("#select-personal").click(function(){
-		if($("#select-personal").text()==''){
-             tip("请选择收费站");
-			 return;
-		}
-	});
-	// 收费站下拉框
-	var dept;
-	if(roleContains("STATION")){
-		dept=getCurrentUser().organid; 
-	}
-	var roadManager;
-	if(roleContains("ROAD_MANAGER")){
-		roadManager=getCurrentUser().organid; 
-	}
-	var feeList = $.zui.store.get("cache_fee_station_list");
-	if(roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
-	setFeeSelectValueNoAll(feeList,"#select-dept",dept);
-	setSecond();
-	/**
-	 * 部门人员下拉框
-	 */
-	function setSecond(){ 
+     * 数组数据
+     * @param {*} data
+     * @param {*} type
+     */
+    function data_array(data, type) {
+        if (type == 1) {
+            array_year_score.length = 0;
+            months.length = 0;
+            if (data.length != 0) {
+                if (data.length < 14) {
+                    for (var i = 0; i < 14 - data.length; i++) {
+                        array_year_score.push(0)
+                    }
+                }
+                var month_arr = month_method_2();
+                for (var i = 0; i < data.length; i++) {
+                    if (month_arr.indexOf(parseInt(data[i].mth))) {
+                        // 指定位置插入值
+                        array_year_score.splice(month_arr.indexOf(data[i].mth), 0,
+                            (1000 - (filter(data[i].all_check_score, data[i].checked_num, 0))));
+                    }
+                }
+            } else {
+                array_year_score.length = 0;
+            }
+        } else if (type == 2) {
+            array_check_type.length = 0;
+            if (data.length != 0) {
+                for (var i = 0; i < data.length; i++) {
+                    array_check_type.push({ "value": data[i].all_check_score, "name": data[i].name });
+                }
+            } else {
+                array_check_type.length = 0;
+            }
+        }
+    }
+
+    $("#select-personal").click(function() {
+        if ($("#select-personal").text() == '') {
+            tip("请选择收费站");
+            return;
+        }
+    });
+    // 收费站下拉框
+    var dept;
+    if (roleContains("STATION")) {
+        dept = getCurrentUser().organid;
+    }
+    var roadManager;
+    if (roleContains("ROAD_MANAGER")) {
+        roadManager = getCurrentUser().organid;
+    }
+    var feeList = $.zui.store.get("cache_fee_station_list");
+    if (roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
+    setFeeSelectValueNoAll(feeList, "#select-dept", dept);
+    setSecond();
+    /**
+     * 部门人员下拉框
+     */
+    function setSecond() {
         var select_road = $("#select-dept").val();
         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){
-				for(var i=0;i<data.length;i++){
-					for(var j=33;j<=53;j++){
-						if(select_road==j){
-							tempStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";  
-						}
-					}
-				sec.innerHTML=tempStr;
-				}
-			}else{
-				sec.innerHTML='';	
-			}
-			// 请求数据
-         	 getInit();
-		},function(error){
-        	return "" ;
-    	});
+        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) {
+                for (var i = 0; i < data.length; i++) {
+                    for (var j = 33; j <= 53; j++) {
+                        if (select_road == j) {
+                            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 = dateChange(new Date($(".div-start input").val()+" 00:00:00"),60*60*1000 );
-		var end_date = $(".div-end input").val()+" 23:00:00";
-		var user_id = $("#select-personal").val();
-		// 页面初始化
-		echart();
-		initAppealPage(start_date,end_date,user_id);
-		init_personal_score_statistics("statistics/one/person/year/info",user_id);
-		init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);
-	}
-
-
-	$("#select-dept").change(function(){
-		setSecond();
-	});
-
-	$("#select-personal").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(){
+    function getInit() {
+        var start_date = dateChange(new Date($(".div-start input").val() + " 00:00:00"), 60 * 60 * 1000);
+        var end_date = $(".div-end input").val() + " 23:00:00";
+        var user_id = $("#select-personal").val();
+        // 页面初始化
+        echart();
+        initAppealPage(start_date, end_date, user_id);
+        init_personal_score_statistics("statistics/one/person/year/info", user_id);
+        init_personal_check_type("statistics/one/person/checkedItem/info", user_id, start_date, end_date);
+    }
+
+
+    $("#select-dept").change(function() {
+        setSecond();
+    });
+
+    $("#select-personal").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({
         require.config({
             paths: {
             paths: {
                 echarts: '/js/lib/echarts/build/dist'
                 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'
+        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%"
+            },
+            legend: {
+                data: ['平均分']
+            },
+            toolbox: {
+                show: true,
+            },
+            calculable: true,
+            xAxis: [{
+                type: 'category',
+                boundaryGap: false,
+                data: month_method_2()
+            }],
+            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: '最小值' }
+                        ]
                     },
                     },
-					grid:{
-                    width:"75%"
-                    },
-					legend: {
-						data:['平均分']
-					},
-					toolbox: {
-						show : true,
-					},
-					calculable : true,
-					xAxis : [
-						{
-							type : 'category',
-							boundaryGap : false,
-							data : month_method_2()
-						}
-					],
-					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 
+                    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,
+                feature: {
+
+                    magicType: {
+
+                        type: ['pie', 'funnel'],
+                        option: {
+                            funnel: {
+                                x: '25%',
+                                width: '50%',
+                                funnelAlign: 'left',
+                                max: 1548
+                            }
                         }
                         }
                     },
                     },
-                    textStyle: {
-                        fontSize: 20,
-						fontFamily:'cursive',
-                        fontWeight: 'bold'
+                }
+            },
+            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 }
                     }
                     }
-                },
-				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;
-		}
+                }
+            }]
+        };
+        return option;
+    }
 
 
 });
 });
-function setVisit(){
-	if(roleContains("STATION")){
-		$("#select-dept").attr("disabled","disabled");
-	}
+
+function setVisit() {
+    if (roleContains("STATION")) {
+        $("#select-dept").attr("disabled", "disabled");
+    }
 }
 }

+ 2 - 2
VisualInspection/js/statistics/toll_station_statistics.js

@@ -81,7 +81,7 @@ $(function(){
         // 查询图四
         // 查询图四
 		init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
 		init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
         // 查询图五
         // 查询图五
-		console.log(select_month+","+select_station);
+		// console.log(select_month+","+select_station);
 		init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
 		init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
         // 查询图六
         // 查询图六
 		init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
 		init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
@@ -96,7 +96,7 @@ $(function(){
 			"dept_id":select_station,
 			"dept_id":select_station,
 			"queryType":2
 			"queryType":2
 		}		
 		}		
-		console.log(param);
+		// console.log(param);
 		initRqueset(url,param,1);
 		initRqueset(url,param,1);
 	}
 	}
 	
 	

+ 44 - 43
VisualInspection/view/statistics/personal_data_statistics.html

@@ -10,11 +10,15 @@
             <!--<div class="name"><span>刘娟</span></div>
             <!--<div class="name"><span>刘娟</span></div>
             <div class="div-select div-button"><button>选择人员</button></div>-->
             <div class="div-select div-button"><button>选择人员</button></div>-->
             <!--<div class="name1"><span  for="exampleInputAccount1">请选择收费站:</span></div>-->
             <!--<div class="name1"><span  for="exampleInputAccount1">请选择收费站:</span></div>-->
-            <div class="div-select"><select  class="form-control" id="select-dept"></select></button></div>
-            <div class="div-select"><select  class="form-control" id="select-personal"></select></button></div>
-            <div class="div-start"><input class="form-control" placeholder="请选择考核开始时间"></input></div>
-            <div class="div-to"><label  for="exampleInputAccount1">-</label></div>
-            <div class="div-end"><input class="form-control" placeholder="请选择考核结束时间"></input></div>
+            <div class="div-select"><select class="form-control" id="select-dept"></select></button>
+            </div>
+            <div class="div-select"><select class="form-control" id="select-personal"></select></button>
+            </div>
+            <div class="div-start"><input class="form-control" placeholder="请选择考核开始时间"></input>
+            </div>
+            <div class="div-to"><label for="exampleInputAccount1">-</label></div>
+            <div class="div-end"><input class="form-control" placeholder="请选择考核结束时间"></input>
+            </div>
             <div class="div-select">
             <div class="div-select">
                 <select class="form-control score-select ">
                 <select class="form-control score-select ">
                     <option value="">全部</option><option value="1" selected>扣分</option><option value="0">不扣分</option>
                     <option value="">全部</option><option value="1" selected>扣分</option><option value="0">不扣分</option>
@@ -23,66 +27,66 @@
             <div class="query div-button"><button>查询</button></div>
             <div class="query div-button"><button>查询</button></div>
             <!--<div class="export div-button"><button>导出</button></div>-->
             <!--<div class="export div-button"><button>导出</button></div>-->
         </div>
         </div>
-    </div> 
+    </div>
     <div class="line-1"></div>
     <div class="line-1"></div>
-    <!--<div class="row-3">
+    <div class="row-3">
         <div class="dept">
         <div class="dept">
             <div style="margin-top:14px;">
             <div style="margin-top:14px;">
-            <span>部门</span><br/><br/>   
-            <a>收费站</a>
+                <span>部门</span><br/><br/>
+                <span class="s_d_name" id='station_name'>收费站</span>
             </div>
             </div>
         </div>
         </div>
         <div class="line-4"></div>
         <div class="line-4"></div>
         <div class="job">
         <div class="job">
             <div style="margin-top:14px;">
             <div style="margin-top:14px;">
-            <span>职务</span><br/><br/>
-            <a>收费员</a>
+                <span>职务</span><br/><br/>
+                <span class="s_d_name" id='station_user_name'>收费员</span>
             </div>
             </div>
         </div>
         </div>
         <div class="line-5"></div>
         <div class="line-5"></div>
         <div class="current-month">
         <div class="current-month">
             <span style="margin-left:20px;">本月:</span>
             <span style="margin-left:20px;">本月:</span>
-            <span style="margin-left:50px;">部门排名:</span><span>6</span>
-            <span style="margin-left:50px;">总排名:</span><span>20</span>
-            <span style="margin-left:50px;">总扣分:</span><span>120</span>
-            <span style="margin-left:50px;">平均单项扣分:</span><span>11</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_com_ranking">-</span>
+            <span>总扣分:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="c_score_ranking">-</span>
+
         </div>
         </div>
         <div class="line-6"></div>
         <div class="line-6"></div>
         <div class="next-month">
         <div class="next-month">
-            <span style="margin-left:20px;">月:</span>
-            <span style="margin-left:50px;">部门排名:</span><span>6</span>
-            <span style="margin-left:50px;">总排名:</span><span>20</span>
-            <span style="margin-left:50px;">总扣分:</span><span>120</span>
-            <span style="margin-left:50px;">平均单项扣分:</span><span>11</span>
+            <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_com_ranking">-</span>
+            <span>总扣分:</span><span style="display: -moz-inline-box;display: inline-block;width:100px" id="l_score_ranking">-</span>
+
         </div>
         </div>
-    </div>-->
+    </div>
 
 
     <div class="row" style="width:100%;margin:0 auto;">
     <div class="row" style="width:100%;margin:0 auto;">
-            <!-- 使用一个div来显示数据表格 -->
-            <div id="personal_data_table" class="datatable" data-checkable="true" data-sortable="true"></div>
+        <!-- 使用一个div来显示数据表格 -->
+        <div id="personal_data_table" class="datatable" data-checkable="true" data-sortable="true"></div>
     </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 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>
-  </div>
 </div>
 </div>
 <script>
 <script>
     $(document).ready(function() {
     $(document).ready(function() {
-        
+
         // 仅选择日期
         // 仅选择日期
-        $(".div-start input,.div-end input").datetimepicker(
-        {
-            language:  "zh-CN",
+        $(".div-start input,.div-end input").datetimepicker({
+            language: "zh-CN",
             weekStart: 1,
             weekStart: 1,
-            todayBtn:  1,
+            todayBtn: 1,
             autoclose: 1,
             autoclose: 1,
             todayHighlight: 1,
             todayHighlight: 1,
             startView: 2,
             startView: 2,
@@ -91,7 +95,4 @@
             format: "yyyy-mm-dd"
             format: "yyyy-mm-dd"
         });
         });
     });
     });
-</script>
-
-
-       
+</script>

+ 17 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckTaskPeriod.java

@@ -0,0 +1,17 @@
+package com.xintong.visualinspection.bean;
+
+import java.util.Date;
+
+import lombok.Data;
+
+@Data
+public class CheckTaskPeriod {
+	
+	private Integer id;
+	private String name;
+	private Date starttime;
+	private Date endtime;
+	private Integer currentday;
+	
+
+}

+ 14 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -4,6 +4,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import com.xintong.visualinspection.pojo.UserRankingData;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -44,6 +45,19 @@ public class StatisticsController extends BaseController {
     	List<StatisticsBo> lists=  statisticsService.getEmployeeCheckedInfo(obj);
     	List<StatisticsBo> lists=  statisticsService.getEmployeeCheckedInfo(obj);
     	return super.returnSuccessResult(lists);
     	return super.returnSuccessResult(lists);
     }
     }
+
+
+    /**
+     * 获取用户排名详情
+     * @param obj
+     * @return
+     */
+    @RequestMapping(value = "/employee/order/detail")
+    public String getEmployeeOrderByUserId(@RequestBody StatisticsBean obj){
+        UserRankingData userRankingData=  statisticsService.getEmployeeRankingData(obj);
+        return super.returnSuccessResult(userRankingData);
+    }
+
     
     
 
 
     /**
     /**

+ 24 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/CheckTaskPeriodDao.java

@@ -0,0 +1,24 @@
+package com.xintong.visualinspection.dao.master;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.xintong.visualinspection.bean.CheckTaskPeriod;
+
+
+/**
+ * 文件名:UserInfoDao
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Mapper
+public interface CheckTaskPeriodDao  {
+    public void insert(CheckTaskPeriod checkTaskPeriod);
+    public void update(CheckTaskPeriod checkTaskPeriod);
+    public void delete(Long id);
+    public List<CheckTaskPeriod> select(CheckTaskPeriod checkTaskPeriod);
+    public List<CheckTaskPeriod> selectbytime(CheckTaskPeriod checkTaskPeriod);
+    public List<CheckTaskPeriod> selectbydatetime(CheckTaskPeriod checkTaskPeriod);
+
+    
+}

+ 72 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckTaskPeriod.xml

@@ -0,0 +1,72 @@
+<?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.dao.master.CheckTaskPeriodDao">
+	<resultMap id="BaseResultMap"
+		type="com.xintong.visualinspection.bean.CheckTaskPeriod">
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="starttime" jdbcType="TIMESTAMP" property="starttime" javaType="java.sql.Timestamp" />  
+		<result column="endtime" jdbcType="TIMESTAMP" property="endtime" javaType="java.sql.Timestamp" />  
+		<result column="currentday" property="currentday" jdbcType="INTEGER" />
+		<result column="name" property="name" jdbcType="VARCHAR" />
+	</resultMap>
+
+	<select id="select" parameterType="com.xintong.visualinspection.bean.CheckTaskPeriod"
+		resultMap="BaseResultMap">
+		select * from check_task_period where 	1=1  
+		<if test="name != null">and name = #{name} </if>
+		<if test="id != null">and id = #{id} </if>
+	
+	</select>
+
+	<select id="selectbytime" parameterType="com.xintong.visualinspection.bean.CheckTaskPeriod"
+		resultMap="BaseResultMap">
+     <![CDATA[
+      select * from  check_task_period where 
+       #{starttime} = starttime
+      and 
+      1=1 
+      ]]>
+	</select>
+
+	<select id="selectbydatetime" parameterType="com.xintong.visualinspection.bean.CheckTaskPeriod"
+			resultMap="BaseResultMap">
+		<![CDATA[
+      select * from  check_task_period where
+       #{starttime} >= starttime and  #{starttime} <= endtime
+      and
+      1=1
+      ]]>
+	</select>
+
+
+	<insert id="insert" parameterType="com.xintong.visualinspection.bean.CheckTaskPeriod">
+		INSERT INTO
+		check_task_period
+		(name,starttime,endtime,currentday)
+		VALUES
+		(#{name},#{starttime},#{endtime},#{currentday})
+	</insert>
+
+	<update id="update" parameterType="com.xintong.visualinspection.bean.CheckTaskPeriod">
+		UPDATE
+		check_task_period
+		SET
+		<if test="name != null">name = #{name},</if>
+		<if test="starttime != null">starttime = #{starttime},</if>
+		<if test="endtime != null">endtime = #{endtime},</if>
+		<if test="currentday != null">currentday = #{currentday},</if>
+		id = #{id}
+		WHERE
+		id = #{id}
+	</update>
+
+	<delete id="delete" parameterType="java.lang.Long">
+		DELETE FROM
+		check_task_period
+		WHERE
+		id =#{id}
+	</delete>
+
+
+
+</mapper>

+ 54 - 58
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -20,11 +20,10 @@
          
          
     <select id="selectMList"  parameterType="com.xintong.visualinspection.pojo.TaskAndScore" resultType="com.xintong.visualinspection.pojo.TaskAndScore">
     <select id="selectMList"  parameterType="com.xintong.visualinspection.pojo.TaskAndScore" resultType="com.xintong.visualinspection.pojo.TaskAndScore">
    
    
-    SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
-          a.monitor_user_id != -1 and a.monitor_user_id != 0 and 
-       a.start_time &gt;= #{start_time} and a.end_time &lt; #{end_time} and a.check_status !=22
-    
-    
+	    SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
+	          a.monitor_user_id != -1 and a.monitor_user_id != 0 and 
+	       a.start_time &gt;= #{start_time} and a.end_time &lt; #{end_time} and a.check_status !=22
+	    
     </select>
     </select>
     
     
     
     
@@ -97,29 +96,27 @@
 			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score , checked_score_t.checked_person,checked_score_t.checked_dept
 			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score , checked_score_t.checked_person,checked_score_t.checked_dept
 		FROM
 		FROM
 			(
 			(
-				SELECT
-					monthfunc (t.start_time) AS mth,
-					sum(m.check_item_score) AS checkd_all_score,
-					t.*
-				FROM
-					check_task t,
-					check_score m
-				WHERE
-					t.id = m.task_id
-				AND t.check_status != 22
-				AND t.checked_person IS NOT NULL
-				<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>
-				<if test="mth!=null and mth!=''">
-					AND monthfunc (t.start_time) =#{mth}
-				</if>
-				GROUP BY
-					mth,
-					t.checked_person
+			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 check_task t 
+						where t.check_status != 22 
+						<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> 
+						<if test="mth!=null and mth!=''">
+							AND monthfunc (t.start_time) =#{mth}
+						</if>
+						  ) t  
+			ON m.task_id = t.id
+				WHERE 1=1
+					GROUP BY mth , m.checked_person
+					
 			) checked_score_t
 			) checked_score_t
 		LEFT JOIN (
 		LEFT JOIN (
 			SELECT
 			SELECT
@@ -179,7 +176,8 @@
      </sql>
      </sql>
      
      
      <select id="selectCheckedScoreList" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      <select id="selectCheckedScoreList" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id ,tab.checked_num  FROM (  <include refid="selectAllCheckedInfo"/> ) tab 
+     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id ,tab.checked_num  
+     		FROM (  <include refid="selectAllCheckedInfo"/> ) tab 
      	WHERE 1=1 
      	WHERE 1=1 
      	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
      	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
     		AND	tab.checked_dept IN
     		AND	tab.checked_dept IN
@@ -194,7 +192,7 @@
      </select>
      </select>
      
      
      <select id="selectCheckedItemScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      <select id="selectCheckedItemScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-     	SELECT count(m.check_item_score) AS checked_num , sum(m.check_item_score) AS all_check_score , m.parent_id,m.check_item_name AS name FROM check_task t INNER JOIN
+     	SELECT count(DISTINCT m.task_id) AS checked_num , sum(m.check_item_score) AS all_check_score , m.parent_id,m.check_item_name AS name FROM check_task t INNER JOIN
 		(
 		(
 			select ci.name AS check_item_name , t.* FROM
 			select ci.name AS check_item_name , t.* FROM
 			(  SELECT ci.parent_id, t.* from check_score t LEFT JOIN check_item  ci ON t.check_item_id = ci.id
 			(  SELECT ci.parent_id, t.* from check_score t LEFT JOIN check_item  ci ON t.check_item_id = ci.id
@@ -223,36 +221,34 @@
 			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score AS all_check_score , checked_score_t.checked_person,checked_score_t.checked_dept
 			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score AS all_check_score , checked_score_t.checked_person,checked_score_t.checked_dept
 			FROM
 			FROM
 			(
 			(
-				SELECT
-					monthfunc (t.start_time) AS mth,
-					sum(m.check_item_score) AS checkd_all_score,
-					t.*
-				FROM
-					check_task t,
-					check_score m
-				WHERE
-					t.id = m.task_id
-				AND t.check_status != 22
-				AND t.checked_person IS NOT NULL
-				<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>
-				<if test="user_id !=null ">
-					AND m.checked_person = #{user_id}
-				</if>
-				GROUP BY mth
+				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 check_task t 
+						where t.check_status != 22 
+						<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>   ) t  
+			ON m.task_id = t.id
+				WHERE 1=1
+					<if test="user_id !=null ">
+						AND m.checked_person = #{user_id}
+					</if>
+					GROUP BY mth
+				
 			) checked_score_t
 			) checked_score_t
 		LEFT JOIN (
 		LEFT JOIN (
 			SELECT
 			SELECT
-				COUNT(t.checked_person) AS checked_num,
+				COUNT( t.id) AS checked_num,
 				t.checked_person,
 				t.checked_person,
-				monthfunc (t.start_time) AS mth,
-				t.id
+				monthfunc (t.start_time) AS mth
 			FROM
 			FROM
-				check_task t
+				check_task t 
 			WHERE
 			WHERE
 				t.checked_person IS NOT NULL
 				t.checked_person IS NOT NULL
 			AND t.check_status != 22
 			AND t.check_status != 22
@@ -275,7 +271,7 @@
      </select>
      </select>
      
      
      <select id="selectOneCheckedItemInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      <select id="selectOneCheckedItemInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-     	SELECT count(m.check_item_score) AS checked_num , sum(m.check_item_score) AS all_check_score , m.parent_id,m.check_item_name AS name FROM check_task t INNER JOIN
+     	SELECT count(DISTINCT m.task_id) AS checked_num , sum(m.check_item_score) AS all_check_score , m.parent_id,m.check_item_name AS name FROM check_task t INNER JOIN
 		(
 		(
 			select ci.name AS check_item_name , t.* FROM
 			select ci.name AS check_item_name , t.* FROM
 			(  SELECT ci.parent_id, t.* from check_score t LEFT JOIN check_item  ci ON t.check_item_id = ci.id
 			(  SELECT ci.parent_id, t.* from check_score t LEFT JOIN check_item  ci ON t.check_item_id = ci.id
@@ -302,10 +298,10 @@
      		LEFT JOIN (SELECT ci.* ,cp.name AS parent_name FROM check_item  ci LEFT JOIN check_item cp ON ci.parent_id = cp.id) ci ON ci.id = cs.check_item_id  
      		LEFT JOIN (SELECT ci.* ,cp.name AS parent_name FROM check_item  ci LEFT JOIN check_item cp ON ci.parent_id = cp.id) ci ON ci.id = cs.check_item_id  
      		where   t.check_status !=22
      		where   t.check_status !=22
      		<if test="queryType!=null and queryType==0">
      		<if test="queryType!=null and queryType==0">
-     			AND   t.checked_person = #{user_id}
+     			AND   cs.checked_person = #{user_id}
      		</if>
      		</if>
      		<if test="queryType!=null and queryType==1 and user_id!=null and user_id!=''">
      		<if test="queryType!=null and queryType==1 and user_id!=null and user_id!=''">
-     			AND  t.checkman = #{user_id}
+     			AND  cs.checkman = #{user_id}
      		</if>
      		</if>
      		<if test="start_date !=null and end_date !=null and queryType ==1">
      		<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}
      			AND t.check_time >= #{start_date} AND t.check_time &lt; #{end_date}

+ 14 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/pojo/UserRankingData.java

@@ -0,0 +1,14 @@
+package com.xintong.visualinspection.pojo;
+
+import com.xintong.visualinspection.bean.StatisticsBo;
+import lombok.Data;
+
+/**
+ * 文件名:UserRankingData
+ * 版本信息:日期:2017/7/27 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class UserRankingData {
+    private StatisticsBo lastP;
+    private StatisticsBo currentP;
+}

+ 20 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/CheckTaskPeriodService.java

@@ -0,0 +1,20 @@
+package com.xintong.visualinspection.service;
+
+import java.util.List;
+
+import com.xintong.visualinspection.bean.CheckTaskPeriod;
+
+/**
+ * 文件名:UserService
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+public interface CheckTaskPeriodService {
+   
+    public void insert(CheckTaskPeriod checkTaskPeriod);
+    public void update(CheckTaskPeriod checkTaskPeriod);
+    public void delete(Integer id);
+    public List<CheckTaskPeriod> select(CheckTaskPeriod checkTaskPeriod);
+    public List<CheckTaskPeriod> selectbytime(CheckTaskPeriod checkTaskPeriod);
+    public List<CheckTaskPeriod> selectbydatetime(CheckTaskPeriod checkTaskPeriod);
+
+}

+ 4 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/StatisticsService.java

@@ -12,6 +12,7 @@ import com.xintong.visualinspection.bean.StatisticsBean;
 import com.xintong.visualinspection.bean.StatisticsBo;
 import com.xintong.visualinspection.bean.StatisticsBo;
 import com.xintong.visualinspection.bean.StatisticsFsWork;
 import com.xintong.visualinspection.bean.StatisticsFsWork;
 import com.xintong.visualinspection.pojo.TaskAndScore;
 import com.xintong.visualinspection.pojo.TaskAndScore;
+import com.xintong.visualinspection.pojo.UserRankingData;
 
 
 /**
 /**
  * 
  * 
@@ -26,7 +27,9 @@ import com.xintong.visualinspection.pojo.TaskAndScore;
  *
  *
  */
  */
 public interface StatisticsService {
 public interface StatisticsService {
-   
+
+    public UserRankingData getEmployeeRankingData(StatisticsBean obj);
+
 	public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj);
 	public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj);
 	
 	
 	public List<StatisticsBean> getFeeStationCheckedScore(StatisticsBean obj);
 	public List<StatisticsBean> getFeeStationCheckedScore(StatisticsBean obj);

+ 65 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckTaskPeriodServiceImpl.java

@@ -0,0 +1,65 @@
+package com.xintong.visualinspection.service.impl;
+
+import java.util.List;
+
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.xintong.visualinspection.bean.CheckTaskPeriod;
+import com.xintong.visualinspection.dao.master.CheckTaskPeriodDao;
+import com.xintong.visualinspection.service.BaseService;
+import com.xintong.visualinspection.service.CheckTaskPeriodService;
+
+import lombok.Data;
+
+/**
+ * 文件名:UserServiceImpl
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Service
+@Data
+public class CheckTaskPeriodServiceImpl extends BaseService implements CheckTaskPeriodService {
+
+    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CheckTaskPeriodService.class);
+
+
+    @Autowired
+    private CheckTaskPeriodDao checkTaskPriodDao;
+
+   
+   
+
+	@Override
+	public void insert(CheckTaskPeriod checkTaskPeriod) {
+		checkTaskPriodDao.insert(checkTaskPeriod);
+	}
+
+	@Override
+	public void update(CheckTaskPeriod checkTaskPeriod) {
+		// TODO Auto-generated method stub
+		checkTaskPriodDao.update(checkTaskPeriod);
+	}
+
+	@Override
+	public void delete(Integer id) {
+		// TODO Auto-generated method stub
+		checkTaskPriodDao.delete((long)id);
+	}
+
+	@Override
+	public List<CheckTaskPeriod> select(CheckTaskPeriod checkTaskPeriod) {
+		// TODO Auto-generated method stub
+		return checkTaskPriodDao.select(checkTaskPeriod);
+	}
+
+	@Override
+	public List<CheckTaskPeriod> selectbytime(CheckTaskPeriod checkTaskPeriod) {
+		return checkTaskPriodDao.selectbytime(checkTaskPeriod);
+	}
+
+	@Override
+	public List<CheckTaskPeriod> selectbydatetime(CheckTaskPeriod checkTaskPeriod) {
+		return checkTaskPriodDao.selectbydatetime(checkTaskPeriod);
+	}
+}

+ 157 - 46
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -9,16 +9,14 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStream;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 
 
+import com.xintong.visualinspection.bean.*;
+import com.xintong.visualinspection.dao.master.CheckTaskPeriodDao;
+import com.xintong.visualinspection.pojo.UserRankingData;
 import org.jxls.common.Context;
 import org.jxls.common.Context;
 import org.jxls.util.JxlsHelper;
 import org.jxls.util.JxlsHelper;
 import org.jxls.util.Util;
 import org.jxls.util.Util;
@@ -26,15 +24,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import com.xintong.visualinspection.bean.CheckAppealStatistic;
-import com.xintong.visualinspection.bean.CheckmanStatisticsBean;
-import com.xintong.visualinspection.bean.Constant;
-import com.xintong.visualinspection.bean.FeeStation;
-import com.xintong.visualinspection.bean.Organ;
-import com.xintong.visualinspection.bean.StatisticsBean;
-import com.xintong.visualinspection.bean.StatisticsBo;
-import com.xintong.visualinspection.bean.StatisticsFsWork;
-import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.cluster.DepartmentDao;
 import com.xintong.visualinspection.dao.cluster.DepartmentDao;
 import com.xintong.visualinspection.dao.cluster.UserInfoDao;
 import com.xintong.visualinspection.dao.cluster.UserInfoDao;
 import com.xintong.visualinspection.dao.master.StatisticsDao;
 import com.xintong.visualinspection.dao.master.StatisticsDao;
@@ -62,10 +51,60 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 	@Autowired
 	@Autowired
 	private UserInfoDao userInfoDao;
 	private UserInfoDao userInfoDao;
 
 
+    @Autowired
+    private CheckTaskPeriodDao checkTaskPeriodDao;
+
+
+	@Override
+    public UserRankingData getEmployeeRankingData(StatisticsBean obj){
+        UserRankingData data = new UserRankingData();
+
+        List<CheckTaskPeriod> checkTaskPeriods = checkTaskPeriodDao.select(new CheckTaskPeriod());
+
+        CheckTaskPeriod lastTaskPeriod = null;
+//        计算上个周期时间   周期时间:00:00:00   ----- 00:00:00       参数:23:00:00
+        for (CheckTaskPeriod p:checkTaskPeriods
+             ) {
+            if(obj.getStart_date().getTime() > p.getStarttime().getTime() &&
+                    obj.getEnd_date().getTime() > p.getStarttime().getTime()){
+                lastTaskPeriod = p;
+                break;
+            }
+        }
+        if(lastTaskPeriod!=null){
+            StatisticsBean temp = new StatisticsBean();
+            temp.setStart_date(new Date(lastTaskPeriod.getStarttime().getTime() -1*1000*60*60));
+            temp.setEnd_date(new Date(lastTaskPeriod.getEndtime().getTime() -1*1000*60*60));
+            List<StatisticsBo> list = getEmployeeCheckedInfo(temp);
+            if(list==null||list.size()<1) return data;
+            for (StatisticsBo b:list
+                 ) {
+                if(b.getUser().getId().intValue() == obj.getUser_id().intValue()){
+                    data.setLastP(b);
+                    break;
+                }
+            }
+        }
+        List<StatisticsBo> list = getEmployeeCheckedInfo(obj);
+        if(list==null||list.size()<1) return data;
+        for (StatisticsBo b:list
+                ) {
+            if(b.getUser().getId().intValue() == obj.getUser_id().intValue()){
+                data.setCurrentP(b);
+                break;
+            }
+        }
+	    return data;
+    }
+
 	@Override
 	@Override
 	public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj) {
 	public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj) {
 		// 查看是否有部门id
 		// 查看是否有部门id
 		Long organId = obj.getDept_id();
 		Long organId = obj.getDept_id();
+		// 道管中心 id
+		Long parent_dept_id = obj.getParent_dept_id() ;
+		obj.setParent_dept_id(null);
+		obj.setDept_id(null);
 		// 将检索出来的数据放到如map中
 		// 将检索出来的数据放到如map中
 		List<StatisticsBean> list = statisticsDao.selectStatistics(obj);
 		List<StatisticsBean> list = statisticsDao.selectStatistics(obj);
 
 
@@ -148,7 +187,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 			}
 		});
 		});
 		// 道管Map
 		// 道管Map
+        //排名
 		Map<String, Integer> center_ranking = new HashMap<>();
 		Map<String, Integer> center_ranking = new HashMap<>();
+		//留last
 		Map<String, StatisticsBo> center_ranking2 = new HashMap<>();
 		Map<String, StatisticsBo> center_ranking2 = new HashMap<>();
 		center_ranking.put("30", 1);
 		center_ranking.put("30", 1);
 		center_ranking.put("31", 1);
 		center_ranking.put("31", 1);
@@ -172,36 +213,66 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			if(lists.get(i).getChecked_num() == 0 ){
 			if(lists.get(i).getChecked_num() == 0 ){
 				continue;
 				continue;
 			}
 			}
-			// 累计道管排名
-			String centerId = lists.get(i).getUser().getParent_organid().toString();
-			if (i > 0 && center_ranking2.get(centerId) != null
-					&& lists.get(i).compareTo(center_ranking2.get(centerId)) == 0) {
-				lists.get(i).setCenter_ranking(center_ranking2.get(centerId).getCenter_ranking());
-			} else {
-				lists.get(i).setCenter_ranking(center_ranking.get(centerId));
-				center_ranking2.put(centerId, lists.get(i));
-			}
-			center_ranking.put(centerId, center_ranking.get(centerId) + 1);
 
 
-			// 累计收费站的排名
-			String feeStationId = lists.get(i).getUser().getOrganid().toString();
-			if (i > 0 && fee_ranking2.get(feeStationId) != null
-					&& lists.get(i).compareTo(fee_ranking2.get(feeStationId)) == 0) {
-				lists.get(i).setFee_station_ranking(fee_ranking2.get(feeStationId).getFee_station_ranking());
-			} else {
-				lists.get(i).setFee_station_ranking(fee_ranking.get(feeStationId));
-				fee_ranking2.put(feeStationId, lists.get(i));
-			}
-			fee_ranking.put(feeStationId, fee_ranking.get(feeStationId) + 1);
-
-			// 公司排名
-			if (i > 0 && lists.get(i - 1).compareTo(lists.get(i)) == 0) {
-				lists.get(i).setCompany_ranking(lists.get(i - 1).getCompany_ranking());
-			} else {
-				lists.get(i).setCompany_ranking(i + 1);
+            StatisticsBo statisticsBo = lists.get(i);
+
+            // 累计道管排名
+			//获取道管id
+            String centerId = statisticsBo.getUser().getParent_organid().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 feeStationId = statisticsBo.getUser().getOrganid().toString();
+
+            if(fee_ranking2.get(feeStationId)==null){
+                statisticsBo.setFee_station_ranking(fee_ranking.get(feeStationId));
+            }else{
+                fee_ranking.put(feeStationId, fee_ranking.get(feeStationId) + 1);
+                if(statisticsBo.compareTo(fee_ranking2.get(feeStationId)) == 0){
+                    statisticsBo.setFee_station_ranking(fee_ranking2.get(feeStationId).getFee_station_ranking());
+                }else{
+                    statisticsBo.setFee_station_ranking(fee_ranking.get(feeStationId));
+                }
+            }
+            fee_ranking2.put(feeStationId, statisticsBo);
+
+            // 公司排名
+
+            if(i==0){
+                statisticsBo.setCompany_ranking(1);
+            }else{
+                StatisticsBo lastbo = lists.get(i-1);
+                if(statisticsBo.compareTo(lastbo)==0){
+                    statisticsBo.setCompany_ranking(lastbo.getCompany_ranking());
+                }else{
+                    statisticsBo.setCompany_ranking(i+1);
+                }
+
+            }
+            
+		}
+		// 这边进行赛选一下;
+		List<StatisticsBo> reList = new ArrayList<>();
+		for(int i=0; i<lists.size(); i++ ){
+			if(parent_dept_id ==null || lists.get(i).getUser().getParent_organid() == parent_dept_id+0 ){
+				if(organId ==null || lists.get(i).getUser().getOrganid() == organId+0){
+					reList.add(lists.get(i));
+				}
 			}
 			}
 		}
 		}
-		return lists;
+		
+		return reList;
 	}
 	}
 
 
 	@Override
 	@Override
@@ -790,6 +861,20 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 	public StatisticsBean getCheckedScoreInfo(StatisticsBean obj) {
 	public StatisticsBean getCheckedScoreInfo(StatisticsBean obj) {
 		int people_num = 0;
 		int people_num = 0;
 		StatisticsBean returnObj = new StatisticsBean();
 		StatisticsBean returnObj = new StatisticsBean();
+		
+		// 获取收费站信息收费站人数
+//		Constant t = CodeUtil.getCodeByFlagAndValue("feestation_check_jobs", "1");
+//		String[] postions = t.getCode_name().split(",");
+//		User user = new User();
+//		List<Integer> positionList = new ArrayList<Integer>();
+//		for (int i = 0; i < postions.length; i++) {
+//			positionList.add(Integer.parseInt(postions[i]));
+//		}
+//		// 检查人数 和 检查次数
+//		obj.setPosition_ids(positionList);
+//		// 检索受检人数
+//		List<StatisticsBean> checkedNumList =  statisticsDao.selectFeeStationCheckNum(obj);
+		
 		if (obj.getQueryType() == 0) {
 		if (obj.getQueryType() == 0) {
 			// 公司
 			// 公司
 			// 公司总人数
 			// 公司总人数
@@ -826,9 +911,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
 		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
 
 
 		for (StatisticsBean sta : userLostScoreInfoList) {
 		for (StatisticsBean sta : userLostScoreInfoList) {
-			if (sta.getAll_check_score() / sta.getChecked_num() <= 15) {
+			if (sta.getAll_check_score()  <= 15) {
 				returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
 				returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
-			} else if (sta.getAll_check_score() / sta.getChecked_num() <= 50) {
+			} else if (sta.getAll_check_score() <= 50) {
 				returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
 				returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
 			} else {
 			} else {
 				returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
 				returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
@@ -999,18 +1084,44 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		obj.setQueryType(2);
 		obj.setQueryType(2);
 		List<StatisticsBean> t_mthList = getPersonalScoreInfo(obj);
 		List<StatisticsBean> t_mthList = getPersonalScoreInfo(obj);
 		Map<Integer, StatisticsBean> t_map = new HashMap<>();
 		Map<Integer, StatisticsBean> t_map = new HashMap<>();
+		
+		int seq =0 ;
+		
 		for (int i = 0; i < t_mthList.size(); i++) {
 		for (int i = 0; i < t_mthList.size(); i++) {
-			t_mthList.get(i).setRanking(i);
+			if( i == 0 ){
+				seq = 0 	;		
+			}else{
+				if(t_mthList.get(i).compare2To(t_mthList.get(i-1)) == 0){
+					 ;
+				}else{
+					seq = i ;
+				}
+			}
+			t_mthList.get(i).setRanking(seq);	
 			t_map.put(t_mthList.get(i).getUser().getId(), t_mthList.get(i));
 			t_map.put(t_mthList.get(i).getUser().getId(), t_mthList.get(i));
 		}
 		}
+		
+		 seq = 0 ;
 		// 查询上一个月
 		// 查询上一个月
 		obj.setMth(obj.getPrev_mth());
 		obj.setMth(obj.getPrev_mth());
 		List<StatisticsBean> prev_mthList = getPersonalScoreInfo(obj);
 		List<StatisticsBean> prev_mthList = getPersonalScoreInfo(obj);
 		for (int i = 0; i < prev_mthList.size(); i++) {
 		for (int i = 0; i < prev_mthList.size(); i++) {
 			Integer uid = prev_mthList.get(i).getUser().getId();
 			Integer uid = prev_mthList.get(i).getUser().getId();
+			if(i == 0 ){
+				;
+			}else{
+				if(prev_mthList.get(i).compare2To(prev_mthList.get(i-1))==0){
+					;
+				}else{
+					seq = i ;
+				}
+			}
+			
 			if (t_map.containsKey(uid)) {
 			if (t_map.containsKey(uid)) {
-				t_map.get(uid).setRanking_change(i - t_map.get(uid).getRanking());
+				t_map.get(uid).setRanking_change(seq - t_map.get(uid).getRanking());
 			}
 			}
+			
+			
 		}
 		}
 
 
 		// 这边按照名词变化进行排名
 		// 这边按照名词变化进行排名

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1114 - 2643
VisualInspection_server/visual/visual.log


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است