chenrj-PC\chenrj 8 tahun lalu
induk
melakukan
49a9792c52

+ 3 - 2
VisualInspection/js/statistics/change_attendance.js

@@ -123,9 +123,10 @@ function getFsWorkInfo(flag){
  * @param {*} seq 
  */
 function getTableContent(obj,seq){
-    var days = getDaysByDate(GV("#sel_month")+"/01");
+    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{
@@ -179,7 +180,7 @@ function getTableContent(obj,seq){
  */
 function monthChange(){
     $(".m28").show();
-    $(".m"+getDaysByDate(GV("#sel_month")+"/01")).hide();
+    $(".m"+getDaysByDate1(GV("#sel_month")+"/01")).hide();
 }
 
 function setVisit(){

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

@@ -126,7 +126,7 @@ $(function(){
  * @param {*} seq 
  */
 function getTableContent(obj,seq){
-    var days = getDaysByDate(GV("#sel_month")+"/01");
+    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){
@@ -184,7 +184,7 @@ function getTableContent(obj,seq){
  */
 function monthChange(){
     $(".m28").show();
-    $(".m"+getDaysByDate(GV("#sel_month")+'/01')).hide();
+    $(".m"+getDaysByDate1(GV("#sel_month")+'/01')).hide();
 }
 
 function setVisit(){

+ 28 - 0
VisualInspection/js/statistics/common_statistic.js

@@ -150,6 +150,34 @@ function getDays(mouth,datet){
  * param: datet String 年份
  * return:days( 28,29,30,31 )
  */
+function getDaysByDate1(datet){
+    //构造当前日期对象
+    var date = new Date(datet);
+    //获取年份
+    var year = date.getFullYear();
+    var mouth = date.getMonth();
+    //定义当月的天数;
+    var days ;
+    //当月份为二月时,根据闰年还是非闰年判断天数
+    if(mouth == 2){
+            days= year % 4 == 0 ? 29 : 28;
+    }
+    else if(mouth == 1 || mouth == 3 || mouth == 5 || mouth == 7 || mouth == 8 || mouth == 10 || mouth == 12){
+        //月份为:1,3,5,7,8,10,12 时,为大月.则天数为31;
+        days= 31;
+    }
+    else{
+        days= 30;   
+    }
+    return days ;
+}
+
+
+/**
+ * 根据月份,判断当前月份天数
+ * param: datet String 年份
+ * return:days( 28,29,30,31 )
+ */
 function getDaysByDate(datet){
     //构造当前日期对象
     var date = new Date(datet);

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

@@ -405,10 +405,13 @@
     <resultMap id="statisticsFsWork" type="com.xintong.visualinspection.bean.StatisticsFsWork">
         <id property="user_id" column="user_id"/>
         <collection property="subStatisticsFsWork" ofType="com.xintong.visualinspection.bean.StatisticsFsWork">
+            <id property="id" column="id" />
+            <result property="start_time" column="start_time" />
             <result column="work_date" property="work_date"/>
             <result property="dept_id" column="dept_id"/>
             <result property="class_type" column="class_type"/>
             <result property="check_id" column="check_id"/>
+            <result property="end_time" column="end_time" />
             <result property="work_days" column="work_days" />
             <result property="work_minutes" column="work_minutes"/>
         </collection>