|
@@ -1,10 +1,13 @@
|
|
|
package com.zhongzheng.modules.inform.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
+import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
import com.zhongzheng.modules.inform.bo.InformQueryBo;
|
|
@@ -75,15 +78,15 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
|
|
|
@Override
|
|
|
public List<InformUserVo> queryList(InformUserQueryBo bo) {
|
|
|
LambdaQueryWrapper<InformUser> lqw = Wrappers.lambdaQuery();
|
|
|
- List<Long> status = new ArrayList<>();
|
|
|
+ /* List<Long> status = new ArrayList<>();
|
|
|
status.add(1L);
|
|
|
- status.add(2L);
|
|
|
+ status.add(2L);*/
|
|
|
lqw.eq(bo.getUserId() != null, InformUser::getUserId, bo.getUserId());
|
|
|
lqw.eq(bo.getSendTime() != null, InformUser::getSendTime, bo.getSendTime());
|
|
|
lqw.eq(bo.getSendStatus() != null, InformUser::getSendStatus, bo.getSendStatus());
|
|
|
lqw.eq(bo.getReceiptStatus() != null, InformUser::getReceiptStatus, bo.getReceiptStatus());
|
|
|
lqw.eq( InformUser::getSendStatus, 1);
|
|
|
- lqw.in( InformUser::getSystemStatus, status);
|
|
|
+ lqw.in( bo.getSystemStatusList() != null,InformUser::getSystemStatus, bo.getSystemStatusList());
|
|
|
lqw.orderByDesc(InformUser::getSendTime);
|
|
|
List<InformUserVo> informUserVos = entity2Vo(this.list(lqw));
|
|
|
for (InformUserVo informUserVo : informUserVos) {
|
|
@@ -198,4 +201,38 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
|
|
|
}
|
|
|
return informUserVo;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改所有未读为已读
|
|
|
+ * @param bo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Boolean updateAllRead(InformUserEditBo bo) {
|
|
|
+ //系统通知
|
|
|
+ if (bo.getSystemStatus()==1) {
|
|
|
+ LambdaUpdateWrapper<InformUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getUserId, bo.getUserId());
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getSystemStatus, bo.getSystemStatus());
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getReceiptStatus, 0);
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getSendStatus, 1);
|
|
|
+
|
|
|
+ objectLambdaUpdateWrapper.set(InformUser::getReceiptStatus, 1);
|
|
|
+ objectLambdaUpdateWrapper.set(InformUser::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+ //教务通知
|
|
|
+ if (bo.getSystemStatus()==2) {
|
|
|
+ LambdaUpdateWrapper<InformUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getUserId, bo.getUserId());
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getSystemStatus, bo.getSystemStatus());
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getReceiptStatus, 0);
|
|
|
+ objectLambdaUpdateWrapper.eq(InformUser::getSendStatus, 1);
|
|
|
+
|
|
|
+ objectLambdaUpdateWrapper.set(InformUser::getReceiptStatus, 1);
|
|
|
+ objectLambdaUpdateWrapper.set(InformUser::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|