合并代码
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
package com.njcn.harmonic.controller.algorithm;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
|
||||
import com.njcn.harmonic.enums.HarmonicResponseEnum;
|
||||
import com.njcn.harmonic.pojo.param.RStatFileVO;
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
||||
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
||||
import com.njcn.minio.bo.MinIoUploadResDTO;
|
||||
import com.njcn.minio.config.MinIoProperties;
|
||||
import com.njcn.minio.utils.MinIoUtils;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "算法")
|
||||
@RequestMapping("/algorithm")
|
||||
public class AlgorithmController extends BaseController {
|
||||
|
||||
private final RStatFileService rStatFileService;
|
||||
|
||||
@Resource
|
||||
private MinIoUtils minIoUtils;
|
||||
@Resource
|
||||
private MinIoProperties minIoProperties;
|
||||
|
||||
/**
|
||||
* 算法保存
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getAlgorithmSave")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("算法保存")
|
||||
@ApiImplicitParam(name = "param", value = "算发内容", required = true)
|
||||
public HttpResult<Boolean> getAlgorithmSave(@RequestBody RStatFileVO param) {
|
||||
String methodDescribe = getMethodDescribe("getAlgorithmSave");
|
||||
RStatFile rStatFile = BeanUtil.copyProperties(param, RStatFile.class);
|
||||
boolean b = rStatFileService.updateById(rStatFile);
|
||||
if(b){
|
||||
// minIoUtils.removeObjects( minIoProperties.getBucket(),param.getAddress());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/getAlgorithmAll")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("算法查询")
|
||||
public HttpResult<List<RStatFile>> getAlgorithmAll() {
|
||||
String methodDescribe = getMethodDescribe("getAlgorithmAll");
|
||||
List<RStatFile> list = rStatFileService.list();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求
|
||||
*/
|
||||
@PostMapping("/common/upload")
|
||||
@ResponseBody
|
||||
public HttpResult<MinIoUploadResDTO> uploadFile(MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "algorithm/");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, upload, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用删除请求
|
||||
*/
|
||||
// @PostMapping("/common/delete")
|
||||
// @ResponseBody
|
||||
// public HttpResult<MinIoUploadResDTO> delete()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// List<String> aaa=new ArrayList<>();
|
||||
// aaa.add("algorithm/0CA99CB427A94A8A833499A41C557405.png");
|
||||
// aaa.add("algorithm/07D8A0FD304A42CDB73F514FBEE641BC.png");
|
||||
// minIoUtils.removeObjects( minIoProperties.getBucket(),aaa);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, null);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.harmonic.controller.distribution;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.service.majornetwork.RStatHarmonicOrgMService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 wr
|
||||
* @createTime: 2022-12-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pwOverview")
|
||||
@Slf4j
|
||||
@Api(tags = "分布式光伏概览")
|
||||
@RequiredArgsConstructor
|
||||
public class PwOverviewController extends BaseController {
|
||||
|
||||
private final RStatHarmonicOrgMService rStatHarmonicOrgMService;
|
||||
|
||||
|
||||
@PostMapping("/getAlarmProportion")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("告警监测点数占比")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<OverviewVO.GroupVO>> getAlarmProportion(@RequestBody OverviewParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAlarmProportion");
|
||||
List<OverviewVO.GroupVO> monitorYoY = rStatHarmonicOrgMService.getExcessiveProportion(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorYoY, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* 配网指标分类概览-监测点分类总览
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-09
|
||||
*/
|
||||
@RestController
|
||||
|
||||
@@ -55,7 +55,7 @@ public class PwRStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
org = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param,2);
|
||||
org = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param, 2);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
@@ -81,12 +81,12 @@ public class PwRStatHarmonicOrgController extends BaseController {
|
||||
@ApiImplicitParam(name = "param", value = "各单位超标监测统计参数", required = true)
|
||||
public HttpResult<List<RIconVO>> getPwRStatHarmonicOrgIcon(@RequestBody RStatHarmonicMParam param) {
|
||||
String methodDescribe = getMethodDescribe("getPwRStatHarmonicOrgIcon");
|
||||
List<RIconVO> icon= null;
|
||||
List<RIconVO> icon = null;
|
||||
String string = param.getType().toString();
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
icon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param,2);
|
||||
icon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param, 2);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param,1);
|
||||
rStatHarmonicOrgMAll = rStatHarmonicOrgYService.getPwRStatHarmonicYOldAll(param, 1);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
@@ -86,7 +86,7 @@ public class RStatHarmonicOrgController extends BaseController {
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数统计图-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param,1);
|
||||
getAllRStatHarmonicOrgIcon = rStatHarmonicOrgYService.getPwRStatHarmonicOrgYOldIcon(param, 1);
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
|
||||
@@ -82,7 +82,7 @@ public class RStatOrgController extends BaseController {
|
||||
@GetMapping("/getRStatSubstation")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("区域稳态指标超标分类统计表")
|
||||
public HttpResult<List<RStatSubstationOrg2VO> > getRStatSubstation(StatisticsBizBaseParam param) {
|
||||
public HttpResult<List<RStatSubstationOrg2VO>> getRStatSubstation(StatisticsBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRStatSubstation");
|
||||
List<RStatSubstationOrg2VO> statSubstationIcon = rStatOrgYService.getRStatSubstationOrg(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, statSubstationIcon, methodDescribe);
|
||||
|
||||
@@ -38,6 +38,7 @@ public class RStatOrgPvPowerQualityController extends BaseController {
|
||||
|
||||
/**
|
||||
* 低功率因数统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -53,6 +54,7 @@ public class RStatOrgPvPowerQualityController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,7 @@ public class WindFarmController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -55,6 +56,7 @@ public class WindFarmController extends BaseController {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user