|
@ -16,6 +16,8 @@ import org.dromara.business.domain.bo.BusinessAlertBo; |
|
|
import org.dromara.business.domain.vo.BusinessAlertVo; |
|
|
import org.dromara.business.domain.vo.BusinessAlertVo; |
|
|
import org.dromara.business.mapper.BusinessAlertMapper; |
|
|
import org.dromara.business.mapper.BusinessAlertMapper; |
|
|
import org.dromara.business.service.IBusinessAlertService; |
|
|
import org.dromara.business.service.IBusinessAlertService; |
|
|
|
|
|
import org.dromara.business.utils.MinioUntil; |
|
|
|
|
|
import org.dromara.business.utils.constants.MinIOConstants; |
|
|
import org.dromara.common.core.enums.BusinessStatusEnum; |
|
|
import org.dromara.common.core.enums.BusinessStatusEnum; |
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
@ -31,6 +33,7 @@ import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
import java.lang.reflect.Method; |
|
|
|
|
|
import java.net.URL; |
|
|
import java.time.LocalDate; |
|
|
import java.time.LocalDate; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.Collections; |
|
|
import java.util.Collections; |
|
@ -146,7 +149,9 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
wrapper.set(BusinessAlert::getAssignDate, new Date()); |
|
|
wrapper.set(BusinessAlert::getAssignDate, new Date()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
wrapper.set(BusinessAlert::getCompleteDate,new Date()); |
|
|
if (BusinessStatusEnum.FINISH.getStatus().equalsIgnoreCase(flowStatus) || BusinessStatusEnum.CANCEL.getStatus().equalsIgnoreCase(flowStatus)){ |
|
|
|
|
|
wrapper.set(BusinessAlert::getCompleteDate,new Date()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
wrapper.eq(BusinessAlert::getId, businessId); |
|
|
wrapper.eq(BusinessAlert::getId, businessId); |
|
|
|
|
|
|
|
@ -170,6 +175,13 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
Page<BusinessAlert> page = this.baseMapper.pageBusinessAlert(pageQuery.build(), wrapper); |
|
|
Page<BusinessAlert> page = this.baseMapper.pageBusinessAlert(pageQuery.build(), wrapper); |
|
|
|
|
|
|
|
|
|
|
|
page.getRecords().forEach(businessAlertVo->{ |
|
|
|
|
|
businessAlertVo.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return TableDataInfo.build(page); |
|
|
return TableDataInfo.build(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -192,6 +204,13 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
Page<BusinessAlert> page = this.baseMapper.pageBusinessAlertCancel(pageQuery.build(), wrapper); |
|
|
Page<BusinessAlert> page = this.baseMapper.pageBusinessAlertCancel(pageQuery.build(), wrapper); |
|
|
|
|
|
|
|
|
|
|
|
page.getRecords().forEach(businessAlertVo->{ |
|
|
|
|
|
businessAlertVo.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return TableDataInfo.build(page); |
|
|
return TableDataInfo.build(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -216,6 +235,13 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
Page<BusinessAlert> page = this.baseMapper.pageAlertFinish(pageQuery.build(), wrapper); |
|
|
Page<BusinessAlert> page = this.baseMapper.pageAlertFinish(pageQuery.build(), wrapper); |
|
|
|
|
|
|
|
|
|
|
|
page.getRecords().forEach(businessAlertVo->{ |
|
|
|
|
|
businessAlertVo.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return TableDataInfo.build(page); |
|
|
return TableDataInfo.build(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -253,6 +279,13 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
page.getRecords().forEach(businessAlertVo->{ |
|
|
|
|
|
businessAlertVo.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxImages(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMaxMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMaxMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
businessAlertVo.setMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getMateSourceImgUrl(), 3600).toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return TableDataInfo.build(page); |
|
|
return TableDataInfo.build(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -339,7 +372,15 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
//查看的是总览的预警信息
|
|
|
//查看的是总览的预警信息
|
|
|
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) { |
|
|
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) { |
|
|
result.put("list",this.baseMapper.listAlert(businessAlertBo,startTime,endTime)); |
|
|
|
|
|
|
|
|
List<BusinessAlert> businessAlerts = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); |
|
|
|
|
|
|
|
|
|
|
|
businessAlerts.forEach(businessAlertVo->{ |
|
|
|
|
|
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600); |
|
|
|
|
|
businessAlertVo.setImages(url.toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
result.put("list",businessAlerts); |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
@ -351,6 +392,11 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); |
|
|
List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); |
|
|
|
|
|
|
|
|
|
|
|
alertList.forEach(businessAlertVo->{ |
|
|
|
|
|
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600); |
|
|
|
|
|
businessAlertVo.setImages(url.toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
handlerMap.put("total",alertList.size()); |
|
|
handlerMap.put("total",alertList.size()); |
|
|
handlerMap.put("finishCount",ObjectUtil.isEmpty(alertList)?0:alertList.stream().filter(p-> p.getHandleType().equalsIgnoreCase(BusinessStatusEnum.FINISH.getStatus())).count()); |
|
|
handlerMap.put("finishCount",ObjectUtil.isEmpty(alertList)?0:alertList.stream().filter(p-> p.getHandleType().equalsIgnoreCase(BusinessStatusEnum.FINISH.getStatus())).count()); |
|
|
handlerMap.put("todoCount",ObjectUtil.isEmpty(alertList)?0:alertList.stream().filter(p-> p.getHandleType().equalsIgnoreCase(BusinessStatusEnum.WAITING.getStatus())).count()); |
|
|
handlerMap.put("todoCount",ObjectUtil.isEmpty(alertList)?0:alertList.stream().filter(p-> p.getHandleType().equalsIgnoreCase(BusinessStatusEnum.WAITING.getStatus())).count()); |
|
@ -397,12 +443,24 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
|
|
|
|
|
List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); |
|
|
List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); |
|
|
|
|
|
|
|
|
|
|
|
alertList.forEach(businessAlertVo->{ |
|
|
|
|
|
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600); |
|
|
|
|
|
businessAlertVo.setImages(url.toString()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> labelCnMap = alertList.stream() |
|
|
Map<String, Integer> labelCnMap = alertList.stream() |
|
|
.collect(Collectors.groupingBy( |
|
|
.collect(Collectors.groupingBy( |
|
|
BusinessAlert::getLabelEn, |
|
|
BusinessAlert::getLabelEn, |
|
|
Collectors.summingInt(e -> 1) |
|
|
Collectors.summingInt(e -> 1) |
|
|
)); |
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
businessAlertBo.getAiLabelEnList().forEach(labelEn -> { |
|
|
|
|
|
if (ObjectUtil.isEmpty(labelCnMap.get(labelEn))) { |
|
|
|
|
|
labelCnMap.put(labelEn,0); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
infoMap.put("panel",labelCnMap); |
|
|
infoMap.put("panel",labelCnMap); |
|
|
|
|
|
|
|
|
infoMap.put("list",alertList); |
|
|
infoMap.put("list",alertList); |
|
@ -432,6 +490,11 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
return this.baseMapper.delete(wrapper) > 0; |
|
|
return this.baseMapper.delete(wrapper) > 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void batchUpdateDept(List<BusinessAlertVo> alertVoList) { |
|
|
|
|
|
this.baseMapper.batchUpdateDept(alertVoList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<String> getLastSixDays() { |
|
|
public static List<String> getLastSixDays() { |
|
|
List<String> days = new ArrayList<>(7); |
|
|
List<String> days = new ArrayList<>(7); |
|
|