diff --git a/pnkx-framework/src/main/java/com/pnkx/framework/aspectj/LogAspect.java b/pnkx-framework/src/main/java/com/pnkx/framework/aspectj/LogAspect.java index 080bedb..0baf983 100644 --- a/pnkx-framework/src/main/java/com/pnkx/framework/aspectj/LogAspect.java +++ b/pnkx-framework/src/main/java/com/pnkx/framework/aspectj/LogAspect.java @@ -141,8 +141,9 @@ public class LogAspect { * 获取请求的参数,放到log中 * * @param operLog 操作日志 + * @throws Exception 异常 */ - private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) { + private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception { String requestMethod = operLog.getRequestMethod(); if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { String params = argsArrayToString(joinPoint.getArgs()); diff --git a/pnkx-life/src/main/java/com/pnkx/service/impl/PxToDoServiceImpl.java b/pnkx-life/src/main/java/com/pnkx/service/impl/PxToDoServiceImpl.java index 2cd1d4a..1e39014 100644 --- a/pnkx-life/src/main/java/com/pnkx/service/impl/PxToDoServiceImpl.java +++ b/pnkx-life/src/main/java/com/pnkx/service/impl/PxToDoServiceImpl.java @@ -7,6 +7,8 @@ import com.pnkx.service.IPxToDoService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; @@ -41,6 +43,19 @@ public class PxToDoServiceImpl implements IPxToDoService { */ @Override public List selectPxToDoList(PxToDo pxToDo) { + if (pxToDo.getParams().containsKey("date")) { + String date = pxToDo.getParams().get("date").toString(); + // 创建一个日期时间格式化对象 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + // 解析字符串到LocalDateTime对象 + LocalDateTime dateTime = LocalDateTime.parse(date, formatter); + // 加一个月 + LocalDateTime plusMonth = dateTime.plusMonths(1); + pxToDo.getParams().put("endDate", plusMonth.format(formatter)); + // 减一个月 + LocalDateTime minusMonth = dateTime.minusMonths(1); + pxToDo.getParams().put("startDate", minusMonth.format(formatter)); + } return pxToDoMapper.selectPxToDoList(pxToDo); } diff --git a/pnkx-life/src/main/resources/mapper/PxToDoMapper.xml b/pnkx-life/src/main/resources/mapper/PxToDoMapper.xml index a43933f..8e68a1d 100644 --- a/pnkx-life/src/main/resources/mapper/PxToDoMapper.xml +++ b/pnkx-life/src/main/resources/mapper/PxToDoMapper.xml @@ -55,6 +55,11 @@ and version = #{version} and finish_by = #{finishBy} and finish_time = #{finishTime} + + and ( + plan_start_time <= #{params.endDate} AND plan_end_time >= #{params.startDate} + ) + order by finish_time desc