MSI\liwei 7 лет назад
Родитель
Сommit
22bf05cd36
40 измененных файлов с 1582 добавлено и 281 удалено
  1. 3 2
      VisualInspection/fwq/js/statistics/assess_type.js
  2. 2 0
      VisualInspection/fwq/js/statistics/total_company_statistics.js
  3. 3 3
      VisualInspection/fwq/view/statistics/service_area_check_statistics.html
  4. 1 0
      VisualInspection/js/statistics/assess_type.js
  5. 28 1
      VisualInspection/qzd/js/other_check/other_check.js
  6. 118 69
      VisualInspection/qzd/js/statistics/assess_type.js
  7. 2 2
      VisualInspection/qzd/js/statistics/dept_check_statistics.js
  8. 11 9
      VisualInspection/qzd/js/statistics/operation_management_integration.js
  9. 160 0
      VisualInspection/qzd/js/statistics/qzd_check_statistics.js
  10. 1 1
      VisualInspection/qzd/js/statistics/service_area_check_statistics.js
  11. 15 10
      VisualInspection/qzd/js/statistics/service_area_data_statistics.js
  12. 62 53
      VisualInspection/qzd/js/statistics/total_company_statistics.js
  13. 2 1
      VisualInspection/qzd/js/task/new.js
  14. 4 4
      VisualInspection/qzd/view/other_check/onsite_check.html
  15. 1 1
      VisualInspection/qzd/view/statistics/assess_type.html
  16. 13 16
      VisualInspection/qzd/view/statistics/operation_management_integration.html
  17. 76 0
      VisualInspection/qzd/view/statistics/qzd_check_statistics.html
  18. 3 3
      VisualInspection/qzd/view/statistics/service_area_data_statistics.html
  19. 2 2
      VisualInspection/qzd/view/statistics/total_company_statistics.html
  20. 35 37
      VisualInspection/qzd/view/task/addtask.html
  21. 346 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_Q.java
  22. 2 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/StatisticsDao.java
  23. 18 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml
  24. 3 4
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/application.properties
  25. BIN
      Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/fwq_operation_info.xls
  26. 17 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/CheckNum.java
  27. 2 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqCheckOther.java
  28. 10 2
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBean.java
  29. 2 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/QzdRecord.java
  30. 110 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/WreckerStatisticsBO.java
  31. 58 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/StatisticsService_Q.java
  32. 1 0
      Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/util/CacheUtil.java
  33. 22 0
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/dao/QzdStatisticsDao.java
  34. 7 0
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/CheckApplylMapper.xml
  35. 3 3
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/RecordMapper.xml
  36. 165 1
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/StatisticsMapper.xml
  37. 1 0
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/TaskMapper.xml
  38. 244 45
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/service/impl/StatisticsServiceImpl.java
  39. 29 12
      Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/service/impl/StatisticsService_FImpl.java
  40. BIN
      Visuallnspection_qzd/src/main/resources/fwq_operation_info.xls

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

