Commit eef4856f authored by chenzhao's avatar chenzhao

任务总览 优化文档代码处理

parent b60eb87e
......@@ -94,11 +94,11 @@ public class HealthStatusIndicatorServiceImpl {
/**
* 夏造风电分析index_key
*/
public static final String INDEX_KEY_FAN = "XZFX#FX%s#ZNFX";
public static final String INDEX_KEY_FAN = "XZFX#ZNFX";
/**
* 泰和光伏分析 index_key
*/
public static final String INDEX_KEY_PV = "THFX#FXGF#ZNFX";
public static final String INDEX_KEY_PV = "THFX#ZNFX";
/**
* 智能分析触发预警系统标识 - 光伏
*/
......@@ -2703,6 +2703,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo.setSourceAttributionDesc(idxBizPvWarningRecord.getStation());
riskBizInfoVo.setWarningObjectType("equip");
riskBizInfoVo.setWarningTime(DateUtil.now());
riskBizInfoVo.setBussId(String.valueOf(idxBizPvWarningRecord.getTs()));
riskBizInfoVo.setWarningObjectLinkUrl(getJumpUrlByInfo(idxBizPvWarningRecord.getKks(), jumpConfigs));
List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>();
RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo();
......@@ -2757,7 +2758,7 @@ public class HealthStatusIndicatorServiceImpl {
log.info("===开始触发风险预警模型===数量为:{}", idxBizFanWarningRecords.size());
idxBizFanWarningRecords.stream().forEach(idxBizFanWarningRecord -> {
BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey(String.format(INDEX_KEY_FAN, idxBizFanWarningRecord.getNumber()));
bizMessage.setIndexKey(INDEX_KEY_FAN);
bizMessage.setIndexValue(idxBizFanWarningRecord.getPointName());
// bizMessage.setTraceId(idxBizFanWarningRecord.getSequenceNbr());
RiskBizInfoVo riskBizInfoVo = new RiskBizInfoVo();
......
......@@ -28,28 +28,28 @@ public interface IMcbWarningService {
* @return 预警信息列表
*/
Page<Map<String, Object>> queryWarningPage(Page<Map<String, Object>> page, Integer processingStatus,
String eventLevel, String createDate, String warningSourceType);
String eventLevel, String createDate,String startTime,String endTime, String warningSourceType,String overView);
/**
* 预警信息总数
*
* @return 预警信息总数
*/
Long queryWarningCount(Integer processingStatus, String eventLevel, String createDate, String warningSourceType);
Long queryWarningCount(Integer processingStatus, String eventLevel, String createDate,String startTime,String endTime, String warningSourceType,String overView);
/**
* 问题信息列表
*
* @return 问题信息列表
*/
Page<Map<String, Object>> queryQuestionPage(Page<Map<String, Object>> page, Integer completionStatus);
Page<Map<String, Object>> queryQuestionPage(Page<Map<String, Object>> page, Integer completionStatus, String startTime, String endTime);
/**
* 问题信息列表
*
* @return 问题信息列表
*/
Long queryQuestionCount(Integer completionStatus);
Long queryQuestionCount(Integer completionStatus, String startTime, String endTime);
/**
* 获取地图点位/路线
......@@ -94,4 +94,7 @@ public interface IMcbWarningService {
Object getLampListByCodes(String questionRectificationStatus, String warningSourceType, String objectName);
List<Map<String, Object>> stationOverNum();
Object stationOverTotal(String province);
}
......@@ -63,10 +63,13 @@ public class McbWarningController {
@RequestParam(value = "processingStatus", required = false) Integer processingStatus,
@RequestParam(value = "eventLevel", required = false) String eventLevel,
@RequestParam(value = "createDate", required = false) String createDate,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "overView", required = false) String overView,
@RequestParam(value = "warningSourceType", required = false) String warningSourceType) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
return ResponseHelper.buildResponse(
mcbWarningService.queryWarningPage(page, processingStatus, eventLevel, createDate, warningSourceType));
mcbWarningService.queryWarningPage(page, processingStatus, eventLevel, createDate, startTime,endTime, warningSourceType,overView));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -76,8 +79,11 @@ public class McbWarningController {
@RequestParam(value = "processingStatus", required = false) Integer processingStatus,
@RequestParam(value = "eventLevel", required = false) String eventLevel,
@RequestParam(value = "createDate", required = false) String createDate,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "overView", required = false) String overView,
@RequestParam(value = "warningSourceType", required = false) String warningSourceType) {
Long count = mcbWarningService.queryWarningCount(processingStatus, eventLevel, createDate, warningSourceType);
Long count = mcbWarningService.queryWarningCount(processingStatus, eventLevel,createDate, startTime,endTime, warningSourceType,overView);
Map<String, Object> result = new HashMap<String, Object>() {
{
this.put("count", count);
......@@ -92,9 +98,12 @@ public class McbWarningController {
public ResponseModel<Page<Map<String, Object>>> queryQuestionList(
@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize,
@RequestParam(value = "completionStatus", required = false) Integer completionStatus) {
@RequestParam(value = "completionStatus", required = false) Integer completionStatus,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime
) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
return ResponseHelper.buildResponse(mcbWarningService.queryQuestionPage(page, completionStatus));
return ResponseHelper.buildResponse(mcbWarningService.queryQuestionPage(page, completionStatus,startTime,endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -136,8 +145,12 @@ public class McbWarningController {
@ApiOperation(httpMethod = "GET", value = "[监测总览]问题总数", notes = "[监测总览]问题总数")
@GetMapping(value = "/question/count")
public ResponseModel<Map<String, Object>> queryQuestionCount(
@RequestParam(value = "completionStatus", required = false) Integer completionStatus) {
Long count = mcbWarningService.queryQuestionCount(completionStatus);
@RequestParam(value = "completionStatus", required = false) Integer completionStatus,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime
) {
Long count = mcbWarningService.queryQuestionCount(completionStatus,startTime,endTime);
Map<String, Object> result = new HashMap<String, Object>() {
{
this.put("count", count);
......@@ -180,4 +193,19 @@ public class McbWarningController {
@RequestParam(value = "objectName", required = false) String objectName) {
return ResponseHelper.buildResponse(mcbWarningService.getLampListByCodes(questionRectificationStatus,warningSourceType,objectName));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "任务总览-地图接口", notes = "任务总览-地图接口")
@GetMapping(value = "/warning-warning-info/stationOverNum")
public ResponseModel<Object> stationOverNum() {
return ResponseHelper.buildResponse(mcbWarningService.stationOverNum());
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "任务总览-地图接口", notes = "任务总览-地图接口")
@GetMapping(value = "/warning-warning-info/stationOverTotal")
public ResponseModel<Object> stationOverTotal(String province) {
return ResponseHelper.buildResponse(mcbWarningService.stationOverTotal(province));
}
}
......@@ -40,7 +40,10 @@ public interface McbWarningMapper extends BaseMapper {
@Param("processingStatus") Integer processingStatus,
@Param("eventLevel") String eventLevel,
@Param("createDate") String createDate,
@Param("warningSourceType") String warningSourceType
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("warningSourceType") String warningSourceType,
@Param("overView") String overView
);
/**
......@@ -53,7 +56,10 @@ public interface McbWarningMapper extends BaseMapper {
@Param("processingStatus") Integer processingStatus,
@Param("eventLevel") String eventLevel,
@Param("createDate") String createDate,
@Param("warningSourceType") String warningSourceType
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("warningSourceType") String warningSourceType,
@Param("overView") String overView
);
/**
......@@ -65,9 +71,14 @@ public interface McbWarningMapper extends BaseMapper {
@Param("start") Long start,
@Param("offset") Long offset,
@Param("projectOrgCodes") List<String> projectOrgCodes,
@Param("completionStatus") Integer completionStatus
@Param("completionStatus") Integer completionStatus,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
List<Map<String, Object>> stationOverNum();
/**
* 问题总数
*
......@@ -75,6 +86,12 @@ public interface McbWarningMapper extends BaseMapper {
*/
Long queryQuestionCount(
@Param("projectOrgCodes") List<String> projectOrgCodes,
@Param("completionStatus") Integer completionStatus
@Param("completionStatus") Integer completionStatus,
@Param("startTime") String startTime,
@Param("endTime") String endTime
);
Integer getYearTotal(String province);
Integer getMonthTotal(String province);
Integer getDayTotal(String province);
}
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.mcbwarningmapper.McbWarningMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -71,7 +72,7 @@ public class McbWarningServiceImpl implements IMcbWarningService {
*/
@Override
public Page<Map<String, Object>> queryWarningPage(Page<Map<String, Object>> page, Integer processingStatus,
String eventLevel, String createDate, String warningSourceType) {
String eventLevel, String createDate,String startTime,String endTime, String warningSourceType,String overView) {
List<String> projectOrgCodes = this.getProjectOrgCodes();
long start = page.getCurrent() - 1;
long offset = page.getSize() * page.getCurrent();
......@@ -79,9 +80,9 @@ public class McbWarningServiceImpl implements IMcbWarningService {
projectOrgCodes.add("NULL");
}
List<Map<String, Object>> records = mcbWarningMapper.queryWarningList(start, offset, projectOrgCodes,
processingStatus, eventLevel, createDate, warningSourceType);
Long total = mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,
warningSourceType);
processingStatus, eventLevel, createDate,startTime,endTime, warningSourceType,overView);
Long total = mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,startTime,endTime,
warningSourceType,overView);
page.setRecords(records);
page.setTotal(total);
return page;
......@@ -94,14 +95,14 @@ public class McbWarningServiceImpl implements IMcbWarningService {
* @return 预警信息总数
*/
@Override
public Long queryWarningCount(Integer processingStatus, String eventLevel, String createDate,
String warningSourceType) {
public Long queryWarningCount(Integer processingStatus, String eventLevel, String createDate,String startTime,String endTime,
String warningSourceType,String overView) {
List<String> projectOrgCodes = this.getProjectOrgCodes();
if (projectOrgCodes.isEmpty()) {
projectOrgCodes.add("NULL");
}
return mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,
warningSourceType);
return mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,startTime,endTime,
warningSourceType,overView);
}
/**
......@@ -112,7 +113,7 @@ public class McbWarningServiceImpl implements IMcbWarningService {
* @return 问题信息列表
*/
@Override
public Page<Map<String, Object>> queryQuestionPage(Page<Map<String, Object>> page, Integer completionStatus) {
public Page<Map<String, Object>> queryQuestionPage(Page<Map<String, Object>> page, Integer completionStatus, String startTime, String endTime) {
List<String> projectOrgCodes = this.getProjectOrgCodes();
long start = page.getCurrent() - 1;
long offset = page.getSize() * page.getCurrent();
......@@ -120,8 +121,8 @@ public class McbWarningServiceImpl implements IMcbWarningService {
projectOrgCodes.add("NULL");
}
List<Map<String, Object>> records = mcbWarningMapper.queryQuestionList(start, offset, projectOrgCodes,
completionStatus);
Long total = mcbWarningMapper.queryQuestionCount(projectOrgCodes, completionStatus);
completionStatus,startTime,endTime);
Long total = mcbWarningMapper.queryQuestionCount(projectOrgCodes, completionStatus,startTime,endTime);
page.setRecords(records);
page.setTotal(total);
return page;
......@@ -134,12 +135,12 @@ public class McbWarningServiceImpl implements IMcbWarningService {
* @return 问题信息列表
*/
@Override
public Long queryQuestionCount(Integer completionStatus) {
public Long queryQuestionCount(Integer completionStatus, String startTime, String endTime) {
List<String> projectOrgCodes = this.getProjectOrgCodes();
if (projectOrgCodes.isEmpty()) {
projectOrgCodes.add("NULL");
}
return mcbWarningMapper.queryQuestionCount(projectOrgCodes, completionStatus);
return mcbWarningMapper.queryQuestionCount(projectOrgCodes, completionStatus,startTime,endTime);
}
/**
......@@ -310,4 +311,20 @@ public class McbWarningServiceImpl implements IMcbWarningService {
return projectOrgCodes;
}
public List<Map<String, Object>> stationOverNum(){
return mcbWarningMapper.stationOverNum();
}
public Map<String,Object> stationOverTotal(String province){
Map<String, Object> map = new HashMap<>();
map.put("dayNum",mcbWarningMapper.getDayTotal(province));
map.put("monNum",mcbWarningMapper.getMonthTotal(province));
map.put("yearNum",mcbWarningMapper.getYearTotal(province));
return map;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment