1.解决省级用户,可查看市级待提交和审核不通过数据

2.pms增加数据单位管理
This commit is contained in:
wr
2024-08-22 16:52:09 +08:00
parent af058896dc
commit 043b8f9a71
17 changed files with 530 additions and 44 deletions

View File

@@ -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 = "250次谐波电压含有率")
private String vharmonicRate;
@ApiModelProperty(value = "250次谐波电流有效值")
private String iharmonic;
@ApiModelProperty(value = "250次谐波有功功率")
private String pharmonic;
@ApiModelProperty(value = "0.549.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;
}
}

View File

@@ -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;
/**
* <p>
* 数据单位管理
* </p>
*
* @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<List<DeviceUnitVo>> nodeTree(String devFlag) {
String methodDescribe = getMethodDescribe("nodeTree");
List<DeviceUnitVo> 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<Boolean> 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<PqsDeviceUnit> 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<PqsDeviceUnit> devUnitDetail(@RequestParam("devID") String devID) {
String methodDescribe = getMethodDescribe("devUnitDetail");
PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.devUnitDetail(devID);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
}
}

View File

@@ -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;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wr
* @since 2023-08-21
*/
public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
}

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.device.pq.mapper.PqsDeviceUnitMapper">
<select id="deviceUnitList" resultType="com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo$DeviceUnit">
SELECT
dev.id as id,
dev.pid as pid,
dev.NAME as `name`,
pd.Run_Flag as devFlag,
b.*
FROM
pq_line dev
INNER JOIN pq_device pd ON dev.id = pd.id and dev.State = 1
LEFT JOIN pqs_device_unit b ON dev.id = b.dev_index
<where>
<if test="devFlag!=null and devFlag!='' ">
pd.Run_Flag = #{devFlag}
</if>
</where>
</select>
<select id="deviceUnitByID" resultType="com.njcn.device.biz.pojo.po.PqsDeviceUnit">
SELECT
unit.*
FROM
pq_line line
INNER JOIN pq_line vo ON vo.id = line.pid
INNER JOIN pq_line dev ON dev.id = vo.pid
INNER JOIN pq_device pd ON pd.id = dev.id
LEFT JOIN pqs_device_unit unit ON unit.DEV_INDEX = dev.id
<where>
line.State = 1
<if test="ids!=null and ids!='' ">
and line.id = #{ids}
</if>
</where>
</select>
</mapper>

View File

@@ -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;
/**
* <p>
* 服务类
* </p>
*
* @author wr
* @since 2023-08-21
*/
public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
/**
* @param devFlag
* @Description: 查询数据单位树
* @return: java.util.List<com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo>
* @Author: wr
* @Date: 2023/8/21 13:58
*/
List<DeviceUnitVo> 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);
}

View File

