瀏覽代碼

一期修改融合

温红权 7 年之前
父節點
當前提交
2fb66bacb4

+ 36 - 3
VisualInspection/js/statistics/assess_ranking.js

@@ -211,6 +211,13 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
         var userChangeStationMap = new HashMap();
         for (var i in userChangeStations) {
             var s = userChangeStations[i];
+            if (userChangeStationMap.get(s.userid) != null) {
+                var p = [];
+                p.push(userChangeStationMap.get(s.userid));
+                p.push(s);
+                userChangeStationMap.set(s.userid, p);
+                continue;
+            }
             userChangeStationMap.set(s.userid, s);
         }
 
@@ -251,10 +258,36 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
                 var userChangeStation = userChangeStationMap.get(data[i].user.id);
                 var ischage = false;
                 var tiptext = "";
+                var texttip = "";
                 if (userChangeStation != null) {
                     ischage = true;
-                    tiptext = userChangeStation.old_dept_name + ":" + userChangeStation.old_dept_check_num + "次," +
-                        userChangeStation.new_dept_name + ":" + userChangeStation.new_dept_check_num + "次";
+                    if (userChangeStation instanceof Array) {
+                        for (var iii in userChangeStation) {
+                            var ppp = userChangeStation[iii];
+                            console.log(ppp);
+                            console.log(tiptext.indexOf(ppp.old_dept_name))
+                            console.log(tiptext.indexOf(ppp.new_dept_name))
+                            if (tiptext.indexOf(ppp.old_dept_name) == -1) {
+                                tiptext += (ppp.old_dept_name + ":" + ppp.old_dept_check_num + "次,");
+                                texttip += ("+" + ppp.old_dept_check_num);
+                            }
+                            if (tiptext.indexOf(ppp.new_dept_name) == -1) {
+                                tiptext += (ppp.new_dept_name + ":" + ppp.new_dept_check_num + "次,");
+                                texttip += ("+" + ppp.new_dept_check_num);
+                            }
+
+                        }
+
+                        texttip = texttip.substring(1);
+
+
+                    } else {
+
+                        tiptext = userChangeStation.old_dept_name + ":" + userChangeStation.old_dept_check_num + "次," +
+                            userChangeStation.new_dept_name + ":" + userChangeStation.new_dept_check_num + "次";
+
+                        texttip = userChangeStation.old_dept_check_num + "+" + userChangeStation.new_dept_check_num;
+                    }
                 }
 
                 var exuserHtml = "";
@@ -263,7 +296,7 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
 
                 var showNumberHtml = (isshownumber ? (filter(data[i].checked_num, '0') + (data[i].checked_num < 6 ? html : "")) : "-");
                 if (hasRole(ROLE_ADMIN) || hasRole(ROLE_JICHA_ADMIN)) {
-                    showNumberHtml = (ischage ? ("<span style='color:red;' data-toggle='tooltip' data-placement='right' title=" + tiptext + ">" + userChangeStation.old_dept_check_num + "+" + userChangeStation.new_dept_check_num + "</span>") : filter(data[i].checked_num, '0')) + html;
+                    showNumberHtml = (ischage ? ("<span style='color:red;' data-toggle='tooltip' data-placement='right' title=" + tiptext + ">" + texttip + "</span>") : filter(data[i].checked_num, '0')) + html;
                     exuserHtml = '<div class="switch"><input type="checkbox" onchange="exUserfun(this,' + data[i].user.id + ',' + data[i].period_id + ')" ' + (data[i].isEx ? 'checked="checked"' : '') + ' > <label>排除</label></div>';
                     $("#th_14").html("是否排除统计");
                 }

+ 27 - 14
VisualInspection/js/statistics/change_attendance.js

@@ -27,7 +27,7 @@ $(function() {
             // 检索
             getFsWorkInfo(0);
         }, userId);
-    },true);
+    }, true);
 
     $.jeDate("#sel_month", {
         isinitVal: true,
@@ -65,15 +65,15 @@ $(function() {
         // if (center_manage_id == '') {
         //     $("#fs_station,#fs_employee").html('');
         // } else {
-            getFsStationList(center_manage_id, function(obj) {
-                $("#fs_station").html(obj);
-                //默认选中第一个
-                $("#fs_station option:first").attr("selected", 'selected');
-                if (roleContains("STATION")) {
-                    var dept = getCurrentUser().organid;
-                    $("#fs_station").val(dept);
-                }
-            },true);
+        getFsStationList(center_manage_id, function(obj) {
+            $("#fs_station").html(obj);
+            //默认选中第一个
+            $("#fs_station option:first").attr("selected", 'selected');
+            if (roleContains("STATION")) {
+                var dept = getCurrentUser().organid;
+                $("#fs_station").val(dept);
+            }
+        }, true);
         // }
     })
 
@@ -155,15 +155,28 @@ function getTableContent(obj, seq) {
             class_type = d;
         }
 
+        var normal = false;
+
+        if (roleContains("STATION")) {
+            normal = true;
+        }
+        if (roleContains("ROAD_MANAGER")) {
+            normal = true;
+        }
+        if (hasRole("ROLE_STATION")) {
+            normal = true;
+        }
+
+
         for (var i = 26; i <= days; i++) {
             if (map_class[i + "-" + class_type] != undefined) {
                 if (map_class[i + "-" + class_type] == 1) {
                     class_html[d] += '<td>/</td width="20px">';
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
 
                 }
@@ -177,9 +190,9 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                 }
             } else {

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

@@ -32,7 +32,7 @@ $(function() {
                 // 检索
                 getFsWorkInfo(0);
             }, userId);
-        },true);
+        }, true);
 
         // 当初始化月份值
         var months = month_method_2();
