Forráskód Böngészése

一:功能需求
1.物流合同+客户经理过滤
2.企业求购+客户经理过滤
3.企业运需+客户经理过滤
4.钱包总览+客户经理过滤
二:修改包名

lengfaqiang 2 éve
szülő
commit
8302cca63c
19 módosított fájl, 298 hozzáadás és 46 törlés
  1. 8 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyMapper.java
  2. 21 18
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java
  3. 89 6
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java
  4. 86 0
      sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml
  5. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/LedgerLogisticsController.java
  6. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/LedgerTradeController.java
  7. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/OperateWalletController.java
  8. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementLogisticsController.java
  9. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementOfflineController.java
  10. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementTradeController.java
  11. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementWalletController.java
  12. 13 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletRelationService.java
  13. 62 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  14. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/LedgerLogisticsService.java
  15. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/LedgerTradeService.java
  16. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementLogisticsService.java
  17. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementOfflineService.java
  18. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementTradeService.java
  19. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementWalletService.java

+ 8 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/dao/KwpWantBuyMapper.java

@@ -22,5 +22,13 @@ public interface KwpWantBuyMapper extends BaseMapper<KwoWantBuy> {
 
     List<WantBuySelectRes> pageSelect(@Param("wantBuyReq") WantBuySelectParam wantBuyReq);
 
+    /**
+     * 查询数据
+     * @param wantBuyReq 请求参数
+     * @param authEntIdList 用户关联的企业id list
+     * @return
+     */
+    List<WantBuySelectRes> pageSelectAllByManager(@Param("wantBuyReq") WantBuySelectParam wantBuyReq, @Param("authEntIdList") List<Long> authEntIdList);
+
     List<TableTopRes> statisticsCount(@Param("wantBuyReq") WantBuySelectParam wantBuyReq);
 }

+ 21 - 18
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -236,13 +236,14 @@ public class KwoTransportDemandService {
                 }
                 authEntIdList.addAll(ids);
             }
-        } else {
-            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
-            if (CollectionUtils.isEmpty(ids)) {
-                return PageHelperUtil.getPageResult(new PageInfo<>());
-            }
-            authEntIdList.addAll(ids);
         }
+//        else {
+//            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+//            if (CollectionUtils.isEmpty(ids)) {
+//                return PageHelperUtil.getPageResult(new PageInfo<>());
+//            }
+//            authEntIdList.addAll(ids);
+//        }
 
         LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(BeanUtils.copyProperties(param, ExportTransportDemandParam.class), authEntIdList);
         IPage<KwoTransportDemand> page = new Page<>(param.getPage(), param.getPageSize());
@@ -367,13 +368,14 @@ public class KwoTransportDemandService {
                 }
                 authEntIdList.addAll(ids);
             }
-        } else {
-            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
-            if (CollectionUtils.isEmpty(ids)) {
-                return getDefaultStatistic(res);
-            }
-            authEntIdList.addAll(ids);
         }
+//        else {
+//            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+//            if (CollectionUtils.isEmpty(ids)) {
+//                return getDefaultStatistic(res);
+//            }
+//            authEntIdList.addAll(ids);
+//        }
 
         LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(BeanUtils.copyProperties(param, ExportTransportDemandParam.class), authEntIdList);
         List<KwoTransportDemand> demands = kwoTransportDemandMapper.selectList(wrapper);
@@ -444,13 +446,14 @@ public class KwoTransportDemandService {
                 }
                 authEntIdList.addAll(ids);
             }
-        } else {
-            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
-            if (CollectionUtils.isEmpty(ids)) {
-                return new ArrayList<>();
-            }
-            authEntIdList.addAll(ids);
         }
