Kaynağa Gözat

系统基础设置增加 加班时长校验

yurk 2 yıl önce
ebeveyn
işleme
4967328a84

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

@@ -864,6 +864,15 @@ public class ReportController {
                             decimalFormat.format(report.getWorkingTime())));
                     return httpRespMsg;
                 }
+                if(comTimeType.getWorkOvertimeNeedCheck()==1&&WorkDayCalculateUtils.isWorkDay(report.getCreateDate())){
+                    HttpRespMsg httpRespMsg = new HttpRespMsg();
+                    BigDecimal bigDecimal=new BigDecimal(report.getWorkingTime());
+                    bigDecimal=bigDecimal.subtract(new BigDecimal(comTimeType.getAllday()));
+                    if(report.getOvertimeHours()>bigDecimal.doubleValue()){
+                        httpRespMsg.setError("加班时长不得超过总工作时长-正常工作时长");
+                        return httpRespMsg;
+                    }
+                }
             }
         }
 

+ 14 - 8
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 2023-02-10
+ * @since 2023-03-09
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -266,18 +266,18 @@ public class TimeType extends Model<TimeType> {
     @TableField("is_secret_salary")
     private Integer isSecretSalary;
 
-    /**
-     * 0-每日提醒当天漏填 1-每日提醒昨天漏填
-     */
-    @TableField("alert_type")
-    private Integer alertType;
-
     /**
      * 采用三位组合,第一位代表周六,第二位代表周日,第三位代表其他节假日,0代表不提醒,1代表提醒
      */
     @TableField("alert_non_workday")
     private Integer alertNonWorkday;
 
+    /**
+     * 0-每日提醒当天漏填 1-每日提醒昨天漏填
+     */
+    @TableField("alert_type")
+    private Integer alertType;
+
     /**
      * 0-工作内容非必填 1-工作内容必填
      */
@@ -303,7 +303,7 @@ public class TimeType extends Model<TimeType> {
     private Integer mainProjectState;
 
     /**
-     * 日报的审核类型, 0-项目审核人审核,1-分组负责人审核,2-先分组负责人审核再项目负责人(PM)审核;3-员工自由选择审批人;4-项目所属BU审核
+     * 日报的审核类型, 0-项目审核人审核,1-分组负责人审核,2-先分组负责人审核再项目负责人(PM)审核;3-员工自由选择审批人 4-项目所属BU审核
      */
     @TableField("report_audit_type")
     private Integer reportAuditType;
@@ -438,6 +438,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("sub_pro_must_fill")
     private Integer subProMustFill;
 
+    /**
+     * 0-否 1-是  加班时长是否需要校验
+     */
+    @TableField("work_overtime_need_check")
+    private Integer workOvertimeNeedCheck;
+
 
     @Override
     protected Serializable pkVal() {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -15,7 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.101.180.183:3306/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
+    url: jdbc:mysql://47.101.180.183:3306/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: HuoshiDB@2022
     hikari:

+ 0 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -945,7 +945,6 @@
                 left join user u on u.id = a.project_auditor_id
                 WHERE a.company_id =#{companyId}
                 and a.state = 0
-                and u.is_active = 1
                 <if test="startDate!=null and endDate!=null">
                     AND a.create_date between #{startDate} and #{endDate}
                 </if>
@@ -981,7 +980,6 @@
                 left join department dp on u.department_id=dp.department_id
                 WHERE a.company_id =#{companyId}
                 and a.state = 0
-                and u.is_active = 1
                 <if test="startDate!=null and endDate!=null">
                     AND a.create_date between #{startDate} and #{endDate}
                 </if>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


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

@@ -248,6 +248,12 @@
                 </div>
                 <el-form-item>
                     <el-checkbox v-model="timeType.includeWeekends" label="批量/代填含周末" />
+                </el-form-item>
+                <el-form-item>
+                    <el-checkbox v-model="timeType.workOvertimeNeedCheck" label="加班时长校验" />
+                    <el-tooltip effect="dark" :content="$t('工作日填写加班时长不得超过总工作时长-正常工作时长')" placement="top-start">
+                                <i class="el-icon-question" style="color:#606266"></i>
+                    </el-tooltip>
                 </el-form-item><br/>
                 <el-form-item :label="$t('filltime')" prop="fillMonths">
                     <el-select v-model="timeType.fillMonths" >
@@ -570,6 +576,7 @@
                     lockWorktime: false,
                     fillAhead: false,
                     includeWeekends: false,
+                    workOvertimeNeedCheck: false,
                     maxReportTime: 8,
                 },
                 customDegreeActive: false,
@@ -1116,6 +1123,7 @@
                         param.lockWorktime = param.lockWorktime ? 1 : 0
                         param.fillAhead = param.fillAhead ? 1 : 0
                         param.includeWeekends = param.includeWeekends ? 1 : 0
+                        param.workOvertimeNeedCheck = param.workOvertimeNeedCheck ? 1 : 0
                         param.mainProjectState = param.mainProjectState ? 1 : 0
                         if(param.lockWorktime){
                             param.fillOvertime = 0
@@ -1199,6 +1207,7 @@
                             this.timeType.customDataStatus = this.timeType.customDataStatus ? true : false
                             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.mainProjectState = this.timeType.mainProjectState ? true : false
                             this.timeType.customDataMaxStatus = this.timeType.customDataMaxStatus ? true : false 
                             this.timeType.customDataMaxValue = this.timeType.customDataMaxValue ? this.timeType.customDataMaxValue : 100