|
@@ -2,14 +2,8 @@ package com.rongwei.zhsw.system.wechat.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
-import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
|
|
|
|
-import com.rongwe.zhsw.system.domain.SwNotificationAnnouncementDo;
|
|
|
|
-import com.rongwe.zhsw.system.domain.SwUserManagementDo;
|
|
|
|
-import com.rongwe.zhsw.system.domain.SwUserWechatDo;
|
|
|
|
-import com.rongwe.zhsw.system.vo.AccountBindVo;
|
|
|
|
-import com.rongwe.zhsw.system.vo.AccountUnbindVo;
|
|
|
|
-import com.rongwe.zhsw.system.vo.SwUserManagementVo;
|
|
|
|
-import com.rongwe.zhsw.system.vo.WeChatHomePageVo;
|
|
|
|
|
|
+import com.rongwe.zhsw.system.domain.*;
|
|
|
|
+import com.rongwe.zhsw.system.vo.*;
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
@@ -17,6 +11,7 @@ import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
|
|
import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
|
|
import com.rongwei.zhsw.system.dao.CommonBusinessDao;
|
|
import com.rongwei.zhsw.system.dao.CommonBusinessDao;
|
|
import com.rongwei.zhsw.system.dao.SwNotificationAnnouncementDao;
|
|
import com.rongwei.zhsw.system.dao.SwNotificationAnnouncementDao;
|
|
|
|
+import com.rongwei.zhsw.system.dao.SysNotifyAnnounceUserDao;
|
|
import com.rongwei.zhsw.system.service.impl.SwBillManagementUnpaidServiceImpl;
|
|
import com.rongwei.zhsw.system.service.impl.SwBillManagementUnpaidServiceImpl;
|
|
import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
|
|
import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
|
|
import com.rongwei.zhsw.system.service.impl.SwUserWechatServiceImpl;
|
|
import com.rongwei.zhsw.system.service.impl.SwUserWechatServiceImpl;
|
|
@@ -57,6 +52,8 @@ public class AccountServiceImpl implements AccountService {
|
|
private SwNotificationAnnouncementDao swNotificationAnnouncementDao;
|
|
private SwNotificationAnnouncementDao swNotificationAnnouncementDao;
|
|
@Autowired
|
|
@Autowired
|
|
private CommonBusinessDao commonBusinessDao;
|
|
private CommonBusinessDao commonBusinessDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysNotifyAnnounceUserDao sysNotifyAnnounceUserDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public R bind(AccountBindVo accountBindVo) {
|
|
public R bind(AccountBindVo accountBindVo) {
|
|
@@ -145,6 +142,12 @@ public class AccountServiceImpl implements AccountService {
|
|
weChatHomePageVo.setDuFees(outstandingBills.stream().map(SwBillManagementUnpaidDo::getActualdue).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
weChatHomePageVo.setDuFees(outstandingBills.stream().map(SwBillManagementUnpaidDo::getActualdue).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.selectShowData();
|
|
List<SwNotificationAnnouncementDo> swNotificationAnnouncementDos = swNotificationAnnouncementDao.selectShowData();
|
|
weChatHomePageVo.setSwNotificationAnnouncementDos(swNotificationAnnouncementDos);
|
|
weChatHomePageVo.setSwNotificationAnnouncementDos(swNotificationAnnouncementDos);
|
|
|
|
+ //获取微信标识
|
|
|
|
+ String openId = WeChatUtils.getCurrentWeChatOpenId();
|
|
|
|
+ //调用selectUserNotifyData方法获取用户消息列表
|
|
|
|
+ List<SysNotifyAnnounceUserDo> sysNotifyAnnounceUserDos = sysNotifyAnnounceUserDao.selectUserNotifyData(accountNumber, openId);
|
|
|
|
+ weChatHomePageVo.setSysNotifyAnnounceUserDos(sysNotifyAnnounceUserDos);
|
|
|
|
+
|
|
return R.ok(weChatHomePageVo);
|
|
return R.ok(weChatHomePageVo);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,4 +224,34 @@ public class AccountServiceImpl implements AccountService {
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public R updateReadStatus(ReadStatusVo readStatusVo) {
|
|
|
|
+ //获取微信标识
|
|
|
|
+ String openId = WeChatUtils.getCurrentWeChatOpenId();
|
|
|
|
+
|
|
|
|
+ // 获取参数
|
|
|
|
+ String id = readStatusVo.getId();
|
|
|
|
+ String account = readStatusVo.getAccount();
|
|
|
|
+ String deKey = readStatusVo.getDeKey();
|
|
|
|
+
|
|
|
|
+ // 更新消息读取状态
|
|
|
|
+ sysNotifyAnnounceUserDao.updateReadStatus(id, account, deKey, openId);
|
|
|
|
+ return R.ok("更新成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public R updateReadStatusAll(ReadStatusVo readStatusVo) {
|
|
|
|
+ //获取微信标识
|
|
|
|
+ String openId = WeChatUtils.getCurrentWeChatOpenId();
|
|
|
|
+
|
|
|
|
+ // 获取参数
|
|
|
|
+ String account = readStatusVo.getAccount();
|
|
|
|
+ String deKey = readStatusVo.getDeKey();
|
|
|
|
+
|
|
|
|
+ // 更新所有消息读取状态
|
|
|
|
+ sysNotifyAnnounceUserDao.updateReadStatusAll(account, deKey, openId);
|
|
|
|
+
|
|
|
|
+ return R.ok("更新成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|