@@ -67,15 +67,15 @@ $(function() {
             // if (center_manage_id == '') {
             //     $("#fs_station,#fs_employee").html('');
             // } else {
-                getFsStationList(center_manage_id, function(obj) {
-                    $("#fs_station").html(obj);
-                    //默认选中第一个
-                    $("#fs_station option:first").attr("selected", 'selected');
-                    if (roleContains("STATION")) {
-                        var dept = getCurrentUser().organid;
-                        $("#fs_station").val(dept);
-                    }
-                },true);
+            getFsStationList(center_manage_id, function(obj) {
+                $("#fs_station").html(obj);
+                //默认选中第一个
+                $("#fs_station option:first").attr("selected", 'selected');
+                if (roleContains("STATION")) {
+                    var dept = getCurrentUser().organid;
+                    $("#fs_station").val(dept);
+                }
+            }, true);
             // }
         })
 
@@ -156,6 +156,17 @@ function getTableContent(obj, seq) {
         if (d != 0) {
             class_type = d;
         }
+        var normal = false;
+
+        if (roleContains("STATION")) {
+            normal = true;
+        }
+        if (roleContains("ROAD_MANAGER")) {
+            normal = true;
+        }
+        if (hasRole("ROLE_STATION")) {
+            normal = true;
+        }
 
         for (var i = 26; i <= days; i++) {
             if (map_class[i + "-" + class_type] != undefined) {
@@ -163,9 +174,9 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                 }
             } else {
@@ -178,9 +189,9 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td  ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                 }
             } else {

+ 30 - 8
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -1,15 +1,15 @@
 package com.xintong.visualinspection.controller;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.*;
 import com.xintong.visualinspection.pojo.StatisiticPojo;
 import com.xintong.visualinspection.pojo.StatisticExUser;
 import com.xintong.visualinspection.pojo.UserRankingData;
+import com.xintong.visualinspection.util.AuthorUtil;
 import com.xintong.visualinspection.util.CacheUtil;
+import com.xintong.visualinspection.util.Constants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -18,6 +18,8 @@ import com.github.pagehelper.PageInfo;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.util.CodeUtil;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * 文件名:StatisticsController
  * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
@@ -289,11 +291,31 @@ public class StatisticsController extends BaseController {
      * 获取收费站具体某个人的扣分详情
      */
     @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
-    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody StatisticsBean obj,@PathVariable Integer page,@PathVariable Integer size){
-    	//PageHelper.offsetPage(page, size);
-    	PageHelper.startPage(page, size);
-    	List<StatisticsBean> returnList=  statisticsService.getOneCheckedDetailInfo(obj);
-    	return super.returnSuccessResult(new PageInfo(returnList));
+    public String getFsOnePersonCheckedItemDetailInfo(HttpServletRequest request, @RequestBody StatisticsBean obj, @PathVariable Integer page, @PathVariable Integer size){
+     	//PageHelper.offsetPage(page, size);
+        boolean isshow = true;
+        //获取个人权限
+        User user = getCurrentUser(request);
+        if(AuthorUtil.hasRole(user, Constants.ROLE_STATION_ADMIN)
+                ||AuthorUtil.hasRole(user, Constants.ROLE_STATION)
+                ||AuthorUtil.hasRole(user, Constants.ROLE_STATION_AGENT)
+                ||AuthorUtil.containsRole(user, "ROLE_STATION")){
+            //判断是否是单钱周期
+            Date a = new Date();
+            if(obj.getEnd_date()!=null && obj.getEnd_date().getTime()>a.getTime()){
+                isshow = false;
+            }
+        }
+
+        if(isshow){
+            PageHelper.startPage(page, size);
+            List<StatisticsBean> returnList=  statisticsService.getOneCheckedDetailInfo(obj);
+            return super.returnSuccessResult(new PageInfo(returnList));
+        }else{
+            return super.returnSuccessResult(new PageInfo(new ArrayList<StatisticsBean>()));
+        }
+
+
     }
     
     

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

@@ -332,7 +332,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 		//更新数据库统计
-      // threadTaskService.saveUserStatic(reList,obj.getStart_date().getTime(),obj.getEnd_date().getTime());
+       threadTaskService.saveUserStatic(reList,obj.getStart_date().getTime(),obj.getEnd_date().getTime());
 
 		return reList;
 	}