Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -136,4 +136,9 @@ public interface OssPath {
|
||||
*/
|
||||
String ONLINE_REPORT="onlineReport/";
|
||||
|
||||
/**
|
||||
* 系统上传文件至装置内,文件存储路径
|
||||
*/
|
||||
String SYSTEM_TO_DEV="systemToDev/";
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import com.njcn.web.utils.HttpServletUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -11,9 +12,8 @@ import org.apache.poi.hssf.usermodel.DVConstraint;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidationConstraint;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -21,10 +21,9 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
@@ -80,7 +79,7 @@ public class ExcelUtil {
|
||||
*
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
public static void exportExcelByWorkbook(String fileName, Workbook workbook) {
|
||||
public static void exportExcelByWorkbook(String fileName, Workbook workbook) {
|
||||
HttpServletResponse response = HttpServletUtil.getResponse();
|
||||
try (ServletOutputStream outputStream = response.getOutputStream()) {
|
||||
fileName = URLEncoder.encode(fileName, CharsetUtil.UTF_8);
|
||||
@@ -116,9 +115,18 @@ public class ExcelUtil {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, dataSet);
|
||||
setTopLevel(workbook, pullDowns);
|
||||
if (CollUtil.isNotEmpty(pullDowns)) {
|
||||
int num = 1;
|
||||
for (PullDown pullDown : pullDowns) {
|
||||
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
||||
String colName = numberToExcelColumn(num);
|
||||
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||
if(sum>255){
|
||||
ExcelUtil.selectListMaxLength(workbook, pullDown.getFirstCol(), pullDown.getLastCol(),pullDown.getStrings().size(),colName);
|
||||
num++;
|
||||
}else{
|
||||
ExcelUtil.selectList(workbook, pullDown.getFirstCol(), pullDown.getLastCol(), pullDown.getStrings().toArray(new String[]{}));
|
||||
}
|
||||
}
|
||||
}
|
||||
Sheet sheetAt = workbook.getSheetAt(0);
|
||||
@@ -128,7 +136,7 @@ public class ExcelUtil {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
//获取行
|
||||
Row row = sheetAt.getRow(i);
|
||||
if(Objects.isNull(row)){
|
||||
if (Objects.isNull(row)) {
|
||||
continue;
|
||||
}
|
||||
for (int j = 0; j < physicalNumberOfCells; j++) {
|
||||
@@ -173,6 +181,8 @@ public class ExcelUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
workbook.write(outputStream);
|
||||
} catch (IOException e) {
|
||||
log.error(">>> 导出数据异常:{}", e.getMessage());
|
||||
@@ -238,7 +248,27 @@ public class ExcelUtil {
|
||||
// 对sheet页生效
|
||||
sheet.addValidationData(validation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 当下拉框超过最大字符255,设置隐藏表单来进行展示
|
||||
* @param workbook
|
||||
* @param firstCol
|
||||
* @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
|
||||
* @Author: wr
|
||||
* @Date: 2024/8/13 15:07
|
||||
*/
|
||||
public static void selectListMaxLength(Workbook workbook,int firstCol, int lastCol,int row ,String colName) {
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
// 生成下拉列表
|
||||
// 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
|
||||
CellRangeAddressList regions = new CellRangeAddressList(2, 65535, firstCol, lastCol);
|
||||
String strFormula = workbook.getSheetName(1) + "!$" + colName + "$1:$" + colName + "$" + row;
|
||||
XSSFDataValidationConstraint hiddentConstraint = new XSSFDataValidationConstraint(DataValidationConstraint.ValidationType.LIST, strFormula);
|
||||
// 数据有效性对象
|
||||
DataValidationHelper help = new XSSFDataValidationHelper((XSSFSheet) sheet);
|
||||
DataValidation validation = help.createValidation(hiddentConstraint, regions);
|
||||
sheet.addValidationData(validation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定名称、数据下载报表(带指定标题将*显示比必填信息),带有下拉信息
|
||||
@@ -265,7 +295,7 @@ public class ExcelUtil {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
//获取行
|
||||
Row row = sheetAt.getRow(i);
|
||||
if(Objects.isNull(row)){
|
||||
if (Objects.isNull(row)) {
|
||||
continue;
|
||||
}
|
||||
for (int j = 0; j < physicalNumberOfCells; j++) {
|
||||
@@ -340,5 +370,60 @@ public class ExcelUtil {
|
||||
sheet.addValidationData(validation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置隐藏表单来进行下拉框
|
||||
* @param workbook
|
||||
* @param pullDowns
|
||||
*/
|
||||
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||
int num = 0;
|
||||
for (PullDown pullDown : pullDowns) {
|
||||
int sum = pullDown.getStrings().stream().mapToInt(String::length).sum();
|
||||
if (sum > 255) {
|
||||
// 创建隐藏sheet
|
||||
String hiddenSheetName = "hiddenSheetA";
|
||||
if (num == 0) {
|
||||
workbook.createSheet(hiddenSheetName);
|
||||
}
|
||||
//false展示隐藏sheet ,true不展示隐藏sheet
|
||||
workbook.setSheetHidden(workbook.getSheetIndex(workbook.getSheet(hiddenSheetName)), true);
|
||||
Sheet sheet = workbook.getSheet(hiddenSheetName);
|
||||
if(num == 0){
|
||||
//sheet.getLastRowNum无法区分 有一行和没有 所以这里先建一行
|
||||
sheet.createRow(0);
|
||||
}
|
||||
Row row; //创建数据行
|
||||
sheet.setColumnWidth(num, 4000); //设置每列的列宽
|
||||
for (int j = 0; j < pullDown.getStrings().size(); j++) {
|
||||
if (sheet.getLastRowNum() < j) {
|
||||
row = sheet.createRow(j); //创建数据行
|
||||
} else {
|
||||
row = sheet.getRow(j);
|
||||
}
|
||||
//设置对应单元格的值
|
||||
row.createCell(num).setCellValue(pullDown.getStrings().get(j));
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
||||
*
|
||||
* @param n
|
||||
* @return
|
||||
*/
|
||||
public static String numberToExcelColumn(int n) {
|
||||
CellReference cellRef = new CellReference(0, n - 1, false, false); // Row and column are 0-based
|
||||
int colIndex = cellRef.getCol();
|
||||
StringBuilder columnName = new StringBuilder();
|
||||
while (colIndex >= 0) {
|
||||
columnName.insert(0, (char) ('A' + (colIndex % 26)));
|
||||
colIndex /= 26;
|
||||
colIndex--;
|
||||
}
|
||||
return columnName.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ public enum GWSendEnum {
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
|
||||
PARK_AND_STATION("parkAndStation", "/pms-ghq-powerquality-start/powerQuality/park/create"),
|
||||
|
||||
REPORT_CREATE("reportCreate", "/pms-ghq-powerquality-start/powerQuality/report/create"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.njcn.device.pms.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class RunMonitorStatisticalDTO {
|
||||
|
||||
private String objId;
|
||||
private String provinceOrg;
|
||||
private String provinceOrgName;
|
||||
private String cityOrg;
|
||||
private String cityOrgName;
|
||||
private String maintOrg;
|
||||
private String maintOrgName;
|
||||
private String monitorName;
|
||||
private String monitorVoltageLevel;
|
||||
private String monitorId;
|
||||
private String monitorStatus;
|
||||
private Date monitorOperateDate;
|
||||
private Date monitorStopDate;
|
||||
private String substationId;
|
||||
private String substationName;
|
||||
private String busId;
|
||||
private String busName;
|
||||
private String outLineIntervalId;
|
||||
private String outLineIntervalName;
|
||||
private String monitorObjTypeBig;
|
||||
private String monitorObjTypeSmall;
|
||||
private String monitorTag;
|
||||
private String monitorObjName;
|
||||
private String monitorObjId;
|
||||
private String isLine;
|
||||
private BigDecimal minShortCapacity;
|
||||
private BigDecimal supplyEquipCapacity;
|
||||
private BigDecimal userProtocolCapacity;
|
||||
private String terminalCode;
|
||||
private String terminalManufacturer;
|
||||
private String terminalModel;
|
||||
private String terminalManufactureNum;
|
||||
private String terminalConnect;
|
||||
private String neutralGround;
|
||||
private String evtType;
|
||||
private String statisticalType;
|
||||
private String statisticalDate;
|
||||
private String isMonitorOnline;
|
||||
private String isTerminalOnline;
|
||||
private Integer onlineMonitorNum;
|
||||
private Integer runMonitorNum;
|
||||
private BigDecimal onlineMonitorRate;
|
||||
private Long expectCollectNum;
|
||||
private Long actualCollectNum;
|
||||
private BigDecimal dataFullRate;
|
||||
|
||||
|
||||
}
|
||||
@@ -269,6 +269,9 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实际,投运,谐波系统 的监测点
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getRunMonitorIds")
|
||||
@ApiOperation("获取投运谐波系统所有监测点")
|
||||
@@ -279,20 +282,6 @@ public class CommTerminalController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取实际,投运,谐波系统 的监测点
|
||||
* @author cdf
|
||||
* @date 2023/9/18
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getRunMonitorList")
|
||||
@ApiOperation("获取实际,投运,谐波系统 的监测点")
|
||||
public HttpResult<List<String>> getRunMonitorList() {
|
||||
String methodDescribe = getMethodDescribe("getRunMonitorList");
|
||||
List<String> result = commTerminalService.getOneMonitorIds();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据监测点集合获取监测点详情
|
||||
* @author cdf
|
||||
|
||||
@@ -85,7 +85,7 @@ public class PmsParkServiceImpl extends ServiceImpl<PmsParkMapper, PmsParkPO> im
|
||||
public Page<PmsParkPO> pageList(PmsParkParam.PmsParkQuery parkQuery) {
|
||||
List<String> deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(parkQuery.getMaintOrg()).getData();
|
||||
LambdaQueryWrapper<PmsParkPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(PmsParkPO::getMaintOrg, deptCodes);
|
||||
lambdaQueryWrapper.in(PmsParkPO::getMaintOrg, deptCodes).orderByDesc(PmsParkPO::getCreateTime,PmsParkPO::getCityOrgName);
|
||||
return this.page(new Page<>(PageFactory.getPageNum(parkQuery), PageFactory.getPageSize(parkQuery)), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class PmsParkServiceImpl extends ServiceImpl<PmsParkMapper, PmsParkPO> im
|
||||
List<String> ids = deptFeignClient.getDepSonSelfCodetByCode(param.getCityOrg()).getData();
|
||||
|
||||
LambdaQueryWrapper<PmsMidLedger> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.select(PmsMidLedger::getName,PmsMidLedger::getOperationName,PmsMidLedger::getId).in(PmsMidLedger::getOperationId,ids).eq(PmsMidLedger::getLevel,0);
|
||||
lambdaQueryWrapper.select(PmsMidLedger::getName,PmsMidLedger::getOperationName,PmsMidLedger::getId).in(PmsMidLedger::getSectionId,ids).eq(PmsMidLedger::getLevel,0);
|
||||
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerMapper.selectList(lambdaQueryWrapper);
|
||||
return pmsMidLedgerList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.PqsTerminalLogsClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2024/8/13 10:14
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/node", fallbackFactory = PqsTerminalLogsClientFallbackFactory.class, contextId = "node")
|
||||
public interface NodeClient {
|
||||
|
||||
|
||||
@ApiOperation("获取全部前置机")
|
||||
@GetMapping("/nodeAllList")
|
||||
HttpResult<List<Node>> nodeAllList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.NodeClient;
|
||||
import com.njcn.device.pq.api.PqsTerminalLogsClient;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zbj
|
||||
* @version 1.0.0
|
||||
* @date 2023年04月13日 13:34
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class NodeClientFallbackFactory implements FallbackFactory<NodeClient> {
|
||||
@Override
|
||||
public NodeClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new NodeClient()
|
||||
{
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Node>> nodeAllList() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取全部前置机", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -515,7 +515,7 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
//父级完整性匹配
|
||||
if (CollectionUtil.isNotEmpty(data)){
|
||||
BigDecimal reduce = data.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
double avg = reduce.divide(new BigDecimal(data.size())).doubleValue();
|
||||
double avg = reduce.divide(new BigDecimal(data.size()),6,RoundingMode.HALF_UP).doubleValue();
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.dataLimits(avg));
|
||||
} else {
|
||||
lineAdministrationTree.setIntegrityData(3.14159);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.njcn.harmonic.pojo.po.upload;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量报表上送
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-08-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_upload_report")
|
||||
public class RUploadReport {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private String objId;
|
||||
|
||||
/**
|
||||
* 省单位id
|
||||
*/
|
||||
private String provinceOrg;
|
||||
|
||||
/**
|
||||
* 省单位名称
|
||||
*/
|
||||
private String provinceOrgName;
|
||||
|
||||
/**
|
||||
* 报表类型
|
||||
*/
|
||||
@NotBlank(message = "报表类型不可为空")
|
||||
private String reportType;
|
||||
|
||||
/**
|
||||
* Json字符串
|
||||
*/
|
||||
@NotBlank(message = "Json字符串不可为空")
|
||||
private String reportData;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String isDelete;
|
||||
|
||||
private LocalDateTime deleteTime;
|
||||
|
||||
private Integer uploadStatus;
|
||||
|
||||
|
||||
}
|
||||
@@ -1233,11 +1233,13 @@ public class ExportModelController extends BaseController {
|
||||
String reportFileUrl = "";
|
||||
try {
|
||||
String fileName = name + formatter.format(currentTime) + ".docx";
|
||||
if (isUrl) {
|
||||
reportFileUrl = wordUtil2.getReportFileUrl(rtfPath, name + formatter.format(currentTime) + ".docx",null ,reportmap);
|
||||
} else {
|
||||
wordUtil2.getWord(rtfPath, reportmap, fileName,null, response);
|
||||
if(ObjectUtil.isNotNull(isUrl)){
|
||||
if (isUrl) {
|
||||
reportFileUrl = wordUtil2.getReportFileUrl(rtfPath, name + formatter.format(currentTime) + ".docx",null ,reportmap);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, reportFileUrl, methodDescribe);
|
||||
}
|
||||
}
|
||||
wordUtil2.getWord(rtfPath, reportmap, fileName,null, response);
|
||||
} catch (Exception e) {
|
||||
log.error("获取报告发生异常,异常是" + e.getMessage());
|
||||
}
|
||||
|
||||
@@ -488,8 +488,8 @@ public class ExportModelJBController extends BaseController {
|
||||
String strTime = String.format("%s——%s。",
|
||||
new String[]{DateUtil.format(startDate, "yyyy年MM月dd日 HH时mm分ss秒"),
|
||||
DateUtil.format(endDate, "yyyy年MM月dd日 HH时mm分ss秒")});
|
||||
reportmap.put("$number$", reportNumber); // 报告编号
|
||||
reportmap.put("$titlePoint$", crmName); // 客户名称
|
||||
reportmap.put("$number$", StrUtil.isBlank(reportNumber)?"":reportNumber); // 报告编号
|
||||
reportmap.put("$titlePoint$",StrUtil.isBlank(crmName)?"":crmName); // 客户名称
|
||||
|
||||
reportmap.put("$TitleTime$", formatter.format(currentTime)); // 报告生成时间
|
||||
reportmap.put("$ReportTitle$",
|
||||
@@ -1503,11 +1503,13 @@ public class ExportModelJBController extends BaseController {
|
||||
String reportFileUrl = "";
|
||||
try {
|
||||
String fileName = name + formatter.format(currentTime) + ".docx";
|
||||
if (isUrl) {
|
||||
reportFileUrl = wordUtil2.getReportFileUrl(rtfPath, name + formatter.format(currentTime) + ".docx",tableList, reportmap);
|
||||
} else {
|
||||
wordUtil2.getWord(rtfPath, reportmap, fileName,tableList, response);
|
||||
if(ObjectUtil.isNotNull(isUrl)){
|
||||
if (isUrl) {
|
||||
reportFileUrl = wordUtil2.getReportFileUrl(rtfPath, name + formatter.format(currentTime) + ".docx",tableList, reportmap);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, reportFileUrl, methodDescribe);
|
||||
}
|
||||
}
|
||||
wordUtil2.getWord(rtfPath, reportmap, fileName,tableList, response);
|
||||
} catch (Exception e) {
|
||||
log.error("获取报告发生异常,异常是" + e.getMessage());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.njcn.harmonic.controller.upload;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.DimGlobalDataParam;
|
||||
import com.njcn.harmonic.pojo.po.upload.RUploadReport;
|
||||
import com.njcn.harmonic.pojo.vo.DimGlobalDataStandVO;
|
||||
import com.njcn.harmonic.service.upload.IRUploadReportService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.enums.GWSendEnum;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.pojo.param.SendParam;
|
||||
import com.njcn.web.utils.GwSendUtil;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量报表上送 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2024-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rUploadReport")
|
||||
@RequiredArgsConstructor
|
||||
public class RUploadReportController extends BaseController {
|
||||
|
||||
private final IRUploadReportService irUploadReportService;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
/**
|
||||
* 新增pms电能质量报表
|
||||
*/
|
||||
@PostMapping("/addPmsReport")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增pms电能质量报表")
|
||||
@ApiImplicitParam(name = "rUploadReport", value = "条件参数", required = true)
|
||||
public HttpResult<Boolean> addPmsReport(@RequestBody @Validated RUploadReport rUploadReport){
|
||||
String methodDescribe = getMethodDescribe("addPmsReport");
|
||||
Dept dept = deptFeignClient.getRootDept().getData();
|
||||
List<Dept> deptList = deptFeignClient.getDirectSonSelf(dept.getId()).getData();
|
||||
Optional<Dept> optional = deptList.stream().filter(item->item.getPid().equals(dept.getId())).findFirst();
|
||||
if(optional.isPresent()){
|
||||
Dept d = optional.get();
|
||||
rUploadReport.setProvinceOrg(d.getCode());
|
||||
rUploadReport.setProvinceOrgName(d.getName());
|
||||
}
|
||||
rUploadReport.setIsDelete("0");
|
||||
rUploadReport.setUploadStatus(0);
|
||||
|
||||
long count = irUploadReportService.count(new LambdaQueryWrapper<RUploadReport>().eq(RUploadReport::getProvinceOrg,rUploadReport.getProvinceOrg()));
|
||||
if(count>0){
|
||||
throw new BusinessException("已经存在该省电能质量报告");
|
||||
}
|
||||
irUploadReportService.save(rUploadReport);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改pms电能质量报表
|
||||
*/
|
||||
@PostMapping("/updatePmsReport")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPLOAD)
|
||||
@ApiOperation("修改pms电能质量报表")
|
||||
@ApiImplicitParam(name = "rUploadReport", value = "条件参数", required = true)
|
||||
public HttpResult<Boolean> updatePmsReport(@RequestBody @Validated RUploadReport rUploadReport){
|
||||
String methodDescribe = getMethodDescribe("updatePmsReport");
|
||||
irUploadReportService.updateById(rUploadReport);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除pms电能质量报表
|
||||
*/
|
||||
@PostMapping("/delPmsReport")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@ApiOperation("删除pms电能质量报表")
|
||||
public HttpResult<Boolean> delPmsReport(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("delPmsReport");
|
||||
irUploadReportService.removeByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/pagePmsReportList")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("列表集合")
|
||||
public HttpResult<Page<RUploadReport>> pagePmsReportList(@RequestBody BaseParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("pagePmsReportList");
|
||||
Page<RUploadReport> reportList = irUploadReportService.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, reportList, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/uploadGw")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("上送电能质量报表数据新增或更新")
|
||||
public HttpResult<Integer> uploadGw(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("uploadGw");
|
||||
List<RUploadReport> reportList = irUploadReportService.listByIds(ids);
|
||||
SendParam sendParam = new SendParam();
|
||||
sendParam.setStats(reportList);
|
||||
Map<String,String> map = GwSendUtil.send(sendParam, GWSendEnum.REPORT_CREATE);
|
||||
int result = GwSendUtil.returnInfoMsg(ids,map);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@
|
||||
)
|
||||
) AS allOvertime
|
||||
FROM
|
||||
`r_stat_limit_rate_d`
|
||||
`r_stat_limit_target_d`
|
||||
<where>
|
||||
and time_id between #{startTime} and #{endTime}
|
||||
<if test=" ids != null and ids.size > 0">
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.harmonic.mapper.upload;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.upload.RUploadReport;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量报表上送 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-08-07
|
||||
*/
|
||||
public interface RUploadReportMapper extends BaseMapper<RUploadReport> {
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.FileUtil;
|
||||
@@ -397,9 +398,9 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
tem = "#NO";
|
||||
}
|
||||
if (StrUtil.isNotBlank(twoKey)) {
|
||||
reportTreeStat.setName("$" + oneKey + "#" + twoKey + "#" + statItem + "#" + item.getClassId().trim() + tem.trim() + "$");
|
||||
reportTreeStat.setName("$" + oneKey + "#" + twoKey + "#" + statItem + "#" + item.getResourcesId().trim() + tem.trim() + "$");
|
||||
} else {
|
||||
reportTreeStat.setName("$" + oneKey + "#" + statItem + "#" + item.getClassId().trim() + tem.trim() + "$");
|
||||
reportTreeStat.setName("$" + oneKey + "#" + statItem + "#" + item.getResourcesId().trim() + tem.trim() + "$");
|
||||
}
|
||||
|
||||
reportTreeStat.setShowName(statItem);
|
||||
@@ -437,146 +438,6 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析报表模板赋值数据
|
||||
*/
|
||||
/* private void analyzeReport(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp,HttpServletResponse response) {
|
||||
//根据content,获取v值并进行处理
|
||||
List<ReportTemplateDTO> reportTemplateDTOList = new ArrayList<>();
|
||||
JSONArray jsonArray;
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(excelRptTemp.getContent())) {
|
||||
//通过文件服务器获取
|
||||
jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get("celldata");
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get("v");
|
||||
if (son.containsKey("v")) {
|
||||
String v = son.getStr("v");
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains("#")) {
|
||||
//剔除前后$
|
||||
v = v.replace("$", "");
|
||||
//封装ReportTemplateDTO
|
||||
ReportTemplateDTO reportTemplateDTO = new ReportTemplateDTO();
|
||||
reportTemplateDTO.setItemName(v);
|
||||
//根据#分割数据
|
||||
String[] vItem = v.split("#");
|
||||
if (vItem.length == 4) {
|
||||
//$HA[_25]#B#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0]);
|
||||
reportTemplateDTO.setPhase(vItem[1].substring(0, 1));
|
||||
reportTemplateDTO.setStatMethod(vItem[2].toUpperCase());
|
||||
reportTemplateDTO.setClassId(vItem[3]);
|
||||
} else if (vItem.length == 3) {
|
||||
//$HA[_25]#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0]);
|
||||
reportTemplateDTO.setPhase("M");
|
||||
reportTemplateDTO.setStatMethod(vItem[1].toUpperCase());
|
||||
reportTemplateDTO.setClassId(vItem[2]);
|
||||
}
|
||||
reportTemplateDTOList.add(reportTemplateDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||
}
|
||||
|
||||
List<ReportTemplateDTO> endList = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(reportTemplateDTOList)) {
|
||||
//开始组织sql
|
||||
reportTemplateDTOList.stream().forEach(data -> {
|
||||
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
||||
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(endList)) {
|
||||
//数据单位信息
|
||||
Map<String, String> unit = unitMap(reportSearchParam.getLineId());
|
||||
//进行反向赋值到模板
|
||||
//1、根据itemName分组
|
||||
Map<String, List<ReportTemplateDTO>> assMap = endList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getItemName));
|
||||
//2、把itemName的value赋给v和m
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = (JSONObject) item;
|
||||
JSONArray itemArr = (JSONArray) jsonObject.get("celldata");
|
||||
itemArr.forEach((it) -> {
|
||||
if (Objects.nonNull(it) && !"null".equals(it.toString())) {
|
||||
//获取到1列
|
||||
JSONObject data = (JSONObject) it;
|
||||
JSONObject son = (JSONObject) data.get("v");
|
||||
if (son.containsKey("v")) {
|
||||
String v = son.getStr("v");
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains("#")) {
|
||||
String str = "";
|
||||
if(Objects.nonNull(assMap.get(v.replace("$", "")))){
|
||||
str = assMap.get(v.replace("$", "")).get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set("v", str);
|
||||
}
|
||||
}
|
||||
//解决数据单位问题 @指标#类型@
|
||||
if (v.charAt(0) == '@' && v.contains("#")) {
|
||||
String replace = v.replace("@", "");
|
||||
son.set("v", unit.getOrDefault(replace, "/"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
InputStream reportStream = IoUtil.toStream(jsonArray.toString(), CharsetUtil.UTF_8);
|
||||
String newContent = fileStorageUtil.uploadStream(reportStream, OssPath.HARMONIC_EXCEL_REPORT, FileUtil.generateFileName("json"));
|
||||
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename="+"aa");
|
||||
//入库前判断是否有了,有了就更新
|
||||
ExcelRpt excelRpt = new ExcelRpt();
|
||||
excelRpt.setName(excelRptTemp.getName());
|
||||
excelRpt.setLineId(reportSearchParam.getLineId());
|
||||
excelRpt.setDataDate(DateUtil.parse(reportSearchParam.getStartTime()));
|
||||
excelRpt.setTempId(excelRptTemp.getId());
|
||||
excelRpt.setContent(newContent);
|
||||
excelRpt.setType(reportSearchParam.getType());
|
||||
excelRpt.setState(DataStateEnum.ENABLE.getCode());
|
||||
|
||||
excelRptMapper.insert(excelRpt);
|
||||
OutputStream toClient = null;
|
||||
try {
|
||||
toClient = new BufferedOutputStream(response.getOutputStream());
|
||||
//通过IOUtils对接输入输出流,实现文件下载
|
||||
IOUtils.copy(reportStream, toClient);
|
||||
toClient.flush();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(reportStream);
|
||||
IOUtils.closeQuietly(toClient);
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
@@ -636,99 +497,6 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
return unit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装influxDB查询sql,查询value并封装endlist
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
private void assSql(ReportTemplateDTO data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, ReportSearchParam reportSearchParam) {
|
||||
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
||||
|
||||
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
||||
if (InfluxDbSqlConstant.PERCENTILE.equals(method)) {
|
||||
sql.append(method)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.getTemplateName())
|
||||
.append(InfluxDbSqlConstant.NUM_95)
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS_VALUE);
|
||||
} else {
|
||||
sql.append(method)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.getTemplateName())
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS_VALUE);
|
||||
}
|
||||
|
||||
if (reportSearchParam.getResourceType() == 1) {
|
||||
sql.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.getClassId().replace("data", "day"));
|
||||
} else {
|
||||
sql.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.getClassId());
|
||||
}
|
||||
|
||||
sql.append(InfluxDbSqlConstant.WHERE)
|
||||
.append(InfluxDBTableConstant.LINE_ID)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(reportSearchParam.getLineId())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
//相别特殊处理
|
||||
if (!InfluxDBTableConstant.NO_PHASE.equals(data.getPhase())) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.PHASIC_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(data.getPhase())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
|
||||
|
||||
//data_flicker、data_fluc、data_plt 无 value_type
|
||||
if (!InfluxDBTableConstant.DATA_FLICKER.equals(data.getClassId()) && !InfluxDBTableConstant.DATA_FLUC.equals(data.getClassId()) && !InfluxDBTableConstant.DATA_PLT.equals(data.getClassId())) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.VALUE_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(data.getStatMethod())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
|
||||
//频率和频率偏差仅统计T相
|
||||
if (data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.PHASIC_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDBTableConstant.PHASE_TYPE_T)
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
//时间范围处理
|
||||
sql
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.GE).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getStartTime()).append(InfluxDbSqlConstant.START_TIME).append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.LT).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getEndTime()).append(InfluxDbSqlConstant.END_TIME).append(InfluxDbSqlConstant.QM);
|
||||
|
||||
System.out.println(sql);
|
||||
|
||||
sql.append(InfluxDbSqlConstant.TZ);
|
||||
|
||||
if (data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")) {
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
|
||||
StatisticalDataDTO statisticalDataDTO = commonService.selectBySql(sql);
|
||||
//根据不同的库表赋值
|
||||
if (Objects.isNull(statisticalDataDTO)) {
|
||||
data.setValue("/");
|
||||
} else {
|
||||
data.setValue(String.format("%.3f", statisticalDataDTO.getValue()));
|
||||
}
|
||||
endList.add(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -748,18 +516,16 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (i == data.size() - 1) {
|
||||
sql.append(method)
|
||||
sql.append("MAX")
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.NUM_95)
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS).append(InfluxDbSqlConstant.DQM)
|
||||
.append(data.get(i).getItemName()).append(InfluxDbSqlConstant.DQM);
|
||||
} else {
|
||||
sql.append(method)
|
||||
sql.append("MAX")
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.get(i).getTemplateName())
|
||||
.append(InfluxDbSqlConstant.NUM_95)
|
||||
.append(InfluxDbSqlConstant.RBK)
|
||||
.append(InfluxDbSqlConstant.AS).append(InfluxDbSqlConstant.DQM)
|
||||
.append(data.get(i).getItemName()).append(InfluxDbSqlConstant.DQM).append(StrUtil.COMMA);
|
||||
@@ -788,14 +554,10 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
}
|
||||
|
||||
sql.append(StrPool.C_SPACE);
|
||||
if (reportSearchParam.getResourceType() == 1) {
|
||||
sql.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.get(0).getClassId().replace("data", "day"));
|
||||
} else {
|
||||
sql.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.get(0).getClassId());
|
||||
}
|
||||
sql.append(StrPool.C_SPACE)
|
||||
.append(InfluxDbSqlConstant.FROM)
|
||||
.append(data.get(0).getResourceId());
|
||||
|
||||
|
||||
sql.append(InfluxDbSqlConstant.WHERE)
|
||||
.append(InfluxDBTableConstant.LINE_ID)
|
||||
@@ -815,14 +577,15 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
|
||||
//data_flicker、data_fluc、data_plt 无 value_type
|
||||
if (!InfluxDBTableConstant.DATA_FLICKER.equals(data.get(0).getClassId()) && !InfluxDBTableConstant.DATA_FLUC.equals(data.get(0).getClassId()) && !InfluxDBTableConstant.DATA_PLT.equals(data.get(0).getClassId())) {
|
||||
//if (!"r_stat_data_flicker_d".equals(data.get(0).getResourceId()) && !"r_stat_data_fluc_d".equals(data.get(0).getResourceId()) && !"r_stat_data_plt_d".equals(data.get(0).getResourceId())) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.VALUE_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(data.get(0).getStatMethod())
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
//频率和频率偏差仅统计T相
|
||||
if (data.get(0).getTemplateName().equals("freq_dev") || data.get(0).getTemplateName().equals("freq")) {
|
||||
@@ -834,29 +597,28 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
//时间范围处理
|
||||
sql
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.GE).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getStartTime()).append(InfluxDbSqlConstant.START_TIME).append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDbSqlConstant.TIME).append(InfluxDbSqlConstant.LT).append(InfluxDbSqlConstant.QM).append(reportSearchParam.getEndTime()).append(InfluxDbSqlConstant.END_TIME).append(InfluxDbSqlConstant.QM);
|
||||
|
||||
System.out.println(sql);
|
||||
|
||||
sql.append(InfluxDbSqlConstant.TZ);
|
||||
|
||||
if (data.get(0).getTemplateName().equals("freq_dev") || data.get(0).getTemplateName().equals("freq")) {
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> mapList = influxDbUtils.getMapResult(sql.toString());
|
||||
List<Map<String,Object>> mapList = SqlRunner.db().selectList(sql.toString());
|
||||
if (CollUtil.isEmpty(mapList)) {
|
||||
data = data.stream().peek(item -> item.setValue("/")).collect(Collectors.toList());
|
||||
} else {
|
||||
Map<String, Object> map = mapList.get(0);
|
||||
|
||||
|
||||
for (ReportTemplateDTO item : data) {
|
||||
if (map.containsKey(item.getItemName())) {
|
||||
double v = (Double) map.get(item.getItemName());
|
||||
if (Objects.nonNull(map) && map.containsKey(item.getItemName())) {
|
||||
double v = Double.parseDouble(map.get(item.getItemName()).toString());
|
||||
item.setValue(String.format("%.3f", v));
|
||||
|
||||
if (overLimitMap.containsKey(item.getLimitName())) {
|
||||
@@ -918,8 +680,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
|
||||
}
|
||||
//处理查日表还是分钟表
|
||||
rangeDate(reportSearchParam);
|
||||
|
||||
|
||||
long temEnd = System.currentTimeMillis();
|
||||
|
||||
@@ -941,7 +702,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
.collect(Collectors.collectingAndThen(Collectors.toCollection(
|
||||
() -> new TreeSet<>(Comparator.comparing(ReportTemplateDTO::getItemName))), ArrayList::new));
|
||||
|
||||
Map<String, List<ReportTemplateDTO>> classMap = reportTemplateDTOList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getClassId));
|
||||
Map<String, List<ReportTemplateDTO>> classMap = reportTemplateDTOList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getResourceId));
|
||||
Map<String, ReportTemplateDTO> assNoPassMap = new HashMap<>();
|
||||
classMap.forEach((classKey, templateValue) -> {
|
||||
Map<String, List<ReportTemplateDTO>> valueTypeMap = templateValue.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getStatMethod));
|
||||
@@ -958,7 +719,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlNew(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlNew(phaseVal, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||
assSqlNew(phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
||||
assSqlNew(phaseVal, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||
}
|
||||
@@ -1155,14 +916,14 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
reportTemplateDTO.setTemplateName(vItem[0]);
|
||||
reportTemplateDTO.setPhase(vItem[1].substring(0, 1));
|
||||
reportTemplateDTO.setStatMethod(vItem[2].toUpperCase());
|
||||
reportTemplateDTO.setClassId(vItem[3]);
|
||||
reportTemplateDTO.setResourceId(vItem[3]);
|
||||
reportTemplateDTO.setLimitName(vItem[4]);
|
||||
} else if (vItem.length == 4) {
|
||||
//$HA[_25]#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0]);
|
||||
reportTemplateDTO.setPhase("M");
|
||||
reportTemplateDTO.setStatMethod(vItem[1].toUpperCase());
|
||||
reportTemplateDTO.setClassId(vItem[2]);
|
||||
reportTemplateDTO.setResourceId(vItem[2]);
|
||||
reportTemplateDTO.setLimitName(vItem[3]);
|
||||
}
|
||||
|
||||
@@ -1179,7 +940,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
//$HA[_25]#B#max#classId$
|
||||
reportTemplateDTO.setTemplateName(vItem[0]);
|
||||
reportTemplateDTO.setStatMethod(vItem[1].toUpperCase());
|
||||
reportTemplateDTO.setClassId(vItem[2]);
|
||||
reportTemplateDTO.setResourceId(vItem[2]);
|
||||
}
|
||||
reportLimitList.add(reportTemplateDTO);
|
||||
} else if (v.charAt(0) == '&') {
|
||||
@@ -1199,35 +960,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取两个时间之间的天数
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/10/20
|
||||
*/
|
||||
private void rangeDate(ReportSearchParam reportSearchParam) {
|
||||
long a;
|
||||
DateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
//开始时间
|
||||
Date star = dft.parse(reportSearchParam.getStartTime());
|
||||
//结束时间
|
||||
Date endDay = dft.parse(reportSearchParam.getEndTime());
|
||||
Long starTimes = star.getTime();
|
||||
Long endTimes = endDay.getTime();
|
||||
long num = endTimes - starTimes;//时间戳相差的毫秒数
|
||||
a = num / 24 / 60 / 60 / 1000;
|
||||
if (a > 5) {
|
||||
//返回天表
|
||||
reportSearchParam.setResourceType(1);
|
||||
} else {
|
||||
//返回分钟
|
||||
reportSearchParam.setResourceType(0);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new BusinessException("时间解析出错!" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author cdf
|
||||
@@ -1245,7 +978,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
}
|
||||
|
||||
sql.append(" from ").append(reportLimitList.get(0).getClassId()).append(" where id ='").append(reportSearchParam.getLineId()).append("'");
|
||||
sql.append(" from ").append(reportLimitList.get(0).getResourceId()).append(" where id ='").append(reportSearchParam.getLineId()).append("'");
|
||||
limitMap = excelRptTempMapper.dynamicSqlMap(sql.toString());
|
||||
|
||||
for (ReportTemplateDTO item : reportLimitList) {
|
||||
|
||||
@@ -416,9 +416,9 @@ public class ReportServiceImpl implements ReportService {
|
||||
* @return
|
||||
*/
|
||||
private List<Float> reflectDataInV(List<RStatDataInharmVDPO> value, String name, String attribute) {
|
||||
Field field = null;
|
||||
Field field;
|
||||
try {
|
||||
field = RStatDataVD.class.getDeclaredField(attribute);
|
||||
field = RStatDataInharmVDPO.class.getDeclaredField(attribute);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -426,9 +426,9 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
Field finalField = field;
|
||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||
BigDecimal o = null;
|
||||
Double o;
|
||||
try {
|
||||
o = (BigDecimal) finalField.get(temp);
|
||||
o = (Double) finalField.get(temp);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.harmonic.service.upload;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.po.upload.RUploadReport;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量报表上送 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-08-07
|
||||
*/
|
||||
public interface IRUploadReportService extends IService<RUploadReport> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.harmonic.service.upload.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.harmonic.mapper.upload.RUploadReportMapper;
|
||||
import com.njcn.harmonic.pojo.po.upload.RUploadReport;
|
||||
import com.njcn.harmonic.service.upload.IRUploadReportService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量报表上送 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-08-07
|
||||
*/
|
||||
@Service
|
||||
public class RUploadReportServiceImpl extends ServiceImpl<RUploadReportMapper, RUploadReport> implements IRUploadReportService {
|
||||
|
||||
}
|
||||
@@ -56,6 +56,8 @@ logging:
|
||||
#mybatis配置信息
|
||||
mybatis-plus:
|
||||
type-aliases-package: com.njcn.harmonic.pojo
|
||||
global-config:
|
||||
enable-sql-runner: true
|
||||
|
||||
|
||||
mqtt:
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.njcn.prepare.harmonic.api.line;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.line.fallback.CoustomReportFeignClientFallbackFactory;
|
||||
import com.njcn.prepare.harmonic.api.line.fallback.CustomReportFeignClientFallbackFactory;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -16,9 +16,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
@FeignClient(
|
||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||
path = "/report",//对应controller请求类
|
||||
fallbackFactory = CoustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||
fallbackFactory = CustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||
)
|
||||
public interface CoustmReportFeignClient {
|
||||
public interface CustomReportFeignClient {
|
||||
|
||||
/**
|
||||
* 批量处理报表
|
||||
@@ -3,7 +3,7 @@ package com.njcn.prepare.harmonic.api.line.fallback;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.line.CoustmReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.line.CustomReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -20,10 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<CoustmReportFeignClient> {
|
||||
public class CustomReportFeignClientFallbackFactory implements FallbackFactory<CustomReportFeignClient> {
|
||||
|
||||
@Override
|
||||
public CoustmReportFeignClient create(Throwable throwable) {
|
||||
public CustomReportFeignClient create(Throwable throwable) {
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException)throwable.getCause();
|
||||
@@ -31,7 +31,7 @@ public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<
|
||||
}
|
||||
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CoustmReportFeignClient() {
|
||||
return new CustomReportFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
|
||||
log.error("{}异常,降级处理,异常为:{}", "生成自定义报表: ", throwable.toString());
|
||||
@@ -42,7 +42,7 @@ public class ReportController extends BaseController {
|
||||
@PostMapping("/batchReport")
|
||||
@ApiOperation("批量处理报表")
|
||||
@ApiImplicitParam(name = "reportParam", value = "查询体", required = true)
|
||||
public HttpResult<Boolean> batchReport(@RequestBody @Validated LineParam reportParam){
|
||||
public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
|
||||
String methodDescribe = getMethodDescribe("batchReport");
|
||||
reportService.batchReport(reportParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
|
||||
@@ -635,7 +635,7 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
List<RStatDataPltDPO> dataPltPOList = new ArrayList<>();
|
||||
List<RStatDataFlickerDPO> dataFlickerPOList = new ArrayList<>();
|
||||
//day表
|
||||
List<DayV> dayVList = new ArrayList<>();
|
||||
/* List<DayV> dayVList = new ArrayList<>();
|
||||
List<DayI> dayIList = new ArrayList<>();
|
||||
List<DayFlicker> dayFlickerList = new ArrayList<>();
|
||||
List<DayFluc> dayFlucList = new ArrayList<>();
|
||||
@@ -648,7 +648,7 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
List<DayHarmRateI> dayHarmRateIList = new ArrayList<>();
|
||||
List<DayInHarmI> dayInHarmIList = new ArrayList<>();
|
||||
List<DayInHarmV> dayInHarmVList = new ArrayList<>();
|
||||
List<DayPlt> dayPltList = new ArrayList<>();
|
||||
List<DayPlt> dayPltList = new ArrayList<>();*/
|
||||
|
||||
List<String> lineIds = calculatedParam.getIdList();
|
||||
//河北数据量较大,以尺寸20分片
|
||||
@@ -713,13 +713,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataVPOList.add(po1);
|
||||
DayV dayV = new DayV();
|
||||
/* DayV dayV = new DayV();
|
||||
BeanUtils.copyProperties(item, dayV);
|
||||
dayV.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayVList.add(dayV);
|
||||
dayVList.add(dayV);*/
|
||||
}
|
||||
statDataVDService.insert(dataVPOList);
|
||||
dayVMapper.insertBatch(dayVList);
|
||||
// dayVMapper.insertBatch(dayVList);
|
||||
}
|
||||
//dataI数据入库
|
||||
if (!CollectionUtils.isEmpty(list2)) {
|
||||
@@ -729,13 +729,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setTime(LocalDate.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER));
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataIPOList.add(po1);
|
||||
DayI dayI = new DayI();
|
||||
/* DayI dayI = new DayI();
|
||||
BeanUtils.copyProperties(item, dayI);
|
||||
dayI.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayIList.add(dayI);
|
||||
dayIList.add(dayI);*/
|
||||
}
|
||||
statDataIDService.insert(dataIPOList);
|
||||
dayIMapper.insertBatch(dayIList);
|
||||
//dayIMapper.insertBatch(dayIList);
|
||||
}
|
||||
//dataFlicker数据入库
|
||||
if (!CollectionUtils.isEmpty(list3)) {
|
||||
@@ -746,13 +746,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataFlickerPOList.add(po1);
|
||||
|
||||
DayFlicker dayFlicker = new DayFlicker();
|
||||
/* DayFlicker dayFlicker = new DayFlicker();
|
||||
BeanUtils.copyProperties(item, dayFlicker);
|
||||
dayFlicker.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayFlickerList.add(dayFlicker);
|
||||
dayFlickerList.add(dayFlicker);*/
|
||||
}
|
||||
statDataFlickerDService.insert(dataFlickerPOList);
|
||||
dayFlickerMapper.insertBatch(dayFlickerList);
|
||||
//dayFlickerMapper.insertBatch(dayFlickerList);
|
||||
}
|
||||
//dataFluc数据入库
|
||||
if (!CollectionUtils.isEmpty(list4)) {
|
||||
@@ -763,13 +763,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataFlucPOList.add(po1);
|
||||
|
||||
DayFluc dayFluc = new DayFluc();
|
||||
/* DayFluc dayFluc = new DayFluc();
|
||||
BeanUtils.copyProperties(item, dayFluc);
|
||||
dayFluc.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayFlucList.add(dayFluc);
|
||||
dayFlucList.add(dayFluc);*/
|
||||
}
|
||||
statDataFlucDService.insert(dataFlucPOList);
|
||||
dayFlucMapper.insertBatch(dayFlucList);
|
||||
//dayFlucMapper.insertBatch(dayFlucList);
|
||||
}
|
||||
//data_harmphasic_i数据入库
|
||||
if (!CollectionUtils.isEmpty(list5)) {
|
||||
@@ -780,13 +780,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmPhasicIPOList.add(po1);
|
||||
|
||||
DayHarmPhasicI dayHarmPhasicI = new DayHarmPhasicI();
|
||||
/* DayHarmPhasicI dayHarmPhasicI = new DayHarmPhasicI();
|
||||
BeanUtils.copyProperties(item, dayHarmPhasicI);
|
||||
dayHarmPhasicI.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmPhasicIList.add(dayHarmPhasicI);
|
||||
dayHarmPhasicIList.add(dayHarmPhasicI);*/
|
||||
}
|
||||
statDataHarmphasicIDService.insert(dataHarmPhasicIPOList);
|
||||
dayHarmPhasicIMapper.insertBatch(dayHarmPhasicIList);
|
||||
//dayHarmPhasicIMapper.insertBatch(dayHarmPhasicIList);
|
||||
}
|
||||
//data_harmphasic_v数据入库
|
||||
if (!CollectionUtils.isEmpty(list6)) {
|
||||
@@ -797,13 +797,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmPhasicVPOList.add(po1);
|
||||
|
||||
DayHarmPhasicV dayHarmPhasicV = new DayHarmPhasicV();
|
||||
/* DayHarmPhasicV dayHarmPhasicV = new DayHarmPhasicV();
|
||||
BeanUtils.copyProperties(item, dayHarmPhasicV);
|
||||
dayHarmPhasicV.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmPhasicVList.add(dayHarmPhasicV);
|
||||
dayHarmPhasicVList.add(dayHarmPhasicV);*/
|
||||
}
|
||||
statDataHarmphasicVDService.insert(dataHarmPhasicVPOList);
|
||||
dayHarmPhasicVMapper.insertBatch(dayHarmPhasicVList);
|
||||
//dayHarmPhasicVMapper.insertBatch(dayHarmPhasicVList);
|
||||
}
|
||||
//data_harmpower_p数据入库
|
||||
if (!CollectionUtils.isEmpty(list7)) {
|
||||
@@ -814,13 +814,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmPowerPPOList.add(po1);
|
||||
|
||||
DayHarmPowerP dayHarmPowerP = new DayHarmPowerP();
|
||||
/* DayHarmPowerP dayHarmPowerP = new DayHarmPowerP();
|
||||
BeanUtils.copyProperties(item, dayHarmPowerP);
|
||||
dayHarmPowerP.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmPowerPList.add(dayHarmPowerP);
|
||||
dayHarmPowerPList.add(dayHarmPowerP);*/
|
||||
}
|
||||
statDataHarmpowerPDService.insert(dataHarmPowerPPOList);
|
||||
dayHarmPowerPMapper.insertBatch(dayHarmPowerPList);
|
||||
//dayHarmPowerPMapper.insertBatch(dayHarmPowerPList);
|
||||
}
|
||||
//data_harmpower_q数据入库
|
||||
if (!CollectionUtils.isEmpty(list8)) {
|
||||
@@ -831,13 +831,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmPowerQPOList.add(po1);
|
||||
|
||||
DayHarmPowerQ dayHarmPowerQ = new DayHarmPowerQ();
|
||||
/* DayHarmPowerQ dayHarmPowerQ = new DayHarmPowerQ();
|
||||
BeanUtils.copyProperties(item, dayHarmPowerQ);
|
||||
dayHarmPowerQ.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmPowerQList.add(dayHarmPowerQ);
|
||||
dayHarmPowerQList.add(dayHarmPowerQ);*/
|
||||
}
|
||||
statDataHarmpowerQDService.insert(dataHarmPowerQPOList);
|
||||
dayHarmPowerQMapper.insertBatch(dayHarmPowerQList);
|
||||
//dayHarmPowerQMapper.insertBatch(dayHarmPowerQList);
|
||||
}
|
||||
//data_harmpower_s数据入库
|
||||
if (!CollectionUtils.isEmpty(list9)) {
|
||||
@@ -848,13 +848,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmPowerSPOList.add(po1);
|
||||
|
||||
DayHarmPowerS dayHarmPowerS = new DayHarmPowerS();
|
||||
/* DayHarmPowerS dayHarmPowerS = new DayHarmPowerS();
|
||||
BeanUtils.copyProperties(item, dayHarmPowerS);
|
||||
dayHarmPowerS.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmPowerSList.add(dayHarmPowerS);
|
||||
dayHarmPowerSList.add(dayHarmPowerS);*/
|
||||
}
|
||||
statDataHarmpowerSDService.insert(dataHarmPowerSPOList);
|
||||
dayHarmPowerSMapper.insertBatch(dayHarmPowerSList);
|
||||
//dayHarmPowerSMapper.insertBatch(dayHarmPowerSList);
|
||||
}
|
||||
//data_harmrate_i数据入库
|
||||
if (!CollectionUtils.isEmpty(list10)) {
|
||||
@@ -865,13 +865,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmRateIPOList.add(po1);
|
||||
|
||||
DayHarmRateI dayHarmRateI = new DayHarmRateI();
|
||||
/* DayHarmRateI dayHarmRateI = new DayHarmRateI();
|
||||
BeanUtils.copyProperties(item, dayHarmRateI);
|
||||
dayHarmRateI.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmRateIList.add(dayHarmRateI);
|
||||
dayHarmRateIList.add(dayHarmRateI);*/
|
||||
}
|
||||
statDataHarmRateIDService.insert(dataHarmRateIPOList);
|
||||
dayHarmRateIMapper.insertBatch(dayHarmRateIList);
|
||||
//dayHarmRateIMapper.insertBatch(dayHarmRateIList);
|
||||
}
|
||||
//data_harmrate_v数据入库
|
||||
if (!CollectionUtils.isEmpty(list11)) {
|
||||
@@ -882,13 +882,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataHarmRateVPOList.add(po1);
|
||||
|
||||
DayHarmRateV dayHarmRateV = new DayHarmRateV();
|
||||
/* DayHarmRateV dayHarmRateV = new DayHarmRateV();
|
||||
BeanUtils.copyProperties(item, dayHarmRateV);
|
||||
dayHarmRateV.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayHarmRateVList.add(dayHarmRateV);
|
||||
dayHarmRateVList.add(dayHarmRateV);*/
|
||||
}
|
||||
statDataHarmRateVDService.insert(dataHarmRateVPOList);
|
||||
dayHarmRateVMapper.insertBatch(dayHarmRateVList);
|
||||
//dayHarmRateVMapper.insertBatch(dayHarmRateVList);
|
||||
}
|
||||
//data_inharm_i数据入库
|
||||
if (!CollectionUtils.isEmpty(list12)) {
|
||||
@@ -899,13 +899,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataInHarmIPOList.add(po1);
|
||||
|
||||
DayInHarmI dayInHarmI = new DayInHarmI();
|
||||
/* DayInHarmI dayInHarmI = new DayInHarmI();
|
||||
BeanUtils.copyProperties(item, dayInHarmI);
|
||||
dayInHarmI.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayInHarmIList.add(dayInHarmI);
|
||||
dayInHarmIList.add(dayInHarmI);*/
|
||||
}
|
||||
statDataInharmIDService.insert(dataInHarmIPOList);
|
||||
dayInHarmIMapper.insertBatch(dayInHarmIList);
|
||||
//dayInHarmIMapper.insertBatch(dayInHarmIList);
|
||||
}
|
||||
//data_inharm_v数据入库
|
||||
if (!CollectionUtils.isEmpty(list13)) {
|
||||
@@ -916,13 +916,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataInHarmVPOList.add(po1);
|
||||
|
||||
DayInHarmV dayInHarmV = new DayInHarmV();
|
||||
/* DayInHarmV dayInHarmV = new DayInHarmV();
|
||||
BeanUtils.copyProperties(item, dayInHarmV);
|
||||
dayInHarmV.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayInHarmVList.add(dayInHarmV);
|
||||
dayInHarmVList.add(dayInHarmV);*/
|
||||
}
|
||||
statDataInharmVDService.insert(dataInHarmVPOList);
|
||||
dayInHarmVMapper.insertBatch(dayInHarmVList);
|
||||
//dayInHarmVMapper.insertBatch(dayInHarmVList);
|
||||
}
|
||||
//data_plt数据入库
|
||||
if (!CollectionUtils.isEmpty(list16)) {
|
||||
@@ -933,13 +933,13 @@ public class DayDataServiceImpl implements DayDataService {
|
||||
po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
|
||||
dataPltPOList.add(po1);
|
||||
|
||||
DayPlt dayPlt = new DayPlt();
|
||||
/* DayPlt dayPlt = new DayPlt();
|
||||
BeanUtils.copyProperties(item, dayPlt);
|
||||
dayPlt.setTime(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_FORMATTER).toInstant());
|
||||
dayPltList.add(dayPlt);
|
||||
dayPltList.add(dayPlt);*/
|
||||
}
|
||||
statDataPltDService.insert(dataPltPOList);
|
||||
dayPltMapper.insertBatch(dayPltList);
|
||||
//dayPltMapper.insertBatch(dayPltList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,13 +49,14 @@ liteflow:
|
||||
logging:
|
||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||
level:
|
||||
root: info
|
||||
root: error
|
||||
|
||||
|
||||
##mybatis配置信息
|
||||
mybatis-plus:
|
||||
#别名扫描
|
||||
type-aliases-package: com.njcn.prepare.harmonic.pojo
|
||||
|
||||
global-config:
|
||||
enable-sql-runner: true
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
|
||||
@@ -23,6 +23,7 @@ public enum SupervisionResponseEnum {
|
||||
NO_POWER("A00550","不能操作非自己创建的任务!"),
|
||||
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
||||
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
||||
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
package com.njcn.supervision.pojo.dto;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/5/10 18:16【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SupervisionDevMainReportExcel {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工程预期投产日期
|
||||
*/
|
||||
@Excel(name = "*工程预期投产日期", width = 30)
|
||||
@NotBlank(message = "不能为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate expectedProductionDate;
|
||||
|
||||
/**
|
||||
* 所属地市
|
||||
*/
|
||||
@Excel(name = "*所属地市", width = 30)
|
||||
@NotBlank(message = "所属地市不能为空")
|
||||
private String city;
|
||||
|
||||
|
||||
//------------------------基本信息---------------------------------------------
|
||||
|
||||
/**
|
||||
* 并网变电站
|
||||
*/
|
||||
@Excel(name = "*所属变电站名称", width = 30)
|
||||
@NotBlank(message = "所属变电站名称不能为空")
|
||||
private String substation;
|
||||
|
||||
/**
|
||||
* 所属供电公司
|
||||
*/
|
||||
@Excel(name = "*所属供电公司", width = 30)
|
||||
@NotBlank(message = "所属供电公司不能为空")
|
||||
private String powerCompany;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
@Excel(name = "*终端型号", width = 30)
|
||||
@NotBlank(message = "终端型号不能为空")
|
||||
private String terminalType;
|
||||
|
||||
|
||||
/**
|
||||
* 监测终端名称
|
||||
*/
|
||||
@Excel(name = "*终端名称", width = 30)
|
||||
@NotBlank(message = "终端名称不能为空")
|
||||
private String monitoringTerminalName;
|
||||
|
||||
|
||||
/**
|
||||
* 通讯类型
|
||||
*/
|
||||
@Excel(name = "*通讯类型", width = 30)
|
||||
@NotBlank(message = "通讯类型不能为空")
|
||||
private String frontType;
|
||||
|
||||
/**
|
||||
* 监测终端编码
|
||||
*/
|
||||
@Excel(name = "*监测终端编码", width = 30)
|
||||
@NotBlank(message = "监测终端编码不能为空")
|
||||
private String monitoringTerminalCode;
|
||||
|
||||
/**
|
||||
* 终端IP
|
||||
*/
|
||||
@Excel(name = "*终端IP", width = 30)
|
||||
@NotBlank(message = "*终端IP不能为空")
|
||||
private String terminalIp;
|
||||
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
@Excel(name = "*端口", width = 30)
|
||||
@NotBlank(message = "*端口不能为空")
|
||||
private String terminalPort;
|
||||
|
||||
/**
|
||||
* 投运时间
|
||||
*/
|
||||
@Excel(name = "*投运时间", width = 30)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@NotBlank(message = "投运时间不能为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime commissioningTime;
|
||||
|
||||
/**
|
||||
* 数据更新时间
|
||||
*/
|
||||
@Excel(name = "数据更新时间", width = 30)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dataUpdateTime;
|
||||
|
||||
/**
|
||||
* 所属前置机
|
||||
*/
|
||||
@Excel(name = "*所属前置机", width = 30)
|
||||
@NotBlank(message = "所属前置机不能为空")
|
||||
private String frontEndMachine;
|
||||
|
||||
/**
|
||||
* 监测终端安装位置
|
||||
*/
|
||||
@Excel(name = "*监测终端安装位置", width = 30, replace = {"电网侧_0", "用户侧_1", "_0"})
|
||||
@NotBlank(message = "监测终端安装位置不能为空")
|
||||
private String monitoringDeviceInstallationPosition;
|
||||
|
||||
/**
|
||||
* 识别码
|
||||
*/
|
||||
@Excel(name = "识别码", width = 30)
|
||||
private String identificationCode;
|
||||
|
||||
/**
|
||||
* 终端秘钥
|
||||
*/
|
||||
@Excel(name = "终端秘钥", width = 30)
|
||||
private String terminalSecretKey;
|
||||
|
||||
/**
|
||||
* 终端模型
|
||||
*/
|
||||
@Excel(name = "终端模型", width = 30, replace = {"虚拟终端_0", "实际终端_1", "离线_2", "_1"})
|
||||
private String terminalModel;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
@Excel(name = "数据类型", width = 30, replace = {"暂态系统_0", "稳态系统_1", "两个系统_2", "_2"})
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 终端接线方式类型
|
||||
*/
|
||||
@Excel(name = "*终端接线方式类型", width = 30)
|
||||
@NotBlank(message = "终端接线方式类型不能为空")
|
||||
private String terminalWiringMethodType;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
@Excel(name = "*厂家", width = 30)
|
||||
@NotBlank(message = "厂家不能为空")
|
||||
private String manufacturer;
|
||||
|
||||
|
||||
/**
|
||||
* 本次终端检测时间
|
||||
*/
|
||||
@Excel(name = "*本次终端检测时间", width = 30)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@NotBlank(message = "本次终端检测时间不能为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime currentTerminalDetectionTime;
|
||||
|
||||
|
||||
/**
|
||||
* 电压互感器类型
|
||||
*/
|
||||
@Excel(name = "*电压互感器类型", width = 30)
|
||||
@NotBlank(message = "*电压互感器类型不能为空")
|
||||
private String voltageTransformerType;
|
||||
|
||||
|
||||
/**
|
||||
* 中性点接线方式
|
||||
*/
|
||||
@Excel(name = "*中性点接线方式", width = 30)
|
||||
@NotBlank(message = "中性点接线方式不能为空")
|
||||
private String neutralPointWiringMethod;
|
||||
|
||||
|
||||
/**
|
||||
* 厂家终端编号
|
||||
*/
|
||||
@Excel(name = "*厂家终端编号", width = 30)
|
||||
@NotBlank(message = "厂家终端编号不能为空")
|
||||
private String manufacturerDeviceNumber;
|
||||
|
||||
|
||||
/**
|
||||
* SIM卡号
|
||||
*/
|
||||
@Excel(name = "SIM卡号", width = 30)
|
||||
@NotBlank(message = "不能为空")
|
||||
private String simCardNumber;
|
||||
|
||||
/**
|
||||
* 对时功能
|
||||
*/
|
||||
@Excel(name = "对时功能", width = 30, replace = {"关闭_0", "开启_1", "_0"})
|
||||
private String timeSyncFunction;
|
||||
|
||||
/**
|
||||
* 电镀功能
|
||||
*/
|
||||
@Excel(name = "电镀功能", width = 30, replace = {"关闭_0", "开启_1", "_0"})
|
||||
private String electroplatingFunction;
|
||||
|
||||
|
||||
/**
|
||||
* 召换标志
|
||||
*/
|
||||
@Excel(name = "召换标志", width = 30, replace = {"周期触发_0", "变位触发_1", "_0"})
|
||||
private String summonFlag;
|
||||
|
||||
/**
|
||||
* 告警功能
|
||||
*/
|
||||
@Excel(name = "告警功能", width = 30, replace = {"否_0", "是_1", "_0"})
|
||||
private String alarmFunction;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@Excel(name = "合同号", width = 30)
|
||||
private String contractNumber;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ExcelMsg extends SupervisionDevMainReportExcel implements Serializable {
|
||||
|
||||
@Excel(name = "错误信息描述", width = 30)
|
||||
private String msg;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -51,6 +52,7 @@ public class SupervisionDevMainReportPO extends BaseEntity {
|
||||
* 工程预期投产日期
|
||||
*/
|
||||
@TableField(value = "expected_production_date")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate expectedProductionDate;
|
||||
|
||||
/**
|
||||
@@ -152,4 +154,10 @@ public class SupervisionDevMainReportPO extends BaseEntity {
|
||||
*/
|
||||
@TableField(value = "`State`")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 状态:0:系统建档 1:外部导入
|
||||
*/
|
||||
@TableField(value = "`import_type`")
|
||||
private Integer importType;
|
||||
}
|
||||
|
||||
@@ -13,17 +13,18 @@ import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -138,4 +139,20 @@ public class DeVReportManageController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping(value = "/downloadDevTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ApiOperation("下载终端台账入网模板")
|
||||
public void downloadDevTemplate() {
|
||||
supervisionDevMainReportPOService.downloadDevTemplate();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/importSensitiveUserData")
|
||||
@ApiOperation("批量导入终端台账入网")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<String> importDevrData(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importDevData");
|
||||
supervisionDevMainReportPOService.importDevData(file, response);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.njcn.supervision.service.device;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.service.IBpmService;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -38,4 +39,8 @@ public interface SupervisionDevMainReportPOService extends IBpmService<Supervisi
|
||||
List<SupervisionTempDeviceReport> getDeviceList();
|
||||
|
||||
SupervisionDevMainReportVO querySurveyDetail(String id);
|
||||
|
||||
void downloadDevTemplate();
|
||||
|
||||
void importDevData(MultipartFile file, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.njcn.supervision.service.device.impl;
|
||||
|
||||
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.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
@@ -16,10 +20,19 @@ 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.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.utils.PubUtil;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.NodeClient;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.excel.PullDown;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
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.param.device.SupervisionDevMainReportParam;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
@@ -28,22 +41,30 @@ import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
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;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/10 18:10【需求编号】
|
||||
*
|
||||
@@ -55,12 +76,13 @@ import java.util.stream.Collectors;
|
||||
public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<SupervisionDevMainReportPOMapper, SupervisionDevMainReportPO> implements SupervisionDevMainReportPOService {
|
||||
|
||||
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final NodeClient nodeClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -68,12 +90,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
|
||||
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
||||
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
||||
if(Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(),"2")){
|
||||
if(StringUtils.isEmpty(supervisionDevMainReportParam.getId())){
|
||||
if (Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(), "2")) {
|
||||
if (StringUtils.isEmpty(supervisionDevMainReportParam.getId())) {
|
||||
//设备校验ip
|
||||
checkIp(supervisionDevMainReportParam, false);
|
||||
|
||||
}else {
|
||||
} else {
|
||||
//设备校验ip
|
||||
checkIp(supervisionDevMainReportParam, true);
|
||||
|
||||
@@ -81,10 +102,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
//设置状态
|
||||
if(Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(),"1")){
|
||||
if (Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(), "1")) {
|
||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
@@ -110,7 +131,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
// supervisionTempLineReportService.save(supervisionTempLineReport);
|
||||
// 发起 BPM 流程
|
||||
// 如何未提交审则不需要发起 BPM 流程
|
||||
if(Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(),"2")) {
|
||||
if (Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(), "2")) {
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.DEVICE_INFO_ADD.getKey());
|
||||
@@ -129,10 +150,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
public String updateDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate supervisionDevMainReportParam) {
|
||||
SupervisionDevMainReportPO supervisionDevMainReportPO = this.baseMapper.selectById(supervisionDevMainReportParam.getId());
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),supervisionDevMainReportPO.getCreateBy());
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), supervisionDevMainReportPO.getCreateBy());
|
||||
supervisionDevMainReportParam.setProcessInstanceId(supervisionDevMainReportPO.getProcessInstanceId());
|
||||
supervisionDevMainReportParam.setHistoryInstanceId(supervisionDevMainReportPO.getHistoryInstanceId());
|
||||
BeanUtils.copyProperties(supervisionDevMainReportParam,supervisionDevMainReportPO);
|
||||
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
//处理历史流程id列表
|
||||
@@ -154,8 +175,6 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean auditDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate supervisionDevMainReportParamUpdate) {
|
||||
return true;
|
||||
@@ -183,13 +202,13 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
queryWrapper.eq("supervision_dev_main_report.status", supervisionDevMainReportQuery.getStatus());
|
||||
}
|
||||
if (StrUtil.isNotBlank(supervisionDevMainReportQuery.getSearchValue())) {
|
||||
queryWrapper.and(x->x
|
||||
queryWrapper.and(x -> x
|
||||
.like("dev.substation_name", supervisionDevMainReportQuery.getSearchValue())
|
||||
.or()
|
||||
.like("dev.monitoring_terminal_code", supervisionDevMainReportQuery.getSearchValue())
|
||||
.or()
|
||||
.like("dev.monitoring_terminal_name", supervisionDevMainReportQuery.getSearchValue())
|
||||
);
|
||||
);
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_dev_main_report.Create_Time",
|
||||
@@ -197,7 +216,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_dev_main_report.Update_Time");
|
||||
Page<SupervisionDevMainReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionDevMainReportQuery), PageFactory.getPageSize(supervisionDevMainReportQuery)), queryWrapper);
|
||||
page.getRecords().stream().forEach(temp->{
|
||||
page.getRecords().stream().forEach(temp -> {
|
||||
// temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||
@@ -209,7 +228,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
|
||||
@Override
|
||||
public void updateProcessStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionDevMainReportPO::getStatus,status).eq(SupervisionDevMainReportPO::getId,businessKey).update();
|
||||
this.lambdaUpdate().set(SupervisionDevMainReportPO::getStatus, status).eq(SupervisionDevMainReportPO::getId, businessKey).update();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,7 +266,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
.eq(SupervisionDevMainReportPO::getStatus, 2)
|
||||
.in(CollectionUtil.isNotEmpty(data), SupervisionDevMainReportPO::getOrgId, data)
|
||||
.list();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(SupervisionDevMainReportPO::getId).collect(Collectors.toList());
|
||||
List<SupervisionTempDeviceReport> list1 = supervisionTempDeviceReportService.lambdaQuery().in(SupervisionTempDeviceReport::getId, collect).list();
|
||||
return list1;
|
||||
@@ -260,30 +279,362 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
public SupervisionDevMainReportVO querySurveyDetail(String id) {
|
||||
SupervisionDevMainReportVO supervisionDevMainReportVO = new SupervisionDevMainReportVO();
|
||||
SupervisionDevMainReportPO byId = this.getById(id);
|
||||
BeanUtils.copyProperties(byId,supervisionDevMainReportVO);
|
||||
BeanUtils.copyProperties(byId, supervisionDevMainReportVO);
|
||||
UserVO userVO = userFeignClient.getUserById(byId.getReporter()).getData();
|
||||
supervisionDevMainReportVO.setReporter(userVO.getName());
|
||||
supervisionDevMainReportVO.setOrgName(deptFeignClient.getDeptById(byId.getOrgId()).getData().getName());
|
||||
|
||||
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
|
||||
// supervisionTempDeviceReport.setSubstation(lineFeignClient.getSubstationInfo(supervisionTempDeviceReport.getSubstation()).getData().getName());
|
||||
if(StringUtils.isNotEmpty(supervisionTempDeviceReport.getPowerCompany())){
|
||||
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(supervisionTempDeviceReport.getPowerCompany()).getData().getName());
|
||||
if (StringUtils.isNotEmpty(supervisionTempDeviceReport.getPowerCompany())) {
|
||||
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(supervisionTempDeviceReport.getPowerCompany()).getData().getName());
|
||||
}
|
||||
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
|
||||
return supervisionDevMainReportVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadDevTemplate() {
|
||||
ExportParams exportParams = new ExportParams("终端入网检测数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "终端入网检测数据信息");
|
||||
//所属地市
|
||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
||||
//所属供电公司 RequestUtil.getDeptIndex()
|
||||
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId("0d52f9f6e43ec0ee83013cd32da93f66").getData();
|
||||
//终端型号
|
||||
List<DictData> devType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
//通讯类型
|
||||
List<DictData> frontType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.FRONT_TYPE.getCode()).getData();
|
||||
//获取所有前置机
|
||||
List<Node> nodes = nodeClient.nodeAllList().getData();
|
||||
|
||||
//接线方式
|
||||
List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||
//厂家
|
||||
List<DictData> devManufacturer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
//电压互感器类型
|
||||
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||
//中性点接线方式
|
||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||
|
||||
|
||||
List<PullDown> pullDowns = new ArrayList<>();
|
||||
|
||||
PullDown pullDown;
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(1);
|
||||
pullDown.setLastCol(1);
|
||||
pullDown.setStrings(jiBeiArea.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//缺少变电站名称
|
||||
// pullDown = new PullDown();
|
||||
// pullDown.setFirstCol(2);
|
||||
// pullDown.setLastCol(2);
|
||||
// pullDown.setStrings();
|
||||
// pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(3);
|
||||
pullDown.setLastCol(3);
|
||||
pullDown.setStrings(depts.stream().map(DeptDTO::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(4);
|
||||
pullDown.setLastCol(4);
|
||||
pullDown.setStrings(devType.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(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()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(12);
|
||||
pullDown.setLastCol(12);
|
||||
pullDown.setStrings(nodes.stream().map(Node::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//监测终端安装位置 0:电网侧 1:用户侧
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(13);
|
||||
pullDown.setLastCol(13);
|
||||
pullDown.setStrings(Stream.of("电网侧", "用户侧").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//终端模型 0:虚拟终端 1:实际终端 2:离线
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(16);
|
||||
pullDown.setLastCol(16);
|
||||
pullDown.setStrings(Stream.of("实际终端", "虚拟终端", "离线").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//数据类型 0:暂态系统 1:稳态系统 2:两个系统
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(17);
|
||||
pullDown.setLastCol(17);
|
||||
pullDown.setStrings(Stream.of("两个系统", "暂态系统", "稳态系统").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(18);
|
||||
pullDown.setLastCol(18);
|
||||
pullDown.setStrings(devConnect.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(19);
|
||||
pullDown.setLastCol(19);
|
||||
pullDown.setStrings(devManufacturer.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(21);
|
||||
pullDown.setLastCol(21);
|
||||
pullDown.setStrings(voltageTransformer.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(22);
|
||||
pullDown.setLastCol(22);
|
||||
pullDown.setStrings(neutralPoint.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(25);
|
||||
pullDown.setLastCol(25);
|
||||
pullDown.setStrings(Stream.of("关闭", "开启").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(26);
|
||||
pullDown.setLastCol(26);
|
||||
pullDown.setStrings(Stream.of("关闭", "开启").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//召唤标志 0:周期触发 1:变位触发
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(27);
|
||||
pullDown.setLastCol(27);
|
||||
pullDown.setStrings(Stream.of("周期触发", "变位触发").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(28);
|
||||
pullDown.setLastCol(28);
|
||||
pullDown.setStrings(Stream.of("否", "是").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
ExcelUtil.exportExcelPullDown(exportParams, "终端入网检测数据模板.xlsx", pullDowns, SupervisionDevMainReportExcel.class, new ArrayList<>());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importDevData(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);//表头
|
||||
params.setTitleRows(1);//标题
|
||||
params.setNeedVerify(true);
|
||||
params.setStartSheetIndex(0);
|
||||
params.setSheetNum(1);
|
||||
List<SupervisionDevMainReportExcel> devExcels = new ArrayList<>();
|
||||
try {
|
||||
ExcelImportResult<SupervisionDevMainReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveUserSExcel.class, params);
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法数据.xlsx", response);
|
||||
} else {
|
||||
devExcels = sensitiveUserExcelExcelImportResult.getList();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
|
||||
}
|
||||
List<SupervisionDevMainReportExcel.ExcelMsg> devMsgList = new ArrayList<>();
|
||||
//所属地市
|
||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
||||
|
||||
//所属供电公司
|
||||
List<DeptDTO> deptS = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||
Map<String, String> deptMap = deptS.stream().collect(Collectors.toMap(DeptDTO::getName, DeptDTO::getId, (k1, k2) -> k1));
|
||||
|
||||
//终端型号
|
||||
List<DictData> devType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
//通讯类型
|
||||
List<DictData> frontType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.FRONT_TYPE.getCode()).getData();
|
||||
//获取所有前置机
|
||||
List<Node> nodes = nodeClient.nodeAllList().getData();
|
||||
Map<String, String> nodeMap = nodes.stream().collect(Collectors.toMap(Node::getName, Node::getId, (k1, k2) -> k1));
|
||||
|
||||
//接线方式
|
||||
List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||
|
||||
//厂家
|
||||
List<DictData> devManufacturer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
//电压互感器类型
|
||||
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||
//中性点接线方式
|
||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||
|
||||
SupervisionDevMainReportPO po;
|
||||
if (CollectionUtil.isNotEmpty(devExcels)) {
|
||||
for (SupervisionDevMainReportExcel dev : devExcels) {
|
||||
//todo 需要根据变电站id进行匹配
|
||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(SupervisionTempDeviceReport::getSubstation, dev.getSubstation())
|
||||
.eq(SupervisionTempDeviceReport::getTerminalIp, dev.getTerminalIp());
|
||||
List<SupervisionTempDeviceReport> list = supervisionTempDeviceReportService.getBaseMapper().selectList(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
//过滤已取消的申请和删除的
|
||||
List<String> collect = list.stream().map(SupervisionTempDeviceReport::getId).collect(Collectors.toList());
|
||||
List<SupervisionDevMainReportPO> list1 = this.lambdaQuery().in(SupervisionDevMainReportPO::getId, collect).list();
|
||||
list1 = list1.stream()
|
||||
.filter(userReportPO -> !userReportPO.getStatus().equals(FlowStatusEnum.CANCEL.getCode()))
|
||||
.filter(userReportPO -> userReportPO.getState().equals(DataStateEnum.ENABLE.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
//如果还存在,则说明有人申请过了
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
//该用户已经录入
|
||||
SupervisionDevMainReportExcel.ExcelMsg sensitiveUserExcelMsg = new SupervisionDevMainReportExcel.ExcelMsg();
|
||||
BeanUtils.copyProperties(dev, sensitiveUserExcelMsg);
|
||||
sensitiveUserExcelMsg.setMsg(dev.getTerminalIp().concat("Ip已占用"));
|
||||
devMsgList.add(sensitiveUserExcelMsg);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//基础报告信息
|
||||
po = new SupervisionDevMainReportPO();
|
||||
po.setReporter(RequestUtil.getUserIndex());
|
||||
po.setReportDate(LocalDate.now());
|
||||
po.setOrgId(RequestUtil.getDeptIndex());
|
||||
po.setExpectedProductionDate(dev.getExpectedProductionDate());
|
||||
po.setCity(PubUtil.getDicById(dev.getCity(), jiBeiArea));
|
||||
po.setUserStatus("1");
|
||||
// po.setAcceptanceInspectionReport();
|
||||
// po.setAcceptanceInspectionReportSingle();
|
||||
// po.setTypeExperimentReport();
|
||||
// po.setFactoryInspectionReport();
|
||||
// po.setPerformanceTestReport();
|
||||
// po.setInformationSecurityTestReport();
|
||||
// po.setOtherAttachments();
|
||||
po.setImportType(1);
|
||||
po.setStatus(2);
|
||||
po.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(po);
|
||||
//终端基础信息
|
||||
StringBuilder msg = new StringBuilder();
|
||||
SupervisionTempDeviceReport devDetails = new SupervisionTempDeviceReport();
|
||||
devDetails.setId(po.getId());
|
||||
if(deptMap.containsKey(dev.getPowerCompany())){
|
||||
devDetails.setPowerCompany(deptMap.get(dev.getPowerCompany()));
|
||||
}else{
|
||||
msg.append("所属供电公司不存在!");
|
||||
}
|
||||
//todo 需要根据变电站id进行匹配
|
||||
// devDetails.setCustomSubstationFlag();
|
||||
// devDetails.setSubstation();
|
||||
// devDetails.setSubstationName();
|
||||
// devDetails.setSubstationVoltageLevel();
|
||||
// devDetails.setLongitude();
|
||||
// devDetails.setLatitude();
|
||||
|
||||
devDetails.setMonitoringTerminalCode(dev.getMonitoringTerminalName());
|
||||
devDetails.setMonitoringTerminalName(dev.getMonitoringTerminalName());
|
||||
String dy = PubUtil.getDicById(dev.getVoltageTransformerType(), voltageTransformer);
|
||||
if(StrUtil.isNotBlank(dy)){
|
||||
devDetails.setVoltageTransformerType(dy);
|
||||
}else{
|
||||
msg.append("电压互感器类型不存在!");
|
||||
}
|
||||
String jx = PubUtil.getDicById(dev.getTerminalWiringMethodType(), devConnect);
|
||||
if(StrUtil.isNotBlank(jx)){
|
||||
devDetails.setTerminalWiringMethodType(jx);
|
||||
}else{
|
||||
msg.append("终端接线方式类型不存在!");
|
||||
}
|
||||
String zx = PubUtil.getDicById(dev.getNeutralPointWiringMethod(), neutralPoint);
|
||||
if(StrUtil.isNotBlank(zx)){
|
||||
devDetails.setNeutralPointWiringMethod(zx);
|
||||
}else{
|
||||
msg.append("中性点接线方式不存在!");
|
||||
}
|
||||
String cj = PubUtil.getDicById(dev.getManufacturer(), devManufacturer);
|
||||
if(StrUtil.isNotBlank(cj)){
|
||||
devDetails.setManufacturer(cj);
|
||||
}else{
|
||||
msg.append("厂家不存在!");
|
||||
}
|
||||
devDetails.setManufacturerDeviceNumber(dev.getManufacturerDeviceNumber());
|
||||
devDetails.setTerminalIp(dev.getTerminalIp());
|
||||
|
||||
String xh = PubUtil.getDicById(dev.getTerminalType(), devType);
|
||||
if(StrUtil.isNotBlank(xh)){
|
||||
devDetails.setTerminalType(xh);
|
||||
}else{
|
||||
msg.append("终端型号不存在!");
|
||||
}
|
||||
devDetails.setTerminalPort(dev.getTerminalPort());
|
||||
if(nodeMap.containsKey(dev.getFrontEndMachine())){
|
||||
devDetails.setFrontEndMachine(nodeMap.get(dev.getFrontEndMachine()));
|
||||
}else{
|
||||
msg.append("所属前置机不存在!");
|
||||
}
|
||||
devDetails.setCurrentTerminalDetectionTime(dev.getCurrentTerminalDetectionTime());
|
||||
devDetails.setNextTerminalInspectionTime(dev.getCurrentTerminalDetectionTime().plusYears(5));
|
||||
devDetails.setIdentificationCode(dev.getIdentificationCode());
|
||||
devDetails.setTerminalSecretKey(dev.getTerminalSecretKey());
|
||||
devDetails.setTerminalModel(dev.getTerminalModel());
|
||||
devDetails.setDataType(dev.getDataType());
|
||||
devDetails.setCommunicationStatus("0");
|
||||
devDetails.setSimCardNumber(dev.getSimCardNumber());
|
||||
devDetails.setCommissioningTime(dev.getCommissioningTime());
|
||||
devDetails.setDataUpdateTime(dev.getDataUpdateTime());
|
||||
devDetails.setTimeSyncFunction(Integer.parseInt(dev.getTimeSyncFunction()));
|
||||
devDetails.setElectroplatingFunction(Integer.parseInt(dev.getElectroplatingFunction()));
|
||||
devDetails.setMonitoringDeviceInstallationPosition(dev.getMonitoringDeviceInstallationPosition());
|
||||
devDetails.setSummonFlag(dev.getSummonFlag());
|
||||
devDetails.setAlarmFunction(dev.getAlarmFunction());
|
||||
devDetails.setContractNumber(dev.getContractNumber());
|
||||
String tx = PubUtil.getDicById(dev.getFrontType(), frontType);
|
||||
if(StrUtil.isNotBlank(tx)){
|
||||
devDetails.setFrontType(tx);
|
||||
}else{
|
||||
msg.append("通讯类型不存在!");
|
||||
}
|
||||
String string = msg.toString();
|
||||
if(StrUtil.isNotBlank(string)){
|
||||
SupervisionDevMainReportExcel.ExcelMsg sensitiveUserExcelMsg = new SupervisionDevMainReportExcel.ExcelMsg();
|
||||
BeanUtils.copyProperties(dev, sensitiveUserExcelMsg);
|
||||
sensitiveUserExcelMsg.setMsg(string);
|
||||
devMsgList.add(sensitiveUserExcelMsg);
|
||||
continue;
|
||||
}
|
||||
supervisionTempDeviceReportService.saveOrUpdate(devDetails);
|
||||
}
|
||||
}
|
||||
//判断有没有错误信息
|
||||
if (CollectionUtil.isNotEmpty(devMsgList)) {
|
||||
ExcelUtil.exportExcel("失败列表.xlsx", SupervisionDevMainReportExcel.ExcelMsg.class, devMsgList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 判断设备ip是否重复,如果重复提示
|
||||
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @return: void
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/11
|
||||
*/
|
||||
* @Description: 判断设备ip是否重复,如果重复提示
|
||||
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @return: void
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/11
|
||||
*/
|
||||
private void checkIp(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
|
||||
//如果保存不填ip则不校验
|
||||
if(!StringUtils.isEmpty(supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp())) {
|
||||
if (!StringUtils.isEmpty(supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp())) {
|
||||
|
||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
@@ -293,12 +644,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
if (isExcludeSelf) {
|
||||
if (supervisionDevMainReportParam instanceof SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) {
|
||||
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
|
||||
}else {
|
||||
} else {
|
||||
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, (supervisionDevMainReportParam).getId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
List<SupervisionTempDeviceReport> list = supervisionTempDeviceReportService.getBaseMapper().selectList(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
|
||||
@@ -757,7 +757,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
// for (String s : indexArr) {
|
||||
// indexList.add(PubUtil.getDicById(s, problemIndicators));
|
||||
// }
|
||||
userReportSensitivePO.setEnergyQualityIndex(userExcel.getEnergyQualityIndex());
|
||||
userReportSensitivePO.setEnergyQualityIndex(PubUtil.getDicById(userExcel.getEnergyQualityIndex(),problemIndicators));
|
||||
userReportSensitivePO.setEvaluationType(PubUtil.getDicById(userExcel.getEvaluationType(), evaluationType));
|
||||
userReportSensitivePO.setAntiInterferenceTest(userExcel.getAntiInterferenceTest() + "");
|
||||
userReportSensitivePO.setEvaluationChekDept(userExcel.getEvaluationChekDept());
|
||||
|
||||
@@ -67,12 +67,11 @@ public enum DicDataEnum {
|
||||
/**
|
||||
* 电压互感器类型
|
||||
*/
|
||||
Cap_V("电容式电压互感器","Cap_V"),
|
||||
Pele_V("光电式电压互感器","Pele_V"),
|
||||
A_V("A类测试电压互感器","A_V"),
|
||||
Elec_V("电子式电压互感器","Elec_V"),
|
||||
Cap_V("电容式","Cap_V"),
|
||||
Pele_V("光电式","Pele_V"),
|
||||
Elec_V("电子式","Elec_V"),
|
||||
Other_S("其他","Other"),
|
||||
Ele_V("电磁式电压互感器","Ele_V"),
|
||||
Ele_V("电磁式","Ele_V"),
|
||||
|
||||
/**
|
||||
* 中性点接地方式
|
||||
|
||||
@@ -137,7 +137,7 @@ public enum DicDataTypeEnum {
|
||||
LOAD_LEVEL("负荷级别","load_level"),
|
||||
SUPPLY_CONDITION("供电电源情况","supply_condition"),
|
||||
|
||||
JIBEI_AREA("供电电源情况","jibei_area"),
|
||||
JIBEI_AREA("所属地市","jibei_area"),
|
||||
Major_Nonlinear_Device("主要非线性设备类型","Major_Nonlinear_Device"),
|
||||
EVALUATION_DEPT("主要非线性设备类型","evaluation_dept"),
|
||||
EVALUATION_TYPE("评估类型","Evaluation_Type"),
|
||||
|
||||
@@ -167,4 +167,9 @@ public class EleEpdPqd {
|
||||
*/
|
||||
private String formula;
|
||||
|
||||
/**
|
||||
* 二次值转一次值公式
|
||||
*/
|
||||
private String primaryFormula;
|
||||
|
||||
}
|
||||
|
||||
@@ -89,9 +89,14 @@ public class AuditController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 这个接口有毒,千万被调用
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/saveLogParam")
|
||||
@ApiOperation("筛选下拉列表参数")
|
||||
@Deprecated
|
||||
public HttpResult<LogParamVO> saveLogParam() {
|
||||
String methodDescribe = getMethodDescribe("saveLogParam");
|
||||
LogParamVO result = auditService.saveLogParam();
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.system.timer.tasks.report;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.harmonic.api.ReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.line.CustomReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 自定义报表预处理
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CustomReportRunner implements TimerTaskRunner {
|
||||
|
||||
private final CustomReportFeignClient customReportFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
LineParam lineParam = new LineParam();
|
||||
if(StrUtil.isNotBlank(date)){
|
||||
lineParam.setDataDate(date);
|
||||
}else {
|
||||
DateTime dealDate = DateUtil.yesterday();
|
||||
String end = DateUtil.format(dealDate, DatePattern.NORM_DATE_PATTERN);
|
||||
lineParam.setDataDate(end);
|
||||
}
|
||||
customReportFeignClient.batchReport(lineParam);
|
||||
}
|
||||
}
|
||||
@@ -366,8 +366,11 @@ public class UserController extends BaseController {
|
||||
String publicKey = keyMap.get("publicKey");
|
||||
String privateKey = keyMap.get("privateKey");
|
||||
String ip = request.getHeader(SecurityConstants.REQUEST_HEADER_KEY_CLIENT_REAL_IP);
|
||||
//秘钥先删除再添加
|
||||
redisUtil.delete(loginName + ip);
|
||||
|
||||
if(redisUtil.hasKey(loginName + ip)){
|
||||
//秘钥先删除再添加
|
||||
redisUtil.delete(loginName + ip);
|
||||
}
|
||||
// 保存私钥到 redis
|
||||
redisUtil.saveByKeyWithExpire(loginName + ip, privateKey, 5 * 60L);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, publicKey, methodDescribe);
|
||||
|
||||
@@ -290,9 +290,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
//fixme 存在web用户和App用户,目前先通过管理员的登录名来区分开
|
||||
} else if (Objects.equals(UserType.ADMINISTRATOR, type) && !Objects.equals(user.getLoginName(), "njcnyw")) {
|
||||
type = UserType.USER;
|
||||
} else if (Objects.equals(UserType.ADMINISTRATOR, type) && Objects.equals(user.getLoginName(), "njcnyw")) {
|
||||
type = UserType.APP;
|
||||
} else if (Objects.equals(UserType.USER, type) || Objects.equals(UserType.APP, type)) {
|
||||
}
|
||||
// else if (Objects.equals(UserType.ADMINISTRATOR, type) && Objects.equals(user.getLoginName(), "njcnyw")) {
|
||||
// type = UserType.APP;
|
||||
// }
|
||||
else if (Objects.equals(UserType.USER, type) || Objects.equals(UserType.APP, type)) {
|
||||
return page;
|
||||
}
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
|
||||
Reference in New Issue
Block a user