Explorar o código

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

QuYueTing hai 7 meses
pai
achega
d15f2ba1c9

+ 5 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -2925,5 +2925,10 @@ public class ReportController {
         }
         //TODO: 针对钉钉和微信公众号进行推送
     }
+
+    @RequestMapping("/getCurAuditNode")
+    public HttpRespMsg getCurAuditNode(String date, String userId) {
+        return reportService.getCurAuditNode(date,userId);
+    }
 }
 

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-08-18
+ * @since 2024-09-23
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -615,6 +615,13 @@ public class TimeType extends Model<TimeType> {
     @TableField(exist = false)
     private Integer saasSyncContact;
 
+    /**
+     * 是否校验考勤数据的加班时长
+     */
+    @TableField("verify_card_overtime")
+    private Integer verifyCardOvertime;
+
+
     @Override
     protected Serializable pkVal() {
         return this.companyId;

+ 20 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/UserCorpwxTime.java

@@ -1,25 +1,25 @@
 package com.management.platform.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.io.Serializable;
-import java.time.LocalDate;
-
 /**
  * <p>
  * 
  * </p>
  *
  * @author Seyason
- * @since 2022-01-07
+ * @since 2024-09-23
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -97,6 +97,20 @@ public class UserCorpwxTime extends Model<UserCorpwxTime> {
     private String weekDayTxt;
 
 
+
+    /**
+     * 加班状态:0-无加班;1-正常;2-缺时长
+     */
+    @TableField("ot_status")
+    private Integer otStatus;
+
+    /**
+     * 加班时长
+     */
+    @TableField("ot_time")
+    private Double otTime;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -169,4 +169,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg batchDenyHisReport(Integer reportAuditLogId, String reason, HttpServletRequest request) throws Exception;
 
     HttpRespMsg exportListByState(Integer state, Integer departmentId, Integer projectId, String date, String startDate, String endDate, String userId, String auditUserId, HttpServletRequest request) throws Exception;
+
+    HttpRespMsg getCurAuditNode(String date, String userId);
 }

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -10113,4 +10113,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         String fileName="待审核日报列表_"+System.currentTimeMillis();
         return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,dataList,path);
     }
+
+    @Override
+    public HttpRespMsg getCurAuditNode(String date, String userId) {
+        List<Report> list = reportMapper.selectList(new QueryWrapper<Report>().eq("create_date", date).eq("creator_id", userId));
+        if (list.size() == 0) {
+            return new HttpRespMsg().setError("日报已不存在");
+        }
+        return null;
+    }
 }

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -1628,6 +1628,15 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                 }
                             }
                         }
