Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	dk-modules/sample/src/main/resources/mapper/IDeviceProMapper.xml
pull/6/head
吴远 1 month ago
parent
commit
28b616b5bf
  1. 12
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertController.java
  2. 2
      dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java
  3. 20
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java
  4. 10
      dk-modules/system/src/main/java/org/dromara/system/dubbo/RemoteNoticeServiceImpl.java

12
dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertController.java

@ -165,4 +165,16 @@ public class BusinessAlertController extends BaseController {
}
/**
* 查询实时流预警
*/
@SaCheckPermission("business:alertAi:list")
@Operation(summary ="查询实时流预警",description = "查询实时流预警")
@GetMapping("/ai/verify/alert")
public R<List<BusinessAlertVo>> listAiVerifyAlert(BusinessAlertVo vo) {
return R.ok(businessAlertService.listAiVerifyAlert(vo));
}
}

2
dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java

@ -95,4 +95,6 @@ public interface IBusinessAlertService {
Boolean transferAlert(BusinessAlertVo vo);
BusinessAlert getBusinessAlert(Long alertId);
List<BusinessAlertVo> listAiVerifyAlert(BusinessAlertVo vo);
}

20
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

@ -668,6 +668,26 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
return this.baseMapper.selectVoList(wrapper);
}
@Override
public List<BusinessAlertVo> listAiVerifyAlert(BusinessAlertVo vo) {
LambdaQueryWrapper<BusinessAlert> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BusinessAlert::getHandleType, BusinessStatusEnum.VERIFY.getStatus());
wrapper.eq(BusinessAlert::getBusinessType, vo.getBusinessType());
if (ObjectUtil.isNotEmpty(vo.getDeptId())){
wrapper.eq(BusinessAlert::getDeptId, vo.getDeptId());
}
List<BusinessAlertVo> businessAlertVos = this.baseMapper.selectVoList(wrapper);
businessAlertVos.forEach(businessAlertVo->{
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, businessAlertVo.getImages(), 3600);
businessAlertVo.setImages(url.toString());
});
return businessAlertVos;
}
@Override
public Boolean deleteAlert(List<Long> alertIdList) {
if (ObjectUtil.isEmpty(alertIdList)) {

10
dk-modules/system/src/main/java/org/dromara/system/dubbo/RemoteNoticeServiceImpl.java

@ -1,5 +1,6 @@
package org.dromara.system.dubbo;
import cn.hutool.core.convert.Convert;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
@ -9,9 +10,12 @@ import org.dromara.resource.api.RemoteMessageService;
import org.dromara.system.api.RemoteNoticeService;
import org.dromara.system.api.domain.bo.RemoteNoticeBo;
import org.dromara.system.domain.SysNotice;
import org.dromara.system.domain.vo.SysDictDataVo;
import org.dromara.system.mapper.SysNoticeMapper;
import org.dromara.system.service.ISysDictTypeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
@ -27,12 +31,16 @@ public class RemoteNoticeServiceImpl implements RemoteNoticeService {
private final SysNoticeMapper sysNoticeMapper;
@DubboReference
private final RemoteMessageService remoteMessageService;
private final ISysDictTypeService dictTypeService;
@Override
public int saveNotice(RemoteNoticeBo bo) {
SysNotice notice = MapstructUtils.convert(bo, SysNotice.class);
/*String type = dictService.getDictLabel("sys_notice_type", notice.getNoticeType());*/
remoteMessageService.publishAll(bo.getParam());
List<SysDictDataVo> data = dictTypeService.selectDictDataByType("ai_push");
List<Long> list = data.stream().map(SysDictDataVo::getDictValue).distinct().toList().stream().map(Long::parseLong).toList();
//获取字典值
remoteMessageService.publishMessage(list,bo.getParam());
return sysNoticeMapper.insert(notice);
}
}

Loading…
Cancel
Save