Sfoglia il codice sorgente

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

zhouyy 1 mese fa
parent
commit
855678aba9

+ 27 - 32
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -503,57 +503,52 @@ public class TaskController {
         if (saved&&isInsert==1){
             if (user.getCompanyId()==Constant.MLD_COMPANY_ID&&task.getIsTaskPlan()==1&& org.apache.commons.lang3.StringUtils.isNotEmpty(task.getCheckFirstId())){
                 //给第一审核人发送信息提醒
+                msgRecepientList=new ArrayList<>();
                 log.info("添加工作计划,给第一审核人发送信息提醒");
                 User owner = userMapper.selectById(task.getCheckFirstId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有新的工作计划待审核");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setMsg("您有工作计划待审核");
+                information.setType(11);
+                information.setUserId(owner.getId());
+                information.setTime(LocalDateTime.now());
+                informationService.save(information);
             }
         } else if (saved && isUpdate > 0) {
+            msgRecepientList=new ArrayList<>();
             //第一审核人修改后, 变成待第二审核人审核
             if (isUpdate==1){
                 User owner = userMapper.selectById(task.getCheckSecondId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有新的工作计划待审核");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setMsg("您有工作计划待审核");
+                information.setType(11);
+                information.setUserId(owner.getId());
+                information.setTime(LocalDateTime.now());
+                informationService.save(information);
+
             }else if(isUpdate==2){
                 List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", task.getId()));
                 if(CollectionUtils.isNotEmpty(taskExecutorList)){
                     for (TaskExecutor taskExecutor : taskExecutorList) {
                         //给任务的执行人发送信息提醒
                         User owner = userMapper.selectById(taskExecutor.getExecutorId());
-                        if (wxCorpInfo != null) {
-                            //推送到企业微信
-                            StringBuilder stringBuilder = new StringBuilder();
-                            stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                                    .append(":有新的任务,请及时查看");
-                            wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                                    WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                        }
+                        Information information = new Information();
+                        information.setMsg("您有新的任务");
+                        information.setType(1);
+                        information.setUserId(owner.getId());
+                        information.setTime(LocalDateTime.now());
+                        informationService.save(information);
                     }
                 }
             } else if (isUpdate==3) {
                 //给第一审核人发送信息提醒
                 log.info("驳回后小组长修改,给第一审核人发送信息提醒");
                 User owner = userMapper.selectById(task.getCheckFirstId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有工作计划待审核");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setType(11);
+                information.setMsg("您有工作计划待审核");
+                information.setUserId(owner.getId());
+                information.setTime(LocalDateTime.now());
+                informationService.save(information);
             }
         }
         if (task.getExecutorId() == null) {

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

@@ -4830,8 +4830,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         projectIdList.add(-1);
                         List<Participation> participations = participationMapper.selectList(new QueryWrapper<Participation>().in("project_id", projectIdList));
                         List<String> userProjectIds = participations.stream().distinct().map(Participation::getUserId).collect(Collectors.toList());
-                        userProjectIds.add("-1");
                         userProjectIds.removeAll(userIds);
+                        userProjectIds.add("-1");
                         userIdsExtra.addAll(userProjectIds);
                         List<Map> taskPlanByGeneralMemb = projectMapper.getTaskPlanByGeneralMemb(userProjectIds, startDate, endDate, user.getCompanyId(), user.getId(),targetUserId);
                         for (Map map : taskPlanByGeneralMemb) {
@@ -8768,8 +8768,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
             QueryWrapper<User> queryWrapper = new QueryWrapper<User>();
             if (deptIds.size() > 0) {
+                deptIds.add(-1);
+                userIds.add("-1");
                 queryWrapper.in("department_id", deptIds).or().in("id", userIds);
             } else {
+                userIds.add("-1");
                 queryWrapper.in("id", userIds);
             }
 

+ 27 - 33
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -37,6 +37,7 @@ import java.io.*;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -100,6 +101,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
 
     @Resource
     private TaskCommentMapper taskCommentMapper;
+    @Autowired
+    private InformationMapper informationMapper;
 
     @Override
     public HttpRespMsg getExecutorPanel(Integer projectId) {
@@ -1058,7 +1061,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         HttpRespMsg msg = new HttpRespMsg();
         String userId = request.getHeader("Token");
         User user = userMapper.selectById(userId);
-        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
 
         Task task = taskMapper.selectById(taskId);
         if (!userId.equals(task.getCheckFirstId())&&!userId.equals(task.getCheckSecondId())){
@@ -1075,14 +1077,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 taskMapper.updateById(task);
                 //给第二审核人发送信息提醒
                 User owner = userMapper.selectById(task.getCheckSecondId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有新的工作计划待审核");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setMsg("您有工作计划待审核");
+                information.setUserId(owner.getId());
+                information.setType(11);
+                information.setTime(LocalDateTime.now());
+                informationMapper.insert(information);
             }
             //第二审核人通过
             else if (task.getIsTaskPlan() == 1 && task.getTaskStatus() == 4
@@ -1098,14 +1098,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     for (TaskExecutor taskExecutor : taskExecutorList) {
                         //给任务的执行人发送信息提醒
                         User owner = userMapper.selectById(taskExecutor.getExecutorId());
-                        if (wxCorpInfo != null) {
-                            //推送到企业微信
-                            StringBuilder stringBuilder = new StringBuilder();
-                            stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                                    .append(":有新的任务,请及时查看");
-                            wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                                    WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                        }
+                        Information information = new Information();
+                        information.setMsg("您有新的任务");
+                        information.setType(1);
+                        information.setUserId(owner.getId());
+                        information.setTime(LocalDateTime.now());
+                        informationMapper.insert(information);
                     }
                 }
             }
@@ -1120,14 +1118,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 taskMapper.updateById(task);
                 //给小组长发送信息提醒
                 User owner = userMapper.selectById(task.getCreaterId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有工作计划被驳回,请查看");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setMsg("您有工作计划被驳回");
+                information.setType(11);
+                information.setUserId(owner.getId());
+                information.setTime(LocalDateTime.now());
+                informationMapper.insert(information);
             }
             //第二审核人驳回
             else if (task.getIsTaskPlan() == 1 && task.getTaskStatus() == 4
@@ -1139,14 +1135,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
 
                 //给小组长发送信息提醒
                 User owner = userMapper.selectById(task.getCreaterId());
-                if (wxCorpInfo != null) {
-                    //推送到企业微信
-                    StringBuilder stringBuilder = new StringBuilder();
-                    stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
-                            .append(":有工作计划被驳回,请查看");
-                    wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
-                            WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
-                }
+                Information information = new Information();
+                information.setMsg("您有工作计划被驳回");
+                information.setType(11);
+                information.setUserId(owner.getId());
+                information.setTime(LocalDateTime.now());
+                informationMapper.insert(information);
             }
         }
         return msg;

+ 12 - 18
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserWithBeisenServiceImpl.java

@@ -71,12 +71,9 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         DateTimeFormatter df2=DateTimeFormatter.ofPattern("HH:mm");
         DateTimeFormatter df3=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         DateTimeFormatter df4=DateTimeFormatter.ofPattern("HH:mm:ss");
-        TimeType timeType = timeTypeMapper.selectById(companyId);
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
         List<UserWithBeisen> userWithBeisenList = userWithBeisenService.list(new LambdaQueryWrapper<UserWithBeisen>().eq(UserWithBeisen::getCompanyId, companyId));
         BeisenConfig beisenConfig = beisenConfigMapper.selectById(companyId);
-        //获取特殊节假日设置
-        List<HolidaySetting> holidaySettings = holidaySettingService.list(new LambdaQueryWrapper<HolidaySetting>().eq(HolidaySetting::getCompanyId, companyId));
         if(beisenConfig==null){
             msg.setError("北森基础数据配置未完成,请联系服务商完成配置");
             return msg;
@@ -89,6 +86,18 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         JSONArray allVacationList=new JSONArray();
         JSONArray allDailyReportList=new JSONArray();
         List<LeaveSheet> leaveSheetList=new ArrayList<>();
+
+        List<UserFvTime> userFvTimeList=new ArrayList<>();
+        for (LocalDate localDate : workDaysListInRange) {
+            JSONArray statisticList = BeiSenUtils.getAttendanceStatistics(df.format(localDate), df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            JSONArray overTimeList = BeiSenUtils.getOverTimeList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            JSONArray vacationList = BeiSenUtils.getVacationList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(),1,100);
+            JSONArray dailyReportList = BeiSenUtils.getDailyReportList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            allOverTimeList.addAll(overTimeList);
+            attendanceStatistics.addAll(statisticList);
+            allVacationList.addAll(vacationList);
+            allDailyReportList.addAll(dailyReportList);
+        }
         //同步休假数据到工时管家
         for (int i = 0; i < allVacationList.size(); i++) {
             JSONObject jsonObject = allVacationList.getJSONObject(i);
@@ -140,22 +149,7 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         if(leaveSheetList.size()>0){
             leaveSheetService.saveOrUpdateBatch(leaveSheetList);
         }
-        List<UserFvTime> userFvTimeList=new ArrayList<>();
-        for (LocalDate localDate : workDaysListInRange) {
-            JSONArray statisticList = BeiSenUtils.getAttendanceStatistics(df.format(localDate), df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            JSONArray overTimeList = BeiSenUtils.getOverTimeList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            JSONArray vacationList = BeiSenUtils.getVacationList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(),1,100);
-            JSONArray dailyReportList = BeiSenUtils.getDailyReportList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            allOverTimeList.addAll(overTimeList);
-            attendanceStatistics.addAll(statisticList);
-            allVacationList.addAll(vacationList);
-            allDailyReportList.addAll(dailyReportList);
-        }
         //打印数据
-        System.out.println("allOverTimeList:"+allOverTimeList);
-        System.out.println("attendanceStatistics:"+attendanceStatistics);
-        System.out.println("allVacationList:"+allVacationList);
-        System.out.println("allDailyReportList:"+allDailyReportList);
         for (LocalDate localDate : workDaysListInRange) {
             Stream<JSONObject> swipingCardsStream = attendanceStatistics.stream().map(item -> (JSONObject) item);
             //todo: 获取当天的考勤数据

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

@@ -2936,7 +2936,7 @@
             AND (t.start_date IS NOT NULL and t.start_date &lt;= #{endDate})
         </if>
     </select>
-    <select id="findRelatedProjectIds" resultType="java.lang.Integer">
+    <select id="getRelatedProjectIds" resultType="java.lang.Integer">
         SELECT DISTINCT pl.project_id
         FROM project_leader pl
         WHERE pl.leader_id = #{userId}

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

@@ -588,7 +588,7 @@ public class TimingTask {
             return;
         }
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        LocalDate start=LocalDate.now().minusDays(7);
+        LocalDate start=LocalDate.now().minusDays(10);
         LocalDate end=LocalDate.now();
         JSONArray jsonArrayFilter = new JSONArray();
         JSONObject filter1 = new JSONObject();

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -771,6 +771,9 @@
                             sessionStorage.action = action
                             this.$router.push("/projectInside/"+date);
                             this.drawer = false;
+                        } else if(type == 11) {
+                            this.$router.push("/list");
+                            this.drawer = false;
                         }