From 60de92280e4cd66a914f41b0681656a62cde346d Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 14 一月 2025 14:50:52 +0800
Subject: [PATCH] 修改bug
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
index d6b352e..82218b8 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
@@ -15,6 +15,8 @@
import com.ruoyi.other.service.ShopBalanceStatementService;
import com.ruoyi.other.service.ShopService;
import com.ruoyi.other.vo.ShopCommissionStatisticsVO;
+import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.api.feignClient.SysUserClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -23,6 +25,8 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
import java.util.Collection;
import java.util.List;
import java.util.List;
@@ -45,9 +49,10 @@
private TokenService tokenService;
@Resource
private ShopBalanceStatementMapper shopBalanceStatementMapper;
-
@Resource
private ShopService shopService;
+ @Resource
+ private SysUserClient sysUserClient;
@@ -69,7 +74,10 @@
public R<Page<ShopBalanceStatement>> shopCommissionStatisticslist(@ApiParam("页码") @RequestParam Integer pageNum,
@ApiParam("每一页数据大小") Integer pageSize,
ShopBalanceStatement shopBalanceStatement){
- Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
+ Long userid = tokenService.getLoginUser().getUserid();
+ R<SysUser> sysUserR = sysUserClient.getSysUser(userid);
+ SysUser sysUser = sysUserR.getData();
+ Integer objectId = sysUser.getObjectId();
Page<ShopBalanceStatement> page = shopBalanceStatementService.lambdaQuery().eq(ShopBalanceStatement::getShopId, objectId).eq(shopBalanceStatement.getType() != null, ShopBalanceStatement::getType, shopBalanceStatement.getType())
.orderByDesc(ShopBalanceStatement::getCreateTime)
.page(Page.of(pageNum, pageSize));
@@ -159,9 +167,19 @@
* @return
*/
@PostMapping("/getShopBalanceStatementList")
- public R<List<ShopBalanceStatement>> getShopBalanceStatementList(@RequestParam("types") Collection<Integer> types, @RequestParam("objectId") Long objectId){
- List<ShopBalanceStatement> list = shopBalanceStatementService.list(new LambdaQueryWrapper<ShopBalanceStatement>().eq(ShopBalanceStatement::getObjectId, objectId)
- .in(ShopBalanceStatement::getType, types));
+ public R<List<ShopBalanceStatement>> getShopBalanceStatementList(@RequestParam("types") Collection<Integer> types, @RequestParam(value = "objectId",required = false) Long objectId){
+ List<ShopBalanceStatement> list = shopBalanceStatementService.list(new LambdaQueryWrapper<ShopBalanceStatement>()
+ .eq(objectId != null,ShopBalanceStatement::getObjectId, objectId)
+ .in(types !=null && !types.isEmpty(),ShopBalanceStatement::getType, types));
+ return R.ok(list);
+ }
+
+ @PostMapping("/getShopBalanceStatementList2")
+ public R<List<ShopBalanceStatement>> getShopBalanceStatementList2(@RequestParam("type") Integer type,
+ @RequestParam(value = "date") LocalDateTime date){
+ List<ShopBalanceStatement> list = shopBalanceStatementService.list(new LambdaQueryWrapper<ShopBalanceStatement>()
+ .eq(ShopBalanceStatement::getType, type)
+ .between(ShopBalanceStatement::getCreateTime, date.with(LocalTime.MIN), date.with(LocalTime.MAX)));
return R.ok(list);
}
}
--
Gitblit v1.7.1