1.excel通用导出模板,解决时间格式不是文本问题
2.解决部分部门查询问题
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.njcn.web.utils.HttpServletUtil;
|
import com.njcn.web.utils.HttpServletUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
@@ -112,9 +113,18 @@ public class ExcelUtil {
|
|||||||
setTopLevel(workbook, pullDowns);
|
setTopLevel(workbook, pullDowns);
|
||||||
if (CollUtil.isNotEmpty(pullDowns)) {
|
if (CollUtil.isNotEmpty(pullDowns)) {
|
||||||
int num = 1;
|
int num = 1;
|
||||||
|
CellStyle cellStyle = workbook.createCellStyle();
|
||||||
|
DataFormat format = workbook.createDataFormat();
|
||||||
|
cellStyle.setDataFormat(format.getFormat("@"));
|
||||||
for (PullDown pullDown : pullDowns) {
|
for (PullDown pullDown : pullDowns) {
|
||||||
|
if (pullDown.getIsText()) {
|
||||||
|
ExcelUtil.selectListText(workbook, pullDown.getFirstCol(),cellStyle);
|
||||||
|
} else {
|
||||||
String colName = numberToExcelColumn(num);
|
String colName = numberToExcelColumn(num);
|
||||||
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||||
|
if (sum == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (sum > 255) {
|
if (sum > 255) {
|
||||||
ExcelUtil.selectListMaxLength(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().size(), colName);
|
ExcelUtil.selectListMaxLength(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().size(), colName);
|
||||||
num++;
|
num++;
|
||||||
@@ -122,6 +132,8 @@ public class ExcelUtil {
|
|||||||
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Sheet sheetAt = workbook.getSheetAt(0);
|
Sheet sheetAt = workbook.getSheetAt(0);
|
||||||
//获取列数
|
//获取列数
|
||||||
@@ -240,12 +252,13 @@ public class ExcelUtil {
|
|||||||
// 对sheet页生效
|
// 对sheet页生效
|
||||||
sheet.addValidationData(validation);
|
sheet.addValidationData(validation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 当下拉框超过最大字符255,设置隐藏表单来进行展示
|
|
||||||
* @param workbook
|
* @param workbook
|
||||||
* @param firstCol
|
* @param firstCol
|
||||||
* @param lastCol
|
* @param lastCol
|
||||||
* @param colName 列A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
|
* @param colName 列A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
|
||||||
|
* @Description: 当下拉框超过最大字符255,设置隐藏表单来进行展示
|
||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2024/8/13 15:07
|
* @Date: 2024/8/13 15:07
|
||||||
*/
|
*/
|
||||||
@@ -261,6 +274,24 @@ public class ExcelUtil {
|
|||||||
DataValidation validation = help.createValidation(hiddentConstraint, regions);
|
DataValidation validation = help.createValidation(hiddentConstraint, regions);
|
||||||
sheet.addValidationData(validation);
|
sheet.addValidationData(validation);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @param workbook
|
||||||
|
* @param firstCol
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2024/8/20 10:44
|
||||||
|
*/
|
||||||
|
public static void selectListText(Workbook workbook, int firstCol,CellStyle cellStyle) {
|
||||||
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
|
for (int i = 2; i < 65535; i++) {
|
||||||
|
Row row = sheet.getRow(i);
|
||||||
|
if(ObjectUtil.isNull(row)){
|
||||||
|
row = sheet.createRow(i);
|
||||||
|
}
|
||||||
|
Cell cell = row.createCell(firstCol);
|
||||||
|
cell.setCellStyle(cellStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定名称、数据下载报表(带指定标题将*显示比必填信息),带有下拉信息
|
* 指定名称、数据下载报表(带指定标题将*显示比必填信息),带有下拉信息
|
||||||
@@ -364,13 +395,18 @@ public class ExcelUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置隐藏表单来进行下拉框
|
* 设置隐藏表单来进行下拉框
|
||||||
|
*
|
||||||
* @param workbook
|
* @param workbook
|
||||||
* @param pullDowns
|
* @param pullDowns
|
||||||
*/
|
*/
|
||||||
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (PullDown pullDown : pullDowns) {
|
for (PullDown pullDown : pullDowns) {
|
||||||
|
if (!pullDown.getIsText()) {
|
||||||
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||||
|
if (sum == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (sum > 255) {
|
if (sum > 255) {
|
||||||
// 创建隐藏sheet
|
// 创建隐藏sheet
|
||||||
String hiddenSheetName = "hiddenSheetA";
|
String hiddenSheetName = "hiddenSheetA";
|
||||||
@@ -399,6 +435,7 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
||||||
|
|||||||
@@ -14,8 +14,13 @@ public class PullDown {
|
|||||||
|
|
||||||
//起始列
|
//起始列
|
||||||
private Integer firstCol;
|
private Integer firstCol;
|
||||||
|
|
||||||
//结束列
|
//结束列
|
||||||
private Integer lastCol;
|
private Integer lastCol;
|
||||||
|
|
||||||
|
//是否设置单元格(文本)
|
||||||
|
private Boolean isText = false;
|
||||||
|
|
||||||
//属性值
|
//属性值
|
||||||
private List<String> strings;
|
private List<String> strings;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,6 +156,11 @@ public class SupervisionDevMainReportParam {
|
|||||||
@ApiModelProperty(value = "审批状态")
|
@ApiModelProperty(value = "审批状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0:系统建档 1:外部导入
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "状态:0:系统建档 1:外部导入")
|
||||||
|
private Integer importType;
|
||||||
|
|
||||||
@ApiModelProperty("发起人自选审批人 Map")
|
@ApiModelProperty("发起人自选审批人 Map")
|
||||||
private Map<String, List<String>> startUserSelectAssignees;
|
private Map<String, List<String>> startUserSelectAssignees;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.njcn.supervision.pojo.vo.survey;
|
package com.njcn.supervision.pojo.vo.survey;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -22,10 +20,6 @@ public class SurveyTestVO extends BaseEntity implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
|
||||||
* 其他报告
|
|
||||||
*/
|
|
||||||
private String otherReport;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普测测试管理表id
|
* 普测测试管理表id
|
||||||
@@ -82,7 +76,6 @@ public class SurveyTestVO extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划完成时间
|
* 计划完成时间
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +96,11 @@ public class SurveyTestVO extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String supervisionReport;
|
private String supervisionReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他报告
|
||||||
|
*/
|
||||||
|
private String otherReport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有问题 0 没有问题 1 有问题
|
* 是否有问题 0 没有问题 1 有问题
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ public class DeVReportManageController extends BaseController {
|
|||||||
public HttpResult<Boolean> auditDevReport(@RequestBody @Validated SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate supervisionDevMainReportParamUpdate){
|
public HttpResult<Boolean> auditDevReport(@RequestBody @Validated SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate supervisionDevMainReportParamUpdate){
|
||||||
String methodDescribe = getMethodDescribe("auditDevReport");
|
String methodDescribe = getMethodDescribe("auditDevReport");
|
||||||
boolean res = supervisionDevMainReportPOService.auditDevReport(supervisionDevMainReportParamUpdate);
|
boolean res = supervisionDevMainReportPOService.auditDevReport(supervisionDevMainReportParamUpdate);
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
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.date.LocalDateTimeUtil;
|
|
||||||
import cn.hutool.core.text.StrPool;
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -22,6 +22,9 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
|||||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||||
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
import com.njcn.device.pms.utils.PubUtil;
|
import com.njcn.device.pms.utils.PubUtil;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.api.NodeClient;
|
import com.njcn.device.pq.api.NodeClient;
|
||||||
@@ -33,7 +36,6 @@ import com.njcn.supervision.enums.FlowStatusEnum;
|
|||||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||||
import com.njcn.supervision.pojo.dto.SensitiveUserSExcel;
|
|
||||||
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||||
@@ -85,6 +87,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
private final NodeClient nodeClient;
|
private final NodeClient nodeClient;
|
||||||
|
private final CommTerminalGeneralClient commterminalGeneralClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -111,7 +114,14 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (ObjectUtil.isNotNull(supervisionDevMainReportParam.getImportType())) {
|
||||||
|
supervisionDevMainReportPO.setImportType(supervisionDevMainReportParam.getImportType());
|
||||||
|
if (supervisionDevMainReportParam.getImportType() == 1) {
|
||||||
|
supervisionDevMainReportParam.setStatus(FlowStatusEnum.APPROVE.getCode());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
supervisionDevMainReportParam.setImportType(0);
|
||||||
|
}
|
||||||
|
|
||||||
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.saveOrUpdate(supervisionDevMainReportPO);
|
this.saveOrUpdate(supervisionDevMainReportPO);
|
||||||
@@ -300,8 +310,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
ExportParams exportParams = new ExportParams("终端入网检测数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "终端入网检测数据信息");
|
ExportParams exportParams = new ExportParams("终端入网检测数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "终端入网检测数据信息");
|
||||||
//所属地市
|
//所属地市
|
||||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
||||||
//所属供电公司 RequestUtil.getDeptIndex()
|
//所属供电公司
|
||||||
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId("0d52f9f6e43ec0ee83013cd32da93f66").getData();
|
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||||
//终端型号
|
//终端型号
|
||||||
List<DictData> devType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
List<DictData> devType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||||
//通讯类型
|
//通讯类型
|
||||||
@@ -317,11 +327,40 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||||
//中性点接线方式
|
//中性点接线方式
|
||||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||||
|
SubstationParam substationParam=new SubstationParam();
|
||||||
|
substationParam.setOrgIds(depts.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||||
|
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||||
|
|
||||||
List<PullDown> pullDowns = new ArrayList<>();
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
PullDown pullDown;
|
PullDown pullDown;
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(0);
|
||||||
|
pullDown.setLastCol(0);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(10);
|
||||||
|
pullDown.setLastCol(10);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(11);
|
||||||
|
pullDown.setLastCol(11);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(20);
|
||||||
|
pullDown.setLastCol(20);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(1);
|
pullDown.setFirstCol(1);
|
||||||
pullDown.setLastCol(1);
|
pullDown.setLastCol(1);
|
||||||
@@ -329,11 +368,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
//缺少变电站名称
|
//缺少变电站名称
|
||||||
// pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
// pullDown.setFirstCol(2);
|
pullDown.setFirstCol(2);
|
||||||
// pullDown.setLastCol(2);
|
pullDown.setLastCol(2);
|
||||||
// pullDown.setStrings();
|
pullDown.setStrings(data.stream().map(SubGetBase::getName).distinct().collect(Collectors.toList()));
|
||||||
// pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(3);
|
pullDown.setFirstCol(3);
|
||||||
@@ -484,10 +523,23 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
//中性点接线方式
|
//中性点接线方式
|
||||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||||
|
|
||||||
|
SubstationParam substationParam=new SubstationParam();
|
||||||
|
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||||
|
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||||
|
|
||||||
SupervisionDevMainReportPO po;
|
SupervisionDevMainReportPO po;
|
||||||
if (CollectionUtil.isNotEmpty(devExcels)) {
|
if (CollectionUtil.isNotEmpty(devExcels)) {
|
||||||
for (SupervisionDevMainReportExcel dev : devExcels) {
|
for (SupervisionDevMainReportExcel dev : devExcels) {
|
||||||
//todo 需要根据变电站id进行匹配
|
//todo 需要根据变电站id进行匹配
|
||||||
|
List<SubGetBase> subList = data.stream().filter(x -> x.getName().equals(dev.getSubstation())).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isEmpty(subList)){
|
||||||
|
//该用户已经录入
|
||||||
|
SupervisionDevMainReportExcel.ExcelMsg sensitiveUserExcelMsg = new SupervisionDevMainReportExcel.ExcelMsg();
|
||||||
|
BeanUtils.copyProperties(dev, sensitiveUserExcelMsg);
|
||||||
|
sensitiveUserExcelMsg.setMsg(dev.getTerminalIp().concat("变电站不存在,请检查变电站信息是否是下拉框信息!"));
|
||||||
|
devMsgList.add(sensitiveUserExcelMsg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper
|
lambdaQueryWrapper
|
||||||
.eq(SupervisionTempDeviceReport::getSubstationName, dev.getSubstation())
|
.eq(SupervisionTempDeviceReport::getSubstationName, dev.getSubstation())
|
||||||
@@ -542,12 +594,12 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
msg.append("所属供电公司不存在!");
|
msg.append("所属供电公司不存在!");
|
||||||
}
|
}
|
||||||
//todo 需要根据变电站id进行匹配
|
//todo 需要根据变电站id进行匹配
|
||||||
// devDetails.setCustomSubstationFlag();
|
devDetails.setCustomSubstationFlag(0);
|
||||||
// devDetails.setSubstation();
|
devDetails.setSubstation(subList.get(0).getId());
|
||||||
devDetails.setSubstationName(dev.getSubstation());
|
devDetails.setSubstationName(dev.getSubstation());
|
||||||
// devDetails.setSubstationVoltageLevel();
|
devDetails.setSubstationVoltageLevel(subList.get(0).getVoltageLevel());
|
||||||
// devDetails.setLongitude();
|
devDetails.setLongitude(subList.get(0).getLat());
|
||||||
// devDetails.setLatitude();
|
devDetails.setLatitude(subList.get(0).getLng());
|
||||||
|
|
||||||
devDetails.setMonitoringTerminalCode(dev.getMonitoringTerminalName());
|
devDetails.setMonitoringTerminalCode(dev.getMonitoringTerminalName());
|
||||||
devDetails.setMonitoringTerminalName(dev.getMonitoringTerminalName());
|
devDetails.setMonitoringTerminalName(dev.getMonitoringTerminalName());
|
||||||
|
|||||||
@@ -412,18 +412,19 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam, Boolean allDataFlag) {
|
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam, Boolean allDataFlag) {
|
||||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
|
||||||
|
//此处仅查询敏感及重要用户
|
||||||
|
userReportVOQueryWrapper.and(wrapper ->
|
||||||
|
wrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||||
|
.or()
|
||||||
|
.in("supervision_user_report.org_id", data)
|
||||||
|
)
|
||||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||||
if (!allDataFlag) {
|
if (!allDataFlag) {
|
||||||
//台账不查询全部数据,需要排除敏感及重要用户
|
//台账不查询全部数据,需要排除敏感及重要用户
|
||||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode());
|
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 (Objects.nonNull(userReportQueryParam)) {
|
||||||
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||||
//查询所有区域下的数据
|
//查询所有区域下的数据
|
||||||
@@ -544,8 +545,13 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
public Page<UserReportVO> getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
public Page<UserReportVO> getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||||
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
|
||||||
//此处仅查询敏感及重要用户
|
//此处仅查询敏感及重要用户
|
||||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
userReportVOQueryWrapper.and(wrapper ->
|
||||||
|
wrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||||
|
.or()
|
||||||
|
.in("supervision_user_report.org_id", data)
|
||||||
|
)
|
||||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||||
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||||
@@ -610,6 +616,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(7);
|
||||||
|
pullDown.setLastCol(7);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(5);
|
pullDown.setFirstCol(5);
|
||||||
pullDown.setLastCol(5);
|
pullDown.setLastCol(5);
|
||||||
@@ -840,6 +852,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !"风光储".equals(x.getName()) && !"超高压".equals(x.getName())).map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(jiBeiArea.stream().filter(x -> !"风光储".equals(x.getName()) && !"超高压".equals(x.getName())).map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
|
pullDown = new PullDown();
|
||||||
|
pullDown.setFirstCol(6);
|
||||||
|
pullDown.setLastCol(6);
|
||||||
|
pullDown.setIsText(true);
|
||||||
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(4);
|
pullDown.setFirstCol(4);
|
||||||
pullDown.setLastCol(4);
|
pullDown.setLastCol(4);
|
||||||
|
|||||||
Reference in New Issue
Block a user