Forráskód Böngészése

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

QuYueTing 1 hónapja
szülő
commit
8105d7e0f8
14 módosított fájl, 170 hozzáadás és 50 törlés
  1. 30 3
      fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/controller/TaskController.java
  2. 6 0
      fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/entity/Information.java
  3. 73 14
      fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  4. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingTalkController.java
  5. 10 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinanceController.java
  6. 3 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/FinanceMapper.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java
  8. 4 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/FinanceService.java
  9. 15 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  10. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FinanceMapper.xml
  11. 3 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  12. 3 2
      fhKeeper/formulahousekeeper/timesheet_mld/src/components/taskComponent.vue
  13. 3 2
      fhKeeper/formulahousekeeper/timesheet_mld/src/views/Home.vue
  14. 1 3
      fhKeeper/formulahousekeeper/timesheet_mld/src/views/project/gantt.vue

+ 30 - 3
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/controller/TaskController.java

@@ -499,12 +499,21 @@ public class TaskController {
                 msgRecepientList=new ArrayList<>();
                 log.info("添加工作计划,给第一审核人发送信息提醒");
                 User owner = userMapper.selectById(inchargerId);
+                System.out.println(task.getExecutorList().toString());
                 Information information = new Information();
-                information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
+                String executorNames = task.getExecutorList().stream()
+                        .map(TaskExecutor::getExecutorName)
+                        .collect(Collectors.joining(","));
+
+                String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
+                        (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                        ",请您查收.";
+                information.setMsg(infoMsg);
                 information.setTaskId(task.getId());
                 information.setType(11);
                 information.setUserId(owner.getId());
                 information.setTime(LocalDateTime.now());
+                information.setJumpType(3);
                 informationService.save(information);
             }
         } else if (saved && shouldResetAuditStatus) {
@@ -514,7 +523,16 @@ public class TaskController {
             User owner = userMapper.selectById(inchargerId);
             Information information = new Information();
             information.setType(11);
-            information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
+            List<TaskExecutor> taskExecutors = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", task.getId()));
+            String executorNames = taskExecutors.stream()
+                    .map(TaskExecutor::getExecutorName)
+                    .collect(Collectors.joining(","));
+
+            String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
+                    (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                    ",请您查收.";
+            information.setMsg(infoMsg);
+            information.setJumpType(3);
             information.setTaskId(task.getId());
             information.setUserId(owner.getId());
             information.setTime(LocalDateTime.now());
@@ -585,6 +603,7 @@ public class TaskController {
         User user = userMapper.selectById(token);
         Task task = taskMapper.selectById(taskId);
         Project project = projectMapper.selectById(task.getProjectId());
+        List<TaskExecutor> taskExecutors = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", task.getId()));
         if (task.getTaskPlan()!=1&&task.getIsTaskPlan()!=1){
             msg.setError("当前计划已变成任务不能撤回计划");
             return msg;
@@ -601,7 +620,15 @@ public class TaskController {
                 Information information = new Information();
 
                 User owner = userMapper.selectById(project.getInchargerId());
-                information.setMsg(project.getProjectName()+"项目有预计FTE计划撤销");
+                String executorNames = taskExecutors.stream()
+                        .map(TaskExecutor::getExecutorName)
+                        .collect(Collectors.joining(","));
+
+                String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
+                        (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                        ",项目有预计FTE计划撤销.";
+                information.setMsg(infoMsg);
+                information.setJumpType(2);
 //                information.setTaskId(task.getId());
                 information.setUserId(owner.getId());
                 information.setType(11);

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

@@ -74,6 +74,12 @@ public class Information extends Model<Information> {
     @TableField("task_id")
     private Integer taskId;
 
+    /**
+     * 跳转类型 1、我执行的,2、我创建的、3、待我审核的
+     */
+    @TableField("jump_type")
+    private Integer jumpType;
+
     @TableField(exist = false)
     private GanttDataItem ganttData;
 

+ 73 - 14
fhKeeper/formulahousekeeper/management-platform-mld/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -860,9 +860,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 if (projectFirst.isPresent()) {
                     Project project = projectFirst.get();
                     Information information = new Information();
-                    information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
+                    String executorNames = task.getExecutorList().stream()
+                            .map(TaskExecutor::getExecutorName)
+                            .collect(Collectors.joining(","));
+
+                    String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
+                            (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                            ",请您查收.";
+                    information.setMsg(infoMsg);
                     information.setTaskId(task.getId());
                     information.setType(11);
+                    information.setJumpType(3);
                     information.setTime(LocalDateTime.now());
                     Optional<User> first = allUserList.stream().filter(u -> u.getId().equals(project.getInchargerId())).findFirst();
                     if (first.isPresent()) {
@@ -1411,11 +1419,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     taskExecutorMapper.updateById(e);
                 });
 
+                List<String> secondAuditorIdList = executorList.stream()
+                        .map(TaskExecutor::getSecondAuditorId)
+                        .filter(Objects::nonNull)          // 过滤 null 值
+                        .distinct()                       // 去重
+                        .collect(Collectors.toList());
                 //给第二审核人发送信息提醒
-                executorList.forEach(e->{
-                    User owner = userMapper.selectById(e.getSecondAuditorId());
+                secondAuditorIdList.forEach(e->{
+                    User owner = userMapper.selectById(e);
                     Information information = new Information();
-                    information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
+                    String executorNames = executorList.stream()
+                            .map(TaskExecutor::getExecutorName)
+                            .collect(Collectors.joining(","));
+
+                    String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
+                            (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                            ",请您查收.";
+                    information.setMsg(infoMsg);
+                    information.setJumpType(3);
                     information.setTaskId(task.getId());
                     information.setUserId(owner.getId());
                     information.setType(11);
@@ -1436,9 +1457,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     //给小组长发消息,提醒通过了
                     User owner = userMapper.selectById(task.getCreaterId());
                     Information information = new Information();
-                    information.setMsg("您有工作计划审核通过了");
+                    String executorNames = executorList.stream()
+                            .map(TaskExecutor::getExecutorName)
+                            .collect(Collectors.joining(","));
+
+                    String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
+                            (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                            ",工作计划审核通过了.";
+                    information.setMsg(infoMsg);
                     information.setType(11);
                     information.setUserId(owner.getId());
+                    information.setJumpType(2);
                     information.setTime(LocalDateTime.now());
                     informationMapper.insert(information);
 
@@ -1447,10 +1476,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         for (TaskExecutor taskExecutor : executorList) {
                             //给任务的执行人发送信息提醒
                             information = new Information();
-                            information.setMsg("您有新的任务");
+                            information.setMsg(project.getProjectName() + "项目的FTE计划审批任务,您有新的工作计划");
                             information.setContent(taskExecutor.getProjectId()==null?null:(""+taskExecutor.getProjectId()));
-                            information.setType(1);
-                            information.setUserId(owner.getId());
+                            information.setType(11);
+                            information.setJumpType(1);
+                            information.setUserId(taskExecutor.getExecutorId());
                             information.setTime(LocalDateTime.now());
                             informationMapper.insert(information);
                         }
@@ -1474,8 +1504,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 //给小组长发送信息提醒
                 User owner = userMapper.selectById(task.getCreaterId());
                 Information information = new Information();
-                information.setMsg("您有工作计划被驳回");
+                String executorNames = executorList.stream()
+                        .map(TaskExecutor::getExecutorName)
+                        .collect(Collectors.joining(","));
+
+                String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
+                        (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                        ",工作计划被驳回";
+                information.setMsg(infoMsg);
                 information.setType(11);
+                information.setJumpType(2);
                 information.setUserId(owner.getId());
                 information.setTime(LocalDateTime.now());
                 informationMapper.insert(information);
@@ -1496,8 +1534,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 //给小组长发送信息提醒
                 User owner = userMapper.selectById(task.getCreaterId());
                 Information information = new Information();
-                information.setMsg("您有工作计划被驳回");
+                String executorNames = executorList.stream()
+                        .map(TaskExecutor::getExecutorName)
+                        .collect(Collectors.joining(","));
+
+                String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
+                        (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                        ",工作计划被驳回";
+                information.setMsg(infoMsg);
                 information.setType(11);
+                information.setJumpType(2);
                 information.setUserId(owner.getId());
                 information.setTime(LocalDateTime.now());
                 informationMapper.insert(information);
@@ -1511,25 +1557,38 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         Task task = taskMapper.selectById(id);
+        //给执行人发消息
+        List<TaskExecutor> executorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", id));
+        Project project = projectMapper.selectById(task.getProjectId());
+
         if (task.getTaskStatus() == TaskController.STATUS_DOING) {
             task.setTaskStatus(TaskController.STATUS_CANCEL);
             taskMapper.updateById(task);
             //给小组长发送信息提醒
             User owner = userMapper.selectById(task.getCreaterId());
+
             Information information = new Information();
-            information.setMsg("您有工作计划被取消");
+            String executorNames = executorList.stream()
+                    .map(TaskExecutor::getExecutorName)
+                    .collect(Collectors.joining(","));
+
+            String infoMsg = project.getProjectName() + "项目" +
+                    (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
+                    ",FTE计划审批任务您有工作计划被取消.";
+            information.setMsg(infoMsg);
             information.setType(11);
+            information.setJumpType(2);
             information.setUserId(owner.getId());
             information.setTime(LocalDateTime.now());
             informationMapper.insert(information);
 
-            //给执行人发消息
-            List<TaskExecutor> executorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", id));
+
             executorList.forEach(e->{
                 User executor = userMapper.selectById(e.getExecutorId());
                 Information exeInformation = new Information();
-                exeInformation.setMsg("您有工作计划被取消");
+                exeInformation.setMsg(project.getProjectName() + "项目,FTE计划审批任务您有工作计划被取消");
                 exeInformation.setType(11);
+                exeInformation.setJumpType(1);
                 exeInformation.setUserId(executor.getId());
                 exeInformation.setTime(LocalDateTime.now());
                 informationMapper.insert(exeInformation);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingTalkController.java

@@ -43,10 +43,10 @@ public class DingTalkController {
         DingTalkUserInfo userInfo = dingTalkService.getUserInfoByCode(code);
         
         // 2. 业务系统登录逻辑
-        String token = "";
+        String userId = "";
         
         // 3. 重定向到前端并携带token
-        response.sendRedirect(dingTalkConfig.getRedirectUri() + "?token=" + token);
+        response.sendRedirect(dingTalkConfig.getRedirectUri() + "?userId=" + userId);
         return ResponseEntity.ok().build();
     }
 }

+ 10 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinanceController.java

@@ -61,8 +61,8 @@ public class FinanceController {
     private String path;
 
     @RequestMapping("/getByMonth")
-    public HttpRespMsg getByMonth(Integer companyId, String yearMonth) {
-        return financeService.getByMonth(companyId, yearMonth);
+    public HttpRespMsg getByMonth(Integer companyId, String yearMonth,Integer deptId) {
+        return financeService.getByMonth(companyId, yearMonth,deptId);
     }
 
     @RequestMapping("/getProjects")
@@ -103,8 +103,10 @@ public class FinanceController {
     @RequestMapping("/exportData")
     public HttpRespMsg exportData(@RequestParam(required = false, defaultValue = "0") Integer groupByCategory,
                                   @RequestParam(defaultValue = "0")Integer onlyTotal,
-                                  @RequestParam String date, Boolean assignNoProUser,HttpServletRequest request) {
-        return financeService.exportData(groupByCategory,onlyTotal, date, assignNoProUser, request);
+                                  @RequestParam String date, Boolean assignNoProUser,
+                                  Integer deptId,
+                                  HttpServletRequest request) {
+        return financeService.exportData(groupByCategory,onlyTotal, date, assignNoProUser,deptId, request);
     }
 
     /**
@@ -114,14 +116,14 @@ public class FinanceController {
      * @return
      */
     @RequestMapping("/exportFinance")
-    public HttpRespMsg exportFinance(@RequestParam String date, HttpServletRequest request) {
-        return financeService.exportFinance(date, request);
+    public HttpRespMsg exportFinance(@RequestParam String date,Integer deptId, HttpServletRequest request) {
+        return financeService.exportFinance(date,deptId, request);
     }
 
     //按照项目分配财务成本
     @RequestMapping("/getTimeCost")
-    public HttpRespMsg getTimeCost(String yearMonth, Boolean assignNoProUser,HttpServletRequest request) {
-        return financeService.getTimeCost(yearMonth, assignNoProUser,request);
+    public HttpRespMsg getTimeCost(String yearMonth,Integer deptId, Boolean assignNoProUser,HttpServletRequest request) {
+        return financeService.getTimeCost(yearMonth,deptId, assignNoProUser,request);
     }
 
     @RequestMapping("/getNoProjectUsers")

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/FinanceMapper.java

@@ -3,6 +3,8 @@ package com.management.platform.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.management.platform.entity.Finance;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,5 @@ import com.management.platform.entity.Finance;
  */
 public interface FinanceMapper extends BaseMapper<Finance> {
 
+    List<Finance> selectListByDept(Integer companyId, String yearMonth, Integer deptId);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -129,7 +129,7 @@ public interface ReportMapper extends BaseMapper<Report> {
 
     List<Map<String, Object>> getRealProjectTime(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate, Integer companyId);
 
-    List<Map<String, Object>> getRealProjectTimeNew(@Param("ym")String ym,@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate, Integer companyId);
+    List<Map<String, Object>> getRealProjectTimeNew(@Param("ym")String ym,@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate, Integer companyId,Integer deptId);
 
     List<Map<String, Object>> getReportFillStatus(String startDate, String endDate, String userId);
 

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

@@ -17,17 +17,17 @@ import javax.servlet.http.HttpServletRequest;
  */
 public interface FinanceService extends IService<Finance> {
 
-    HttpRespMsg getByMonth(Integer companyId, String yearMonth);
+    HttpRespMsg getByMonth(Integer companyId, String yearMonth,Integer deptId);
 
     HttpRespMsg importData(Integer companyId, String yearMonth, Boolean syncUserCost, Boolean syncHistoryReport, MultipartFile multipartFile, HttpServletRequest request) throws Exception;
 
-    HttpRespMsg exportData(Integer groupByCategory,Integer onlyTotal, String date, Boolean assignNoProUser, HttpServletRequest request);
+    HttpRespMsg exportData(Integer groupByCategory,Integer onlyTotal, String date, Boolean assignNoProUser,Integer deptId, HttpServletRequest request);
 
-    HttpRespMsg getTimeCost(String yearMonth, Boolean assignNoProUser, HttpServletRequest request);
+    HttpRespMsg getTimeCost(String yearMonth,Integer deptId, Boolean assignNoProUser, HttpServletRequest request);
 
     HttpRespMsg getNoProjectUsers(String yearMonth, HttpServletRequest request);
 
     HttpRespMsg getProjects(Integer companyId, String yearMonth);
 
-    HttpRespMsg exportFinance(String date, HttpServletRequest request);
+    HttpRespMsg exportFinance(String date,Integer deptId, HttpServletRequest request);
 }

+ 15 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -100,9 +100,10 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
     private String path;
 
     @Override
-    public HttpRespMsg getByMonth(Integer companyId, String yearMonth) {
+    public HttpRespMsg getByMonth(Integer companyId, String yearMonth,Integer deptId) {
         HttpRespMsg msg = new HttpRespMsg();
-        List<Finance> financeList = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+//        List<Finance> financeList = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+        List<Finance> financeList = financeMapper.selectListByDept(companyId, yearMonth,deptId);
         TimeType timeType = timeTypeMapper.selectById(companyId);
         //当前月是否有项目日报数据
         List<Map<String, Object>> userList = reportMapper.selectFillReportUserList(companyId, yearMonth+"-01", yearMonth+"-31");
@@ -655,7 +656,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
     }
 
     @Override
-    public HttpRespMsg exportData(Integer groupByCategory,Integer onlyTotal, String yearMonth, Boolean assignNoProUser, HttpServletRequest request) {
+    public HttpRespMsg exportData(Integer groupByCategory,Integer onlyTotal, String yearMonth, Boolean assignNoProUser, Integer deptId,HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
@@ -776,7 +777,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
 
 //            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTime(startDate, endDate, companyId);
             /**添加非分摊项目过滤*/
-            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId);
+            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId,deptId);
             //如果定义了可分摊项目的过滤,按照数据处理一下
             CostProjectSetting setting = costProjectSettingMapper.selectOne(new QueryWrapper<CostProjectSetting>().eq("company_id", companyId));
             if (setting != null && setting.getSettingType() > 0) {
@@ -817,7 +818,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     userTime.get(creatorId).workingTime = userTime.get(creatorId).workingTime.add(new BigDecimal((Double)map.get("workingTime")));
                 }
             }
-            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+//            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+            List<Finance> finances = financeMapper.selectListByDept(companyId,yearMonth,deptId);
             List<Finance> noProjectUser = new ArrayList<>();
             //计算无项目的人员
             for (Finance f : finances) {
@@ -1990,7 +1992,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
     }
 
     @Override
-    public HttpRespMsg getTimeCost(String yearMonth, Boolean assignNoProUser, HttpServletRequest request) {
+    public HttpRespMsg getTimeCost(String yearMonth,Integer deptId, Boolean assignNoProUser, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
@@ -2004,7 +2006,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
 
 //            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTime(startDate, endDate, companyId);
             /**添加非分摊项目过滤*/
-            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId);
+            List<Map<String, Object>> projectTimeList = reportMapper.getRealProjectTimeNew(yearMonth,startDate, endDate, companyId,deptId);
             //如果定义了可分摊项目的过滤,按照数据处理一下
             CostProjectSetting setting = costProjectSettingMapper.selectOne(new QueryWrapper<CostProjectSetting>().eq("company_id", companyId));
             if (setting != null && setting.getSettingType() > 0) {
@@ -2043,7 +2045,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     userTime.put(creatorId, d);
                 }
             }
-            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+//            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+            List<Finance> finances = financeMapper.selectListByDept(companyId,yearMonth,deptId);
             //未投入项目的人员
             ProjectSumItem noProjectItem = new ProjectSumItem();
             List<Finance> noProjectUser = new ArrayList<>();
@@ -2216,7 +2219,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             resultMap.put("noProjectItem", noProjectItem);
             resultMap.put("totalMoneyCost", totalMoneyCost);
             if (missingFinanceUserIds.size() > 0) {
-                List<Map<String, Object>> userList = userMapper.getSimpleNameList(new QueryWrapper<User>().in("id", missingFinanceUserIds));
+                List<Map<String, Object>> userList = userMapper.getSimpleNameList(new QueryWrapper<User>().in("id", missingFinanceUserIds).eq("department_id",deptId));
                 resultMap.put("missingFinanceUserList", userList);
             } else {
                 resultMap.put("missingFinanceUserList", new ArrayList<>());
@@ -2286,7 +2289,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
     }
 
     @Override
-    public HttpRespMsg exportFinance(String yearMonth, HttpServletRequest request) {
+    public HttpRespMsg exportFinance(String yearMonth,Integer deptId, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
@@ -2337,7 +2340,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
 
 
             //获取月成本列表
-            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+//            List<Finance> finances = financeMapper.selectList(new QueryWrapper<Finance>().eq("company_id", companyId).eq("ymonth", yearMonth));
+            List<Finance> finances = financeMapper.selectListByDept(companyId,yearMonth,deptId);
             for (Finance f : finances) {
                 User user = userList.stream().filter(ul -> ul.getId().equals(f.getUserId())).findFirst().get();
                 BigDecimal cost = f.getTotalCost();

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FinanceMapper.xml

@@ -34,5 +34,21 @@
     <sql id="Base_Column_List">
         id, user_id, job_number, name, company_id, dept_name, month_cost, bonus, allowance, insurance_old, insurance_medical, insurance_losejob, insurance_injury, house_fund, others, total_cost, ymonth, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7
     </sql>
+    <select id="selectListByDept" resultType="com.management.platform.entity.Finance">
+        SELECT f.* FROM finance f
+                left JOIN user on f.user_id=user.id
+                left JOIN department d on d.department_id=`user`.department_id
+        <where>
+            <if test="deptId !=null">
+                and d.department_id=#{deptId}
+            </if>
+            <if test="companyId !=null">
+                and f.company_id=#{companyId}
+            </if>
+            <if test="yearMonth !=null and yearMonth !='' ">
+                and f.ymonth=#{yearMonth}
+            </if>
+        </where>
+    </select>
 
 </mapper>

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

@@ -934,6 +934,9 @@
         <if test="endDate != null">
             AND report.create_date &lt; #{endDate}
         </if>
+        <if test="deptId != null">
+            AND report.dept_id= #{deptId}
+        </if>
         AND not exists(
         select 1 from finance_exclude_project fep where fep.company_id = report.company_id and fep.use_ym = #{ym} and fep.project_id = report.project_id
         )

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet_mld/src/components/taskComponent.vue

@@ -375,8 +375,9 @@
         </el-dialog>
     </div>
     <div slot="footer" class="dialog-footer foooot">
-        <el-button v-if="(user.id == showMmeiLaiDeData.checkFirstId && showMmeiLaiDeData.taskStatus == 3) || (user.id == showMmeiLaiDeData.checkSecondId && [4, '4', '1', 1].includes(showMmeiLaiDeData.taskStatus))" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
-        <el-button v-if="showMmeiLaiDeData.taskPlan && showMmeiLaiDeData.taskStatus == 2" @click.native="deleteTask()" style="float:left;">删除</el-button>
+        <!-- <el-button v-if="(user.id == showMmeiLaiDeData.checkFirstId && showMmeiLaiDeData.taskStatus == 3) || (user.id == showMmeiLaiDeData.checkSecondId && [4, '4', '1', 1].includes(showMmeiLaiDeData.taskStatus))" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
+        <el-button v-if="showMmeiLaiDeData.taskPlan && showMmeiLaiDeData.taskStatus == 2" @click.native="deleteTask()" style="float:left;">删除</el-button> -->
+        <el-button v-if="addForm.createrId == user.id && addForm.taskStatus == 2" @click.native="deleteTask()" style="float:left;">删除</el-button>
         <el-button @click.native="closeBounceds()">{{ $t('btn.cancel') }}</el-button>
 
         <template v-if="addForm.taskStatus == 3 && addForm.createrId == user.id">

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet_mld/src/views/Home.vue

@@ -773,11 +773,12 @@
                             this.drawer = false;
                         } else if(type == 11) {
                             console.log(row, '<====== ganttData')
-                            const { taskId, ganttData, msg } = row
+                            const { taskId, ganttData, msg, jumpType } = row
                             // if(msg.indexOf('取消') != -1 || msg.indexOf('驳回') != -1 || msg.indexOf('审核') != -1) {
                             this.$router.push({
                                 path: '/task',
-                                query: { doICreateIt: msg.indexOf('审批') != -1 ? 3 : 2 }
+                                // query: { doICreateIt: msg.indexOf('新的工作计划') != -1 ? 1 : msg.indexOf('审批') != -1 ? 3 : 2 }
+                                query: { doICreateIt: jumpType ? jumpType : 2 }
                             })
                             // } else {
                             //     this.$router.push({

+ 1 - 3
fhKeeper/formulahousekeeper/timesheet_mld/src/views/project/gantt.vue

@@ -222,7 +222,6 @@ export default {
       this.bindTooltipEvents(); // 初次执行
     },
     bindTooltipEvents() {
-      console.log('开始执行')
       const taskLines = this.$refs.ganttContainer && this.$refs.ganttContainer.querySelectorAll(".gantt_task_line");
 
       (taskLines || []).forEach(line => {
@@ -415,10 +414,9 @@ export default {
             <div style="margin-left: 6px;">${texts}</div>
           </div>`;
       }
-
       // 正常人
       return `<div class="task_text" style="justify-content: center;">
-          <div>${task.text}</div>
+          <div style="color: ${!task.taskId ? '#333' : '#fff'}">${task.text}</div>
         </div>`;
     };
     gantt.config.grid_width = 350;