From d41358fce9a436d81b9341d06fc1d8f3ddff92ff Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期一, 25 九月 2023 16:17:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java
index 39bbbfe..05343e6 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java
@@ -17,10 +17,7 @@
 import com.dsh.guns.core.common.constant.factory.PageFactory;
 import com.dsh.guns.core.util.ToolUtil;
 import com.dsh.guns.modular.system.model.*;
-import com.dsh.guns.modular.system.service.ICityService;
-import com.dsh.guns.modular.system.service.IEvaluationService;
-import com.dsh.guns.modular.system.service.IStoreService;
-import com.dsh.guns.modular.system.service.StoreConfigService;
+import com.dsh.guns.modular.system.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -48,6 +45,8 @@
     @Autowired
     private ICityService cityService;
     @Autowired
+    private IRegionService regionService;
+    @Autowired
     private FinanceClient financeClient;
     @Autowired
     private CancelledClassesClient cancelledClassesClient;
@@ -57,14 +56,11 @@
      */
     @RequestMapping("/rechargeRecords")
     public String index(Model model) {
-
         List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
         model.addAttribute("list",list);
-
         Integer objectType = UserExt.getUser().getObjectType();
         Integer objectId = UserExt.getUser().getObjectId();
         model.addAttribute("userType",objectType);
-        // 去重
         String roleid = UserExt.getUser().getRoleid();
         model.addAttribute("objectType",objectType);
         return PREFIX + "RechargeRecords.html";
@@ -76,9 +72,20 @@
     @ResponseBody
     public List<RechargeRecordsVO> list(String province, String city, String name, String phone,String time,Integer type) {
         RechargeRecordsQuery coachQuery = new RechargeRecordsQuery();
-        coachQuery.setProvince(province);
-        coachQuery.setCity(city);
+        Region provinceCode = regionService.getOne(new QueryWrapper<Region>().eq("code", province));
+        Region cityCode = regionService.getOne(new QueryWrapper<Region>().eq("code", city));
+        if (provinceCode!=null){
+            coachQuery.setProvince(provinceCode.getName());
+        }else{
+            coachQuery.setProvince(province);
+        }
+        if (cityCode!=null){
+            coachQuery.setCity(cityCode.getName());
+        }else{
+            coachQuery.setCity(city);
+        }
         coachQuery.setName(name);
+
         coachQuery.setPhone(phone);
         coachQuery.setTime(time);
         coachQuery.setType(type);
@@ -100,9 +107,11 @@
         coachQuery.setType(type);
         List<RechargeRecordsVO> rechargeRecordsVOS = financeClient.rechargeList(coachQuery);
         BigDecimal total = new BigDecimal("0.00");
+        BigDecimal result = new BigDecimal("0.00");
         for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) {
             BigDecimal amount = rechargeRecordsVO.getAmount();
-            total.add(amount);
+            total = total.add(amount); // 将新的值赋给total
+            result = result.add(amount); // 将新的值赋给result
         }
         return total;
     }

--
Gitblit v1.7.1