+                        //处理加班时长
+                        JSONObject otInfo = jsonObject.getJSONObject("ot_info");
+                        Integer s = otInfo.getIntValue("ot_status");
+                        Integer duration = otInfo.getInteger("ot_duration");//秒为单位
+                        ct.setOtStatus(s);
+                        //加班
+                        double otTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(duration));
+                        if (showLog) System.out.println("加班时长:"+otTime);
+                        ct.setOtTime(otTime);
                         //校正请假时长
                         if (ct.getAskLeaveTime() != null && ct.getAskLeaveTime() == 24.0) {
                             ct.setAskLeaveTime(8.0);//24小时为一天,修正为8小时

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 14 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/UserCorpwxTimeMapper.xml

@@ -18,18 +18,20 @@
         <result column="ask_leave_time" property="askLeaveTime" />
         <result column="week_day" property="weekDay" />
         <result column="week_day_txt" property="weekDayTxt" />
+        <result column="ot_status" property="otStatus" />
+        <result column="ot_time" property="otTime" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, create_date, corpwx_userid, start_time, end_time, card_time, work_hours, company_id, wx_corpid, name, outdoor_time, ask_leave_time, week_day, week_day_txt
+        id, create_date, corpwx_userid, start_time, end_time, card_time, work_hours, company_id, wx_corpid, name, outdoor_time, ask_leave_time, week_day, week_day_txt, ot_status, ot_time
     </sql>
 
 
     <select id="getUserDataList" resultType="java.util.HashMap" >
         SELECT user.id as userId, department.department_name as departmentName, DATE_FORMAT(a.create_date, '%Y/%m/%d') as createDate,a.start_time as startTime, a.end_time as endTime, a.work_hours as workHours, user.name as username,user.corpwx_userid as corpwxUserid,a.week_day as weekDay,
         week_day_txt as weekDayTxt,card_time as cardTime, outdoor_time as outdoorTime, ask_leave_time as askLeaveTime FROM user_corpwx_time a
-            LEFT JOIN user ON  user.name = a.name AND a.`company_id` = user.`company_id`
+        LEFT JOIN user ON  user.name = a.name AND a.`company_id` = user.`company_id`
         left join department on department.department_id = user.department_id
         WHERE a.create_date BETWEEN #{startDate} AND #{endDate}
         AND a.company_id = #{companyId}
@@ -46,20 +48,20 @@
     <select id="getUserDataRatioList" resultType="java.util.HashMap" >
         SELECT user.id AS userId, user.`name` as username,department.department_name as departmentName, user.`corpwx_userid` as corpwxUserid, IFNULL(card_time.workHours, 0) as workHours, IFNULL(report_time.projectTime, 0)  AS projectTime FROM
         user left join department on department.department_id = user.department_id
-            LEFT JOIN
+        LEFT JOIN
         (SELECT a.corpwx_userid,a.name, SUM(a.work_hours) AS workHours FROM user_corpwx_time a, user b WHERE a.company_id = #{companyId}
         AND (a.`corpwx_userid` = b.`corpwx_userid` OR (a.corpwx_userid IS NULL AND a.name = b.name))
-            AND (a.`create_date` &gt;= b.`induction_date` OR b.`induction_date` IS NULL)
-            AND  a.create_date in
-           <foreach collection="dateList" item="date" open="(" separator="," close=")">
-                #{date}
-            </foreach>
-           GROUP BY a.`corpwx_userid`,a.name ) card_time
+        AND (a.`create_date` &gt;= b.`induction_date` OR b.`induction_date` IS NULL)
+        AND  a.create_date in
+        <foreach collection="dateList" item="date" open="(" separator="," close=")">
+            #{date}
+        </foreach>
+        GROUP BY a.`corpwx_userid`,a.name ) card_time
         ON user.name = card_time.name
         LEFT JOIN (SELECT r.creator_id, SUM(r.working_time) AS projectTime FROM report r WHERE r.company_id = #{companyId} AND  r.create_date in
-            <foreach collection="dateList" item="date" open="(" separator="," close=")">
-                #{date}
-            </foreach> GROUP BY r.`creator_id` ) report_time
+        <foreach collection="dateList" item="date" open="(" separator="," close=")">
+            #{date}
+        </foreach> GROUP BY r.`creator_id` ) report_time
         ON report_time.creator_id = user.id
         WHERE user.company_id = #{companyId}
         <if test="userId != null">

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -1933,6 +1933,7 @@
   "hao": "number",
   "haoHanQianTianBao": "Fill in before (including) the number.",
   "jiaBanShiChangXiaoYan": "Overtime duration verification",
+  "kaoqingjiabanjiaoyan": "attendance overtime verification",
   "kaiQiHouChaoGuoXiangMuJiHuaJieShuRiQiDeRiBaoJiangBuKeTianBao": "Daily reports that exceed the end date of the project plan after opening will not be able to be filled in",
   "keYong_0BiaoShiDaiShenHeTiaoShuLiRu_0JiangBeiTiHuanWei_10": "({0} can be used to represent the number of pending reviews, for example: {0} will be replaced with 10.)",
   "keYong_0BiaoShiLouTianRiQiLiRu_0JiangBeiTiHuanWei_05240525": "(You can use {0} to indicate a missing date, for example: {0} will be replaced with 05/24, 05/25.)",

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -1921,6 +1921,8 @@
   "liXiangShuJu": "立项数据",
   "liXiangDaoChuXlsx": "立项导出.xlsx",
   "jiaBanShiChangXiaoYan": "加班时长校验",
