Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6475a862c | ||
| 3bf3c65575 | |||
| 7cfbb8fb53 | |||
|
|
dce85a5f4c | ||
| 9be058b9e9 | |||
| 6a3b848dc0 | |||
|
|
396fe59b94 | ||
| e7b4117167 | |||
| 8f57310625 | |||
|
|
401195fc7b | ||
| 1d5ceca9dc | |||
| f1ad74ea2d | |||
| 0b5a3f0a32 | |||
| 3377da4ae3 | |||
|
|
b3015c2dcb | ||
| 35f1b21474 | |||
| 92ffdb1931 | |||
|
|
5b4b756fc3 | ||
|
|
c6f767b3aa | ||
|
|
ca32a4e3c6 | ||
|
|
92ddbd34a8 | ||
| 2c9d17c0ff | |||
| d681bdedfe | |||
| a904650751 | |||
|
|
04ce3eb97d | ||
| 8fc1645b04 | |||
| 2e37cf5b21 | |||
| 42c1faa5dc | |||
| 2f84ace8f1 | |||
| 5cc21b6289 | |||
| a6acf6d1c9 | |||
| ff205cb335 | |||
| b675369f7d | |||
| 9b92c1df03 | |||
| 64d2fd46e2 | |||
| 3484902147 | |||
| 739b697137 | |||
|
|
c85df36f32 | ||
|
|
a87ac5a246 | ||
|
|
91b3f63b99 | ||
| 6cd45fd7f9 | |||
| a608b3850c | |||
| 7b6099e2dc | |||
| d642ed8e52 | |||
| 568f14da96 | |||
|
|
2c8c94746e | ||
|
|
0837e38c83 | ||
|
|
c343e5765c | ||
| b49ba0e06f | |||
|
|
84321ff192 | ||
| 89e38abc00 | |||
| 8229653fb0 | |||
| 5d80582e23 | |||
|
|
7bc9cb9792 | ||
| cd4016eb1c | |||
| d7e63ec2d5 | |||
| 35d05dd3ac | |||
|
|
fad0e10203 | ||
|
|
4e8a26b1fb | ||
|
|
7a877045c9 | ||
| 23ee3b1af2 | |||
|
|
a601af9479 | ||
|
|
d3f412e2cb | ||
| b659dd055f | |||
| 66530aa5aa | |||
| 541d2ab3fe | |||
| cac6b4bdbb | |||
| a225b039fe | |||
| 0fcd67bd38 | |||
|
|
8445a08a64 | ||
|
|
3c820b1645 | ||
| 3132b0a134 | |||
| 618f1314f6 | |||
| 474a368670 | |||
|
|
a6326f574d | ||
| 7c19a21d92 | |||
|
|
dfa95fd701 | ||
|
|
09190b164b | ||
|
|
146e0e4408 | ||
| 448f76d646 | |||
| 0eeedf8f35 | |||
|
|
054fa20bab | ||
| c80e2cd825 | |||
| b3f553c450 | |||
| ef35d9bdbe | |||
| b36f4400bf | |||
| ea5bb460b4 | |||
| c84e79b789 | |||
| b62eacdbd6 | |||
| 84f16b822e | |||
| 29c1f2a530 | |||
|
|
59522c66d9 | ||
| bd153dc7b9 | |||
| 5676c736a5 | |||
|
|
e38a653e3c | ||
| 1e5dbbba19 | |||
|
|
db40090b00 | ||
| 99b56bffac | |||
|
|
04ae4f1fc1 | ||
|
|
08c5e44755 | ||
|
|
f291c85e27 | ||
|
|
38b0f20ea9 | ||
| 275a07f790 | |||
| 3bb5f91c1a | |||
| ab0b6e96c6 | |||
| da814e4bdc | |||
| 33a0ddc6f9 | |||
| ae5ca42391 |
6
pom.xml
6
pom.xml
@@ -22,7 +22,7 @@
|
||||
<module>pqs-process</module>
|
||||
<module>pqs-bpm</module>
|
||||
<module>pqs-supervision</module>
|
||||
|
||||
<module>pqs-algorithm</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
<name>灿能微服务生态系统</name>
|
||||
@@ -54,8 +54,8 @@
|
||||
<nacos.password>nacos</nacos.password>
|
||||
<!--服务器发布内容为空-->
|
||||
<!-- <nacos.namespace></nacos.namespace>-->
|
||||
<nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>
|
||||
<!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
|
||||
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
||||
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||
<!-- sentinel:port-->
|
||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||
|
||||
@@ -78,6 +78,8 @@ public enum AdvanceResponseEnum {
|
||||
MACHINE_HAS_UNIT("A0102","当前设备存在元器件"),
|
||||
|
||||
EVENT_TIME_ERROR("A0102","暂降事件时间格式有误,请检查"),
|
||||
|
||||
INVALID_FILE_TYPE("A0102","请选择CSV文件"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.njcn.advance.pojo.carrycapacity.excel;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.converters.localdatetime.LocalDateTimeStringConverter;
|
||||
import com.njcn.advance.utils.EasyExcelUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -266,17 +267,20 @@ public class CarryCapcityDataEexcel {
|
||||
private Double i25_c;
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<CarryCapcityDataEexcel> objects = EasyExcelUtil.syncReadModel("C:\\Users\\无名\\Desktop\\11.xlsx", CarryCapcityDataEexcel.class, 0,3);
|
||||
System.out.println(objects);
|
||||
// List<CarryCapcityDataEexcel> objects = EasyExcelUtil.syncReadModel("C:\\Users\\无名\\Desktop\\11.xlsx", CarryCapcityDataEexcel.class, 0,3);
|
||||
// System.out.println(objects);
|
||||
|
||||
// String sheetName = "sheetName";
|
||||
// List<CarryCapcityDataEexcel> excels = new ArrayList<>();
|
||||
// CarryCapcityDataEexcel exportHeadersExcel = new CarryCapcityDataEexcel();
|
||||
// excels.add(exportHeadersExcel);
|
||||
//
|
||||
// EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
||||
// .sheet(sheetName)
|
||||
// .doWrite(excels);
|
||||
String sheetName = "sheetName";
|
||||
List<CarryCapcityDataEexcel> excels = new ArrayList<>();
|
||||
CarryCapcityDataEexcel exportHeadersExcel = new CarryCapcityDataEexcel();
|
||||
excels.add(exportHeadersExcel);
|
||||
|
||||
EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
||||
.sheet(sheetName)
|
||||
.doWrite(excels);
|
||||
EasyExcel.write("C:\\\\Users\\\\无名\\\\Desktop\\\\22.xlsx", CarryCapcityDataEexcel.class)
|
||||
.sheet("sheetName2")
|
||||
.doWrite(excels);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ public class CarryCapacityDeviceParam {
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String devName;
|
||||
|
||||
private String devScale;
|
||||
|
||||
@@ -31,6 +31,7 @@ public class CarryCapacityUserParam {
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
|
||||
@@ -376,4 +376,9 @@ public class EasyExcelUtil {
|
||||
|
||||
return new EasyExcelWriteTool(response.getOutputStream());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Map<Integer, String>> maps = EasyExcelUtil.syncRead("C:\\Users\\无名\\Desktop\\11.xlsx");
|
||||
System.out.println(maps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,15 +56,7 @@ public class CarryCapacityController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/modelTraining")
|
||||
@ApiOperation("承载能力评估模型训练")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<CarryCapacityDataVO> modelTraining(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("modelTraining");
|
||||
CarryCapacityDataVO carryCapacityDataVO = carryCapcityService.modelTraining(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapacityDataVO, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryCarryCapacityQData")
|
||||
@@ -72,7 +64,7 @@ public class CarryCapacityController extends BaseController {
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<CarryCapacityDataQVO> queryCarryCapacityQData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("queryCarryCapacityQData");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityQData(queryParam), methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityqData(queryParam), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@@ -81,7 +73,7 @@ public class CarryCapacityController extends BaseController {
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<CarryCapacityDataIVO> queryCarryCapacityIData(@RequestBody @Validated CarryCapacityQueryDataParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("queryCarryCapacityIData");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityIData(queryParam), methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, carryCapcityService.queryCarryCapacityiData(queryParam), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
|
||||
@@ -106,6 +106,13 @@ public class SgEventController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importEventData");
|
||||
|
||||
// 检查文件MIME类型是否为csv
|
||||
String contentType = file.getContentType();
|
||||
if (!"text/csv".equals(contentType)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.INVALID_FILE_TYPE);
|
||||
}
|
||||
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);
|
||||
params.setNeedVerify(true);
|
||||
|
||||
@@ -21,9 +21,9 @@ public interface CarryCapacityService {
|
||||
|
||||
CarryCapacityDataVO queryCarryCapacityData(CarryCapacityQueryDataParam queryParam);
|
||||
|
||||
CarryCapacityDataQVO queryCarryCapacityQData(CarryCapacityQueryDataParam queryParam);
|
||||
CarryCapacityDataQVO queryCarryCapacityqData(CarryCapacityQueryDataParam queryParam);
|
||||
|
||||
CarryCapacityDataIVO queryCarryCapacityIData(CarryCapacityQueryDataParam queryParam);
|
||||
CarryCapacityDataIVO queryCarryCapacityiData(CarryCapacityQueryDataParam queryParam);
|
||||
|
||||
CarryCapacityDResultVO carryCapacityCal(CarryCapacityCalParam calParam);
|
||||
|
||||
@@ -31,7 +31,6 @@ public interface CarryCapacityService {
|
||||
|
||||
boolean uploadExcel(ExcelDataParam excelDataParam) throws Exception;
|
||||
|
||||
CarryCapacityDataVO modelTraining(CarryCapacityQueryDataParam queryParam);
|
||||
|
||||
CarryCapacityDResultVO carryCapacityEvaluate(CarryCapacityEvaluateParam calParam);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package com.njcn.advance.service.carrycapacity.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||
import com.njcn.advance.mapper.carrycapacity.CarryCapacityDevicePOMapper;
|
||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityDeviceParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityDevicePO;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityDevicePOService;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -23,6 +30,10 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateDevice(CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam deviceParam) {
|
||||
if(StringUtils.isBlank(deviceParam.getDevName())){
|
||||
throw new BusinessException("干扰源设备名称不能为空");
|
||||
}
|
||||
checkName(deviceParam,true);
|
||||
return this.lambdaUpdate().eq(CarryCapacityDevicePO::getDevId, deviceParam.getDevId())
|
||||
.set(CarryCapacityDevicePO::getDevName, deviceParam.getDevName())
|
||||
.set(CarryCapacityDevicePO::getProtocolCapacity, deviceParam.getProtocolCapacity())
|
||||
@@ -32,8 +43,38 @@ public class CarryCapacityDevicePOServiceImpl extends ServiceImpl<CarryCapacityD
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(CarryCapacityDeviceParam capacityDeviceParam) {
|
||||
CarryCapacityDevicePO carryCapacityDevicePO = new CarryCapacityDevicePO();
|
||||
BeanUtils.copyProperties(capacityDeviceParam,carryCapacityDevicePO);
|
||||
return this.save(carryCapacityDevicePO);
|
||||
if(StringUtils.isBlank(capacityDeviceParam.getDevName())){
|
||||
throw new BusinessException("干扰源设备名称不能为空");
|
||||
}
|
||||
checkName(capacityDeviceParam,false);
|
||||
|
||||
CarryCapacityDevicePO carryCapacityDevice = new CarryCapacityDevicePO();
|
||||
BeanUtils.copyProperties(capacityDeviceParam,carryCapacityDevice);
|
||||
return this.save(carryCapacityDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查名称是否已存在
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
private void checkName(CarryCapacityDeviceParam carryCapacityDeviceParam, boolean isUpdate) {
|
||||
LambdaQueryWrapper<CarryCapacityDevicePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//条件组合:where state = 1 and name = ?
|
||||
lambdaQueryWrapper.eq(CarryCapacityDevicePO::getUserId,carryCapacityDeviceParam.getUserId()).eq(CarryCapacityDevicePO::getDevName, carryCapacityDeviceParam.getDevName());
|
||||
|
||||
//and id <> ?
|
||||
if (isUpdate) {
|
||||
if (carryCapacityDeviceParam instanceof CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam) {
|
||||
lambdaQueryWrapper.ne(CarryCapacityDevicePO::getDevId, ((CarryCapacityDeviceParam.CarryCapacityDeviceUpdateParam) carryCapacityDeviceParam).getDevId());
|
||||
}
|
||||
}
|
||||
|
||||
//若存在条件数据抛出异常
|
||||
int count = this.getBaseMapper().selectCount(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("干扰源设备名称已存在");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ public class CarryCapacityResultPOServiceImpl extends ServiceImpl<CarryCapacityR
|
||||
BeanUtils.copyProperties(temp, vo);
|
||||
String[] split = temp.getUserId().split(",");
|
||||
List<String> collect1 = Arrays.stream(split).sequential().map(userId -> {
|
||||
CarryCapacityUserPO carryCapacityUserPO = carryCapacityUserPOService.queyDetailUserById(userId);
|
||||
return carryCapacityUserPO.getUserName();
|
||||
CarryCapacityUserPO carryCapacityUser = carryCapacityUserPOService.queyDetailUserById(userId);
|
||||
return carryCapacityUser.getUserName();
|
||||
}).collect(Collectors.toList());
|
||||
vo.setUserName(String.join(",", collect1));
|
||||
if (ObjectUtils.isNotEmpty(temp.getIResultList()) ){
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@ public class CarryCapacityStrategyDhlPOServiceImpl extends ServiceImpl<CarryCapa
|
||||
@Override
|
||||
public List<CarryCapacityStrategyDhlVO> queyDetailDhl() {
|
||||
List<CarryCapacityStrategyDhlPO> list = this.lambdaQuery().eq(CarryCapacityStrategyDhlPO::getUserFlag, 1).list();
|
||||
List<CarryCapacityStrategyDhlVO> collect = list.stream().map(t -> {
|
||||
return list.stream().map(t -> {
|
||||
CarryCapacityStrategyDhlVO vo = new CarryCapacityStrategyDhlVO();
|
||||
vo.setCount1(t.getCount1());
|
||||
vo.setCount2(t.getCount2());
|
||||
@@ -42,7 +42,6 @@ public class CarryCapacityStrategyDhlPOServiceImpl extends ServiceImpl<CarryCapa
|
||||
vo.setType(t.getType());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,8 +38,8 @@ public class CarryCapacityStrategyPOServiceImpl extends ServiceImpl<CarryCapacit
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean add(CarryCapacityStrategyParam carryCapacityStrategyParam) {
|
||||
CarryCapacityStrategyPO carryCapacityStrategyPO = new CarryCapacityStrategyPO();
|
||||
BeanUtils.copyProperties(carryCapacityStrategyParam, carryCapacityStrategyPO);
|
||||
CarryCapacityStrategyPO carryCapacityStrategy = new CarryCapacityStrategyPO();
|
||||
BeanUtils.copyProperties(carryCapacityStrategyParam, carryCapacityStrategy);
|
||||
//将原始策略处理为不启用
|
||||
this.lambdaUpdate().eq(CarryCapacityStrategyPO::getResult, carryCapacityStrategyParam.getResult())
|
||||
.eq(CarryCapacityStrategyPO::getId, carryCapacityStrategyParam.getId())
|
||||
@@ -56,9 +56,9 @@ public class CarryCapacityStrategyPOServiceImpl extends ServiceImpl<CarryCapacit
|
||||
//将客户对应策略删除
|
||||
this.remove(lambdaQuery);
|
||||
//新增客户策略;
|
||||
carryCapacityStrategyPO.setProtoFlag(2);
|
||||
carryCapacityStrategyPO.setUserFlag(1);
|
||||
return this.save(carryCapacityStrategyPO);
|
||||
carryCapacityStrategy.setProtoFlag(2);
|
||||
carryCapacityStrategy.setUserFlag(1);
|
||||
return this.save(carryCapacityStrategy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.advance.service.carrycapacity.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -11,7 +12,11 @@ import com.njcn.advance.pojo.carrycapacity.param.CarryCapacityUserParam;
|
||||
import com.njcn.advance.pojo.carrycapacity.po.CarryCapacityUserPO;
|
||||
import com.njcn.advance.service.carrycapacity.CarryCapacityUserPOService;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -37,29 +42,52 @@ public class CarryCapacityUserPOServiceImpl extends ServiceImpl<CarryCapacityUse
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(CarryCapacityUserParam carryCapacityUserParam) {
|
||||
CarryCapacityUserPO carryCapacityUserPO = new CarryCapacityUserPO();
|
||||
BeanUtils.copyProperties(carryCapacityUserParam, carryCapacityUserPO);
|
||||
CarryCapacityUserPO one = this.lambdaQuery().eq(CarryCapacityUserPO::getUserName, carryCapacityUserParam.getUserName()).one();
|
||||
if(Objects.nonNull(one)){
|
||||
if(StringUtils.isBlank(carryCapacityUserParam.getUserName())){
|
||||
throw new BusinessException("用户称不能为空");
|
||||
}
|
||||
checkName(carryCapacityUserParam,false);
|
||||
CarryCapacityUserPO carryCapacityUser = new CarryCapacityUserPO();
|
||||
BeanUtils.copyProperties(carryCapacityUserParam, carryCapacityUser);
|
||||
carryCapacityUser.setStatus(1);
|
||||
return this.save(carryCapacityUser);
|
||||
}
|
||||
/**
|
||||
* 检查名称是否已存在
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
private void checkName(CarryCapacityUserParam carryCapacityUserParam, boolean isUpdate) {
|
||||
LambdaQueryWrapper<CarryCapacityUserPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//条件组合:where state = 1 and name = ?
|
||||
lambdaQueryWrapper.eq(CarryCapacityUserPO::getStatus, DataStateEnum.ENABLE.getCode()).eq(CarryCapacityUserPO::getUserName, carryCapacityUserParam.getUserName());
|
||||
|
||||
//and id <> ?
|
||||
if (isUpdate) {
|
||||
if (carryCapacityUserParam instanceof CarryCapacityUserParam.CarryCapacityUserUpdateParam) {
|
||||
lambdaQueryWrapper.ne(CarryCapacityUserPO::getUserId, ((CarryCapacityUserParam.CarryCapacityUserUpdateParam) carryCapacityUserParam).getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
//若存在条件数据抛出异常
|
||||
int count = this.getBaseMapper().selectCount(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException(AdvanceResponseEnum.USER_NAME_EXIST);
|
||||
}
|
||||
carryCapacityUserPO.setStatus(1);
|
||||
boolean save = this.save(carryCapacityUserPO);
|
||||
return save;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateUser(CarryCapacityUserParam.CarryCapacityUserUpdateParam userUpdateParam) {
|
||||
CarryCapacityUserPO carryCapacityUserPO = new CarryCapacityUserPO();
|
||||
BeanUtils.copyProperties(userUpdateParam, carryCapacityUserPO);
|
||||
CarryCapacityUserPO one = this.lambdaQuery().eq(CarryCapacityUserPO::getUserName, userUpdateParam.getUserName()).ne(CarryCapacityUserPO::getUserId,userUpdateParam.getUserId()).one();
|
||||
if(Objects.nonNull(one)){
|
||||
throw new BusinessException(AdvanceResponseEnum.USER_NAME_EXIST);
|
||||
if(StringUtils.isBlank(userUpdateParam.getUserName())){
|
||||
throw new BusinessException("用户称不能为空");
|
||||
}
|
||||
checkName(userUpdateParam,false);
|
||||
CarryCapacityUserPO carryCapacityUser = new CarryCapacityUserPO();
|
||||
BeanUtils.copyProperties(userUpdateParam, carryCapacityUser);
|
||||
|
||||
boolean save = this.updateById(carryCapacityUserPO);
|
||||
return save;
|
||||
|
||||
return this.updateById(carryCapacityUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -274,6 +275,9 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||
LambdaQueryWrapper<RmpEventDetailAssPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(baseParam.getSearchValue())) {
|
||||
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
||||
}
|
||||
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
||||
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
||||
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||
|
||||
@@ -182,6 +182,7 @@ public class RadarUtil {
|
||||
* @param governYearLoss 治理后损失
|
||||
*/
|
||||
public static Double getRadarResult(Double yearLoss, Double governYearLoss) {
|
||||
// 年治理效果
|
||||
double loss = yearLoss - governYearLoss;
|
||||
if (loss == 0D || yearLoss == 0) {
|
||||
return 0D;
|
||||
|
||||
27
pqs-algorithm/algorithm-api/pom.xml
Normal file
27
pqs-algorithm/algorithm-api/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>pqs-algorithm</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>algorithm-api</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.algorithm.pojo.param;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 算法编排的计算参数
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年11月03日 09:21
|
||||
*/
|
||||
@Data
|
||||
public class CalculatedParam<T> implements Serializable {
|
||||
|
||||
/***
|
||||
* 是否全链路执行算法
|
||||
* 非全链路执行时,tag集合必须非空
|
||||
*/
|
||||
@ApiModelProperty(name = "fullChain",value = "是否全链执行")
|
||||
private boolean fullChain;
|
||||
|
||||
/**
|
||||
* 目前仅监测点日统计存在补招功能 by yxb
|
||||
* 是否补招标识,默认不补招
|
||||
*/
|
||||
@ApiModelProperty(name = "repair",value = "是否补招")
|
||||
private boolean repair;
|
||||
|
||||
/**
|
||||
* 日期_yyyy-MM-dd
|
||||
*/
|
||||
@ApiModelProperty(name = "dataDate",value = "时间日期_yyyy-MM-dd")
|
||||
private String dataDate;
|
||||
|
||||
/***
|
||||
* 需要执行的组件
|
||||
* 当不需要全链路执行时,通过tag名称动态指定执行某个算法组件
|
||||
*/
|
||||
@ApiModelProperty(name = "tagNames",value = "待执行链节点的tag集合")
|
||||
private Set<String> tagNames;
|
||||
|
||||
/**
|
||||
* 待计算的对象索引集合,监测点、设备、母线、变电站、单位下监测点等等
|
||||
*/
|
||||
@ApiModelProperty(name = "idList",value = "索引集合")
|
||||
private List<T> idList;
|
||||
}
|
||||
131
pqs-algorithm/algorithm-boot/pom.xml
Normal file
131
pqs-algorithm/algorithm-boot/pom.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>pqs-algorithm</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>algorithm-boot</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>algorithm-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>2.12.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-rule-nacos</artifactId>
|
||||
<version>2.12.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--暂态模块-->
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>event-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--稳态模块-->
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>harmonic-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>algorithmboot</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<phase>${docker.operate}</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!--<serverId>36dockerHarbor</serverId>-->
|
||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||
<!-- 镜像名称 -->
|
||||
<imageName>${docker.repostory}/${docker.registry.name}/${project.artifactId}</imageName>
|
||||
<imageTags>
|
||||
<imageTag>latest</imageTag>
|
||||
</imageTags>
|
||||
<dockerHost>${docker.url}</dockerHost>
|
||||
<dockerDirectory>${basedir}/</dockerDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/ROOT</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.algorithm;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/4 14:05
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
public class AlgorithmApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AlgorithmApplication.class,args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.algorithm.event.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 15:55
|
||||
*/
|
||||
public interface RMpEventDetailDMapper extends MppBaseMapper<RMpEventDetailD> {
|
||||
|
||||
/***
|
||||
* 处理在暂态指标明细——月报表数据获取
|
||||
* @author hongawen
|
||||
* @date 2023/11/2 10:54
|
||||
* @param lineIds 监测点集合
|
||||
* @param dataDate 统计日期
|
||||
* @param beginMonth 起始时间
|
||||
* @param endMonth 截止时间
|
||||
* @return List<RMpEventDetailDPO>
|
||||
*/
|
||||
List<RMpEventDetailM> handleMonth(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginMonth") DateTime beginMonth, @Param("endMonth") DateTime endMonth);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.algorithm.event.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/12/28 14:58【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface RMpEventDetailMMapper extends MppBaseMapper<RMpEventDetailM> {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.algorithm.event.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 15:43
|
||||
*/
|
||||
public interface RMpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
||||
|
||||
/***
|
||||
* 处理在暂态指标明细——日报表数据获取
|
||||
* @author hongawen
|
||||
* @date 2023/11/2 10:54
|
||||
* @param lineIds 监测点集合
|
||||
* @param dataDate 统计日期
|
||||
* @param beginDay 起始时间
|
||||
* @param endDay 截止时间
|
||||
* @param voltageDip 电压暂降
|
||||
* @param voltageRise 电压暂升
|
||||
* @param shortInterruptions 短时中断
|
||||
* @return List<RMpEventDetailDPO>
|
||||
*/
|
||||
List<RMpEventDetailD> handleDay(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginDay") LocalDateTime beginDay, @Param("endDay") LocalDateTime endDay, @Param("voltageDip") String voltageDip, @Param("voltageRise") String voltageRise, @Param("shortInterruptions") String shortInterruptions);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailDMapper">
|
||||
|
||||
<select id="handleMonth" resultType="com.njcn.event.pojo.po.RMpEventDetailM">
|
||||
SELECT
|
||||
#{dataDate} dataDate,
|
||||
measurement_point_id measurement_point_id,
|
||||
sum(sag_times) AS sagTimes,
|
||||
sum(swell_times) AS swellTimes,
|
||||
sum(interrupt_times) AS interruptTimes
|
||||
FROM
|
||||
r_mp_event_detail_d r_mp_event_detail_d
|
||||
where
|
||||
r_mp_event_detail_d.data_date between #{beginMonth} and #{endMonth}
|
||||
AND
|
||||
r_mp_event_detail_d.measurement_point_id IN
|
||||
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
measurement_point_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailMMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailMapper">
|
||||
|
||||
<select id="handleDay" resultType="com.njcn.event.pojo.po.RMpEventDetailD">
|
||||
SELECT
|
||||
#{dataDate} dataDate,
|
||||
measurement_point_id measurement_point_id,
|
||||
sum( event_type = #{voltageDip} ) AS sagTimes,
|
||||
sum( event_type = #{voltageRise} ) AS swellTimes,
|
||||
sum( event_type = #{shortInterruptions} ) AS interruptTimes
|
||||
FROM
|
||||
r_mp_event_detail r_mp_event_detail
|
||||
where r_mp_event_detail.start_time between #{beginDay} and #{endDay}
|
||||
AND r_mp_event_detail.measurement_point_id
|
||||
IN
|
||||
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
measurement_point_id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.algorithm.event.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 15:48
|
||||
*/
|
||||
public interface IRMpEventDetailDService extends IMppService<RMpEventDetailD> {
|
||||
|
||||
/***
|
||||
* 监测点暂态指标明细--月表算法
|
||||
* @author hongawen
|
||||
* @date 2023/11/2 11:19
|
||||
* @param calculatedParam 查询条件
|
||||
*/
|
||||
void handleMonth(CalculatedParam calculatedParam);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.algorithm.event.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 16:03
|
||||
*/
|
||||
public interface IRMpEventDetailMService extends IMppService<RMpEventDetailM> {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.algorithm.event.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 15:31
|
||||
*/
|
||||
public interface IRMpEventDetailService extends IService<RmpEventDetailPO> {
|
||||
|
||||
|
||||
/***
|
||||
* 监测点暂态指标明细--日表算法
|
||||
* @author hongawen
|
||||
* @date 2023/11/2 11:19
|
||||
* @param calculatedParam 查询条件
|
||||
*/
|
||||
void handleDay(CalculatedParam calculatedParam);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.algorithm.event.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.algorithm.event.mapper.RMpEventDetailDMapper;
|
||||
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
||||
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 15:49
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RMpEventDetailDServiceImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRMpEventDetailDService {
|
||||
|
||||
|
||||
private final IRMpEventDetailMService rMpEventDetailMService;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*监测点暂态指标明细--月表算法
|
||||
*/
|
||||
@Override
|
||||
public void handleMonth(CalculatedParam calculatedParam) {
|
||||
List<String> lineIds = calculatedParam.getIdList();
|
||||
//以尺寸1000分片
|
||||
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1000);
|
||||
DateTime beginMonth = DateUtil.beginOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||
DateTime endMonth = DateUtil.endOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||
for (List<String> pendingId : pendingIds) {
|
||||
List<RMpEventDetailM> rMpEventDetailMPOList = this.baseMapper.handleMonth(pendingId, DateUtil.format(beginMonth, DatePattern.NORM_DATE_PATTERN), beginMonth, endMonth);
|
||||
rMpEventDetailMService.saveOrUpdateBatchByMultiId(rMpEventDetailMPOList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.algorithm.event.service.impl;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.algorithm.event.mapper.RMpEventDetailMMapper;
|
||||
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/12/28 14:58【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RMpEventDetailMServiceImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRMpEventDetailMService {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.njcn.algorithm.event.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.algorithm.event.mapper.RMpEventDetailMapper;
|
||||
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
||||
import com.njcn.algorithm.event.service.IRMpEventDetailService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/4/23 13:50【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpEventDetailServiceImpl extends ServiceImpl<RMpEventDetailMapper, RmpEventDetailPO> implements IRMpEventDetailService {
|
||||
|
||||
private final IRMpEventDetailDService rMpEventDetailDService;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
|
||||
/***
|
||||
* 监测点暂态指标明细--日表算法
|
||||
*/
|
||||
@Override
|
||||
public void handleDay(CalculatedParam calculatedParam) {
|
||||
List<String> lineIds = calculatedParam.getIdList();
|
||||
//以尺寸1000分片
|
||||
List<List<String>> pendingIds = ListUtils.partition(lineIds,1000);
|
||||
LocalDateTime beginDay = LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||
LocalDateTime endDay = LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
||||
for (List<String> pendingId : pendingIds) {
|
||||
//查询
|
||||
List<RMpEventDetailD> rMpEventDetailDList = this.baseMapper.handleDay(
|
||||
pendingId
|
||||
,LocalDateTimeUtil.format(beginDay,DatePattern.NORM_DATE_PATTERN)
|
||||
,beginDay
|
||||
,endDay
|
||||
,getEventTypeId(DicDataEnum.VOLTAGE_DIP.getCode())
|
||||
,getEventTypeId(DicDataEnum.VOLTAGE_RISE.getCode())
|
||||
,getEventTypeId(DicDataEnum.SHORT_INTERRUPTIONS.getCode()));
|
||||
//入库
|
||||
rMpEventDetailDService.saveOrUpdateBatchByMultiId(rMpEventDetailDList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getEventTypeId(String code) {
|
||||
String eventType = redisUtil.getStringByKey(code);
|
||||
eventType = Optional.ofNullable(eventType).orElseGet(() -> {
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(code).getData();
|
||||
redisUtil.saveByKey(data.getCode(), data.getId());
|
||||
return data.getId();
|
||||
});
|
||||
|
||||
return eventType;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.njcn.algorithm.harmonic.line.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||
|
||||
/**
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface RMpMonitorEvaluateDMapper extends MppBaseMapper<RMpMonitorEvaluateD> {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.algorithm.harmonic.line.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/4/19 15:42【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface IRMpMonitorEvaluateDService extends IMppService<RMpMonitorEvaluateD> {
|
||||
|
||||
|
||||
/***
|
||||
* 监测点报表--日统计
|
||||
* @author hongawen
|
||||
* @date 2023/11/3 14:48
|
||||
* @param calculatedParam 查询条件
|
||||
*/
|
||||
void handleDay(CalculatedParam calculatedParam);
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package com.njcn.algorithm.harmonic.line.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper;
|
||||
import com.njcn.algorithm.harmonic.line.service.IRMpMonitorEvaluateDService;
|
||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
||||
import com.njcn.algorithm.support.mapper.PmsAbnormalRulesMapper;
|
||||
import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
||||
import com.njcn.influx.pojo.po.DataFlicker;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RMpMonitorEvaluateDServiceImpl extends MppServiceImpl<RMpMonitorEvaluateDMapper, RMpMonitorEvaluateD> implements IRMpMonitorEvaluateDService {
|
||||
|
||||
private final CommLineClient commLineClient;
|
||||
// private final DataVInfluxdbService dataVInfluxdbService;
|
||||
// private final PmsAbnormalRulesMapper pmsAbnormalRulesMapper;
|
||||
// private final DataIntegrityRateInfluxService dataIntegrityRateInfluxService;
|
||||
|
||||
/***
|
||||
* 监测点报表--日统计
|
||||
* @author hongawen
|
||||
* @date 2023/11/3 14:48
|
||||
* @param calculatedParam 查询条件
|
||||
*/
|
||||
@Override
|
||||
public void handleDay(CalculatedParam calculatedParam) {
|
||||
// //1、取出规则
|
||||
// List<PmsAbnormalRules> pmsAbnormalRules = pmsAbnormalRulesMapper.selectList(null);
|
||||
// String beginDay =LocalDateTimeUtil.format(LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
||||
// String endDay = LocalDateTimeUtil.format(LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
||||
// //以尺寸1000分片
|
||||
// List<List<String>> pendingIds = ListUtils.partition(calculatedParam.getIdList(), 100);
|
||||
// for (List<String> pendingId : pendingIds) {
|
||||
// List<LineDTO> lineDTOList = commLineClient.getLineDetailBatch(pendingId).getData();
|
||||
// List<RMpMonitorEvaluateD> rMpMonitorEvaluateDS = new ArrayList<>();
|
||||
// for (LineDTO lineDTO : lineDTOList) {
|
||||
// if (ObjectUtil.isNotNull(lineDTO)) {
|
||||
// /*todo 统计间隔,电压等级取值方式后期提供融合版本接口获取不然pms,pqs系统取值方式不一样*/
|
||||
// /*统计间隔*/
|
||||
// Integer statisticalInterval = lineDTO.getTimeInterval();
|
||||
// /*电压等级*/
|
||||
// Double voltage = Double.parseDouble(lineDTO.getVoltageLevel());
|
||||
// List<DataVFiveItemDTO> fiveItems = dataVInfluxdbService.getFiveItems(lineDTO.getLineId(), beginDay, endDay, statisticalInterval);
|
||||
// RMpMonitorEvaluateD rMpMonitorEvaluateD = new RMpMonitorEvaluateD();
|
||||
// rMpMonitorEvaluateD = calculateRMpMonitorEvaluateDPO(rMpMonitorEvaluateD, fiveItems, pmsAbnormalRules, voltage, lineDTO);
|
||||
// Date date = DateUtil.parse(beginDay);
|
||||
// DataFlicker twoFlickerData = dataIntegrityRateInfluxService.getTwoFlickerData(lineDTO.getLineId(), date, 5);
|
||||
// LocalDate localDate = LocalDateTimeUtil.parseDate(beginDay, DatePattern.NORM_DATETIME_PATTERN);
|
||||
//
|
||||
// if (Objects.isNull(twoFlickerData)) {
|
||||
// rMpMonitorEvaluateD.setPltCount(0);
|
||||
// rMpMonitorEvaluateD.setPstCount(0);
|
||||
// } else {
|
||||
// rMpMonitorEvaluateD.setPltCount(twoFlickerData.getPltCount());
|
||||
// rMpMonitorEvaluateD.setPstCount(twoFlickerData.getPstCount());
|
||||
// }
|
||||
// rMpMonitorEvaluateD.setAllMinuteCount(fiveItems.size());
|
||||
// rMpMonitorEvaluateD.setDeviceId(lineDTO.getDevId());
|
||||
// rMpMonitorEvaluateD.setDataDate(localDate);
|
||||
// rMpMonitorEvaluateD.setMeasurementPointId(lineDTO.getLineId());
|
||||
// rMpMonitorEvaluateDS.add(rMpMonitorEvaluateD);
|
||||
// }
|
||||
// }
|
||||
// if (CollUtil.isNotEmpty(rMpMonitorEvaluateDS)) {
|
||||
// this.saveOrUpdateBatchByMultiId(rMpMonitorEvaluateDS, 500);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 3、频率在【45,55】之间;
|
||||
* 4、相电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级/1.732
|
||||
* 5、线电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级
|
||||
* 6、电压总谐波畸变率在【0.1%,20%】之间;
|
||||
* 7、负序电压不平衡度在【0,20%】。满足以上条件则是一条有效数据
|
||||
* @Param: [fiveItems, pmsAbnormalRules, voltage]
|
||||
* @return: java.lang.Integer
|
||||
* @Author: clam
|
||||
* @Date: 2023/2/23
|
||||
*/
|
||||
// private RMpMonitorEvaluateD calculateRMpMonitorEvaluateDPO(RMpMonitorEvaluateD rMpMonitorEvaluateD, List<DataVFiveItemDTO> fiveItems, List<PmsAbnormalRules> pmsAbnormalRules, Double voltage, LineDTO data) {
|
||||
//
|
||||
// Integer freqCount = 0;
|
||||
// Integer unbalanceCount = 0;
|
||||
// Integer phaseVoltageCount = 0;
|
||||
// Integer lineVoltageCount = 0;
|
||||
// Integer vThdCount = 0;
|
||||
// Integer effectiveMinuteCount = 0;
|
||||
//
|
||||
// PmsAbnormalRules freqLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_FREQ)).collect(Collectors.toList()).get(0);
|
||||
// PmsAbnormalRules rmsLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS)).collect(Collectors.toList()).get(0);
|
||||
// PmsAbnormalRules rms_lvrLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS_LVR)).collect(Collectors.toList()).get(0);
|
||||
// PmsAbnormalRules v_thdLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_THD)).collect(Collectors.toList()).get(0);
|
||||
// PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_UNBALANCE)).collect(Collectors.toList()).get(0);
|
||||
// if (!CollectionUtils.isEmpty(fiveItems)) {
|
||||
// for (DataVFiveItemDTO fiveItem : fiveItems) {
|
||||
// Double freqMax = fiveItem.getFreqMax();
|
||||
// Double freqMin = fiveItem.getFreqMin();
|
||||
//
|
||||
// Double rmsMax = fiveItem.getRmsMax();
|
||||
// Double rmsMin = fiveItem.getRmsMin();
|
||||
// Double vThdMax = fiveItem.getVThdMax();
|
||||
// Double vThdMin = fiveItem.getVThdMin();
|
||||
//
|
||||
// Double vUnbalanceMax = fiveItem.getVUnbalanceMax();
|
||||
// Double vUnbalanceMin = fiveItem.getVUnbalanceMin();
|
||||
// Double rmsLvrMax = fiveItem.getRmsLvrMax();
|
||||
// Double rmsLvrMin = fiveItem.getRmsLvrMin();
|
||||
//
|
||||
// Boolean rmsflag = false;
|
||||
// Boolean rmsLvrflag = false;
|
||||
// Boolean vUnbalanceflag = false;
|
||||
//
|
||||
// freqCount++;
|
||||
// unbalanceCount++;
|
||||
// phaseVoltageCount++;
|
||||
// lineVoltageCount++;
|
||||
// vThdCount++;
|
||||
// effectiveMinuteCount++;
|
||||
// // 先注释掉 校验跑出监测点
|
||||
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit()) {
|
||||
//// freqCount++;
|
||||
//// }
|
||||
//// /*,监测点的接线方式,如果是星形接线这个指标要判断,角形界面则不判断,默认它是正常的*/
|
||||
//// if (Objects.equals("0", data.getPtType())) {
|
||||
//// if (rmsLimit.getLowerLimit() * (voltage / 1.732) <= rmsMin && rmsMax <= rmsLimit.getUpperLimit() * (voltage / 1.732)) {
|
||||
//// phaseVoltageCount++;
|
||||
//// rmsflag = true;
|
||||
//// }
|
||||
//// } else {
|
||||
//// rmsflag = true;
|
||||
//// phaseVoltageCount++;
|
||||
//// }
|
||||
//// if (Objects.equals("1", data.getPtPhaseType())) {
|
||||
//// if (rms_lvrLimit.getLowerLimit() * voltage <= rmsLvrMin && rmsLvrMax <= rms_lvrLimit.getUpperLimit() * voltage) {
|
||||
//// lineVoltageCount++;
|
||||
//// rmsLvrflag = true;
|
||||
//// }
|
||||
////
|
||||
//// } else {
|
||||
//// rmsLvrflag = true;
|
||||
//// lineVoltageCount++;
|
||||
////
|
||||
//// }
|
||||
//// if (Objects.equals("1", data.getPtPhaseType()) && Objects.equals("0", data.getPtType())) {
|
||||
//// if (v_unbalanceLimit.getLowerLimit() <= vUnbalanceMin && vUnbalanceMax <= v_unbalanceLimit.getUpperLimit()
|
||||
//// ) {
|
||||
//// unbalanceCount++;
|
||||
//// vUnbalanceflag = true;
|
||||
//// }
|
||||
//// } else {
|
||||
//// unbalanceCount++;
|
||||
//// vUnbalanceflag = true;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// if (v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit()) {
|
||||
//// vThdCount++;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit() &&
|
||||
//// rmsflag &&
|
||||
//// rmsLvrflag &&
|
||||
//// v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit() &&
|
||||
//// vUnbalanceflag
|
||||
////
|
||||
//// ) {
|
||||
//// effectiveMinuteCount++;
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// rMpMonitorEvaluateD.setEffectiveMinuteCount(effectiveMinuteCount);
|
||||
// rMpMonitorEvaluateD.setFreqCount(freqCount);
|
||||
// rMpMonitorEvaluateD.setPhaseVoltageCount(phaseVoltageCount);
|
||||
// rMpMonitorEvaluateD.setLineVoltageCount(lineVoltageCount);
|
||||
// rMpMonitorEvaluateD.setVThdCount(vThdCount);
|
||||
// rMpMonitorEvaluateD.setUnbalanceCount(unbalanceCount);
|
||||
// return rMpMonitorEvaluateD;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.algorithm.support.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
||||
|
||||
/**
|
||||
* PmsAbnormalRulesMapper
|
||||
*
|
||||
* @author qijian
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
public interface PmsAbnormalRulesMapper extends BaseMapper<PmsAbnormalRules> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.algorithm.support.mapper.PmsAbnormalRulesMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,56 @@
|
||||
#当前服务的基本信息
|
||||
microservice:
|
||||
ename: @artifactId@
|
||||
name: '@name@'
|
||||
version: @version@
|
||||
sentinel:
|
||||
url: @sentinel.url@
|
||||
gateway:
|
||||
url: @gateway.url@
|
||||
server:
|
||||
port: 10223
|
||||
#feign接口开启服务熔断降级处理
|
||||
feign:
|
||||
sentinel:
|
||||
enabled: true
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: @artifactId@
|
||||
#nacos注册中心以及配置中心的指定
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: @service.server.url@
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
liteflow:
|
||||
rule-source: config/liteflow.el.xml
|
||||
# rule-source-ext-data-map:
|
||||
# serverAddr: @nacos.url@
|
||||
# dataId: prepare_liteflow
|
||||
# group: DEFAULT_GROUP
|
||||
# namespace: @nacos.namespace@
|
||||
when-max-wait-time: 600000
|
||||
print-banner: false
|
||||
|
||||
|
||||
#项目日志的配置
|
||||
logging:
|
||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||
level:
|
||||
root: error
|
||||
|
||||
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<chain name="measurement_point">
|
||||
THEN(
|
||||
rMpSurplusAbnormalD
|
||||
);
|
||||
</chain>
|
||||
<chain name="org_point">
|
||||
THEN(
|
||||
WHEN(rDimBusbarHarmnic.tag("r_dim_busbar_harmnic_d")),
|
||||
rOperatingIndex.tag("r_operating_index_d"),
|
||||
rOperatingIndex.tag("r_operating_index_m"),
|
||||
rOperatingIndex.tag("r_operating_index_q"),
|
||||
rOperatingIndex.tag("r_operating_index_y"),
|
||||
rStatOrg.tag("r_stat_org_d"),
|
||||
rStatOrg.tag("r_stat_org_m"),
|
||||
rStatOrg.tag("r_stat_org_q"),
|
||||
rStatOrg.tag("r_stat_org_y"),
|
||||
rStatPollutionOrg.tag("r_stat_pollution_org_d"),
|
||||
rStatPollutionOrg.tag("r_stat_pollution_org_m"),
|
||||
rStatPollutionOrg.tag("r_stat_pollution_org_q"),
|
||||
rStatPollutionOrg.tag("r_stat_pollution_org_y"),
|
||||
rStatHarmonic.tag("r_stat_harmonic_d"),
|
||||
rStatHarmonic.tag("r_stat_harmonic_m"),
|
||||
rStatHarmonic.tag("r_stat_harmonic_q"),
|
||||
rStatHarmonic.tag("r_stat_harmonic_y"),
|
||||
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_d"),
|
||||
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_m"),
|
||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_d"),
|
||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_m"),
|
||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_q"),
|
||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_y"),
|
||||
rStatEvent.tag("r_stat_event_d"),
|
||||
rStatEvent.tag("r_stat_event_m"),
|
||||
rStatEvent.tag("r_stat_event_q"),
|
||||
rStatEvent.tag("r_stat_event_y"),
|
||||
rStatEventVoltage.tag("r_stat_event_voltage_d"),
|
||||
rStatEventVoltage.tag("r_stat_event_voltage_m"),
|
||||
rStatEventOrg.tag("r_stat_event_org_d"),
|
||||
rStatEventOrg.tag("r_stat_event_org_m"),
|
||||
rStatEventOrg.tag("r_stat_event_org_q"),
|
||||
rStatEventOrg.tag("r_stat_event_org_y"),
|
||||
rStatEventLoadType.tag("r_stat_load_type_d"),
|
||||
rStatEventLoadType.tag("r_stat_load_type_m"),
|
||||
rStatEventLoadType.tag("r_stat_load_type_q"),
|
||||
rStatEventLoadType.tag("r_stat_load_type_y"),
|
||||
rStatAlarmCount.tag("r_stat_alarm_count_w"),
|
||||
rStatAlarmCount.tag("r_stat_area_alarm_count_m"),
|
||||
rDimBusTarget.tag("r_dim_bus_target_d"),
|
||||
rDimBusTarget.tag("r_dim_bus_target_m"),
|
||||
rDimBusTarget.tag("r_dim_bus_target_y"),
|
||||
rDimObjTarget.tag("r_dim_obj_target_d"),
|
||||
rDimObjTarget.tag("r_dim_obj_target_m"),
|
||||
rDimObjTarget.tag("r_dim_obj_target_y"),
|
||||
rDimObjGlobal.tag("r_dim_obj_global_d"),
|
||||
rDimObjGlobal.tag("r_dim_obj_global_m"),
|
||||
rDimObjGlobal.tag("r_dim_obj_global_y"),
|
||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_d"),
|
||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_m"),
|
||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_y")
|
||||
);
|
||||
</chain>
|
||||
<chain name="sub_station">
|
||||
THEN(
|
||||
THEN(
|
||||
rUploadSubStatisticalData
|
||||
),
|
||||
THEN(
|
||||
rStatSubstation.tag("r_stat_substation_d"),
|
||||
rStatSubstation.tag("r_stat_substation_m"),
|
||||
rStatSubstation.tag("r_stat_substation_q"),
|
||||
rStatSubstation.tag("r_stat_substation_y")
|
||||
),
|
||||
THEN(
|
||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_d"),
|
||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_m"),
|
||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_q"),
|
||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_y")
|
||||
)
|
||||
);
|
||||
</chain>
|
||||
<chain name="dim_station_busbar">
|
||||
THEN(
|
||||
THEN(
|
||||
rDimObjEvent.tag("r_dim_obj_event_d"),
|
||||
rDimObjEvent.tag("r_dim_obj_event_m"),
|
||||
rDimObjEvent.tag("r_dim_obj_event_y")
|
||||
)
|
||||
);
|
||||
</chain>
|
||||
<chain name="genera_trix">
|
||||
THEN(
|
||||
THEN(
|
||||
rBusbarVoltage.tag("r_dim_voltage_d"),
|
||||
rBusbarVoltage.tag("r_dim_voltage_m"),
|
||||
rBusbarVoltage.tag("r_dim_voltage_y")
|
||||
),
|
||||
THEN(
|
||||
rStatBusbarHarmonicY
|
||||
),
|
||||
THEN(
|
||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_d"),
|
||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_m"),
|
||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_q"),
|
||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_y")
|
||||
)
|
||||
);
|
||||
</chain>
|
||||
<chain name="upload_org">
|
||||
THEN(
|
||||
rUploadPointStatisticalData,
|
||||
rUploadEvaluationData,
|
||||
pqTypicalSourceCreatePOService
|
||||
|
||||
);
|
||||
</chain>
|
||||
<chain name="orgSub_station">
|
||||
THEN(
|
||||
THEN(
|
||||
rStatSubstationVoltage.tag("r_stat_substation_voltage_m")
|
||||
)
|
||||
);
|
||||
</chain>
|
||||
</flow>
|
||||
25
pqs-algorithm/pom.xml
Normal file
25
pqs-algorithm/pom.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>algorithm-api</module>
|
||||
<module>algorithm-boot</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>pqs-algorithm</artifactId>
|
||||
<description>算法模块</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -37,7 +37,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/oauth/autoLogin").permitAll()
|
||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/judgeToken/heBei","/oauth/autoLogin").permitAll()
|
||||
// @link https://gitee.com/xiaoym/knife4j/issues/I1Q5X6 (接口文档knife4j需要放行的规则)
|
||||
.antMatchers("/webjars/**","/doc.html","/swagger-resources/**","/v2/api-docs").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
|
||||
@@ -76,4 +76,44 @@ public class JudgeThirdToken extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/heBei")
|
||||
@ApiOperation("校验河北token有效性")
|
||||
@ApiImplicitParam(name = "token", required = true)
|
||||
public HttpResult<Object> heBei(String token) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String methodDescribe = getMethodDescribe("heBei");
|
||||
LogUtil.njcnDebug(log, "{},token:{}", methodDescribe, token);
|
||||
|
||||
/* // 请求地址
|
||||
String url = "http://dwzyywzt-test.com/baseCenter/oauth2/user/token";
|
||||
|
||||
// 请求头设置,x-www-form-urlencoded格式的数据
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
//提交参数设置
|
||||
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
||||
map.add("token", token);
|
||||
|
||||
// 组装请求体
|
||||
HttpEntity<MultiValueMap<String, String>> request =
|
||||
new HttpEntity<>(map, headers);
|
||||
|
||||
// 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
|
||||
String result = restTemplate.postForObject(url, request, String.class);
|
||||
JSONObject resultJson = new JSONObject(result);
|
||||
if (Objects.equals(resultJson.getInt("status"), DataStateEnum.ENABLE.getCode())) {
|
||||
//成功
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}*/
|
||||
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "HE_DNZLJCYW", methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.bpm.controller;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.PageResult;
|
||||
import com.njcn.bpm.pojo.param.task.*;
|
||||
import com.njcn.bpm.pojo.po.BpmCategory;
|
||||
@@ -217,6 +218,24 @@ public class BpmTaskController extends BaseController {
|
||||
page.setTotal(bpmTaskRespVOPageResult.getTotal());
|
||||
page.setSize(PageFactory.getPageSize(bpmTaskQueryParam));
|
||||
page.setCurrent(PageFactory.getPageNum(bpmTaskQueryParam));
|
||||
|
||||
List<BpmTaskVO> records = page.getRecords();
|
||||
for (BpmTaskVO record : records) {
|
||||
if(record.getStatus().equals(BpmTaskStatusEnum.CANCEL.getStatus()) && record.getReason().equals("系统自动取消")){
|
||||
record.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||
record.setReason(BpmTaskStatusEnum.APPROVE.getName());
|
||||
// 找到由谁完成的
|
||||
HttpResult<List<BpmTaskVO>> taskListByProcessInstanceId = this.getTaskListByProcessInstanceId(record.getProcessInstanceId());
|
||||
if(CollectionUtil.isNotEmpty(taskListByProcessInstanceId.getData())){
|
||||
for (BpmTaskVO datum : taskListByProcessInstanceId.getData()) {
|
||||
if(datum.getStatus().equals(BpmTaskStatusEnum.APPROVE.getStatus()) && datum.getTaskDefinitionKey().equals(record.getTaskDefinitionKey())){
|
||||
record.setReason("由".concat(datum.getAssigneeUser().getName()).concat("完成审批"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
import org.flowable.common.engine.impl.identity.Authentication;
|
||||
@@ -108,6 +109,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
|
||||
@Override
|
||||
public PageResult<HistoricProcessInstance> getProcessInstancePage(String userId, BpmProcessInstancePageParam bpmProcessInstancePageParam) {
|
||||
if (StrUtil.isNotBlank(bpmProcessInstancePageParam.getSearchValue()) && bpmProcessInstancePageParam.getSearchValue().contains("null")) {
|
||||
throw new BusinessException("搜索值中不能包含null");
|
||||
}
|
||||
// 通过 BpmProcessInstanceExtDO 表,先查询到对应的分页
|
||||
HistoricProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
||||
.includeProcessVariables()
|
||||
@@ -123,6 +127,9 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getName())) {
|
||||
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getName() + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getSearchValue())) {
|
||||
processInstanceQuery.processInstanceNameLike("%" + bpmProcessInstancePageParam.getSearchValue() + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(bpmProcessInstancePageParam.getProcessDefinitionId())) {
|
||||
processInstanceQuery.processDefinitionId("%" + bpmProcessInstancePageParam.getProcessDefinitionId() + "%");
|
||||
}
|
||||
|
||||
@@ -128,6 +128,9 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
|
||||
@Override
|
||||
public PageResult<HistoricTaskInstance> getTaskDonePage(String userId, BpmTaskParam.BpmTaskQueryParam bpmTaskQueryParam) {
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue()) && bpmTaskQueryParam.getSearchValue().contains("null")) {
|
||||
throw new BusinessException("搜索值中不能包含null");
|
||||
}
|
||||
HistoricTaskInstanceQuery taskQuery = historyService.createHistoricTaskInstanceQuery()
|
||||
// 已完成
|
||||
.finished()
|
||||
@@ -137,7 +140,7 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
// 审批时间倒序
|
||||
.orderByHistoricTaskInstanceEndTime().desc();
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
||||
taskQuery.taskNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
taskQuery.processDefinitionNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
}
|
||||
String beginTimeStr = bpmTaskQueryParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmTaskQueryParam.getSearchEndTime();
|
||||
|
||||
@@ -21,17 +21,17 @@ public class GenerateCode {
|
||||
|
||||
private static final String TARGET_DIR = "D://code";
|
||||
|
||||
private static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/pqsinfo";
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_zl";
|
||||
// private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
|
||||
|
||||
private static final String USERNAME = "root";
|
||||
|
||||
private static final String PASSWORD = "123456";
|
||||
private static final String PASSWORD = "njcnpqs";
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Module> modules = Stream.of(
|
||||
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
||||
"supervision_line_warning"
|
||||
"app_version"
|
||||
).collect(Collectors.toList()), "supervision_")
|
||||
).collect(Collectors.toList());
|
||||
generateJavaFile(modules);
|
||||
|
||||
@@ -174,16 +174,31 @@ public interface PatternRegex {
|
||||
*/
|
||||
String TYPE_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,100}$";
|
||||
|
||||
/**
|
||||
* 描述32
|
||||
*/
|
||||
String DES32_REGEX = "^.{0,32}$";
|
||||
|
||||
/**
|
||||
* 描述64
|
||||
*/
|
||||
String DES64_REGEX = "^.{0,64}$";
|
||||
|
||||
/**
|
||||
* 描述100
|
||||
*/
|
||||
String DES100_REGEX = "^.{0,100}$";
|
||||
|
||||
/**
|
||||
* 描述200
|
||||
*/
|
||||
String DES200_REGEX = "^.{0,200}$";
|
||||
|
||||
/**
|
||||
* 描述400
|
||||
*/
|
||||
String DES400_REGEX = "^.{0,400}$";
|
||||
|
||||
/**
|
||||
* 描述500
|
||||
*/
|
||||
|
||||
@@ -49,5 +49,7 @@ public interface ServerInfo {
|
||||
|
||||
String ADVANCE_BOOT = "advance-boot";
|
||||
|
||||
String DATA_PLATFORM = "data-platform-boot";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ public class SimpleDTO implements Serializable {
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer algoDescribe;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ public class SimpleTreeDTO extends SimpleDTO implements Serializable {
|
||||
|
||||
private List<SimpleDTO> children;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.common.pojo.enums.common;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 11:37
|
||||
*/
|
||||
@Getter
|
||||
public enum DealStateEnum {
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
RESOLVED(1, "已解决"),
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
UNSOLVED(0, "未解决");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
DealStateEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.common.pojo.exception;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -83,5 +84,6 @@ public class BusinessException extends RuntimeException {
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
this.code = CommonResponseEnum.FAIL.getCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LogUtil {
|
||||
public static void logExceptionStackInfo(String exceptionName, Exception exception) {
|
||||
//若开启了debug模式,则输出所有的栈堆信息
|
||||
njcnPatchDebug(log, ExceptionUtil.getAllExceptionStackInfo(exception));
|
||||
log.error("{}{},目标文件:{}",exceptionName, exception.toString(), ExceptionUtil.getExceptionServerStackInfo(exception));
|
||||
log.error("{}{},目标文件:{}",exceptionName, exception, ExceptionUtil.getExceptionServerStackInfo(exception));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.oss.utils;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.huawei.obs.util.OBSUtil;
|
||||
@@ -7,6 +8,7 @@ import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||
import com.njcn.minioss.config.MinIossProperties;
|
||||
import com.njcn.minioss.util.MinIoUtils;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import io.minio.*;
|
||||
import io.minio.errors.*;
|
||||
@@ -21,9 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -92,7 +92,7 @@ public class FileStorageUtil {
|
||||
* @param dir 服务器文件存放路径
|
||||
* @param flag 是否保留原始文件名
|
||||
*/
|
||||
public String uploadMultipart(MultipartFile multipartFile, String dir,boolean flag) {
|
||||
public String uploadMultipart(MultipartFile multipartFile, String dir, boolean flag) {
|
||||
String filePath;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||
@@ -100,7 +100,7 @@ public class FileStorageUtil {
|
||||
} else {
|
||||
try {
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir,flag);
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir, flag);
|
||||
filePath = minIoUploadResDTO.getMinFileName();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||
@@ -136,6 +136,7 @@ public class FileStorageUtil {
|
||||
|
||||
/**
|
||||
* 上传InputStream流,并指定文件的名称
|
||||
*
|
||||
* @author xuyang
|
||||
*/
|
||||
public String uploadStreamSpecifyName(InputStream inputStream, String dir, String fileName) {
|
||||
@@ -211,7 +212,7 @@ public class FileStorageUtil {
|
||||
} catch (Exception exception) {
|
||||
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
|
||||
}
|
||||
String fileType = filePath.substring(filePath.lastIndexOf('.')+1).toLowerCase();
|
||||
String fileType = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
|
||||
switch (fileType) {
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
@@ -219,13 +220,14 @@ public class FileStorageUtil {
|
||||
case "gif":
|
||||
response.setContentType(MediaType.IMAGE_PNG_VALUE);
|
||||
break;
|
||||
case "svg":
|
||||
response.setContentType("image/svg+xml");
|
||||
break;
|
||||
case "pdf":
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + filePath);
|
||||
break;
|
||||
default:
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + filePath);
|
||||
break;
|
||||
}
|
||||
try {
|
||||
@@ -263,18 +265,19 @@ public class FileStorageUtil {
|
||||
}
|
||||
directory = (String) Optional.ofNullable(directory).orElse("");
|
||||
String minFileName = directory + fileName;
|
||||
this.instance.putObject((PutObjectArgs)((io.minio.PutObjectArgs.Builder)((io.minio.PutObjectArgs.Builder)PutObjectArgs.builder().bucket(bucketName)).object(minFileName)).stream(inputStream, (long)inputStream.available(), -1L).build());
|
||||
this.instance.putObject((PutObjectArgs) ((io.minio.PutObjectArgs.Builder) ((io.minio.PutObjectArgs.Builder) PutObjectArgs.builder().bucket(bucketName)).object(minFileName)).stream(inputStream, (long) inputStream.available(), -1L).build());
|
||||
inputStream.close();
|
||||
return new MinIoUploadResDTO(minFileName, minIoUtils.getObjectUrl(bucketName, minFileName, 60));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: getAllFile 获取minio指定文件夹下所有文件
|
||||
* @Param:
|
||||
* @return: java.lang.Iterable<io.minio.Result<io.minio.messages.Item>>
|
||||
* @return: java.lang.Iterable<io.minio.Result < io.minio.messages.Item>>
|
||||
* @Author: clam
|
||||
* @Date: 2024/9/27
|
||||
*/
|
||||
public List<MultipartFile> getAllFile(String bucketName, String directory) throws Exception{
|
||||
public List<MultipartFile> getAllFile(String bucketName, String directory) throws Exception {
|
||||
List<MultipartFile> files = new ArrayList<>();
|
||||
Iterable<Result<Item>> results = this.instance.listObjects(
|
||||
ListObjectsArgs.builder().bucket(bucketName).prefix(directory).recursive(true).build());
|
||||
@@ -287,7 +290,6 @@ public class FileStorageUtil {
|
||||
GetObjectArgs.builder().bucket(bucketName).object(item.objectName()).build());
|
||||
|
||||
|
||||
|
||||
// 假设你有一个方法可以将InputStream转换为MultipartFile
|
||||
MultipartFile multipartFile = new MockMultipartFile(item.objectName(), item.objectName(), "text/plain", stream);
|
||||
files.add(multipartFile);
|
||||
@@ -296,4 +298,38 @@ public class FileStorageUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 目前只给审计日志使用
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/10/15
|
||||
*/
|
||||
public File getLastFile(String bucketName, String directory) throws Exception {
|
||||
File file = null;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
Iterable<Result<Item>> results = this.instance.listObjects(
|
||||
ListObjectsArgs.builder().bucket(bucketName).prefix(directory).recursive(true).build());
|
||||
Item lastItem = null;
|
||||
for (Result<Item> result : results) {
|
||||
Item item = result.get();
|
||||
if (lastItem == null) {
|
||||
lastItem = item;
|
||||
} else {
|
||||
if (item.lastModified().isAfter(lastItem.lastModified())) {
|
||||
lastItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
InputStream stream = this.instance.getObject(
|
||||
GetObjectArgs.builder().bucket(bucketName).object(lastItem.objectName()).build());
|
||||
|
||||
file = File.createTempFile(lastItem.objectName(), "xlsx");
|
||||
FileUtil.writeFromStream(stream, file);
|
||||
}else if(generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS){
|
||||
file = obsUtil.getLastFile(OssPath.LOGBAK);
|
||||
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,24 @@ public interface AppRedisKey {
|
||||
String DOWNLOAD = "downloadKey:";
|
||||
|
||||
String CONTROL = "control:";
|
||||
|
||||
/**
|
||||
* 设备池
|
||||
*/
|
||||
String DEVICE_LIST = "deviceListKey";
|
||||
|
||||
/**
|
||||
* 字典树
|
||||
*/
|
||||
String DICT_TREE = "dictTreeKey";
|
||||
|
||||
/**
|
||||
* 模板
|
||||
*/
|
||||
String DEV_MODEL = "devModelKey:";
|
||||
|
||||
/**
|
||||
* 补召文件
|
||||
*/
|
||||
String MAKE_UP_FILES = "makeUpFilesKey:";
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.redis.utils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
@@ -79,6 +80,17 @@ public class RedisUtil {
|
||||
redisTemplate.delete(Arrays.asList(keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定字符模糊匹配,批量删除keys
|
||||
*/
|
||||
public void deleteKeysByString(String str) {
|
||||
Set<String> keys = redisTemplate.keys(str.concat("*"));
|
||||
// 删除所有匹配的key
|
||||
if (keys != null && !keys.isEmpty()) {
|
||||
redisTemplate.delete(keys);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取key对应的字符数据
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.njcn.web.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.njcn.web.filter.XssFilter;
|
||||
import com.njcn.web.filter.XssRequestWrapper;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
|
||||
@@ -7,10 +7,8 @@ package com.njcn.web.constant;
|
||||
*/
|
||||
public interface ValidMessage {
|
||||
|
||||
|
||||
String MISS_PREFIX="字段不能为空,请检查";
|
||||
|
||||
|
||||
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
||||
|
||||
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
||||
@@ -69,4 +67,8 @@ public interface ValidMessage {
|
||||
|
||||
String DEVICE_VERSION_NOT_BLANK = "装置版本json文件不能为空,请检查deviceVersionFile参数";
|
||||
|
||||
String SEARCH_DATA_ERROR = "搜索值过长,请检查搜索参数";
|
||||
|
||||
String DATA_TOO_LONG = "参数过长,请检查参数";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.njcn.web.enums;
|
||||
|
||||
|
||||
import com.njcn.web.utils.GwSendUtil;
|
||||
|
||||
import static com.njcn.web.utils.GwSendUtil.NEWGWURL;
|
||||
|
||||
/**
|
||||
* @Description: 上送枚举
|
||||
* @Author: wr
|
||||
@@ -39,14 +43,19 @@ public enum GWSendEnum {
|
||||
|
||||
|
||||
//调用总部下发工单的反馈单接口
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
|
||||
PARK_AND_STATION("parkAndStation", "/pms-ghq-powerquality-start/powerQuality/park/create"),
|
||||
PARK_AND_STATION("parkAndStation", "/powerQuality/park/create"),
|
||||
|
||||
REPORT_CREATE("reportCreate", "/pms-ghq-powerquality-start/powerQuality/report/create"),
|
||||
|
||||
COMM_POINT("commPoint","/pms-ghq-powerquality-start/powerQuality/publicConnection/pqBusMonitorDataStatisticalCreate")
|
||||
REPORT_CREATE("reportCreate", "/powerQuality/report/create"),
|
||||
|
||||
COMM_POINT("commPoint","/powerQuality/publicConnection/pqBusMonitorDataStatisticalCreate"),
|
||||
MAIN_MONITOR("mainMonitor","/powerQuality/runStatistics/monitorStatisticsCreate"),
|
||||
TEMP_USER_CREATE("tempUserCreate","/powerQuality/process/tempUserCreate"),
|
||||
TEMP_PROCESS_TRACK_CREATE("tempProcessTrackCreate","/powerQuality/process/processFollowCreate"),
|
||||
MONTH_REPORT_CREATE("monthReportCreate","/powerQuality/process/monthReportCreate"),
|
||||
PROCESS_APPROVAL_CREATE("processApprovalCreate","powerQuality/process/processApprovalCreate"),
|
||||
PROCESS_TEST_RUN_CREATE("processTestRunCreate","powerQuality/process/processTestRunCreate")
|
||||
;
|
||||
|
||||
|
||||
@@ -66,4 +75,8 @@ public enum GWSendEnum {
|
||||
public String getUrl() {
|
||||
return "http://dwzyywzt-pms3-proxy.com/CSB" + url;
|
||||
}
|
||||
|
||||
public String getNewUrl(){
|
||||
return GwSendUtil.NEWGWURL + url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Stream;
|
||||
@Slf4j
|
||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields"};
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields","definition"};
|
||||
|
||||
|
||||
public XssRequestWrapper(HttpServletRequest request) {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.njcn.web.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -16,6 +19,7 @@ public class BaseParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("搜索值")
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.SEARCH_DATA_ERROR)
|
||||
private String searchValue;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
|
||||
@@ -26,8 +26,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@Slf4j
|
||||
public class GwSendUtil {
|
||||
|
||||
private static final String GWURL = "dwzyywzt-pms3-proxy.com";
|
||||
private static final String CODE = "13B9B47F1E483324E05338297A0A0595";
|
||||
public static final String GWURL = "dwzyywzt-pms3-proxy.com";
|
||||
public static final String CODE = "13B9B47F1E483324E05338297A0A0595";
|
||||
|
||||
//最新的上送接口路径
|
||||
public static final String NEWGWURL = "http://pms.pms30.com.cn/pms-tech-seval";
|
||||
public static final String secretKey = "xQcEF+9hnekk2ZAD1+K1y3PS1d7e3wf0dmPXeeMKf/19qRhyP+4c0FTr70bGINpR";
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -43,7 +47,7 @@ public class GwSendUtil {
|
||||
cb = new ContentBody("");
|
||||
} else {
|
||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||
log.info(Thread.currentThread().getName() + "1.信息:" + s);
|
||||
log.info(Thread.currentThread().getName() + "1.上送网公司信息:" + s);
|
||||
cb = new ContentBody(s);
|
||||
}
|
||||
//ContentBody传递,要求使用post方式进行调用
|
||||
@@ -59,6 +63,7 @@ public class GwSendUtil {
|
||||
|
||||
builder.contentBody(cb);
|
||||
String token = LoginToken();
|
||||
System.out.println("获取token------->"+token);
|
||||
builder.putHeaderParamsMap("x-token", token);
|
||||
builder.putHeaderParamsMap("serviceName", sendEnum.getServiceName());
|
||||
//进行调用,返回结果
|
||||
@@ -112,6 +117,58 @@ public class GwSendUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新的上送方式
|
||||
* @param param
|
||||
* @param sendEnum
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> newSend(SendParam param, GWSendEnum sendEnum) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
try {
|
||||
ContentBody cb;
|
||||
if (ObjectUtil.isNull(param)) {
|
||||
cb = new ContentBody("");
|
||||
} else {
|
||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||
log.info(Thread.currentThread().getName() + "1.信息:" + s);
|
||||
cb = new ContentBody(s);
|
||||
}
|
||||
//ContentBody传递,要求使用post方式进行调用
|
||||
//如果需要传递请求参数 可以拼接到请求URL中,或者设置paramsMap参数由SDK内部进行拼接
|
||||
HttpParameters.Builder builder = HttpParameters.newBuilder();
|
||||
|
||||
builder.requestURL(sendEnum.getNewUrl()) // 设置请求的URL,可以拼接URL请求参数
|
||||
.method("post") // 设置调用方式, 必须为 post
|
||||
.contentType("application/json; charset=UTF-8"); //设置请求content-type
|
||||
|
||||
builder.contentBody(cb);
|
||||
|
||||
//进行调用,返回结果
|
||||
try {
|
||||
HttpReturn ret = HttpCaller.invokeReturn(builder.build());
|
||||
String responseStr = ret.getResponseStr();//获取响应的文本串
|
||||
System.out.println("获取响应的文本串:"+responseStr);
|
||||
if (responseStr.indexOf("\\\"") != -1) {
|
||||
responseStr = responseStr.replace("\\\"", "\"");
|
||||
}
|
||||
Map mapData = JSON.parseObject(responseStr, Map.class);
|
||||
if(mapData.containsKey("error_msg")){
|
||||
throw new BusinessException("国网上送接口超时,请重新上送");
|
||||
}
|
||||
map.put("succeed", responseStr);
|
||||
} catch (HttpCallerException e) {
|
||||
// error process
|
||||
log.info(Thread.currentThread().getName() + "错误信息:" + e);
|
||||
map.put("error", e.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
map.put("error", "当前时间段国网上送请求过多,请稍后再试");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于单次调用的返回
|
||||
* @author cdf
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -52,4 +53,8 @@ public interface CommLineClient {
|
||||
|
||||
@GetMapping("/getLineAllDetailList")
|
||||
HttpResult<List<LineALLInfoDTO>> getLineAllDetailList(@RequestParam("ids") List<String> ids);
|
||||
|
||||
@PostMapping("/getLineInfo")
|
||||
HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -56,6 +57,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PollutionLineDTO>> getLineInfo(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点列表信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -109,7 +110,9 @@ public class LineDevGetDTO {
|
||||
|
||||
|
||||
public void setTimeInterval(Integer timeInterval) {
|
||||
if(Objects.nonNull(timeInterval)) {
|
||||
this.interval = timeInterval;
|
||||
this.timeInterval = timeInterval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
package com.njcn.device.biz.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.biz.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -14,6 +15,7 @@ public class DeviceBak {
|
||||
/**
|
||||
* 终端Id
|
||||
*/
|
||||
@TableId("Id")
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
FROM eclipse-temurin:8-jdk-centos7
|
||||
MAINTAINER hongawen_13914774158@163.com
|
||||
ENV JAVA_OPTS="-Xms1024m -Xmx1024m"
|
||||
# 挂载时区的目录
|
||||
VOLUME /usr/share/zoneinfo
|
||||
# 设置时区为上海
|
||||
ENV TZ=Asia/Shanghai
|
||||
# 设置时区信息
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
FROM openjdk:8-jdk-alpine
|
||||
ADD target/deviceboot.jar deviceboot.jar
|
||||
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /deviceboot.jar
|
||||
ENTRYPOINT ["/bin/sh", "-c" , "echo 25.36.214.50 dwzyywzt-pms3-proxy.com >> /etc/hosts && echo 25.36.227.20 pms.pms30.com.cn >> /etc/hosts && echo 25.36.181.69 8d051549520e423ab8dccf8b3d457c74.apigw.he-region-2.sgic.sgcc.com.cn >> /etc/hosts && exec java -jar deviceboot.jar" ]
|
||||
EXPOSE 10202
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
@@ -61,3 +61,8 @@ isJb: false
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
|
||||
oracle:
|
||||
isSync: false
|
||||
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
|
||||
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerUpdateLine
|
||||
syncLedgerDeleteLine: http://localhost:8082/export/syncLedgerDeleteLine
|
||||
|
||||
@@ -68,6 +68,15 @@ public interface MonitorClient {
|
||||
@PostMapping("getMonitorList")
|
||||
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
||||
|
||||
|
||||
/**
|
||||
* 通过同源监测点编码获取监测点信息
|
||||
* @author cdf
|
||||
* @date 2022/11/29
|
||||
*/
|
||||
@PostMapping("getMonitorListByMid")
|
||||
HttpResult<List<Monitor>> getMonitorListByMid(@RequestBody List<String> midIds);
|
||||
|
||||
@PostMapping("getMonitorPage")
|
||||
HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam);
|
||||
|
||||
|
||||
@@ -32,4 +32,8 @@ public interface PmsTerminalClient {
|
||||
*/
|
||||
@PostMapping("/getTerminalSelectList")
|
||||
HttpResult<List<PmsTerminal>> getTerminalSelectList(@RequestBody PmsBaseParam pmsBaseParam);
|
||||
|
||||
@PostMapping("/getTerminalSelectByIds")
|
||||
HttpResult<List<PmsTerminal>> getTerminalSelectByIds(@RequestBody List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Monitor>> getMonitorListByMid(List<String> midIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "使用同源监测点编码获取监测点信息 ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Page<Monitor>> getMonitorPage(TerminalQueryParam baseParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "分页获取主网监测点数据 ", throwable.toString());
|
||||
|
||||
@@ -36,6 +36,12 @@ public class PmsTerminalClientFallbackFactory implements FallbackFactory<PmsTerm
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取主网所有终端", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectByIds(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "使用装置id集合查询装置信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,49 +86,49 @@ public class PowerClientParam {
|
||||
* 合同容量
|
||||
*/
|
||||
@ApiModelProperty(value = "合同容量",required = true)
|
||||
@NotNull(message = "合同容量不可为空")
|
||||
//@NotNull(message = "合同容量不可为空")
|
||||
private Float contractCapacity;
|
||||
|
||||
/**
|
||||
* 运行容量
|
||||
*/
|
||||
@ApiModelProperty(value = "运行容量",required = true)
|
||||
@NotNull(message = "运行容量不可为空")
|
||||
//@NotNull(message = "运行容量不可为空")
|
||||
private Float operatingCapacity;
|
||||
|
||||
/**
|
||||
* 生产班次(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "生产班次(字典)",required = true)
|
||||
@NotBlank(message = "生产班次不可为空")
|
||||
//@NotBlank(message = "生产班次不可为空")
|
||||
private String productionShift;
|
||||
|
||||
/**
|
||||
* 负荷性质(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "负荷性质(字典)",required = true)
|
||||
@NotBlank(message = "负荷性质不可为空")
|
||||
//@NotBlank(message = "负荷性质不可为空")
|
||||
private String loadNature;
|
||||
|
||||
/**
|
||||
* 供电电压(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "供电电压(字典)",required = true)
|
||||
@NotBlank(message = "供电电压不可为空")
|
||||
//@NotBlank(message = "供电电压不可为空")
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 高耗能行业类别(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "高耗能行业类别(字典)",required = true)
|
||||
@NotBlank(message = "高耗能行业类别不可为空")
|
||||
//@NotBlank(message = "高耗能行业类别不可为空")
|
||||
private String highIndustryType;
|
||||
|
||||
/**
|
||||
* 送电日期
|
||||
*/
|
||||
@ApiModelProperty(value = "送电日期",required = true)
|
||||
@NotNull(message = "送电日期不可为空")
|
||||
//@NotNull(message = "送电日期不可为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDate powerTransmissionDate;
|
||||
|
||||
@@ -136,42 +136,42 @@ public class PowerClientParam {
|
||||
* 重要性等级(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "重要性等级",required = true)
|
||||
@NotBlank(message = "重要性等级不可为空")
|
||||
//@NotBlank(message = "重要性等级不可为空")
|
||||
private String importanceLevel;
|
||||
|
||||
/**
|
||||
* 用电客户状态(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "用电客户状态",required = true)
|
||||
@NotBlank(message = "用电客户状态不可为空")
|
||||
//@NotBlank(message = "用电客户状态不可为空")
|
||||
private String eccStat;
|
||||
|
||||
/**
|
||||
* 是否敏感用户:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否敏感用户",required = true)
|
||||
@NotNull(message = "用户编号不可为空")
|
||||
//@NotNull(message = "用户编号不可为空")
|
||||
private Integer ifSensitiveUser;
|
||||
|
||||
/**
|
||||
* 是否影响电能质量:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否影响电能质量:0-否;1:是;",required = true)
|
||||
@NotNull(message = "是否影响电能质量不可为空")
|
||||
//@NotNull(message = "是否影响电能质量不可为空")
|
||||
private Integer ifPowerQuality;
|
||||
|
||||
/**
|
||||
* 是否重要客户:0-否;1:是;
|
||||
*/
|
||||
@ApiModelProperty(value = "是否重要客户:0-否;1:是;",required = true)
|
||||
@NotNull(message = "是否重要客户不可为空")
|
||||
//@NotNull(message = "是否重要客户不可为空")
|
||||
private Integer ifKeyCustomers;
|
||||
|
||||
/**
|
||||
* 敏感用户类别(字典)
|
||||
*/
|
||||
@ApiModelProperty(value = "敏感用户类别",required = true)
|
||||
@NotBlank(message = "敏感用户类别不可为空")
|
||||
//@NotBlank(message = "敏感用户类别不可为空")
|
||||
private String sensitiveType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,4 +22,6 @@ public class PwUserMonitorParam extends BaseParam {
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
private String monitorState;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.device.pms.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
@@ -70,66 +72,79 @@ public class PowerClient extends BaseEntity {
|
||||
/**
|
||||
* 合同容量
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Float contractCapacity;
|
||||
|
||||
/**
|
||||
* 运行容量
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Float operatingCapacity;
|
||||
|
||||
/**
|
||||
* 生产班次(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String productionShift;
|
||||
|
||||
/**
|
||||
* 负荷性质(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String loadNature;
|
||||
|
||||
/**
|
||||
* 供电电压(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 高耗能行业类别(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String highIndustryType;
|
||||
|
||||
/**
|
||||
* 送电日期
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDate powerTransmissionDate;
|
||||
|
||||
/**
|
||||
* 重要性等级(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String importanceLevel;
|
||||
|
||||
/**
|
||||
* 用电客户状态(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String eccStat;
|
||||
|
||||
/**
|
||||
* 是否敏感用户:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifSensitiveUser;
|
||||
|
||||
/**
|
||||
* 是否影响电能质量:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifPowerQuality;
|
||||
|
||||
/**
|
||||
* 是否重要客户:0-否;1:是;
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer ifKeyCustomers;
|
||||
|
||||
/**
|
||||
* 敏感用户类别(字典)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String sensitiveType;
|
||||
|
||||
/**
|
||||
@@ -150,6 +165,7 @@ public class PowerClient extends BaseEntity {
|
||||
/**
|
||||
* 用户标签
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String userTag;
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MonitorSendController extends BaseController {
|
||||
@ApiOperation("国网上送接口")
|
||||
@ApiImplicitParam(name = "param",value = "请求体",required = true)
|
||||
public HttpResult<String> windSend(@RequestBody @Validated MonitorParam.Info param){
|
||||
String methodDescribe = getMethodDescribe("sendType");
|
||||
String methodDescribe = getMethodDescribe("windSend");
|
||||
String s = monitorSendService.sendType(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, s, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -58,4 +59,15 @@ public class CommLineController extends BaseController {
|
||||
List<LineDTO> result = monitorService.getLineDetailBatch(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineInfo")
|
||||
@ApiOperation("获取监测点信息")
|
||||
public HttpResult<List<PollutionLineDTO>> getLineInfo(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getLineInfo");
|
||||
List<PollutionLineDTO> result = monitorService.getLineInfo(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -131,15 +131,27 @@ public class PmsMonitorController extends BaseController {
|
||||
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
|
||||
@ApiImplicitParam(name = "monitorIds",value = "主网监测点编号",required = true)
|
||||
public HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds) {
|
||||
String methodDescribe = getMethodDescribe("getAllMonitorList");
|
||||
String methodDescribe = getMethodDescribe("getMonitorList");
|
||||
List<Monitor> monitor= monitorService.getMonitorList(monitorIds);
|
||||
if (Objects.isNull(monitor)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用同源监测点编码获取监测点信息
|
||||
* @author cdf
|
||||
* @date 2022/11/29
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorListByMid")
|
||||
@ApiOperation("使用同源监测点编码获取监测点信息")
|
||||
@ApiImplicitParam(name = "midIds",value = "主网监测点编号",required = true)
|
||||
public HttpResult<List<Monitor>> getMonitorListByMid(@RequestBody List<String> midIds) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorListByMid");
|
||||
List<Monitor> monitor= monitorService.getMonitorListByMid(midIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorPage")
|
||||
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
|
||||
|
||||
@@ -162,7 +162,7 @@ public class PmsStatationStatController extends BaseController {
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
})
|
||||
public HttpResult<List<StatationStat>> getPowerInfo(@RequestBody PmsStatationStatInfoParam param) {
|
||||
String methodDescribe = getMethodDescribe("getStatationStatInfo");
|
||||
String methodDescribe = getMethodDescribe("getPowerInfo");
|
||||
List<StatationStat> powerInfo = statationStatService.getPowerInfo(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerInfo, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,16 @@ public class PmsTerminalController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getTerminalSelectByIds")
|
||||
@ApiOperation("根据ID集合查询监测终端台账数据")
|
||||
@ApiImplicitParam(name = "ID集合",value = "ids",required = true)
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectByIds(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("getTerminalSelectByIds");
|
||||
List<PmsTerminal> pmsTerminal = iTerminalService.getTerminalSelectByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pmsTerminal, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测终端台账信息
|
||||
* @author hany
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.device.pms.pojo.vo.StatationStatVO;
|
||||
import com.njcn.device.pms.service.majornetwork.IStatationStatService;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -19,7 +18,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import retrofit2.http.GET;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
(
|
||||
/* (
|
||||
SELECT
|
||||
ppd.id,
|
||||
ppd.Name,
|
||||
@@ -62,7 +62,7 @@
|
||||
ppd.Line_Name
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
) UNION ALL
|
||||
) UNION ALL*/
|
||||
(
|
||||
SELECT
|
||||
ppc.id,
|
||||
@@ -176,7 +176,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
) UNION ALL
|
||||
) /*UNION ALL
|
||||
(
|
||||
SELECT
|
||||
ppd.id,
|
||||
@@ -191,7 +191,7 @@
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
)
|
||||
) AS monitor
|
||||
) AS monitor*/
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
|
||||
@@ -519,7 +519,8 @@
|
||||
pms_distribution_monitor
|
||||
inner join pms_power_client on pms_distribution_monitor.Monitor_Id = pms_power_client.id
|
||||
left join pms_real_data on pms_power_client.id = pms_real_data.line_id and pms_real_data.value_type = "AVG"
|
||||
WHERE pms_power_client.org_id in
|
||||
WHERE pms_distribution_monitor.Monitor_State = #{param.monitorState}
|
||||
and pms_power_client.org_id in
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pms.pojo.vo.gw.TypicalSourceOnLine;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -88,6 +89,8 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
|
||||
List<Monitor> getMonitorList(List<String> monitorIds);
|
||||
|
||||
List<Monitor> getMonitorListByMid(List<String> midIds);
|
||||
|
||||
|
||||
List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds);
|
||||
|
||||
@@ -220,4 +223,7 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
* @Date: 2024/5/27 13:54
|
||||
*/
|
||||
Page<TypicalSourceOnLine> monitorTypicalList(TypicalSourceParam param);
|
||||
|
||||
|
||||
List<PollutionLineDTO> getLineInfo(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,7 @@ import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.device.pms.pojo.vo.StatationStatVO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -478,6 +478,8 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
||||
@Override
|
||||
public List<PwUserMonitorDataVO> getPwUserIds(PwUserMonitorParam pwUserMonitorParam) {
|
||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(pwUserMonitorParam.getOrgId()).getData();
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||
pwUserMonitorParam.setMonitorState(dictData.getId());
|
||||
return this.distributionMonitorMapper.getDistributionList(deptIds,pwUserMonitorParam);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixWireMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.*;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
|
||||
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
|
||||
@@ -23,16 +21,19 @@ import com.njcn.device.pms.pojo.param.GeneratrixWireParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsBaseParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
|
||||
import com.njcn.device.pms.pojo.po.GeneratrixWire;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||
import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService;
|
||||
import com.njcn.device.pms.service.majornetwork.IStatationStatService;
|
||||
import com.njcn.event.pojo.po.PmsMonitorPO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -57,6 +58,8 @@ public class GeneratrixWireImpl extends ServiceImpl<PmsGeneratrixWireMapper, Gen
|
||||
|
||||
private final StatationStatMapper statationStatMapper;
|
||||
|
||||
private final MonitorMapper monitorMapper;
|
||||
|
||||
@Override
|
||||
public boolean addGeneratrixWire(GeneratrixWireParam generatrixWireParam) {
|
||||
checkName(generatrixWireParam, false);
|
||||
@@ -68,12 +71,22 @@ public class GeneratrixWireImpl extends ServiceImpl<PmsGeneratrixWireMapper, Gen
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateGeneratrixWire(GeneratrixWireParam generatrixWireParam) {
|
||||
checkName(generatrixWireParam, true);
|
||||
GeneratrixWire generatrixWireVa = this.getById(generatrixWireParam.getId());
|
||||
if (Objects.isNull(generatrixWireVa)) {
|
||||
throw new BusinessException(PmsDeviceResponseEnum.VOLTAGE_EMPTY);
|
||||
}
|
||||
|
||||
if(!generatrixWireParam.getName().equals(generatrixWireVa.getName())){
|
||||
//名称变更需要同步修改其他台账表的母线测点名称
|
||||
LambdaUpdateWrapper<Monitor> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(Monitor::getLineName,generatrixWireParam.getName())
|
||||
.eq(Monitor::getLineId,generatrixWireVa.getId());
|
||||
monitorMapper.update(null,lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
GeneratrixWire generatrixWire = new GeneratrixWire();
|
||||
BeanUtils.copyProperties(generatrixWireParam, generatrixWire);
|
||||
return this.updateById(generatrixWire);
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.njcn.device.pms.pojo.vo.PmsMonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.gw.TypicalSourceOnLine;
|
||||
import com.njcn.device.pms.service.majornetwork.*;
|
||||
import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.po.LineBak;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
@@ -58,7 +59,6 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.dto.PmsPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -302,6 +302,16 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return monitorList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Monitor> getMonitorListByMid(List<String> midIds) {
|
||||
List<Monitor> monitorList;
|
||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode()).in(Monitor::getMonitorId,midIds);
|
||||
monitorList = this.list(lambdaQueryWrapper);
|
||||
return monitorList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds) {
|
||||
List<LineDevGetDTO> monitorList = new ArrayList<>();
|
||||
@@ -314,7 +324,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setDevId(monitor.getTerminalId());
|
||||
lineDevGetDTO.setPointId(monitor.getId());
|
||||
|
||||
lineDevGetDTO.setInterval(monitor.getStatisticalInterval());
|
||||
System.out.println("获取主网测点统计间隔"+lineDevGetDTO.getInterval());
|
||||
monitorList.add(lineDevGetDTO);
|
||||
}
|
||||
|
||||
@@ -879,6 +891,26 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
pmsPage.setRecords(info);
|
||||
return pmsPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PollutionLineDTO> getLineInfo(List<String> ids) {
|
||||
List<PollutionLineDTO> result = new ArrayList<>();
|
||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(Monitor::getId,ids).eq(Monitor::getStatus,DataStateEnum.ENABLE.getCode());
|
||||
List<Monitor> monitors = this.list(lambdaQueryWrapper);
|
||||
monitors.forEach(item->{
|
||||
PollutionLineDTO pollutionLineDTO = new PollutionLineDTO();
|
||||
pollutionLineDTO.setId(item.getId());
|
||||
pollutionLineDTO.setName(item.getName());
|
||||
pollutionLineDTO.setBusBar(item.getLineId());
|
||||
pollutionLineDTO.setSubstationId(item.getPowerrId());
|
||||
pollutionLineDTO.setSubstation(item.getPowerrName());
|
||||
pollutionLineDTO.setPowerCompany(item.getOrgName());
|
||||
result.add(pollutionLineDTO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private String monitorObjectTypeName(String name) {
|
||||
if(StrUtil.isNotBlank(name)){
|
||||
switch (name) {
|
||||
@@ -1302,6 +1334,12 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
||||
//单位
|
||||
if(oracleTerminalExcel.getGdName().equals("省检修")){
|
||||
oracleTerminalExcel.setGdName("国网河北超高压公司本部");
|
||||
}else {
|
||||
oracleTerminalExcel.setGdName("国网"+oracleTerminalExcel.getGdName()+"本部");
|
||||
}
|
||||
|
||||
if (!mapDept.containsKey(oracleTerminalExcel.getGdName())) {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "单位名称不存在,请确认单位名称是否正确"));
|
||||
continue;
|
||||
@@ -1492,35 +1530,38 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getLineId, lineId)
|
||||
.eq(Monitor::getName, oracleTerminalExcel.getLineName());
|
||||
Monitor monitor = monitorMapper.selectOne(monitorLambdaQueryWrapper);
|
||||
List<Monitor> monitorList = monitorMapper.selectList(monitorLambdaQueryWrapper);
|
||||
|
||||
if(CollUtil.isNotEmpty(monitorList)) {
|
||||
|
||||
for (Monitor monitor : monitorList) {
|
||||
|
||||
//当前电站下面没有监测点,可以新增
|
||||
Monitor monitorPO = new Monitor();
|
||||
|
||||
String monitorId = "04";
|
||||
String one ="";
|
||||
if(deptDTO.getName().contains("石家庄")){
|
||||
one= "01";
|
||||
}else if(deptDTO.getName().contains("邯郸")){
|
||||
one= "02";
|
||||
}else if(deptDTO.getName().contains("保定")){
|
||||
one= "03";
|
||||
}else if(deptDTO.getName().contains("沧州")){
|
||||
one= "04";
|
||||
}else if(deptDTO.getName().contains("邢台")){
|
||||
one= "05";
|
||||
}else if(deptDTO.getName().contains("衡水")){
|
||||
one= "06";
|
||||
}else if(deptDTO.getName().contains("超高压")){
|
||||
one= "07";
|
||||
}else {
|
||||
one= "3.14159";
|
||||
String one = "";
|
||||
if (deptDTO.getName().contains("石家庄")) {
|
||||
one = "01";
|
||||
} else if (deptDTO.getName().contains("邯郸")) {
|
||||
one = "02";
|
||||
} else if (deptDTO.getName().contains("保定")) {
|
||||
one = "03";
|
||||
} else if (deptDTO.getName().contains("沧州")) {
|
||||
one = "04";
|
||||
} else if (deptDTO.getName().contains("邢台")) {
|
||||
one = "05";
|
||||
} else if (deptDTO.getName().contains("衡水")) {
|
||||
one = "06";
|
||||
} else if (deptDTO.getName().contains("超高压")) {
|
||||
one = "07";
|
||||
} else {
|
||||
one = "3.14159";
|
||||
}
|
||||
|
||||
String last = String.format("M%05d",oracleTerminalExcel.getId());
|
||||
String last = String.format("M%05d", oracleTerminalExcel.getId());
|
||||
|
||||
monitorPO.setMonitorId(monitorId+one+last);
|
||||
monitorPO.setMonitorId(monitorId + one + last);
|
||||
|
||||
|
||||
monitorPO.setName(oracleTerminalExcel.getLineName());
|
||||
@@ -1579,33 +1620,59 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
||||
|
||||
|
||||
|
||||
if(oracleTerminalExcel.getLoadType().equals("电加热负荷") || oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷") ||oracleTerminalExcel.getLoadType().equals("其他非线性负荷")){
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") ||oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")) {
|
||||
if (objTypeDicMap.containsKey("冶炼负荷")) {
|
||||
String objTypeId = objTypeDicMap.get("冶炼负荷").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
}else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "冶炼负荷字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("半导体制造") ||oracleTerminalExcel.getLoadType().equals("精密加工")){
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get("重要或敏感用户").getId();
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")) {
|
||||
if (objTypeDicMap.containsKey("城市商业")) {
|
||||
String objTypeId = objTypeDicMap.get("城市商业").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
}else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "城市商业字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("二类变电站") ||oracleTerminalExcel.getLoadType().equals("三类变电站") ||oracleTerminalExcel.getLoadType().equals("四类变电站")){
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get("主变低压侧").getId();
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工")) {
|
||||
if (objTypeDicMap.containsKey("敏感用户")) {
|
||||
String objTypeId = objTypeDicMap.get("敏感用户").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
}else {
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "敏感用户字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("二类变电站") || oracleTerminalExcel.getLoadType().equals("三类变电站") || oracleTerminalExcel.getLoadType().equals("四类变电站")) {
|
||||
if (objTypeDicMap.containsKey("主变高压侧")) {
|
||||
String objTypeId = objTypeDicMap.get("主变高压侧").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
}else {
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("跨省计量关口")){
|
||||
if (objTypeDicMap.containsKey("跨省联络线")) {
|
||||
String objTypeId = objTypeDicMap.get("跨省联络线").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "跨省联络线字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("光伏电站")){
|
||||
if (objTypeDicMap.containsKey("光伏电站")) {
|
||||
String objTypeId = objTypeDicMap.get("光伏电站").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "光伏电站字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1621,8 +1688,11 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("电加热负荷")){
|
||||
String objTypeId = objTypeMap.get("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType()+"字典监测点对象类型不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType() + "字典监测点对象类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1668,19 +1738,17 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setCt2(oracleTerminalExcel.getCt2());
|
||||
|
||||
|
||||
if(oracleTerminalExcel.getLoadType().equals("光伏电站") || oracleTerminalExcel.getLoadType().equals("风电场")){
|
||||
if (oracleTerminalExcel.getLoadType().equals("光伏电站") || oracleTerminalExcel.getLoadType().equals("风电场")) {
|
||||
monitorPO.setFieldStation("01");
|
||||
}
|
||||
|
||||
if(oracleTerminalExcel.getPowerFlag() == 0){
|
||||
if (oracleTerminalExcel.getPowerFlag() == 0) {
|
||||
monitorPO.setPowerFlag("101");
|
||||
}else if(oracleTerminalExcel.getPowerFlag() == 1){
|
||||
} else if (oracleTerminalExcel.getPowerFlag() == 1) {
|
||||
monitorPO.setPowerFlag("102");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
||||
monitorPO.setIsUpToGrid(0);
|
||||
monitorMapper.insert(monitorPO);
|
||||
@@ -1724,6 +1792,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -119,6 +120,7 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateStatationStat(StatationStatParam statationStatParam) {
|
||||
//校验同一单位下不能出现同名电站
|
||||
LambdaQueryWrapper<StatationStat> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -130,10 +132,13 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
throw new BusinessException(PmsDeviceResponseEnum.DEPT_STATION_REPEAT);
|
||||
}
|
||||
|
||||
StatationStat res = this.getById(statationStatParam.getPowerId());
|
||||
|
||||
StatationStat statationStat = new StatationStat();
|
||||
BeanUtils.copyProperties(statationStatParam, statationStat);
|
||||
this.updateById(statationStat);
|
||||
|
||||
if(!res.getPowerName().equals(statationStatParam.getPowerName())) {
|
||||
//修改单位名称时候要确保其他台账中的电站名同时修改
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode()).eq(Monitor::getPowerrId, statationStat.getPowerId());
|
||||
@@ -149,6 +154,11 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
}).collect(Collectors.toList());
|
||||
iMonitorService.updateBatchById(monitorListP);
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<GeneratrixWire> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(GeneratrixWire::getStationName,statationStatParam.getPowerName())
|
||||
.eq(GeneratrixWire::getStationId,statationStatParam.getPowerId());
|
||||
pmsGeneratrixWireMapper.update(null,lambdaUpdateWrapper);
|
||||
//台区
|
||||
LambdaQueryWrapper<PowerDistributionarea> powerDistributionareaLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
powerDistributionareaLambdaQueryWrapper.eq(PowerDistributionarea::getStatus, DataStateEnum.ENABLE.getCode()).eq(PowerDistributionarea::getPowerStationId, statationStat.getPowerId());
|
||||
@@ -176,6 +186,7 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
terminalMapper.updateById(pmsTerminalP);
|
||||
});
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.DataParam;
|
||||
@@ -16,9 +13,8 @@ import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.line.LineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -361,4 +357,8 @@ public interface LineFeignClient {
|
||||
*/
|
||||
@PostMapping("/getByName")
|
||||
HttpResult<List<LineDetail>> getByName(@RequestBody LineBaseQueryParam param);
|
||||
|
||||
@GetMapping("/getLevelMonitorIdByDept")
|
||||
HttpResult<List<String>> getLevelMonitorIdByDept(@RequestParam("level") String level,@RequestParam("deptId")String deptId);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ 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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,8 +21,18 @@ import java.util.List;
|
||||
public interface NodeClient {
|
||||
|
||||
|
||||
@ApiOperation("获取全部前置机")
|
||||
/**
|
||||
* 获取全部前置机
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/nodeAllList")
|
||||
HttpResult<List<Node>> nodeAllList();
|
||||
|
||||
/**
|
||||
* 根据id获取前置机
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getNodeById")
|
||||
HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ 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.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.DataParam;
|
||||
@@ -287,6 +288,12 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点名称和电网侧变电站名称模糊搜索: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getLevelMonitorIdByDept(String level, String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据部门查询重要测点id: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@ public class NodeClientFallbackFactory implements FallbackFactory<NodeClient> {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取全部前置机", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Node> getNodeById(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据id获取前置机", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ public enum PvDeviceResponseEnum {
|
||||
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
|
||||
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
||||
NEWSTATION_REPEAT("A0371","新能源场站名称已存在"),
|
||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
||||
GD_OR_NOT("A00550","供电公司名称为空,请检查信息是否存在!"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -225,6 +225,9 @@ public class OracleTerminalExcel implements Serializable {
|
||||
@Excel(name = "监测点对象名称", width = 15)
|
||||
private String objName;
|
||||
|
||||
@Excel(name = "电网侧变电站", width = 15)
|
||||
private String powerSubstationName;
|
||||
|
||||
@Excel(name = "人为干预统计", replace = {"不参与统计_0", "参与统计_1"}, width = 15)
|
||||
@NotNull(message = "统计标志不为空")
|
||||
private Integer statFlag;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 15:07【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class DevComFlagDTO {
|
||||
|
||||
private String id;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime date;
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user