From af17b0f5142f5b4a5c1c40cd0db814cacca6ceaf Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 09 十二月 2025 18:52:20 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/haizhentong
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmSalespersonController.java | 41 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmSalespersonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmSalespersonController.java
index d2ad35e..8e5332b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmSalespersonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmSalespersonController.java
@@ -28,6 +28,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -35,6 +36,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
+import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -78,8 +80,32 @@
// 查询分公司信息
TCrmBranch crmBranch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class)
.eq(TCrmBranch::getUserId, userId)
+ .eq(TCrmBranch::getStatus, 1)
.last("LIMIT 1"));
- query.setBranchId(crmBranch.getId());
+ List<String> branchIds = new ArrayList<>();
+ if(crmBranch.getPersonType() == 1){
+ List<TCrmBranch> crmBranches = crmBranchService.list(Wrappers.lambdaQuery(TCrmBranch.class)
+ .eq(TCrmBranch::getProvinceBranchId, crmBranch.getId()));
+ branchIds.add(crmBranch.getId());
+ if(!CollectionUtils.isEmpty(crmBranches)){
+ List<String> branchIdList = crmBranches.stream().map(TCrmBranch::getId).collect(Collectors.toList());
+ branchIds.addAll(branchIdList);
+ query.setBranchIds(branchIds);
+ }
+ }
+ if(crmBranch.getPersonType() == 2){
+ List<TCrmBranch> crmBranches = crmBranchService.list(Wrappers.lambdaQuery(TCrmBranch.class)
+ .eq(TCrmBranch::getCorrelationPersonId, crmBranch.getId()));
+ branchIds.add(crmBranch.getId());
+ if(!CollectionUtils.isEmpty(crmBranches)){
+ List<String> branchIdList = crmBranches.stream().map(TCrmBranch::getId).collect(Collectors.toList());
+ branchIds.addAll(branchIdList);
+ query.setBranchIds(branchIds);
+ }
+ }
+ if(crmBranch.getPersonType() == 3){
+ branchIds.add(crmBranch.getId());
+ }
}
return R.ok(crmSalespersonService.pageList(query));
}
@@ -113,6 +139,19 @@
}
/**
+ * 获取crm业务员管理管理列表
+ */
+ @ApiOperation(value = "获取crm业务员管理列表")
+ @GetMapping(value = "/listByBranchId")
+ public R<List<TCrmSalesperson>> listByBranchId(@RequestParam String branchId) {
+ LambdaQueryWrapper<TCrmSalesperson> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(TCrmSalesperson::getBranchId,branchId);
+ wrapper.eq(TCrmSalesperson::getStatus,1)
+ .orderByDesc(TCrmSalesperson::getCreateTime);
+ return R.ok(crmSalespersonService.list(wrapper));
+ }
+
+ /**
* 添加crm业务员管理管理
*/
@Log(title = "crm业务员管理信息-新增crm业务员管理", businessType = BusinessType.INSERT)
--
Gitblit v1.7.1