禅道问题修复:站内信模版/消息、日志管理、组织权限使用时间区间查询当日数据失效修复

This commit is contained in:
gaoqr
2024-10-08 14:23:17 +08:00
parent f651fb643f
commit 4fe3cfda62
5 changed files with 24 additions and 0 deletions
@@ -1,6 +1,7 @@
package com.cf.imes.framework.common.util.date;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil;
import java.time.Duration;
import java.time.LocalDate;
@@ -132,4 +133,19 @@ public class LocalDateTimeUtils {
return LocalDateTimeUtil.between(dateTime, LocalDateTime.now(), ChronoUnit.DAYS);
}
/**
* 生成起时间0点和止时间12点的区间
*
* @param dateSection
* @return
*/
public static LocalDateTime[] generateTimeSection(LocalDateTime[] dateSection) {
if (ObjectUtil.isNotNull(dateSection) && dateSection.length == 2) {
LocalDateTime[] result = new LocalDateTime[2];
result[0] = dateSection[0].withHour(0).withMinute(0).withSecond(0);
result[1] = dateSection[1].withHour(23).withMinute(59).withSecond(59);
return result;
}
return dateSection;
}
}
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.controller.admin.logger;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageParam;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
import com.cf.imes.framework.excel.core.util.ExcelUtils;
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
import com.cf.imes.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO;
@@ -46,6 +47,7 @@ public class OperateLogController {
@Operation(summary = "查看操作日志分页列表")
@PreAuthorize("@ss.hasPermission('system:operate-log:query')")
public CommonResult<PageResult<OperateLogRespVO>> pageOperateLog(@Valid OperateLogPageReqVO pageReqVO) {
pageReqVO.setStartTime(LocalDateTimeUtils.generateTimeSection(pageReqVO.getStartTime()));
PageResult<OperateLogDO> pageResult = operateLogService.getOperateLogPage(pageReqVO);
// 获得拼接需要的数据
Map<Long, AdminUserDO> userMap = userService.getUserMap(
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.controller.admin.notify;
import com.cf.imes.framework.common.enums.UserTypeEnum;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO;
import com.cf.imes.module.system.controller.admin.notify.vo.message.NotifyMessageRespVO;
@@ -47,6 +48,7 @@ public class NotifyMessageController {
@PreAuthorize("@ss.hasPermission('system:notify-message:query')")
public CommonResult<PageResult<NotifyMessageRespVO>> getNotifyMessagePage(@Valid NotifyMessagePageReqVO pageVO) {
pageVO.setUserId(getLoginUserId());
pageVO.setCreateTime(LocalDateTimeUtils.generateTimeSection(pageVO.getCreateTime()));
PageResult<NotifyMessageDO> pageResult = notifyMessageService.getMyMyNotifyMessagePage(pageVO);
return success(BeanUtils.toBean(pageResult, NotifyMessageRespVO.class));
}
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.controller.admin.notify;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.module.system.controller.admin.notify.vo.template.NotifyTemplatePageReqVO;
import com.cf.imes.module.system.controller.admin.notify.vo.template.NotifyTemplateRespVO;
@@ -71,6 +72,7 @@ public class NotifyTemplateController {
@Operation(summary = "获得站内信模版分页")
@PreAuthorize("@ss.hasPermission('system:notify-template:query')")
public CommonResult<PageResult<NotifyTemplateRespVO>> getNotifyTemplatePage(@Valid NotifyTemplatePageReqVO pageVO) {
pageVO.setCreateTime(LocalDateTimeUtils.generateTimeSection(pageVO.getCreateTime()));
PageResult<NotifyTemplateDO> pageResult = notifyTemplateService.getNotifyTemplatePage(pageVO);
return success(BeanUtils.toBean(pageResult, NotifyTemplateRespVO.class));
}
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.controller.admin.organ;
import com.cf.imes.framework.common.enums.CommonStatusEnum;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.module.system.controller.admin.organ.vo.packages.TenantPackagePageReqVO;
import com.cf.imes.module.system.controller.admin.organ.vo.packages.TenantPackageRespVO;
@@ -69,6 +70,7 @@ public class TenantPackageController {
@Operation(summary = "获得组织套餐分页")
@PreAuthorize("@ss.hasPermission('system:tenant-package:query')")
public CommonResult<PageResult<TenantPackageRespVO>> getTenantPackagePage(@Valid TenantPackagePageReqVO pageVO) {
pageVO.setCreateTime(LocalDateTimeUtils.generateTimeSection(pageVO.getCreateTime()));
PageResult<TenantPackageDO> pageResult = tenantPackageService.getTenantPackagePage(pageVO);
return success(BeanUtils.toBean(pageResult, TenantPackageRespVO.class));
}