浏览代码

工时管家客户定制需求 任务修改

Min 1 年之前
父节点
当前提交
6039f2061a

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/GroupBudgetReviewController.java

@@ -191,9 +191,9 @@ public class GroupBudgetReviewController {
                 }
             }
             item.add(df.format(groupBudgetReview.getCreateTime()));
-            item.add(String.valueOf(groupBudgetReview.getOldManDay()));
-            item.add(String.valueOf(groupBudgetReview.getChangeManDay()));
-            item.add(String.valueOf(groupBudgetReview.getNowManDay()));
+            item.add(String.valueOf(groupBudgetReview.getOldManDay()*8)+"h");
+            item.add(String.valueOf(groupBudgetReview.getChangeManDay()*8)+"h");
+            item.add(String.valueOf(groupBudgetReview.getNowManDay()*8)+"h");
             item.add(String.valueOf(groupBudgetReview.getRemark()));
             item.add(String.valueOf(groupBudgetReview.getRejectReason()==null?"":groupBudgetReview.getRejectReason()));
             item.add(groupBudgetReview.getStatus()==0?"待审核":groupBudgetReview.getStatus()==1?"审核通过":"已驳回");

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

@@ -1451,6 +1451,11 @@ public class ProjectController {
         return projectService.getMembProjectCateRatio(startDate,endDate, onlyShowWarning);
     }
 
