From 10f1422bc8f401b06b1e55ee63b23016d74abce8 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 28 二月 2024 11:34:09 +0800
Subject: [PATCH] 优化商户发券逻辑
---
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java | 39 +++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
index 171dea4..15f9a03 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -1106,8 +1106,8 @@
* @date 2023/6/18 16:59
*/
@Override
- public MgtBulletinBoardVo boardShopTotal(){
- MgtBulletinBoardVo mgtBulletinBoardVoShop = shopMapper.shopTotal();
+ public MgtBulletinBoardVo boardShopTotal(List<Long> userIds){
+ MgtBulletinBoardVo mgtBulletinBoardVoShop = shopMapper.shopTotal(userIds);
return mgtBulletinBoardVoShop;
}
@@ -1249,7 +1249,7 @@
userIdList.add(mgtBasePlatformDto.getUserId());
} else {
MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept();
- mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getUserId());
+ mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getDeptId());
mgtUserIdByDept = configService.getUserIdByDept(mgtUserIdByDept).getData();
userIdList = mgtUserIdByDept.getUserIdList();
}
@@ -1257,8 +1257,20 @@
mgtBasePlatformDto.setUserIdList(userIdList);
}
}
+ //数据权限
+ List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId();
+ if(null != userIds){
+ List<Long> userIdList = mgtBasePlatformDto.getUserIdList();
+ if(null != userIdList){
+ userIdList.addAll(userIds);
+ }else{
+ userIdList = userIds;
+ }
+ mgtBasePlatformDto.setUserIdList(userIdList);
+ }
+
//获取基础统计
- MgtPlTotalShopTotalVo plTotalShopTotalVo = shopMapper.getPlTotalShopTotal();
+ MgtPlTotalShopTotalVo plTotalShopTotalVo = shopMapper.getPlTotalShopTotal(userIds);
plTotalShopTotalVo.setSignTotal(0);
List<Long> shopIdList = shopMapper.listShopIdByTotal(mgtBasePlatformDto);
if (!shopIdList.isEmpty()) {
@@ -1917,4 +1929,23 @@
public List<Shop> listShopByCityCode(List<String> cityCodes){
return shopMapper.listShopByCityCode(cityCodes);
}
+
+
+ /**
+ * 根据员工id获取对应的门店
+ * @param userIds
+ * @return
+ */
+ @Override
+ public List<Shop> getShopBySysUserIds(List<Long> userIds) {
+ if(null == userIds || userIds.size() == 0){
+ return new ArrayList<>();
+ }
+ QueryWrapper<Shop> queryWrapper = new QueryWrapper<Shop>().eq("del_flag", 0).ne("shop_status", -1);
+ if(null != userIds && userIds.size() > 0){
+ queryWrapper.in("belong_user_id", userIds);
+ }
+ List<Shop> list = this.list(queryWrapper);
+ return list;
+ }
}
--
Gitblit v1.7.1