diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java index 1681dd5..4dbaaa2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java @@ -82,17 +82,17 @@ public class TaskSendStartMessageJob implements JobHandler { List list = new ArrayList<>(); for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) { //站内信发送通知 -// NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); -// notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId())); -// notifyMessage.setTemplateCode("task_messages"); -// Map templateParams = new HashMap<>(); -// templateParams.put("title", beforeTaskInfo.getTitle()); -// templateParams.put("startTime", beforeTaskInfo.getStartDate()); -// templateParams.put("endTime", beforeTaskInfo.getEndDate()); -// templateParams.put("url", "sub/task/detail?taskId="+ enterpriseInspectionsDO.getTaskId()); -// -// notifyMessage.setTemplateParams(templateParams); -// notifyMessageSendApi.sendSingleMessageToMember(notifyMessage); + NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); + notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId())); + notifyMessage.setTemplateCode("task_messages"); + Map templateParams = new HashMap<>(); + templateParams.put("title", beforeTaskInfo.getTitle()); + templateParams.put("startTime", DateUtil.format(beforeTaskInfo.getStartDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY)); + templateParams.put("endTime", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY) ); + templateParams.put("url", "sub/task/detail?taskId="+ enterpriseInspectionsDO.getTaskId()); + + notifyMessage.setTemplateParams(templateParams); + notifyMessageSendApi.sendSingleMessageToMember(notifyMessage); enterpriseInspectionsDO.setStatus(2); list.add(enterpriseInspectionsDO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index 97dbbaa..63b3336 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -331,8 +331,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { if (insert < 0) { throw exception(INSERT_ERROR); } - - user = userService.autoRegisterUser(authUser, reqVO.getUserType()); + user = userService.autoRegisterUser(authUser); user.setIsBand(false); } else { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/home/HomeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/home/HomeServiceImpl.java index 63f07dd..abcefd5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/home/HomeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/home/HomeServiceImpl.java @@ -75,8 +75,13 @@ public class HomeServiceImpl implements HomeService{ //总数 final Integer taskExec = taskExecList.stream().reduce(Integer::sum).orElse(0); homeCountResVO.setInspectionsCount(taskExec); + //完成数 final Integer taskFinish = taskFinishList.stream().reduce(Integer::sum).orElse(0); + + log.info("taskFinish={}",taskFinish); + log.info("taskExec={}",taskExec); + if (taskFinish != null && taskFinish != 0) { double taskCompletionRate = (double) taskFinish/taskExec*100; homeCountResVO.setTaskCompletionRate(String.format("%.1f", taskCompletionRate)); @@ -118,16 +123,16 @@ public class HomeServiceImpl implements HomeService{ LocalDateTime[] dateList = new LocalDateTime[2]; switch (selectWeek) { - case 1: + case 4: dateList[0] = now.minusDays(3); // 三天前 break; - case 2: + case 3: dateList[0] = now.minusWeeks(1); // 一周前 break; - case 3: + case 2: dateList[0] = now.minusMonths(1); // 一月前 break; - case 4: + case 1: dateList[0] = now.minusYears(1); // 一年前 break; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java index 07ed606..66c5308 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java @@ -222,16 +222,16 @@ public class TaskInfoServiceImpl implements TaskInfoService { LocalDateTime startTime = null; switch (pageReqVO.getSelectWeek()) { - case 1: + case 4: startTime = now.minusDays(3); // 三天前 break; - case 2: + case 3: startTime = now.minusWeeks(1); // 一周前 break; - case 3: + case 2: startTime = now.minusMonths(1); // 一月前 break; - case 4: + case 1: startTime = now.minusYears(1); // 一年前 break; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index 1b53fb7..623b9fc 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -223,7 +223,7 @@ public interface AdminUserService { * @Author djx * @Date 2025-01-22 上午9:41 **/ - AdminUserDO autoRegisterUser(AuthUser authUser, int userType); + AdminUserDO autoRegisterUser(AuthUser authUser); void userAudit(UserAuditLogSaveReqVO auditLogSaveReqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 5c78025..a4964ad 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -595,7 +595,7 @@ public class AdminUserServiceImpl implements AdminUserService { * @Date 2025-01-22 上午9:40 **/ @Override - public AdminUserDO autoRegisterUser(AuthUser authUser, int userType) { + public AdminUserDO autoRegisterUser(AuthUser authUser) { // 根据微信用户信息生成用户数据 AdminUserDO user = new AdminUserDO(); // openid.substring(openid.length() - 10) @@ -603,7 +603,6 @@ public class AdminUserServiceImpl implements AdminUserService { user.setNickname("wx_" + authUser.getUuid().substring(authUser.getUuid().length() - 5)); user.setAvatar(authUser.getAvatar()); user.setStatus(CommonStatusEnum.ENABLE.getStatus()); - user.setUserType(userType); user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码 userMapper.insert(user); return user; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml index 28271b1..9ab8f2b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml @@ -29,7 +29,7 @@ AND t.priority = #{params.priority} - AND t.priority = #{params.status} + AND t.status = #{params.status} AND e.department_id = #{params.deptId} @@ -84,10 +84,7 @@ WHERE ei.deleted = 0 AND e.deleted = 0 and ei.status = 2 - and e.department_id = #{deptId} - - - and e.department_id != 100 + and su.dept_id = #{deptId} GROUP BY