+    @RequestMapping("/exportMembProjectCateRatio")
+    public HttpRespMsg exportMembProjectCateRatio(String startDate,String endDate, Integer onlyShowWarning){
+        return projectService.exportMembProjectCateRatio(startDate,endDate, onlyShowWarning);
+    }
+
     //依斯倍定制 员工项目进度表
     @RequestMapping("/userProjectProcessList")
     public HttpRespMsg userProjectProcessList(Integer deptId,String userId,Integer projectId,Integer pageIndex,Integer pageSize){
@@ -1477,14 +1482,14 @@ public class ProjectController {
 
     //依斯倍定制 项目耗用进度表
     @RequestMapping("/projectExpendProcessList")
-    public HttpRespMsg projectExpendProcessList(Integer projectId,Integer categoryId,String userId,Integer pageIndex,Integer pageSize){
-        return projectService.projectExpendProcessList(projectId,categoryId,userId,pageIndex,pageSize);
+    public HttpRespMsg projectExpendProcessList(String startDate,String endDate,Integer projectId,Integer categoryId,String userId,Integer pageIndex,Integer pageSize){
+        return projectService.projectExpendProcessList(startDate,endDate,projectId,categoryId,userId,pageIndex,pageSize);
     }
 
     //依斯倍定制 导出项目耗用进度表
     @RequestMapping("/exportProjectExpendProcessList")
-    public HttpRespMsg exportProjectExpendProcessList(Integer projectId,Integer categoryId,String userId){
-        return projectService.exportProjectExpendProcessList(projectId,categoryId,userId);
+    public HttpRespMsg exportProjectExpendProcessList(String startDate,String endDate,Integer projectId,Integer categoryId,String userId){
+        return projectService.exportProjectExpendProcessList(startDate,endDate,projectId,categoryId,userId);
     }
 
     //依斯倍定制 员工任务进度表

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -544,6 +544,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("custom_degree_multiple")
     private Boolean customDegreeMultiple;
 
+    /**
+     * 任务是否必填 0-否 1-是
+     */
+    @TableField("task_required")
+    private Integer taskRequired;
+
 
     @Override
     protected Serializable pkVal() {

+ 8 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/UserCateTimeVo.java

@@ -2,14 +2,22 @@ package com.management.platform.entity.vo;
 
 import lombok.Data;
 
+import java.util.Map;
+
 @Data
 public class UserCateTimeVo {
     public String userId;
+    public String plate1;
+    public String plate2;
+    public String plate3;
+    public String plate4;
+    public String plate5;
     public String name;
     public Integer category;
     public String categoryName;
     public Double workingTime;
     public Double percent;
+    public Map<String,Object> plateMap;
 
     public boolean warning;
 

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

@@ -175,9 +175,9 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> groupExpendProcessList(String userId, Integer companyId,String startDate,String endDate,@Param("list") List<Integer> deptIds,@Param("listSecond") List<Integer> regularDeptIds);
 
-    List<Map<String, Object>> projectExpendProcessList(Integer projectId, Integer categoryId, String userId, Integer companyId, @Param("list") List<Integer> deptIds, Integer start, Integer size);
+    List<Map<String, Object>> projectExpendProcessList(String startDate,String endDate,Integer projectId, Integer categoryId, String userId, Integer companyId, @Param("list") List<Integer> deptIds, Integer start, Integer size);
 
-    Long projectExpendProcessListCount(Integer projectId, Integer categoryId, String userId, Integer companyId, @Param("list") List<Integer> deptIds);
+    Long projectExpendProcessListCount(String startDate,String endDate,Integer projectId, Integer categoryId, String userId, Integer companyId, @Param("list") List<Integer> deptIds);
 
     List<Map<String, Object>> userTaskProcessList(Integer deptId, String userId, Integer projectId, Integer companyId, @Param("list") List<Integer> deptIds,String startDate,String endDate,@Param("listSecond") List<Integer> regularDeptIds, Integer start, Integer size);
 

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -273,6 +273,8 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg getMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning);
 
+    HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning);
+
     HttpRespMsg userProjectProcessList(Integer deptId, String userId, Integer projectId, Integer pageIndex, Integer pageSize);
 
     HttpRespMsg exportUserProjectProcessList(Integer deptId, String userId, Integer projectId);
@@ -281,9 +283,9 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg exportGroupExpendProcessList(String startDate, String endDate);
 
-    HttpRespMsg projectExpendProcessList(Integer projectId, Integer categoryId, String userId, Integer pageIndex, Integer pageSize);
+    HttpRespMsg projectExpendProcessList(String startDate,String endDate,Integer projectId, Integer categoryId, String userId, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg exportProjectExpendProcessList(Integer projectId, Integer categoryId, String userId);
+    HttpRespMsg exportProjectExpendProcessList(String startDate,String endDate,Integer projectId, Integer categoryId, String userId);
 
     HttpRespMsg userTaskProcessList(Integer deptId, String userId, Integer projectId,String startDate,String endDate, Integer pageIndex, Integer pageSize);
 

+ 93 - 14
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -12234,7 +12234,33 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public HttpRespMsg getMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning) {
         HttpRespMsg msg = new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
         List<UserCateTimeVo> timeList = projectMapper.getMembProjectCateTime(companyId, startDate, endDate);
+        if(!StringUtils.isEmpty(timeList)){
+            for(UserCateTimeVo u:timeList) {
+                HashMap map=new HashMap();
+                for (int i = 0; i < userCustomList.size(); i++) {
+                    switch (i) {
+                        case 0:
+                            map.put(userCustomList.get(i).getName(),u.getPlate1());
+                            break;
+                        case 1:
+                            map.put(userCustomList.get(i).getName(), u.getPlate2());
+                            break;
+                        case 2:
+                            map.put(userCustomList.get(i).getName(), u.getPlate3());
+                            break;
+                        case 3:
+                            map.put(userCustomList.get(i).getName(), u.getPlate4());
+                            break;
+                        case 4:
+                            map.put(userCustomList.get(i).getName(), u.getPlate5());
+                            break;
+                    }
+                }
+                u.setPlateMap(map);
+            }
+        }
         CategoryRatioTblSetting categoryRatioTblSetting = categoryRatioTblSettingMapper.selectById(companyId);
         //把timeList按照用户分组
         Map<String, List<UserCateTimeVo>> userMap = timeList.stream().collect(Collectors.groupingBy(UserCateTimeVo::getUserId));
@@ -12245,6 +12271,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             map.put("userId", entry.getKey());
             List<UserCateTimeVo> value = entry.getValue();
             map.put("userName", value.get(0).getName());
+            map.put("plateMap", value.get(0).getPlateMap());
             map.put("cateTimeList", value);
             //计算这个人的总工时
             double sum = value.stream().mapToDouble(UserCateTimeVo::getWorkingTime).sum();
@@ -12307,8 +12334,60 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return msg;
     }
 
+    @Override
+    public HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        HttpRespMsg respMsg = getMembProjectCateRatio(startDate, endDate, onlyShowWarning);
+        Map<String,Object> resultMap= (Map<String, Object>) respMsg.getData();
+        List<Map<String, Object>> mapList = (List<Map<String, Object>>) resultMap.get("userList");
+        List<ProjectCategory> categoryList = (List<ProjectCategory>) resultMap.get("categoryList");
+        List<String> titleList =new ArrayList<>();
+        titleList.add("人员");
+        if(companyId==4374){
+            titleList.add("员工类型");
+        }
+        titleList.add("总工时");
+        List<String> otherTitileList = categoryList.stream().map(ProjectCategory::getName).collect(Collectors.toList());
+        titleList.addAll(otherTitileList);
+        List<List<String>> dataList=new ArrayList<>();
+        dataList.add(titleList);
+        for (Map<String, Object> map : mapList) {
+            List<String> item=new ArrayList<>();
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                item.add("$userName="+map.get("userName")+"$");
+            }else {
+                item.add(map.get("userName")+"");
+            }
+            if(companyId==4374){
+                Map<String, Object> plateMap = (Map<String, Object>) map.get("plateMap");
+                item.add(plateMap.containsKey("员工类型")?(plateMap.get("员工类型")==null?"":String.valueOf(plateMap.get("员工类型"))):"");
+            }
+            item.add(map.get("workingTime")+"h");
+            List<UserCateTimeVo> cateTimeList = (List<UserCateTimeVo>) map.get("cateTimeList");
+            for (String categoryName : otherTitileList) {
+                Optional<UserCateTimeVo> first = cateTimeList.stream().filter(f -> String.valueOf(f.getCategoryName()).equals(categoryName)).findFirst();
+                if(first.isPresent()){
+                    BigDecimal decimal = new BigDecimal(first.get().getPercent());
+                    item.add("工时:"+first.get().getWorkingTime()+"h"+"\n"+"占比:"+decimal.setScale(0,RoundingMode.HALF_UP).doubleValue()+"%");
+                }else {
+                    item.add("");
+                }
+            }
+            dataList.add(item);
+        }
+        String title= "项目分类工时占比表_"+System.currentTimeMillis();
+        String fileName= title+".xlsx";
+        try {
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return msg;
+    }
 
-//    public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
+    //    public void setDeptIdList(Integer departmentId,List<Integer> deptIds){
 //        LambdaQueryWrapper<Department> lqw = new LambdaQueryWrapper<>();
 //        lqw.eq(Department::getSuperiorId,departmentId);
 //        List<Department> departmentList = departmentMapper.selectList(lqw);
@@ -13030,7 +13109,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg projectExpendProcessList(Integer projectId, Integer categoryId, String userId, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg projectExpendProcessList(String startDate,String endDate,Integer projectId, Integer categoryId, String userId, Integer pageIndex, Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         NumberFormat percentFormat = NumberFormat.getPercentInstance();
@@ -13051,8 +13130,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(!viewAll){
             if(!incharger){
                 //只能查看本人的数据
-                resultList=projectMapper.projectExpendProcessList(projectId,categoryId,user.getId(),companyId,null,start,size);
-                total=projectMapper.projectExpendProcessListCount(projectId,categoryId,user.getId(),companyId,null);
+                resultList=projectMapper.projectExpendProcessList(startDate,endDate,projectId,categoryId,user.getId(),companyId,null,start,size);
+                total=projectMapper.projectExpendProcessListCount(startDate,endDate,projectId,categoryId,user.getId(),companyId,null);
             }else {
                 List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().select(Department::getDepartmentId).eq(Department::getManagerId, user.getId()));
                 List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
@@ -13066,12 +13145,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDeptList);
                     deptIds.addAll(branchDepartment);
                 }
-                resultList=projectMapper.projectExpendProcessList(projectId,categoryId,userId,companyId,deptIds,start,size);
-                total=projectMapper.projectExpendProcessListCount(projectId,categoryId,userId,companyId,deptIds);
+                resultList=projectMapper.projectExpendProcessList(startDate,endDate,projectId,categoryId,userId,companyId,deptIds,start,size);
+                total=projectMapper.projectExpendProcessListCount(startDate,endDate,projectId,categoryId,userId,companyId,deptIds);
             }
         }else {
-            resultList=projectMapper.projectExpendProcessList(projectId,categoryId,userId,companyId,null,start,size);
-            total=projectMapper.projectExpendProcessListCount(projectId,categoryId,userId,companyId,null);
+            resultList=projectMapper.projectExpendProcessList(startDate,endDate,projectId,categoryId,userId,companyId,null,start,size);
+            total=projectMapper.projectExpendProcessListCount(startDate,endDate,projectId,categoryId,userId,companyId,null);
         }
         for (Map<String, Object> map : resultList) {
             if(StringUtils.isEmpty(String.valueOf(map.get("executorString")))){
@@ -13119,13 +13198,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg exportProjectExpendProcessList(Integer projectId, Integer categoryId, String userId) {
+    public HttpRespMsg exportProjectExpendProcessList(String startDate,String endDate,Integer projectId, Integer categoryId, String userId) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         NumberFormat percentFormat = NumberFormat.getPercentInstance();
         percentFormat.setMaximumFractionDigits(2);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
-        HttpRespMsg resultMsg = projectExpendProcessList(projectId,categoryId,userId,null,null);
+        HttpRespMsg resultMsg = projectExpendProcessList(startDate,endDate,projectId,categoryId,userId,null,null);
         Map<String, Object> msgData = (Map<String, Object>) resultMsg.getData();
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) msgData.get("record");
         List<List<String>> dataList=new ArrayList<>();
@@ -13147,8 +13226,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             item.add(String.valueOf(map.get("projectName")));
             item.add(String.valueOf(map.get("categoryName")));
             item.add(String.valueOf(map.get("projectCode")));
-            item.add(String.valueOf(map.get("planStartDate")));
-            item.add(String.valueOf(map.get("planEndDate")));
+            item.add(map.get("planStartDate")==null?"":String.valueOf(map.get("planStartDate")));
+            item.add(map.get("planEndDate")==null?"":String.valueOf(map.get("planEndDate")));
             item.add(String.valueOf(map.get("planHour")));
             item.add(String.valueOf(map.get("realHour")));
             item.add(String.valueOf(map.get("realCost")));
@@ -13422,8 +13501,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 list.add(String.valueOf(maps.get(i).get("planHour")));
                 list.add(String.valueOf(maps.get(i).get("consumeTime")));
                 list.add(String.valueOf(maps.get(i).get("residue")));
-                list.add(String.valueOf(maps.get(i).get("planStartDate")));
-                list.add(String.valueOf(maps.get(i).get("planEndDate")));
+                list.add(maps.get(i).get("planStartDate")==null?"":String.valueOf(maps.get(i).get("planStartDate")));
+                list.add(maps.get(i).get("planEndDate")==null?"":String.valueOf(maps.get(i).get("planEndDate")));
             }
         }
         int k=0;

+ 13 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -2043,36 +2043,37 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             //headCell.setCellValue("部门");
             headCell.setCellValue(MessageUtils.message("excel.department"));
             headCell.setCellStyle(headStyle);
+            int auditIndex = -1;
             if(timeType.getReportAuditType() == 5 || timeType.getReportAuditType() == 6){
                 headCell = headRow.createCell(5);
-                //headCell.setCellValue("部门");
                 headCell.setCellValue("直属审核人");
                 headCell.setCellStyle(headStyle);
+                auditIndex=0;
             }
 
             int minusIndex = -2;
             if (canViewCost) {
-                headCell = headRow.createCell(6);
+                headCell = headRow.createCell(6+auditIndex);
                 //headCell.setCellValue("月薪");
                 headCell.setCellValue(MessageUtils.message("excel.MonSalary"));
                 headCell.setCellStyle(headStyle);
-                headCell = headRow.createCell(7);
+                headCell = headRow.createCell(7+auditIndex);
                 //headCell.setCellValue("时薪");
                 headCell.setCellValue(MessageUtils.message("excel.hourlyWage"));
                 headCell.setCellStyle(headStyle);
                 minusIndex = 0;
             }
 
-            headCell = headRow.createCell(8+minusIndex);
+            headCell = headRow.createCell(8+minusIndex+auditIndex);
             //headCell.setCellValue("证书");
             headCell.setCellValue(MessageUtils.message("excel.certificate"));
             headCell.setCellStyle(headStyle);
             for (int i = 0; i < userCustomList.size(); i++) {
-                headCell = headRow.createCell(minusIndex+9+i);
+                headCell = headRow.createCell(minusIndex+9+i+auditIndex);
                 headCell.setCellValue(userCustomList.get(i).getName());
                 headCell.setCellStyle(headStyle);
             }
-            headCell = headRow.createCell(minusIndex+9+userCustomList.size());
+            headCell = headRow.createCell(minusIndex+9+userCustomList.size()+auditIndex);
             //headCell.setCellValue("状态");
             headCell.setCellValue(MessageUtils.message("leave.status"));
             headCell.setCellStyle(headStyle);
@@ -2134,8 +2135,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
                 }
                 if (canViewCost) {
-                    row.createCell(6).setCellValue(item.getMonthCost()==null? 0 : item.getMonthCost().intValue());
-                    row.createCell(7).setCellValue(item.getCost() == null?0.0 : item.getCost().doubleValue());
+                    row.createCell(6+auditIndex).setCellValue(item.getMonthCost()==null? 0 : item.getMonthCost().intValue());
+                    row.createCell(7+auditIndex).setCellValue(item.getCost() == null?0.0 : item.getCost().doubleValue());
                 }
                 List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
                 if(certList.size()>0){
@@ -2147,9 +2148,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                             s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate();
                         }
                     }