+//        else {
+//            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+//            if (CollectionUtils.isEmpty(ids)) {
+//                return new ArrayList<>();
+//            }
+//            authEntIdList.addAll(ids);
+//        }
         LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(param, authEntIdList);
         List<KwoTransportDemand> demands = kwoTransportDemandMapper.selectList(wrapper);
         if (CollectionUtils.isEmpty(demands)) {

+ 89 - 6
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -28,6 +28,7 @@ import com.sckw.order.model.dto.WantBuyExport;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.model.vo.res.*;
 import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import lombok.RequiredArgsConstructor;
@@ -50,6 +51,8 @@ import java.util.stream.Collectors;
 public class KwpWantBuyService {
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
+    RemoteUserService remoteUserService;
     private final KwpWantBuyMapper kwpWantBuyMapper;
     private final KwpWantBuyTradingMapper kwpWantBuyTradingMapper;
     private final KwpWantBuyAddressMapper kwpWantBuyAddressMapper;
@@ -155,11 +158,32 @@ public class KwpWantBuyService {
             List<String> goodsTypes = goodsTypeHandle(wantBuySelectParam);
             wantBuySelectParam.setGoodsTypeValueSearch(goodsTypes);
         }
-        wantBuySelectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+//        wantBuySelectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+
+        /**新增客户经理权限过滤*/
+        List<Long> authEntIdList = new ArrayList<>();
+        if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
+            authEntIdList.add(LoginUserHolder.getEntId());
+        } else {
+            List<Long> authEntIdList1 = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList1)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new PageRes<>();
+                }
+                authEntIdList.addAll(ids);
+            } else {
+                authEntIdList.addAll(authEntIdList1);
+            }
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
         wantBuySelectParam.setSystemType(LoginUserHolder.getSystemType());
 
         PageHelper.startPage(wantBuySelectParam.getPage(), wantBuySelectParam.getPageSize());
-        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(wantBuySelectParam);
+//        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(wantBuySelectParam);
+        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelectAllByManager(wantBuySelectParam,authEntIdList);
         if (CollectionUtils.isEmpty(wantBuyDto)) {
             return new PageRes<>();
         }
@@ -504,10 +528,30 @@ public class KwpWantBuyService {
             List<String> goodsTypes = goodsTypeHandle(params);
             params.setGoodsTypeValueSearch(goodsTypes);
         }
-        params.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+//        params.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+        /**新增客户经理权限过滤*/
+        List<Long> authEntIdList = new ArrayList<>();
+        if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
+            authEntIdList.add(LoginUserHolder.getEntId());
+        } else {
+            List<Long> authEntIdList1 = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList1)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                   return getDefaultTops(res);
+                }
+                authEntIdList.addAll(ids);
+            } else {
+                authEntIdList.addAll(authEntIdList1);
+            }
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
         params.setSystemType(LoginUserHolder.getSystemType());
 
-        List<WantBuySelectRes> result = kwpWantBuyMapper.pageSelect(params);
+//        List<WantBuySelectRes> result = kwpWantBuyMapper.pageSelect(params);
+        List<WantBuySelectRes> result = kwpWantBuyMapper.pageSelectAllByManager(params,authEntIdList);
         Map<Integer, List<WantBuySelectRes>> map = result.stream().collect(Collectors.groupingBy(WantBuySelectRes::getStatus));
         List<TableTop> tableTops = new ArrayList<>();
         TableTop all = new TableTop();
@@ -532,6 +576,24 @@ public class KwpWantBuyService {
         return res;
     }
 
+    private TableStatisticRes getDefaultTops(TableStatisticRes res) {
+        List<TableTop> tableTops = new ArrayList<>();
+        TableTop all = new TableTop();
+        all.setName("全部").setTotal(0);
+        tableTops.add(all);
+        List<WantBuyStatusEnum> enums = WantBuyStatusEnum.getSortList();
+        enums.forEach(e -> {
+            Integer value = e.getCode();
+            TableTop tableTop = new TableTop();
+            tableTop.setName(e.getMsg()).setValue(value).setTotal(0);
+            tableTops.add(tableTop);
+        });
+        TableBottom tableBottom = new TableBottom();
+        tableBottom.setTotal(0);
+        res.setTableTops(tableTops).setTableBottom(tableBottom);
+        return res;
+    }
+
     public List<WantBuyExport> export(WantBuySelectParam param) {
         WantBuySelectParam selectParam = new WantBuySelectParam();
         if (StringUtils.isNotBlank(param.getIds())) {
@@ -549,10 +611,31 @@ public class KwpWantBuyService {
                 selectParam.setGoodsTypeValueSearch(goodsTypes);
             }
         }
-        selectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+//        selectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+
+        /**新增客户经理权限过滤*/
+        List<Long> authEntIdList = new ArrayList<>();
+        if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
+            authEntIdList.add(LoginUserHolder.getEntId());
+        } else {
+            List<Long> authEntIdList1 = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList1)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return Collections.emptyList();
+                }
+                authEntIdList.addAll(ids);
+            } else {
+                authEntIdList.addAll(authEntIdList1);
+            }
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
         selectParam.setSystemType(LoginUserHolder.getSystemType());
 
