From 03e20b226d79f4452722a42eae275edb94bebba5 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 28 十月 2024 15:20:30 +0800
Subject: [PATCH] xiugai

---
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TAccountingStrategyMapper.java            |    3 ++-
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java |   22 ++++++++++++++++++++++
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java    |    2 +-
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/TAccountingStrategyService.java          |    3 ++-
 ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TAccountingStrategyMapper.xml                  |   19 +++++++++++++++++++
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java                            |    3 +--
 6 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
index 2670e36..a4a794b 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -327,7 +327,7 @@
     @PostMapping(value = "/auth/pageList")
     public AjaxResult<PageInfo<TAccountingStrategyVO>> authPageList(@RequestBody TAccountingStrategyQuery query) {
 
-        return AjaxResult.ok(accountingStrategyService.pageList(query));
+        return AjaxResult.ok(accountingStrategyService.pageList1(query));
     }
     
 
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TAccountingStrategyMapper.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TAccountingStrategyMapper.java
index 6b3ce5d..efbf492 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TAccountingStrategyMapper.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TAccountingStrategyMapper.java
@@ -28,7 +28,8 @@
      * @return
      */
     List<TAccountingStrategyVO> pageList(@Param("query") TAccountingStrategyQuery query, @Param("pageInfo")PageInfo<TAccountingStrategyVO> pageInfo);
-    
+    List<TAccountingStrategyVO> pageList1(@Param("query") TAccountingStrategyQuery query, @Param("pageInfo")PageInfo<TAccountingStrategyVO> pageInfo);
+
     
     /**
      * 获取平台添加的计费策略
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/TAccountingStrategyService.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/TAccountingStrategyService.java
index 06834ef..f805cd0 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/TAccountingStrategyService.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/TAccountingStrategyService.java
@@ -24,7 +24,8 @@
      * @return
      */
     PageInfo<TAccountingStrategyVO> pageList(TAccountingStrategyQuery query);
-    
+    PageInfo<TAccountingStrategyVO> pageList1(TAccountingStrategyQuery query);
+
     /**
      * 获取平台添加的计费策略
      * @return
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
index 472d616..29d8c4a 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyServiceImpl.java
@@ -64,6 +64,28 @@
         pageInfo.setRecords(list);
         return pageInfo;
     }
+    @Override
+    public PageInfo<TAccountingStrategyVO> pageList1(TAccountingStrategyQuery query) {
+        PageInfo<TAccountingStrategyVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
+        List<TAccountingStrategyVO> list = this.baseMapper.pageList1(query,pageInfo);
+        List<Integer> parentIds = list.stream().map(TAccountingStrategyVO::getId).collect(Collectors.toList());
+
+        for (TAccountingStrategyVO tAccountingStrategyVO : list) {
+            SysUser data = sysUserClient.getSysUser(tAccountingStrategyVO.getUserId()).getData();
+            tAccountingStrategyVO.setUserName(data.getNickName());
+            if (tAccountingStrategyVO.getFirstUserId()!=null){
+                SysUser first = sysUserClient.getSysUser(tAccountingStrategyVO.getFirstUserId()).getData();
+                tAccountingStrategyVO.setFirstUserName(first==null?null:first.getNickName());
+            }
+            if (tAccountingStrategyVO.getTwoUserId()!=null){
+                SysUser two = sysUserClient.getSysUser(tAccountingStrategyVO.getTwoUserId()).getData();
+                tAccountingStrategyVO.setTwoUserName(two==null?null:two.getNickName());
+            }
+
+        }
+        pageInfo.setRecords(list);
+        return pageInfo;
+    }
     
     
     /**
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TAccountingStrategyMapper.xml b/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TAccountingStrategyMapper.xml
index e218c2a..c9b1ea5 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TAccountingStrategyMapper.xml
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TAccountingStrategyMapper.xml
@@ -43,6 +43,25 @@
         ORDER BY create_time DESC
     </select>
 
+
+    <select id="pageList1" resultType="com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO">
+        SELECT
+        id, site_id, `name`, description, discount,first_user_id,two_user_id,first_remark,two_remark,audit_status,first_audit_time,two_audit_time, create_time, del_flag,user_id,parent_id
+        FROM t_accounting_strategy
+        <where>
+            <if test="query.name != null and query.name != ''">
+                AND `name` LIKE concat('%',#{query.name}, '%')
+            </if>
+            <if test="query.auditStatus != null">
+                AND audit_status = #{query.auditStatus}
+            </if>
+            AND site_id IS NULL
+            AND (parent_id IS NULL OR audit_status = 1 OR audit_status = 2)
+            AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+        </where>
+        ORDER BY create_time DESC
+    </select>
+
     
     
     <select id="getPlatformAccountingStrategy" resultType="com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO">
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java
index 7a58640..5f390ad 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java
@@ -60,7 +60,6 @@
     @Override
     public PageInfo<TGoods> pageList1(AppGoodQuery basePage) {
         GoodsDTO dto = new GoodsDTO();
-        dto.setType(2);
         dto.setStatus(1);
         dto.setPageCurr(basePage.getPageCurr());
         dto.setPageSize(basePage.getPageSize());
@@ -81,7 +80,7 @@
         }
         String string = stringBuilder.toString();
         // 订单号加上商品类型
-        String res = string+"-"+dto.getType();
+        String res = string+"-"+basePage.getType();
 
         List<Integer> data = orderClient.getSalesCountByGoodsId(res).getData();
         for (int i = 0; i < list.size(); i++) {

--
Gitblit v1.7.1