-                    row.createCell(8+minusIndex).setCellValue(s);
+                    row.createCell(8+minusIndex+auditIndex).setCellValue(s);
                 }else {
-                    row.createCell(8+minusIndex).setCellValue("");
+                    row.createCell(8+minusIndex+auditIndex).setCellValue("");
                 }
                 for (int i = 0; i < userCustomList.size(); i++) {
                     String value="";
@@ -2165,9 +2166,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                         case 4:value=item.getPlate5()==null?"":item.getPlate5();
                             break;
                     }
-                    row.createCell(9+i+minusIndex).setCellValue(value);
+                    row.createCell(9+i+minusIndex+auditIndex).setCellValue(value);
                 }
-                row.createCell(9+userCustomList.size()+minusIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
+                row.createCell(9+userCustomList.size()+minusIndex+auditIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
                 rowNum++;
             }
             //生成Excel文件

+ 14 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -1787,7 +1787,9 @@
     </select>
     <!--获取员工的项目分类工时统计数据 -->
     <select id="getMembProjectCateTime" resultType="com.management.platform.entity.vo.UserCateTimeVo">
-        SELECT user.id AS userId, user.`name`, project.`category`, project.`category_name` AS categoryName, SUM(report.`working_time`) AS workingTime FROM report LEFT JOIN `user` ON user.id = report.`creator_id`
+        SELECT user.id AS userId,user.plate1 as plate1,user.plate2 as plate2,user.plate3 as plate3,user.plate4 as plate4,user.plate5 as plate5, user.`name`, project.`category`, project.`category_name` AS categoryName, SUM(report.`working_time`) AS workingTime
+        FROM report
+        LEFT JOIN `user` ON user.id = report.`creator_id`
         LEFT JOIN project ON project.id = report.`project_id`
         WHERE report.`company_id` = #{companyId}
         AND report.`create_date` BETWEEN #{startDate} and #{endDate}
@@ -1900,16 +1902,16 @@
 
     <select id="projectExpendProcessList" resultType="java.util.Map">
         select p.id AS projectId,p.project_name as projectName,DATE_FORMAT(p.`plan_start_date`,'%Y-%m-%d') AS planStartDate,DATE_FORMAT(p.`plan_end_date`,'%Y-%m-%d') AS planEndDate,pc.name as categoryName,p.project_code as projectCode,IFNULL(SUM(te.plan_hours),0) as planHour,
-        IFNULL((select SUM(working_time) from report where project_id=p.id and state=1),0) as realHour, IFNULL((select SUM(cost) from report where project_id=p.id and state=1),0) as realCost,
-        IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where project_id=p.id and state=1),0),0) as residueHour,
-        GROUP_CONCAT(CONCAT_WS('|',te.executor_name,IFNULL((select SUM(working_time) from report where creator_id=te.executor_id and project_id=p.id and state=1),0))) as executorString
+        IFNULL((select SUM(working_time) from report where project_id=p.id and create_date BETWEEN #{startDate} AND #{endDate} and state=1),0) as realHour, IFNULL((select SUM(cost) from report where project_id=p.id and create_date BETWEEN #{startDate} AND #{endDate} and state=1),0) as realCost,
+        IFNULL(IFNULL(SUM(te.plan_hours),0)-IFNULL((select SUM(working_time) from report where project_id=p.id and create_date BETWEEN #{startDate} AND #{endDate} and state=1),0),0) as residueHour,
+        GROUP_CONCAT(CONCAT_WS('|',te.executor_name,IFNULL((select SUM(working_time) from report where creator_id=te.executor_id and project_id=p.id and create_date BETWEEN #{startDate} AND #{endDate} and state=1),0))) as executorString
         from task_executor te
         left join  user u on u.id=te.executor_id
         left join department d on u.department_id=d.department_id
         left join task t on t.id=te.task_id
         left join project p on p.id=t.project_id
         left join project_category pc on pc.id=p.category
-        where u.company_id=#{companyId} and te.project_id is not null  and pc.name in ('报价项目','售后报价项目','售后工程项目')
+        where u.company_id=#{companyId} and te.project_id is not null  and pc.name in ('报价项目','售后报价项目','售后工程项目','工程项目')
         <if test="projectId!=null">
             and p.id=#{projectId}
         </if>
@@ -1940,7 +1942,7 @@
         left join task t on t.id=te.task_id
         left join project p on p.id=t.project_id
         left join project_category pc on pc.id=p.category
-        where u.company_id=#{companyId} and te.project_id is not null  and pc.name in ('报价项目','售后报价项目','售后工程项目')
+        where u.company_id=#{companyId} and te.project_id is not null  and pc.name in ('报价项目','售后报价项目','售后工程项目','工程项目')
         <if test="projectId!=null">
             and p.id=#{projectId}
         </if>
@@ -1992,7 +1994,9 @@
             </foreach>
         </if>
         <if test="startDate!=null and endDate!=null and startDate!='' and endDate!=''">
-            and t.start_date &gt;= #{startDate} and t.end_date &lt;= #{endDate}
+            and ((t.start_date between #{startDate} and  #{endDate})
+            or
+            (t.end_date between #{startDate} and  #{endDate}))
         </if>
         group by te.executor_id,t.id
         order by d.department_id,u.id
@@ -2032,7 +2036,9 @@
             </foreach>
         </if>
         <if test="startDate!=null and endDate!=null and startDate!='' and endDate!=''">
-            and t.start_date &gt;= #{startDate} and t.end_date &lt;= #{endDate}
+            and ((t.start_date between #{startDate} and  #{endDate})
+            or
+            (t.end_date between #{startDate} and  #{endDate}))
         </if>
         group by te.executor_id,t.id
         order by d.department_id,u.id

文件差异内容过多而无法显示
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 28 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -194,7 +194,7 @@
       </div>
       <!-- <p :style="ins == 9 ? 'float: right;margin-right: 25px;width:20%' : 'float: right;margin-right: 25px;width:10%'" > -->
       <p :style="`${ins == 9 ? 'width:20%' : ins == 14 ? 'width: 20%' : 'width: 10%'}`" class="tableRightBtn">
-        <el-button type="primary" @click="exportExcel" size="mini" v-if="ins != 21">{{ $t('reporderived') }}</el-button>
+        <el-button type="primary" @click="exportExcel" size="mini">{{ $t('reporderived') }}</el-button>
         <el-button type="primary" @click="fillAll" size="mini" v-if="ins == 14">全部补足</el-button>
         <el-button type="primary" @click="exportExcelByQuarter" size="mini" v-if="ins == 9 && user.companyId == 876">{{ $t('an-ji-du-dao-chu') }}</el-button>
         <el-button type="primary" @click="setWarning" size="mini" v-if="ins == 21">设置预警</el-button>
@@ -1004,6 +1004,13 @@
                   </div>
                 </template>
               </el-table-column>
+              <el-table-column v-if="user.companyId==4374" align="center" prop="name" label="员工类型" min-width="150" fixed="left">
+                <template slot-scope="scope">
+                    <span>
+                      {{findValue('员工类型',scope.row.plateMap)}}
+                    </span>
+                </template>
+              </el-table-column>
               <el-table-column align="center" prop="workingTime" label="总工时" min-width="150">
                 <template slot-scope="scope">
                   {{ scope.row.workingTime }} h
@@ -1495,7 +1502,7 @@ export default {
         monthRange: [19], // 月份区间筛选条件 (等于)
         staff: [6, 8, 9, 19, 11, 14, 18, 23, 25, 26], // 人员筛选条件 (等于)
         departments: [14, 15, 23, 26], // 部门筛选条件 (等于)
-        timePeriod: [5, 6, 8, 9, 10, 11, 12, 16, 17, 18, 20, 21, 22, 24, 26], // 时间段筛选条件 (等于)
+        timePeriod: [5, 6, 8, 9, 10, 11, 12, 16, 17, 18, 20, 21, 22, 24, 25, 26], // 时间段筛选条件 (等于)
       },
       efficentList:[],
       groupNames: [],
@@ -1893,6 +1900,14 @@ export default {
           });
       });
     },
+    //根据key找到value
+    findValue(key,obj) {
+       for (let k in obj){
+            if (k===key){
+                return obj[k]
+           }
+        }
+    },
     getDepartmentList() {
       this.http.post( this.port.manage.depList, {},
         res => {
@@ -2284,6 +2299,12 @@ export default {
           url = "/project/exportEffectiveLaborHourRate"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
+        }else if(this.ins == 21) {
+          fName = '项目分类工时占比表' + '.xlsx'
+          url = "/project/exportMembProjectCateRatio"
+          sl.onlyShowWarning=0
+          sl.startDate = this.rangeDatas[0]
+          sl.endDate = this.rangeDatas[1]
         } else if(this.ins == 22) {
           fName = '分类工时明细表' + '.xlsx'
           url = "/report/exportUserWorkTimeByCategory"
@@ -2305,6 +2326,8 @@ export default {
         } else if(this.ins == 25) {
           fName = '项目耗用进度表' + '.xlsx'
           url = "/project/exportProjectExpendProcessList"
+          sl.startDate = this.rangeDatas[0]
+          sl.endDate = this.rangeDatas[1]
           this.proJuctId ? sl.projectId = this.proJuctId : ''
           this.userId ? sl.userId = this.userId : ''
           this.projectSortIdTwo ? sl.categoryId = this.projectSortIdTwo : ''
@@ -3767,7 +3790,7 @@ export default {
       let dataList = data || []
       dataList.push({id: 0, name: '未分类'})
       this.projectSortList = dataList
-      this.projectSortListTwo = dataList.filter((item) => item.name == '报价项目' || item.name == '售后工程项目' || item.name == '售后报价项目')
+      this.projectSortListTwo = dataList.filter((item) => item.name == '报价项目' || item.name == '售后工程项目' || item.name == '售后报价项目'||item.name == '工程项目')
       this.projectSortId = dataList[0].id
       this.projectSortName = dataList[0].name
     },
@@ -3830,6 +3853,8 @@ export default {
     // 项目耗用进度表
     async getConsumptionScheduleTwo() {
       let parameter = {
+        startDate: this.rangeDatas[0],
+        endDate: this.rangeDatas[1],
         pageIndex: this.page,
         pageSize: this.size,
       }

+ 11 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -226,6 +226,9 @@
                     </div>
                   </template>
                 </el-table-column>
+                <el-table-column v-if="user.companyId==4374" :label="'员工类型'" width="100">
+                    <template slot-scope="scope">{{findValue('员工类型',scope.row.plateMap)}}</template>
+                </el-table-column>
                 <el-table-column :label="$t('jiao-se')" width="100">
                     <template slot-scope="scope">{{scope.row.roleName}}</template>
                 </el-table-column>
@@ -1525,6 +1528,14 @@ export default {
         }
       );
     },
+    //根据key找到value
+    findValue(key,obj) {
+       for (let k in obj){
+            if (k===key){
+                return obj[k]
+           }
+        }
+    },
     test() {
       this.getCustomConfigList();
     },