From 043b8f9a7113bce8e56890bef688a1fa05253264 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Thu, 22 Aug 2024 16:52:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E7=9C=81=E7=BA=A7=E7=94=A8?= =?UTF-8?q?=E6=88=B7=EF=BC=8C=E5=8F=AF=E6=9F=A5=E7=9C=8B=E5=B8=82=E7=BA=A7?= =?UTF-8?q?=E5=BE=85=E6=8F=90=E4=BA=A4=E5=92=8C=E5=AE=A1=E6=A0=B8=E4=B8=8D?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=95=B0=E6=8D=AE=202.pms=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8D=95=E4=BD=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/pms/pojo/vo/DeviceUnitVo.java | 120 +++++++++++++++++ .../majornetwork/PqsDeviceUnitController.java | 84 ++++++++++++ .../pms/mapper/PqsDeviceUnitMapper.java | 17 +++ .../mapper/mapping/PqsDeviceUnitMapper.xml | 39 ++++++ .../majornetwork/IPqsDeviceUnitService.java | 55 ++++++++ .../impl/PqsDeviceUnitServiceImpl.java | 121 ++++++++++++++++++ .../pojo/dto/SensitiveReportExcel.java | 4 +- .../pojo/dto/SensitiveUserSExcel.java | 4 +- .../device/impl/CheckDeviceServiceImpl.java | 8 +- .../impl/QuitRunningDeviceServiceImpl.java | 6 + ...SupervisionDevMainReportPOServiceImpl.java | 12 +- ...SupervisionTempLineDebugPOServiceImpl.java | 11 ++ .../SupervisionTempLineReportServiceImpl.java | 12 +- .../impl/WarningLeafletServiceImpl.java | 6 +- .../survey/impl/SurveyPlanServiceImpl.java | 6 + .../survey/impl/SurveyTestServiceImpl.java | 28 ++-- .../user/impl/UserReportPOServiceImpl.java | 41 ++++-- 17 files changed, 530 insertions(+), 44 deletions(-) create mode 100644 pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/DeviceUnitVo.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PqsDeviceUnitController.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/PqsDeviceUnitMapper.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/PqsDeviceUnitMapper.xml create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPqsDeviceUnitService.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PqsDeviceUnitServiceImpl.java diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/DeviceUnitVo.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/DeviceUnitVo.java new file mode 100644 index 000000000..cf92fd9f5 --- /dev/null +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/vo/DeviceUnitVo.java @@ -0,0 +1,120 @@ +package com.njcn.device.pms.pojo.vo; + +import com.njcn.device.biz.pojo.po.PqsDeviceUnit; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author wr + * @description + * @date 2023/8/21 10:16 + */ +@Data +public class DeviceUnitVo { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "编号") + private String id; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "频率") + private String unitFrequency; + + @ApiModelProperty(value = "频率偏差") + private String unitFrequencyDev; + + @ApiModelProperty(value = "相电压有效值") + private String phaseVoltage; + + @ApiModelProperty(value = "线电压有效值") + private String lineVoltage; + + @ApiModelProperty(value = "电压上偏差") + private String voltageDev; + + @ApiModelProperty(value = "电压下偏差") + private String uvoltageDev; + + @ApiModelProperty(value = "电流有效值") + private String ieffective; + + @ApiModelProperty(value = "单相有功功率") + private String singleP; + + @ApiModelProperty(value = "单相视在功率") + private String singleViewP; + + @ApiModelProperty(value = "单相无功功率") + private String singleNoP; + + @ApiModelProperty(value = "总有功功率") + private String totalActiveP; + + @ApiModelProperty(value = "总视在功率") + private String totalViewP; + + @ApiModelProperty(value = "总无功功率") + private String totalNoP; + + @ApiModelProperty(value = "相(线)电压基波有效值") + private String vfundEffective; + + @ApiModelProperty(value = "基波电流") + private String ifund; + + @ApiModelProperty(value = "基波有功功率") + private String fundActiveP; + + @ApiModelProperty(value = "基波无功功率") + private String fundNoP; + + @ApiModelProperty(value = "电压总谐波畸变率") + private String vdistortion; + + @ApiModelProperty(value = "2~50次谐波电压含有率") + private String vharmonicRate; + + @ApiModelProperty(value = "2~50次谐波电流有效值") + private String iharmonic; + + @ApiModelProperty(value = "2~50次谐波有功功率") + private String pharmonic; + + @ApiModelProperty(value = "0.5~49.5次间谐波电流有效值") + private String iiharmonic; + + @ApiModelProperty(value = "正序电压") + private String positiveV; + + @ApiModelProperty(value = "运行状态") + private String devFlag; + + @ApiModelProperty(value = "零序负序电压") + private String noPositiveV; + @ApiModelProperty(value = "子集数据") + List children; + + @Data + public static class DeviceUnit extends PqsDeviceUnit { + + @ApiModelProperty(value = "编号") + private String id; + + @ApiModelProperty(value = "父节点") + private String pid; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "运行状态") + private String devFlag; + + @ApiModelProperty(value = "子集数据") + List children; + } +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PqsDeviceUnitController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PqsDeviceUnitController.java new file mode 100644 index 000000000..1775be73b --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PqsDeviceUnitController.java @@ -0,0 +1,84 @@ +package com.njcn.device.pms.controller.majornetwork; + + +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.device.biz.pojo.po.PqsDeviceUnit; +import com.njcn.device.pms.pojo.vo.DeviceUnitVo; +import com.njcn.device.pms.service.majornetwork.IPqsDeviceUnitService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + *

