Commit dc31b9ca authored by 赵啸非's avatar 赵啸非

添加定时删除七天前的人流数据

parent 5819f763
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.realtime.model.RealtimeDataflowEntity; import com.mortals.xhx.module.realtime.model.RealtimeDataflowEntity;
import com.mortals.xhx.module.realtime.model.RealtimeDataflowQuery; import com.mortals.xhx.module.realtime.model.RealtimeDataflowQuery;
import com.mortals.xhx.module.realtime.model.RealtimeDataflowStatEntity; import com.mortals.xhx.module.realtime.model.RealtimeDataflowStatEntity;
...@@ -21,16 +15,10 @@ import lombok.extern.slf4j.Slf4j; ...@@ -21,16 +15,10 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.DateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static java.util.stream.Collectors.toList;
/** /**
* 人流统计接口 * 人流统计接口
*/ */
......
...@@ -196,7 +196,11 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService { ...@@ -196,7 +196,11 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
Long serviceThreshold = careConfigEntity.getServiceThreshold(); Long serviceThreshold = careConfigEntity.getServiceThreshold();
String msgRecipients = careConfigEntity.getMsgRecipients(); String msgRecipients = careConfigEntity.getMsgRecipients();
List<CareRecordsEntity> waitCareList = recordsEntities.stream().filter(f -> f.getWaitTime() > serviceThreshold.intValue() && f.getCareCount() == 0).collect(Collectors.toList()); List<CareRecordsEntity> waitCareList = recordsEntities.stream()
.filter(f->f.getCareCount() == 0)
.filter(f -> f.getWaitTime() > serviceThreshold.intValue())
.collect(Collectors.toList());
log.info("待关怀的人数:{}",waitCareList.size());
if (!ObjectUtils.isEmpty(waitCareList)) { if (!ObjectUtils.isEmpty(waitCareList)) {
waitCareList.forEach(waitCare -> { waitCareList.forEach(waitCare -> {
//发送消息给管理员 //发送消息给管理员
......
...@@ -67,7 +67,6 @@ public class CareRecordsServiceImpl extends AbstractCRUDServiceImpl<CareRecordsD ...@@ -67,7 +67,6 @@ public class CareRecordsServiceImpl extends AbstractCRUDServiceImpl<CareRecordsD
@Override @Override
public Rest<String> notice(CareRecordsEntity careRecordsEntity, Context context) { public Rest<String> notice(CareRecordsEntity careRecordsEntity, Context context) {
//todo 通知负责人
UserEntity userEntity = new UserEntity(); UserEntity userEntity = new UserEntity();
userEntity.setUserType(UserType.SYSTEM.getValue()); userEntity.setUserType(UserType.SYSTEM.getValue());
List<UserEntity> userEntities = userService.find(userEntity); List<UserEntity> userEntities = userService.find(userEntity);
......
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