|
|
@ -21,6 +21,7 @@ import org.dromara.business.utils.BatchProcessorUtil; |
|
|
|
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.FormatsType; |
|
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
|
import org.dromara.common.core.utils.DateUtils; |
|
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
@ -119,6 +120,11 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
alert.setHandleType(BusinessStatusEnum.VERIFY.getStatus()); |
|
|
|
BeanUtils.copyProperties(alert, businessAlert); |
|
|
|
|
|
|
|
//查询历史预警
|
|
|
|
List<BusinessAlert> businessAlertList = this.listHandleHistory(alert.getLng(), alert.getLat(), DateUtils.parseDateToStr(FormatsType.YYYY_MM_DD_HH_MM_SS, alert.getCreateTime())); |
|
|
|
|
|
|
|
businessAlert.setHandleNum(businessAlertList.size()); |
|
|
|
|
|
|
|
return businessAlert; |
|
|
|
}).toList(); |
|
|
|
|
|
|
@ -656,6 +662,32 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService { |
|
|
|
return this.baseMapper.update(wrapper) > 0; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<BusinessAlert> listHandleHistory(String lng, String lat, String createTime) { |
|
|
|
if (ObjectUtil.hasEmpty(lng, lat)) { |
|
|
|
return ListUtil.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
List<BusinessAlert> businessAlerts = this.baseMapper.listHandleHistory(lng, lat, createTime); |
|
|
|
|
|
|
|
try { |
|
|
|
businessAlerts.forEach(businessAlert -> { |
|
|
|
if (businessAlert.getBusinessType() == 2){ |
|
|
|
businessAlert.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_DKCY, businessAlert.getImages(), 3600).toString()); |
|
|
|
}else { |
|
|
|
businessAlert.setImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlert.getImages(), 3600).toString()); |
|
|
|
businessAlert.setMaxImages(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlert.getMaxImages(), 3600).toString()); |
|
|
|
businessAlert.setMaxMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlert.getMaxMateSourceImgUrl(), 3600).toString()); |
|
|
|
businessAlert.setMateSourceImgUrl(MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlert.getMateSourceImgUrl(), 3600).toString()); |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(e.getMessage(),e); |
|
|
|
} |
|
|
|
|
|
|
|
return businessAlerts; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
System.out.println(getLastSixDays()); |
|
|
|