高低电压穿越及有功功率趋势算法

This commit is contained in:
guofeihu
2024-08-22 15:25:44 +08:00
parent f27a107bba
commit 957af09daa
18 changed files with 690 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
package com.njcn.prepare.harmonic.controller.event;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 有功功率趋势 前端控制器
* @author guofeihu
* @date 2024/8/21
*/
@Validated
@Slf4j
@RestController
@RequestMapping("/rActivePowerRange")
@Api(tags = "有功功率趋势")
@AllArgsConstructor
public class RActivePowerRangeController extends BaseController {
private final RActivePowerRangeService rActivePowerRangeService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/record")
@ApiOperation("有功功率趋势记录(用于定时任务)")
public HttpResult<Boolean> record() {
String methodDescribe = getMethodDescribe("record");
rActivePowerRangeService.record();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
@PostMapping("/getDataByLineIds")
@ApiOperation("根据监测点ID集合获取有功功率趋势信息")
public HttpResult<List<RActivePowerRangePO>> getDataByLineIds(@RequestBody List<String> lineIds) {
String methodDescribe = getMethodDescribe("getDataByLineIds");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rActivePowerRangeService.getDataByLineIds(lineIds), methodDescribe);
}
}

View File

@@ -0,0 +1,55 @@
package com.njcn.prepare.harmonic.controller.event;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
import com.njcn.prepare.harmonic.service.mysql.event.SpThroughService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 高低电压穿越 前端控制器
* @author guofeihu
* @date 2024/8/21
*/
@Validated
@Slf4j
@RestController
@RequestMapping("/spThrough")
@Api(tags = "高低电压穿越")
@AllArgsConstructor
public class SpThroughController extends BaseController {
private final SpThroughService spThroughService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/record")
@ApiOperation("高低电压穿越记录(用于定时任务)")
public HttpResult<Boolean> record() {
String methodDescribe = getMethodDescribe("record");
spThroughService.record();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
@PostMapping("/getDataByLineIds")
@ApiOperation("根据监测点ID集合获取高低电压穿越信息")
public HttpResult<List<SpThroughPO>> getDataByLineIds(@RequestBody List<String> lineIds) {
String methodDescribe = getMethodDescribe("getDataByLineIds");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, spThroughService.getDataByLineIds(lineIds), methodDescribe);
}
}

View File

@@ -0,0 +1,13 @@
package com.njcn.prepare.harmonic.mapper.mysql.event;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
/**
* 有功功率趋势 Mapper 接口
* @author guofeihu
* @since 2024-08-20
*/
public interface RActivePowerRangeMapper extends MppBaseMapper<RActivePowerRangePO> {
}

View File

@@ -0,0 +1,13 @@
package com.njcn.prepare.harmonic.mapper.mysql.event;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
/**
* 高低电压穿越 Mapper 接口
* @author guofeihu
* @since 2024-08-22
*/
public interface SpThroughMapper extends MppBaseMapper<SpThroughPO> {
}

View File