@@ -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;
/**
* <p>
* 服务实现类
* </p>
*
* @author wr
* @since 2023-08-21
*/
@Service
@RequiredArgsConstructor
public class PqsDeviceUnitServiceImpl extends ServiceImpl<PqsDeviceUnitMapper, PqsDeviceUnit> implements IPqsDeviceUnitService {
private final ITerminalService terminalService;
private final IMonitorService monitorService;
@Override
public List<DeviceUnitVo> nodeList(String devFlag) {
List<DeviceUnitVo> pqsDeviceUnitVos = new ArrayList<>();
List<PmsTerminal> list = terminalService.list(new LambdaQueryWrapper<PmsTerminal>()
.eq(PmsTerminal::getStatus, DataStateEnum.ENABLE.getCode())
.eq(StrUtil.isNotBlank(devFlag), PmsTerminal::getTerminalState, devFlag)
);
List<String> terminal = list.stream().map(PmsTerminal::getId).collect(Collectors.toList());
//获取所有终端信息
List<PqsDeviceUnit> pqsDeviceUnits = this.listByIds(terminal);
Map<String, PqsDeviceUnit> unitMap = pqsDeviceUnits.stream().collect(Collectors.toMap(PqsDeviceUnit::getDevIndex, Function.identity()));
Map<String, List<PmsTerminal>> 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<String, List<PmsTerminal>> subMap = value.stream().collect(Collectors.groupingBy(PmsTerminal::getPowerStationId));
List<DeviceUnitVo> subUnitVos = new ArrayList<>();
subMap.forEach((subKey, subValue) -> {
DeviceUnitVo subUnitVo = new DeviceUnitVo();
subUnitVo.setId(subKey);
subUnitVo.setName(subValue.get(0).getPowerrName());
Map<String, List<PmsTerminal>> terMap = subValue.stream().collect(Collectors.groupingBy(PmsTerminal::getId));
List<DeviceUnitVo> 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();
}
}

View File

@@ -36,8 +36,8 @@ public class SensitiveReportExcel implements Serializable {
@NotNull(message = "用户状态不能为空") @NotNull(message = "用户状态不能为空")
private Integer userStatus; private Integer userStatus;
@Excel(name = "*变电站", width = 30) @Excel(name = "*厂站名称", width = 30)
@NotBlank(message = "变电站不能为空") @NotBlank(message = "厂站名称不能为空")
private String substation; private String substation;

View File

@@ -31,8 +31,8 @@ public class SensitiveUserSExcel implements Serializable {
@NotNull(message = "用户状态不能为空") @NotNull(message = "用户状态不能为空")
private Integer userStatus; private Integer userStatus;
@Excel(name = "*变电站", width = 30) @Excel(name = "*厂站名称", width = 30)
@NotBlank(message = "变电站不能为空") @NotBlank(message = "厂站名称不能为空")
private String substation; private String substation;

View File

@@ -123,9 +123,11 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
//默认根据逾期天数排序 //默认根据逾期天数排序
queryWrapper.orderBy(true, false, "A.overdue_day"); queryWrapper.orderBy(true, false, "A.overdue_day");
} }
if (!Objects.isNull(param.getStatus())) { queryWrapper.and(wrapper ->
queryWrapper.eq("A.status", param.getStatus()); wrapper.isNull("A.status")
} .or()
.eq(ObjUtil.isNotNull(param.getStatus()),"A.status", param.getStatus())
);
if (!Objects.isNull(param.getState())) { if (!Objects.isNull(param.getState())) {
queryWrapper.eq("A.state", param.getState()); queryWrapper.eq("A.state", param.getState());
} }

View File

@@ -169,6 +169,12 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
}else{ }else{
mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId,Function.identity(), (key1,key2)->key1))); mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId,Function.identity(), (key1,key2)->key1)));
} }
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())) { if (Objects.nonNull(quitRunningDeviceQueryParam.getStatus())) {
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus()); quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus());
} }

View File

@@ -117,10 +117,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
if (ObjectUtil.isNotNull(supervisionDevMainReportParam.getImportType())) { if (ObjectUtil.isNotNull(supervisionDevMainReportParam.getImportType())) {
supervisionDevMainReportPO.setImportType(supervisionDevMainReportParam.getImportType()); supervisionDevMainReportPO.setImportType(supervisionDevMainReportParam.getImportType());
if (supervisionDevMainReportParam.getImportType() == 1) { if (supervisionDevMainReportParam.getImportType() == 1) {
supervisionDevMainReportParam.setStatus(FlowStatusEnum.APPROVE.getCode()); supervisionDevMainReportPO.setStatus(FlowStatusEnum.APPROVE.getCode());
} }
} else { } else {
supervisionDevMainReportParam.setImportType(0); supervisionDevMainReportPO.setImportType(0);
} }
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode()); supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
@@ -210,6 +210,12 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgNo()).getData(); List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgNo()).getData();
queryWrapper.in("supervision_dev_main_report.org_id", data); 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())) { if (Objects.nonNull(supervisionDevMainReportQuery.getStatus())) {
queryWrapper.eq("supervision_dev_main_report.status", supervisionDevMainReportQuery.getStatus()); queryWrapper.eq("supervision_dev_main_report.status", supervisionDevMainReportQuery.getStatus());
} }
@@ -390,7 +396,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
pullDown = new PullDown(); pullDown = new PullDown();
pullDown.setFirstCol(6); pullDown.setFirstCol(6);
pullDown.setLastCol(6); pullDown.setLastCol(6);
pullDown.setStrings(frontType.stream().filter(x -> "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); pullDowns.add(pullDown);
pullDown = new PullDown(); pullDown = new PullDown();

View File

@@ -221,6 +221,12 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData(); List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData();
queryWrapper.in("supervision_temp_line_report.org_id", data); 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())) { if (Objects.nonNull(supervisionTempLineDebugQuery.getStatus())) {
queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus()); queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus());
} }
@@ -255,6 +261,11 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData(); List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData();
queryWrapper.in("supervision_temp_line_report.org_id", data); 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())) { if (Objects.nonNull(supervisionTempLineDebugQuery.getStatus())) {
queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus()); queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus());
} }

View File

