Parcourir la source

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

seyason il y a 2 ans
Parent
commit
035dc77fd3

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

@@ -864,6 +864,21 @@ public class ReportController {
                             decimalFormat.format(report.getWorkingTime())));
                     return httpRespMsg;
                 }
+
+            }
+        }
+        //如果开启了加班时长校验
+        if(comTimeType.getFillOvertime()==1&&comTimeType.getWorkOvertimeNeedCheck()==1){
+            for (Report report : reportList) {
+                if(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/java/com/management/platform/mapper/ReportMapper.java

@@ -133,7 +133,7 @@ public interface ReportMapper extends BaseMapper<Report> {
     @Update("update report set task_id = null where task_id=#{taskId}")
     void deleteReportTask(Integer taskId);
 
-    List<Map<String, Object>> getUserReportTimelinessRate(Integer companyId,String startDate, String endDate);
+    List<Map<String, Object>> getUserReportTimelinessRate(Integer companyId,String startDate, String endDate,String userId,List<Integer> deptIds);
     @Select("SELECT report.id, report.creator_id,  DATE_FORMAT(report.`create_date`, '%Y-%m-%d') AS create_date FROM report WHERE report.state = 1  AND report.`project_audit_state`=0 \n" +
             "AND EXISTS(SELECT 1 FROM audit_workflow_time_setting s, `user` u WHERE s.dept_id = u.department_id AND u.id = report.`creator_id` AND s.audit_dept_id IS NOT NULL)\n" +
             "AND EXISTS(SELECT 1 FROM report r WHERE report.`creator_id` = r.creator_id AND report.`create_date` = r.create_date AND report.id <> r.id AND r.state = 0)\n" +

+ 6 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -6518,13 +6518,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Integer timeliness = timeType.getTimeliness();
         List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全公司填报及时率");
         List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门填报及时率");
-        List<Integer> deptIds=null;
+        List<Integer> deptIds=new ArrayList<>();
         List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",targetUser.getCompanyId()));
         List<Department> userDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id",targetUser.getCompanyId()));
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
-            deptIds=new ArrayList<>();
             deptIds.add(-1);
             if(functionDeptList.size()>0){
                 List<Integer> collect = userDepartmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
@@ -6536,7 +6535,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
             }
         }
-        List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate);
         QueryWrapper<User> queryWrapper=new QueryWrapper();
         queryWrapper.eq("company_id",targetUser.getCompanyId());
         List<Integer> branchDepartment =null;
@@ -6544,13 +6542,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
         }
         if(branchDepartment!=null&&branchDepartment.size()>0){
-            queryWrapper.in("department_id",branchDepartment);
+            deptIds.addAll(branchDepartment);
         }
         if(userId!=null){
             queryWrapper.eq("id",userId);
         }
         if(deptIds!=null && deptIds.size()>0){
-            queryWrapper.in("department_id",deptIds);
+            LinkedHashSet<Integer> set = new LinkedHashSet<>(deptIds);
+            List<Object> list = Arrays.asList(set.toArray());
+            queryWrapper.in("department_id",list);
         }
         queryWrapper.eq("is_active",1).orderByAsc("department_id");
         List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", targetUser.getCompanyId()));
@@ -6563,6 +6563,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }else {
             userList = userMapper.selectList(queryWrapper);
         }
+        List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate,userId,deptIds);
         Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("userName"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
         //获取请假数据
         List<LeaveSheet> leaveSheetList = leaveSheetMapper.selectList(new QueryWrapper<LeaveSheet>().eq("company_id", targetUser.getCompanyId()));

+ 10 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -113,6 +113,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
 
     @Value(value = "${configEnv.isPrivateDeploy}")
     private boolean isPrivateDeploy;
+    @Value(value = "${privateDeployURL.pcUrl}")
+    private boolean pcUrl;
+    @Value(value = "${privateDeployURL.mobUrl}")
+    private boolean mobUrl;
 
     @Autowired
     RestTemplate restTemplate;
@@ -265,7 +269,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             reqParam.put("agentid", corpInfo.getAgentid());
             JSONObject cardJson = new JSONObject();
             String title = "";
-            String jumpUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
+            String jumpUrl ;
+            if(isPrivateDeploy){
+                jumpUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
+            }else {
+                jumpUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
+            }
 
             if (StringUtils.isEmpty(pageRouter)) {
                 title = "消息通知";

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -73,8 +73,8 @@ public class TimingTask {
     public String appId;
     @Value("${wx.app_secret}")
     public String appSecret;
-    @Value("${corpId}")
-    public String corpId;
+    @Value("${suitId}")
+    public String suitId;
     @Autowired
     private RedisUtil redisUtil;
     @Autowired
@@ -601,7 +601,7 @@ public class TimingTask {
                     jsonObj.put("value",StringUtils.isEmpty(map.get("num"))?"":map.get("num"));
                     dataJson.add(jsonObj);
                     if(isPrivateDeploy){
-                        json.put("content","待审核数量: "+(StringUtils.isEmpty(map.get("num"))?"":map.get("num"))+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
+                        json.put("content","待审核数量: "+(StringUtils.isEmpty(map.get("num"))?"":map.get("num"))+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
                     }else {
                         json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
                         json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=review#wechat_redirect");
@@ -897,7 +897,7 @@ public class TimingTask {
                         jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
                         dataJson.add(jsonObj);
                         if(isPrivateDeploy){
-                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+corpId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
+                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+suitId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
                         }else {
                             json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
                             json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");

+ 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>

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -738,6 +738,15 @@
         and rl.create_date between  #{startDate} and #{endDate}
         and rl.msg like '%提交了%'
         and `user`.is_active = 1
+        <if test="userId!=null">
+            and `user`.id=#{userId}
+        </if>
+        <if test="deptIds!=null and deptIds.size()>0">
+            and `user`.department_id  in
+            <foreach collection="deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         group by user.id,rl.create_date
     </select>
 

Fichier diff supprimé car celui-ci est trop grand
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


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

@@ -43,6 +43,12 @@
                         </el-form-item><br>
                         <el-form-item :label="$t('workSettings')" prop="allday" v-if="!timeType.lockWorktime">
                             <el-checkbox v-model="timeType.fillOvertime" :label="$t('hourscanbereported')" />
+                            <el-form-item v-if="timeType.fillOvertime">
+                            <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>
                             <template v-if="timeType.fillOvertime">
                             <el-checkbox v-model="timeType.payOvertime" :label="$t('chargedtocost')" />
                             <!-- <el-checkbox v-model="timeType.doubleOvertime" label="加班双倍成本" :disabled="!timeType.payOvertime"/> -->
@@ -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