+  "kaoqingjiabanjiaoyan": "考勤加班时长校验",
+  "kaoqingjiabanjiaoyanTip": "每日填报工时总加班时长不得超过考勤的加班时长",
   "gongZuoRiTianXieJiaBanShiChangBuDeChaoGuoZongGongZuoShiChangZhengChangGongZuoShiChang": "工作日填写加班时长不得超过总工作时长-正常工作时长",
   "meiYue": "每月",
   "hao": "号",

+ 8 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -55,6 +55,12 @@
                                         <i class="el-icon-question" style="color:#606266"></i>
                             </el-tooltip>
                             </el-form-item>
+                            <el-form-item v-if="timeType.fillOvertime && timeType.syncCorpwxTime">
+                            <el-checkbox v-model="timeType.verifyCardOvertime" :label="$t('kaoqingjiabanjiaoyan')" />
+                            <el-tooltip effect="dark" :content="$t('kaoqingjiabanjiaoyanTip')" placement="top-start">
+                                        <i class="el-icon-question" style="color:#606266"></i>
+                            </el-tooltip>
+                            </el-form-item>
                             <template v-if="timeType.fillOvertime">
                             <el-checkbox v-model="timeType.payOvertime" :label="$t('chargedtocost')" />
                             <!-- <el-checkbox v-model="timeType.doubleOvertime" label="加班双倍成本" :disabled="!timeType.payOvertime"/> -->
@@ -1635,6 +1641,7 @@
                         param.fillAhead = param.fillAhead ? 1 : 0
                         param.includeWeekends = param.includeWeekends ? 1 : 0
                         param.workOvertimeNeedCheck = param.workOvertimeNeedCheck ? 1 : 0
+                        param.verifyCardOvertime = param.verifyCardOvertime ? 1 : 0
                         param.mainProjectState = param.mainProjectState ? 1 : 0
                         param.stopReport = param.stopReport? 1: 0;
                         param.notAllowedOnNonWorkday = param.notAllowedOnNonWorkday? 1: 0;
@@ -1734,6 +1741,7 @@
                             this.timeType.fillAhead = this.timeType.fillAhead ? true : false
                             this.timeType.includeWeekends = this.timeType.includeWeekends ? true : false
                             this.timeType.workOvertimeNeedCheck = this.timeType.workOvertimeNeedCheck ? true : false
+                            this.timeType.verifyCardOvertime = this.timeType.verifyCardOvertime ? true : false
                             this.timeType.mainProjectState = this.timeType.mainProjectState ? true : false
                             this.timeType.customDataMaxStatus = this.timeType.customDataMaxStatus ? true : false 
                             this.timeType.customDataMaxValue = this.timeType.customDataMaxValue ? this.timeType.customDataMaxValue : 100

+ 9 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -2166,7 +2166,14 @@
         <!-- 审核流程展示 -->
         <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
             <div style="padding:20px 40px 20px 0">
-                <el-timeline :reverse="false">
+                <el-steps  :active="curAuditNode" align-center="true" finish-status="success">
+                <el-step title="员工提交"></el-step>
+                <el-step title="项目经理审核"></el-step>
+                <el-step title="公司副总审核"></el-step>
+                </el-steps>
+                <el-divider></el-divider>
+                <p style="color:#aaaaaa;">审核记录</p>
+                <el-timeline :reverse="false" style="margin-top:10px;">
                     <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
                         <!-- {{item.msg}} -->
                         <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
@@ -2219,6 +2226,7 @@
         },
         data() {
             return {
+                curAuditNode: 1,
                 refreshingTime: false,
                 substitudeStep: 1,
                 showHidden: false,