From 87710caff5482ee0bcaa58cf76c3cf0e3a9758f0 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 05 十二月 2025 14:44:04 +0800
Subject: [PATCH] 分公司审核,解除列表
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java | 77 ++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
index ef2c828..342aef2 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TCrmBranchServiceImpl.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.dto.TCrmBranchDTO;
+import com.ruoyi.system.export.TCrmBranchAuditExport;
import com.ruoyi.system.export.TCrmBranchExport;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.TCrmBranchLiftMapper;
@@ -16,12 +17,14 @@
import com.ruoyi.system.model.TCrmBranchArea;
import com.ruoyi.system.model.TCrmBranchLift;
import com.ruoyi.system.model.TCrmBranchSalary;
+import com.ruoyi.system.query.TCrmBranchAuditQuery;
import com.ruoyi.system.query.TCrmBranchQuery;
import com.ruoyi.system.query.TSysAppUserQuery;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.TCrmBranchAreaService;
import com.ruoyi.system.service.TCrmBranchSalaryService;
import com.ruoyi.system.service.TCrmBranchService;
+import com.ruoyi.system.vo.TCrmBranchLiftVO;
import com.ruoyi.system.vo.TCrmBranchVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -132,6 +135,25 @@
return R.fail("负责区域已存在");
}
}
+ }
+ if(dto.getPersonType() == 2){
+ // 查询一级
+ TCrmBranch crmBranch = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class)
+ .eq(TCrmBranch::getUserId, dto.getCorrelationPersonId())
+ .last("LIMIT 1"));
+ dto.setProvinceBranchId(crmBranch.getId());
+ }
+
+ if(dto.getPersonType() == 3){
+ // 查询二级
+ TCrmBranch crmBranch = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class)
+ .eq(TCrmBranch::getUserId, dto.getCorrelationPersonId())
+ .last("LIMIT 1"));
+ // 查询一级
+ TCrmBranch crmBranch1 = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class)
+ .eq(TCrmBranch::getUserId, crmBranch.getCorrelationPersonId())
+ .last("LIMIT 1"));
+ dto.setProvinceBranchId(crmBranch1.getId());
}
this.save(dto);
@@ -299,4 +321,59 @@
}
return list;
}
+
+ @Override
+ public PageInfo<TCrmBranchVO> pageAuditList(TCrmBranchAuditQuery query) {
+ PageInfo<TCrmBranchVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
+ List<TCrmBranchVO> list = this.baseMapper.pageAuditList(query,pageInfo);
+ if(CollectionUtils.isEmpty(list)){
+ return pageInfo;
+ }
+ List<String> branchIds = list.stream().map(TCrmBranchVO::getProvinceBranchId).collect(Collectors.toList());
+ List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds));
+ for (TCrmBranchVO tCrmBranchVO : list) {
+ List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> tCrmBranchVO.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList());
+ if(!CollectionUtils.isEmpty(crmBranchList)){
+ tCrmBranchVO.setProvinceBranchName(crmBranchList.get(0).getBranchName());
+ }
+ }
+ pageInfo.setRecords(list);
+ return pageInfo;
+ }
+
+ @Override
+ public PageInfo<TCrmBranchLiftVO> pageUnbindList(TCrmBranchAuditQuery query) {
+ PageInfo<TCrmBranchLiftVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
+ List<TCrmBranchLiftVO> list = this.baseMapper.pageUnbindList(query,pageInfo);
+ if(CollectionUtils.isEmpty(list)){
+ return pageInfo;
+ }
+ List<String> branchIds = list.stream().map(TCrmBranchLiftVO::getProvinceBranchId).collect(Collectors.toList());
+ List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds));
+ for (TCrmBranchLiftVO crmBranchLiftVO : list) {
+ List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> crmBranchLiftVO.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList());
+ if(!CollectionUtils.isEmpty(crmBranchList)){
+ crmBranchLiftVO.setProvinceBranchName(crmBranchList.get(0).getBranchName());
+ }
+ }
+ pageInfo.setRecords(list);
+ return pageInfo;
+ }
+
+ @Override
+ public List<TCrmBranchAuditExport> exportAuditList(TCrmBranchAuditQuery query) {
+ List<TCrmBranchAuditExport> list = this.baseMapper.exportAuditList(query);
+ if(CollectionUtils.isEmpty(list)){
+ return new ArrayList<>();
+ }
+ List<String> branchIds = list.stream().map(TCrmBranchAuditExport::getProvinceBranchId).collect(Collectors.toList());
+ List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds));
+ for (TCrmBranchAuditExport crmBranchAuditExport : list) {
+ List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> crmBranchAuditExport.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList());
+ if(!CollectionUtils.isEmpty(crmBranchList)){
+ crmBranchAuditExport.setProvinceBranchName(crmBranchList.get(0).getBranchName());
+ }
+ }
+ return list;
+ }
}
--
Gitblit v1.7.1