@@ -23,6 +23,7 @@ function queryTypeClick() {
     var url = "f/statistics/score/item/info";
     var strTbody = '';
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 管道中心受检人平均每人次扣分
         check_people_avg(data);
     }, function(error) {
@@ -62,8 +63,8 @@ function getHeadHtml(data) {
     var strHead = "";
     itemArray = data.itemList;
     var colspanNum = data.itemList.length + 1;
-    strHead += "<tr><th rowspan='2' width='6%'>道管整体排名</th><th rowspan='2' width='6%'>道管</th><th rowspan='2' width='6%'>管道内服务区排名</th>";
-    strHead += "<th rowspan='2' width='10%'>服务区</th><th rowspan='2' width='6%'>受检次数</th>";
+    strHead += "<tr><th rowspan='2' width='6%'>工号</th><th rowspan='2' width='6%'>岗位</th><th rowspan='2' width='6%'>管道内服务区排名</th>";
+    strHead += "<th rowspan='2' width='10%'>出警</th><th rowspan='2' width='6%'>受检次数</th>";
     strHead += "<th colspan=" + colspanNum + " height='40px'>存在问题扣分详情</th><th rowspan='2' width='6%'>管道中心受检服务区平均扣分(千分制)</th></tr><tr>";
     for(var i=0;i<data.itemList.length;i++){
         strHead += "<th width='55px'>"+data.itemList[i]+"</th>";

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

@@ -359,6 +359,7 @@ $(function() {
                 array_points.length = 0;
             }
         } else if (type == 3) {
+            console.log(data);
             array_road.length = 0;
             array_road_score.length = 0;
             for (var i = 0; i < data.length; i++) {
@@ -390,6 +391,7 @@ $(function() {
                 array_road_score_temp.push({ value: array_road_score[i], name: data[i].feeStationName })
             }
         } else if (type == 4) {
+            console.log(data);
             array_allStation_score.length = 0;
             array_allStation.length = 0;
             for (var i = 0; i < data.length; i++) {

+ 3 - 3
VisualInspection/fwq/view/statistics/service_area_check_statistics.html

@@ -90,9 +90,9 @@
                 <input type="text" id="end-score" class="form-control form-date" value="1000">
             </div>
         </div>
-        <div class="col-sm-2 ">
-            <button class="btn btn-info2 col-sm-6 query-company " id="searchbtn">查询</button>
-            <button class="btn btn-info2 col-sm-6 query-company " onclick="exportExcel()">导出</button>
+        <div class="col-sm-4 " style="float: right ;">
+            <button class="btn btn-info3 col-sm-3 query-company " style="float:right;margin-right: 25px;" onclick="exportExcel()">导出</button>
+            <button class="btn btn-info2 col-sm-3 query-company " style="float:right;margin-right: 25px;" id="searchbtn">查询</button>
         </div>
     </div>
 

+ 1 - 0
VisualInspection/js/statistics/assess_type.js

@@ -40,6 +40,7 @@ function queryTypeClick() {
     var url = "statistics/score/item/info";
     var strTbody = '';
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 管道中心受检人平均每人次扣分
         check_people_avg(data);
     }, function(error) {

+ 28 - 1
VisualInspection/qzd/js/other_check/other_check.js

@@ -106,6 +106,7 @@ $("#save-check").click(function() {
         var check_num = $("#check_num").val();
         var wrecker_check_type = $("#select-check-type").val();
         var special_check_type = $("#select-special-check-type").val();
+        var people = $("#select-personal").val();
         if (idUpdate) {
             if ($("#editImage").attr("file_src") != '') {
                 var src = $("#editImage").attr("file_src").split(",");
@@ -161,6 +162,9 @@ $("#save-check").click(function() {
         } else if (check_score == null || check_score == undefined || check_score == "") {
             layer.msg('请选择扣分值');
             return;
+        }else if(people == null || people == undefined || people == ""){
+            layer.msg('请选择考核人');
+            return;
         }
         data = {
             "id": check_id,
@@ -175,7 +179,8 @@ $("#save-check").click(function() {
             "check_time_name": check_time_name,
             "check_num": check_num,
             "wrecker_check_type": wrecker_check_type,
-            "special_check_type": special_check_type
+            "special_check_type": special_check_type,
+            "check_person_id":people
         }
         console.log(data);
         if (idUpdate) {
@@ -322,12 +327,14 @@ function updateCheckTeam(id) {
         // setPersonal(data.user_id);
         // $("#select-dept").val(data.dept_id);
         // $("#select-personal").val(data.user_id);
+        getdeptpeople(data.check_person_id);
         $("#check_item_select input").val(data.check_item_name);
         $("#remark").val(data.remark);
         $("#check_score").val(data.check_score);
         var time = data.check_time;
         $("#month_date2").val(data.check_time);
         $("#check_num").val(data.check_num);
+        $("#select-personal").val(data.check_num);
         setCheckTypeSelect('#select-check-type', data.wrecker_check_type, "wrecker_group_check_type");
         setCheckTypeSelect('#select-special-check-type', data.special_check_type, 'special_check_type');
         $("#editImage").empty();
@@ -1004,4 +1011,24 @@ function static() {
     //         });
     //     });
     // }
+}
+
+function getdeptpeople(id){
+    var dept = $("#select-dept").val();
+    var userData = {
+        "organid": dept
+    }
+    UserGetList(userData, function(data) {
+        console.log(data);
+        var str = '';
+       for(var index in data){
+          var obj = data[index];
+          str += "<option value='"+obj.id+"'>"+obj.truename+"</option>"
+       }
+       $("#select-personal").html(str);
+       if(id != 0){
+        $("#select-personal").val(id);
+       }
+    });
+
 }

+ 118 - 69
VisualInspection/qzd/js/statistics/assess_type.js

@@ -20,9 +20,10 @@ function queryTypeClick() {
         "start_date": start_date,
         "end_date": end_date,
     }
-    var url = "f/statistics/score/item/info";
+    var url = "q/statistics/score/item/info";
     var strTbody = '';
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 管道中心受检人平均每人次扣分
         check_people_avg(data);
     }, function(error) {
@@ -42,10 +43,11 @@ function initQueryType() {
         "start_date": start_date,
         "end_date": end_date,
     }
-    var url = "f/statistics/score/item/info";
+    var url = "q/statistics/score/item/info";
     var strTbody = '';
 
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 管道中心受检人平均每人次扣分
         check_people_avg(data);
     }, function(error) {
@@ -61,14 +63,21 @@ function initQueryType() {
 function getHeadHtml(data) {
     var strHead = "";
     itemArray = data.itemList;
-    var colspanNum = data.itemList.length + 1;
-    strHead += "<tr><th rowspan='2' width='6%'>道管整体排名</th><th rowspan='2' width='6%'>道管</th><th rowspan='2' width='6%'>管道内服务区排名</th>";
-    strHead += "<th rowspan='2' width='10%'>服务区</th><th rowspan='2' width='6%'>受检次数</th>";
-    strHead += "<th colspan=" + colspanNum + " height='40px'>存在问题扣分详情</th><th rowspan='2' width='6%'>管道中心受检服务区平均扣分(千分制)</th></tr><tr>";
-    for(var i=0;i<data.itemList.length;i++){
-        strHead += "<th width='55px'>"+data.itemList[i]+"</th>";
+    var colspanNum = data.itemlist[0].length+data.itemlist[1].length+ data.itemlist[2].length;
+    strHead += "<tr><th rowspan='3' width='3%'>单位</th><th rowspan='3' width='3%'>姓名</th><th rowspan='3' width='6%'>工号</th><th rowspan='3' width='3%'>岗位</th>";
+    strHead += "<th rowspan='3' width='3%'>出警次数</th><th rowspan='3' width='3%'>受检次数</th>";
+    strHead += "<th colspan=" + colspanNum + " height='40px'>考核情况</th><th rowspan='3' width='6%'>合计扣分</th><th rowspan='3' width='6%'>平均得分</th></tr><tr>";
+    strHead +="<th colspan=" + data.itemlist[0].length + " height='40px'>视频稽查</th><th colspan=" + data.itemlist[1].length + " height='40px'>暗访稽查</th><th colspan=" + data.itemlist[2].length + " height='40px'>现场检查</th></tr>"
+    strHead +="<tr>"
+    for(var i=0;i<data.itemlist.length;i++){
+        for(var j=0;j<data.itemlist[i].length;j++){
+            strHead += "<th width='55px'>"+data.itemlist[i][j]+"</th>";   
+        }
     }
-    strHead += "<th width='55px'>扣分合计</th></tr>";
+    // for(var i=0;i<data.itemList1.length;i++){
+    //     strHead += "<th width='55px'>"+data.itemList1[i]+"</th>";
+    // }
+    strHead += "</tr>";
     return strHead;
 }
 
@@ -78,69 +87,109 @@ function getHeadHtml(data) {
  * @param {*} i
  * @param {*} avg
  */
-function gethtml(data, i, organList, avg, lists) {
+function gethtml(data, i, itemlist, avg, lists) {
     var strTbody = "";
-    if (i == 0 || i == organList[0] || i == organList[1]) {
+    // if (i == 0 || i == organList[0] || i == organList[1]) {
 
-        var ranking;
-        var name = "";
-        var rowspan = 0;
-        order = 1;
-        if (i == 0) {
-            name = "连云港";
-            rowspan = organList[0];
-            ranking = rank[i];
-            for (var i = 0; i < lists.length; i++) {
-                if (avg > lists[i]) {
-                    order = order + 1;
-                }
+    //     var ranking;
+    //     var name = "";
+    //     var rowspan = 0;
+    //     order = 1;
+    //     if (i == 0) {
+    //         name = "连云港";
+    //         rowspan = organList[0];
+    //         ranking = rank[i];
+    //         for (var i = 0; i < lists.length; i++) {
+    //             if (avg > lists[i]) {
+    //                 order = order + 1;
+    //             }
+    //         }
+    //     } else if (i == organList[0]) {
+    //         name = "盐城";
+    //         rowspan = organList[1]-organList[0];
+    //         ranking = rank[i];
+    //         for (var i = 0; i < lists.length; i++) {
+    //             if (avg > lists[i]) {
+    //                 order = order + 1;
+    //             }
+    //         }
+    //     } else if (i == organList[1]) {
+    //         name = "南通";
+    //         rowspan = organList[2]-organList[1];
+    //         ranking = rank[i];
+    //         for (var i = 0; i < lists.length; i++) {
+    //             if (avg > lists[i]) {
+    //                 order = order + 1;
+    //             }
+    //         }
+    //     }
+    //     strTbody += "<tr><td rowspan=" + rowspan + " width='6%'>" + order + "</td><td rowspan=" + rowspan + " width='6%'>" + name + "</td>";
+    //     strTbody += "<td width='6%'>" + ranking + "</td><td width='10%'>" + data.name + "</td><td width='6%'>" + filter(data.checked_num, '0');
+    //     for (var i=0;i<itemArray.length;i++) {
+    //         strTbody += "</td><td width='55px'>" + getItemScore(data, itemArray[i]);
+    //     }
+    //     strTbody += "</td><td width='55px'>" + data.all_check_score + "</td><td rowspan=" + rowspan + " width='6%'>" + avg + "</td>";
+    //     strTbody += "</tr>";
+    // } else {
+    //     strTbody += "<tr><td>" + rank[i] + "</td>";
+    //     strTbody += "<td>" + data.name + "</td><td>" + filter(data.checked_num, '0');
+    //     for (var i=0;i<itemArray.length;i++) {
+    //         strTbody += "</td><td>" + getItemScore(data, itemArray[i]);
+    //     }
+    //     strTbody += "</td><td>" + data.all_check_score + "</td>";
+    //     strTbody += "</tr>";
+
+    // }
+      var obj = data;
+      strTbody += "<tr><td width='3%'>"+obj.user.organname+"</td><td width='3%'>"+obj.user.truename+"</td><td width='6%'>"+obj.user.workno+"</td><td width='3%'>"+obj.user.position_name+"</td>";
+      strTbody += "<td width='3%'>"+obj.check_s_num+"</td><td width='3%'>"+obj.check_t_num+"</td>";
+      for(var i = 0;i<itemlist[0].length;i++){
+          var score = 0;
+        //  console.log(obj.checked_socre_name.length);
+          for(var j =0;j<obj.checked_socre_name.length;j++){
+            //console.log(itemlist[0][i]);
+            if(itemlist[0][i] == obj.checked_socre_name[j]){
+                score = obj.checked_score[j];
             }
-        } else if (i == organList[0]) {
-            name = "盐城";
-            rowspan = organList[1]-organList[0];
-            ranking = rank[i];
-            for (var i = 0; i < lists.length; i++) {
-                if (avg > lists[i]) {
-                    order = order + 1;
-                }
+          }
+          strTbody +="<td width='55px'>"+score+"</td>"
+      }
+      for(var i = 0;i<itemlist[1].length;i++){
+        var score = 0;
+        //  console.log(obj.checked_socre_name.length);
+          for(var j =0;j<obj.third_socre_name.length;j++){
+            //console.log(itemlist[0][i]);
+            if(itemlist[1][i] == obj.third_socre_name[j]){
+                score = obj.third_score[j];
             }
-        } else if (i == organList[1]) {
-            name = "南通";
-            rowspan = organList[2]-organList[1];
-            ranking = rank[i];
-            for (var i = 0; i < lists.length; i++) {
-                if (avg > lists[i]) {
-                    order = order + 1;
-                }
+          }
+          strTbody +="<td width='55px'>"+score+"</td>"
+      }
+      for(var i = 0;i<itemlist[2].length;i++){
+        var score = 0;
+        //  console.log(obj.checked_socre_name.length);
+          for(var j =0;j<obj.onsite_socre_name.length;j++){
+            //console.log(itemlist[0][i]);
+            if(itemlist[2][i] == obj.onsite_socre_name[j]){
+                score = obj.onsite_score[j];
             }
-        }
-        strTbody += "<tr><td rowspan=" + rowspan + " width='6%'>" + order + "</td><td rowspan=" + rowspan + " width='6%'>" + name + "</td>";
-        strTbody += "<td width='6%'>" + ranking + "</td><td width='10%'>" + data.name + "</td><td width='6%'>" + filter(data.checked_num, '0');
-        for (var i=0;i<itemArray.length;i++) {
-            strTbody += "</td><td width='55px'>" + getItemScore(data, itemArray[i]);
-        }
-        strTbody += "</td><td width='55px'>" + data.all_check_score + "</td><td rowspan=" + rowspan + " width='6%'>" + avg + "</td>";
-        strTbody += "</tr>";
-    } else {
-        strTbody += "<tr><td>" + rank[i] + "</td>";
-        strTbody += "<td>" + data.name + "</td><td>" + filter(data.checked_num, '0');
-        for (var i=0;i<itemArray.length;i++) {
-            strTbody += "</td><td>" + getItemScore(data, itemArray[i]);
-        }
-        strTbody += "</td><td>" + data.all_check_score + "</td>";
-        strTbody += "</tr>";
-
-    }
+          }
+          strTbody +="<td width='55px'>"+score+"</td>"
+      }
+      count = obj.all_check_score+obj.third_total_score+obj.onsite_total_score;
+     // strTbody +="<th colspan=" + itemlist[0].length + " height='40px'>视频稽查</th><th colspan=" + itemlist[1].length + " height='40px'>暗访稽查</th><th colspan=" + itemlist[2].length + " height='40px'>现场检查</th>"
+      strTbody +="<th width='6%'>"+count+"</th><th width='6%'>0</th>"
+      strTbody +="</tr>"
     return strTbody;
 }
 
 function getTotalHtml(data) {
-    var html = "<tr><td>合计</td><td></td><td></td><td></td><td>" + data.totalcheckedCount;
-        for (var i=0;i<itemArray.length;i++) {
-            html += "</td><td>" + getTotalScore(data, itemArray[i]);
-        }
-        html += "</td><td>" + data.totalAll + "</td><td>-</td></tr>";
-    return html;
+    // var html = "<tr><td>合计</td><td></td><td></td><td></td><td>" + data.totalcheckedCount;
+    //     for (var i=0;i<itemArray.length;i++) {
+    //         html += "</td><td>" + getTotalScore(data, itemArray[i]);
+    //     }
+    //     html += "</td><td>" + data.totalAll + "</td><td>-</td></tr>";
+    // return html;
 }
 
 /**
@@ -199,15 +248,15 @@ function check_people_avg(data) {
 
     // 道管下的服务区排名
     ranking_method(list,organArray);
-    for (i = 0; i < list.length; i++) {
+    for (i = 0; i < data.list.length; i++) {
         if (i == 0) {
-            $(".table-tbody").append(gethtml(list[i], i, organArray, dataArray[0], dataArray));
+            $(".table-tbody").append(gethtml(list[i], i, data.itemlist, dataArray[0], dataArray));
         } else if (i == organArray[0]) {
-            $(".table-tbody").append(gethtml(list[i], i, organArray, dataArray[1], dataArray));
+            $(".table-tbody").append(gethtml(list[i], i, data.itemlist, dataArray[1], dataArray));
         } else if (i == organArray[1]) {
-            $(".table-tbody").append(gethtml(list[i], i, organArray, dataArray[2], dataArray));
+            $(".table-tbody").append(gethtml(list[i], i, data.itemlist, dataArray[2], dataArray));
         } else {
-            $(".table-tbody").append(gethtml(list[i], i, organArray));
+            $(".table-tbody").append(gethtml(list[i], i, data.itemlist));
         }
     }
     $(".table-tbody").append(getTotalHtml(data));
@@ -330,5 +379,5 @@ function exportExcel() {
     var t = getTimeByMonth($("#start-time").val());
     var start_date = getMomentTimeFormat(t.starttime);
     var end_date = getMomentTimeFormat(t.endtime);
-    window.open(getExcelServeraddr() + "f/file/score/item/info?start_date=" + start_date + "&end_date=" + end_date);
+    window.open(getQzdExcelServeraddr() + "q/file/score/item/info?start_date=" + start_date + "&end_date=" + end_date);
 }

+ 2 - 2
VisualInspection/qzd/js/statistics/dept_check_statistics.js

@@ -39,7 +39,7 @@ function exportExcel() {
         tip("请选择起止日期");
         return;
     }
-    window.open(getExcelServeraddr() + "f/file/dept/static/excel?start_date=" + start_date + "&end_date=" + end_date);
+    window.open(getQzdExcelServeraddr() + "q/file/dept/static/excel?start_date=" + start_date + "&end_date=" + end_date);
 }
 
 
@@ -58,7 +58,7 @@ function getdeptscore(starttime, endtime) {
     };
 
     //获取该人员排班
-    var url = "f/statistics/dept";
+    var url = "q/statistics/dept";
     
     post_common_service(url, data_p, function(data) {
 

+ 11 - 9
VisualInspection/qzd/js/statistics/operation_management_integration.js

@@ -20,9 +20,10 @@ function queryTypeClick() {
         "start_date": start_date,
         "end_date": end_date,
     }
-    var url = "f/statistics/operation/manage/integration";
+    var url = "q/statistics/operation/manage/integration";
     var strTbody = '';
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 运营管理综合检查情况
         check_operation_avg(data);
     }, function(error) {
@@ -41,10 +42,11 @@ function initQueryType() {
         "start_date": start_date,
         "end_date": end_date,
     }
-    var url = "f/statistics/operation/manage/integration";
+    var url = "q/statistics/operation/manage/integration";
     var strTbody = '';
 
     post_common_service(url, param, function(data) {
+        console.log(data);
         // 运营管理综合检查情况
         check_operation_avg(data);
     }, function(error) {
@@ -61,10 +63,10 @@ function initQueryType() {
  */
 function gethtml(data, i, avg, lists) {
     var strTbody = "";
-
-    strTbody += "<tr><td width='8%'>" + data.company_ranking2 + "</td>";
-    strTbody += "<td width='8%'>" + data.name + "</td><td width='6%'>" + data.company_check_num +
-        "</td><td width='6%'>" + data.company_total_score + "</td><td width='6%'>" + data.third_check_num +
+    var i= i+1;
+    strTbody += "<tr><td width='8%'>" + i + "</td>";
+    strTbody += "<td width='8%'>" + data.name + "</td><td width='8%'>" + lists + "</td><td width='8%'>" + data.check_t_num + "</td><td width='6%'>" + data.other_check_num +
+        "</td><td width='6%'>" + data.company_check_num + "</td><td width='6%'>" + data.third_check_num +"<td width='6%'>" + data.company_total_score + "</td>"+"<td width='6%'>" + data.third_check_num + "</td>"+
         "</td><td width='6%'>" + data.third_total_score + "</td><td width='6%'>" + data.onsite_check_num +
         "</td><td width='6%'>" + data.onsite_total_score + "</td><td width='8%'>" +
         data.check_total_avg + "</td>" +
@@ -74,7 +76,7 @@ function gethtml(data, i, avg, lists) {
 }
 
 function getTotalHtml(data) {
-    var html = "<tr><td>合计</td><td></td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyScore + "</td><td>" +
+    var html = "<tr><td>合计</td><td></td><td width='8%'>" + "1" + "</td><td width='8%'>" + "1" + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyScore + "</td><td>" +
         data.totalThirdNum + "</td><td>" + data.totalThirdScore + "</td><td>" + data.totalOnsiteNum + "</td><td>" + data.totalOnsiteScore +
          "</td><td>-</td><td>-</td></tr>";
     return html;
@@ -110,7 +112,7 @@ function check_operation_avg(data) {
     }
 
     for (i = 0; i < list.length; i++) {
-        $(".table-tbody").append(gethtml(list[i], i, dataArray[0], dataArray));
+        $(".table-tbody").append(gethtml(list[i], i, dataArray[0], data.deptList[i]));
     }
     $(".table-tbody").append(getTotalHtml(data));
 }
@@ -158,5 +160,5 @@ function exportExcel() {
     var t = getTimeByMonth($("#start-time").val());
     var start_date = getMomentTimeFormat(t.starttime);
     var end_date = getMomentTimeFormat(t.endtime);
-    window.open(getExcelServeraddr() + "f/file/operation/manage/integration?start_date=" + start_date + "&end_date=" + end_date);
+    window.open(getQzdExcelServeraddr() + "q/file/operation/manage/integration?start_date=" + start_date + "&end_date=" + end_date);
 }

+ 160 - 0
VisualInspection/qzd/js/statistics/qzd_check_statistics.js

@@ -0,0 +1,160 @@
+var lianyungang_Station = new Array;
+var yancheng_Station = new Array;
+var nantong_Station = new Array;
+var r1 = new Array();
+var r2 = new Array();
+var r3 = new Array();
+var rank = new Array();
+/**
+ * 点击查询
+ */
+function queryTypeClick() {
+    //每次点击前清空表格数据
+    $(".table-tbody").empty('');
+    var t = getTimeByMonth($("#start-time").val());
+    var start_date = getMomentTimeFormat(t.starttime);
+    var end_date = getMomentTimeFormat(t.endtime);
+   
+    var param = {
+        "dept_id": $("#fsList").val(),
+        "start_date": start_date,
+        "end_date": end_date,
+    }
+    var url = "q/statistics/one/qzd/checknum";
+    var strTbody = '';
+    post_common_service(url, param, function(data) {
+        // 运营管理综合检查情况
+        check_operation_avg(data);
+    }, function(error) {
+        return "";
+    });
+}
+
+/**
+ * 表格初始化
+ */
+function initQueryType() {
+    var t = getTimeByMonth($("#start-time").val());
+    var start_date = getMomentTimeFormat(t.starttime);
+    var end_date = getMomentTimeFormat(t.endtime);
+    var param = {
+        "start_date": start_date,
+        "end_date": end_date,
+    }
+    var url = "q/statistics/one/qzd/checknum";
+    var strTbody = '';
+
+    post_common_service(url, param, function(data) {
+        console.log(data);
+        // 运营管理综合检查情况
+        check_operation_avg(data);
+    }, function(error) {
+        return "";
+    });
+
+}
+
+/**
+ * 表格拼接及数据传入
+ * @param {*} data
+ * @param {*} i
+ * @param {*} avg
+ */
+function gethtml(data, i, avg, lists) {
+    var strTbody = "";
+    var i= i+1;
+    strTbody += "<tr><td width='12.5%'>" + i + "</td>";
+    strTbody += "<td width='12.5%'>" + data.deptName + "</td><td width='12.5%'>" + data.recordNum + "</td><td width='12.5%'>" + data.taskNum
+    + "</td><td width='12.5%'>" + data.isApplyNunm +
+        "</td><td width='12.5%'>" + data.videosNum + "</td><td width='12.5%'>" + data.picsNum +"</td><td width='12.5%'></td>";
+    strTbody += "</tr>";
+    return strTbody;
+}
+
+function getTotalHtml(data) {
+    // var html = "<tr><td>合计</td><td></td><td width='8%'>" + "1" + "</td><td width='8%'>" + "1" + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyNum + "</td><td>" + data.totalCompanyScore + "</td><td>" +
+    //     data.totalThirdNum + "</td><td>" + data.totalThirdScore + "</td><td>" + data.totalOnsiteNum + "</td><td>" + data.totalOnsiteScore +
+    //      "</td><td>-</td><td>-</td></tr>";
+    // return html;
+}
+
+/**
+ * 管道中心受检人平均每人次扣分
+ * @param {*} data
+ */
+function check_operation_avg(data) {
+    var list = data;
+    var dataArray = new Array();
+    var sum = 0;
+    var sum1 = 0;
+    for (k = 0; k < list.length; k++) {
+        sum = parseFloat(sum) + parseFloat(list[k].check_total_avg);
+        sum1++;
+        if (k == 6) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+        if (k == 12) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+        if (k == 20) {
+            dataArray.push(filterJudge(sum, sum1));
+            sum = 0;
+            sum1 = 0;
+        }
+    }
+
+    for (i = 0; i < list.length; i++) {
+        $(".table-tbody").append(gethtml(list[i], i));
+    }
+    $(".table-tbody").append(getTotalHtml(data));
+}
+
+/**
+ * 过滤undefined
+ * @param {*} value
+ * @param {*} default_display_value
+ */
+function filter(value, default_display_value) {
+    if (value != '' && value != undefined) {
+        return value;
+    } else if (default_display_value != undefined) {
+        return default_display_value;
+    } else {
+        return "";
+    }
+}
+
+/**
+ * 过滤除数为0和保留二位小数时出现的0.00
+ * @param {*} value
+ * @param {*} default_display_value
+ */
+function filterByZeroHandle(value, default_display_value) {
+    if (isNaN(value)) {
+        return default_display_value;
+    } else {
+        if ((value + '').endsWith('.00')) {
+            return value.substring(0, value.length - 3);
+        }
+        return value;
+    }
+}
+
+function filterJudge(num1, num2) {
+    if (num2 == 0) {
+        return 0;
+    } else {
+        return (num1 / num2).toFixed(2);
+    }
+}
+
+function exportExcel() {
+    var t = getTimeByMonth($("#start-time").val());
+    var start_date = getMomentTimeFormat(t.starttime);
+    var end_date = getMomentTimeFormat(t.endtime);
+    window.open(getQzdExcelServeraddr() + "q/file/operation/manage/integration?start_date=" + start_date + "&end_date=" + end_date);
+}

+ 1 - 1
VisualInspection/qzd/js/statistics/service_area_check_statistics.js

@@ -51,7 +51,7 @@ function getscore(starttime, endtime, limitnumber, limitscore, limitscore2) {
     };
 
     //获取该人员排班
-    var url = "f/statistics/user/score";
+    var url = "q/statistics/user/score";
 
     post_common_service(url, data_p, function(data) {
 

+ 15 - 10
VisualInspection/qzd/js/statistics/service_area_data_statistics.js

@@ -75,9 +75,9 @@ $(function() {
             "end_date": end_date,
             "dept_id": dept_id
         }
-        var url_t = "f/statistics/employee/order/detail"
+        var url_t = "q/statistics/employee/order/detail"
         post_common_service(url_t, data_t, function(res) {
-
+            console.log(res);
             $("#c_com_ranking").html("-");
             $("#c_score_ranking").html("-");         
             $("#l_com_ranking").html("-");
@@ -163,7 +163,7 @@ $(function() {
                     // { width: 80, text: '扣分人', flex: true, colClass: 'text-center', field: 'checked_name' },
                     {
                         width: 100,
-                        text: '服务区',
+                        text: '清障队',
                         flex: true,
                         colClass: 'text-center',
                         field: 'dept_id',
@@ -181,7 +181,7 @@ $(function() {
                 }
                 $('#personal_data_table').mytable({
                     'cols': cols,
-                    'url': "f/statistics/one/checkedItem/detail/info",
+                    'url': "q/statistics/one/checkedItem/detail/info",
                     'param': data
                 });
             }
@@ -214,9 +214,9 @@ $(function() {
         var end_date = getMomentTimeFormat(t.endtime);
         
         // 查询图一
-        init_personal_score_statistics("f/statistics/one/serviceArea/year/info", dept_id);
+        init_personal_score_statistics("q/statistics/one/serviceArea/year/info", dept_id);
         // 查询图二
-        init_personal_check_type("f/statistics/one/serviceArea/checkedItem/info", dept_id, start_date, end_date);
+        init_personal_check_type("q/statistics/one/serviceArea/checkedItem/info", dept_id, start_date, end_date);
         // 表格
         initAppealPage(start_date, end_date, dept_id);
         // 加载图配置
@@ -401,9 +401,14 @@ $(function() {
     // if (roleContains("ROAD_MANAGER")) {
     //     roadManager = getCurrentUser().organid;
     // }
-    var feeList = $.zui.store.get("cache_service_area_list");
+    var feeList = $.zui.store.get("cache_wrecker_group_list");
     // if (roadManager) feeList = cache_road_manager_fee_list_map.get(roadManager);
-    setSASelectValueNoAll2(feeList, "#select-dept", dept);
+   // setSASelectValueNoAll2(feeList, "#select-dept", dept);
+//    var checked_dept;
+//    if (roleContains("WRECKER")) {
+//     checked_dept = getCurrentUser().organid;
+// }
+    setWreckerGroupSelect("#select-dept");
 
     getInit();
     // setSecond();
@@ -460,8 +465,8 @@ $(function() {
         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);
+        init_personal_score_statistics("q/statistics/one/serviceArea/year/info", dept_id);
+        init_personal_check_type("q/statistics/one/serviceArea/checkedItem/info", dept_id, start_date, end_date);
     }
 
 

+ 62 - 53
VisualInspection/qzd/js/statistics/total_company_statistics.js

@@ -74,15 +74,15 @@ $(function() {
         init_company_year_assess(select_month.split('/')[0], select_month.split('/')[1]);
         // 查询图二
         //	init_company_points_assess("statistics/lost/score/rate",select_month+'');
-        init_company_points_assess("f/statistics/score/info", select_month.split('/')[0], select_month.split('/')[1]);
-        // 查询图三
-        init_road_manager_score_rank_three("f/statistics/score/center/manage/info", select_month + '');
-        // 查询图四
-        init_stationAll_rank_four("f/statistics/score/tollgate/info", select_month + '');
-        // 查询图五
-        init_server_check_type_five("f/statistics/lost/itemscore/rate", select_month + "");
-        // 查询图六
-        init_each_people_points_six("f/statistics/lost/twice/itemscore/rate", select_month + "");
+         init_company_points_assess("q/statistics/score/info", select_month.split('/')[0], select_month.split('/')[1]);
+        // // 查询图三
+        init_road_manager_score_rank_three("q/statistics/score/center/manage/info", select_month + '');
+        // // 查询图四
+        init_stationAll_rank_four("q/statistics/score/tollgate/info", select_month + '');
+        // // 查询图五
+        init_server_check_type_five("q/statistics/lost/itemscore/rate", select_month + "");
+        // // 查询图六
+        init_each_people_points_six("q/statistics/lost/twice/itemscore/rate", select_month + "");
     }
     /**
      * 初始化图一
@@ -107,7 +107,7 @@ $(function() {
         }
 
 
-        initRqueset("f/statistics/score/year/info", param, 1);
+        initRqueset("q/statistics/score/year/info", param, 1);
 
     }
     // init_company_year_assess();
@@ -314,57 +314,48 @@ $(function() {
             else
                 min_year = eval("Math.min(" + array_year_score.toString() + ")").toFixed(0) - 10;
         } else if (type == 2) {
-            // 获得各个道管下面所有服务区的数量
-            debugger
-            var organList = data.organList;
-            var organArray = new Array();
-            var organCount = 0;
-            for (h = 0; h < organList.length; h++) {
-                organCount += organList[h].sacount;
-                organArray.push(organCount);
-            }
-
             array_points2 = [];
             array_points = [];
-            // console.log(data);
+             console.log(data);
             if (data != null) {
-                array_points.push({ "value": (data.total0), "name": '满分', "itemStyle": { "normal": { "color": '#48CCCD' } } });
-                array_points.push({ "value": data.total15, "name": '0-15分', "itemStyle": { "normal": { "color": '#38ACEC' } } });
-                array_points.push({ "value": data.total50, "name": '15-50分', "itemStyle": { "normal": { "color": '#FFD801' } } });
-                array_points.push({ "value": data.totalOver50, "name": '50分以上', "itemStyle": { "normal": { "color": '#7F38EC' } } });
-                var temp = [0, 0, 0];
+                array_points.push({ "value": (data.total0), "name": '满分', "area":data.total0Area, "itemStyle": { "normal": { "color": '#48CCCD' } } });
+                array_points.push({ "value": data.total15, "name": '0-15分', "area":data.total15Area, "itemStyle": { "normal": { "color": '#38ACEC' } } });
+                array_points.push({ "value": data.total50, "name": '15-50分', "area":data.total50Area, "itemStyle": { "normal": { "color": '#FFD801' } } });
+                array_points.push({ "value": data.totalOver50, "name": '50分以上', "area":data.totalOver50Area, "itemStyle": { "normal": { "color": '#7F38EC' } } });
+                // var temp = [0, 0, 0];
 
                 // 满分
-                for (var i = 0; i < data.list.length; i++) {
-                    if (i < organArray[0]) {
-                        temp[0] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    } else if (i < organArray[1]) {
-                        temp[1] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    } else if (i < organArray[2]) {
-                        temp[2] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
-                    }
-                }
-                if (temp[0] != 0) {
-                    array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
-                }
-                if (temp[1] != 0) {
-                    array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": '#3EA99F' } } });
-                }
-                if (temp[2] != 0) {
-                    array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": '#008080' } } });
-                }
-                pushDate(data, organArray, 'score_fifteen', '0-15分');
-                pushDate(data, organArray, 'score_fifty', '15-50分');
-                pushDate(data, organArray, 'score_over_fifty', '50分以上');
+                // for (var i = 0; i < data.list.length; i++) {
+                //     if (i < organArray[0]) {
+                //         temp[0] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     } else if (i < organArray[1]) {
+                //         temp[1] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     } else if (i < organArray[2]) {
+                //         temp[2] += data.list[i].checked_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
+                //     }
+                // }
+                // if (temp[0] != 0) {
+                //     array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
+                // }
+                // if (temp[1] != 0) {
+                //     array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": '#3EA99F' } } });
+                // }
+                // if (temp[2] != 0) {
+                //     array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": '#008080' } } });
+                // }
+                // pushDate(data, organArray, 'score_fifteen', '0-15分');
+                // pushDate(data, organArray, 'score_fifty', '15-50分');
+                // pushDate(data, organArray, 'score_over_fifty', '50分以上');
             } else {
                 array_points.length = 0;
             }
         } else if (type == 3) {
+            console.log(data);
             array_road.length = 0;
             array_road_score.length = 0;
             for (var i = 0; i < data.length; i++) {
                 if (data != '') {
-                    array_road_score.push((1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, 1.0, 0))));
+                    array_road_score.push(1000 - (filter_handlernew(data[i].all_check_score, data[i].checked_num,data[i].onsite_total_score,data[i].third_total_score)));
                 } else {
                     array_road.length = 0;
                     array_road_score.length = 0;
@@ -395,8 +386,15 @@ $(function() {
             array_allStation.length = 0;
             for (var i = 0; i < data.length; i++) {
                 if (data != '' && data.length != 0) {
-
-                    array_allStation_score.push((1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, 1.0, 0))));
+                    var onsite_total_score = 0;
+                    if(data[i].onsite_total_score){
+                        onsite_total_score =   data[i].onsite_total_score
+                    }
+                    var third_total_score = 0;
+                    if(data[i].third_total_score){
+                        third_total_score =   data[i].third_total_score
+                    }
+                    array_allStation_score.push((1000 - (filter_handlernew(data[i].all_check_score, data[i].checked_num,onsite_total_score,third_total_score))));
                 } else {
                     array_allStation_score.length = 0;
                     array_allStation.length = 0;
@@ -420,7 +418,7 @@ $(function() {
             }
             array_allStation_score_temp = new Array();
             for (var i = 0; i < array_allStation_score.length; i++) {
-                array_allStation.push(data[i].feeStationName.substr(0, data[i].feeStationName.length - 3) + "\n" + (rank[i]));
+                array_allStation.push(data[i].feeStationName+(rank[i]));
                 array_allStation_score_temp.push({ value: array_allStation_score[i], name: data[i].feeStationName })
             }
         } else if (type == 5) {
@@ -443,6 +441,7 @@ $(function() {
                 array_check_type.length = 0;
             }
         } else if (type == 6) {
+            console.log(date);
             array_all_deptname = new Array();
             map_month_data = new HashMap();
             map_per_data = new HashMap();
@@ -461,6 +460,7 @@ $(function() {
     }
 
     function data_each_people_points(data) {
+        console.log(data);
         var flag = false;
         var name = data.itemList;
         array_all_name = name;
@@ -549,6 +549,15 @@ $(function() {
         }
     }
 
+    function filter_handlernew(num, num1, num2, num4) {
+        if (num1 == 0 || num2 == 0) {
+            console.log(num2*0.4+num4*0.2);
+            return num2*0.4+num4*0.2;
+        } else {
+          var i = ((num / num1) * 0.4)+num2*0.4+num4*0.2;
+            return ((num / num1) * 0.4)+num2*0.4+num4*0.2;
+        }
+    }
     /**
      * 图配置
      */
@@ -822,7 +831,7 @@ $(function() {
                 }
             },
             legend: {
-                data: ['公司全体服务区得分']
+                data: ['公司全体清障队得分']
             },
             calculable: true,
             xAxis: [{
@@ -838,7 +847,7 @@ $(function() {
                 max: 1000
             }],
             series: [{
-                name: '公司全体服务区得分',
+                name: '公司全体清障队得分',
                 type: 'bar',
                 data: array_allStation_score_temp,
                 itemStyle: {

+ 2 - 1
VisualInspection/qzd/js/task/new.js

@@ -411,7 +411,8 @@ function saveMonitor(id){
       "id":id,
       "monitor": $("#select"+id).val(),
       "vice_monitor":$("#vselect"+id).val(),
-      "isComplete":1
+      "isComplete":1,
+      "isApply":0
   }
   post_common_service('q/record/update', data, function(redata) {
     layer.msg('已添加', { icon: 1 });

+ 4 - 4
VisualInspection/qzd/view/other_check/onsite_check.html

@@ -59,13 +59,13 @@
             <div style="width:100%;margin-top:20px;overflow:hidden;zoom:1;">
                 <div style="width:100%;margin-top:10px;overflow:hidden;zoom:1;">
                     <div style="width:80px;float:left;">
-                        <span style="line-height:32px;">选择清障队</span>
+                        <span style="line-height:32px;">选择人员</span>
                     </div>
                     <div style="width:260px;float:left;">
-                        <div class="div-select"><select class="form-control" id="select-dept"></select></button>
+                        <div class="div-select"><select class="form-control" id="select-dept" onchange="getdeptpeople(0)"></select></button>
+                        </div>
+                        <div class="div-select"><select class="form-control" id="select-personal"></select></button>
                         </div>
-                        <!-- <div class="div-select"><select class="form-control" id="select-personal"></select></button>
-                        </div> -->
                     </div>
                 </div>
                 <div style="width:100%;margin-top:10px;">

+ 1 - 1
VisualInspection/qzd/view/statistics/assess_type.html

@@ -25,7 +25,7 @@
             </div>
         </form>
     </div>
-    <div class="table-title"><span>温馨服务检查情况统计表</span></div>
+    <div class="table-title"><span>清障生产人员业务提升考核情况反馈表</span></div>
 
     <div class="row">
         <!-- 使用一个div来显示数据表格 -->

+ 13 - 16
VisualInspection/qzd/view/statistics/operation_management_integration.html

@@ -31,26 +31,23 @@
                     <thead>
                         <tr>
                             <!--<th rowspan="3" width="6%">排名</th><th rowspan="3" width="6%">道管</th>-->
-                            <th rowspan="3" width="8%">排名</th>
+                            <th rowspan="2" width="8%">序号</th>
                             <!--<th rowspan="3" width="6%">道管内排名</th>-->
-                            <th rowspan="3" width="8%">服务区</th>
-                            <th colspan="4" width="24%" height="40px">温馨服务</th>
+                            <th rowspan="2" width="8%">清障队</th>
+                            <th rowspan="2" width="8%">在岗人数</th>
+                            <th rowspan="2" width="8%">受捡人数</th>
+                            <!-- <th colspan="4" width="24%" height="40px">温馨服务</th> -->
+                            <th colspan="4" width="24%" height="40px">视频检查</th>
+                            <th colspan="2" width="12%" height="40px">第三方暗访</th>
                             <th colspan="2" width="12%" height="40px">现场检查</th>
                             <th rowspan="3" width="8%">总平均扣分</th>
                             <th rowspan="3" width="8%">平均得分</th>
-                        </tr>
-                        <tr>
-                            <th colspan="2">公司检查</th>
-                            <th colspan="2">第三方暗访</th>
-                            <th rowspan="2" width="54px">受检次数</th>
-                            <th rowspan="2" width="54px">扣分合计</th>
-                        </tr>
-                        <tr>
-                            <th width="54px">受检次数</th>
-                            <th width="54px">扣分合计</th>
-                            <th width="54px">受检次数</th>
-                            <th width="54px">扣分合计</th>
-                        </tr>
+                            </tr>
+                            <tr> 
+                            <th width="54px">清障次数</th><th width="54px">受检次数</th><th width="54px">平均受检次数</th><th width="54px">扣分合计</th>
+                            <th width="54px">受检次数</th><th width="54px">扣分合计</th>
+                            <th width="54px">受检次数</th><th width="54px">扣分合计</th>
+                            </tr>
                     </thead>
                     <!-- <tbody class="table-tbody" style="background:white" align="center">
                

+ 76 - 0
VisualInspection/qzd/view/statistics/qzd_check_statistics.html

@@ -0,0 +1,76 @@
+<!--服务区-营运管理综合检查情况统计-->
+<script src="/qzd/js/statistics/qzd_check_statistics.js"></script>
+<link rel="stylesheet" type="text/css" href="/css/statistics/assess_situation.css?__inline">
+<div class="container-fluid ">
+    <div class="form-div">
+        <form class="form-horizontal">
+            <div class="form-group">
+                <div class="from-label"><label>查询日期</label></div>
+                <div class="col-sm-2">
+                    <input type="text" id="start-time" class="form-control form-date" placeholder="选择月份">
+                </div>
+                <!-- <div class="col-sm-2">
+                    <input type="text" id="end-time" class="form-control form-date" placeholder="结束日期">
+                </div> -->
+                <div class="col-sm-1">
+                    <button class="btn btn-primary " type="button" onclick="queryTypeClick()">查询</button>
+                </div>
+                <div class="col-sm-1">
+                    <button class="btn btn-primary " type="button" onclick="exportExcel()">导出Excel</button>
+                </div>
+            </div>
+        </form>
+    </div>
+    <div class="table-title"><span>运营管理综合检查情况统计表</span></div>
+
+    <div class="row">
+        <!-- 使用一个div来显示数据表格 -->
+        <div class="datatable" data-checkable="false" data-sortable="false" style="margin-bottom:0px;">
+            <div class="table-head">
+                <table border="1" width="100%" height="90px" align="center">
+                    <thead>
+                        <tr style="height: 40px;">
+                            <!--<th rowspan="3" width="6%">排名</th><th rowspan="3" width="6%">道管</th>-->
+                            <th  width="12.5%">序号</th>
+                            <!--<th rowspan="3" width="6%">道管内排名</th>-->
+                            <th  width="12.5%">清障队</th>
+                            <th  width="12.5%">出警次数</th>
+                            <th  width="12.5%">受捡次数</th>
+                            <th  width="12.5%">放空次数</th>
+                            <!-- <th colspan="4" width="24%" height="40px">温馨服务</th> -->
+                            <th  width="12.5%">未上传视频(图片)数量</th>
+                            <th  width="12.5%">上传图片数量</th>
+                            <th  width="12.5%">备注</th>
+                            </tr>
+                    </thead>
+                    <!-- <tbody class="table-tbody" style="background:white" align="center">
+               
+                    </tbody> -->
+                </table>
+            </div>
+        </div>
+        <div id="scrollTable" style="height:300px;overflow:scroll;margin-right:-10px;">
+            <div class="table-head" style="margin:0px;">
+                <table border="1" width="100%" height="90px" align="center" style="border-top:0px;">
+                    <tbody class="table-tbody" style="background:white" align="center">
+
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    $(document).ready(function() {
+        // 设置滚动表格的高度
+        $("#scrollTable").height($(window).height() - 360);
+
+        // 仅选择日期
+        $.jeDate("#start-time", {
+            isinitVal: true,
+            format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
+        });
+        $("#start-time").val(getCurrentTimeFormat());
+        initQueryType();
+    });
+</script>

+ 3 - 3
VisualInspection/qzd/view/statistics/service_area_data_statistics.html

@@ -35,7 +35,7 @@
         <div class="dept">
             <div style="margin-top:14px;">
                 <span>部门</span><br/><br/>
-                <span class="s_d_name" id='station_name'>服务区</span>
+                <span class="s_d_name" id='station_name'>清障队</span>
             </div>
         </div>
         <!-- <div class="line-4"></div>
@@ -66,7 +66,7 @@
     <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="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>
@@ -78,7 +78,7 @@
         <!-- <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 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>

+ 2 - 2
VisualInspection/qzd/view/statistics/total_company_statistics.html

@@ -51,14 +51,14 @@
     <div class="row" style="margin-top: 15px;">
         <div class="col-sm-6">
             <div class="border-no">
-                <div class="title-div"><span>公司全体服务区排名</span></div>
+                <div class="title-div"><span>公司全体清障队排名</span></div>
                 <div id="company-stationAll-rank" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
             </div>
         </div>
         <!-- <div class="line-3"></div> -->
         <div class="col-sm-6">
             <div class="border-no">
-                <div class="title-div"><span class="title-span">温馨服务检查问题类别占比</span></div>
+                <div class="title-div"><span class="title-span">清障队检查问题类别占比</span></div>
                 <div id="server-check-type" style="width:100%;height:400px;float:left;background-color: #fff;"></div>
             </div>
         </div>

+ 35 - 37
VisualInspection/qzd/view/task/addtask.html

@@ -45,7 +45,7 @@
 </div>
 <div class="form-group">
     <div class="form-group col-xs-5">
-        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding: 0px">接时间:</label>
+        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding: 0px">接时间:</label>
         <div class="col-xs-8">
             <input type="text" style="width:100%;" id="received_time" class="form-control">
         </div>
@@ -66,21 +66,17 @@
         </div>
     </div>
     <div class="form-group col-xs-7">
-        <label for="" class="col-xs-4">是否满意:</label>
-        <div class="col-xs-6">
-            <select class="form-control" id="carUserSatisfaction">
-                                            <option value="1">非常满意</option>
-                                            <option value="2">满意</option>
-                                            <option value="3">不满意</option>
-                                    </select>
+        <label for="exampleInputAccount1" class="col-xs-4">出勤人员:</label>
+        <div class="col-xs-8">
+            <input type="text" id="recordUser" class="form-control" placeholder="请选择出勤人员" autocomplete="off">
         </div>
     </div>
 </div>
 <div class="form-group" style="margin:0px;">
     <div class="form-group col-xs-5">
-        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">出勤人员:</label>
+        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">发生方向:</label>
         <div class="col-xs-8">
-            <input type="text" id="recordUser" class="form-control" placeholder="请选择出勤人员" autocomplete="off">
+            <input type="text" style="width:100%;" id="direction" class="form-control">
         </div>
     </div>
     <div class="form-group col-xs-7">
@@ -92,26 +88,26 @@
 </div>
 <div class="form-group" style="margin:0px;">
     <div class="form-group col-xs-5">
-        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">送达时间:</label>
+        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">到达现场时间:</label>
         <div class="col-xs-8">
-            <input type="text" style="width:100%;" id="delivery_time" class="form-control">
+            <input type="text" style="width:100%;" id="arrive_time" class="form-control">
         </div>
     </div>
     <div class="form-group col-xs-7">
-        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding-right:0">到达现场时间:</label>
+        <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding-right:0">场时间:</label>
         <div class="col-xs-6">
-            <input type="text" style="width:100%;" id="arrive_time" class="form-control">
+            <input type="text" style="width:100%;" id="back_time" class="form-control">
         </div>
     </div>
 </div>
-<div class="form-group" style="margin:0px;">
+<!-- <div class="form-group" style="margin:0px;">
     <div class="form-group col-xs-5">
         <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">离场时间:</label>
         <div class="col-xs-8">
             <input type="text" style="width:100%;" id="back_time" class="form-control" autocomplete="off">
         </div>
-    </div>
-    <!-- <div class="form-group col-xs-7">
+    </div> -->
+    <div class="form-group col-xs-5">
         <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding-right:0">是否放空:</label>
         <div class="col-xs-6">
             <select class="form-control" id="isApply">
@@ -119,8 +115,8 @@
                 <option value="1">是</option>
         </select>
         </div>
-    </div> -->
-</div>
+    </div>
+<!-- </div> -->
 <!-- <div class="form-group" style="margin:0px;">
     <div class="form-group col-xs-5">
         <label for="exampleInputAccount1" class="col-xs-4" style="text-align: left;padding:0">施救时间:</label>
@@ -166,21 +162,21 @@
         type: 'datetime',
         format: 'yyyy-MM-dd HH:mm'
     });
-    laydate.render({
-        elem: '#delivery_time',
-        type: 'datetime',
-        format: 'yyyy-MM-dd HH:mm'
-    });
+    // laydate.render({
+    //     elem: '#delivery_time',
+    //     type: 'datetime',
+    //     format: 'yyyy-MM-dd HH:mm'
+    // });
     // laydate.render({
     //     elem: '#accept_time',
     //     type: 'datetime',
     //     format: 'yyyy-MM-dd HH:mm'
     // });
-    laydate.render({
-        elem: '#startTime',
-        type: 'datetime',
-        format: 'yyyy-MM-dd HH:mm'
-    });
+    // laydate.render({
+    //     elem: '#startTime',
+    //     type: 'datetime',
+    //     format: 'yyyy-MM-dd HH:mm'
+    // });
     laydate.render({
         elem: '#arrive_time',
         type: 'datetime',
@@ -306,7 +302,8 @@ function setRecordUserID(usersid) {
 
         var data = {
             "isComplete":1,
-            // "isApply":$("#isApply").val()
+            "direction":$("#direction").val(),
+            "isApply":0
         }  
         // if($("#backfield_time").val() != null && $("#backfield_time").val() !=''){
         //         data.backfield_time =moment($("#backfield_time").val()).format("YYYY-MM-DD HH:mm:ss");
@@ -328,11 +325,11 @@ function setRecordUserID(usersid) {
         // }else{
         //         data.isComplete = 0;
         // }
-        if($("#delivery_time").val() != null && $("#delivery_time").val() !=''){
-                data.delivery_time =moment($("#delivery_time").val()).format("YYYY-MM-DD HH:mm:ss");
-        }else{
-                data.isComplete = 0;
-        }
+        // if($("#delivery_time").val() != null && $("#delivery_time").val() !=''){
+        //         data.delivery_time =moment($("#delivery_time").val()).format("YYYY-MM-DD HH:mm:ss");
+        // }else{
+        //         data.isComplete = 0;
+        // }
         if($("#back_time").val() != null && $("#back_time").val() !=''){
                 data.back_time =moment($("#back_time").val()).format("YYYY-MM-DD HH:mm:ss");
         }else{
@@ -351,8 +348,8 @@ function setRecordUserID(usersid) {
             data.arrive_in_time  = 1;
         }
         }
-        if($("#backTime").val() != null && $("#arriveTime").val() != null){
-        var umipededHour = new Date($("#backTime").val()) - new Date($("#arriveTime").val());
+        if($("#backTime").val() != null && $("#delivery_time").val() != null){
+        var umipededHour = new Date($("#backTime").val()) - new Date($("#delivery_time").val());
         if (umipededHour / 100 / 60 > back) {
             data.unimpeded_in_time  = 0;
         } else {
@@ -394,6 +391,7 @@ function setRecordUserID(usersid) {
                                         window.parent.location.reload();
                                     });
                                 } else {
+                                    data.isApply = $("#isApply").val();
                                     data.id = is_save.split("_")[1];
                                     console.log(data);
                                     post_common_service('q/record/update', data, function(redata) {

+ 346 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/gettway/StatisticsController_Q.java

@@ -0,0 +1,346 @@
+package com.xintong.visualinspection.controller.gettway;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import com.xintong.visualinspection.bean.*;
+import com.xintong.visualinspection.controller.BaseController;
+import com.xintong.visualinspection.dao.cluster.DepartmentDao;
+import com.xintong.visualinspection.dao.master.StatisticsDao;
+import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
+import com.xintong.visualinspection.pojo.fwq.FwqStatisiticPojo;
+import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
+import com.xintong.visualinspection.service.CheckOtherService_Q;
+import com.xintong.visualinspection.service.CommonService;
+import com.xintong.visualinspection.service.StatisticsService_Q;
+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;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author huangcheng
+ * @since 2018/5/9
+ */
+@RestController
+@RequestMapping("/q/statistics")
+public class StatisticsController_Q extends BaseController {
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private StatisticsService_Q statisticsService_f;
+
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private CommonService commonService;
+    @Reference(version = "1.0.0",
+            application = "${dubbo.application.id}",
+            registry = "${dubbo.registry.address}")
+    private CheckOtherService_Q checkOtherService_f;
+
+    @Autowired
+    private DepartmentDao departmentDao;
+
+    @Autowired
+    private StatisticsDao statisticsDao;
+    /**
+     * 公司12个月考核得分总体变化趋势分析
+     */
+//    @RequestMapping(value = "/score/year/info")
+//    public String selectYearScoreChange(@RequestBody FwqStatisticsBean fwqStatisticsBean){
+//        List<FwqStatisticsBean> lists=  statisticsService_f.getYearScoreChange(fwqStatisticsBean);
+//        return super.returnSuccessResult(lists);
+//    }
+
+    /**
+     * 运营管理综合检查情况统计表
+     */
+    @RequestMapping(value = "/operation/manage/integration")
+    public String getOperationInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getOperationInfo(obj);
+        List<Integer> deptList = statisticsDao.selectWreckerCount(obj);
+        int totalCompanyNum = 0,
+                totalCompanyScore = 0,
+                totalThirdNum = 0,
+                totalThirdScore = 0,
+                totalOnsiteNum = 0,
+                totalOnsiteScore = 0;
+
+        for (FwqStatisticsBean bean : lists) {
+            totalCompanyNum += bean.getCompany_check_num();
+            totalCompanyScore += bean.getCompany_total_score();
+            totalThirdNum += bean.getThird_check_num();
+            totalThirdScore += bean.getThird_total_score();
+            totalOnsiteNum += bean.getOnsite_check_num();
+            totalOnsiteScore += bean.getOnsite_total_score();
+        }
+        Map<String, Object> resultMap = new HashMap<>();
+        resultMap.put("list", lists);
+        resultMap.put("deptList", deptList);
+        resultMap.put("totalCompanyNum", totalCompanyNum);
+        resultMap.put("totalCompanyScore", totalCompanyScore);
+        resultMap.put("totalThirdNum", totalThirdNum);
+        resultMap.put("totalThirdScore", totalThirdScore);
+        resultMap.put("totalOnsiteNum", totalOnsiteNum);
+        resultMap.put("totalOnsiteScore", totalOnsiteScore);
+        return super.returnSuccessResult(resultMap);
+    }
+
+    /**
+     * 营运管理提升综合成绩汇总表
+     *
+     * @param obj
+     * @return
+     */
+    @RequestMapping(value = "/dept")
+    public String getDeptStatistic(@RequestBody FwqDeptStatistic obj) {
+        Map<String, List<FwqDeptStatistic>> s = statisticsService_f.getDeptStatistic(obj);
+        return super.returnSuccessResult(s);
+    }
+
+    /**
+     * 考核问题分布报表
+     *
+     * @param obj
+     * @return
+     */
+    @RequestMapping(value = "/score/item/info")
+    public String getScoreItemInfo(@RequestBody FwqStatisticsBean obj) {
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        WreckerStatisticsBO wobj = new WreckerStatisticsBO();
+        wobj.setStart_date(obj.getStart_date());
+        wobj.setEnd_date(obj.getEnd_date());
+        List<WreckerStatisticsBO> list = statisticsDao.selectWreckerStaff(wobj);
+        FwqCheckOther fwqCheckOther = new FwqCheckOther();
+        List<User> userlist = new ArrayList<User>();
+        for(WreckerStatisticsBO w:list){
+            FwqStatisticsBean bean = new FwqStatisticsBean();
+            User user = new User();
+            user.setOrganname(w.getDept_name());
+            user.setPosition_name(w.getPosition_name());
+            user.setTruename(w.getName());
+            user.setId(w.getUser_id().intValue());
+            if(w.getWork_no() != null){
+                user.setWorkno(w.getWork_no().toString());
+            }
+            bean.setUser(user);
+            userlist.add(user);
+        }
+        Map<Long, FwqStatisticsBean> scoreMap = statisticsService_f.getQWzdCheckedItemScoreInfo(userlist,obj);
+        int totalcheckedCount = 0,
+                totalAll = 0;
+        List<FwqStatisticsBean> scorelist = new ArrayList<FwqStatisticsBean>(scoreMap.values());
+       // scorelist.add(scoreMap);
+        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++) {
+//                Integer score = scoreTypeMap.get(names.get(i));
+//                if (score == null) {
+//                    score = 0;
+//                }
+//                score += scores.get(i);
+//                if (names.get(i) != null) {
+//                    scoreTypeMap.put(names.get(i), score);
+//                }
+//            }
+//        }
+        Map<String, Object> resultMap = new HashMap<>();
+        resultMap.put("list", scorelist);
+        resultMap.put("totalcheckedCount", totalcheckedCount);
+        resultMap.put("totalAll", totalAll);
+       // List itemList = commonService.getCheckItemName(25L);
+        List itemlist = new ArrayList();
+        List itemidlist = new ArrayList();
+        itemlist.add(commonService.getCheckItemName(25L));
+        itemlist.add(commonService.getCheckItemName(30L));
+        itemlist.add(commonService.getCheckItemName(29L));
+       // itemidlist.add(commonService.getItemMap());
+//        itemidlist.add(commonService.getCheckItemName(30L));
+//        itemidlist.add(commonService.getCheckItemName(29L));
+        resultMap.put("organList", list);
+        //resultMap.put("itemidlist", itemidlist);
+        resultMap.put("itemlist",itemlist);
+        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);
+    }
+
+    /**
+     * 公司总览--->12个月考核得分总体
+     */
+    @RequestMapping(value = "/score/year/info")
+    public String selectYearScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getYearScoreChange(obj);
+        return super.returnSuccessResult(lists);
+    }
+
+    /**
+     * 公司总览--->公司考核扣分情况占比
+     *
+     * @param obj
+     * @return
+     */
+    @RequestMapping(value = "/score/info")
+    public String getScoreInfo(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getFeeStationCheckedScore(obj);
+        int totalcheckedCount = 0, total0 = 0, total15 = 0, total50 = 0, totalOver50 = 0;
+        StringBuffer total0Area = new StringBuffer();
+        StringBuffer total15Area = new StringBuffer();
+        StringBuffer total50Area = new StringBuffer();
+        StringBuffer totalOver50Area = new StringBuffer();
+
+        /*for(FwqStatisticsBean bean:lists){
+            totalcheckedCount+=bean.getChecked_num();
+            total0+=(bean.getChecked_num()-bean.getScore_fifteen()-bean.getScore_fifty()-bean.getScore_over_fifty());
+            total15+=bean.getScore_fifteen();
+            total50+=bean.getScore_fifty();
+            totalOver50+=bean.getScore_over_fifty();
+            totalAll+=bean.getAll_check_score();
+        }*/
+        totalcheckedCount = lists.size();
+        for (FwqStatisticsBean bean : lists) {
+            if (bean.getAll_check_score() == 0) {
+                total0 += 1;
+                total0Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 0 && bean.getAll_check_score() <= 15) {
+                total15 += 1;
+                total15Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 15 && bean.getAll_check_score() <= 50) {
+                total50 += 1;
+                total50Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            } else if (bean.getAll_check_score() > 50) {
+                totalOver50 += 1;
+                totalOver50Area.append(bean.getName().replaceAll("服务区", "") + ",");
+            }
+        }
+        Map<String, Object> resultMap = new HashMap<>();
+        resultMap.put("list", lists);
+        resultMap.put("totalcheckedCount", totalcheckedCount);
+        resultMap.put("total0", total0);
+        resultMap.put("total15", total15);
+        resultMap.put("total50", total50);
+        resultMap.put("totalOver50", totalOver50);
+        resultMap.put("total0Area", total0Area);
+        resultMap.put("total15Area", total15Area);
+        resultMap.put("total50Area", total50Area);
+        resultMap.put("totalOver50Area", totalOver50Area);
+//        resultMap.put("totalAll", totalAll);
+//        resultMap.put("organList", departmentDao.getOrganToSaCount());
+        return super.returnSuccessResult(resultMap);
+    }
+
+    /**
+     * 公司总览--->道管中心得分排名
+     */
+    @RequestMapping(value = "/score/center/manage/info")
+    public String selectCentermanageScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getCenterManageScoreInfo(obj);
+        return super.returnSuccessResult(lists);
+    }
+
+    /**
+     * 公司总览--->公司全体服务区排名
+     */
+    @RequestMapping(value = "/score/tollgate/info")
+    public String selectTollgateScoreChange(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> lists = statisticsService_f.getFeeStationScoreInfo(obj);
+        return super.returnSuccessResult(lists);
+    }
+
+    /**
+     * 公司总览--->温馨服务检查问题类别占比
+     */
+    @RequestMapping(value = "/lost/itemscore/rate")
+    public String getCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> returnList = statisticsService_f.getCheckedItemScoreInfo(obj);
+        return super.returnSuccessResult(returnList);
+    }
+
+    /**
+     * 公司总览--->各个问题类别的扣分情况
+     */
+    @RequestMapping(value = "/lost/twice/itemscore/rate")
+    public String getTwiceCheckedItemInfoRate(@RequestBody FwqStatisticsBean obj) {
+        Map<String, Object> resultMap = new HashMap<>();
+        Map<String, List<FwqStatisticsBean>> returnMap = statisticsService_f.get2CheckedItemScoreInfo(obj);
+        resultMap.put("itemList", commonService.getCheckItemName(25L));
+        resultMap.put("list", returnMap);
+        return super.returnSuccessResult(resultMap);
+    }
+
+    /**
+     * 服务区连续月统计
+     */
+    @RequestMapping(value = "/user/score")
+    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody ServiceAreaStatistic obj) {
+         List<FwqStatisiticPojo> returnList = statisticsService_f.getFwqStatistic(obj);
+        return super.returnSuccessResult((returnList));
+    }
+
+    /**
+     * 服务区数据查询分析---->获取服务区的12月情况
+     */
+    @RequestMapping(value = "/one/qzd/check")
+    public String getQzdCheck(@RequestBody FwqStatisticsBean obj) {
+        List<FwqStatisticsBean> returnList = statisticsService_f.getOneSACheckedInfo(obj);
+        return super.returnSuccessResult(returnList);
+    }
+
+    /**
+     * 服务区数据查询分析---->获取清障队的数据
+     */
+    @RequestMapping(value = "/one/qzd/checknum")
+    public String getQzdCheckNum(@RequestBody FwqStatisticsBean obj) {
+        List<CheckNum> returnList = statisticsService_f.selectQzdCheckNum(obj);
+        return super.returnSuccessResult(returnList);
+    }
+}

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/StatisticsDao.java

@@ -92,4 +92,6 @@ public interface StatisticsDao  {
 
 	public void addcheckSExUser(StatisticExUser statisticExUser);
 
+	public  List<Integer> selectWreckerCount(FwqStatisticsBean obj);
+
 }

+ 18 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -7,6 +7,7 @@
         LEFT join (select starttime,endtime from check_task_period ) t_p on DELETE_TIME &gt;= starttime and DELETE_TIME
         &lt; endtime
         WHERE STATUS =-1 and DELETE_TIME &gt;= t_p.starttime and DELETE_TIME &lt; t_p.endtime ) deleted_user
+        WHERE STATUS =-1 and DELETE_TIME &gt;= t_p.starttime and DELETE_TIME &lt; t_p.endtime ) deleted_user
     </sql>
 
     <sql id="taskexclouddeleteUser">
@@ -1079,6 +1080,23 @@
         </if>
     </select>
 
+    <select id="selectWreckerCount"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="Integer">
+            SELECT
+                COUNT(o.ORGANID) as count
+            FROM
+                t_sys_users o
+                LEFT JOIN sys_job b ON o.POSITIONID = b.id
+                LEFT JOIN t_br_layer_wrecker_group tlw ON tlw.ORGAN_ID = o.ORGANID
+            WHERE
+                o.`STATUS` = 1
+                AND o.ORGANID IN ( SELECT ORGAN_ID FROM t_br_layer_wrecker_group )
+        <if test="start_date != null">and if(DELETE_TIME is not NULL,o.DELETE_TIME >#{start_date} ,1=1)</if>
+            GROUP BY o.ORGANID
+              ORDER BY o.ORGANID
+                </select>
+
     <select id="selectWreckerStatisticDetail" parameterType="com.xintong.visualinspection.bean.WreckerStatisticsBO"
             resultType="com.xintong.visualinspection.bean.WreckerStatisticsBO">
         SELECT cim.name AS item_name , COUNT(1) AS check_num , t.user_id , t.wrecker_check_type , SUM(t.check_score) AS

+ 3 - 4
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/application.properties

@@ -12,15 +12,14 @@ dubbo.application.name = jicha_fjq-provider_consumer
 # ProtocolConfig Bean
 dubbo.protocol.id = dubbo
 dubbo.protocol.name = dubbo
-dubbo.protocol.port = 7683
+dubbo.protocol.port = 7689
 dubbo.protocol.status = server
 
 ## RegistryConfig Bean
 dubbo.registry.id = fjq_service
 #dubbo.registry.address = zookeeper://git.topm.win:9994
-#dubbo.registry.address = zookeeper://100.0.0.3:2181
+#dubbo.registry.address = zookeeper://192.168.45.158:2181
 dubbo.registry.address = zookeeper://127.0.0.1:2181
-
 dubbo.registry.file = ./output/dubbo1.cache
 dubbo.reference.check=false
 dubbo.consumer.check=false
@@ -28,7 +27,7 @@ dubbo.consumer.check=false
 
 
 #master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection_2?useUnicode=true&characterEncoding=utf-8
-master.datasource.url = jdbc:mysql://xt.wenhq.top:8082/visualinspection_2?useUnicode=true&characterEncoding=utf-8
+master.datasource.url = jdbc:mysql://192.168.45.158:3306/visualinspection_2?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection_2?useUnicode=true&characterEncoding=utf-8
 master.datasource.username = root

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


+ 17 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/CheckNum.java

@@ -0,0 +1,17 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CheckNum implements Serializable {
+    private  Integer  dept;
+    private  String deptName;
+    private  Integer  recordNum;
+    private  Integer  videosNum;
+    private  Integer  picsNum;
+    private  Integer  taskNum;
+    private  Integer  isApplyNunm;
+}
+

+ 2 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqCheckOther.java

@@ -62,4 +62,6 @@ public class FwqCheckOther implements Serializable {
     //
     private String scoretype;
 
+    private int parent_id;
+
 }

+ 10 - 2
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/FwqStatisticsBean.java

@@ -81,6 +81,14 @@ public class FwqStatisticsBean implements Serializable {
 
     private List<Integer> checked_score = new ArrayList<Integer>();
 
+    private List<String> third_socre_name = new ArrayList<String>();
+
+    private List<Integer> third_score = new ArrayList<Integer>();
+
+    private List<String> onsite_socre_name = new ArrayList<String>();
+
+    private List<Integer> onsite_score = new ArrayList<Integer>();
+
     private List<Integer> seq_checked_score = new ArrayList<Integer>();
 
     private List<Organ> dept_list;
@@ -163,11 +171,11 @@ public class FwqStatisticsBean implements Serializable {
     private Integer company_ranking2;
     // 道管排名
     private Integer fee_station_ranking2;
-
+    //在岗人数
     private Integer check_t_num = 0;
 
     private Integer check_t_score = 0;
-
+    //受检人数
     private Integer check_x_num = 0;
 
     private Integer check_x_score = 0;

+ 2 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/QzdRecord.java

@@ -83,4 +83,6 @@ public class QzdRecord implements Serializable {
     private  int vice_monitor;
    //是否放空 0:否 1:是
     private  int isApply;
+    //方向
+    private String direction;
 }

+ 110 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/bean/WreckerStatisticsBO.java

@@ -0,0 +1,110 @@
+package com.xintong.visualinspection.bean;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper=false)
+public class WreckerStatisticsBO {
+
+    //编号
+    private Integer id;
+
+    private String dept_name ;
+
+    // 部门id
+    private Long dept_id;
+
+    //开始日期
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date start_date ;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date end_date ;
+
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date update_time ;
+
+    private Long work_no;
+
+    private Integer positionid ;
+
+    private Long user_id ;
+
+    private String name ;
+
+    private String position_name ;
+
+    private int score;
+
+    private Integer item_id ;
+
+    private String item_name ;
+
+    private int chu_jing ;
+
+    private int xian_chang;
+
+    private int chang_tong ;
+
+    private int zuo_ye;
+
+    private int xin_xi ;
+
+    private int zhuo_zhuang;
+
+    private int zuo_ye_xian_chang;
+
+    private int wen_ming ;
+
+    private int cao_zuo ;
+
+    private int gong_zuo;
+
+    //
+    private int private_check ;
+
+    private int in_check ;
+
+    private int other_check ;
+
+    private int all_check_score ;
+
+    private int check_num;
+
+    private Integer wrecker_check_type ;
+
+
+    public int compareTo(WreckerStatisticsBO o2){
+        if(this.getCheck_num() !=0  && o2.getCheck_num() !=0){
+            double a=this.getAll_check_score()/this.getCheck_num();
+            double b= o2.getAll_check_score() /  this.getCheck_num()  ;
+            if(a>b){
+                return 1;
+            }else if(a<b){
+                return -1 ;
+            }else{
+                return 0 ;
+            }
+        }else{
+            if(this.getCheck_num() == 0 && o2.getCheck_num() !=0){
+                return 1 ;
+            }else if(this.getCheck_num() != 0 && o2.getCheck_num() ==0){
+                return -1 ;
+            }else{
+                return 0 ;
+            }
+        }
+    }
+
+}

+ 58 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/service/StatisticsService_Q.java

@@ -0,0 +1,58 @@
+package com.xintong.visualinspection.service;
+
+import com.xintong.visualinspection.bean.*;
+import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
+import com.xintong.visualinspection.pojo.fwq.FwqStatisiticPojo;
+import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
+
+import java.util.List;
+import java.util.Map;
+
+public interface StatisticsService_Q {
+
+    // 运营管理综合检查情况统计表
+    List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj);
+
+    // 营运管理提升综合成绩汇总表
+    Map<String, List<FwqDeptStatistic>> getDeptStatistic(FwqDeptStatistic obj);
+
+    // 考核问题分布报表数据
+    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);
+
+    // 公司12个月考核得分总体变化趋势
+    List<FwqStatisticsBean> getYearScoreChange(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean> getFeeStationCheckedScore(FwqStatisticsBean obj);
+
+    // 道管中心得分排名
+    List<FwqStatisticsBean> getCenterManageScoreInfo(FwqStatisticsBean obj);
+
+    // 公司全体服务区排名
+    List<FwqStatisticsBean> getFeeStationScoreInfo(FwqStatisticsBean obj);
+
+    // 温馨服务检查问题类别占比
+    List<FwqStatisticsBean> getCheckedItemScoreInfo(FwqStatisticsBean obj);
+
+    // 各个问题类别的扣分情况
+    Map<String,List<FwqStatisticsBean>> get2CheckedItemScoreInfo(FwqStatisticsBean obj);
+
+    //获取连续月达标的服务区
+    List<FwqStatisiticPojo> getFwqStatistic(ServiceAreaStatistic obj);
+
+    Map<Long, FwqStatisticsBean> getQWzdCheckedItemScoreInfo(List<User> list,FwqStatisticsBean obj);
+
+    List<CheckNum> selectQzdCheckNum(FwqStatisticsBean obj);
+}

+ 1 - 0
Visuallnspection_fjq/visuallnspectioninteface/src/main/java/com/xintong/visualinspection/util/CacheUtil.java

@@ -90,6 +90,7 @@ public class CacheUtil {
 
     public static void refreshItemNameMap(ItemService itemService) {
         List<Long> list = new ArrayList<Long>();
+        list.add(25L);// 第三方暗访
         list.add(26L);// 第三方暗访
         list.add(27L);// 现场检查
         list.add(28L);// 服务区考核办法

+ 22 - 0
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/dao/QzdStatisticsDao.java

@@ -1,9 +1,13 @@
 package com.xintong.visualinspection.visuallnspection_qzd.dao;
 
 import com.xintong.visualinspection.bean.FwqStatisticsBean;
+import com.xintong.visualinspection.bean.FwqCheckOther;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
+import com.xintong.visualinspection.bean.CheckNum;
 import org.apache.ibatis.annotations.Mapper;
 
+
 import java.util.List;
 
 /**
@@ -37,4 +41,22 @@ public interface QzdStatisticsDao {
     List<FwqStatisticsBean> selectCheckedItemScoreInfo(FwqStatisticsBean obj);
 
     List<ServiceAreaStatistic> selectlimituser(ServiceAreaStatistic obj);
+
+    Integer getOtherCheckScore(FwqCheckOther fwqCheckOtherwqCheckOther);
+
+    List<User> selectWGCheckNum(FwqStatisticsBean obj);
+
+    List<User> selectRecordNum(FwqStatisticsBean obj);
+
+    List<FwqStatisticsBean>  selectOtherCheckedPersonScoreDetail(FwqCheckOther obj);
+
+    Integer selectDeptRecord(FwqStatisticsBean obj);
+
+    List<Integer> selectDeptpeople();
+
+    Integer selectDeptChedkpeople(FwqStatisticsBean obj);
+
+    List<CheckNum> selectQzdCheckNum(FwqStatisticsBean obj);
+
+    Integer selectQzdApplyNum(FwqStatisticsBean obj);
 }

+ 7 - 0
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/CheckApplylMapper.xml

@@ -39,6 +39,13 @@
 	            #{apply_id}
 	        </foreach>
        	</if>
+        <if test="invalidFrom == -1">AND
+            ( ct.invalid_from = 0 OR ct.invalid_from = 1)
+        </if>
+
+        <if test="invalidFrom != null  and invalidFrom != -1">AND
+            ct.invalid_from = #{invalidFrom}
+        </if>
         ORDER BY ct.start_time DESC
     </select>
 

+ 3 - 3
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/RecordMapper.xml

@@ -30,10 +30,10 @@
             parameterType="com.xintong.visualinspection.bean.QzdRecord">
         INSERT INTO record_info
         (type,users,dept,addr,received_time,car_info,car_user_info,start_time,arrive_time,back_time,record_user,arrive_in_time,unimpeded_in_time,car_user_satisfaction,videos
-        ,pics,zxt_is_standard,is_explain,record_no_come,take_photo_upload,arrive_do_work,remarks,delivery_time,accept_time,rescue_time,relief_time,backfield_time,isComplete)
+        ,pics,zxt_is_standard,is_explain,record_no_come,take_photo_upload,arrive_do_work,remarks,delivery_time,accept_time,rescue_time,relief_time,backfield_time,isComplete,direction)
         VALUES
         (#{type},#{users},#{dept},#{addr},#{received_time},#{car_info},#{car_user_info},#{start_time},#{arrive_time},#{back_time},#{record_user},#{arrive_in_time},#{unimpeded_in_time},#{car_user_satisfaction},#{videos}
-        ,#{pics},#{zxt_is_standard},#{is_explain},#{record_no_come},#{take_photo_upload},#{arrive_do_work},#{remarks},#{delivery_time},#{accept_time},#{rescue_time},#{relief_time},#{backfield_time},#{isComplete}
+        ,#{pics},#{zxt_is_standard},#{is_explain},#{record_no_come},#{take_photo_upload},#{arrive_do_work},#{remarks},#{delivery_time},#{accept_time},#{rescue_time},#{relief_time},#{backfield_time},#{isComplete},#{direction}
         )
     </insert>
 
@@ -71,7 +71,7 @@
         <if test="isComplete != null">isComplete = #{isComplete},</if>
         <if test="monitor != null">monitor = #{monitor},</if>
         <if test="vice_monitor != null">vice_monitor = #{vice_monitor},</if>
-        <!--<if test="isApply != null">isApply = #{isApply},</if>-->
+        <if test="direction != null">direction = #{direction},</if>
         id=#{id}
         WHERE
         id = #{id}

+ 165 - 1
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/StatisticsMapper.xml

@@ -36,11 +36,57 @@
         GROUP BY t.checked_dept
     </select>
 
+    <select id="selectWGCheckNum" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.User">
+            SELECT
+                w.user_id,
+                w.user_id as id,
+                w.work_no as workno,
+                w.name as truename,
+                w.position_name as position_name,
+                w.dept_name as organname,
+                IF(t.id IS NOT NULL, COUNT( w.user_id )  , 0 ) as age
+            FROM
+                wg_user w
+                LEFT JOIN (SELECT * FROM check_task WHERE  1=1
+        <if test="period_id != null and period_id != ''">
+        AND period_id = #{period_id}
+    </if>)t ON INSTR( t.checked_users, w.user_id ) = 1
+            WHERE
+                1=1
+            GROUP BY
+                w.user_id
+            order by
+                w.user_id
+    </select>
+
+    <select id="selectRecordNum" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.User">
+        SELECT
+            w.user_id as id,
+            w.work_no as workno,
+            w.name as truename,
+            w.position_name as position_name,
+            w.dept_name as organname,
+            IF(t.id IS NOT NULL, COUNT( w.user_id )  , 0 ) as age
+        FROM
+            wg_user w
+            LEFT JOIN (SELECT * FROM record_info WHERE  1=1
+        <if test="start_date != null and end_date != null">and received_time between #{start_date} and #{end_date}</if>)t ON INSTR( t.users, w.user_id ) = 1
+        WHERE
+           1=1
+        GROUP BY
+            w.user_id
+        order by
+           w.user_id
+    </select>
+
     <select id="selectFeeStationCheckedPersonScoreDetail"
             parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
             resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
         SELECT
-        t.checked_dept     AS dept_id,
+        t.checked_dept     as dept_id,
+        t.checked_area     AS checkman_id,
         t.check_item_id,
         t.check_item_score AS score
         FROM check_score t
@@ -54,6 +100,26 @@
         </if>
     </select>
 
+    <select id="selectOtherCheckedPersonScoreDetail"
+            parameterType="com.xintong.visualinspection.bean.FwqCheckOther"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT
+        t.check_person_id     AS checkman_id,
+        t.check_item_id,
+        t.check_score AS score
+        FROM other_check t
+        WHERE 1=1
+        <if test="check_time_name!=null">
+            AND t.check_time_name = #{check_time_name}
+        </if>
+        <if test="dept_id != null and dept_id != ''">
+            AND t.dept_id = #{dept_id}
+        </if>
+        <if test="check_type != null and check_type != ''">
+            AND t.check_type = #{check_type}
+        </if>
+    </select>
+
     <select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
             resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
         SELECT
@@ -377,6 +443,104 @@
         AND check_num_t.mth = checked_score_t.mth
     </sql>
 
+    <select id="getOtherCheckScore" parameterType="com.xintong.visualinspection.bean.FwqCheckOther"
+            resultType="Integer">
+        select
+        sum(check_score) as check_score_all
+        from other_check
+        where
+         1=1
+        <if test="dept_id !=null">
+            AND dept_id = #{dept_id}
+        </if>
+        <if test="check_time_name !=null">
+            AND check_time_name = #{check_time_name}
+        </if>
+        <if test="check_type !=null">
+            AND check_type = #{check_type}
+        </if>
+    </select>
+    <select id="getScore" parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.FwqStatisticsBean">
+        SELECT * FROM
+    </select>
+
+    <select id="selectDeptRecord"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="Integer">
+        SELECT
+        COUNT(t.id) as check_score_all
+        FROM record_info t
+        WHERE isApply = 0
+        <if test="start_date != null and end_date != null">and t.received_time between #{start_date} and #{end_date}</if>
+        <if test="dept_id != null">and t.dept = #{dept_id}</if>
+    </select>
+
+    <select id="selectDeptpeople" resultType="Integer">
+    SELECT COUNT(dept_name)
+    FROM `wg_user` GROUP BY dept_name
+    </select>
+
+
+    <select id="selectDeptChedkpeople"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="Integer">
+    SELECT COUNT(a.user_id) FROM(SELECT
+    w.user_id as user_id,
+    t.checked_dept as checked_dept,
+    t.period_id as period_id
+    FROM
+    wg_user w
+    LEFT JOIN check_task t ON INSTR(t.checked_users,w.user_id) = 1
+    WHERE
+    t.id IS NOT NULL
+        <if test="dept_id != null">and t.checked_dept = #{dept_id}</if>
+        <if test="period_id != null">and t.period_id = #{period_id}</if>
+    GROUP BY
+    w.user_id
+    order by
+    w.user_id
+    ) a
+    where
+    1=1
+
+     </select>
+
+    <select id="selectQzdCheckNum"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="com.xintong.visualinspection.bean.CheckNum">
+        SELECT
+        dept,
+        COUNT(r.id) as recordNum,
+        COUNT(t.id)	 as taskNum,
+        COUNT((r.videos = null or r.videos = "")and(r.pics = null or r.pics =""))	 as videosNum,
+        COUNT(r.pics is not null or r.pics != "")	 as picsNum
+        FROM
+        record_info r
+        LEFT JOIN check_task t ON r.id = t.record_id
+        WHERE
+        r.isApply = 0
+        <if test="start_date != null and end_date != null">and r.received_time between #{start_date} and #{end_date}</if>
+        AND r.isComplete = 1
+        GROUP BY
+        dept
+
+    </select>
+
+    <select id="selectQzdApplyNum"
+            parameterType="com.xintong.visualinspection.bean.FwqStatisticsBean"
+            resultType="Integer">
+        SELECT
+        COUNT(r.id) as isApplyNunm
+        FROM
+        record_info r
+        WHERE
+        r.isApply = 1
+        <if test="start_date != null and end_date != null">and r.received_time between #{start_date} and #{end_date}</if>
+        AND r.dept = #{dept_id}
+
+    </select>
+
 </mapper>
 
 

+ 1 - 0
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/mapper/master/TaskMapper.xml

@@ -96,6 +96,7 @@
         update check_task set
         <if test="check_status != null">check_status = #{check_status},</if>
         <if test="recheckman != null">recheckman = #{recheckman},</if>
+        <if test="invalid_from != null">invalid_from = #{invalid_from},</if>
         update_time=now()
         WHERE
         id = #{id}

+ 244 - 45
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/service/impl/StatisticsServiceImpl.java

@@ -3,18 +3,13 @@ package com.xintong.visualinspection.visuallnspection_qzd.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.bean.*;
 import com.xintong.visualinspection.pojo.fwq.FwqRankingData;
 import com.xintong.visualinspection.pojo.fwq.FwqStatisiticPojo;
 import com.xintong.visualinspection.pojo.fwq.ServiceAreaStatistic;
+import com.xintong.visualinspection.service.CheckOtherService_Q;
 import com.xintong.visualinspection.service.CommonService;
-import com.xintong.visualinspection.service.StatisticsService_F;
+import com.xintong.visualinspection.service.StatisticsService_Q;
 import com.xintong.visualinspection.visuallnspection_qzd.dao.QzdCheckDeptStatisticsDao;
 import com.xintong.visualinspection.visuallnspection_qzd.dao.QzdStatisticsDao;
 import org.slf4j.Logger;
@@ -46,41 +41,57 @@ import java.util.Set;
         registry = "${dubbo.registry.id}",
         timeout = 3000
 )
-public class StatisticsServiceImpl implements StatisticsService_F {
+
+public class StatisticsServiceImpl implements StatisticsService_Q {
 
     private static final Logger logger = LoggerFactory.getLogger(StatisticsServiceImpl.class);
 
     @Autowired
-    private QzdStatisticsDao qzdStatisticsDao;
+    private QzdStatisticsDao fwqStatisticsDao;
     @Autowired
-    private QzdCheckDeptStatisticsDao qzdCheckDeptStatisticsDao;
+    private QzdCheckDeptStatisticsDao fwqCheckDeptStatisticsDao;
 
     @Reference(version = "1.0.0",
             application = "${dubbo.application.id}",
             registry = "${dubbo.registry.address}")
     private CommonService commonService;
 
+    private CheckOtherService_Q checkOtherService_f;
+
     @Override
     public List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj) {
 
         // 获得所有服务区数据
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
+        if (obj.getStart_date() != null && obj.getEnd_date() != null) {
+            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
+            if (p != null) {
+                obj.setPeriod_id(p.getId());
+            }
+        }
         for (FeeStation sta : saList) {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
             obj2.setName(sta.getName());
             mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
+            FwqStatisticsBean obj3 = new FwqStatisticsBean();
+            obj3.setDept_id(Long.valueOf(sta.getDeptid()));
+            obj3.setStart_date(obj.getStart_date());
+            obj3.setEnd_date(obj.getEnd_date());
+            obj3.setPeriod_id(obj.getPeriod_id());
+            mapStationInfos.get(Long.valueOf(sta.getDeptid())).setCheck_t_num(fwqStatisticsDao.selectDeptChedkpeople(obj3));
+            mapStationInfos.get(Long.valueOf(sta.getDeptid())).setOther_check_num(fwqStatisticsDao.selectDeptRecord(obj3));
         }
 
         // 获取公司检查的某个收费站的受检次数和扣分合计
         List<FwqStatisticsBean> company_beans =  getFeeStationCheckItemScore(obj);
         // 获取第三方暗访稽查的某个服务区的受检次数和扣分合计
-        obj.setCheck_type(8);
-        List<FwqStatisticsBean> third_beans = qzdStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+        obj.setCheck_type(12);
+        List<FwqStatisticsBean> third_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
         // 获取现场稽查的某个服务区的受检次数和扣分合计
-        obj.setCheck_type(9);
-        List<FwqStatisticsBean> onsite_beans = qzdStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
+        obj.setCheck_type(11);
+        List<FwqStatisticsBean> onsite_beans = fwqStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
 
         for (FwqStatisticsBean company_bean : company_beans) {
             mapStationInfos.get(company_bean.getDept_id()).setCompany_check_num(company_bean.getChecked_num());
@@ -117,12 +128,12 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             value.setScore_avg(score_avg.toString());
         }
         List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
-        sortList.sort(new Comparator<FwqStatisticsBean>() {
-            @Override
-            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
-                return o1.compare3To(o2);
-            }
-        });
+//        sortList.sort(new Comparator<FwqStatisticsBean>() {
+//            @Override
+//            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
+//                return o1.compare3To(o2);
+//            }
+//        });
 
         List<FwqStatisticsBean> temp = new ArrayList<>();
         temp.addAll(sortList);
@@ -161,7 +172,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
                 ss.setIntegral(sortList.size() - s.getCompany_ranking2() + 1);
                 ss.setDept_id(s.getDept_id());
                 ss.setPeriod_id(period.getId());
-                qzdCheckDeptStatisticsDao.saveandupdate(ss);
+                fwqCheckDeptStatisticsDao.saveandupdate(ss);
             }
         }
 
@@ -196,7 +207,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             obj.setEndperiod_id(checkTaskPeriods.get(checkTaskPeriods.size() - 1).getId());
         }
 
-        List<FwqDeptStatistic> deptStatistics = qzdCheckDeptStatisticsDao.selectdepts(obj);
+        List<FwqDeptStatistic> deptStatistics = fwqCheckDeptStatisticsDao.selectdepts(obj);
         Map<String, List<FwqDeptStatistic>> listMap = new HashMap<>();
         Map<Long, List<FwqDeptStatistic>> listMap1 = new HashMap<>();
         if (deptStatistics.size() > 0) {
@@ -368,7 +379,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
     public List<FwqStatisticsBean> getFeeStationCheckItemScore(FwqStatisticsBean obj) {
 
         // 获得所有服务区数据
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         Map<Long, Item> itemMap = commonService.getItemMap();
         Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
         for (FeeStation sta : saList) {
@@ -394,7 +405,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         //服务区检查次数
-        List<FwqStatisticsBean> listCheckNum = qzdStatisticsDao.selectFeeStationCheckNum(obj);
+        List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
         for (FwqStatisticsBean sta : listCheckNum) {
             if (mapStationInfos.containsKey(sta.getDept_id())) {
                 mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
@@ -402,7 +413,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             }
         }
 
-        List<FwqStatisticsBean> listCheckedScore = qzdStatisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
+        List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
 
         // 处理同一个服务区中,如果item的parent_id是一样的话,将这些数据结合在一起
         for (FwqStatisticsBean sta : listCheckedScore) {
@@ -512,7 +523,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         if (!(page.equals(0) && size.equals(0))) {
             PageHelper.startPage(page, size);
         }
-        List<FwqStatisticsBean> list = qzdStatisticsDao.selectOneCheckedDetailInfo(obj);
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectOneCheckedDetailInfo(obj);
         Map<Long, Item> itemMap = commonService.getItemMap();
 
         for (FwqStatisticsBean sta : list) {
@@ -570,12 +581,12 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
     @Override
     public List<FwqStatisticsBean> getOneSACheckedInfo(FwqStatisticsBean obj) {
-        return qzdStatisticsDao.selectOneCheckedInfoData(obj);
+        return fwqStatisticsDao.selectOneCheckedInfoData(obj);
     }
 
     @Override
     public List<FwqStatisticsBean> getOneCheckedItemInfo(FwqStatisticsBean obj) {
-        List<FwqStatisticsBean> listCheckedScore = qzdStatisticsDao.selectOneCheckedItemInfo(obj);
+        List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectOneCheckedItemInfo(obj);
         Map<Long, Item> itemMap = commonService.getItemMap();
         // 处理同一个服务区中,如果item的parent_id是一样的话,将这些数据结合在一起
         for (FwqStatisticsBean sta : listCheckedScore) {
@@ -601,7 +612,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
     public List<FwqStatisticsBo> getEmployeeCheckedInfo(FwqStatisticsBean obj) {
 
         // 将检索出来的数据放到如map中
-        List<FwqStatisticsBean> list = qzdStatisticsDao.selectStatistics(obj);
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectStatistics(obj);
         Map<Long, Item> itemMap = commonService.getItemMap();
         Map<Long, Organ> deptMap = commonService.getDeptMap();
         // 将list中的数据找到项目的父项目,然后去除重复的
@@ -618,12 +629,12 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         // 查询服务区受检次数
-        List<FwqStatisticsBean> timesList = qzdStatisticsDao.selectCheckedTimes(obj);
+        List<FwqStatisticsBean> timesList = fwqStatisticsDao.selectCheckedTimes(obj);
 
         Map<Long, FwqStatisticsBo> statisticBoMap = new HashMap<>();
 
         // 获得所有服务区数据,将服务区数据保存在map中
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         for (FeeStation sta : saList) {
             FwqStatisticsBo obj2 = new FwqStatisticsBo();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
@@ -755,7 +766,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
     @Override
     public List<FwqStatisticsBean> getYearScoreChange(FwqStatisticsBean obj) {
-        List<FwqStatisticsBean> list = qzdStatisticsDao.selectYearScoreInfo(obj);
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectYearScoreInfo(obj);
         return list;
 
     }
@@ -765,7 +776,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
         Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
         // 获得所有服务区数据,将服务区数据保存在map中
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         for (FeeStation sta : saList) {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
@@ -789,7 +800,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         }
 
         // 检查次数
-        List<FwqStatisticsBean> listCheckNum = qzdStatisticsDao.selectFeeStationCheckNum(obj);
+        List<FwqStatisticsBean> listCheckNum = fwqStatisticsDao.selectFeeStationCheckNum(obj);
         for (FwqStatisticsBean sta : listCheckNum) {
             if (mapStationInfos.containsKey(sta.getDept_id())) {
                 mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
@@ -802,7 +813,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
             listmap.put(b.getDept_id().intValue(), b);
         }
 
-        List<FwqStatisticsBean> listCheckedScore = qzdStatisticsDao.selectFeeStationCheckedScore(obj);
+        List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectFeeStationCheckedScore(obj);
         for (FwqStatisticsBean sta : listCheckedScore) {
             if (mapStationInfos.containsKey(sta.getDept_id())) {
 
@@ -882,7 +893,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
         // 获取所有的服务区
         List<FwqStatisticsBean> lists = new ArrayList<>();
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         for (FeeStation sta : saList) {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
@@ -897,18 +908,30 @@ public class StatisticsServiceImpl implements StatisticsService_F {
                         + centerManageMap.get(sta.getDept_id()).getAll_check_score());
                 centerManageList.get(0).setChecked_num(centerManageList.get(0).getChecked_num()
                         + centerManageMap.get(sta.getDept_id()).getChecked_num());
+                centerManageList.get(0).setOnsite_total_score(centerManageList.get(0).getOnsite_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getOnsite_total_score());
+                centerManageList.get(0).setThird_total_score(centerManageList.get(0).getThird_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getThird_total_score());
                 centerManageList.get(0).setFeeStationName("连云港");
             } else if (sta.getParent_dept_id() == 31) {
                 centerManageList.get(1).setAll_check_score(centerManageList.get(1).getAll_check_score()
                         + centerManageMap.get(sta.getDept_id()).getAll_check_score());
                 centerManageList.get(1).setChecked_num(centerManageList.get(1).getChecked_num()
                         + centerManageMap.get(sta.getDept_id()).getChecked_num());
+                centerManageList.get(1).setOnsite_total_score(centerManageList.get(0).getOnsite_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getOnsite_total_score());
+                centerManageList.get(1).setThird_total_score(centerManageList.get(0).getThird_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getThird_total_score());
                 centerManageList.get(1).setFeeStationName("盐城");
             } else if (sta.getParent_dept_id() == 32) {
                 centerManageList.get(2).setAll_check_score(centerManageList.get(2).getAll_check_score()
                         + centerManageMap.get(sta.getDept_id()).getAll_check_score());
                 centerManageList.get(2).setChecked_num(centerManageList.get(2).getChecked_num()
                         + centerManageMap.get(sta.getDept_id()).getChecked_num());
+                centerManageList.get(2).setOnsite_total_score(centerManageList.get(0).getOnsite_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getOnsite_total_score());
+                centerManageList.get(2).setThird_total_score(centerManageList.get(0).getThird_total_score()
+                        + centerManageMap.get(sta.getDept_id()).getThird_total_score());
                 centerManageList.get(2).setFeeStationName("南通");
             }
         }
@@ -940,7 +963,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
     @Override
     public List<FwqStatisticsBean> getCheckedItemScoreInfo(FwqStatisticsBean obj) {
-        List<FwqStatisticsBean> list = qzdStatisticsDao.selectCheckedItemScoreInfo(obj);
+        List<FwqStatisticsBean> list = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
         Map<Long, Item> itemMap = commonService.getItemMap();
         Map<Long, Organ> deptMap = commonService.getDeptMap();
         for (FwqStatisticsBean sta : list) {
@@ -965,7 +988,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
     public Map<String, List<FwqStatisticsBean>> get2CheckedItemScoreInfo(FwqStatisticsBean obj) {
 
         Map<String, List<FwqStatisticsBean>> map = new HashMap<>();
-        List<FwqStatisticsBean> objList = qzdStatisticsDao.selectCheckedItemScoreInfo(obj);
+        List<FwqStatisticsBean> objList = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
         Map<Long, Item> itemMap = commonService.getItemMap();
         Map<Long, Organ> deptMap = commonService.getDeptMap();
         for (FwqStatisticsBean sta : objList) {
@@ -987,7 +1010,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
         map.put("Tmth", objList);
         obj.setMth(obj.getPrev_mth());
-        objList = qzdStatisticsDao.selectCheckedItemScoreInfo(obj);
+        objList = fwqStatisticsDao.selectCheckedItemScoreInfo(obj);
 
         for (FwqStatisticsBean sta : objList) {
             sta.setItem_id(itemMap.get(sta.getCheck_item_id().longValue()).getParent_id().intValue());
@@ -1047,7 +1070,7 @@ public class StatisticsServiceImpl implements StatisticsService_F {
 
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM");
         //获取满足条件的服务区
-        List<ServiceAreaStatistic> fwqStatistics = qzdStatisticsDao.selectlimituser(obj);
+        List<ServiceAreaStatistic> fwqStatistics = fwqStatisticsDao.selectlimituser(obj);
 
         HashMap<Integer, List<ServiceAreaStatistic>> usm = new HashMap<>();
 
@@ -1116,20 +1139,34 @@ public class StatisticsServiceImpl implements StatisticsService_F {
     }
 
     private List<FwqStatisticsBean> reFeeStationScoreInfo(FwqStatisticsBean obj) {
-        List<FwqStatisticsBean> scoreList = qzdStatisticsDao.selectFeeStationScoreInfo(obj);
+        List<FwqStatisticsBean> scoreList = fwqStatisticsDao.selectFeeStationScoreInfo(obj);
         Map<Long, FwqStatisticsBean> feeStationMap = new HashMap<>();
 
         for (FwqStatisticsBean feeObj : scoreList) {
             if (!feeStationMap.containsKey(feeObj.getDept_id())) {
+                FwqCheckOther fwq = new FwqCheckOther();
+                fwq.setCheck_time_name(obj.getMth());
+                fwq.setDept_id(feeObj.getDept_id());
+                fwq.setCheck_type(11);
+                if(fwqStatisticsDao.getOtherCheckScore(fwq) != null){
+                    feeObj.setOnsite_total_score(fwqStatisticsDao.getOtherCheckScore(fwq));
+                }else{
+                    feeObj.setOnsite_total_score(0);
+                }
+                fwq.setCheck_type(12);
+                if(fwqStatisticsDao.getOtherCheckScore(fwq) != null){
+                    feeObj.setOnsite_total_score(fwqStatisticsDao.getOtherCheckScore(fwq));
+                }else{
+                    feeObj.setOnsite_total_score(0);
+                }
                 feeStationMap.put(feeObj.getDept_id(), feeObj);
             }
         }
         // 需要补充的
         List<FwqStatisticsBean> reList = new ArrayList<>();
-
         // 获取所有的服务区
         List<FwqStatisticsBean> feeStationList = new ArrayList<>();
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         for (FeeStation sta : saList) {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
@@ -1149,4 +1186,166 @@ public class StatisticsServiceImpl implements StatisticsService_F {
         scoreList.addAll(reList);
         return scoreList;
     }
+
+    public  Map<Long, FwqStatisticsBean> getQWzdCheckedItemScoreInfo(List<User> userlist, FwqStatisticsBean obj){
+        Map<Long, Item> itemMap = commonService.getItemMap();
+        Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
+//        for (User sta : userlist) {
+//            FwqStatisticsBean obj2 = new FwqStatisticsBean();
+//           obj2.setUser(sta);
+//            mapStationInfos.put(Long.valueOf(sta.getId()), obj2);
+//        }
+        if (obj.getStart_date() != null && obj.getEnd_date() != null) {
+            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
+            if (p != null) {
+                obj.setPeriod_id(p.getId());
+            }
+        }
+        List<User> taskList = fwqStatisticsDao.selectWGCheckNum(obj);
+        List<User> recordList = fwqStatisticsDao.selectRecordNum(obj);
+      for(int i =0;i<taskList.size();i++){
+          User sta = taskList.get(i);
+          FwqStatisticsBean obj2 = new FwqStatisticsBean();
+          obj2.setUser(sta);
+          obj2.setCheck_t_num(taskList.get(i).getAge());
+          obj2.setCheck_s_num(recordList.get(i).getAge());
+          mapStationInfos.put(Long.valueOf(sta.getId()), obj2);
+      }
+        List<FwqStatisticsBean> listCheckedScore = fwqStatisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
+        for (FwqStatisticsBean sta : listCheckedScore) {
+            Item item = itemMap.get(sta.getCheck_item_id().longValue());
+            if (item != null) {
+                sta.setItem_id(item.getParent_id().intValue());
+            }
+        }
+        for (int i = 0; i < listCheckedScore.size(); i++) {
+            for (int j = listCheckedScore.size() - 1; j > i; j--) {
+                //此处checkman_id所放为被考核人
+                if (listCheckedScore.get(j).getCheckman_id() != null && listCheckedScore.get(j).getItem_id() != null){
+                    if(listCheckedScore.get(j).getCheckman_id().equals(listCheckedScore.get(i).getCheckman_id())) {
+                        if (listCheckedScore.get(j).getItem_id().equals(listCheckedScore.get(i).getItem_id())) {
+                            listCheckedScore.get(i).setScore(listCheckedScore.get(i).getScore() + listCheckedScore.get(j).getScore());
+                            listCheckedScore.remove(j);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (FwqStatisticsBean sta : listCheckedScore) {
+            if (mapStationInfos.containsKey(Long.valueOf(sta.getCheckman_id()))) {
+                FwqStatisticsBean statis = mapStationInfos.get(Long.valueOf(sta.getCheckman_id()));
+                statis.setAll_check_score(statis.getAll_check_score() + sta.getScore());
+                // 组装扣分类型内容
+                if (itemMap.get(sta.getCheck_item_id().longValue()).getParent_id() != null) {
+                    sta.setId(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());
+                    }
+                }
+                statis.getChecked_socre_name().add(sta.getName());
+                statis.getChecked_score().add(sta.getScore());
+                statis.getChecked_score_ids().add(sta.getId());
+            }
+        }
+
+        SimpleDateFormat time=new SimpleDateFormat("yyyy/MM");
+        FwqCheckOther fwqCheckOther = new FwqCheckOther();
+        fwqCheckOther.setCheck_time_name(time.format(obj.getEnd_date().getTime()));
+        fwqCheckOther.setCheck_type(11);
+        List<FwqStatisticsBean> listOnsiteScore = fwqStatisticsDao.selectOtherCheckedPersonScoreDetail(fwqCheckOther);
+        for (FwqStatisticsBean sta : listOnsiteScore) {
+            Item item = itemMap.get(sta.getCheck_item_id().longValue());
+            if (item != null) {
+                sta.setItem_id(item.getParent_id().intValue());
+            }
+        }
+        for (int i = 0; i < listOnsiteScore.size(); i++) {
+            for (int j = listOnsiteScore.size() - 1; j > i; j--) {
+                //此处checkman_id所放为被考核人
+                if (listOnsiteScore.get(j).getCheckman_id() != null && listOnsiteScore.get(j).getItem_id() != null){
+                    if(listOnsiteScore.get(j).getCheckman_id().equals(listOnsiteScore.get(i).getCheckman_id())) {
+                        if (listOnsiteScore.get(j).getItem_id().equals(listOnsiteScore.get(i).getItem_id())) {
+                            listOnsiteScore.get(i).setScore(listOnsiteScore.get(i).getScore() + listOnsiteScore.get(j).getScore());
+                            listOnsiteScore.remove(j);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (FwqStatisticsBean sta : listOnsiteScore) {
+            if (mapStationInfos.containsKey(Long.valueOf(sta.getCheckman_id()))) {
+                FwqStatisticsBean statis = mapStationInfos.get(Long.valueOf(sta.getCheckman_id()));
+                statis.setOnsite_total_score(statis.getOnsite_total_score() + sta.getScore());
+                // 组装扣分类型内容
+                if (itemMap.get(sta.getCheck_item_id().longValue()).getParent_id() != null) {
+                    sta.setId(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());
+                    }
+                }
+                statis.getOnsite_socre_name().add(sta.getName());
+                statis.getOnsite_score().add(sta.getScore());
+               // statis.getChecked_score_ids().add(sta.getId());
+            }
+        }
+        fwqCheckOther.setCheck_type(12);
+        List<FwqStatisticsBean> listThirdScore = fwqStatisticsDao.selectOtherCheckedPersonScoreDetail(fwqCheckOther);
+        for (FwqStatisticsBean sta : listThirdScore) {
+            Item item = itemMap.get(sta.getCheck_item_id().longValue());
+            if (item != null) {
+                sta.setItem_id(item.getParent_id().intValue());
+            }
+        }
+        for (int i = 0; i < listThirdScore.size(); i++) {
+            for (int j = listThirdScore.size() - 1; j > i; j--) {
+                //此处checkman_id所放为被考核人
+                if (listThirdScore.get(j).getCheckman_id() != null && listThirdScore.get(j).getItem_id() != null){
+                    if(listThirdScore.get(j).getCheckman_id().equals(listThirdScore.get(i).getCheckman_id())) {
+                        if (listThirdScore.get(j).getItem_id().equals(listThirdScore.get(i).getItem_id())) {
+                            listThirdScore.get(i).setScore(listThirdScore.get(i).getScore() + listThirdScore.get(j).getScore());
+                            listThirdScore.remove(j);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (FwqStatisticsBean sta : listThirdScore) {
+            if (mapStationInfos.containsKey(Long.valueOf(sta.getCheckman_id()))) {
+                FwqStatisticsBean statis = mapStationInfos.get(Long.valueOf(sta.getCheckman_id()));
+                statis.setThird_total_score(statis.getThird_total_score() + sta.getScore());
+                // 组装扣分类型内容
+                if (itemMap.get(sta.getCheck_item_id().longValue()).getParent_id() != null) {
+                    sta.setId(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());
+                    }
+                }
+                statis.getThird_socre_name().add(sta.getName());
+                statis.getThird_score().add(sta.getScore());
+                // statis.getChecked_score_ids().add(sta.getId());
+            }
+        }
+        return mapStationInfos;
+    }
+
+       public List<CheckNum> selectQzdCheckNum(FwqStatisticsBean obj){
+           List<CheckNum> objList = fwqStatisticsDao.selectQzdCheckNum(obj);
+           Map<Long, Item> itemMap = commonService.getItemMap();
+           Map<Long, Organ> deptMap = commonService.getDeptMap();
+           for (CheckNum sta : objList) {
+               obj.setDept_id(sta.getDept().longValue());
+               sta.setDeptName(deptMap.get(sta.getDept().longValue()).getOrganname());
+              sta.setIsApplyNunm(fwqStatisticsDao.selectQzdApplyNum(obj));
+           }
+           return objList;
+       }
 }

+ 29 - 12
Visuallnspection_qzd/src/main/java/com/xintong/visualinspection/visuallnspection_qzd/service/impl/StatisticsService_FImpl.java

@@ -61,23 +61,38 @@ public class StatisticsService_FImpl implements StatisticsService_F {
 
     public List<FwqStatisticsBean> getOperationInfo(FwqStatisticsBean obj) {
 
-        // 获得所有服务区数据
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
+        if (obj.getStart_date() != null && obj.getEnd_date() != null) {
+            CheckTaskPeriod p = commonService.getCheckTaskPeriod(obj.getStart_date().getTime() + 1 * 1000 * 60 * 60, obj.getEnd_date().getTime() + 1 * 1000 * 60 * 60);
+            if (p != null) {
+                obj.setPeriod_id(p.getId());
+            }
+        }
+        int sort = 1;
         for (FeeStation sta : saList) {
             FwqStatisticsBean obj2 = new FwqStatisticsBean();
             obj2.setDept_id(Long.valueOf(sta.getDeptid()));
             obj2.setName(sta.getName());
             mapStationInfos.put(Long.valueOf(sta.getDeptid()), obj2);
+            FwqStatisticsBean obj3 = new FwqStatisticsBean();
+            obj3.setDept_id(Long.valueOf(sta.getDeptid()));
+            obj3.setStart_date(obj.getStart_date());
+            obj3.setEnd_date(obj.getEnd_date());
+            obj3.setPeriod_id(obj.getPeriod_id());
+            mapStationInfos.get(Long.valueOf(sta.getDeptid())).setCheck_t_num(qzdStatisticsDao.selectDeptChedkpeople(obj3));
+            mapStationInfos.get(Long.valueOf(sta.getDeptid())).setOther_check_num(qzdStatisticsDao.selectDeptRecord(obj3));
+            mapStationInfos.get(Long.valueOf(sta.getDeptid())).setId(sort);
+            sort++;
         }
 
         // 获取公司检查的某个收费站的受检次数和扣分合计
         List<FwqStatisticsBean> company_beans =  getFeeStationCheckItemScore(obj);
         // 获取第三方暗访稽查的某个服务区的受检次数和扣分合计
-        obj.setCheck_type(8);
+        obj.setCheck_type(12);
         List<FwqStatisticsBean> third_beans = qzdStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
         // 获取现场稽查的某个服务区的受检次数和扣分合计
-        obj.setCheck_type(9);
+        obj.setCheck_type(11);
         List<FwqStatisticsBean> onsite_beans = qzdStatisticsDao.getselectFeeStationOperationScoreDetail(obj);
 
         for (FwqStatisticsBean company_bean : company_beans) {
@@ -115,12 +130,12 @@ public class StatisticsService_FImpl implements StatisticsService_F {
             value.setScore_avg(score_avg.toString());
         }
         List<FwqStatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
-        sortList.sort(new Comparator<FwqStatisticsBean>() {
-            @Override
-            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
-                return o1.compare3To(o2);
-            }
-        });
+//        sortList.sort(new Comparator<FwqStatisticsBean>() {
+//            @Override
+//            public int compare(FwqStatisticsBean o1, FwqStatisticsBean o2) {
+//                return o1.compare3To(o2);
+//            }
+//        });
 
         List<FwqStatisticsBean> temp = new ArrayList<>();
         temp.addAll(sortList);
@@ -150,6 +165,8 @@ public class StatisticsService_FImpl implements StatisticsService_F {
             }
         }
 
+        CheckTaskPeriod period = commonService.getCheckTaskPeriod(obj.getStart_date().getTime()+1 * 1000 * 60 * 60, obj.getEnd_date().getTime()+1 * 1000 * 60 * 60);
+
         return sortList;
     }
 
@@ -376,7 +393,7 @@ public class StatisticsService_FImpl implements StatisticsService_F {
     public List<FwqStatisticsBean> getFeeStationCheckItemScore(FwqStatisticsBean obj) {
 
         // 获得所有服务区数据
-        List<FeeStation> saList = commonService.getAllDeptByLayer("SA");
+        List<FeeStation> saList = commonService.getAllDeptByLayer("WG");
         Map<Long, Item> itemMap = commonService.getItemMap();
         Map<Long, FwqStatisticsBean> mapStationInfos = new HashMap<>();
         for (FeeStation sta : saList) {
@@ -488,7 +505,7 @@ public class StatisticsService_FImpl implements StatisticsService_F {
         float lygScore = 0.00f, ycScore = 0.00f, ntScore = 0.00f;
         int lygCheckNum = 0, ycCheckNum = 0, ntCheckNum = 0;
         Map<String, Integer> scoreTypeMap = new HashMap<>();
-        List<String> itemAll = commonService.getCheckItemName(28L);
+        List<String> itemAll = commonService.getCheckItemName(25L);
         Map<Long, Organ> deptMap = commonService.getDeptMap();
         // 处理数据
         for (FwqStatisticsBean st : list) {

BIN
Visuallnspection_qzd/src/main/resources/fwq_operation_info.xls