|
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -83,8 +84,15 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
public BusinessAlert addBusinessAlert(BusinessAlertVo param) { |
|
|
|
BusinessAlert alert = MapstructUtils.convert(param, BusinessAlert.class); |
|
|
|
alert.setCreateTime(new Date()); |
|
|
|
alert.setCaseNumber(param.getCaseNumber()); |
|
|
|
alert.setJobName(alert.getDeptName()+alert.getLabelCn()+ DateUtils.getTime()); |
|
|
|
|
|
|
|
//创建案件号
|
|
|
|
try { |
|
|
|
incrementalAlertCount(alert); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(e.getMessage(),e); |
|
|
|
} |
|
|
|
|
|
|
|
this.baseMapper.insert(alert); |
|
|
|
return alert; |
|
|
|
} |
|
|
@ -674,9 +682,14 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
return this.baseMapper.selectVoList(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 查询实时流待验证预警 |
|
|
|
* @param vo |
|
|
|
* @param pageQuery |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<BusinessAlertVo> listAiVerifyAlert(BusinessAlertVo vo) { |
|
|
|
public TableDataInfo<BusinessAlertVo> listAiVerifyAlert(BusinessAlertVo vo,PageQuery pageQuery) { |
|
|
|
LambdaQueryWrapper<BusinessAlert> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(BusinessAlert::getHandleType, BusinessStatusEnum.VERIFY.getStatus()); |
|
|
|
wrapper.eq(BusinessAlert::getBusinessType, vo.getBusinessType()); |
|
|
@ -684,14 +697,18 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
wrapper.eq(BusinessAlert::getDeptId, vo.getDeptId()); |
|
|
|
} |
|
|
|
|
|
|
|
List<BusinessAlertVo> businessAlertVos = this.baseMapper.selectVoList(wrapper); |
|
|
|
businessAlertVos.forEach(businessAlertVo->{ |
|
|
|
if (ObjectUtil.isNotEmpty(vo.getJobName())){ |
|
|
|
wrapper.like(BusinessAlert::getJobName, vo.getJobName()); |
|
|
|
} |
|
|
|
|
|
|
|
IPage<BusinessAlertVo> businessAlertVos = this.baseMapper.selectVoPage(pageQuery.build(), wrapper); |
|
|
|
businessAlertVos.getRecords().forEach(businessAlertVo->{ |
|
|
|
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, businessAlertVo.getImages(), 3600); |
|
|
|
|
|
|
|
businessAlertVo.setImages(url.toString()); |
|
|
|
}); |
|
|
|
|
|
|
|
return businessAlertVos; |
|
|
|
return TableDataInfo.build(businessAlertVos); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -744,6 +761,22 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 创建递归caseNumber |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public void incrementalAlertCount(BusinessAlert businessAlert){ |
|
|
|
//查询当天时间有多少条预警
|
|
|
|
Integer currentCount = this.baseMapper.selectCurrentAlertCount(DateUtils.getDate()); |
|
|
|
//获取当天的时间戳
|
|
|
|
String currentDate = DateUtils.getDate().replace("-",""); |
|
|
|
|
|
|
|
//然后0 + 个数 + 1 当前年月日 例如 202505150 total + 1
|
|
|
|
|
|
|
|
businessAlert.setCaseNumber(currentDate + "0" + (currentCount + 1)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static List<String> getLastSixDays() { |
|
|
|
List<String> days = new ArrayList<>(7); |
|
|
@ -867,7 +900,7 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Boolean updateBusinessAlert(BusinessAlert businessAlert) { |
|
|
|
return baseMapper.updateById(businessAlert); |
|
|
|
return baseMapper.updateById(businessAlert) > 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|