-        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(selectParam);
+//        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(selectParam);
+        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelectAllByManager(selectParam,authEntIdList);
         if (CollectionUtils.isEmpty(wantBuyDto)) {
             return Collections.emptyList();
         }

+ 86 - 0
sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml

@@ -42,6 +42,81 @@
         </collection>
     </resultMap>
 
+    <sql id="managerWhere">
+        kb.del_flag = 0
+        <if test="authEntIdList != null and authEntIdList.size() != 0">
+            and kb.ent_id in
+            <foreach collection="authEntIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="wantBuyReq.startCreateTime != null">
+            and kb.create_time &gt;= #{wantBuyReq.startCreateTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="wantBuyReq.endCreateTime != null">
+            and kb.create_time &lt;= #{wantBuyReq.endCreateTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="wantBuyReq.tradings != null and wantBuyReq.tradings.size() > 0">
+            <!--私用and条件-->
+            <!--            and kt.trading in-->
+            <!--            <foreach collection="wantBuyReq.tradings" item="item" open="(" close=")" separator=",">-->
+            <!--                #{item,jdbcType=VARCHAR}-->
+            <!--            </foreach>-->
+            <!-- 使用 AND 条件 -->
+            <!--            and (-->
+            <!--            <foreach collection="wantBuyReq.tradings" item="item" separator=" and ">-->
+            <!--                kt.trading = #{item,jdbcType=VARCHAR}-->
+            <!--            </foreach>-->
+            <!--            )-->
+            <foreach collection="wantBuyReq.tradings" item="value" separator="">
+                AND EXISTS (
+                SELECT 1
+                FROM kwo_want_buy_trading kt2
+                WHERE kt2.want_buy_id = kb.id
+                AND kt2.trading = #{value}
+                )
+            </foreach>
+        </if>
+        <if test="wantBuyReq.wantBuyIds != null and wantBuyReq.wantBuyIds.size() > 0">
+            and kb.id in
+            <foreach collection="wantBuyReq.wantBuyIds" item="item" open="(" close=")" separator=",">
+                #{item,jdbcType=BIGINT}
+            </foreach>
+        </if>
+        <if test="wantBuyReq.status != null">
+            and kb.status = #{wantBuyReq.status}
+        </if>
+        <if test="wantBuyReq.entId != null ">
+            and kb.ent_id = #{wantBuyReq.entId}
+        </if>
+        <if test="wantBuyReq.keywords != null and wantBuyReq.keywords != ''">
+            <if test="wantBuyReq.entIds != null and wantBuyReq.entIds.size() > 0">
+                and (kb.ent_id in
+                <foreach collection="wantBuyReq.entIds" item="item" open="(" close=")" separator=",">
+                    #{item,jdbcType=BIGINT}
+                </foreach>
+                or kb.`name` like concat('%', #{wantBuyReq.keywords,jdbcType=VARCHAR}, '%')
+                )
+            </if>
+            <if test="wantBuyReq.entIds == null or wantBuyReq.entIds.size() == 0">
+                and (kb.`name` like concat('%', #{wantBuyReq.keywords,jdbcType=VARCHAR}, '%'))
+            </if>
+        </if>
+        <if test="wantBuyReq.goodsTypeValueSearch != null and wantBuyReq.goodsTypeValueSearch.size() > 0">
+            and kb.goods_type in
+            <foreach collection="wantBuyReq.goodsTypeValueSearch" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="wantBuyReq.cityCode != null and wantBuyReq.cityCode != ''">
+            and (kba.`city_code` like concat(#{wantBuyReq.cityCode,jdbcType=VARCHAR}, '%'))
+        </if>
+        <if test="wantBuyReq.systemType != null and wantBuyReq.systemType == 1">
+            and kb.status in (1,2)
+        </if>
+
+    </sql>
+
     <sql id="where">
         kb.del_flag = 0
         <if test="wantBuyReq.startCreateTime != null">
@@ -121,6 +196,17 @@
         </where>
         group by kb.id
         order by kb.create_time desc
+
+    </select><select id="pageSelectAllByManager" resultMap="wangBuyResultMap" resultType="com.sckw.order.model.vo.res.WantBuySelectRes">
+        select
+        <include refid="Base_Column_List" />
+        from kwo_want_buy kb left join kwo_want_buy_address kba on kb.id = kba.want_buy_id and kba.del_flag = 0
+            left join kwo_want_buy_trading kt on kb.id = kt.want_buy_id and kt.del_flag = 0
+        <where>
+            <include refid="managerWhere" />
+        </where>
+        group by kb.id
+        order by kb.create_time desc
     </select>
 
 <!--    <resultMap id="tradIngMap" type="com.sckw.order.model.KwoWantBuyTrading">-->

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerLogisticsController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/LedgerLogisticsController.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
@@ -7,7 +7,7 @@ import com.sckw.payment.model.vo.LedgerLogistics;
 import com.sckw.payment.model.vo.excel.LedgerLogisticsExport;
 import com.sckw.payment.model.vo.req.LedgerListReq;
 import com.sckw.payment.model.vo.req.LogisticsReq;
-import com.sckw.payment.service.operate.LedgerLogisticsService;
+import com.sckw.payment.service.operationManagement.LedgerLogisticsService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerTradeController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/LedgerTradeController.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
@@ -7,7 +7,7 @@ import com.sckw.payment.model.vo.LedgerSell;
 import com.sckw.payment.model.vo.excel.LedgerTradeExport;
 import com.sckw.payment.model.vo.req.LedgerListReq;
 import com.sckw.payment.model.vo.req.TradeReq;
-import com.sckw.payment.service.operate.LedgerTradeService;
+import com.sckw.payment.service.operationManagement.LedgerTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/OperateWalletController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/OperateWalletController.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.vo.req.CashPageReq;

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementLogisticsController.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -6,7 +6,7 @@ import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.vo.SettlementLogistics;
 import com.sckw.payment.model.vo.excel.SettlementLogisticsExportVo;
 import com.sckw.payment.model.vo.req.SettlementReq;
-import com.sckw.payment.service.operate.SettlementLogisticsService;
+import com.sckw.payment.service.operationManagement.SettlementLogisticsService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementOfflineController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementOfflineController.java

@@ -1,9 +1,9 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
 import com.sckw.payment.model.vo.req.SettlementOfflineReq;
-import com.sckw.payment.service.operate.SettlementOfflineService;
+import com.sckw.payment.service.operationManagement.SettlementOfflineService;
 import jakarta.annotation.Resource;
 import jakarta.validation.Valid;
 import org.springframework.web.bind.annotation.GetMapping;

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementTradeController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementTradeController.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -6,7 +6,7 @@ import com.sckw.payment.model.constant.TradeUnitType;
 import com.sckw.payment.model.vo.SettlementTrade;
 import com.sckw.payment.model.vo.excel.SettlementTradeExportVo;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
-import com.sckw.payment.service.operate.SettlementTradeService;
+import com.sckw.payment.service.operationManagement.SettlementTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementWalletController.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operationManagement/SettlementWalletController.java

@@ -1,10 +1,10 @@
-package com.sckw.payment.controller.operate;
+package com.sckw.payment.controller.operationManagement;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
 import com.sckw.payment.model.constant.SettlementWalletPayTypeEnum;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
-import com.sckw.payment.service.operate.SettlementWalletService;
+import com.sckw.payment.service.operationManagement.SettlementWalletService;
 import jakarta.annotation.Resource;
 import jakarta.validation.Valid;
 import org.springframework.validation.annotation.Validated;

+ 13 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletRelationService.java

@@ -42,6 +42,19 @@ public class KwpWalletRelationService {
         return new ArrayList<>();
     }
 
+    public List<String> getAllByManagerEntIds(List<Long> authEntIdList) {
+        LambdaQueryWrapper<KwpWalletRelation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwpWalletRelation::getDelFlag, 0);
+        if (authEntIdList.size() > 0 && CollectionUtils.isNotEmpty(authEntIdList)) {
+            wrapper.in(KwpWalletRelation::getEntId, authEntIdList);
+        }
+        List<KwpWalletRelation> kwpWalletRelations = relationMapper.selectList(wrapper);
+        if (!CollectionUtils.isEmpty(kwpWalletRelations)) {
+            return kwpWalletRelations.stream().map(KwpWalletRelation::getUid).collect(Collectors.toList());
+        }
+        return new ArrayList<>();
+    }
+
     /**
      * 根据企业id查询中台用户
      *

+ 62 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -38,6 +38,7 @@ import com.sckw.payment.model.vo.res.*;
 import com.sckw.redis.config.RedisLockUtil;
 import com.sckw.redis.constant.RedisLockKey;
 import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.EntCertificateResDto;
 import lombok.RequiredArgsConstructor;
@@ -82,6 +83,8 @@ public class WalletService {
     private RemoteSystemService remoteSystemService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteManageService remoteManageService;
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    private RemoteUserService remoteUserService;
 
     /**
      * 填充时间等参数
@@ -552,6 +555,22 @@ public class WalletService {
                 }
             }
         } else {
+            /*增加客户经理数据过滤*/
+            List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+            if (CollectionUtils.isEmpty(authEntIdList)) {
+                List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+                if (CollectionUtils.isEmpty(ids)) {
+                    return new ArrayList<>();
+                }
+                authEntIdList.addAll(ids);
+            }
+            if (CollectionUtils.isNotEmpty(authEntIdList)) {
+                authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+            }
+            all = walletRelationService.getAllByManagerEntIds(authEntIdList);
+            if (CollectionUtils.isEmpty(all)) {
+                return PageRes.handPage(walletDetailReq.getPage(), walletDetailReq.getPageSize(), new ArrayList<>());
+            }
             //不搜索往来单位
             for (String uid : all) {
                 R<Wallet> wallet = payCenterService.walletSum(uid, channelEnum, "");
@@ -850,7 +869,20 @@ public class WalletService {
     public Object cashList2(CashPageReq cashPageReq) {
         log.info("提现记录:{}", JSONObject.toJSONString(cashPageReq));
 
-        List<String> all = walletRelationService.getAll();
+//        List<String> all = walletRelationService.getAll();
+        /*增加客户经理数据过滤*/
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return new ArrayList<>();
+            }
+            authEntIdList.addAll(ids);
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
+        List<String> all = walletRelationService.getAllByManagerEntIds(authEntIdList);
         if (CollectionUtils.isEmpty(all)) {
             return PageRes.handPage(cashPageReq.getPage(), cashPageReq.getPageSize(), new ArrayList<>());
         }
@@ -954,7 +986,21 @@ public class WalletService {
      */
     public Object cashCount2(CashPageReq cashPageReq) {
         log.info("运营端提现分类页签统计:{}", JSONObject.toJSONString(cashPageReq));
-        List<String> all = walletRelationService.getAll();
+        /*增加客户经理数据过滤*/
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return null;
+            }
+            authEntIdList.addAll(ids);
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
+
+//        List<String> all = walletRelationService.getAll();
+        List<String> all = walletRelationService.getAllByManagerEntIds(authEntIdList);
         if (CollectionUtils.isEmpty(all)) {
             return null;
         }
@@ -1054,7 +1100,20 @@ public class WalletService {
      * @return
      */
     public Object prePayList2(PrePayPage prePayPage) {
-        List<String> all = walletRelationService.getAll();
+//        List<String> all = walletRelationService.getAll();
+                /*增加客户经理数据过滤*/
+        List<Long> authEntIdList = LoginUserHolder.getAuthEntIdList();
+        if (CollectionUtils.isEmpty(authEntIdList)) {
+            List<Long> ids = remoteUserService.findEnterpriseIdsByUserIdIsMain(LoginUserHolder.getUserId());
+            if (CollectionUtils.isEmpty(ids)) {
+                return new ApPageRes<>(prePayPage.getPage(), prePayPage.getPageSize(), 0, 0, new ArrayList<>());
+            }
+            authEntIdList.addAll(ids);
+        }
+        if (CollectionUtils.isNotEmpty(authEntIdList)) {
+            authEntIdList = authEntIdList.stream().distinct().collect(Collectors.toList());
+        }
+        List<String> all = walletRelationService.getAllByManagerEntIds(authEntIdList);
         if (CollectionUtils.isEmpty(all)) {
             return new ApPageRes<>(prePayPage.getPage(), prePayPage.getPageSize(), 0, 0, new ArrayList<>());
         }

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/LedgerLogisticsService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/LedgerLogisticsService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/LedgerTradeService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/LedgerTradeService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.github.pagehelper.PageHelper;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementLogisticsService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementLogisticsService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementOfflineService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementOfflineService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementTradeService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementTradeService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementWalletService.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operationManagement/SettlementWalletService.java

@@ -1,4 +1,4 @@
-package com.sckw.payment.service.operate;
+package com.sckw.payment.service.operationManagement;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;