From a9fae48c7724293b7e1d63fc08594c8eb700b5c0 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Fri, 14 Jul 2023 21:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/process/pojo/po/SupvPlan.java | 10 ++++++++++ .../com/njcn/process/pojo/po/SupvProblem.java | 2 ++ .../com/njcn/process/pojo/vo/SupvPlanVO.java | 1 + .../service/impl/SupvPlanServiceImpl.java | 16 ++++++++++++++-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java index 5af851436..eb4f1b342 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java @@ -1,5 +1,6 @@ package com.njcn.process.pojo.po; +import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -106,12 +107,14 @@ public class SupvPlan extends BaseEntity { * 计划执行开始时间 */ @JsonFormat(pattern = "yyyy-MM-dd") + @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDate effectStartTime; /** * 计划执行结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd") + @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDate effectEndTime; @@ -145,12 +148,14 @@ public class SupvPlan extends BaseEntity { /** * 关联电站 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String substationName; /** * 关联电站电压等级 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String substationVoltageLevel; /** @@ -163,16 +168,19 @@ public class SupvPlan extends BaseEntity { /** * 监督对象属性 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String objType; /** * 监督对象属性名称 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String objTypeName; /** * 监督对象协议容量(MVA) */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private Double objCapacity; @@ -181,12 +189,14 @@ public class SupvPlan extends BaseEntity { * 报告出具时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDateTime reportIssueTime; /** * 电能质量问题发生时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDateTime problemOcTime; diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java index ec70b2b0d..7b620b491 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java @@ -1,5 +1,6 @@ package com.njcn.process.pojo.po; +import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -55,6 +56,7 @@ public class SupvProblem extends BaseEntity { /** * 整改时间 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDate rectificationTime; /** diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java index 7647df4f0..12e54f065 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvPlanVO.java @@ -64,6 +64,7 @@ public class SupvPlanVO { * 计划监督时间 */ @ApiModelProperty(value = "计划监督时间",required = true) + @JsonFormat(pattern = "yyyy-MM") private String planSupvDate; /** diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java index e87c3bd18..be59634c2 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java @@ -161,10 +161,22 @@ public class SupvPlanServiceImpl extends ServiceImpl i List deptIds = deptFeignClient.getDepSonSelfCodetByCode(supvPlanParam.getSupvOrgId()).getData(); lambdaQueryWrapper.in(SupvPlan::getSupvOrgId, deptIds) .between(SupvPlan::getCreateTime, LocalDateTimeUtil.beginOfDay(LocalDate.parse(supvPlanParam.getSearchBeginTime()).atStartOfDay()), LocalDateTimeUtil.endOfDay(LocalDate.parse(supvPlanParam.getSearchEndTime()).atStartOfDay())) - .eq(StrUtil.isNotBlank(supvPlanParam.getSupvType()),SupvPlan::getSupvType,supvPlanParam.getSupvType()) - .orderByDesc(SupvPlan::getCreateTime); + .eq(StrUtil.isNotBlank(supvPlanParam.getSupvType()),SupvPlan::getSupvType,supvPlanParam.getSupvType()); } + + if(StrUtil.isNotBlank(supvPlanParam.getSortBy())){ + if(supvPlanParam.getOrderBy().equals("desc")){ + lambdaQueryWrapper.orderByDesc(SupvPlan::getPlanSupvDate); + }else { + lambdaQueryWrapper.orderByAsc(SupvPlan::getPlanSupvDate); + + } + }else { + lambdaQueryWrapper.orderByDesc(SupvPlan::getCreateTime); + } + + List deptList = deptFeignClient.allDeptList().getData(); Map mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity())); Map mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));