Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 1 year ago
parent
commit
f558ed2779
  1. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java
  2. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.java
  3. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml
  4. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
  5. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
  6. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java
  7. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
  8. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/feign/InspectTaskReportClient.java

@ -131,7 +131,7 @@ public class InspectTaskReportClient implements IInspectTaskReportClient {
if(CollectionUtil.isEmpty(taskList)){ if(CollectionUtil.isEmpty(taskList)){
return R.data(dutyInspectTaskVO); return R.data(dutyInspectTaskVO);
} }
dutyInspectTaskVO.setInspectTaskIds(taskList.stream().map(TaskEntity::getId).map(id->id.toString()).collect(Collectors.joining(","))); dutyInspectTaskVO.setInspectTaskIds(taskList.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
dutyInspectTaskVO.setInspectTaskSum(taskList.size()); dutyInspectTaskVO.setInspectTaskSum(taskList.size());
// 所有处理完成巡检任务 // 所有处理完成巡检任务
List<TaskEntity> finshList = taskList.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList()); List<TaskEntity> finshList = taskList.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());

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

@ -20,5 +20,5 @@ public interface AlarmHandleMapper extends UserDataScopeBaseMapper<AlarmHandleEn
@UserDataAuth @UserDataAuth
IPage<AlarmHandleVo> selectHandlePage(IPage<Object> page,@Param("param") HandleQueryVo param); IPage<AlarmHandleVo> selectHandlePage(IPage<Object> page,@Param("param") HandleQueryVo param);
List<AlarmHandleEntity> handles(@Param("types") List<Long> types,@Param("alarm") Integer alarm,@Param("start") String start,@Param("end") String end); List<AlarmHandleEntity> handles(@Param("types") List<Long> types,@Param("start") String start,@Param("end") String end);
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/AlarmHandleMapper.xml

@ -51,9 +51,6 @@
<if test="start != null and end != null"> <if test="start != null and end != null">
and handler.create_time between #{start} and #{end} and handler.create_time between #{start} and #{end}
</if> </if>
<if test="alarm != null">
and type = #{alarm}
</if>
and (detail.DELAY_TIME &gt; #{end} or detail.DELAY_TIME is null) and (detail.DELAY_TIME &gt; #{end} or detail.DELAY_TIME is null)
</where> </where>
</select> </select>

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java

@ -151,9 +151,13 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
* @return * @return
*/ */
@Override @Override
public List<AlarmHandleEntity> handles(List<Long> types,Integer alarm) { public List<AlarmHandleEntity> handles(List<Long> types,Integer isEarly) {
if(AbnormalAlarmConstant.INTELLIGENCE_ALARM.equals(isEarly)){
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.handles(types,null,null);
}
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"; String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.handles(types,alarm,start,end); return this.baseMapper.handles(types,start,end);
} }
} }

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java

@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.fdp.feign.IFdpMonitorClient; import com.hnac.hzims.fdp.feign.IFdpMonitorClient;
@ -739,10 +740,17 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper
if(CollectionUtil.isEmpty(list)){ if(CollectionUtil.isEmpty(list)){
return null; return null;
} }
log.error("fault_list_stations: {}",stations); // 过滤已处理预警信息
log.error("fault_list_list: {}",list); List<AlarmHandleEntity> handles = handleService.handles(Collections.singletonList(AbnormalAlarmConstant.EARLY_WARNING),AbnormalAlarmConstant.INTELLIGENCE_ALARM);
Map<String,String> map = stations.stream().collect(Collectors.toMap(StationEntity::getCode,StationEntity::getName)); Map<String,String> map = stations.stream().collect(Collectors.toMap(StationEntity::getCode,StationEntity::getName));
return list.stream().filter(fault -> map.containsKey(fault.getStation())).peek(o-> o.setStationName(map.get(o.getStation()))).collect(Collectors.toList()); return list.stream().filter(fault -> map.containsKey(fault.getStation())).peek(record -> {
record.setStationName(map.get(record.getStation()));
if(CollectionUtil.isEmpty(handles)){
record.setIsHandle(false);
}else{
record.setIsHandle(handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(String.valueOf(record.getFaultId())));
}
}).collect(Collectors.toList());
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/vo/FaultVo.java

@ -27,4 +27,6 @@ public class FaultVo {
private String info; private String info;
private String name; private String name;
private Boolean isHandle;
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java

@ -539,6 +539,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
e.printStackTrace(); e.printStackTrace();
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
pool.shutdown();
// 任务完成率 // 任务完成率
int taskSum = item.getDefectSum() + item.getInspectionTaskCount() + item.getMaintenanceTaskCount() + item.getOverhaulTaskCount(); int taskSum = item.getDefectSum() + item.getInspectionTaskCount() + item.getMaintenanceTaskCount() + item.getOverhaulTaskCount();
int finishSum = item.getSolvedCount() + item.getInspectionTaskFinishCount() + item.getMaintenanceTaskFinishCount() + item.getOverhaulTaskFinishCount(); int finishSum = item.getSolvedCount() + item.getInspectionTaskFinishCount() + item.getMaintenanceTaskFinishCount() + item.getOverhaulTaskFinishCount();

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java

@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.utils.DateUtil; import com.hnac.hzims.common.utils.DateUtil;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.dto.PlanMsgRecordDto; import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
@ -34,8 +33,6 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*; import org.springblade.core.tool.utils.*;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -51,10 +48,8 @@ import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE; import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE;
@ -273,7 +268,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
//拆分设备 每个设备生成一条任务 //拆分设备 每个设备生成一条任务
if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) { if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) {
log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode()); log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode());
List<String> emCodeList = Arrays.asList(finalPlanEntity.getEmCode().split(",")); String[] emCodeList = finalPlanEntity.getEmCode().split(",");
for (String emCode : emCodeList) { for (String emCode : emCodeList) {
taskEntity.setEmCode(emCode); taskEntity.setEmCode(emCode);
this.fillTask(taskEntity, finalPlanEntity); this.fillTask(taskEntity, finalPlanEntity);
@ -359,23 +354,26 @@ public class MaintenanceServiceImpl implements MaintenanceService {
BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("taskId", taskEntity.getId()); params.put("taskId", taskEntity.getId());
List<String> userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); int index = 1;
String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> { for(String userId :taskEntity.getDisposer().split(",")){
return "taskUser_".concat(s); if(index > 1){
}).collect(Collectors.joining(",")); params.put("initUserIds" + index , "taskUser_".concat(userId));
params.put("initUserIds", taskUsers); }else{
params.put("initUserIds", "taskUser_".concat(userId));
}
index++;
}
params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo);
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId();
} }
/** /*
* 推送日常维护任务消息 推送日常维护任务消息
*
* @return void @return void
* @Param taskEntity 日常维护任务 * @Param taskEntity 日常维护任务
**/ */
private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) { private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) {
log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer()); log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer());
R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId()); R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId());

Loading…
Cancel
Save