Browse Source

bug修改

master
DX 1 month ago
parent
commit
61ce27b89b
  1. 22
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java
  2. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java
  3. 13
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/home/HomeServiceImpl.java
  4. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java
  5. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java
  6. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java
  7. 7
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml

22
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<EnterpriseInspectionsDO> list = new ArrayList<>(); List<EnterpriseInspectionsDO> list = new ArrayList<>();
for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) { for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) {
//站内信发送通知 //站内信发送通知
// NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO();
// notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId())); notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId()));
// notifyMessage.setTemplateCode("task_messages"); notifyMessage.setTemplateCode("task_messages");
// Map<String, Object> templateParams = new HashMap<>(); Map<String, Object> templateParams = new HashMap<>();
// templateParams.put("title", beforeTaskInfo.getTitle()); templateParams.put("title", beforeTaskInfo.getTitle());
// templateParams.put("startTime", beforeTaskInfo.getStartDate()); templateParams.put("startTime", DateUtil.format(beforeTaskInfo.getStartDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
// templateParams.put("endTime", beforeTaskInfo.getEndDate()); templateParams.put("endTime", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY) );
// templateParams.put("url", "sub/task/detail?taskId="+ enterpriseInspectionsDO.getTaskId()); templateParams.put("url", "sub/task/detail?taskId="+ enterpriseInspectionsDO.getTaskId());
//
// notifyMessage.setTemplateParams(templateParams); notifyMessage.setTemplateParams(templateParams);
// notifyMessageSendApi.sendSingleMessageToMember(notifyMessage); notifyMessageSendApi.sendSingleMessageToMember(notifyMessage);
enterpriseInspectionsDO.setStatus(2); enterpriseInspectionsDO.setStatus(2);
list.add(enterpriseInspectionsDO); list.add(enterpriseInspectionsDO);

3
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) { if (insert < 0) {
throw exception(INSERT_ERROR); throw exception(INSERT_ERROR);
} }
user = userService.autoRegisterUser(authUser);
user = userService.autoRegisterUser(authUser, reqVO.getUserType());
user.setIsBand(false); user.setIsBand(false);
} else { } else {

13
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); final Integer taskExec = taskExecList.stream().reduce(Integer::sum).orElse(0);
homeCountResVO.setInspectionsCount(taskExec); homeCountResVO.setInspectionsCount(taskExec);
//完成数 //完成数
final Integer taskFinish = taskFinishList.stream().reduce(Integer::sum).orElse(0); final Integer taskFinish = taskFinishList.stream().reduce(Integer::sum).orElse(0);
log.info("taskFinish={}",taskFinish);
log.info("taskExec={}",taskExec);
if (taskFinish != null && taskFinish != 0) { if (taskFinish != null && taskFinish != 0) {
double taskCompletionRate = (double) taskFinish/taskExec*100; double taskCompletionRate = (double) taskFinish/taskExec*100;
homeCountResVO.setTaskCompletionRate(String.format("%.1f", taskCompletionRate)); homeCountResVO.setTaskCompletionRate(String.format("%.1f", taskCompletionRate));
@ -118,16 +123,16 @@ public class HomeServiceImpl implements HomeService{
LocalDateTime[] dateList = new LocalDateTime[2]; LocalDateTime[] dateList = new LocalDateTime[2];
switch (selectWeek) { switch (selectWeek) {
case 1: case 4:
dateList[0] = now.minusDays(3); // 三天前 dateList[0] = now.minusDays(3); // 三天前
break; break;
case 2: case 3:
dateList[0] = now.minusWeeks(1); // 一周前 dateList[0] = now.minusWeeks(1); // 一周前
break; break;
case 3: case 2:
dateList[0] = now.minusMonths(1); // 一月前 dateList[0] = now.minusMonths(1); // 一月前
break; break;
case 4: case 1:
dateList[0] = now.minusYears(1); // 一年前 dateList[0] = now.minusYears(1); // 一年前
break; break;
} }

8
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; LocalDateTime startTime = null;
switch (pageReqVO.getSelectWeek()) { switch (pageReqVO.getSelectWeek()) {
case 1: case 4:
startTime = now.minusDays(3); // 三天前 startTime = now.minusDays(3); // 三天前
break; break;
case 2: case 3:
startTime = now.minusWeeks(1); // 一周前 startTime = now.minusWeeks(1); // 一周前
break; break;
case 3: case 2:
startTime = now.minusMonths(1); // 一月前 startTime = now.minusMonths(1); // 一月前
break; break;
case 4: case 1:
startTime = now.minusYears(1); // 一年前 startTime = now.minusYears(1); // 一年前
break; break;
} }

2
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 * @Author djx
* @Date 2025-01-22 上午9:41 * @Date 2025-01-22 上午9:41
**/ **/
AdminUserDO autoRegisterUser(AuthUser authUser, int userType); AdminUserDO autoRegisterUser(AuthUser authUser);
void userAudit(UserAuditLogSaveReqVO auditLogSaveReqVO); void userAudit(UserAuditLogSaveReqVO auditLogSaveReqVO);

3
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 * @Date 2025-01-22 上午9:40
**/ **/
@Override @Override
public AdminUserDO autoRegisterUser(AuthUser authUser, int userType) { public AdminUserDO autoRegisterUser(AuthUser authUser) {
// 根据微信用户信息生成用户数据 // 根据微信用户信息生成用户数据
AdminUserDO user = new AdminUserDO(); AdminUserDO user = new AdminUserDO();
// openid.substring(openid.length() - 10) // 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.setNickname("wx_" + authUser.getUuid().substring(authUser.getUuid().length() - 5));
user.setAvatar(authUser.getAvatar()); user.setAvatar(authUser.getAvatar());
user.setStatus(CommonStatusEnum.ENABLE.getStatus()); user.setStatus(CommonStatusEnum.ENABLE.getStatus());
user.setUserType(userType);
user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码 user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码
userMapper.insert(user); userMapper.insert(user);
return user; return user;

7
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.priority}
</if> </if>
<if test="params.status != null and params.status != ''"> <if test="params.status != null and params.status != ''">
AND t.priority = #{params.status} AND t.status = #{params.status}
</if> </if>
<if test="params.deptId != null and params.deptId != ''"> <if test="params.deptId != null and params.deptId != ''">
AND e.department_id = #{params.deptId} AND e.department_id = #{params.deptId}
@ -84,10 +84,7 @@
WHERE WHERE
ei.deleted = 0 AND e.deleted = 0 and ei.status = 2 ei.deleted = 0 AND e.deleted = 0 and ei.status = 2
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
and e.department_id = #{deptId} and su.dept_id = #{deptId}
</if>
<if test="deptId == null">
and e.department_id != 100
</if> </if>
GROUP BY GROUP BY
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">

Loading…
Cancel
Save