1.pqbug修改

This commit is contained in:
wr
2023-06-02 16:36:25 +08:00
parent 7f71e9e5d8
commit e37fbf4f47
7 changed files with 128 additions and 86 deletions

View File

@@ -6,7 +6,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.event.mapper.majornetwork.EventDetailMapper;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.vo.GeneralVO;
import com.njcn.event.service.majornetwork.EventDetailService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author denghuajun
@@ -35,6 +38,7 @@ import java.util.List;
public class EventDetailController extends BaseController {
private final EventDetailService eventDetailService;
private final EventDetailMapper eventDetailMapper;
/**
* 获取暂降事件
@@ -124,6 +128,17 @@ public class EventDetailController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/**
* 根据监测点集合获取短时终端,电压暂升,电压暂降
* @return
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getEventDetailCount")
@ApiOperation("根据监测点集合获取各个监测点的统计类型数量")
public HttpResult<List<GeneralVO>> getEventDetail(@RequestBody Map<String, Object> condMap) {
String methodDescribe = getMethodDescribe("getEventDetail");
List<GeneralVO> generalVOS = eventDetailMapper.ListEventType(condMap);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, generalVOS, methodDescribe);
}
}

View File

@@ -18,9 +18,9 @@
<select id="ListEventType" resultType="com.njcn.event.pojo.vo.GeneralVO">
SELECT
id,
IF(`event_type` =#{condMap.Voltage_Dip}, num, 0) as sagsCount,
IF(`event_type` = #{condMap.Short_Interruptions}, num, 0) as breakCount,
IF(`event_type` = #{condMap.Voltage_Rise}, num, 0) as upCount
sum(IF(`event_type` =#{condMap.Voltage_Dip}, num, 0)) as sagsCount,
sum(IF(`event_type` = #{condMap.Short_Interruptions}, num, 0)) as breakCount,
sum(IF(`event_type` = #{condMap.Voltage_Rise}, num, 0)) as upCount
from(
SELECT
measurement_point_id AS id,
@@ -41,6 +41,7 @@
GROUP BY
measurement_point_id,event_type
) a
GROUP BY id
</select>
</mapper>

View File

@@ -1083,7 +1083,7 @@ public class ReportServiceImpl implements ReportService {
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
sheetAt.setColumnWidth(3, 24 * 256);
sheetAt.setColumnWidth(3, 44 * 256);
sheetAt.setColumnWidth(4, 24 * 256);
sheetAt.setColumnWidth(5, 24 * 256);
sheetAt.setColumnWidth(6, 24 * 256);
@@ -1164,7 +1164,7 @@ public class ReportServiceImpl implements ReportService {
cell6.setCellValue(vo.getLoadType());
cell7.setCellValue(vo.getFeatureAmplitude()*100);
cell8.setCellValue(vo.getDuration());
cell9.setCellValue(vo.getSeverity());
cell9.setCellValue(BigDecimal.valueOf(vo.getSeverity()).setScale(2, RoundingMode.HALF_UP).doubleValue());
}
}
@@ -1279,11 +1279,11 @@ public class ReportServiceImpl implements ReportService {
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
sheetAt.setColumnWidth(3, 24 * 256);
sheetAt.setColumnWidth(3, 44 * 256);
sheetAt.setColumnWidth(4, 24 * 256);
sheetAt.setColumnWidth(5, 24 * 256);
sheetAt.setColumnWidth(6, 24 * 256);
sheetAt.setColumnWidth(7, 24 * 256);
sheetAt.setColumnWidth(7, 50 * 256);
sheetAt.setColumnWidth(8, 24 * 256);
sheetAt.setColumnWidth(9, 24 * 256);
sheetAt.setColumnWidth(10, 24 * 256);
@@ -1320,9 +1320,9 @@ public class ReportServiceImpl implements ReportService {
setCellStyle(r1Cell4, "监测点", cellStyle);
setCellStyle(r1Cell5, "监测点电压等级", cellStyle);
setCellStyle(r1Cell6, "干扰源类型", cellStyle);
setCellStyle(r1Cell7, "暂降(骤升)幅值(%)", cellStyle);
setCellStyle(r1Cell8, "持续时间(s)", cellStyle);
setCellStyle(r1Cell9, "暂态事件严重度", cellStyle);
setCellStyle(r1Cell7, "监测点对象名称", cellStyle);
setCellStyle(r1Cell8, "暂降(骤升)幅值(%)", cellStyle);
setCellStyle(r1Cell9, "持续时间(s)", cellStyle);
setCellStyle(r1Cell10, "暂态类型(机器判断)", cellStyle);
List<DetailVO> severity = sheetDetailed(businessParam);
for (int i = 0; i < severity.size(); i++) {
@@ -1360,7 +1360,7 @@ public class ReportServiceImpl implements ReportService {
cell4.setCellValue(vo.getLineName());
cell5.setCellValue(vo.getVoltageScale());
cell6.setCellValue(vo.getLoadType());
cell7.setCellValue(vo.getObjName());
cell7.setCellValue(vo.getObjName()==null||vo.getObjName()==""?"/":vo.getObjName());
cell8.setCellValue(vo.getFeatureAmplitude()*100);
cell9.setCellValue(vo.getDuration());
cell10.setCellValue(vo.getAdvanceType());
@@ -1370,11 +1370,11 @@ public class ReportServiceImpl implements ReportService {
public void sheet5(HSSFWorkbook sheets,HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle ,DeviceInfoParam.BusinessParam businessParam){
sheets.createSheet("暂降次数统计");
HSSFSheet sheetAt = sheets.getSheetAt(4);
sheetAt.setColumnWidth(0, 9 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 30 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
sheetAt.setColumnWidth(3, 24 * 256);
sheetAt.setColumnWidth(4, 24 * 256);
sheetAt.setColumnWidth(3, 50 * 256);
sheetAt.setColumnWidth(4, 44 * 256);
sheetAt.setColumnWidth(5, 24 * 256);
sheetAt.setColumnWidth(6, 24 * 256);
sheetAt.addMergedRegion(new CellRangeAddress(0, 1, 0, 0));
@@ -1427,7 +1427,7 @@ public class ReportServiceImpl implements ReportService {
cell0.setCellValue(i+1);
cell1.setCellValue(vo.getLineName());
cell2.setCellValue(vo.getLoadType());
cell3.setCellValue(vo.getObjName());
cell3.setCellValue(vo.getObjName()==null||vo.getObjName()==""?"/":vo.getObjName());
cell4.setCellValue(vo.getSubName());
cell5.setCellValue(vo.getGdName());
cell6.setCellValue(vo.getTimes());
@@ -1437,11 +1437,11 @@ public class ReportServiceImpl implements ReportService {
public void sheet6(HSSFWorkbook sheets,HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle ,DeviceInfoParam.BusinessParam businessParam){
sheets.createSheet("暂升次数统计");
HSSFSheet sheetAt = sheets.getSheetAt(5);
sheetAt.setColumnWidth(0, 9 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 30 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
sheetAt.setColumnWidth(3, 24 * 256);
sheetAt.setColumnWidth(4, 24 * 256);
sheetAt.setColumnWidth(3, 50 * 256);
sheetAt.setColumnWidth(4, 44 * 256);
sheetAt.setColumnWidth(5, 24 * 256);
sheetAt.setColumnWidth(6, 24 * 256);
sheetAt.addMergedRegion(new CellRangeAddress(0, 1, 0, 0));
@@ -1494,7 +1494,7 @@ public class ReportServiceImpl implements ReportService {
cell0.setCellValue(i+1);
cell1.setCellValue(vo.getLineName());
cell2.setCellValue(vo.getLoadType());
cell3.setCellValue(vo.getObjName());
cell3.setCellValue(vo.getObjName()==null||vo.getObjName()==""?"/":vo.getObjName());
cell4.setCellValue(vo.getSubName());
cell5.setCellValue(vo.getGdName());
cell6.setCellValue(vo.getTimes());
@@ -1504,11 +1504,11 @@ public class ReportServiceImpl implements ReportService {
public void sheet7(HSSFWorkbook sheets,HSSFCellStyle cellStyle, HSSFCellStyle bodyStyle ,DeviceInfoParam.BusinessParam businessParam){
sheets.createSheet("短时中断次数统计");
HSSFSheet sheetAt = sheets.getSheetAt(6);
sheetAt.setColumnWidth(0, 9 * 256);
sheetAt.setColumnWidth(1, 24 * 256);
sheetAt.setColumnWidth(0, 24 * 256);
sheetAt.setColumnWidth(1, 30 * 256);
sheetAt.setColumnWidth(2, 24 * 256);
sheetAt.setColumnWidth(3, 24 * 256);
sheetAt.setColumnWidth(4, 24 * 256);
sheetAt.setColumnWidth(3, 50 * 256);
sheetAt.setColumnWidth(4, 44 * 256);
sheetAt.setColumnWidth(5, 24 * 256);
sheetAt.setColumnWidth(6, 24 * 256);
sheetAt.addMergedRegion(new CellRangeAddress(0, 1, 0, 0));
@@ -1561,7 +1561,7 @@ public class ReportServiceImpl implements ReportService {
cell0.setCellValue(i+1);
cell1.setCellValue(vo.getLineName());
cell2.setCellValue(vo.getLoadType());
cell3.setCellValue(vo.getObjName());
cell3.setCellValue(vo.getObjName()==null||vo.getObjName()==""?"/":vo.getObjName());
cell4.setCellValue(vo.getSubName());
cell5.setCellValue(vo.getGdName());
cell6.setCellValue(vo.getTimes());