Compare commits
5 Commits
2025-10
...
340ba18f99
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
340ba18f99 | ||
|
|
e320685af1 | ||
|
|
400b9fd9c1 | ||
|
|
ce0b9892c2 | ||
| 2fb11ecaaf |
@@ -35,12 +35,6 @@
|
|||||||
<artifactId>common-microservice</artifactId>
|
<artifactId>common-microservice</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>user-api</artifactId>
|
<artifactId>user-api</artifactId>
|
||||||
@@ -59,6 +53,12 @@
|
|||||||
<artifactId>common-device-biz</artifactId>
|
<artifactId>common-device-biz</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -48,4 +49,14 @@ public interface CsLineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/updateLineDataByList")
|
@PostMapping("/updateLineDataByList")
|
||||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
||||||
|
|
||||||
|
@PostMapping("/getLineByName")
|
||||||
|
HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName);
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getAllLine")
|
||||||
|
HttpResult<List<String>> getAllLine();
|
||||||
|
|
||||||
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
|
HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -86,6 +87,23 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> getAllLine() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取所有监测点id",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<Overlimit>> getOverLimitData(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据监测点id集合获取国标限值异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLinePO>> getLineByName(String lineName) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据名称查询监测点异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,4 +122,14 @@ public class CsLinePO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "line_no")
|
@TableField(value = "line_no")
|
||||||
private Integer lineNo;
|
private Integer lineNo;
|
||||||
|
/**
|
||||||
|
* 监测对象类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "monitor_obj")
|
||||||
|
private String monitorObj;
|
||||||
|
/**
|
||||||
|
* 是否治理(0:未治理 1:已治理)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_govern")
|
||||||
|
private Integer govern;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -88,11 +88,6 @@
|
|||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.5</version>
|
<version>5.8.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- zxing生成二维码 -->
|
<!-- zxing生成二维码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -153,12 +148,21 @@
|
|||||||
<artifactId>access-api</artifactId>
|
<artifactId>access-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-mq</artifactId>
|
<artifactId>common-mq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
</dependency>
|
||||||
</dependency>
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn.platform</groupId>
|
||||||
|
<artifactId>message-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
|||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csdevice.service.ICsGroupService;
|
import com.njcn.csdevice.service.ICsGroupService;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -21,6 +23,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -143,5 +146,15 @@ public class CsGroupController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/trendData")
|
||||||
|
@ApiOperation("查询趋势数据")
|
||||||
|
@ApiImplicitParam(name = "param",required = true)
|
||||||
|
public HttpResult<List<ThdDataVO>> trendData(@RequestBody @Validated TrendDataQueryParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("trendData");
|
||||||
|
List<ThdDataVO> list = csGroupService.trendData(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,12 +136,12 @@ public class CslineController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getOverLimitData")
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
@ApiOperation("根据监测点id获取国标限值")
|
@ApiOperation("根据监测点id集合获取国标限值")
|
||||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||||
Overlimit result = overlimitMapper.selectById(id);
|
List<Overlimit> result = overlimitMapper.selectBatchIds(ids);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,4 +220,33 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getAllLine")
|
||||||
|
@ApiOperation("获取系统中所有监测点id")
|
||||||
|
public HttpResult<List<String>> getAllLine(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllLine");
|
||||||
|
List<String> list = csLinePOService.getAllLine();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getLineByName")
|
||||||
|
@ApiOperation("根据名称获取监测点")
|
||||||
|
@ApiImplicitParam(name = "lineName", value = "监测点名称", required = true)
|
||||||
|
public HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineByName");
|
||||||
|
List<CsLinePO> list = csLinePOService.getLineByName(lineName);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询监测点列表")
|
||||||
|
public HttpResult<List<CsLinePO>> list() {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
List<CsLinePO> list = csLinePOService.list(new LambdaQueryWrapper<CsLinePO>().orderByAsc(CsLinePO::getName));
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,6 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CsLinePO> getLineByName(String lineName);
|
List<CsLinePO> getLineByName(String lineName);
|
||||||
|
|
||||||
|
List<String> getAllLine();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import com.njcn.csdevice.pojo.po.CsGroup;
|
|||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -78,4 +78,11 @@ public interface ICsGroupService extends IService<CsGroup> {
|
|||||||
*/
|
*/
|
||||||
void deleteGroup(String groupId);
|
void deleteGroup(String groupId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.njcn.csharmonic.api.EventFeignClient;
|
|||||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -784,6 +785,153 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam) {
|
||||||
|
List<ThdDataVO> result = new ArrayList();
|
||||||
|
CsLinePO finalCsLinePO = csLineFeignClient.getById(trendDataQueryParam.getLineId()).getData();
|
||||||
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||||
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
|
Double ct = finalCsLinePO.getCtRatio();
|
||||||
|
Double pt = finalCsLinePO.getPtRatio();
|
||||||
|
if(CollectionUtil.isNotEmpty(trendDataQueryParam.getList())) {
|
||||||
|
for (TrendDataQueryParam param : trendDataQueryParam.getList()) {
|
||||||
|
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||||
|
for (EleEpdPqd epdPqd : eleEpdPqds) {
|
||||||
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
|
commonQueryParam.setLineId(finalCsLinePO.getLineId());
|
||||||
|
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||||
|
commonQueryParam.setColumnName(epdPqd.getName() + (StringUtils.isEmpty(param.getFrequency()) ? "" : "_" + param.getFrequency()));
|
||||||
|
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||||
|
|
||||||
|
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(trendDataQueryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(trendDataQueryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
|
||||||
|
commonQueryParam.setDataType(trendDataQueryParam.getValueType());
|
||||||
|
|
||||||
|
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(finalCsLinePO.getLineId()));
|
||||||
|
|
||||||
|
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(Collections.singletonList(commonQueryParam));
|
||||||
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
|
String unit;
|
||||||
|
ThdDataVO vo = new ThdDataVO();
|
||||||
|
vo.setLineId(temp.getLineId());
|
||||||
|
vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType());
|
||||||
|
String position = finalCsLinePO.getPosition();
|
||||||
|
vo.setPosition(position);
|
||||||
|
vo.setTime(temp.getTime());
|
||||||
|
vo.setStatMethod(temp.getValueType());
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
if (temp.getValue() != null) {
|
||||||
|
double re = 0;
|
||||||
|
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||||
|
re = Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue() / 1000));
|
||||||
|
vo.setStatisticalData(re);
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue())));
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() * pt / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() * ct;
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() * pt * ct / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() / pt;
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() / ct;
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() / pt / ct;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
}
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(null);
|
||||||
|
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setUnit(unit);
|
||||||
|
vo.setStatisticalIndex(epdPqd.getId());
|
||||||
|
vo.setStatisticalName(epdPqd.getName());
|
||||||
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
result.addAll(collect1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
||||||
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,16 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
return this.lambdaQuery().like(CsLinePO::getName,lineName).list();
|
return this.lambdaQuery().like(CsLinePO::getName,lineName).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAllLine() {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(CsLinePO::getStatus, 1)
|
||||||
|
.list()
|
||||||
|
.stream()
|
||||||
|
.map(CsLinePO::getLineId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||||
// *
|
// *
|
||||||
|
|||||||
@@ -88,11 +88,13 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
|||||||
devNameListString = "[" + item.getDeviceName() + "]";
|
devNameListString = "[" + item.getDeviceName() + "]";
|
||||||
}
|
}
|
||||||
if (item.getIsReceived() == 0) {
|
if (item.getIsReceived() == 0) {
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备未收到应答";
|
||||||
//将cs_terminal_logs数据置为未发送
|
//将cs_terminal_logs数据置为未发送
|
||||||
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
||||||
} else {
|
} else if (item.getIsReceived() == 1){
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
||||||
|
} else {
|
||||||
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
||||||
}
|
}
|
||||||
result.add(key);
|
result.add(key);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role,"bxs_user")){
|
} else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role,"bxs_user")){
|
||||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||||
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class InfluxDbParamUtil {
|
|||||||
//如果是云前置设备,直接返回clDid
|
//如果是云前置设备,直接返回clDid
|
||||||
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
||||||
if(isCLdDevice){
|
if(isCLdDevice){
|
||||||
// return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
||||||
}
|
}
|
||||||
//之后的逻辑还是按照原来的不变
|
//之后的逻辑还是按照原来的不变
|
||||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TrendDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点")
|
||||||
|
@NotBlank(message = "监测点ID不可为空")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<TrendDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
@TableField(value = "`status`")
|
@TableField(value = "`status`")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
public static final String COL_ID = "id";
|
public static final String COL_ID = "id";
|
||||||
@@ -74,4 +75,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
public static final String COL_UPDATE_BY = "update_by";
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
public static final String COL_UPDATE_TIME = "update_time";
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String SORT = "sort";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
String name = csConfigurationPO.getName();
|
String name = csConfigurationPO.getName();
|
||||||
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
if(count>1){
|
if(count>1){
|
||||||
throw new BusinessException("存在相同的组态项目名称");
|
throw new BusinessException("存在相同的组态项目名称在其他工程项目中,无法新建");
|
||||||
}
|
}
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,12 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
boolean b = this.updateById(csConfigurationPO);
|
boolean b = this.updateById(csConfigurationPO);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, auditParm.getName()).ne(CsConfigurationPO::getId,auditParm.getId()).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
|
if(count>0){
|
||||||
|
throw new BusinessException("修改名称失败,存在相同的组态项目");
|
||||||
|
}
|
||||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
||||||
|
|
||||||
List<String> projectIds = auditParm.getProjectIds();
|
List<String> projectIds = auditParm.getProjectIds();
|
||||||
if(!CollectionUtils.isEmpty(projectIds)){
|
if(!CollectionUtils.isEmpty(projectIds)){
|
||||||
String projects = String.join(",", projectIds);
|
String projects = String.join(",", projectIds);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
|||||||
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
||||||
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
||||||
eq ("status",1).
|
eq ("status",1).
|
||||||
orderByAsc(CsPagePO.COL_KID);
|
orderByAsc(CsPagePO.SORT);
|
||||||
|
|
||||||
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
||||||
List<String> collect1 = pageData.getRecords().stream().map(CsPagePO::getCreateBy).collect(Collectors.toList());
|
List<String> collect1 = pageData.getRecords().stream().map(CsPagePO::getCreateBy).collect(Collectors.toList());
|
||||||
@@ -123,7 +123,7 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
|||||||
CsPageVO csPageVO = new CsPageVO();
|
CsPageVO csPageVO = new CsPageVO();
|
||||||
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
||||||
BeanUtils.copyProperties(temp, csPageVO);
|
BeanUtils.copyProperties(temp, csPageVO);
|
||||||
csPageVO.setKId(temp.getKId());
|
// csPageVO.setKId(temp.getKId());
|
||||||
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
||||||
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
||||||
String text = new BufferedReader(
|
String text = new BufferedReader(
|
||||||
|
|||||||
Reference in New Issue
Block a user