代码提交

This commit is contained in:
2023-06-15 09:45:27 +08:00
parent f1a71e8855
commit 7bc2fe684b
4 changed files with 42 additions and 10 deletions

View File

@@ -82,4 +82,9 @@ public interface OssPath {
* 日志文件
*/
String LOGBAK = "logbak/";
/***
* 组态图元
*/
String ELEMENT = "element/";
}

View File

@@ -36,5 +36,7 @@ public class StatisticalDataDTO {
private String statisticalName;
private String target;
}

View File

@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 类的介绍:
@@ -36,7 +37,6 @@ public class EleEpdPqdParam {
private String type;
@ApiModelProperty(value = "相别")
@NotBlank(message="相别不能为空!")
private String phase;
@ApiModelProperty(value = "单位")
@@ -53,7 +53,7 @@ public class EleEpdPqdParam {
private String classId;
@ApiModelProperty(value = "数据统计方法")
private String statMethod;
private List<String> statMethod;
@ApiModelProperty(value = "系统类别")
private String systemType;
@@ -113,7 +113,10 @@ public class EleEpdPqdParam {
@EqualsAndHashCode(callSuper = true)
public static class EleEpdPqdQueryParam extends BaseParam {
@ApiModelProperty("dataType")
private String dataType;
private List<String> dataType;
@ApiModelProperty("classId")
private List<String> classId;
}
}

View File

@@ -1,5 +1,6 @@
package com.njcn.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -20,13 +21,12 @@ import com.njcn.system.service.IEleEpdPqdService;
import com.njcn.web.factory.PageFactory;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -62,6 +62,15 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
checkEleEpdPqdParam(eleEpdPqdParam,false);
EleEpdPqd eleEpdPqd = new EleEpdPqd();
BeanUtils.copyProperties(eleEpdPqdParam,eleEpdPqd);
if (CollectionUtil.isNotEmpty(eleEpdPqdParam.getStatMethod())){
eleEpdPqd.setStatMethod(String.join(",", eleEpdPqdParam.getStatMethod()));
}
if (Objects.isNull(eleEpdPqdParam.getResourcesId())){
eleEpdPqd.setResourcesId(eleEpdPqdParam.getClassId());
}
if (Objects.isNull(eleEpdPqdParam.getPhase())){
eleEpdPqd.setPhase("M");
}
eleEpdPqd.setStatus(1);
this.save(eleEpdPqd);
}
@@ -78,6 +87,15 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
checkEleEpdPqdParam(updateParam,true);
EleEpdPqd eleEpdPqd = new EleEpdPqd();
BeanUtils.copyProperties(updateParam,eleEpdPqd);
if (CollectionUtil.isNotEmpty(updateParam.getStatMethod())){
eleEpdPqd.setStatMethod(String.join(",", updateParam.getStatMethod()));
}
if (Objects.isNull(updateParam.getResourcesId())){
eleEpdPqd.setResourcesId(updateParam.getClassId());
}
if (Objects.isNull(updateParam.getPhase())){
eleEpdPqd.setPhase("M");
}
this.updateById(eleEpdPqd);
}
@@ -98,11 +116,14 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
queryWrapper.orderBy(true, queryParam.getOrderBy().equalsIgnoreCase(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
} else {
//默认根据sort排序
queryWrapper.orderBy(true, true, "Sort");
queryWrapper.orderBy(true, true, "data_type","Sort");
}
}
if (!StringUtils.isBlank(queryParam.getDataType())){
queryWrapper.eq("ele_epd_pqd.data_type", queryParam.getDataType());
if (CollectionUtil.isNotEmpty(queryParam.getDataType())){
queryWrapper.in("ele_epd_pqd.data_type", queryParam.getDataType());
}
if (CollectionUtil.isNotEmpty(queryParam.getClassId())){
queryWrapper.in("ele_epd_pqd.Class_Id", queryParam.getClassId());
}
queryWrapper.eq("ele_epd_pqd.status", 1);
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
@@ -171,7 +192,8 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
.eq(EleEpdPqd::getName, eleEpdPqdParam.getName())
.eq(EleEpdPqd::getPhase, eleEpdPqdParam.getPhase())
.eq(EleEpdPqd::getClassId,eleEpdPqdParam.getClassId())
.eq(EleEpdPqd::getDataType, eleEpdPqdParam.getDataType());
.eq(EleEpdPqd::getDataType, eleEpdPqdParam.getDataType())
.eq(EleEpdPqd::getStatus,1);
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if (eleEpdPqdParam instanceof EleEpdPqdParam.EleEpdPqdUpdateParam) {