1.解决技术监督计划部门过滤bug

2.终端模板导入
3.台账关联干扰源管理,信息修改
This commit is contained in:
wr
2024-08-16 12:30:30 +08:00
parent 8bc94ea9a8
commit 68c0b72710
19 changed files with 490 additions and 26 deletions

View File

@@ -0,0 +1,34 @@
package com.njcn.device.pq.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author wr
* @description
* @date 2024/8/15 14:13
*/
@Data
public class DevAndLine {
@ApiModelProperty("终端id")
private String devId;
@ApiModelProperty("终端名称")
private String devName;
@ApiModelProperty("监测点集合")
private List<Line> lineList;
@Data
public static class Line {
@ApiModelProperty("监测点id")
private String lineId;
@ApiModelProperty("监测点名称")
private String lineName;
}
}

View File

@@ -418,12 +418,8 @@ public class LineController extends BaseController {
@ApiImplicitParam(name = "deviceInfoParam", value = "监测点查询条件", required = true)
})
public HttpResult<List<DeptLineCountVO>> getDeptLineCount(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
String methodDescribe = getMethodDescribe("getDeptLineCount");
List<DeptLineCountVO> deptLineCountVOS = new ArrayList<> ();
deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
List<DeptLineCountVO> deptLineCountVOS = lineService.getDeptLineCount(deviceInfoParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptLineCountVOS, methodDescribe);
}
@@ -542,4 +538,12 @@ public class LineController extends BaseController {
List<LineDetail> list = lineService.getByName(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("获取部门下终端信息和终端下监测点信息")
@GetMapping("/getByDeptDevLine")
HttpResult<List<DevAndLine>> getByDeptDevLine(String id){
String methodDescribe = getMethodDescribe("getByDeptDevLine");
List<DevAndLine> list = lineService.getByDeptDevLine(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -224,4 +224,11 @@ public interface LineService extends IService<Line> {
List<ReportLineInfoVo> getReportLineInfo(List<String> ids);
List<LineDetail> getByName(LineBaseQueryParam param);
/**
* 获取部门下终端信息和终端下监测点信息
* @param id
* @return
*/
List<DevAndLine> getByDeptDevLine(String id);
}

View File

@@ -696,6 +696,35 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
return this.baseMapper.selectByName(param);
}
@Override
public List<DevAndLine> getByDeptDevLine(String id) {
List<DevAndLine> info=new ArrayList<>();
List<String> ids = deptFeignClient.getDepSonIdtByDeptId(id).getData();
List<DeptLine> deptLines = deptLineService.selectDeptBindLines(ids);
List<String> lineIDs = deptLines.stream().map(DeptLine::getLineId).collect(Collectors.toList());
if(CollUtil.isNotEmpty(lineIDs)){
List<LineDetailVO.Detail> deptDeviceDetailData = this.baseMapper.getDeptDeviceDetailData(lineIDs, null, 3);
if(CollUtil.isNotEmpty(deptDeviceDetailData)){
Map<String, List<LineDetailVO.Detail>> collect = deptDeviceDetailData.stream().collect(Collectors.groupingBy(LineDetailVO.Detail::getDevId));
collect.forEach((k,v)->{
DevAndLine devAndLine = new DevAndLine();
List<DevAndLine.Line> lineList=new ArrayList<>();
devAndLine.setDevId(k);
devAndLine.setDevName(v.get(0).getDevName());
v.stream().distinct().forEach(v1->{
DevAndLine.Line line = new DevAndLine.Line();
line.setLineId(v1.getLineId());
line.setLineName(v1.getLineName());
lineList.add(line);
});
devAndLine.setLineList(lineList);
info.add(devAndLine);
});
}
}
return info;
}
@Override
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());

View File

@@ -2125,6 +2125,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
deviceBakLambdaQueryWrapper.eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId());
List<DeviceBak> deviceBaks = deviceBakService.list(deviceBakLambdaQueryWrapper);
List<String> devIds = deviceBaks.stream().map(DeviceBak::getId).collect(Collectors.toList());
List<Line> devList = new ArrayList<>();
if(!CollectionUtil.isEmpty(devIds)){
@@ -2215,6 +2216,79 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
}
}
}
}else{
//先查询终端id是否存在存在则修改不存在这添加
//判断是否因为改了终端名称导致没有查到数据
// LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
// deviceBakLambdaQueryWrapper.eq(DeviceBak::getDevId, temp.getId());
// DeviceBak byId = deviceBakService.getById(deviceBakLambdaQueryWrapper);
// if(Objects.isNull(byId)){
//插入新旧终端ID中间表
DeviceBak deviceBak = new DeviceBak();
deviceBak.setId(temp.getId());
deviceBak.setDevId(oracleTerminalExcel.getDeviceId());
deviceBakService.saveOrUpdate(deviceBak);
// }else{
// if(!byId.getDevId().equals(oracleTerminalExcel.getDeviceId())){
// oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "终端关系数据存入Oracle和excl不一样" + oracleTerminalExcel.getLineNum() + "需要排查"));
// continue;
// }
// }
//更新终端信息
List<Device> existIp = deviceMapper.getDeviceBySubId(pids.get(LineBaseEnum.SUB_LEVEL.getCode()), oracleTerminalExcel.getIp(), oracleTerminalExcel.getPort(), null);
if (CollectionUtil.isNotEmpty(existIp)) {
Device device = existIp.get(0);
if (!device.getId().equalsIgnoreCase(temp.getId())) {
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "IP地址" + oracleTerminalExcel.getIp() + "已存在"));
//删除刚刚新增装置信息
this.baseMapper.deleteById(temp.getId());
continue;
}
}
//处理终端厂家
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(),oracleTerminalExcel.getManufacturer()).getData();
if (Objects.isNull(manufacturer)) {
//在终端厂家字典内新增一条记录
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
}
Device device = new Device();
BeanUtils.copyProperties(oracleTerminalExcel, device);
device.setId(temp.getId());
device.setManufacturer(manufacturer.getId());
device.setIp(oracleTerminalExcel.getIp());
//处理前置ID
Node node = nodeService.getNodeByNodeName(oracleTerminalExcel.getNodeName());
if (Objects.isNull(node)) {
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "前置名:" + oracleTerminalExcel.getNodeName() + "不存在"));
//删除刚刚新增装置信息
this.baseMapper.deleteById(temp.getId());
continue;
}
device.setNodeId(node.getId());
String oracleDevType = oracleTerminalExcel.getDevType().toUpperCase();
String frontType = getComType(oracleDevType);
if (StringUtils.isBlank(frontType)) {
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "前置类型不存在"));
//删除刚刚新增装置信息
this.baseMapper.deleteById(temp.getId());
continue;
}
//处理前置类型
DictData frontTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.FRONT_TYPE.getName(), frontType).getData();
if (Objects.isNull(frontTypeDicData)) {
//在通讯类型字典内新增一条记录
frontTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.FRONT_TYPE.getName(), frontType).getData();
}
device.setFrontType(frontTypeDicData.getId());
String devType = oracleDevType.replace("_" + frontType, "");
//处理终端类型
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(),devType).getData();
if (Objects.isNull(devTypeDicData)) {
//在终端类型字典内新增一条记录
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
}
device.setDevType(devTypeDicData.getId());
deviceMapper.updateById(device);
}
//添加终端索引
pids.add(temp.getId());
@@ -2256,6 +2330,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
}
//添加母线索引
pids.add(temp.getId());
/*
* 处理监测点
* 1、判断是否存在不存在则插入
@@ -2268,6 +2344,65 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
temp = queryLine(lineLambdaQueryWrapper, lineName, pids.get(LineBaseEnum.SUB_V_LEVEL.getCode()), LineBaseEnum.LINE_LEVEL.getCode(), DataStateEnum.ENABLE.getCode());
if (Objects.nonNull(temp)) {
// oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "监测点名称重复,请联系管理员"));
LineBak lineBak = new LineBak();
lineBak.setId(temp.getId());
lineBak.setLineId(oracleTerminalExcel.getId());
lineBakService.saveOrUpdate(lineBak);
//修改监测点信息
LineDetail lineDetail = new LineDetail();
BeanUtils.copyProperties(oracleTerminalExcel, lineDetail);
lineDetail.setId(temp.getId());
//判断监测点号是否已被占用
List<LineDetail> lineDetails = lineDetailMapper.getLineDetail(pids.get(LineBaseEnum.DEVICE_LEVEL.getCode()), Stream.of(oracleTerminalExcel.getLineNum()).collect(Collectors.toList()));
if (CollectionUtil.isNotEmpty(lineDetails)) {
LineDetail lineDetail1 = lineDetails.get(0);
if (lineDetail1.getId().equalsIgnoreCase(temp.getId())) {
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "监测点线路号:" + oracleTerminalExcel.getLineNum() + "已存在"));
//删除刚刚新增装置信息
this.baseMapper.deleteById(temp.getId());
continue;
}
}
//获取该监测点的限值数据
// List<OverLimitExcel> overLimitList = overLimitExcels.stream()
// .filter(overLimitExcel -> overLimitExcel.getId().equals(oracleTerminalExcel.getId()))
// .collect(Collectors.toList());
// if (CollectionUtil.isEmpty(overLimitList)) {
// oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "没有找到该监测点的限值数据"));
// //删除刚刚新增装置信息
// this.baseMapper.deleteById(temp.getId());
// continue;
// }
lineDetail.setNum(oracleTerminalExcel.getLineNum());
//干扰源类型
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(),oracleTerminalExcel.getLoadType()).getData();
if (Objects.isNull(loadTypeDicData)) {
//在电压等级内新增一条记录
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
}
lineDetail.setLoadType(loadTypeDicData.getId());
//行业类型
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(),oracleTerminalExcel.getBusinessType()).getData();
if (Objects.isNull(businessDicData)) {
//在电压等级内新增一条记录
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
}
lineDetail.setBusinessType(businessDicData.getId());
if (StringUtils.isBlank(oracleTerminalExcel.getMonitorId())) {
lineDetail.setMonitorFlag(0);
} else {
lineDetail.setMonitorFlag(1);
}
//终端等级,为空不处理,可以为空
if (StringUtils.isNotBlank(oracleTerminalExcel.getLineGrade())) {
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(),oracleTerminalExcel.getLineGrade()).getData();
if (Objects.isNull(lineGradeDicData)) {
//在电压等级内新增一条记录
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
}
lineDetail.setLineGrade(lineGradeDicData.getId());
}
lineDetailMapper.updateById(lineDetail);
} else {
//判断是否因为改了终端名称导致没有查到数据
LambdaQueryWrapper<LineBak> lineBakLambdaQueryWrapper = new LambdaQueryWrapper<>();

View File

@@ -30,7 +30,7 @@ public class SupervisionDevMainReportExcel {
/**
* 工程预期投产日期
*/
@Excel(name = "*工程预期投产日期", width = 30)
@Excel(name = "*工程预期投产日期(yyyy-MM-dd)", width = 30)
@NotBlank(message = "不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expectedProductionDate;
@@ -107,7 +107,7 @@ public class SupervisionDevMainReportExcel {
/**
* 投运时间
*/
@Excel(name = "*投运时间", width = 30)
@Excel(name = "*投运时间(yyyy-MM-dd HH:mm:ss)", width = 30)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotBlank(message = "投运时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -116,7 +116,7 @@ public class SupervisionDevMainReportExcel {
/**
* 数据更新时间
*/
@Excel(name = "数据更新时间", width = 30)
@Excel(name = "数据更新时间(yyyy-MM-dd HH:mm:ss)", width = 30)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime dataUpdateTime;
@@ -177,7 +177,7 @@ public class SupervisionDevMainReportExcel {
/**
* 本次终端检测时间
*/
@Excel(name = "*本次终端检测时间", width = 30)
@Excel(name = "*本次终端检测时间(yyyy-MM-dd HH:mm:ss)", width = 30)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotBlank(message = "本次终端检测时间不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -1,5 +1,6 @@
package com.njcn.supervision.pojo.param.user;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.supervision.pojo.po.user.UserReportProjectPO;
import com.njcn.supervision.pojo.po.user.UserReportSensitivePO;
@@ -142,6 +143,17 @@ public class UserReportParam {
@ApiModelProperty(value = "历史流程实例的编号")
private String historyInstanceId;
/**
* 终端id
*/
@ApiModelProperty(value = "终端id")
private String devId;
/**
* 监测点id
*/
@ApiModelProperty(value = "监测点id")
private String lineId;
@Data
@EqualsAndHashCode(callSuper = true)
@@ -165,6 +177,8 @@ public class UserReportParam {
@ApiModelProperty(value = "工程名称")
private String projectName;
@ApiModelProperty(value = "填报部门")
private String orgId;
@ApiModelProperty(value = "数据来源类型 0正常审核流程 1批量导入")
private Integer dataType;

View File

@@ -0,0 +1,45 @@
package com.njcn.supervision.pojo.po.file;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 用户档案信息表
* </p>
*
* @author wr
* @since 2024-08-14
*/
@Getter
@Setter
@TableName("supervision_file_url")
public class FileUrl extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id(对应表数据id一样)
*/
private String id;
/**
* 字段名称
*/
private String name;
/**
* 文件地址
*/
private String url;
/**
* 状态0-删除 1-正常
*/
private Integer state;
}

View File

@@ -124,6 +124,17 @@ public class UserReportPO extends BaseEntity {
@TableField(value = "data_type")
private Integer dataType;
/**
* 终端id
*/
@TableField(value = "dev_id")
private String devId;
/**
* 监测点id
*/
@TableField(value = "line_id")
private String lineId;
/**
* 审批状态1:审批中2审批通过3审批不通过4已取消

View File

@@ -165,6 +165,17 @@ public class UserReportVO {
@ApiModelProperty(value = "true可以点击治理 false不可以点击治理 ")
private Boolean type;
/**
* 终端id
*/
@ApiModelProperty(value = "终端id")
private String devId;
/**
* 监测点id
*/
@ApiModelProperty(value = "监测点id")
private String lineId;
@Data
@EqualsAndHashCode(callSuper = true)

View File

@@ -0,0 +1,56 @@
package com.njcn.supervision.controller.file;
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.supervision.pojo.po.file.FileUrl;
import com.njcn.supervision.service.file.IFileUrlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController;
import java.util.List;
/**
* <p>
* 文件信息录入表 前端控制器
* </p>
*
* @author wr
* @since 2024-08-14
*/
@RestController
@RequestMapping("/fileUrl")
@Slf4j
@Api(tags = "文件信息")
@RequiredArgsConstructor
public class FileUrlController extends BaseController {
private final IFileUrlService fileUrlService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/getFileById")
@ApiOperation("根据id查询文件信息集合")
public HttpResult<List<FileUrl>> getFileUrlList(String id) {
String methodDescribe = getMethodDescribe("getFileUrlList");
List<FileUrl> fileUrlList = fileUrlService.getFileUrlList(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, fileUrlList, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/addOrUpdateFile")
@ApiOperation("批量添加和修改文件信息")
public HttpResult<Boolean> addOrUpdateFile(List<FileUrl> list) {
String methodDescribe = getMethodDescribe("addOrUpdateFile");
Boolean b = fileUrlService.addOrUpdateFile(list);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
}
}

View File

@@ -0,0 +1,16 @@
package com.njcn.supervision.mapper.file;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.supervision.pojo.po.file.FileUrl;
/**
* <p>
* 文件信息录入表 Mapper 接口
* </p>
*
* @author wr
* @since 2024-08-14
*/
public interface FileUrlMapper extends BaseMapper<FileUrl> {
}

View File

@@ -0,0 +1,5 @@
<?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.supervision.mapper.file.FileUrlMapper">
</mapper>

View File

@@ -52,7 +52,9 @@
supervision_user_report.history_instance_id,
supervision_user_report.create_time,
supervision_user_report.create_by,
supervision_user_report.status
supervision_user_report.status,
supervision_user_report.dev_id,
supervision_user_report.line_id
FROM supervision_user_report supervision_user_report
WHERE ${ew.sqlSegment}
</select>
@@ -77,7 +79,9 @@
r.history_instance_id,
supervision_user_report.create_time,
supervision_user_report.create_by,
r.status
r.status,
supervision_user_report.dev_id,
supervision_user_report.line_id
FROM supervision_user_report supervision_user_report
LEFT JOIN supervision_user_report_renewal r ON supervision_user_report.id=r.id
WHERE ${ew.sqlSegment}

View File

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.StrPool;
@@ -513,7 +514,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
po = new SupervisionDevMainReportPO();
po.setReporter(RequestUtil.getUserIndex());
po.setReportDate(LocalDate.now());
po.setOrgId(RequestUtil.getDeptIndex());
//解决导入部门问题
List<String> DeptIds = deptS.stream().filter(x -> x.getName().equals(dev.getCity())).map(DeptDTO::getId).collect(Collectors.toList());
po.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex());
po.setExpectedProductionDate(dev.getExpectedProductionDate());
po.setCity(PubUtil.getDicById(dev.getCity(), jiBeiArea));
po.setUserStatus("1");
@@ -534,6 +538,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
devDetails.setId(po.getId());
if(deptMap.containsKey(dev.getPowerCompany())){
devDetails.setPowerCompany(deptMap.get(dev.getPowerCompany()));
devDetails.setPowerCompany(deptMap.get(dev.getPowerCompany()));
}else{
msg.append("所属供电公司不存在!");
}

View File

@@ -0,0 +1,31 @@
package com.njcn.supervision.service.file;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.supervision.pojo.po.file.FileUrl;
import java.util.List;
/**
* <p>
* 文件信息录入表 服务类
* </p>
*
* @author wr
* @since 2024-08-14
*/
public interface IFileUrlService extends IService<FileUrl> {
/**
* 根据id获取全部数据
* @param id
* @return
*/
List<FileUrl> getFileUrlList(String id);
/**
* 批量添加和修改文件信息
* @param list
* @return
*/
Boolean addOrUpdateFile(List<FileUrl> list);
}

View File

@@ -0,0 +1,32 @@
package com.njcn.supervision.service.file.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.supervision.mapper.file.FileUrlMapper;
import com.njcn.supervision.pojo.po.file.FileUrl;
import com.njcn.supervision.service.file.IFileUrlService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 文件信息录入表 服务实现类
* </p>
*
* @author wr
* @since 2024-08-14
*/
@Service
public class FileUrlServiceImpl extends ServiceImpl<FileUrlMapper, FileUrl> implements IFileUrlService {
@Override
public List<FileUrl> getFileUrlList(String id) {
return this.list(new LambdaQueryWrapper<FileUrl>().eq(FileUrl::getId, id));
}
@Override
public Boolean addOrUpdateFile(List<FileUrl> list) {
return this.saveOrUpdateBatch(list);
}
}

View File

@@ -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.DatePattern;
import cn.hutool.core.date.DateUtil;
@@ -18,6 +19,7 @@ import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.device.pms.pojo.po.PmsNewEnergy;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
import com.njcn.supervision.enums.FlowStatusEnum;
@@ -46,10 +48,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -87,6 +86,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
@Override
public Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) {
QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper = new QueryWrapper<>();
List<String> deptIds = new ArrayList<>();;
if (Objects.nonNull(surveyTestQueryParam)) {
//添加上时间范围
surveyTestVOQueryWrapper.between("supervision_survey_plan.plan_start_time",
@@ -110,9 +110,9 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
//筛选普测负责单位
if (StrUtil.isNotBlank(surveyTestQueryParam.getDeptIndex())) {
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData();
surveyTestVOQueryWrapper.in("supervision_survey_test.dept_id", deptIds);
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());
}
@@ -122,8 +122,14 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
.eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
.orderByDesc("supervision_survey_test.Update_Time");
//未完成的技术监督计划,也要展示出来,不受时间限制
surveyTestVOQueryWrapper.or().isNull("supervision_survey_test.complete_time")
.le("supervision_survey_plan.plan_start_time",surveyTestQueryParam.getSearchBeginTime());
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);
List<SurveyTestVO> records = surveyTestVOPage.getRecords();
if (CollectionUtil.isNotEmpty(records)) {

View File

@@ -50,9 +50,11 @@ import com.njcn.system.pojo.po.DictData;
import com.njcn.system.pojo.po.SysDicTreePO;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.api.UserFeignClient;
import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.vo.UserVO;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -417,6 +419,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
//台账不查询全部数据,需要排除敏感及重要用户
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode());
}
if (StrUtil.isNotBlank(userReportQueryParam.getOrgId())) {
/*获取直接下属子单位*/
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
userReportVOQueryWrapper.in("supervision_user_report.org_id", data);
}
if (Objects.nonNull(userReportQueryParam)) {
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
//查询所有区域下的数据
@@ -440,7 +447,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
} else {
page = this.baseMapper.pageUpdate(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
}
page.getRecords().forEach(temp -> {
Integer needGovernance = 0;
if (
@@ -709,6 +715,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
//供电电源情况
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
//解决填报部门问题
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData();
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
List<SensitiveUserSExcel.SensitiveUserExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
@@ -729,7 +739,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
UserReportPO userReportPO = new UserReportPO();
userReportPO.setReporter(RequestUtil.getUserIndex());
userReportPO.setReportDate(LocalDate.now());
userReportPO.setOrgId(RequestUtil.getDeptIndex());
//解决导入部门问题
List<String> 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(userExcel.getExpectedProductionDate());
userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode());
//所属地市
@@ -901,6 +914,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
Map<String, String> treeString = getTreeString("", treeVOS.get(0).getChildren());
//评估类型
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
//解决填报部门问题
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData();
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
@@ -922,7 +937,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
UserReportPO userReportPO = new UserReportPO();
userReportPO.setReporter(RequestUtil.getUserIndex());
userReportPO.setReportDate(LocalDate.now());
userReportPO.setOrgId(RequestUtil.getDeptIndex());
//解决导入部门问题
List<String> 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(reportExcel.getExpectedProductionDate());
userReportPO.setUserType(reportExcel.getUserType());
//所属地市