1.无线设bug修改
2.添加测试项每日扫描功能
This commit is contained in:
@@ -1,269 +0,0 @@
|
||||
//package com.njcn.csharmonic.controller;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//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.harmonic.pojo.param.ReportSearchParam;
|
||||
//import com.njcn.harmonic.pojo.param.ReportTemplateParam;
|
||||
//import com.njcn.harmonic.pojo.po.ExcelRptTemp;
|
||||
//import com.njcn.harmonic.pojo.vo.ReportTemplateVO;
|
||||
//import com.njcn.harmonic.pojo.vo.ReportTreeVO;
|
||||
//import com.njcn.harmonic.pojo.vo.SysDeptTempVO;
|
||||
//import com.njcn.harmonic.service.CustomReportService;
|
||||
//import com.njcn.web.controller.BaseController;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiImplicitParam;
|
||||
//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.*;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * pqs
|
||||
// * 用户自定义报表
|
||||
// * @author cdf
|
||||
// * @date 2022/8/15
|
||||
// */
|
||||
//
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/customReport")
|
||||
//@Api(tags = "用户自定义报表")
|
||||
//@AllArgsConstructor
|
||||
//public class CsCustomReportController extends BaseController {
|
||||
//
|
||||
// private final CustomReportService customReportService;
|
||||
//
|
||||
// /**
|
||||
// * 新增自定义报表模板
|
||||
// * @author cdf
|
||||
// * @date 2022/10/19
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.ADD)
|
||||
// @PostMapping("/addTemplate")
|
||||
// @ApiOperation("新增自定义报表模板")
|
||||
// public HttpResult<Boolean> addCustomReportTemplate(@Validated ReportTemplateParam reportTemplateParam){
|
||||
// String methodDescribe = getMethodDescribe("addCustomReportTemplate");
|
||||
// boolean res = customReportService.addCustomReportTemplate(reportTemplateParam);
|
||||
// if(res){
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询所有模板
|
||||
// * @author qijian
|
||||
// * @date 2022/10/14
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/getTemplateList")
|
||||
// @ApiOperation("查询报表模板")
|
||||
// @ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||
// public HttpResult<List<ReportTemplateVO>> getTemplateList(@RequestBody ReportSearchParam reportSearchParam){
|
||||
// String methodDescribe = getMethodDescribe("getTemplateList");
|
||||
// List<ReportTemplateVO> list = customReportService.getTemplateList(reportSearchParam);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据部门查询模板
|
||||
// * @author qijian
|
||||
// * @date 2022/10/19
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/getTemplateByDept")
|
||||
// @ApiOperation("根据部门查询模板")
|
||||
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
// public HttpResult<List<ReportTemplateVO>> getTemplateByDept(@RequestParam("id") String id){
|
||||
// String methodDescribe = getMethodDescribe("getTemplateList");
|
||||
// List<ReportTemplateVO> list = customReportService.getTemplateByDept(id);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除模板
|
||||
// * @author qijian
|
||||
// * @date 2022/10/18
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.DELETE)
|
||||
// @PostMapping("/delTemplate")
|
||||
// @ApiOperation("删除报表模板")
|
||||
// @ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||
// public HttpResult<Boolean> delTemplate(@RequestBody ReportSearchParam reportSearchParam){
|
||||
// String methodDescribe = getMethodDescribe("delTemplate");
|
||||
// boolean res = customReportService.delTemplate(reportSearchParam);
|
||||
// if(res){
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据id查询模板详情
|
||||
// * @author qijian
|
||||
// * @date 2022/10/14
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/getCustomReportTemplateById")
|
||||
// @ApiOperation("根据id查询模板详情")
|
||||
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
// public HttpResult<ExcelRptTemp> getCustomReportTemplateById(@RequestParam("id") String id){
|
||||
// String methodDescribe = getMethodDescribe("getCustomReportTemplateById");
|
||||
// ExcelRptTemp excelRptTemp = customReportService.getCustomReportTemplateById(id);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, excelRptTemp, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据id回显模板
|
||||
// * @author qijian
|
||||
// * @date 2022/10/14
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/viewCustomReportTemplateById")
|
||||
// @ApiOperation("根据id查询模板详情")
|
||||
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
// public void viewCustomReportTemplateById(@RequestParam("id") String id,HttpServletResponse response){
|
||||
// customReportService.viewCustomReportTemplateById(id,response);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改自定义报表模板
|
||||
// * @author qijian
|
||||
// * @date 2022/10/18
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||
// @PostMapping("/updateTemplate")
|
||||
// @ApiOperation("修改自定义报表模板")
|
||||
// public HttpResult<Boolean> updateCustomReportTemplate(@Validated ReportTemplateParam.UpdateReportTemplateParam reportTemplateParam){
|
||||
// String methodDescribe = getMethodDescribe("updateCustomReportTemplate");
|
||||
// boolean res = customReportService.updateCustomReportTemplate(reportTemplateParam);
|
||||
// if(res){
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 绑定/解绑模板数据
|
||||
// * @author qijian
|
||||
// * @date 2022/10/19
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||
// @PostMapping("/updateBindTemplate")
|
||||
// @ApiOperation("绑定/解绑模板数据")
|
||||
// @ApiImplicitParam(name = "reportSearchParams", value = "实体参数", required = false)
|
||||
// public HttpResult<Boolean> updateBindTemplate(@RequestBody List<ReportSearchParam> reportSearchParams){
|
||||
// String methodDescribe = getMethodDescribe("updateBindTemplate");
|
||||
// boolean res = customReportService.updateBindTemplate(reportSearchParams);
|
||||
// if(res){
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据模板ID查询数据
|
||||
// * @author qijian
|
||||
// * @date 2022/10/19
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/getDataByTempId")
|
||||
// @ApiOperation("根据模板ID查询数据")
|
||||
// @ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
// public HttpResult<List<SysDeptTempVO>> getDataByTempId(@RequestParam("id")String id){
|
||||
// String methodDescribe = getMethodDescribe("getDataByTempId");
|
||||
// List<SysDeptTempVO> list = customReportService.getDataByTempId(id);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改激活状态
|
||||
// * @author qijian
|
||||
// * @date 2022/10/17
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||
// @PostMapping("/updateTemplateActive")
|
||||
// @ApiOperation("修改激活状态")
|
||||
// @ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||
// public HttpResult<Page<ExcelRptTemp>> updateTemplateActive(@RequestBody ReportSearchParam reportSearchParam){
|
||||
// String methodDescribe = getMethodDescribe("updateTemplateActive");
|
||||
// boolean res = customReportService.updateStatus(reportSearchParam);
|
||||
// if(res){
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }else {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取报表模板树
|
||||
// * @author cdf
|
||||
// * @date 2022/8/16
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/reportChooseTree")
|
||||
// @ApiOperation("获取报表模板树")
|
||||
// public HttpResult<List<ReportTreeVO>> reportChooseTree(){
|
||||
// String methodDescribe = getMethodDescribe("reportChooseTree");
|
||||
// List<ReportTreeVO> res = customReportService.reportChooseTree();
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 替换报表数据并返回
|
||||
// * @author qijian
|
||||
// * @date 2022/10/19
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/getCustomReport")
|
||||
// @ApiOperation("获取报表")
|
||||
// @ApiImplicitParam(name = "reportSearchParam", value = "查询体", required = false)
|
||||
// public void getCustomReport(@RequestBody ReportSearchParam reportSearchParam, HttpServletResponse response) {
|
||||
// String methodDescribe = getMethodDescribe("getCustomReport");
|
||||
// customReportService.getCustomReport(reportSearchParam,response);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取报表指标是否合格模板树
|
||||
// * @author cdf
|
||||
// * @date 2023/10/11
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/targetLimitChooseTree")
|
||||
// @ApiOperation("获取报表指标是否合格模板树")
|
||||
// public HttpResult<List<ReportTreeVO>> targetLimitChooseTree(){
|
||||
// String methodDescribe = getMethodDescribe("targetLimitChooseTree");
|
||||
// List<ReportTreeVO> res = customReportService.targetLimitChooseTree();
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取报表台账模板树
|
||||
// * @author cdf
|
||||
// * @date 2023/10/11
|
||||
// */
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @GetMapping("/terminalChooseTree")
|
||||
// @ApiOperation("获取报表台账模板树")
|
||||
// public HttpResult<List<ReportTreeVO>> terminalChooseTree(){
|
||||
// String methodDescribe = getMethodDescribe("terminalChooseTree");
|
||||
// List<ReportTreeVO> res = customReportService.terminalChooseTree();
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -31,6 +31,8 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.njcn.csharmonic.constant.HarmonicConstant.POWER_LIST;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/6/26 9:14【需求编号】
|
||||
@@ -83,13 +85,25 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
||||
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
||||
if (linePo.getClDid() != 0 && Objects.equals(devicDataTrendQueryParam.getDataLevel(),"Primary") && ObjectUtil.isNotNull(epdPqd.getPrimaryFormula())) {
|
||||
double secondaryData = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), linePo.getPtRatio(), linePo.getCtRatio());
|
||||
if (changePower(epdPqd.getShowName())) {
|
||||
secondaryData = secondaryData/1000;
|
||||
}
|
||||
vo.setStatisticalData(BigDecimal.valueOf(secondaryData).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
||||
} else {
|
||||
vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
||||
Double temVal = statisticalDataDTO.getValue();
|
||||
if (changePower(epdPqd.getShowName())) {
|
||||
temVal = temVal/1000;
|
||||
}
|
||||
vo.setStatisticalData(BigDecimal.valueOf(temVal).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
vo.setStatisticalIndex(temp.getDataId());
|
||||
vo.setStatisticalName(temp.getName());
|
||||
vo.setUnit(temp.getUnit());
|
||||
|
||||
if (changePower(epdPqd.getShowName())) {
|
||||
vo.setUnit("k" + temp.getUnit());
|
||||
} else {
|
||||
vo.setUnit(temp.getUnit());
|
||||
}
|
||||
vo.setAnotherName(temp.getAnotherName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
@@ -97,4 +111,14 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//判断功率是否需要转换
|
||||
public boolean changePower(String name) {
|
||||
return POWER_LIST.stream()
|
||||
.anyMatch(name::contains);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user