فهرست منبع

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

minitiger 8 سال پیش
والد
کامیت
b23701af6c

+ 112 - 99
VisualInspection/js/statistics/change_attendance.js

@@ -1,21 +1,20 @@
-
-$(function(){
+$(function() {
     setVisit();
     var road_manager;
-	if(roleContains("STATION")){
-        road_manager = getCurrentUser().road_manager_id;     
+    if (roleContains("STATION")) {
+        road_manager = getCurrentUser().road_manager_id;
     }
-    if(roleContains("ROAD_MANAGER")){
-        road_manager = getCurrentUser().organid;     
+    if (roleContains("ROAD_MANAGER")) {
+        road_manager = getCurrentUser().organid;
     }
-	setRoadManagerSelect("#center_manage",road_manager);
+    setRoadManagerSelect("#center_manage", road_manager);
     // 初始化部门下的收费站
-    getFsStationList(GV("#center_manage"),function(obj){
+    getFsStationList(GV("#center_manage"), function(obj) {
         $("#fs_station").html(obj);
-         //默认选中第一个
-        $("#fs_station option:first").attr("selected", 'selected'); 
-        if(roleContains("STATION")){
-            var dept = getCurrentUser().organid;     
+        //默认选中第一个
+        $("#fs_station option:first").attr("selected", 'selected');
+        if (roleContains("STATION")) {
+            var dept = getCurrentUser().organid;
             $("#fs_station").val(dept);
         }
         var userId;
@@ -23,17 +22,17 @@ $(function(){
             userId = getCurrentUser().id;
         }
         // 初始化收费站下的人数
-        getFsEmployee(GV("#fs_station"),function(obj){
+        getFsEmployee(GV("#fs_station"), function(obj) {
             $("#fs_employee").html(obj);
             // 检索
             getFsWorkInfo(0);
-        },userId);
+        }, userId);
     });
 
-    $.jeDate("#sel_month",{
-		isinitVal:true,
-		format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
-	});
+    $.jeDate("#sel_month", {
+        isinitVal: true,
+        format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
+    });
     // 当初始化月份值
     var months = month_method_2();
     // for(var i=0; i < months.length;i++){
@@ -45,33 +44,33 @@ $(function(){
 
     // 根据月份确定天数
     monthChange();
-     $("#month_name").html( GV("#sel_month"));
+    $("#month_name").html(GV("#sel_month"));
 
 
     // 收费站中心选择
-    $("#fs_station").change(function(){
+    $("#fs_station").change(function() {
         var fee_station_id = GV(this);
-        if(fee_station_id == ''){
+        if (fee_station_id == '') {
             $("#fs_employee").html('');
-        }else{
-            getFsEmployee(fee_station_id,function(obj){
+        } else {
+            getFsEmployee(fee_station_id, function(obj) {
                 $("#fs_employee").html(obj);
             });
         }
     })
 
     // 导管中心选择
-    $("#center_manage").change(function(){
+    $("#center_manage").change(function() {
         var center_manage_id = GV(this);
-        if(center_manage_id == ''){
+        if (center_manage_id == '') {
             $("#fs_station,#fs_employee").html('');
-        }else{
-            getFsStationList(center_manage_id,function(obj){
+        } 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 option:first").attr("selected", 'selected');
+                if (roleContains("STATION")) {
+                    var dept = getCurrentUser().organid;
                     $("#fs_station").val(dept);
                 }
             });
@@ -79,107 +78,121 @@ $(function(){
     })
 
     // 查询
-    $("#searchBtn").click(function(){        
-        $("#month_name").html( GV("#sel_month") )
-        getFsWorkInfo(1);
-    })
-    // end
+    $("#searchBtn").click(function() {
+            $("#month_name").html(GV("#sel_month"))
+            getFsWorkInfo(1);
+        })
+        // end
 })
 
 /**
  * 检索出勤明细数据
- * @param {*} param 
+ * @param {*} param
  */
-function getFsWorkInfo(flag){
+function getFsWorkInfo(flag) {
 
     var param = {
-           "start_time": timeTranslate( GV("#sel_month") ) ,
-            "end_time": (GV("#sel_month")+"/25 23:00:00").replace("/","-").replace("/","-")
+        "start_time": timeTranslate(GV("#sel_month")),
+        "end_time": (GV("#sel_month") + "/25 23:00:00").replace("/", "-").replace("/", "-")
     }
-    
-    if(GV("#fs_employee")!=''){
-            param[ 'user_id'] = GV("#fs_employee");
-    }else if(GV("#fs_station")!=''){
-        param[ 'dept_id' ] = GV("#fs_station");
-    }else if(GV("#center_manage") != ''){
-            param[ 'parent_dept_id' ] = GV("#center_manage");
+
+    if (GV("#fs_employee") != '') {
+        param['user_id'] = GV("#fs_employee");
+    } else if (GV("#fs_station") != '') {
+        param['dept_id'] = GV("#fs_station");
+    } else if (GV("#center_manage") != '') {
+        param['parent_dept_id'] = GV("#center_manage");
     }
     //加载层
-    var index = layer.load(2, {shade: false}); //0代表加载的风格,支持0-2
-    post_common_service("statistics/fs/unregular/work/info",param,function(data){
+    var index = layer.load(2, { shade: false }); //0代表加载的风格,支持0-2
+    post_common_service("statistics/fs/unregular/work/info", param, function(data) {
         layer.close(index);
-        if(flag == 0 && $("#ca-a-table").children().length > 0 ){
-            return ;
+        if (flag == 0 && $("#ca-a-table").children().length > 0) {
+            return;
         }
         // 月份变化
         monthChange();
         $("#ca-a-table").empty();
-        if(data.length >0){
-            for(var i=0;i< data.length;i++){
-                if(data[i].userName != undefined){
-                    $("#ca-a-table").append( getTableContent(data[i],i+1));
+        if (data.length > 0) {
+            for (var i = 0; i < data.length; i++) {
+                if (data[i].userName != undefined) {
+                    $("#ca-a-table").append(getTableContent(data[i], i + 1));
                 }
             }
         }
-    },function(error){
+    }, function(error) {
         layer.close(index);
     });
 }
 
 /**
  * 拼接表格内容
- * @param {*} obj 
- * @param {*} seq 
+ * @param {*} obj
+ * @param {*} seq
  */
-function getTableContent(obj,seq){
-    var days = getDaysByDate1(GV("#sel_month")+"/01");
+function getTableContent(obj, seq) {
+    var days = getDaysByDate1(GV("#sel_month") + "/01");
     var map_class = {};
-    for(var z=0; z < obj.subStatisticsFsWork.length ;z++){
-            // console.log(obj.subStatisticsFsWork[z])
-        if(obj.subStatisticsFsWork[z].check_id !=undefined){
-            map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
-        }else{
-            if(  map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] == null ){
-                map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+    for (var z = 0; z < obj.subStatisticsFsWork.length; z++) {
+
+        if (obj.subStatisticsFsWork[z].check_id != undefined) {
+            if (obj.subStatisticsFsWork[z].status != undefined && obj.subStatisticsFsWork[z].status == 1) {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 3;
+            } else {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 2;
+            }
+
+        } else {
+            if (map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] == null) {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 1;
             }
         }
     }
     var class_html = [];
-    for(var d=0;d<3;d++){
+    for (var d = 0; d < 3; d++) {
         var class_type = 3;
-        if(d != 0){
-            class_type = d ;
+        if (d != 0) {
+            class_type = d;
         }
 
-        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{
-                    class_html[d] += '<td class="b-grey" width="20px">/</td>' ;
+        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>';
+                    } else {
+                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                    }
+
                 }
-            }else{
-                class_html[d] += '<td width="20px"></td>' ;
+            } else {
+                class_html[d] += '<td width="20px"></td>';
             }
         }
-        for(var i=1; i<=25; i++){
-            if( map_class[i+"-"+class_type] !=undefined ){
-                if( map_class[i+"-"+class_type]==1){
-                    class_html[d] += '<td width="20px">/</td>' ;
-                }else{
-                    class_html[d] += '<td class="b-grey" width="20px">/</td>' ;
+        for (var i = 1; i <= 25; i++) {
+            if (map_class[i + "-" + class_type] != undefined) {
+                if (map_class[i + "-" + class_type] == 1) {
+                    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>';
+                    } else {
+                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                    }
                 }
-            }else{
-                class_html[d] += '<td width="20px"></td>' ;
+            } else {
+                class_html[d] += '<td width="20px"></td>';
             }
         }
     }
 
-    var content = "<tr><td rowspan='3' width='4%'>"+seq+"</td> <td rowspan='3' width='4%'>"+obj.feeStationName+"</td> <td rowspan='3' width='4%'>"+obj.userName+
-            "</td> <td rowspan='3' width='4%'>"+obj.positionName+"</td><td rowspan='3' width='8%'>"+ obj.workno +"</td><td width='4%'>夜班</td> "+class_html[0]+"<td rowspan='3' width='4%'>"+
-            obj.work_days+"</td><td rowspan='3' width='4%'>"+convertT(obj.work_minutes)+"</td><td rowspan='3' width='4%'></td> </tr>\
-        <tr><td width='4%'>早班</td> "+class_html[1]+" </tr>\
-        <tr><td width='4%'>中班</td> "+ class_html[2] +" </tr>" ;
+    var content = "<tr><td rowspan='3' width='4%'>" + seq + "</td> <td rowspan='3' width='4%'>" + obj.feeStationName + "</td> <td rowspan='3' width='4%'>" + obj.userName +
+        "</td> <td rowspan='3' width='4%'>" + obj.positionName + "</td><td rowspan='3' width='8%'>" + obj.workno + "</td><td width='4%'>夜班</td> " + class_html[0] + "<td rowspan='3' width='4%'>" +
+        obj.work_days + "</td><td rowspan='3' width='4%'>" + convertT(obj.work_minutes) + "</td><td rowspan='3' width='4%'></td> </tr>\
+        <tr><td width='4%'>早班</td> " + class_html[1] + " </tr>\
+        <tr><td width='4%'>中班</td> " + class_html[2] + " </tr>";
 
     return content;
 }
@@ -187,18 +200,18 @@ function getTableContent(obj,seq){
 /**
  * 月份变化 , 天数变化
  */
-function monthChange(){
+function monthChange() {
     $(".m28").show();
-    $(".m"+getDaysByDate1(GV("#sel_month")+"/01")).hide();
+    $(".m" + getDaysByDate1(GV("#sel_month") + "/01")).hide();
 }
 
-function setVisit(){
-	if(roleContains("STATION")){
-		$("#center_manage").attr("disabled","disabled");
-		$("#fs_station").attr("disabled","disabled");
-	}
-	if(roleContains("ROAD_MANAGER")){
-		$("#center_manage").attr("disabled","disabled");
+function setVisit() {
+    if (roleContains("STATION")) {
+        $("#center_manage").attr("disabled", "disabled");
+        $("#fs_station").attr("disabled", "disabled");
+    }
+    if (roleContains("ROAD_MANAGER")) {
+        $("#center_manage").attr("disabled", "disabled");
     }
     if (hasRole("ROLE_STATION")) {
         $("#fs_employee").attr("disabled", "disabled");

+ 177 - 167
VisualInspection/js/statistics/common_attendance.js

@@ -1,189 +1,199 @@
-
-$(function(){
-    setVisit();
-    var road_manager;
-	if(roleContains("STATION")){
-        road_manager = getCurrentUser().road_manager_id;     
-    }
-    if(roleContains("ROAD_MANAGER")){
-        road_manager = getCurrentUser().organid;     
-    }
-	setRoadManagerSelect("#center_manage",road_manager,false);
-
-    $.jeDate("#sel_month",{
-		isinitVal:true,
-		format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
-	});
-    // 初始化部门下的收费站
-     getFsStationList(GV("#center_manage"),function(obj){
-        $("#fs_station").html(obj);
-        //默认选中第一个
-        $("#fs_station option:first").attr("selected", 'selected'); 
-        if(roleContains("STATION")){
-            var dept = getCurrentUser().organid;     
-            $("#fs_station").val(dept);
+$(function() {
+        setVisit();
+        var road_manager;
+        if (roleContains("STATION")) {
+            road_manager = getCurrentUser().road_manager_id;
         }
-        var userId;
-        if (hasRole("ROLE_STATION")) {
-            userId = getCurrentUser().id;
+        if (roleContains("ROAD_MANAGER")) {
+            road_manager = getCurrentUser().organid;
         }
-        // 初始化收费站下的人数
-        getFsEmployee(GV("#fs_station"),function(obj){
-            $("#fs_employee").html(obj);
-            // 检索
-            getFsWorkInfo(0);
-        },userId);
-    });
-
-    // 当初始化月份值
-    var months = month_method_2();
-    // for(var i=0; i < months.length;i++){
-    //     $("#sel_month").append('<option value= "'+ months[i]  +'">'+ months[i] +'</option>');
-    // }
-
-    // 当前月份初始化
-    // $("#sel_month").val(months[months.length-1 ]);
-
-    // 根据月份确定天数
-    monthChange();
- 
-     $("#month_name").html( GV("#sel_month"));
-
-
-    // 收费站中心选择
-    $("#fs_station").change(function(){
-        var fee_station_id = GV(this);
-        if(fee_station_id == ''){
-            $("#fs_employee").html('');
-        }else{
-            getFsEmployee(fee_station_id,function(obj){
+        setRoadManagerSelect("#center_manage", road_manager, false);
+
+        $.jeDate("#sel_month", {
+            isinitVal: true,
+            format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
+        });
+        // 初始化部门下的收费站
+        getFsStationList(GV("#center_manage"), function(obj) {
+            $("#fs_station").html(obj);
+            //默认选中第一个
+            $("#fs_station option:first").attr("selected", 'selected');
+            if (roleContains("STATION")) {
+                var dept = getCurrentUser().organid;
+                $("#fs_station").val(dept);
+            }
+            var userId;
+            if (hasRole("ROLE_STATION")) {
+                userId = getCurrentUser().id;
+            }
+            // 初始化收费站下的人数
+            getFsEmployee(GV("#fs_station"), function(obj) {
                 $("#fs_employee").html(obj);
-            });
-        }
-    })
+                // 检索
+                getFsWorkInfo(0);
+            }, userId);
+        });
+
+        // 当初始化月份值
+        var months = month_method_2();
+        // for(var i=0; i < months.length;i++){
+        //     $("#sel_month").append('<option value= "'+ months[i]  +'">'+ months[i] +'</option>');
+        // }
+
+        // 当前月份初始化
+        // $("#sel_month").val(months[months.length-1 ]);
+
+        // 根据月份确定天数
+        monthChange();
+
+        $("#month_name").html(GV("#sel_month"));
+
+
+        // 收费站中心选择
+        $("#fs_station").change(function() {
+            var fee_station_id = GV(this);
+            if (fee_station_id == '') {
+                $("#fs_employee").html('');
+            } else {
+                getFsEmployee(fee_station_id, function(obj) {
+                    $("#fs_employee").html(obj);
+                });
+            }
+        })
+
+        // 导管中心选择
+        $("#center_manage").change(function() {
+            var center_manage_id = GV(this);
+            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);
+                    }
+                });
+            }
+        })
+
+        // 查询
+        $("#searchBtn").click(function() {
+                $("#month_name").html(GV("#sel_month"))
+                getFsWorkInfo(1);
+            })
+            // end
+
+        /**
+         * 检索出勤明细数据
+         * @param {*} param
+         */
+        function getFsWorkInfo(flag) {
+
+            var param = {
+                "start_time": timeTranslate(GV("#sel_month")),
+                "end_time": (GV("#sel_month") + "/25 23:00:00").replace("/", "-").replace("/", "-")
+            }
 
-    // 导管中心选择
-    $("#center_manage").change(function(){
-        var center_manage_id = GV(this);
-        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);
+            if (GV("#fs_employee") != '') {
+                param['user_id'] = GV("#fs_employee");
+            } else if (GV("#fs_station") != '') {
+                param['dept_id'] = GV("#fs_station");
+            } else if (GV("#center_manage") != '') {
+                param['parent_dept_id'] = GV("#center_manage");
+            }
+            //加载层
+            var index = layer.load(2, { shade: false }); //0代表加载的风格,支持0-2
+            post_common_service("statistics/fs/work/info", param, function(data) {
+                layer.close(index);
+                if (flag == 0 && $("#c-a-tbody").children().length > 0) {
+                    return;
+                }
+                // 月份变化
+                monthChange();
+                $("#c-a-tbody").empty();
+                if (data.length > 0) {
+                    var seq = 1;
+                    for (var i = 0; i < data.length; i++) {
+                        if (data[i].userName != undefined) {
+                            $("#c-a-tbody").append(getTableContent(data[i], seq++));
+                        }
+                    }
                 }
+            }, function(error) {
+                layer.close(index);
             });
         }
-    })
 
-    // 查询
-    $("#searchBtn").click(function(){        
-        $("#month_name").html( GV("#sel_month") )
-        getFsWorkInfo(1);
     })
-    // end
-
     /**
-     * 检索出勤明细数据
-     * @param {*} param 
+     * 拼接表格内容
+     * @param {*} obj
+     * @param {*} seq
      */
-    function getFsWorkInfo(flag){
-
-        var param = {
-            "start_time": timeTranslate( GV("#sel_month") ) ,
-            "end_time": (GV("#sel_month")+"/25 23:00:00").replace("/","-").replace("/","-")
-        }
-        
-        if(GV("#fs_employee")!=''){
-                param[ 'user_id'] = GV("#fs_employee");
-        }else if(GV("#fs_station")!=''){
-            param[ 'dept_id' ] = GV("#fs_station");
-        }else if(GV("#center_manage") != ''){
-                param[ 'parent_dept_id' ] = GV("#center_manage");
-        }
-        //加载层
-        var index = layer.load(2, {shade: false}); //0代表加载的风格,支持0-2
-        post_common_service("statistics/fs/work/info",param,function(data){
-            layer.close(index);
-            if(flag == 0 && $("#c-a-tbody").children().length > 0 ){
-                return ;
-            }
-            // 月份变化
-            monthChange();
-            $("#c-a-tbody").empty();
-            if(data.length >0){
-                var seq = 1 ;
-                for(var i=0;i< data.length;i++){
-                    if(data[i].userName != undefined){
-                        $("#c-a-tbody").append( getTableContent(data[i],seq++));
-                    }
-                }
+function getTableContent(obj, seq) {
+    var days = getDaysByDate1(GV("#sel_month") + "/01");
+    var map_class = {};
+    for (var z = 0; z < obj.subStatisticsFsWork.length; z++) {
+        if (obj.subStatisticsFsWork[z].check_id != undefined) {
+            if (obj.subStatisticsFsWork[z].status != undefined && obj.subStatisticsFsWork[z].status == 1) {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 3;
+            } else {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 2;
             }
-        },function(error){
-            layer.close(index);
-        });
-    }
 
-})
-/**
- * 拼接表格内容
- * @param {*} obj 
- * @param {*} seq 
- */
-function getTableContent(obj,seq){
-    var days = getDaysByDate1(GV("#sel_month")+"/01");
-    var map_class = {};
-    for(var z=0; z < obj.subStatisticsFsWork.length ;z++){
-        if(obj.subStatisticsFsWork[z].check_id !=undefined){
-           
-            map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
-        
-        }else{
-            if(  map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] == null ){
-                map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
+        } else {
+            if (map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] == null) {
+                map_class[getD(obj.subStatisticsFsWork[z].work_date) + "-" + obj.subStatisticsFsWork[z].class_type] = 1;
             }
         }
     }
     var class_html = [];
-    for(var d=0;d<3;d++){
+    for (var d = 0; d < 3; d++) {
         var class_type = 3;
-        if(d != 0){
-            class_type = d ;
+        if (d != 0) {
+            class_type = d;
         }
 
-        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 width="20px">/</td>' ;
-                }else{
-                    class_html[d] += '<td class="b-grey" width="20px">/</td>' ;
+        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 width="20px">/</td>';
+                } else {
+                    if (map_class[i + "-" + class_type] == 3) {
+                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                    } else {
+                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                    }
                 }
-            }else{
-                class_html[d] += '<td width="20px"></td>' ;
+            } else {
+                class_html[d] += '<td width="20px"></td>';
             }
         }
-        for(var i=1; i<=25; i++){
-            if( map_class[i+"-"+class_type] !=undefined ){
-                if( map_class[i+"-"+class_type]==1){
-                    class_html[d] += '<td width="20px">/</td>' ;
-                }else{
-                    class_html[d] += '<td class="b-grey" width="20px">/</td>' ;
+        for (var i = 1; i <= 25; i++) {
+            if (map_class[i + "-" + class_type] != undefined) {
+                if (map_class[i + "-" + class_type] == 1) {
+                    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>';
+                    } else {
+                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                    }
                 }
-            }else{
-                class_html[d] += '<td width="20px"></td>' ;
+            } else {
+                class_html[d] += '<td width="20px"></td>';
             }
         }
     }
 
-    var content = "<tr><td rowspan='3' width='4%'>"+seq+"</td> <td rowspan='3' width='4%'>"+obj.feeStationName+"</td> <td rowspan='3' width='4%'>"+obj.userName+
-            "</td> <td rowspan='3' width='4%'>"+obj.positionName+"</td><td rowspan='3' width='8%'>"+ obj.workno +"</td><td width='4%'>夜班</td> "+class_html[0]+"<td rowspan='3' width='4%'>"+
-            obj.work_days+"</td><td rowspan='3' width='4%'>"+convertT(obj.work_minutes)+"</td><td rowspan='3' width='3%'></td> </tr>\
-        <tr><td width='4%'>早班</td> "+class_html[1]+" </tr>\
-        <tr><td width='4%'>中班</td> "+ class_html[2] +" </tr>" ;
+    var content = "<tr><td rowspan='3' width='4%'>" + seq + "</td> <td rowspan='3' width='4%'>" + obj.feeStationName + "</td> <td rowspan='3' width='4%'>" + obj.userName +
+        "</td> <td rowspan='3' width='4%'>" + obj.positionName + "</td><td rowspan='3' width='8%'>" + obj.workno + "</td><td width='4%'>夜班</td> " + class_html[0] + "<td rowspan='3' width='4%'>" +
+        obj.work_days + "</td><td rowspan='3' width='4%'>" + convertT(obj.work_minutes) + "</td><td rowspan='3' width='3%'></td> </tr>\
+        <tr><td width='4%'>早班</td> " + class_html[1] + " </tr>\
+        <tr><td width='4%'>中班</td> " + class_html[2] + " </tr>";
 
     return content;
 }
@@ -191,18 +201,18 @@ function getTableContent(obj,seq){
 /**
  * 月份变化 , 天数变化
  */
-function monthChange(){
+function monthChange() {
     $(".m28").show();
-    $(".m"+getDaysByDate1(GV("#sel_month")+'/01')).hide();
+    $(".m" + getDaysByDate1(GV("#sel_month") + '/01')).hide();
 }
 
-function setVisit(){
-	if(roleContains("STATION")){
-		$("#center_manage").attr("disabled","disabled");
-		$("#fs_station").attr("disabled","disabled");
-	}
-	if(roleContains("ROAD_MANAGER")){
-		$("#center_manage").attr("disabled","disabled");
+function setVisit() {
+    if (roleContains("STATION")) {
+        $("#center_manage").attr("disabled", "disabled");
+        $("#fs_station").attr("disabled", "disabled");
+    }
+    if (roleContains("ROAD_MANAGER")) {
+        $("#center_manage").attr("disabled", "disabled");
     }
     if (hasRole("ROLE_STATION")) {
         $("#fs_employee").attr("disabled", "disabled");

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsFsWork.java

@@ -66,6 +66,8 @@ public class StatisticsFsWork {
     
     // 稽查id
     private Integer check_id;
+
+    private Integer status;
     
     List<StatisticsFsWork> subStatisticsFsWork;
     

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Task.java

@@ -65,6 +65,8 @@ public class Task{
     private String remark;
     //用户班次
     private String user_class_id;
+
+    private Integer user_class_unregular_id;
     
     private Integer status_search_type;
     //任务稽查时间段

+ 4 - 6
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/StatisticsDao.java

@@ -2,12 +2,9 @@ package com.xintong.visualinspection.dao.master;
 
 import java.util.List;
 
+import com.xintong.visualinspection.bean.*;
 import org.apache.ibatis.annotations.Mapper;
 
-import com.xintong.visualinspection.bean.CheckAppealStatistic;
-import com.xintong.visualinspection.bean.CheckmanStatisticsBean;
-import com.xintong.visualinspection.bean.StatisticsBean;
-import com.xintong.visualinspection.bean.StatisticsFsWork;
 import com.xintong.visualinspection.pojo.TaskAndScore;
 
 /**
@@ -48,8 +45,9 @@ public interface StatisticsDao  {
 	public CheckmanStatisticsBean selectCheckManInfo2(CheckmanStatisticsBean obj);
 	
 	public CheckmanStatisticsBean selectCheckManInfo3(CheckmanStatisticsBean obj);
-	
-	
+
+    public List<Task> getAllTasklist(StatisticsFsWork obj);
+
 	
 	public List<StatisticsFsWork> selectFsWork(StatisticsFsWork obj);
 	

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml

@@ -113,7 +113,7 @@
     <select id="findByUserName" parameterType="String" resultMap="userMap">
         select u.*,o.parentid as road_manager_id
         from t_sys_users u left join t_sys_organ o on u.organid=o.id
-        where username= #{username}
+        where username= #{username} and u.status >0
     </select>
     
     <select id="getUsersCenterManageCount" parameterType="com.xintong.visualinspection.bean.StatisticsBean"  resultType="java.lang.Integer">

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

@@ -503,6 +503,51 @@
             <result property="work_minutes" column="work_minutes"/>
         </collection>
     </resultMap>
+
+
+
+    <resultMap id="taskBaseResultMap" type="com.xintong.visualinspection.bean.Task" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="check_status" property="check_status" jdbcType="INTEGER" />
+        <result column="check_status_name" property="check_status_name" jdbcType="VARCHAR" />
+        <result column="video_id" property="video_id" jdbcType="VARCHAR" />
+        <result column="create_time" property="create_time" jdbcType="VARCHAR" />
+        <result column="update_time" property="update_time" jdbcType="VARCHAR" />
+        <result column="start_time" property="start_time" jdbcType="VARCHAR" />
+        <result column="end_time" property="end_time" jdbcType="VARCHAR" />
+        <result column="checkman" property="checkman" jdbcType="INTEGER" />
+        <result column="recheckman" property="recheckman" jdbcType="INTEGER" />
+        <result column="checked_person" property="checked_person" jdbcType="INTEGER" />
+        <result column="checked_dept" property="checked_dept" jdbcType="INTEGER" />
+        <result column="rule_id" property="rule_id" jdbcType="INTEGER" />
+        <result column="checked_location" property="checked_location" jdbcType="VARCHAR" />
+        <result column="checked_location_type" property="checked_location_type" jdbcType="INTEGER" />
+        <result column="remark" property="remark" jdbcType="VARCHAR" />
+        <result column="check_period" property="check_period" jdbcType="VARCHAR" />
+        <result column="class_type" property="class_type" jdbcType="INTEGER" />
+        <result column="period_id" property="period_id" jdbcType="INTEGER" />
+        <result column="monitor_user_id" property="monitor_user_id" jdbcType="INTEGER" />
+        <result column="user_class_unregular_id" property="user_class_unregular_id" jdbcType="INTEGER" />
+        <result column="appeal_result" property="appeal_result" jdbcType="INTEGER" />
+    </resultMap>
+
+    <select id="getAllTasklist" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="taskBaseResultMap">
+
+        select * from check_task where check_status!=22 and id not in <include refid="classexclouddeleteUser"/>
+
+        <if test="start_time!=null">
+            AND start_time >= #{start_time}
+        </if>
+        <if test="end_time!=null">
+            AND end_time &lt; #{end_time}
+        </if>
+
+        order by checked_person
+
+    </select>
+
+
     
     <select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT t.* , ct.id AS check_id  FROM sys_user_class t 
@@ -560,6 +605,9 @@
             <result property="appeal_result" column="appeal_result"/>
         </collection>
     </resultMap>
+
+
+
 	
 	<select id="selectCheckAppealNum" parameterType="com.xintong.visualinspection.bean.CheckAppealStatistic" resultMap="appealNum" >
 		SELECT COUNT(t.appeal_dept) AS appeal_num ,t.appeal_dept AS dept_id,t.appeal_result FROM check_appeal t 

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

@@ -9,6 +9,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.reflect.Method;
 import java.text.DecimalFormat;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -1332,11 +1333,64 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 
-		return sFsList;
+        try {
+            List<Task> tasklist = statisticsDao.getAllTasklist(obj);
+            for (Task t : tasklist
+                    ) {
+                if (mapSta.containsKey(t.getChecked_person().intValue())) {
+                    if (t.getUser_class_unregular_id() != null) continue;
+                    StatisticsFsWork staobj = map.get(t.getChecked_person().intValue());
+                    List<StatisticsFsWork> list = staobj.getSubStatisticsFsWork();
+//                当前任务工作时间
+                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+                    Calendar cal = Calendar.getInstance();
+                    cal.setTime(t.getStart_time());
+                    int hour = cal.get(Calendar.HOUR);//小时
+                    Date workdate = t.getStart_time();
+                    if (hour >= 23) {
+                        cal.add(1, Calendar.DAY_OF_MONTH);
+                        workdate = df.parse(df.format(cal.getTime()));
+                    } else {
+                        workdate = df.parse(df.format(cal.getTime()));
+                    }
+                    boolean isin = false;
+
+                    List<StatisticsFsWork> temp = new ArrayList<>();
+                    for (StatisticsFsWork w : list
+                            ) {
+                        if (w.getWork_date().getTime() == workdate.getTime()) {
+                            isin =true;
+                            break;
+                        }
+                    }
+                    if(!isin) {
+                        StatisticsFsWork ww = new StatisticsFsWork();
+                        ww.setId(Integer.parseInt(t.getUser_class_id()));
+                        ww.setDept_id(t.getChecked_dept());
+                        ww.setStart_time(t.getStart_time());
+                        ww.setEnd_time(t.getEnd_time());
+                        ww.setWork_date(workdate);
+                        ww.setClass_type(t.getClass_type());
+                        ww.setCheck_id(t.getId().intValue());
+                        ww.setStatus(1);
+                        temp.add(ww);
+                        list.addAll(temp);
+                        staobj.setSubStatisticsFsWork(list);
+                    }
+
+                }
+
+            }
+        }catch (Exception  e){
+
+        }
+
+
+        return sFsList;
 	}
 
 	@Override
-	public List<StatisticsFsWork> getUnregularFsWorkStatisticInfo(StatisticsFsWork obj) {
+	public List<StatisticsFsWork> getUnregularFsWorkStatisticInfo(StatisticsFsWork obj)  {
 		List<User> userList = new ArrayList<>();
 		if (obj.getUser_id() != null) {
 			userList.add(userInfoDao.getOneDetail(obj.getUser_id().intValue()));
@@ -1375,7 +1429,61 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 				staobj.setWork_minutes(mapSta.get(userObj.getId()).getWork_minutes());
 			}
 		}
-		return sFsList;
+
+		try {
+            List<Task> tasklist = statisticsDao.getAllTasklist(obj);
+            for (Task t : tasklist
+                    ) {
+                if (mapSta.containsKey(t.getChecked_person().intValue())) {
+                    if (t.getUser_class_unregular_id() == null) continue;
+                    StatisticsFsWork staobj = map.get(t.getChecked_person().intValue());
+                    List<StatisticsFsWork> list = staobj.getSubStatisticsFsWork();
+//                当前任务工作时间
+                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+                    Calendar cal = Calendar.getInstance();
+                    cal.setTime(t.getStart_time());
+                    int hour = cal.get(Calendar.HOUR);//小时
+                    Date workdate = t.getStart_time();
+                    if (hour >= 23) {
+                        cal.add(1, Calendar.DAY_OF_MONTH);
+                        workdate = df.parse(df.format(cal.getTime()));
+                    } else {
+                        workdate = df.parse(df.format(cal.getTime()));
+                    }
+                    boolean isin = false;
+
+                    List<StatisticsFsWork> temp = new ArrayList<>();
+                    for (StatisticsFsWork w : list
+                            ) {
+                        if (w.getWork_date().getTime() == workdate.getTime()) {
+                            isin =true;
+                            break;
+                        }
+                    }
+                    if(!isin) {
+                        StatisticsFsWork ww = new StatisticsFsWork();
+                        ww.setId(Integer.parseInt(t.getUser_class_id()));
+                        ww.setDept_id(t.getChecked_dept());
+                        ww.setStart_time(t.getStart_time());
+                        ww.setEnd_time(t.getEnd_time());
+                        ww.setWork_date(workdate);
+                        ww.setClass_type(t.getClass_type());
+                        ww.setCheck_id(t.getId().intValue());
+                        ww.setStatus(1);
+                        temp.add(ww);
+                        list.addAll(temp);
+                        staobj.setSubStatisticsFsWork(list);
+                    }
+
+                }
+
+            }
+        }catch (Exception  e){
+
+        }
+
+
+        return sFsList;
 	}
 
 	@Override

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


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