Browse Source

#流程bug

zhongwei
yang_shj 1 year ago
parent
commit
ad71a6a5a7
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java
  2. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskPlanMapper.java
  3. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskPlanService.java
  4. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/ObjectServiceImpl.java
  5. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskPlanServiceImpl.java
  6. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  7. 2
      hzims-service/hzims-scheduled/src/main/resources/mapper/inspect/TaskPlanMapper.xml
  8. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  9. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java
  10. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskMapper.java

@ -1,13 +1,13 @@
package com.hnac.hzims.scheduled.mapper.inspect; package com.hnac.hzims.scheduled.mapper.inspect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/** /**
* @author ysj * @author ysj
*/ */
@Mapper @Mapper
public interface TaskMapper extends UserDataScopeBaseMapper<TaskEntity> { public interface TaskMapper extends BaseMapper<TaskEntity> {
} }

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/PlanMapper.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/inspect/TaskPlanMapper.java

@ -1,12 +1,12 @@
package com.hnac.hzims.scheduled.mapper.inspect; package com.hnac.hzims.scheduled.mapper.inspect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; import com.hnac.hzinfo.inspect.plan.entity.PlanEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/** /**
* @author ysj * @author ysj
*/ */
@Mapper @Mapper
public interface PlanMapper extends UserDataScopeBaseMapper<PlanEntity> { public interface TaskPlanMapper extends BaseMapper<PlanEntity> {
} }

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/PlanService.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/TaskPlanService.java

@ -6,7 +6,7 @@ import org.springblade.core.mp.base.BaseService;
/** /**
* @author ysj * @author ysj
*/ */
public interface PlanService extends BaseService<PlanEntity> { public interface TaskPlanService extends BaseService<PlanEntity> {
} }

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/ObjectServiceImpl.java

@ -10,6 +10,9 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/**
* @author ysj
*/
@Service @Service
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/PlanServiceImpl.java → hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskPlanServiceImpl.java

@ -1,8 +1,8 @@
package com.hnac.hzims.scheduled.service.inspect.impl; package com.hnac.hzims.scheduled.service.inspect.impl;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.hnac.hzims.scheduled.mapper.inspect.PlanMapper; import com.hnac.hzims.scheduled.mapper.inspect.TaskPlanMapper;
import com.hnac.hzims.scheduled.service.inspect.PlanService; import com.hnac.hzims.scheduled.service.inspect.TaskPlanService;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; import com.hnac.hzinfo.inspect.plan.entity.PlanEntity;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -16,6 +16,6 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
@DS("inspect") @DS("inspect")
public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanEntity> implements PlanService { public class TaskPlanServiceImpl extends BaseServiceImpl<TaskPlanMapper, PlanEntity> implements TaskPlanService {
} }

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java

@ -52,7 +52,7 @@ import java.util.stream.Collectors;
@DS("inspect") @DS("inspect")
public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements TaskService { public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements TaskService {
private final PlanService planService; private final TaskPlanService planService;
private final ObjectService objectService; private final ObjectService objectService;

2
hzims-service/hzims-scheduled/src/main/resources/mapper/inspect/PlanMapper.xml → hzims-service/hzims-scheduled/src/main/resources/mapper/inspect/TaskPlanMapper.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.hnac.hzims.scheduled.mapper.inspect.PlanMapper"> <mapper namespace="com.hnac.hzims.scheduled.mapper.inspect.TaskPlanMapper">
</mapper> </mapper>

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java

@ -131,18 +131,6 @@ public class AbnormalAlarmController extends BladeController {
} }
/** /**
*
*/
@ApiLog
@ApiOperation(value = "站点")
@ApiOperationSupport(order = 7)
@RequestMapping(value = "/stations", method = {RequestMethod.GET, RequestMethod.POST})
public R stations(){
service.stations();
return R.status(true);
}
/**
* 智能告警数量: 时间范围当天 * 智能告警数量: 时间范围当天
*/ */
@ApiLog @ApiLog

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java

@ -37,6 +37,4 @@ public interface HistoryAbnormalAlarmService extends BaseService<HistoryAbnormal
IPage<AlarmVo> alarmData(AlarmDataPageVo page,Query query); IPage<AlarmVo> alarmData(AlarmDataPageVo page,Query query);
List<String> queryStationName(); List<String> queryStationName();
void stations();
} }

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -35,7 +35,6 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -60,8 +59,6 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
private final ISoeClient alarmClient; private final ISoeClient alarmClient;
private final RedisTemplate redisTemplate;
@Value("${hzims.operation.alarm.types}") @Value("${hzims.operation.alarm.types}")
private String types; private String types;
@ -236,28 +233,12 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){
return new AlarmReustVo(); return new AlarmReustVo();
} }
// 返回数据
AlarmReustVo response = new AlarmReustVo();
if(types.size() > 1){
response.setCount((int) result.getData().getTotal());
response.setTotal(result.getData().getTotal());
response.setSoeList(result.getData().getRecords().stream().map(alarm -> {
AlarmDataVo record = new AlarmDataVo();
// 继承类属性拷贝
BeanUtil.copyProperties(alarm, record);
record.setStationCode(alarm.getStation());
record.setContent(alarm.getSoeExplain());
record.setType(alarm.getSoeType());
record.setSoeType(AbnormalAlarmConstant.TYPE_NAMES[Integer.parseInt(alarm.getSoeType())]);
record.setStationName((String) redisTemplate.opsForValue().get("alarm:station:" + alarm.getStation()));
record.setServeType("2");
record.setAlarmType(AbnormalAlarmConstant.SYSTEM_ALARM);
return record;
}).sorted(Comparator.comparing(AlarmDataVo::getTs, Comparator.reverseOrder())).collect(Collectors.toList()));
}else{
// 查询当天类型处理告警 // 查询当天类型处理告警
List<AlarmHandleEntity> handles = handleService.handles(types.stream().map(Long::parseLong).collect(Collectors.toList()),AbnormalAlarmConstant.SYSTEM_ALARM); List<AlarmHandleEntity> handles = handleService.handles(types.stream().map(Long::parseLong).collect(Collectors.toList()),AbnormalAlarmConstant.SYSTEM_ALARM);
// 返回数据
AlarmReustVo response = new AlarmReustVo();
List<AlarmDataVo> datas = result.getData().getRecords().stream().map(alarm -> { List<AlarmDataVo> datas = result.getData().getRecords().stream().map(alarm -> {
AlarmDataVo record = new AlarmDataVo(); AlarmDataVo record = new AlarmDataVo();
// 继承类属性拷贝 // 继承类属性拷贝
@ -285,13 +266,11 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
response.setCount((int) (result.getData().getTotal() - handles.size())); response.setCount((int) (result.getData().getTotal() - handles.size()));
response.setSoeList(datas); response.setSoeList(datas);
response.setTotal(result.getData().getTotal()); response.setTotal(result.getData().getTotal());
}
return response; return response;
} }
/** /**
* 获取处理数据ID集合 * 获取处理数据ID集合
* @return * @return
@ -412,11 +391,6 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
return this.baseMapper.getStationName(); return this.baseMapper.getStationName();
} }
@Override
public void stations() {
List<StationEntity> stations = stationService.list();
stations.forEach(item-> redisTemplate.opsForValue().set("alarm:station:" + item.getCode(),item.getName()));
}
private Boolean entityIsNull(Object object) { private Boolean entityIsNull(Object object) {

Loading…
Cancel
Save