温红权 8 лет назад
Родитель
Сommit
6ed19326a2

+ 6 - 3
VisualInspection/js/statistics/user_check_statistics.js

@@ -16,6 +16,7 @@ $(function() {
     });
 
     $("#month_date_from").val("2017-07");
+    $("#month_date_to").val(moment(moment().format("YYYY-MM")).subtract(1, "month").format("YYYY-MM"));
 
 
     $("#searchbtn").on("click", function() {
@@ -30,7 +31,7 @@ $(function() {
     });
 
 
-    getscore("2017-07", "2018-02", 3, 985, 1000);
+    getscore("2017-07", moment(moment().format("YYYY-MM")).subtract(1, "month").format("YYYY-MM"), 3, 985, 1000);
 
 
 
@@ -55,6 +56,8 @@ function getscore(starttime, endtime, limitnumber, limitscore, limitscore2) {
     post_common_service(url, data_p, function(data) {
 
         var table = '';
+        console.log(data.length)
+        $("#totlapeople").html(data.length);
         for (var i in data) {
             var ss = data[i];
             var dat = "";
@@ -63,7 +66,7 @@ function getscore(starttime, endtime, limitnumber, limitscore, limitscore2) {
                 dat += po.p_str + "月、";
             }
             dat = dat.substring(0, dat.length - 1);
-            table += "<tr><td width='5%;'>" + (parseInt(i) + 1) + "</td><td width='15%;'>" + ss.user.workno + "</td><td width='15%;'>" + ss.dept + "</td><td width='15%;'><a href='JavaScript:void(0)' onclick='jumpuser(\"" + ss.user.id + "\",\"" + ss.user.organid + "\")'>" + ss.user.truename + "</a></td><td width='50%;'>" + dat + "</td></tr>";
+            table += "<tr><td width='5%;'>" + (parseInt(i) + 1) + "</td><td width='10%;'>" + ss.user.workno + "</td><td width='15%;'>" + ss.dept + "</td><td width='10%;'><a href='JavaScript:void(0)' onclick='jumpuser(\"" + ss.user.id + "\",\"" + ss.user.organid + "\")'>" + ss.user.truename + "</a></td><td width='60%;'>" + dat + "</td></tr>";
 
 
         }
@@ -74,7 +77,7 @@ function getscore(starttime, endtime, limitnumber, limitscore, limitscore2) {
         $('[data-toggle="tooltip"]').tooltip();
         $("tr:gt(0):odd").css("background", "#EFEFEF");
 
-        console.log(data)
+
 
     });
 

+ 5 - 4
VisualInspection/view/statistics/user_check_statistics.html

@@ -92,16 +92,17 @@
 
 <div class="row ">
 
-    <div class="datatable" data-checkable="false" style="margin-bottom: 0px;margin-right:10px;" data-sortable="false">
+    <div class="datatable" data-checkable="false" style="margin-bottom: 0px;margin-right:10px;    background: #ffffff00;" data-sortable="false">
+        <label style="margin: 0;">共查询到 <span id="totlapeople" >0</span> 人</label>
         <div class="table-head">
             <table border="0" width="100%" align="center" style="margin-right:10px;">
                 <thead class="table-thead" align="center">
                     <tr>
                         <th width="5%">序号</th>
-                        <th width="15%">工号</th>
+                        <th width="10%">工号</th>
                         <th width="15%">部门</th>
-                        <th width="15%">姓名</th>
-                        <th width="50%">满足条件月份</th>
+                        <th width="10%">姓名</th>
+                        <th width="60%">满足条件月份</th>
                     </tr>
                 </thead>
             </table>

+ 13 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -2485,6 +2485,19 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
             }
         }
 
+        user_ids.sort(new Comparator<StatisiticPojo>() {
+            @Override
+            public int compare(StatisiticPojo o1, StatisiticPojo o2) {
+                if(o1.getUser().getOrganid()>o2.getUser().getOrganid()){
+                    return 1;
+                }
+                if(o1.getUser().getOrganid()<o2.getUser().getOrganid()){
+                    return -1;
+                }
+                return 0;
+            }
+        });
+
         return user_ids;
     }
 }