+ * 数据单位管理 + *

+ * + * @author wr + * @since 2023-08-21 + */ +@RestController +@Api(tags = "数据单位管理") +@RequestMapping("/pq/pqsDeviceUnit") +@RequiredArgsConstructor +public class PqsDeviceUnitController extends BaseController { + + private final IPqsDeviceUnitService iPqsDeviceUnitService; + + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/nodeTree") + @ApiOperation("数据单位查询树") + @ApiImplicitParam(name = "devFlag", value = "实体", required = true) + public HttpResult> nodeTree(String devFlag) { + String methodDescribe = getMethodDescribe("nodeTree"); + List pqsDeviceUnitVos = iPqsDeviceUnitService.nodeList(devFlag); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnitVos, methodDescribe); + + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/saveDeviceUnit") + @ApiOperation("数据单位修改") + @ApiImplicitParam(name = "unit", value = "实体", required = true) + public HttpResult saveDeviceUnit(@RequestBody PqsDeviceUnit unit) { + String methodDescribe = getMethodDescribe("saveDeviceUnit"); + Boolean aBoolean = iPqsDeviceUnitService.saveDeviceUnit(unit); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, aBoolean, methodDescribe); + + } + + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/lineUnitDetail") + @ApiOperation("根据监测点id获取数据单位") + @ApiImplicitParam(name = "lineID", value = "实体", required = true) + public HttpResult lineUnitDetail(@RequestParam("lineID") String lineID) { + String methodDescribe = getMethodDescribe("lineUnitDetail"); + PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.lineUnitDetail(lineID); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe); + + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/devUnitDetail") + @ApiOperation("根据终端id获取数据单位") + @ApiImplicitParam(name = "devID", value = "实体", required = true) + public HttpResult devUnitDetail(@RequestParam("devID") String devID) { + String methodDescribe = getMethodDescribe("devUnitDetail"); + PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.devUnitDetail(devID); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe); + + } + +} + diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/PqsDeviceUnitMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/PqsDeviceUnitMapper.java new file mode 100644 index 000000000..6f5a9a623 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/PqsDeviceUnitMapper.java @@ -0,0 +1,17 @@ +package com.njcn.device.pms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.biz.pojo.po.PqsDeviceUnit; + +/** + *

+ * Mapper 接口 + *

+ * + * @author wr + * @since 2023-08-21 + */ +public interface PqsDeviceUnitMapper extends BaseMapper { + + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/PqsDeviceUnitMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/PqsDeviceUnitMapper.xml new file mode 100644 index 000000000..70f2002f1 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/PqsDeviceUnitMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPqsDeviceUnitService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPqsDeviceUnitService.java new file mode 100644 index 000000000..f305f655c --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPqsDeviceUnitService.java @@ -0,0 +1,55 @@ +package com.njcn.device.pms.service.majornetwork; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.device.biz.pojo.po.PqsDeviceUnit; +import com.njcn.device.pms.pojo.vo.DeviceUnitVo; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author wr + * @since 2023-08-21 + */ +public interface IPqsDeviceUnitService extends IService { + + /** + * @param devFlag + * @Description: 查询数据单位树 + * @return: java.util.List + * @Author: wr + * @Date: 2023/8/21 13:58 + */ + List nodeList(String devFlag); + + /** + * @param unit + * @Description: 添加数据终端 + * @return: java.lang.Boolean + * @Author: wr + * @Date: 2023/8/21 14:01 + */ + Boolean saveDeviceUnit(PqsDeviceUnit unit); + + /** + * @param lineID + * @Description: 根据监测点id查询数据单位 + * @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit + * @Author: wr + * @Date: 2023/8/21 14:02 + */ + PqsDeviceUnit lineUnitDetail(String lineID); + + /** + * @param devID + * @Description: 根据终端id查询数据单位 + * @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit + * @Author: wr + * @Date: 2023/8/21 14:02 + */ + PqsDeviceUnit devUnitDetail(String devID); + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PqsDeviceUnitServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PqsDeviceUnitServiceImpl.java new file mode 100644 index 000000000..c77485531 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PqsDeviceUnitServiceImpl.java @@ -0,0 +1,121 @@ +package com.njcn.device.pms.service.majornetwork.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.common.pojo.enums.common.DataStateEnum; +import com.njcn.device.biz.pojo.po.PqsDeviceUnit; +import com.njcn.device.pms.mapper.PqsDeviceUnitMapper; +import com.njcn.device.pms.pojo.po.Monitor; +import com.njcn.device.pms.pojo.po.PmsTerminal; +import com.njcn.device.pms.pojo.vo.DeviceUnitVo; +import com.njcn.device.pms.service.majornetwork.IMonitorService; +import com.njcn.device.pms.service.majornetwork.IPqsDeviceUnitService; +import com.njcn.device.pms.service.majornetwork.ITerminalService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + *

+ * 服务实现类 + *

+ * + * @author wr + * @since 2023-08-21 + */ +@Service +@RequiredArgsConstructor +public class PqsDeviceUnitServiceImpl extends ServiceImpl implements IPqsDeviceUnitService { + + private final ITerminalService terminalService; + private final IMonitorService monitorService; + + @Override + public List nodeList(String devFlag) { + List pqsDeviceUnitVos = new ArrayList<>(); + List list = terminalService.list(new LambdaQueryWrapper() + .eq(PmsTerminal::getStatus, DataStateEnum.ENABLE.getCode()) + .eq(StrUtil.isNotBlank(devFlag), PmsTerminal::getTerminalState, devFlag) + ); + List terminal = list.stream().map(PmsTerminal::getId).collect(Collectors.toList()); + //获取所有终端信息 + List pqsDeviceUnits = this.listByIds(terminal); + Map unitMap = pqsDeviceUnits.stream().collect(Collectors.toMap(PqsDeviceUnit::getDevIndex, Function.identity())); + Map> orgMap = list.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId)); + orgMap.forEach((key, value) -> { + DeviceUnitVo unitVo = new DeviceUnitVo(); + unitVo.setId(key); + unitVo.setName(value.get(0).getOrgName()); + Map> subMap = value.stream().collect(Collectors.groupingBy(PmsTerminal::getPowerStationId)); + + List subUnitVos = new ArrayList<>(); + subMap.forEach((subKey, subValue) -> { + DeviceUnitVo subUnitVo = new DeviceUnitVo(); + subUnitVo.setId(subKey); + subUnitVo.setName(subValue.get(0).getPowerrName()); + Map> terMap = subValue.stream().collect(Collectors.groupingBy(PmsTerminal::getId)); + List terUnitVos = new ArrayList<>(); + terMap.forEach((terKey, terValue) -> { + for (PmsTerminal pmsTerminal : terValue) { + DeviceUnitVo terUnitVo = new DeviceUnitVo(); + terUnitVo.setId(pmsTerminal.getId()); + terUnitVo.setName(pmsTerminal.getName()); + PqsDeviceUnit pqsDeviceUnit; + if (unitMap.containsKey(terKey)) { + pqsDeviceUnit = unitMap.get(terKey); + } else { + pqsDeviceUnit = new PqsDeviceUnit(); + } + BeanUtil.copyProperties(pqsDeviceUnit,terUnitVo); + terUnitVos.add(terUnitVo); + } + }); + subUnitVo.setChildren(terUnitVos); + subUnitVos.add(subUnitVo); + }); + unitVo.setChildren(subUnitVos); + pqsDeviceUnitVos.add(unitVo); + }); + return pqsDeviceUnitVos; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean saveDeviceUnit(PqsDeviceUnit unit) { + PqsDeviceUnit byId = this.getById(unit.getDevIndex()); + if (ObjectUtil.isNotNull(byId)) { + return this.updateById(unit); + } + return this.save(unit); + } + + @Override + public PqsDeviceUnit lineUnitDetail(String lineID) { + Monitor byId = monitorService.getById(lineID); + if (ObjectUtil.isNotNull(byId)) { + PqsDeviceUnit unit = this.getById(byId.getTerminalId()); + if (ObjectUtil.isNotNull(unit)) { + return unit; + } + return new PqsDeviceUnit(); + } + return new PqsDeviceUnit(); + } + + @Override + public PqsDeviceUnit devUnitDetail(String devID) { + PqsDeviceUnit byId = this.getById(devID); + if (ObjectUtil.isNotNull(byId)) { + return byId; + } + return new PqsDeviceUnit(); + } + +} diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveReportExcel.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveReportExcel.java index c48b034fb..eee95e3d9 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveReportExcel.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveReportExcel.java @@ -36,8 +36,8 @@ public class SensitiveReportExcel implements Serializable { @NotNull(message = "用户状态不能为空") private Integer userStatus; - @Excel(name = "*变电站", width = 30) - @NotBlank(message = "变电站不能为空") + @Excel(name = "*厂站名称", width = 30) + @NotBlank(message = "厂站名称不能为空") private String substation; diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserSExcel.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserSExcel.java index 54b68424c..20ee564c2 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserSExcel.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/dto/SensitiveUserSExcel.java @@ -31,8 +31,8 @@ public class SensitiveUserSExcel implements Serializable { @NotNull(message = "用户状态不能为空") private Integer userStatus; - @Excel(name = "*变电站", width = 30) - @NotBlank(message = "变电站不能为空") + @Excel(name = "*厂站名称", width = 30) + @NotBlank(message = "厂站名称不能为空") private String substation; diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java index 29a9fb9f0..93c3d4cb4 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java @@ -123,9 +123,11 @@ public class CheckDeviceServiceImpl extends MppServiceImpl + wrapper.isNull("A.status") + .or() + .eq(ObjUtil.isNotNull(param.getStatus()),"A.status", param.getStatus()) + ); if (!Objects.isNull(param.getState())) { queryWrapper.eq("A.state", param.getState()); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/QuitRunningDeviceServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/QuitRunningDeviceServiceImpl.java index 7862a273b..7e9f03ca9 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/QuitRunningDeviceServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/QuitRunningDeviceServiceImpl.java @@ -169,6 +169,12 @@ public class QuitRunningDeviceServiceImpl extends ServiceImplkey1))); } + quitRunningDeviceVOQueryWrapper + .and(w -> w.in("supervision_quit_running_device.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_quit_running_device.create_by", RequestUtil.getUserIndex()) + ); + if (Objects.nonNull(quitRunningDeviceQueryParam.getStatus())) { quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus()); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionDevMainReportPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionDevMainReportPOServiceImpl.java index d74dbe623..53729d0bd 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionDevMainReportPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionDevMainReportPOServiceImpl.java @@ -117,10 +117,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgNo()).getData(); queryWrapper.in("supervision_dev_main_report.org_id", data); } + queryWrapper + .and(w -> w.in("supervision_dev_main_report.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_dev_main_report.create_by", RequestUtil.getUserIndex()) + ); + if (Objects.nonNull(supervisionDevMainReportQuery.getStatus())) { queryWrapper.eq("supervision_dev_main_report.status", supervisionDevMainReportQuery.getStatus()); } @@ -390,7 +396,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl "CLD".equals(x.getCode()) || "61850".equals(x.getCode())).map(DictData::getName).distinct().collect(Collectors.toList())); + pullDown.setStrings(frontType.stream().filter(x -> !"CLD".equals(x.getCode()) && !"61850".equals(x.getCode())).map(DictData::getName).distinct().collect(Collectors.toList())); pullDowns.add(pullDown); pullDown = new PullDown(); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java index 77c05b382..51abcb0fc 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineDebugPOServiceImpl.java @@ -221,6 +221,12 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData(); queryWrapper.in("supervision_temp_line_report.org_id", data); } + queryWrapper + .and(w -> w.in("supervision_temp_line_debug.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex()) + ); + if (Objects.nonNull(supervisionTempLineDebugQuery.getStatus())) { queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus()); } @@ -255,6 +261,11 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData(); queryWrapper.in("supervision_temp_line_report.org_id", data); } + queryWrapper + .and(w -> w.in("supervision_temp_line_debug.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex()) + ); if (Objects.nonNull(supervisionTempLineDebugQuery.getStatus())) { queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus()); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineReportServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineReportServiceImpl.java index 769009c8b..3100afd7b 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineReportServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/SupervisionTempLineReportServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.supervision.service.device.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.text.StrPool; @@ -41,10 +42,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; import static javafx.beans.binding.Bindings.concat; @@ -159,6 +157,12 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgNo()).getData(); queryWrapper.in("supervision_temp_line_report.org_id", data); } + queryWrapper + .and(w -> w.in("supervision_temp_line_report.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_temp_line_report.create_by", RequestUtil.getUserIndex()) + ); + if (Objects.nonNull(supervisionTempLineReportQuery.getStatus())) { queryWrapper.eq("supervision_temp_line_report.status", supervisionTempLineReportQuery.getStatus()); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java index e8c551c45..bfab637dd 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java @@ -268,7 +268,11 @@ public class WarningLeafletServiceImpl extends ServiceImpl w.in("supervision_warning_leaflet.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex()) + ); //筛选负责单位 if (StrUtil.isNotBlank(warningLeafletQueryParam.getDeptIndex())) { List deptIds = deptFeignClient.getDepSonIdtByDeptId(warningLeafletQueryParam.getDeptIndex()).getData(); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java index 8e3b86cd7..1d2dcc73f 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.supervision.service.survey.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.text.StrPool; @@ -90,6 +91,11 @@ public class SurveyPlanServiceImpl extends ServiceImpl deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyPlanQueryParam.getDeptIndex()).getData(); surveyPlanVOQueryWrapper.in("supervision_survey_plan.dept_id", deptIds); } + surveyPlanVOQueryWrapper + .and(w -> w.in("supervision_survey_plan.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_survey_plan.create_by", RequestUtil.getUserIndex()) + ); if (Objects.nonNull(surveyPlanQueryParam.getStatus())) { surveyPlanVOQueryWrapper.in("supervision_survey_plan.status", surveyPlanQueryParam.getStatus()); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java index b44c93797..a09db9dad 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyTestServiceImpl.java @@ -89,9 +89,18 @@ public class SurveyTestServiceImpl extends ServiceImpl deptIds = new ArrayList<>();; if (Objects.nonNull(surveyTestQueryParam)) { //添加上时间范围 - surveyTestVOQueryWrapper.between("supervision_survey_plan.plan_start_time", - DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())), - DateUtil.endOfDay(DateUtil.parse(surveyTestQueryParam.getSearchEndTime()))); + surveyTestVOQueryWrapper.and(wrapper -> + wrapper.between("supervision_survey_plan.plan_start_time", + DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(surveyTestQueryParam.getSearchEndTime()))) + .or(x-> + //未完成的技术监督计划,也要展示出来,不受时间限制 + x.isNull("supervision_survey_test.complete_time") + .le("supervision_survey_plan.plan_start_time", surveyTestQueryParam.getSearchBeginTime()) + ) + ); + + //根据工程名称模糊搜索 if (Objects.nonNull(surveyTestQueryParam.getSearchValue())) { LambdaQueryWrapper surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -107,11 +116,6 @@ public class SurveyTestServiceImpl extends ServiceImpl(); } } - - //筛选普测负责单位 - if (StrUtil.isNotBlank(surveyTestQueryParam.getDeptIndex())) { - deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData(); - } surveyTestVOQueryWrapper.in(CollUtil.isNotEmpty(deptIds), "supervision_survey_test.dept_id", deptIds); if (Objects.nonNull(surveyTestQueryParam.getStatus())) { surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus()); @@ -121,14 +125,6 @@ public class SurveyTestServiceImpl extends ServiceImpl finalDeptIds = deptIds; - surveyTestVOQueryWrapper.or( - wrapper -> - wrapper.isNull("supervision_survey_test.complete_time") - .le("supervision_survey_plan.plan_start_time", surveyTestQueryParam.getSearchBeginTime()) - .in(CollUtil.isNotEmpty(finalDeptIds), "supervision_survey_test.dept_id", finalDeptIds) - ); Page surveyTestVOPage = this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper); List records = surveyTestVOPage.getRecords(); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java index 37e73ff71..d0512b668 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java @@ -289,18 +289,28 @@ public class UserReportPOServiceImpl extends ServiceImpl w.in("supervision_user_report.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) + .or() + .eq("supervision_user_report.create_by", RequestUtil.getUserIndex()) + ); + if (ObjectUtil.isNotNull(userReportQueryParam.getStatus())) { userReportVOQueryWrapper.eq("supervision_user_report.status", userReportQueryParam.getStatus()); } userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName()); //添加上时间范围 if (StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime()) && StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())) { - userReportVOQueryWrapper.and(x -> x.between("supervision_user_report.expected_production_date", + userReportVOQueryWrapper.and(x -> x.between("supervision_user_report.report_date", DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))) .or() - .isNull("supervision_user_report.expected_production_date")); + .isNull("supervision_user_report.expected_production_date") + .or() + .between("supervision_user_report.expected_production_date", + DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))) + ); } userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time"); } @@ -435,9 +445,14 @@ public class UserReportPOServiceImpl extends ServiceImpl wrapper.between("supervision_user_report.report_date", + DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))) + .or() + .between("supervision_user_report.expected_production_date", + DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())), + DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))) + ); } userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time"); } @@ -549,8 +564,8 @@ public class UserReportPOServiceImpl extends ServiceImpl wrapper.in("supervision_user_report.create_by", colleaguesIds) - .or() - .in("supervision_user_report.org_id", data) + .or() + .in("supervision_user_report.org_id", data) ) .eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode()) @@ -752,8 +767,8 @@ public class UserReportPOServiceImpl extends ServiceImpl DeptIds = data.stream().filter(x -> x.getName().equals(userExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList()); - userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex()); + List DeptIds = data.stream().filter(x -> x.getName().equals(userExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList()); + userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds) ? DeptIds.get(0) : RequestUtil.getDeptIndex()); userReportPO.setExpectedProductionDate(DateUtil.parseDate(userExcel.getExpectedProductionDate()).toLocalDateTime().toLocalDate()); userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode()); @@ -782,7 +797,7 @@ public class UserReportPOServiceImpl extends ServiceImpl DeptIds = data.stream().filter(x -> x.getName().equals(reportExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList()); - userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex()); + List DeptIds = data.stream().filter(x -> x.getName().equals(reportExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList()); + userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds) ? DeptIds.get(0) : RequestUtil.getDeptIndex()); userReportPO.setExpectedProductionDate(DateUtil.parseDate(reportExcel.getExpectedProductionDate()).toLocalDateTime().toLocalDate()); userReportPO.setUserType(reportExcel.getUserType());