From bc3c8f7b4076e885dce6549bc4579d7e26e29774 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期一, 13 一月 2025 15:02:56 +0800
Subject: [PATCH] 12.18

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java        |   14 ++++++++------
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java |    7 ++++++-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
index 73d5d13..b654b8c 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.account.api.model.AppUser;
 import com.ruoyi.account.api.model.UserCancellationLog;
 import com.ruoyi.account.api.model.UserCoupon;
@@ -34,6 +35,7 @@
 import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.feignClient.SysUserClient;
 import io.swagger.annotations.*;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -721,13 +723,16 @@
      */
     @GetMapping("/commissionDetail")
     @ApiOperation(value = "分佣统计", tags = "管理后台-首页统计")
-    public R<CommissionDetail> commissionDetail() {
+    public R<CommissionDetail> commissionDetail(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
+                                                @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
         Long userid = tokenService.getLoginUser().getUserid();
         SysUser sysUser = sysUserClient.getSysUser(userid).getData();
         LambdaQueryWrapper<AppUser> queryWrapper = new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0);
         if(sysUser.getRoleType() == 2){
             queryWrapper.eq(AppUser::getShopId, sysUser.getObjectId());
         }
+        queryWrapper.ge(null != startTime, AppUser::getCreateTime, startTime);
+        queryWrapper.le(null != endTime, AppUser::getCreateTime, endTime);
         queryWrapper.orderByAsc(AppUser::getCreateTime);
         List<AppUser> appUserList = appUserService.list(queryWrapper);
         if (appUserList.isEmpty()) {
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
index 2bc41bf..64e4910 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -119,9 +119,11 @@
         shop.setDistrictCode(city);
         shopService.save(shop);
 
+        Integer shopId = shop.getId();
+
         AppUserShop appUserShop = new AppUserShop();
         appUserShop.setAppUserId(appUser.getId());
-        appUserShop.setShopId(shop.getId());
+        appUserShop.setShopId(shopId);
         R<Void> r = appUserClient.addAppUserShop(appUserShop);
         if (R.isError(r)){
             throw new RuntimeException("添加失败");
@@ -136,14 +138,14 @@
         if(null != sysUser){
             UserShop userShop = new UserShop();
             userShop.setUserId(sysUser.getUserId());
-            userShop.setShopId(shop.getId());
+            userShop.setShopId(shopId);
             userShop.setRoleType(1);
             userShop.setNickName(sysUser.getNickName());
             List<UserShop> data = userShopClient.getUserShop(userShop).getData();
             if(null == data || data.size() == 0){
                 userShop = new UserShop();
                 userShop.setUserId(sysUser.getUserId());
-                userShop.setShopId(shop.getId());
+                userShop.setShopId(shopId);
                 userShop.setRoleType(1);
                 userShop.setRoleId(2L);
                 userShop.setCreateTime(LocalDateTime.now());
@@ -160,7 +162,7 @@
             user.setStatus("0");
             user.setDelFlag("0");
             user.setRoleType(2);
-            user.setObjectId(shop.getId());
+            user.setObjectId(shopId);
             user.setAppUserId(appUser.getId());
             user.setPassword(phone.substring(5));
             user.setCreateTime(new Date());
@@ -168,14 +170,14 @@
 
             UserShop userShop = new UserShop();
             userShop.setUserId(userId);
-            userShop.setShopId(shop.getId());
+            userShop.setShopId(shopId);
             userShop.setRoleType(1);
             userShop.setRoleId(2L);
             userShopClient.saveUserShop(userShop);
         }
 
         // 更换下级会员绑定门店
-        R<List<AppUser>> lowerShopR = appUserClient.setLowerUserShop(appUser.getId(), shop.getId());
+        R<List<AppUser>> lowerShopR = appUserClient.setLowerUserShop(appUser.getId(), shopId);
         if (R.isError(lowerShopR)){
             throw new RuntimeException("更换下级会员绑定门店失败");
         }

--
Gitblit v1.7.1