Commit e46930ca authored by 韩桐桐's avatar 韩桐桐

fix(jg):BUG 26887

parent 31ac860c
......@@ -6,8 +6,12 @@ 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.jg.biz.event.CancellationEvent;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgRegisterInfoServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.event.EventListener;
......@@ -26,24 +30,21 @@ import java.util.concurrent.LinkedBlockingQueue;
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class CancellationEventListener {
@Value("${cancellation.deal.thread.number:1}")
private int threadNumber;
private ICommonService commonService;
private final ICommonService commonService;
private ESEquipmentCategory esEquipmentCategoryDao;
private final ESEquipmentCategory esEquipmentCategoryDao;
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
private final IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
private BlockingQueue<String> queue = new LinkedBlockingQueue<>();
private final IdxBizJgRegisterInfoServiceImpl idxBizJgRegisterInfoService;
public CancellationEventListener(ICommonService commonService, ESEquipmentCategory esEquipmentCategoryDao, IdxBizJgUseInfoMapper idxBizJgUseInfoMapper) {
this.commonService = commonService;
this.esEquipmentCategoryDao = esEquipmentCategoryDao;
this.idxBizJgUseInfoMapper = idxBizJgUseInfoMapper;
}
private BlockingQueue<String> queue = new LinkedBlockingQueue<>();
@EventListener(value = CancellationEvent.class)
public void handleTransactionalEvent(CancellationEvent event) {
......@@ -80,6 +81,12 @@ public class CancellationEventListener {
updateWrapper.eq(IdxBizJgUseInfo::getRecord, record);
updateWrapper.set(IdxBizJgUseInfo::getIsIntoManagement, false);
idxBizJgUseInfoMapper.update(null, updateWrapper);
// 清除系统自动生成的设备代码
idxBizJgRegisterInfoService.lambdaUpdate()
.eq(IdxBizJgRegisterInfo::getRecord, record)
.eq(IdxBizJgRegisterInfo::getEquCodeType, "2")
.set(IdxBizJgRegisterInfo::getEquCode, null)
.update();
// 更新已纳管为未纳管-es
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategoryDao.findById(record);
if (optional.isPresent()) {
......
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