@@ -0,0 +1,42 @@
<?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.prepare.harmonic.mapper.mysql.event.RActivePowerRangeMapper">
<resultMap id="BaseResultMap" type="com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="line_id" jdbcType="VARCHAR" property="lineId" />
<result column="time_id" jdbcType="DATE" property="timeId"/>
<result column="mins_time0" jdbcType="VARCHAR" property="minsTime0" />
<result column="mins_num0" jdbcType="INTEGER" property="minsNum0" />
<result column="is_or_not0" jdbcType="INTEGER" property="isOrNot0" />
<result column="mins_time1" jdbcType="VARCHAR" property="minsTime1" />
<result column="mins_num1" jdbcType="INTEGER" property="minsNum1" />
<result column="is_or_not1" jdbcType="INTEGER" property="isOrNot1" />
<result column="mins_time2" jdbcType="VARCHAR" property="minsTime2" />
<result column="mins_num2" jdbcType="INTEGER" property="minsNum2" />
<result column="is_or_not2" jdbcType="INTEGER" property="isOrNot2" />
<result column="mins_time3" jdbcType="VARCHAR" property="minsTime3" />
<result column="mins_num3" jdbcType="INTEGER" property="minsNum3" />
<result column="is_or_not3" jdbcType="INTEGER" property="isOrNot3" />
<result column="mins_time4" jdbcType="VARCHAR" property="minsTime4" />
<result column="mins_num4" jdbcType="INTEGER" property="minsNum4" />
<result column="is_or_not4" jdbcType="INTEGER" property="isOrNot4" />
<result column="mins_time5" jdbcType="VARCHAR" property="minsTime5" />
<result column="mins_num5" jdbcType="INTEGER" property="minsNum5" />
<result column="is_or_not5" jdbcType="INTEGER" property="isOrNot5" />
<result column="mins_time6" jdbcType="VARCHAR" property="minsTime6" />
<result column="mins_num6" jdbcType="INTEGER" property="minsNum6" />
<result column="is_or_not6" jdbcType="INTEGER" property="isOrNot6" />
<result column="mins_time7" jdbcType="VARCHAR" property="minsTime7" />
<result column="mins_num7" jdbcType="INTEGER" property="minsNum7" />
<result column="is_or_not7" jdbcType="INTEGER" property="isOrNot7" />
<result column="mins_time8" jdbcType="VARCHAR" property="minsTime8" />
<result column="mins_num8" jdbcType="INTEGER" property="minsNum8" />
<result column="is_or_not8" jdbcType="INTEGER" property="isOrNot8" />
<result column="mins_time9" jdbcType="VARCHAR" property="minsTime9" />
<result column="mins_num9" jdbcType="INTEGER" property="minsNum9" />
<result column="is_or_not9" jdbcType="INTEGER" property="isOrNot9" />
<result column="state" jdbcType="INTEGER" property="state" />
</resultMap>
</mapper>

View File

@@ -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.prepare.harmonic.mapper.mysql.event.SpThroughMapper">
</mapper>

View File

@@ -0,0 +1,27 @@
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.prepare.harmonic.mapper.mysql.event.RActivePowerRangeMapper;
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 有功功率趋势 服务实现类
* @author guofeihu
* @since 2024-08-22
*/
@Service
public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRangeMapper, RActivePowerRangePO> implements RActivePowerRangeService {
@Override
public void record() {
}
@Override
public List<RActivePowerRangePO> getDataByLineIds(List<String> lineIds) {
return null;
}
}

View File

@@ -0,0 +1,27 @@
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.prepare.harmonic.mapper.mysql.event.SpThroughMapper;
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
import com.njcn.prepare.harmonic.service.mysql.event.SpThroughService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 高低电压穿越 服务实现类
* @author guofeihu
* @since 2024-08-22
*/
@Service
public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThroughPO> implements SpThroughService {
@Override
public void record() {
}
@Override
public List<SpThroughPO> getDataByLineIds(List<String> lineIds) {
return null;
}
}

View File

@@ -0,0 +1,24 @@
package com.njcn.prepare.harmonic.service.mysql.event;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
import java.util.List;
/**
* 有功功率趋势 服务类
* @author guofeihu
* @since 2024-08-22
*/
public interface RActivePowerRangeService extends IMppService<RActivePowerRangePO> {
/**
* 有功功率趋势记录(用于定时任务)
*/
void record();
/**
* 根据监测点ID集合获取有功功率趋势信息
*/
List<RActivePowerRangePO> getDataByLineIds(List<String> lineIds);
}

View File

@@ -0,0 +1,24 @@
package com.njcn.prepare.harmonic.service.mysql.event;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
import java.util.List;
/**
* 高低电压穿越 服务类
* @author guofeihu
* @since 2024-08-22
*/
public interface SpThroughService extends IMppService<SpThroughPO> {
/**
* 高低电压穿越记录(用于定时任务)
*/
void record();
/**
* 根据监测点ID集合获取高低电压穿越信息
*/
List<SpThroughPO> getDataByLineIds(List<String> lineIds);
}