Commit 3bf04189 authored by suhuiguang's avatar suhuiguang

feat(综合搜索):增量数据同步调整

1.评分时进行同步 2.作废时评分同步
parent 5e654dc7
......@@ -56,7 +56,7 @@ public class CancelAndGradeEventListener {
try {
CancelEquipItem cancelEquipItem = queue.take();
log.info("线程 {} 开始处理 cancelEquipItem: {}", Thread.currentThread().getName(), cancelEquipItem);
updateService.dealData(cancelEquipItem);
updateService.cancelAndGrade(cancelEquipItem);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
......@@ -52,7 +52,7 @@ public class CancellationEventListener {
try {
String record = queue.take();
log.info("线程 {} 开始处理 record: {}", Thread.currentThread().getName(), record);
updateService.dealData(record, false);
updateService.dealDataAndAsyncEs(record);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
package com.yeejoin.amos.boot.module.jg.biz.event.listener.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
......@@ -20,10 +19,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@Slf4j
......@@ -41,79 +38,85 @@ public class ManageStatusDataUpdateService {
private final IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
@Transactional(rollbackFor = Exception.class)
public void dealData(CancelEquipItem cancelEquipItem) {
// 设备、气瓶、管道纳管状态处理
cancelEquipItem.getRecords().forEach(record -> {
dealData(record, true);
});
// 装置评分处理
castEvent2EquipEditEvent(cancelEquipItem.getProjectContraptionIds());
// 发送数据刷新消息
sendPipelineRefreshMsg(cancelEquipItem.getProjectContraptionIds());
public void cancelAndGrade(CancelEquipItem cancelEquipItem) {
// 1.设备、气瓶、管道纳管状态处理
cancelEquipItem.getRecords().forEach(this::cancelAndGrade);
// 2.评分级别更新
castEvent2EquipEditEvent(cancelEquipItem);
}
private void sendPipelineRefreshMsg(Set<String> projectContraptionIds) {
if (projectContraptionIds != null && !projectContraptionIds.isEmpty()) {
List<String> records = idxBizJgUseInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>().in(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionIds).select(IdxBizJgUseInfo::getRecord)).stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
publisher.publish(new DataRefreshEvent(this, records, DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
/**
* 处理单个设备纳管状态
*
* @param record 设备唯一标识
*/
public void cancelAndGrade(String record) {
// 所有业务单据(除去作废、删除状态单据),有在引用设备的则不修改设备纳管状态
Boolean inUsed = commonService.checkEquipIsUsed(record);
// 无引用则进行修改纳管状态为未纳管
if (!inUsed) {
try {
// 更新已纳管为未纳管 - 数据库
updateEquipData(idxBizJgUseInfoService, record, idxBizJgRegisterInfoService, esEquipmentCategoryDao);
} catch (Exception e) {
log.error("设备cancelAndGrade异常:{}", e.getMessage());
}
}
}
/**
* 处理单个设备纳管状态
*
* @param record 设备唯一标识
* @param isForward 是否进行转发
* @param record 设备唯一标识
*/
@Transactional(rollbackFor = Exception.class)
public void dealData(String record, Boolean isForward) {
log.info("开始检查设备的引用:{}", record);
public void dealDataAndAsyncEs(String record) {
// 所有业务单据(除去作废、删除状态单据),有在引用设备的则不修改设备纳管状态
Boolean inUsed = commonService.checkEquipIsUsed(record);
// 无引用则进行修改纳管状态为未纳管
if (!inUsed) {
log.info("进行设备作废处理:{}", record);
try {
// 更新已纳管为未纳管 - 数据库
idxBizJgUseInfoService.lambdaUpdate()
.eq(IdxBizJgUseInfo::getRecord, record)
.set(IdxBizJgUseInfo::getIsIntoManagement, false)
.update();
// 清除系统自动生成的设备代码`equCode`
boolean isRegisterUpdated = idxBizJgRegisterInfoService.lambdaUpdate()
.eq(IdxBizJgRegisterInfo::getRecord, record)
.eq(IdxBizJgRegisterInfo::getEquCodeType, "2")
.set(IdxBizJgRegisterInfo::getEquCode, null)
.update();
// 同步修改ES数据
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategoryDao.findById(record);
optional.ifPresent(esEquipmentCategoryDto -> {
esEquipmentCategoryDto.setIS_INTO_MANAGEMENT(false);
if (isRegisterUpdated) {
esEquipmentCategoryDto.setEQU_CODE(null);
}
esEquipmentCategoryDao.save(esEquipmentCategoryDto);
});
updateEquipData(idxBizJgUseInfoService, record, idxBizJgRegisterInfoService, esEquipmentCategoryDao);
// 发送数据刷新消息
publisher.publish(new DataRefreshEvent(this, Collections.singletonList(record), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
} catch (Exception e) {
log.error("设备作废异常:{}", e.getMessage());
log.error("设备dealDataAndAsyncEs异常:{}", e.getMessage());
}
}
if (isForward) {
castEvent2EquipEditEvent(record);
}
}
private void castEvent2EquipEditEvent(String record) {
publisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), Sets.newHashSet(record), EquipCreateOrEditEvent.EquipType.equip));
private void updateEquipData(IdxBizJgUseInfoServiceImpl idxBizJgUseInfoService, String record, IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService, ESEquipmentCategory esEquipmentCategoryDao) {
// 更新已纳管为未纳管 - 数据库
idxBizJgUseInfoService.lambdaUpdate()
.eq(IdxBizJgUseInfo::getRecord, record)
.set(IdxBizJgUseInfo::getIsIntoManagement, false)
.update();
// 清除系统自动生成的设备代码`equCode`
boolean isRegisterUpdated = idxBizJgRegisterInfoService.lambdaUpdate()
.eq(IdxBizJgRegisterInfo::getRecord, record)
.eq(IdxBizJgRegisterInfo::getEquCodeType, "2")
.set(IdxBizJgRegisterInfo::getEquCode, null)
.update();
// 同步修改ES数据
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategoryDao.findById(record);
optional.ifPresent(esEquipmentCategoryDto -> {
esEquipmentCategoryDto.setIS_INTO_MANAGEMENT(false);
if (isRegisterUpdated) {
esEquipmentCategoryDto.setEQU_CODE(null);
}
esEquipmentCategoryDao.save(esEquipmentCategoryDto);
});
}
private void castEvent2EquipEditEvent(Set<String> projectContraptionIds) {
private void castEvent2EquipEditEvent(CancelEquipItem cancelEquipItem) {
Set<String> projectContraptionIds = cancelEquipItem.getProjectContraptionIds();
if (projectContraptionIds != null && !projectContraptionIds.isEmpty()) {
publisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_PROJECT.name(), projectContraptionIds, EquipCreateOrEditEvent.EquipType.project));
} else {
publisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), Sets.newHashSet(cancelEquipItem.getRecords()), EquipCreateOrEditEvent.EquipType.equip));
}
}
}
......@@ -65,7 +65,8 @@ public class EquipmentRefreshHandler implements IDataRefreshHandler {
Map<String, Object> map = categoryOtherInfoMapper.selectDataById(record);
ESEquipmentCategoryDto categoryEs = JSON.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
BeanUtil.copyProperties(categoryEs, esEquipmentInfo);
IdxBizJgUseInfo useInfo = useInfoService.getOne(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getRecord, record).select(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getCreateDate));
IdxBizJgUseInfo useInfo = useInfoService.getOne(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getRecord, record)
.select(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getCreateDate, IdxBizJgUseInfo::getDataQualityScore));
IdxBizJgDesignInfo designInfo = idxBizJgDesignInfoServiceImpl.getOne(new LambdaQueryWrapper<IdxBizJgDesignInfo>()
.eq(IdxBizJgDesignInfo::getRecord, record)
.select(IdxBizJgDesignInfo::getRecord, IdxBizJgDesignInfo::getDesignUnitName, IdxBizJgDesignInfo::getDesignUnitCreditCode, IdxBizJgDesignInfo::getDesignDate));
......@@ -87,6 +88,7 @@ public class EquipmentRefreshHandler implements IDataRefreshHandler {
} catch (Exception e) {
log.error("时区转换失败:{}", record, e);
}
esEquipmentInfo.setDataQualityScore(useInfo.getDataQualityScore() != null ? useInfo.getDataQualityScore() : null);
esEquipmentInfo.setCarNumber(registerInfo.getCarNumber());
esEquipmentInfo.setUSE_ORG_CODE(registerInfo.getUseOrgCode());
esEquipmentInfo.setIssueDate(getIssueDate(registerInfo.getUseOrgCode()));
......
......@@ -14,7 +14,7 @@ import org.springframework.transaction.event.TransactionalEventListener;
@Component
@RequiredArgsConstructor
@Slf4j
public class EditEventAdapter {
public class BizDataChange2EditEventAdapter {
private final ApplicationEventPublisher publisher;
......
......@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent;
import com.yeejoin.amos.boot.module.common.biz.service.impl.EquipmentCategoryService;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.reminder.biz.factory.GradeStrategyFactory;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.service.IQualityScoreUpdate;
......@@ -23,11 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.Optional;
import java.util.Set;
import java.util.*;
@Component
@RequiredArgsConstructor
......@@ -46,8 +46,9 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
private final GradeStrategyFactory gradeStrategyFactory;
@Autowired
EquipmentCategoryService equipmentCategoryService;
private final EquipmentCategoryService equipmentCategoryService;
private final EventPublisher eventPublisher;
@Override
public Boolean support(EquipCreateOrEditEvent.EquipType equipType) {
......@@ -56,8 +57,9 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
@Async
@Override
@Transactional(rollbackFor = Exception.class)
public void update(String bizType, Set<String> records) {
records.parallelStream().forEach(record -> {
records.forEach(record -> {
Optional<ESEquipmentCategoryDto> op = equipmentCategoryDao.findById(record);
// 压力管道不进行管道登记的计算
if (op.isPresent() && op.get().getEQU_LIST_CODE().equals(EquipmentClassifityEnum.YLGD.getCode())) {
......@@ -74,6 +76,8 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
updateWrapper.set(TzsBaseEntity::getRecDate, new Date());
idxBizJgUseInfoService.update(updateWrapper);
});
// 事务提交后发送数据变更消息
this.sendDataRefreshMsgEquip(new ArrayList<>(records));
}
public Integer getReminderLevel(String bizType, String record) {
......@@ -111,4 +115,8 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
IdxBizJgRegisterInfo::getWhetherVehicleCylinder,
IdxBizJgRegisterInfo::getProductName));
}
private void sendDataRefreshMsgEquip(List<String> records) {
eventPublisher.publish(new DataRefreshEvent(this, records, DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
}
package com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.reminder.biz.factory.GradeStrategyFactory;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.service.IQualityScoreUpdate;
import com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto;
import com.yeejoin.amos.boot.module.jg.biz.reminder.service.CommonReminderService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgProjectContraptionServiceImplService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Component
@RequiredArgsConstructor
......@@ -30,6 +38,10 @@ public class ProjectQualityScoreUpdateService implements IQualityScoreUpdate {
private final IdxBizJgProjectContraptionServiceImplService idxBizJgProjectContraptionService;
private final IIdxBizJgUseInfoService idxBizJgUseInfoService;
private final EventPublisher eventPublisher;
@Value("${grade.calculation.strategy:MAX_GRADE}")
private String activeStrategy;
......@@ -40,8 +52,9 @@ public class ProjectQualityScoreUpdateService implements IQualityScoreUpdate {
@Async
@Override
@Transactional(rollbackFor = Exception.class)
public void update(String bizType, Set<String> projectContraptionIds) {
projectContraptionIds.parallelStream().forEach(projectContraptionId -> {
projectContraptionIds.forEach(projectContraptionId -> {
Integer level = this.getReminderLevel(bizType, projectContraptionId);
LambdaUpdateWrapper<IdxBizJgProjectContraption> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgProjectContraption::getSequenceNbr, projectContraptionId);
......@@ -49,6 +62,7 @@ public class ProjectQualityScoreUpdateService implements IQualityScoreUpdate {
updateWrapper.set(BaseEntity::getRecDate, new Date());
idxBizJgProjectContraptionService.update(updateWrapper);
});
this.sendDataRefreshMsg(projectContraptionIds);
}
......@@ -67,6 +81,17 @@ public class ProjectQualityScoreUpdateService implements IQualityScoreUpdate {
reminderItemDto.setEquipName(projectContraption.getProjectContraption());
reminderItemDto.setDetailData(BeanUtil.beanToMap(matchItemDto));
return gradeStrategyFactory.getStrategy(activeStrategy).calculateGrade(Collections.singletonList(reminderItemDto), matchItemDto);
}
/**
* 发送管道编辑信息-用于将装置下管道同步到
*
* @param projectContraptionIds 装置ids
*/
private void sendDataRefreshMsg(Set<String> projectContraptionIds) {
List<IdxBizJgUseInfo> useInfos = idxBizJgUseInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>()
.in(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionIds)
.select(IdxBizJgUseInfo::getRecord));
eventPublisher.publish(new DataRefreshEvent(this, useInfos.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList()), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
}
......@@ -186,7 +186,6 @@ public class DataDockServiceImpl {
})).toArray(CompletableFuture[]::new)
).join();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, new ArrayList<>(recordSet), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.INSERT));
return Boolean.TRUE;
}
......@@ -2460,7 +2459,6 @@ public class DataDockServiceImpl {
})).toArray(CompletableFuture[]::new)
).join();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, new ArrayList<>(recordSet), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.INSERT));
return Boolean.TRUE;
}
......
......@@ -437,39 +437,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
ResponseModel responseModel = this.pipelineEquipCreateOrUpdate(paramMap);
Long projectContraptionId = (Long)responseModel.getResult();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_PROJECT.name(), Sets.newHashSet(projectContraptionId.toString()), EquipCreateOrEditEvent.EquipType.project));
this.sendDataRefreshMsgProjectContraption(projectContraptionId);
return responseModel;
}
if(dataSource.contains("black")){
ResponseModel responseModel = this.blackEquipCreateOrUpdate(paramMap);
String record = (String)responseModel.getResult();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), Sets.newHashSet(record), EquipCreateOrEditEvent.EquipType.equip));
this.sendDataRefreshMsgEquip(record);
return responseModel;
} else {
ResponseModel responseModel = this.otherEquipCreateOrUpdate(paramMap);
String record = (String)responseModel.getResult();
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), Sets.newHashSet(record), EquipCreateOrEditEvent.EquipType.equip));
this.sendDataRefreshMsgEquip(record);
return responseModel;
}
}
private void sendDataRefreshMsgEquip(String record) {
eventPublisher.publish(new DataRefreshEvent(this, Collections.singletonList(record), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
/**
*
* 发送管道编辑信息-用于将装置下管道同步到
* @param projectContraptionId 装置id
*/
private void sendDataRefreshMsgProjectContraption(Long projectContraptionId) {
List<IdxBizJgUseInfo> useInfos = idxBizJgUseInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>()
.eq(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionId)
.select(IdxBizJgUseInfo::getRecord));
eventPublisher.publish(new DataRefreshEvent(this, useInfos.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList()), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
/**
* 管道设备新增或更新
......@@ -4340,7 +4322,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Optional.of(esEquipmentCategoryList).filter(list -> !list.isEmpty()).ifPresent(esEquipmentCategory::saveAll);
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, new ArrayList<>(recordSet), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.INSERT));
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
}
......
......@@ -1298,7 +1298,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgRegistrationHistory.setChangeData(JSON.toJSONString(mapData));
jgRegistrationHistoryService.updateById(jgRegistrationHistory);
this.publish2CalGrade(jgUseRegistration, records);
eventPublisher.publish(new DataRefreshEvent(this, records, DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
this.getBaseMapper().updateById(jgUseRegistration);
commonServiceImpl.saveExecuteFlowData2Redis(jgUseRegistration.getInstanceId(), this.buildInstanceRuntimeData(jgUseRegistration));
......@@ -1732,7 +1731,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
certificateChangeRecordEqService.save(changeRecordEq);
});
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_USAGE_REGISTRATION.name(), Sets.newHashSet(registerInfo.getRecord()), EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, Collections.singletonList(registerInfo.getRecord()), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
}
this.getBaseMapper().updateById(jgUseRegistration);
commonServiceImpl.saveExecuteFlowData2Redis(jgUseRegistration.getInstanceId(), this.buildInstanceRuntimeData(jgUseRegistration));
......@@ -4364,7 +4362,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), Sets.newHashSet(equipId), EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, Collections.singletonList(equipId), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.UPDATE));
return this.baseMapper.getDetailById(jgUseRegistration.getSequenceNbr());
} catch (BadRequest | LocalBadRequest e) {
log.error(e.getMessage(), e);
......
......@@ -1019,7 +1019,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
);
// 车用气瓶评分
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.name(), Sets.newHashSet(equipIdList), EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, equipIdList, DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.INSERT));
}
this.getBaseMapper().updateById(jgVehicleInformation);
commonService.saveExecuteFlowData2Redis(jgVehicleInformation.getInstanceId(), this.buildInstanceRuntimeData(jgVehicleInformation));
......@@ -2188,7 +2187,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.map(v -> (String) v.get("record"))
.collect(Collectors.toSet());
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_NEW_EQUIP.name(), recordSet, EquipCreateOrEditEvent.EquipType.equip));
eventPublisher.publish(new DataRefreshEvent(this, new ArrayList<>(recordSet), DataRefreshEvent.DataType.equipment.name(), DataRefreshEvent.Operation.INSERT));
return Collections.singletonList(vehicleInformation);
}
......
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