|
|
@@ -1,5 +1,7 @@
|
|
|
package com.zd.airbottle.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -97,6 +99,9 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
|
|
|
private IQpQualificationApplyService qualificationApplyService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private IQpUsegasApplyService qpUsegasApplyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private RemoteMessageService remoteMessageService;
|
|
|
|
|
|
private static final String RFID_CODE = "RFID:";
|
|
|
@@ -483,12 +488,17 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
|
|
|
phones.append(i.getAdminPhone()).append(",").append(i.getSafeUserPhone());
|
|
|
}
|
|
|
//过期时间在提醒天数内 并且在一天之内
|
|
|
- QpQualificationApplyVO qualificationApply = new QpQualificationApplyVO();
|
|
|
- qualificationApply.setUserId(QpUseRecord.getUserId());
|
|
|
- List<QpQualificationApplyVO> qualificationApplies = qualificationApplyService.selectQpQualificationApplyList(qualificationApply);
|
|
|
- qualificationApplies = qualificationApplies.stream().filter(qa -> qa.getCenterAuditStatus() == 1).filter(qa -> qa.getEndTime().getTime() < Calendar.getInstance().getTime().getTime()).collect(Collectors.toList());
|
|
|
-
|
|
|
- if(qualificationApplies.size() > 0){
|
|
|
+ QpUsegasApplyVO qpUsegasApplyVO = new QpUsegasApplyVO();
|
|
|
+ qpUsegasApplyVO.setUserId(QpUseRecord.getUserId());
|
|
|
+ qpUsegasApplyVO.setSubjectId(QpUseRecord.getSubjectId());
|
|
|
+ qpUsegasApplyVO.setUseGasId(qpAirBottle.getId());
|
|
|
+ List<QpUsegasApplyVO> qpUsegasApplyVOS = qpUsegasApplyService.selectQpUsegasApplyList(qpUsegasApplyVO);
|
|
|
+ List<QpUsegasApplyVO> collect = qpUsegasApplyVOS.stream().filter(qa -> "1".equals(qa.getRemark())).sorted(Comparator.comparing(QpUsegasApplyVO::getEndTime).reversed()).limit(1).collect(Collectors.toList());
|
|
|
+ QpUsegasApplyVO qpUsegasApplyVO1 = collect.get(0);
|
|
|
+ Date endTime = qpUsegasApplyVO1.getEndTime();
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ DateTime yesterday = DateUtil.offsetDay(now, -1);
|
|
|
+ if(yesterday.getTime() < endTime.getTime() && now.getTime() > endTime.getTime()){
|
|
|
//过了最大领用时间
|
|
|
warningNoticeLogDto.setWarningContent("气瓶超时未归还");
|
|
|
String timeout = warningConfigDto.getTimeout();
|