@@ -1,5 +1,6 @@
package com.njcn.supervision.service.device.impl; package com.njcn.supervision.service.device.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
@@ -41,10 +42,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static javafx.beans.binding.Bindings.concat; import static javafx.beans.binding.Bindings.concat;
@@ -159,6 +157,12 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgNo()).getData(); List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgNo()).getData();
queryWrapper.in("supervision_temp_line_report.org_id", data); 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())) { if (Objects.nonNull(supervisionTempLineReportQuery.getStatus())) {
queryWrapper.eq("supervision_temp_line_report.status", supervisionTempLineReportQuery.getStatus()); queryWrapper.eq("supervision_temp_line_report.status", supervisionTempLineReportQuery.getStatus());
} }

View File

@@ -268,7 +268,11 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())), DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime()))); DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
} }
warningLeafletVOQueryWrapper
.and(w -> 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())) { if (StrUtil.isNotBlank(warningLeafletQueryParam.getDeptIndex())) {
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(warningLeafletQueryParam.getDeptIndex()).getData(); List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(warningLeafletQueryParam.getDeptIndex()).getData();

View File

@@ -1,5 +1,6 @@
package com.njcn.supervision.service.survey.impl; package com.njcn.supervision.service.survey.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
@@ -90,6 +91,11 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyPlanQueryParam.getDeptIndex()).getData(); List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyPlanQueryParam.getDeptIndex()).getData();
surveyPlanVOQueryWrapper.in("supervision_survey_plan.dept_id", deptIds); 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())) { if (Objects.nonNull(surveyPlanQueryParam.getStatus())) {
surveyPlanVOQueryWrapper.in("supervision_survey_plan.status", surveyPlanQueryParam.getStatus()); surveyPlanVOQueryWrapper.in("supervision_survey_plan.status", surveyPlanQueryParam.getStatus());
} }

View File

@@ -89,9 +89,18 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
List<String> deptIds = new ArrayList<>();; List<String> deptIds = new ArrayList<>();;
if (Objects.nonNull(surveyTestQueryParam)) { if (Objects.nonNull(surveyTestQueryParam)) {
//添加上时间范围 //添加上时间范围
surveyTestVOQueryWrapper.between("supervision_survey_plan.plan_start_time", surveyTestVOQueryWrapper.and(wrapper ->
wrapper.between("supervision_survey_plan.plan_start_time",
DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())), DateUtil.beginOfDay(DateUtil.parse(surveyTestQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(surveyTestQueryParam.getSearchEndTime()))); 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())) { if (Objects.nonNull(surveyTestQueryParam.getSearchValue())) {
LambdaQueryWrapper<SurveyPlan> surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SurveyPlan> surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -107,11 +116,6 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
return new Page<>(); return new Page<>();
} }
} }
//筛选普测负责单位
if (StrUtil.isNotBlank(surveyTestQueryParam.getDeptIndex())) {
deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData();
}
surveyTestVOQueryWrapper.in(CollUtil.isNotEmpty(deptIds), "supervision_survey_test.dept_id", deptIds); surveyTestVOQueryWrapper.in(CollUtil.isNotEmpty(deptIds), "supervision_survey_test.dept_id", deptIds);
if (Objects.nonNull(surveyTestQueryParam.getStatus())) { if (Objects.nonNull(surveyTestQueryParam.getStatus())) {
surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus()); surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus());
@@ -121,14 +125,6 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
surveyTestVOQueryWrapper surveyTestVOQueryWrapper
.eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
.orderByDesc("supervision_survey_test.Update_Time"); .orderByDesc("supervision_survey_test.Update_Time");
//未完成的技术监督计划,也要展示出来,不受时间限制
List<String> 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<SurveyTestVO> surveyTestVOPage = this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper); Page<SurveyTestVO> surveyTestVOPage = this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper);
List<SurveyTestVO> records = surveyTestVOPage.getRecords(); List<SurveyTestVO> records = surveyTestVOPage.getRecords();

View File

@@ -289,18 +289,28 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
//查询所有区域下的数据 //查询所有区域下的数据
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity()); userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
} }
if (Objects.nonNull(userReportQueryParam.getStatus())) { userReportVOQueryWrapper
.and(w -> 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.eq("supervision_user_report.status", userReportQueryParam.getStatus());
} }
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName()); userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
//添加上时间范围 //添加上时间范围
if (StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime()) && StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())) { 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.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))) DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime())))
.or() .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"); userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time");
} }
@@ -435,9 +445,14 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
} }
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName()); userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
if (StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime()) && StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())) { if (StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime()) && StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())) {
userReportVOQueryWrapper.between("supervision_user_report.expected_production_date", userReportVOQueryWrapper.and(wrapper -> wrapper.between("supervision_user_report.report_date",
DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())), DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))); 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"); userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time");
} }