Bladeren bron

提交月度工时表

Lijy 2 jaren geleden
bovenliggende
commit
e74d8004e5
21 gewijzigde bestanden met toevoegingen van 349 en 111 verwijderingen
  1. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  2. 4 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  3. 10 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WxCorpInfoController.java
  4. 9 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportAuditorSetting.java
  5. 5 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java
  6. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java
  7. 124 51
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  8. 36 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  9. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  10. 3 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  11. 69 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  12. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportAuditorSettingMapper.xml
  13. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  14. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  15. 23 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue
  16. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue
  17. 8 8
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  18. 10 5
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  19. 4 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue
  20. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue
  21. 28 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/projectInside.vue

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java

@@ -58,7 +58,6 @@ public class DingDingController {
     @Resource
     private TimeTypeMapper timeTypeMapper;
 
-
     @RequestMapping("/callback")
     public Map<String, String> dingCallback(
             @RequestParam(value = "signature") String signature,
@@ -457,4 +456,5 @@ public class DingDingController {
     public HttpRespMsg initSuperManager(String corpid, String name) {
         return dingDingService.initSuperManager(corpid, name);
     }
+
 }

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -429,14 +429,14 @@ public class ProjectController {
 
     //分页查询员工月度工时表
     @RequestMapping("/getEmpMonthHours")
-    public HttpRespMsg getEmpMonthHours(@RequestParam Integer pageIndex, @RequestParam Integer pageSize, LocalDate Month,Integer departmentId,String userId) {
-        return projectService.getEmpMonthHours(pageIndex, pageSize, Month,departmentId,userId, request);
+    public HttpRespMsg getEmpMonthHours(@RequestParam Integer pageIndex, @RequestParam Integer pageSize, String month,Integer departmentId,String userId) {
+        return projectService.getEmpMonthHours(pageIndex, pageSize, month,departmentId,userId, request);
     }
 
     //导出员工月度工时表
     @RequestMapping("/exportEmpMonthHours")
-    public HttpRespMsg exportEmpMonthHours() {
-        return projectService.exportAllProjectCost(request);
+    public HttpRespMsg exportEmpMonthHours(String month,String userId,Integer departmentId) {
+        return projectService.exportEmpMonthHours(month,request,userId,departmentId);
     }
 
     //分页查询项目收支平衡表

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WxCorpInfoController.java

@@ -8,6 +8,7 @@ import com.management.platform.entity.User;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.task.TimingTask;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,6 +33,9 @@ public class WxCorpInfoController {
     WxCorpInfoService wxCorpInfoService;
     @Resource
     UserMapper userMapper;
+    @Resource
+    private TimingTask timingTask;
+
     @RequestMapping("/testDownload")
     public HttpRespMsg testDownload() {
         HttpRespMsg msg = new HttpRespMsg();
@@ -73,5 +77,11 @@ public class WxCorpInfoController {
         wxCorpInfoService.sendWXCorpTemplateMsg(corpInfo, corpUid, json);
         return new HttpRespMsg();
     }
+
+    @RequestMapping("/wxLeaveTest")
+    public void wxLeaveTest() throws Exception {
+        timingTask.synWxLeave();
+    }
+
 }
 

+ 9 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportAuditorSetting.java

@@ -1,12 +1,9 @@
 package com.management.platform.entity;
 
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
-
-import jdk.nashorn.internal.ir.annotations.Ignore;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -17,7 +14,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2022-09-29
+ * @since 2022-10-13
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -53,9 +50,16 @@ public class ReportAuditorSetting extends Model<ReportAuditorSetting> {
     /**
      * 抄送人
      */
-    @TableField(value = "cc_userid",updateStrategy = FieldStrategy.IGNORED)
+    @TableField("cc_userid")
     private String ccUserid;
 
+    /**
+     * 当前待审核的层级,对应第几审核人
+     */
+    @TableField("cur_audit_level")
+    private Integer curAuditLevel;
+
+
     @Override
     protected Serializable pkVal() {
         return this.reportId;

+ 5 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -7,6 +7,7 @@ import com.management.platform.entity.vo.ProjectWithStage;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Update;
 
+import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -127,4 +128,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
     long selectCountWithGroupProject(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId);
 
     List<Map<String, Object>> getCostByUserCustom(String startDate, String endDate, Integer companyId, List<Integer> deptIds, Integer customId, String subCustomName,String fieldName);
+
+    List<Map<String, Object>> getEmpMonthHours(Integer companyId, String startDate, String endDate, Integer start, Integer size, String userId, List<Integer> branchDepartment, List<Integer> deptIds);
+
+    long findCountWithEmpMonthHours(Integer companyId, String startDate, String endDate, Integer start, Integer size, String userId, List<Integer> branchDepartment, List<Integer> deptIds);
 }

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -201,5 +201,7 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg testAdd(String jobId);
 
-    HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, LocalDate Month,Integer departmentId,String userId, HttpServletRequest request);
+    HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, String month,Integer departmentId,String userId, HttpServletRequest request);
+
+    HttpRespMsg exportEmpMonthHours(String month, HttpServletRequest request, String userId, Integer departmentId);
 }

+ 124 - 51
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -60,9 +60,12 @@ import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.chrono.ChronoLocalDate;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static java.time.format.DateTimeFormatter.ISO_DATE;
+
 
 /**
  * <p>
@@ -7177,59 +7180,129 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
     //分页查询员工月度工时表
     @Override
-    public HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, LocalDate Month,Integer departmentId,String userId, HttpServletRequest request) {
+    public HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, String month,Integer departmentId,String userId, HttpServletRequest request) {
         HttpRespMsg httpRespMsg =new HttpRespMsg();
-//        User targetUser = userMapper.selectById(request.getHeader("token"));
-//        List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全部人员月度工时表");
-//        List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门月度工时表");
-//        List<Integer> deptIds=null;
-//        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().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
-//                List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
-//                collect.addAll(otherCollect);
-//                for (Integer integer : collect) {
-//                    List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
-//                    deptIds.addAll(branchDepartment);
-//                }
-//            }
-//        }
-//        long total;
-//        List<Map<String,Object>> resultList;
-//        List<Integer> branchDepartment =null;
-//        if(departmentId!=null){
-//            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
-//        }
-//        if(pageIndex!=null&&pageSize!=null){
-//            Integer size=pageSize;
-//            Integer start=(pageIndex-1)*size;
-//            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
-//            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
-//        }else{
-//            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
-//            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
-//        }
-//        for (Map<String, Object> map : resultList) {
-//            BigDecimal phBigDecimal =new BigDecimal(String.valueOf(map.get("planHours")==null?0:map.get("planHours")));
-//            BigDecimal wtBigDecimal =new BigDecimal(String.valueOf(map.get("workingTime")==null?0:map.get("workingTime")));
-//            if(phBigDecimal.compareTo(BigDecimal.ZERO)==0||wtBigDecimal.compareTo(BigDecimal.ZERO)==0){
-//                map.put("proportion",dft.format(0));
-//            }else{
-//                BigDecimal divide = wtBigDecimal.divide(phBigDecimal, 2, BigDecimal.ROUND_HALF_UP);
-//                map.put("proportion",dft.format(divide));
-//            }
-//        }
-//        Map<String,Object> map=new HashMap<>();
-//        map.put("result",resultList);
-//        map.put("total",total);
-//        httpRespMsg.data=map;
+        User targetUser = userMapper.selectById(request.getHeader("token"));
+        List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全部人员月度工时表");
+        List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门月度工时表");
+        List<Integer> deptIds=null;
+        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().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
+                List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
+                collect.addAll(otherCollect);
+                //将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
+                for (Integer integer : collect) {
+                    List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
+                    deptIds.addAll(branchDepartment);
+                }
+            }
+        }
+        long total;
+        List<Map<String,Object>> resultList;
+        List<Integer> branchDepartment =null;
+        //若用户传入departmentId参数,则查询该部门所有子部门,添加到branchDepartment集合中
+        if(departmentId!=null){
+            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
+        }
+        String startDate = null;
+        String endDate = null;
+        LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        startDate = time.with(TemporalAdjusters.firstDayOfMonth()).toString();
+        endDate = time.with(TemporalAdjusters.lastDayOfMonth()).toString();
+        int days = WorkDayCalculateUtils.getWorkDaysListInRange(startDate, endDate, 0).size();
+        //分页查询用户计划工时和实际工时
+        if(pageIndex!=null&&pageSize!=null){
+            Integer size=pageSize;
+            Integer start=(pageIndex-1)*size;
+            resultList=projectMapper.getEmpMonthHours(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
+            total=projectMapper.findCountWithEmpMonthHours(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
+        }else{
+            resultList=projectMapper.getEmpMonthHours(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
+            total=projectMapper.findCountWithEmpMonthHours(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
+        }
+        if(resultList.size()!=0){
+            System.out.println(resultList.toString());
+            float standardHours = Float.parseFloat(resultList.get(0).get("allday").toString())*days;
+            for (Map<String, Object> map : resultList) {
+                map.put("standardHours",standardHours);
+                map.put("workingTime",map.get("workingTime")==null?0:map.get("workingTime"));
+                map.put("leaveTime",map.get("leaveTime")==null?0:map.get("leaveTime"));
+                if (Float.parseFloat(map.get("workingTime").toString()) != standardHours){
+                    map.put("whether",0);
+                }else{
+                    map.put("whether",1);
+                }
+            }
+        }
+        System.err.println(resultList.toString());
+        Map<String,Object> map=new HashMap<>();
+        map.put("result",resultList);
+        map.put("total",total);
+        httpRespMsg.data=map;
         return httpRespMsg;
     }
 
+    //导出员工月度工时表
+    @Override
+    public HttpRespMsg exportEmpMonthHours(String month, HttpServletRequest request, String userId, Integer departmentId){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        String startDate = null;
+        String endDate = null;
+        LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        startDate = time.with(TemporalAdjusters.firstDayOfMonth()).toString();
+        endDate = time.with(TemporalAdjusters.lastDayOfMonth()).toString();
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        HttpRespMsg httpRespMsg = getEmpMonthHours(null, null,month,departmentId,userId,request);
+        Map<String,Object> data = (Map<String, Object>) httpRespMsg.data;
+        List<Map<String,Object>> resultList= (List<Map<String, Object>>) data.get("result");
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        titleList.add("姓名");
+        titleList.add("工号");
+        titleList.add("标准工时");
+        titleList.add("实际工时");
+        titleList.add("请假工时");
+        titleList.add("是否满足工时");
+        dataList.add(titleList);
+        for (Map<String, Object> map : resultList) {
+            List<String> item=new ArrayList<>();
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                item.add("$userName="+(map.get("corwxUserId")==null?"":map.get("corwxUserId"))+"$");
+                item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
+                //item.add("$deprtmentName="+(map.get("corpwxDeptId")==null?"":map.get("corpwxDeptId"))+"$");
+            }else {
+                item.add((String) map.get("name"));
+                item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
+                //item.add((String) map.get("departmentName")==null?"":(String) map.get("departmentName"));
+            }
+            item.add(String.valueOf(map.get("standardHours")).equals("null")?"":String.valueOf(map.get("standardHours")));
+            item.add(String.valueOf(map.get("workingTime")).equals("null")?"":String.valueOf(map.get("workingTime")));
+            item.add(String.valueOf(map.get("leaveTime")).equals("null")?"":String.valueOf(map.get("leaveTime")));
+            if (map.get("whether").toString().equals("1")){
+                item.add("是");
+            }else{
+                item.add("否");
+            }
+            dataList.add(item);
+        }
+        //生成excel文件导出
+        String fileName = "员工"+time.getMonthValue()+"月工时表"+System.currentTimeMillis();
+        try {
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+//        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName , dataList, path);
+//        msg.data = resp;
+        return msg;
+    }
+
 }

+ 36 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -830,6 +830,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             reportList.forEach(r->r.getAuditorSetting().setReportId(r.getId()));
             List<ReportAuditorSetting> collect = reportList.stream().map(Report::getAuditorSetting).collect(Collectors.toList());
             if (collect.size() > 0) {
+                //提交时,审批流重置当前的待审核层级为1:第一层
+                collect.forEach(r->r.setCurAuditLevel(1));
                 reportAuditorSettingService.saveOrUpdateBatch(collect);
             }
         }
@@ -1374,40 +1376,51 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 String auditorId = user.getId();
                 List<ReportAuditorSetting> auditorSettingList = reportAuditorSettingMapper.selectList(new QueryWrapper<ReportAuditorSetting>().in("report_id", ids));
                 List<Report> updateReportList = new ArrayList<>();
+                List<ReportAuditorSetting> updateReportAuditorSettingList = new ArrayList<>();
                 for (Integer rid : ids) {
                     Report r = new Report();
                     r.setId(rid);
                     ReportAuditorSetting auditorItem = auditorSettingList.stream().filter(a -> a.getReportId().equals(rid)).findFirst().get();
-                    if (auditorId.equals(auditorItem.getAuditorFirst())) {
-                        if (auditorItem.getAuditorSec() != null) {
-                            //进入到第二审批人
-                            r.setProjectAuditorId(auditorItem.getAuditorSec());
-                        } else {
-                            r.setProjectAuditState(1);
-                            r.setProjectAuditTime(LocalDateTime.now());
-                            r.setState(1);
-                        }
-                        updateReportList.add(r);
-                    } else if (auditorId.equals(auditorItem.getAuditorSec())) {
-                        if (auditorItem.getAuditorThird() != null) {
-                            //进入到第三审批人
-                            r.setProjectAuditorId(auditorItem.getAuditorThird());
-                        } else {
+                    switch (auditorItem.getCurAuditLevel()) {
+                        case 1:
+                            if (auditorItem.getAuditorSec() != null) {
+                                //进入到第二审批人
+                                r.setProjectAuditorId(auditorItem.getAuditorSec());
+                                auditorItem.setCurAuditLevel(2);
+                                updateReportAuditorSettingList.add(auditorItem);
+                            } else {
+                                r.setProjectAuditState(1);
+                                r.setProjectAuditTime(LocalDateTime.now());
+                                r.setState(1);
+                            }
+                            updateReportList.add(r);
+                            break;
+                        case 2:
+                            if (auditorItem.getAuditorThird() != null) {
+                                //进入到第三审批人
+                                r.setProjectAuditorId(auditorItem.getAuditorThird());
+                                auditorItem.setCurAuditLevel(3);
+                                updateReportAuditorSettingList.add(auditorItem);
+                            } else {
+                                r.setProjectAuditState(1);
+                                r.setProjectAuditTime(LocalDateTime.now());
+                                r.setState(1);
+                            }
+                            updateReportList.add(r);
+                            break;
+                        case 3:
+                            //目前最多三层,第三个审批人审批后结束
                             r.setProjectAuditState(1);
                             r.setProjectAuditTime(LocalDateTime.now());
                             r.setState(1);
-                        }
-                        updateReportList.add(r);
-                    } else if (auditorId.equals(auditorItem.getAuditorThird())) {
-                        //目前最多三层,第三个审批人审批后结束
-                        r.setProjectAuditState(1);
-                        r.setProjectAuditTime(LocalDateTime.now());
-                        r.setState(1);
-                        updateReportList.add(r);
+                            updateReportList.add(r);
+                            break;
                     }
                 }
                 if (updateReportList.size() > 0) {
                     updateBatchById(updateReportList);
+                    //更新审核人的审批流程
+                    reportAuditorSettingService.updateBatchById(updateReportAuditorSettingList);
                 }
             } else {
                 //之前的流程逻辑,综合了一层项目审核,或者一层任务分组审核。 可叠加部门审批流

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

@@ -905,6 +905,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             String accessToken = getCorpAccessToken(wxCorpInfo);
             url = url.replace("ACCESS_TOKEN", accessToken);
             //查询并更新审核中的审批单
+            System.out.println("+++++++++++++++++++开始查询并更新审核中的审批单+++++++++++++++++++");
             if (approvalLeave.size()!=0){
                 for (LeaveSheet corpInfo : approvalLeave) {
                     if (corpInfo.getCompanyId().equals(wxCorpInfo.getCompanyId())&& StringUtils.isNotEmpty(corpInfo.getProcinstId())){
@@ -971,6 +972,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     }
                 }
             }
+            System.out.println("+++++++++++++++++++++开始同步昨天请假信息+++++++++++++++++++++");
             //批量获取审批单号
             ArrayList<HashMap> list = new ArrayList<>();
             HashMap<String, String> record_type = new HashMap<>();
@@ -1130,12 +1132,13 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         //请假说明
                         leaveSheet.setRemark(remark==null?"":remark);
                         //请假时长和天数
-                        float time = Integer.parseInt(timeHours);
+                        float time = Float.parseFloat(timeHours);
                         if("hour".equals(leaveType)){
                             leaveSheet.setTimeType(1);
                             leaveSheet.setTimeHours(time/3600);
                         }else{
                             leaveSheet.setTimeType(0);
+                            leaveSheet.setTimeHours(time/3600);
                             leaveSheet.setTimeDays(time/3600/24);
                         }
                         result.add(leaveSheet);

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

@@ -311,8 +311,9 @@ public class TimingTask {
 
     //每天1:00 同步昨天的微信请假信息
     @Scheduled(cron = "0 0 1 ? * *")
-    private void synWxLeave() throws Exception {
+    public void synWxLeave() throws Exception {
         if (isDev) return;
+        System.out.println("+++++++++++++++++++微信请假同步开始+++++++++++++++++++");
         String startTime = Long.toString(System.currentTimeMillis()/1000L-86400);
         String endTime = Long.toString(System.currentTimeMillis()/1000L);
         //查询更新审批中的请假单
@@ -540,7 +541,7 @@ public class TimingTask {
     }
     //推送到开发环境,每10分钟一次
     @Scheduled(fixedRate = 600 * 1000)
-    private void genRandomCode() {
+    private void pushSysConfigToDev() {
         if (isDev) {
             return;
         }

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

@@ -1214,4 +1214,73 @@
         </if>
         GROUP BY suc.name
     </select>
+
+    <select id="getEmpMonthHours" resultType="java.util.Map">
+        select us.name,us.corpwx_userid as corpwxUserId,us.job_number as jobNumber,dp.department_name as departmentName,dp.corpwx_deptid as corpwxDeptId,
+        (select allday from time_type te
+        where te.company_id=#{companyId}) as allday,
+        (select SUM(report.working_time) from report
+        left join task on task.id=report.task_id
+        where report.creator_id=us.id and task_id is not null and report.state=1
+        and report.create_date &gt;=#{startDate} and report.create_date &lt;=#{endDate})
+        as workingTime,
+        (select SUM(leave_sheet.time_hours) from leave_sheet
+        where leave_sheet.owner_id=us.id and leave_sheet.status=0
+        and leave_sheet.start_date &gt;=#{startDate}
+        and leave_sheet.end_date &lt;=#{endDate})
+        as leaveTime
+        from user us
+        left join department dp on dp.department_id=us.department_id
+        where us.company_id=#{companyId}
+        <if test="userId!=null and userId!=''">
+            and us.id=#{userId}
+        </if>
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and us.department_id in
+            <foreach collection="branchDepartment" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
+        <if test="deptIds!=null and deptIds.size()>0">
+            and us.department_id in
+            <foreach collection="deptIds" open="(" item="item" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        group by us.id
+        order  by us.department_id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>
+    </select>
+
+    <select id="findCountWithEmpMonthHours" resultType="java.lang.Long">
+        select count(1)
+        from(select us.name,dp.department_name  as departmentName,
+        (select SUM(report.working_time) from report
+        left join task on task.id=report.task_id
+        where report.creator_id=us.id and task_id is not null
+        and task.create_date &gt;=#{startDate} and task.create_date &lt;=#{endDate})
+        as workingTime
+        from user us
+        left join  department dp on dp.department_id=us.department_id
+        where us.company_id=#{companyId}
+        <if test="userId!=null and userId!=''">
+            and us.id=#{userId}
+        </if>
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and us.department_id in
+            <foreach collection="branchDepartment" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
+        <if test="deptIds!=null and deptIds.size()>0">
+            and us.department_id in
+            <foreach collection="deptIds" open="(" item="item" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        group by us.id
+        order  by us.department_id)as total
+    </select>
 </mapper>

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportAuditorSettingMapper.xml

@@ -9,11 +9,12 @@
         <result column="auditor_sec" property="auditorSec" />
         <result column="auditor_third" property="auditorThird" />
         <result column="cc_userid" property="ccUserid" />
+        <result column="cur_audit_level" property="curAuditLevel" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        report_id, auditor_first, auditor_sec, auditor_third, cc_userid
+        report_id, auditor_first, auditor_sec, auditor_third, cc_userid, cur_audit_level
     </sql>
 
 </mapper>

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

@@ -1401,5 +1401,6 @@
   "ren-yuan-yue-du-gong-shi-biao": "Monthly time sheet of personnel",
   "biao-zhun-gong-shi": "Standard working hours",
   "qing-jia-gong-shi": "Off hours",
-  "shi-fou-man-zu-gong-shi": "Whether the working hours are met"
+  "shi-fou-man-zu-gong-shi": "Whether the working hours are met",
+  "fu-wu-xiang-mu": "service project"
 }

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

@@ -1401,5 +1401,6 @@
   "ren-yuan-yue-du-gong-shi-biao": "人员月度工时表",
   "biao-zhun-gong-shi": "标准工时",
   "qing-jia-gong-shi": "请假工时",
-  "shi-fou-man-zu-gong-shi": "是否满足工时"
+  "shi-fou-man-zu-gong-shi": "是否满足工时",
+  "fu-wu-xiang-mu": "服务项目"
 }

+ 23 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -230,6 +230,7 @@
             </el-form-item>
 
             <el-form-item style="float:right;margin-right:20px;" v-if="permissions.financialShare">
+                <el-link type="primary" :underline="false" @click="uploadTest()" v-if="user.companyId == 936" style="margin-right:10px">上传</el-link>
                 <el-link type="primary" :underline="false" @click="exportFinanceDialog=true">{{ $t('ExportingtheAllocationData') }}</el-link>
             </el-form-item>
             
@@ -646,6 +647,28 @@ import { error } from 'dingtalk-jsapi';
             };
         },
         methods: {
+            uploadTest(){
+                this.http.post('/report/uploadThirdReportData',{
+                    yearMonth: this.date
+                },res => {
+                    if(res.code == 'ok'){
+                        thiss.$message({
+                            message: '上传成功',
+                            type: 'success'
+                        })
+                    }else{
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: er,
+                        type: 'error'
+                    })
+                })
+            },
             chosenProjectsCheckedClick() {
                 console.log(this.chosenProjects, '数据')
                 if(this.chosenProjectsChecked) {

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -592,6 +592,7 @@
                         <el-option :value="$t('softwareproject')" :label="$t('softwareproject')"></el-option>
                         <el-option :value="$t('hardwareproject')" :label="$t('hardwareproject')"></el-option>
                         <el-option :value="$t('integrationproject')" :label="$t('integrationproject')"></el-option>
+                        <el-option :value="$t('fu-wu-xiang-mu')" :label="$t('fu-wu-xiang-mu')"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item :label="$t('region')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">

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

@@ -3197,7 +3197,7 @@
                         });
                     });
                 //检查当前的项目是否需要获取分组的负责人
-                if (this.user.timeType.reportAuditType >= 1) {
+                if (this.user.timeType.reportAuditType >= 1 && this.user.timeType.reportAuditType != 3) {
                     this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
                         res => {
                             if (res.code == "ok") {
@@ -4409,12 +4409,12 @@
                 if(this.user.timeType.reportAuditType == 3){
                     let auditTips = ''
                     if(!this.zhoBao.auditorFirst){ auditTips += '第一、' }
-                    if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
-                    if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
+                    // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
+                    // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
                     if(auditTips){
                         auditTips = auditTips.substring(0,auditTips.length - 1)
                         this.$message({
-                            message: '请选择[' + auditTips + ']审核人',
+                            message: '请选择' + auditTips + '审核人',
                             type: 'warning'
                         })
                         return
@@ -5556,11 +5556,11 @@
                                     audItem.auditorFirst = this.workForm.domains[i].auditorFirst
                                 }
                                 if(this.user.timeType.auditLevel > 1){
-                                    if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
+                                    // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
                                     audItem.auditorSec = this.workForm.domains[i].auditorSec
                                 }
                                 if(this.user.timeType.auditLevel > 2){
-                                    if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
+                                    // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
                                     audItem.auditorThird = this.workForm.domains[i].auditorThird
                                 }
                                 if(this.workForm.domains[i].ccUserid){
@@ -5569,7 +5569,7 @@
                                 if(auditRule){
                                     auditRule = auditRule.substring(0,auditRule.length - 1)
                                     this.$message({
-                                        message: '请指定[' + auditRule + ']审核人',
+                                        message: '请指定' + auditRule + '审核人',
                                         type: 'error'
                                     })
                                     return
@@ -5739,7 +5739,7 @@
                                         type: "error"
                                     });
                                     return;
-                                } else if(this.user.timeType.reportAuditType != 3){
+                                } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
                                     //分组负责人先审核, 确定是选择了任务分组
                                     if (this.workForm.domains[i].taskGroups.length == 0) {
                                         this.$message({

+ 10 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1542,11 +1542,11 @@ import timetoolVue from '../timetool/timetool.vue';
                                 audItem.auditorFirst = this.form.domains[i].auditorFirst.id
                             }
                             if(this.user.timeType.auditLevel > 1){
-                                if(!this.form.domains[i].auditorSec.id){ auditRule += '第二、' }
+                                // if(!this.form.domains[i].auditorSec.id){ auditRule += '第二、' }
                                 audItem.auditorSec = this.form.domains[i].auditorSec.id
                             }
                             if(this.user.timeType.auditLevel > 2){
-                                if(!this.form.domains[i].auditorThird.id){ auditRule += '第三、' }
+                                // if(!this.form.domains[i].auditorThird.id){ auditRule += '第三、' }
                                 audItem.auditorThird = this.form.domains[i].auditorThird.id
                             }
                             if(this.form.domains[i].ccUserid.id){
@@ -1554,7 +1554,7 @@ import timetoolVue from '../timetool/timetool.vue';
                             }
                             if(auditRule){
                                 auditRule = auditRule.substring(0,auditRule.length - 1)
-                                this.$toast.fail('请指定[' + auditRule + ']审核人')
+                                this.$toast.fail('请指定' + auditRule + '审核人')
                                 return
                             }
                             formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
@@ -1709,16 +1709,21 @@ import timetoolVue from '../timetool/timetool.vue';
                         } else {
                             if (this.user.timeType.reportAuditType == 0) {
                                 this.$toast.fail("请指定["+this.form.domains[i].projectName+']项目的审核人');
-                            } else {
+                                return;
+                            } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
                                 if (this.form.domains[i].taskGroups.length == 0) {
                                     this.$toast.fail("您在["+this.form.domains[i].projectName+"]项目上尚无参与的任务分组");
+                                    return;
                                 } else if (!this.form.domains[i].groupId) {
                                     this.$toast.fail("请选择["+this.form.domains[i].projectName+"]项目的任务分组");
+                                    return;
                                 } else {
                                     this.$toast.fail("请先设置["+this.form.domains[i].projectName+']-['+this.form.domains[i].groupName+']的分组负责人');
+                                    return;
                                 }
+                                
                             }
-                            return;
+                            
                         }
                     }
                     if(!this.flgLg) {

+ 4 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -1624,11 +1624,11 @@
                                 audItem.auditorFirst = this.form[formIndex].domains[i].auditorFirst.id
                             }
                             if(this.user.timeType.auditLevel > 1){
-                                if(!this.form[formIndex].domains[i].auditorSec.id){ auditRule += '第二、' }
+                                // if(!this.form[formIndex].domains[i].auditorSec.id){ auditRule += '第二、' }
                                 audItem.auditorSec = this.form[formIndex].domains[i].auditorSec.id
                             }
                             if(this.user.timeType.auditLevel > 2){
-                                if(!this.form[formIndex].domains[i].auditorThird.id){ auditRule += '第三、' }
+                                // if(!this.form[formIndex].domains[i].auditorThird.id){ auditRule += '第三、' }
                                 audItem.auditorThird = this.form[formIndex].domains[i].auditorThird.id
                             }
                             if(this.form[formIndex].domains[i].ccUserid.id){
@@ -1636,7 +1636,7 @@
                             }
                             if(auditRule){
                                 auditRule = auditRule.substring(0,auditRule.length - 1)
-                                this.$toast.fail('请指定' + this.weekArr[formIndex] + '的[' + auditRule + ']审核人')
+                                this.$toast.fail('请指定' + this.weekArr[formIndex] + '的' + auditRule + '审核人')
                                 return
                             }
                             formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
@@ -1783,7 +1783,7 @@
                         //审核人
                         if (this.form[formIndex].domains[i].projectAuditorId) {
                             formData.append("projectAuditorId", this.form[formIndex].domains[i].projectAuditorId);
-                        } else {
+                        } else if(this.user.timeType.reportAuditType == 0){
                             this.$toast.fail('请选择'+this.weekArr[formIndex]+'投入项目的审核人');
                             return;
                         }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -81,7 +81,7 @@
                     this.routers.push({
                         name: '待办任务',
                         url: '/task',
-                        icon: 'todo-list-o'
+                        icon: 'coupon-o'
                     });
                 }
                 if(list[i].name == '项目报告审核') {

+ 28 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/projectInside.vue

@@ -30,9 +30,10 @@
                             </template>
                         </van-picker>
                     </van-popup>
-                    <van-cell value-class="addtaskvalue">
+                    <!-- <van-cell value-class="addtaskvalue">
                         <van-button plain type="info" class="addtaskbutton" @click="toEditask(null)">新建任务</van-button>
-                    </van-cell>
+                    </van-cell> -->
+                    <van-icon name="add-o" class="addtaskicon" @click="toEditask(null)" />
                     <div class="taskList">
                         <van-cell v-for="item in inside.taskList" :key="item.id">
                             <div style="line-height:0.8rem">任务名称:{{item.name}}</div>
@@ -42,6 +43,8 @@
                             </div>
                             <div class="task_button">
                                 <van-button size="small" type="info" @click="toEditask(item.id)">编辑</van-button>
+                                <van-button size="small" type="primary" @click="taskStatus(item.id,0,item)" v-if="item.taskStatus == 0">完成</van-button>
+                                <van-button size="small" color="#e6a23c" @click="taskStatus(item.id,1,item)" v-if="item.taskStatus == 1">重启</van-button>
                             </div>
                         </van-cell>
                     </div>
@@ -302,6 +305,19 @@ export default {
             sessionStorage.setItem('taskId',JSON.stringify(item))
             this.$router.push("/editask");
         },
+        taskStatus(taskid,status,taskitem){          // 改变任务状态
+            this.$axios.post("/task/finish", {
+                id: taskid,
+                taskStatus: status
+            }).then(res => {
+                if(res.code == "ok") {
+                    this.$toast.success('操作成功');
+                    taskitem.taskStatus = status ? 0 : 1
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
         
         
 
@@ -383,6 +399,16 @@ export default {
             height: 30px;
         }
     }
+    .addtaskicon{
+        position: fixed;
+        z-index: 1000;
+        font-size: 50px;
+        color: #1989fa;
+        background-color: #fff;
+        border-radius: 50%;
+        bottom: 33px;
+        right: 33px;
+    }
     .task_button{
         padding-top: .09rem;
         text-align: right;