ソースを参照

Merge branch 'hurx'

hurx 1 ヶ月 前
コミット
d19926ee5d
21 ファイル変更292 行追加26 行削除
  1. 2 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteAddressAreaService.java
  2. 3 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCompanyService.java
  3. 6 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerLevelService.java
  4. 2 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/dto/AddressAreaDTO.java
  5. 34 1
      ruoyi-auth/src/main/java/org/dromara/auth/service/impl/SmsAuthStrategy.java
  6. 19 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/CustomerInfoController.java
  7. 23 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/PartnerInfoController.java
  8. 22 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java
  9. 14 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/pc/PcAddressController.java
  10. 0 6
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoVo.java
  11. 9 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IPartnerInfoService.java
  12. 9 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java
  13. 76 15
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java
  14. 14 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/PartnerInfoServiceImpl.java
  15. 12 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java
  16. 11 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/pc/PcComStaffController.java
  17. 9 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/AddressAreaVo.java
  18. 6 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ComCompanyVo.java
  19. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteAddressAreaServiceImpl.java
  20. 7 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCompanyServiceImpl.java
  21. 8 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerLevelServiceImpl.java

+ 2 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteAddressAreaService.java

@@ -15,4 +15,6 @@ public interface RemoteAddressAreaService {
     List<AddressAreaDTO> listByIds(Set<Long> allAreaIds);
 
     Long getIdsByName(String province);
+
+    List<org.dromara.system.api.domain.dto.AddressAreaDTO> getChinaArea();
 }

+ 3 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCompanyService.java

@@ -2,6 +2,7 @@ package org.dromara.system.api;
 
 import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -10,4 +11,6 @@ public interface RemoteComCompanyService {
     Map<Long, String> selectCompanyNameByIds(Set<Long> ids);
 
     RemoteComCompanyVo selectByCompanyName(String companyName);
+
+    List<RemoteComCompanyVo> selectCompanyList();
 }

+ 6 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerLevelService.java

@@ -2,6 +2,10 @@ package org.dromara.system.api;
 
 import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import java.util.Map;
 import java.util.Set;
 
@@ -16,4 +20,6 @@ public interface RemoteComCustomerLevelService {
      * @return Map<ID, 名称>
      */
     Map<Long, String> selectCustomerLevelNameByIds(Set<Long> ids);
+
+    List<RemoteComCustomerLevelVo> selectCustomerLevelList();
 }

+ 2 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/dto/AddressAreaDTO.java

@@ -52,4 +52,6 @@ public class AddressAreaDTO implements Serializable {
      */
     private String dataSource;
 
+    private List<AddressAreaDTO> children;
+
 }

+ 34 - 1
ruoyi-auth/src/main/java/org/dromara/auth/service/impl/SmsAuthStrategy.java

@@ -2,6 +2,7 @@ package org.dromara.auth.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
 import cn.dev33.satoken.stp.parameter.SaLoginParameter;
+import com.alibaba.fastjson.JSONObject;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -80,7 +81,39 @@ public class SmsAuthStrategy implements IAuthStrategy {
      */
     @Override
     public LoginVo clientLogin(String body, RemoteClientVo client) {
-        return null;
+        SmsLoginBody loginBody = JsonUtils.parseObject(body, SmsLoginBody.class);
+        // 1. 将字符串解析为 JSON 对象
+        JSONObject jsonObject = JSONObject.parseObject(body);
+
+        // 2. 提取 mobile 字段
+        String mobile = jsonObject.getString("mobile");
+        loginBody.setPhonenumber(mobile);
+        ValidatorUtils.validate(loginBody);
+        String tenantId = loginBody.getTenantId();
+        String phonenumber = loginBody.getPhonenumber();
+        String smsCode = loginBody.getSmsCode();
+        LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> {
+            LoginUser user = remoteUserService.getUserInfoByPhonenumber(phonenumber, tenantId);
+            loginService.checkLogin(LoginType.SMS, tenantId, user.getUsername(), () -> !validateSmsCode(tenantId, phonenumber, smsCode));
+            return user;
+        });
+        loginUser.setClientKey(client.getClientKey());
+        loginUser.setDeviceType(client.getDeviceType());
+        SaLoginParameter model = new SaLoginParameter();
+        model.setDeviceType(client.getDeviceType());
+        // 自定义分配 不同用户体系 不同 token 授权时间 不设置默认走全局 yml 配置
+        // 例如: 后台用户30分钟过期 app用户1天过期
+        model.setTimeout(client.getTimeout());
+        model.setActiveTimeout(client.getActiveTimeout());
+        model.setExtra(LoginHelper.CLIENT_KEY, client.getClientId());
+        // 生成token
+        LoginHelper.login(loginUser, model);
+
+        LoginVo loginVo = new LoginVo();
+        loginVo.setAccessToken(StpUtil.getTokenValue());
+        loginVo.setExpireIn(StpUtil.getTokenTimeout());
+        loginVo.setClientId(client.getClientId());
+        return loginVo;
     }
 
     @Override

+ 19 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/CustomerInfoController.java

@@ -27,6 +27,8 @@ import org.dromara.customer.listener.CustomerImportListener;
 import org.dromara.customer.service.ICustomerInfoService;
 import org.dromara.system.api.RemoteProductTaxrateService;
 import org.dromara.system.api.*;
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
+import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -160,7 +162,7 @@ public class CustomerInfoController extends BaseController {
     }
 
     /**
-     * 获取客户名称查询工商注册信息详细信息
+     * 获取客户名称模糊查询客户列表信息
      *
      * @param customerName 主键
      */
@@ -254,4 +256,20 @@ public class CustomerInfoController extends BaseController {
     public void importTemplate(HttpServletResponse response) {
         ExcelUtil.exportExcel(new ArrayList<>(), "客户数据", CustomerInfoImportVo.class, response);
     }
+
+    /**
+     * 获取公司下拉列表
+     */
+    @GetMapping("/companyOptionList")
+    public R<List<RemoteComCompanyVo>> companyOptionList() {
+        return R.ok(remoteComCompanyService.selectCompanyList());
+    }
+
+    /**
+     * 获取等级下拉列表
+     */
+    @GetMapping("/levelOptionList")
+    public R<List<RemoteComCustomerLevelVo>> levelOptionList() {
+        return R.ok(remoteComCustomerLevelService.selectCustomerLevelList());
+    }
 }

+ 23 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/PartnerInfoController.java

@@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.customer.domain.vo.CustomerInfoVo;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.validation.annotation.Validated;
 import org.dromara.common.idempotent.annotation.RepeatSubmit;
@@ -112,4 +114,25 @@ public class PartnerInfoController extends BaseController {
                           @PathVariable("ids") Long[] ids) {
         return toAjax(partnerInfoService.deleteWithValidByIds(List.of(ids), true));
     }
+
+    /**
+     * 获取伙伴商名称模糊查询伙伴商列表信息
+     *
+     * @param partnerName 主键
+     */
+    @GetMapping("/selectByPartnerName/{partnerName}")
+    public R<List<PartnerInfoVo>> selectByPartnerName(
+        @PathVariable("partnerName") String partnerName) {
+
+        if (StringUtils.isBlank(partnerName)) {
+            return R.fail("伙伴商名称不能为空");
+        }
+
+        List<PartnerInfoVo> partnerfoVoList = partnerInfoService.selectByPartnerName(partnerName);
+        if (null == partnerfoVoList || partnerfoVoList.size() == 0) {
+            return R.fail("未查询到伙伴商信息");
+        }
+
+        return R.ok(partnerfoVoList);
+    }
 }

+ 22 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java

@@ -8,6 +8,7 @@ import jakarta.validation.constraints.NotNull;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.common.core.domain.R;
+import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.core.validate.AddGroup;
 import org.dromara.common.core.validate.EditGroup;
 import org.dromara.common.excel.core.ExcelResult;
@@ -19,6 +20,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.web.core.BaseController;
 import org.dromara.customer.domain.bo.SupplierInfoBo;
+import org.dromara.customer.domain.vo.PartnerInfoVo;
 import org.dromara.customer.domain.vo.SupplierInfoImportVo;
 import org.dromara.customer.domain.vo.SupplierInfoVo;
 import org.dromara.customer.listener.SupplierImportListener;
@@ -254,4 +256,24 @@ public class SupplierInfoController extends BaseController {
         ExcelUtil.exportExcel(new ArrayList<>(), "供应商数据", SupplierInfoImportVo.class, response);
     }
 
+    /**
+     * 获取供应商名称模糊查询供应商列表信息
+     *
+     * @param supplierName 主键
+     */
+    @GetMapping("/selectBySupplierName/{supplierName}")
+    public R<List<SupplierInfoVo>> selectByPartnerName(
+        @PathVariable("supplierName") String supplierName) {
+
+        if (StringUtils.isBlank(supplierName)) {
+            return R.fail("供应商名称不能为空");
+        }
+
+        List<SupplierInfoVo> partnerfoVoList = supplierInfoService.selectBySupplierName(supplierName);
+        if (null == partnerfoVoList || partnerfoVoList.size() == 0) {
+            return R.fail("未查询到供应商信息");
+        }
+
+        return R.ok(partnerfoVoList);
+    }
 }

+ 14 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/pc/PcAddressController.java

@@ -15,6 +15,9 @@ import org.dromara.common.web.core.BaseController;
 import org.dromara.customer.domain.bo.CustomerShippingAddressBo;
 import org.dromara.customer.domain.vo.CustomerShippingAddressVo;
 import org.dromara.customer.service.ICustomerShippingAddressService;
+import org.dromara.system.api.RemoteAddressAreaService;
+import org.dromara.system.api.domain.dto.AddressAreaDTO;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.dromara.common.core.validate.AddGroup;
@@ -36,9 +39,19 @@ public class PcAddressController extends BaseController {
 
     private final ICustomerShippingAddressService customerShippingAddressService;
 
+    @DubboReference
+    private RemoteAddressAreaService remoteAddressAreaService;
+
+    /**
+     * 获取省市两级联动列表
+     */
+    @GetMapping("/province-cities")
+    public R<List<AddressAreaDTO>> provinceCities() {
+        return R.ok(remoteAddressAreaService.getChinaArea());
+    }
+
     /**
      * 查询当前企业的收货地址列表
-     * PC端用户只能查询自己企业的地址
      */
     @GetMapping("/list")
     public TableDataInfo<CustomerShippingAddressVo> list(CustomerShippingAddressBo bo, PageQuery pageQuery) {

+ 0 - 6
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoVo.java

@@ -265,12 +265,6 @@ public class CustomerInfoVo implements Serializable {
     private String enterpriseTypeName;
     /** 客户等级名称 */
     private String customerLevelName;
-    /** 业务负责人名称 */
-    private String salesPersonName;
-    /** 客服支持名称 */
-    private String serviceStaffName;
-    /** 部门名称 */
-    private String deptName;
     /** 合作状态名称 */
     private String cooperationName;
 }

+ 9 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IPartnerInfoService.java

@@ -2,6 +2,7 @@ package org.dromara.customer.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.dromara.customer.domain.PartnerInfo;
+import org.dromara.customer.domain.vo.CustomerInfoVo;
 import org.dromara.customer.domain.vo.PartnerInfoVo;
 import org.dromara.customer.domain.bo.PartnerInfoBo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -79,4 +80,12 @@ public interface IPartnerInfoService extends IService<PartnerInfo> {
 
     /*根据ids查询伙伴商名称*/
     Map<Long, String> selectPartnerNameByIds(Set<Long> ids);
+
+    /**
+     * 查询伙伴商名称查询伙伴商信息
+     *
+     * @param partnerName 主键
+     * @return 伙伴商信息
+     */
+    List<PartnerInfoVo> selectByPartnerName(String partnerName);
 }

+ 9 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java

@@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import jakarta.validation.constraints.NotNull;
 import org.dromara.customer.domain.SupplierInfo;
 import org.dromara.customer.domain.bo.*;
+import org.dromara.customer.domain.vo.PartnerInfoVo;
 import org.dromara.customer.domain.vo.SupplierInfoVo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.PageQuery;
@@ -145,4 +146,12 @@ public interface ISupplierInfoService extends IService<SupplierInfo> {
      * @return 供应商对象信息
      */
     SupplierInfoVo selectSupplierByEnterpriseName(String enterpriseName);
+
+    /**
+     * 查询供应商名称查询供应商信息
+     *
+     * @param supplierName 主键
+     * @return 供应商信息
+     */
+    List<SupplierInfoVo> selectBySupplierName(String supplierName);
 }

+ 76 - 15
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java

@@ -172,6 +172,33 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
         vo.setCustomerSalesInfoVo(voObj);
 
+        Set<Long> comStaffIds = new HashSet<>();
+        Set<Long> comDeptIds = new HashSet<>(); //系统的部门
+
+        if (vo.getSalesPersonId() != null) {
+            comStaffIds.add(customerSalesInfo.getSalesPersonId());
+        }
+        if (vo.getServiceStaffId() != null) {
+            comStaffIds.add(customerSalesInfo.getServiceStaffId());
+        }
+        if (vo.getBelongingDepartmentId() != null) {
+            comDeptIds.add(customerSalesInfo.getBelongingDepartmentId());
+        }
+
+        Map<Long, String> comStaffMap = staffIds.isEmpty()
+            ? Collections.emptyMap()
+            : remoteComStaffService.selectStaffNameByIds(staffIds);
+
+        Map<Long, String> comDeptMap = deptIds.isEmpty()//系统的部门
+            ? Collections.emptyMap()
+            : remoteDeptService.selectDeptNameByIds(deptIds);
+
+        /*回填系统的人员与部门*/
+        vo.setSalesPersonName(comStaffMap.get(vo.getSalesPersonId()));
+        vo.setServiceStaffName(comStaffMap.get(vo.getServiceStaffId()));
+        vo.setBelongingDepartmentName(comDeptMap.get(vo.getBelongingDepartmentId()));
+
+
         List<CustomerContact> contactEntities = customerContactMapper.selectListByCustomerId(id);
         vo.setCustomerContactVoList(
             contactEntities != null
@@ -239,6 +266,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
                     IndustryCategoryVo::getIndustryCategoryName,
                     (e, r) -> e
                 ));
+            records.forEach(vo -> vo.setIndustryCategory(industryMap.get(vo.getIndustryCategoryId())));
         }
 
         // === 2. 提取客户ID,查询销售信息 ===
@@ -278,6 +306,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
                 (existing, replacement) -> existing // 若有重复,保留第一个
             ));
 
+        // === 4. 收集人员和部门ID ===
         Set<Long> staffIds = new HashSet<>();
         Set<Long> deptIds = new HashSet<>();
 
@@ -305,6 +334,31 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
             vo.setServiceStaff(staffMap.get(vo.getServiceStaffId()));
             vo.setBelongingDepartment(deptMap.get(vo.getBelongingDepartmentId()));
         }
+        //系统人员与部门
+        Set<Long> comStaffIds = new HashSet<>();
+        Set<Long> comDeptIds = new HashSet<>();
+
+        for (CustomerInfoVo vo : records) {
+            if (vo.getSalesPersonId() != null) comStaffIds.add(vo.getSalesPersonId());
+            if (vo.getServiceStaffId() != null) comStaffIds.add(vo.getServiceStaffId());
+            if (vo.getBelongingDepartmentId() != null) comDeptIds.add(vo.getBelongingDepartmentId());
+        }
+
+        // === 远程调用获取名称 ===
+        Map<Long, String> comStaffMap = staffIds.isEmpty()
+            ? Collections.emptyMap()
+            : remoteComStaffService.selectStaffNameByIds(comStaffIds);
+
+        Map<Long, String> comDeptMap = deptIds.isEmpty()
+            ? Collections.emptyMap()
+            : remoteDeptService.selectDeptNameByIds(comDeptIds);
+
+        // === 回填系统人员和部门名称到 customerInfoVo ===
+        records.forEach(v -> {
+            v.setSalesPersonName(comStaffMap.get(v.getSalesPersonId()));
+            v.setServiceStaffName(comStaffMap.get(v.getServiceStaffId()));
+            v.setBelongingDepartmentName(comDeptMap.get(v.getBelongingDepartmentId()));
+        });
 
         // === 7. 将销售信息回填到客户VO ===
         for (CustomerInfoVo customerVo : records) {
@@ -471,6 +525,10 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
      */
     @Override
     public TableDataInfo<CustomerListVo> queryCustomerListPage(CustomerListBo bo, PageQuery pageQuery) {
+        // 设置平台标识(暂时注释掉)
+        // if (StringUtils.isBlank(bo.getPlatformCode())) {
+        //     bo.setPlatformCode(PlatformContext.getPlatform());
+        // }
         Page<CustomerListVo> page = baseMapper.selectCustomerListPage(pageQuery.build(), bo);
 
         // 补充业务员名称和信用等级名称
@@ -561,6 +619,9 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         lqw.orderByDesc(CustomerInfo::getId);
         lqw.eq(StringUtils.isNotBlank(bo.getCustomerNo()), CustomerInfo::getCustomerNo, bo.getCustomerNo());
         lqw.eq(bo.getBelongCompanyId() != null, CustomerInfo::getBelongCompanyId, bo.getBelongCompanyId());
+        lqw.eq(bo.getSalesPersonId() != null, CustomerInfo::getSalesPersonId, bo.getSalesPersonId());
+        lqw.eq(bo.getServiceStaffId() != null, CustomerInfo::getServiceStaffId, bo.getServiceStaffId());
+        lqw.eq(bo.getBelongingDepartmentId() != null, CustomerInfo::getBelongingDepartmentId, bo.getBelongingDepartmentId());
         lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), CustomerInfo::getCompanyName, bo.getCompanyName());
         lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), CustomerInfo::getCustomerName, bo.getCustomerName());
         lqw.like(StringUtils.isNotBlank(bo.getBusinessCustomerName()), CustomerInfo::getBusinessCustomerName, bo.getBusinessCustomerName());
@@ -1208,25 +1269,25 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         }
 
         try {
-            List<CustomerSalesInfo> updateList = new ArrayList<>();
-            CustomerSalesInfo salesInfo = null;
+            List<CustomerInfo> updateList = new ArrayList<>();
+            CustomerInfo customerInfo = null;
             for (Long customerId : customerIds) {
                 if (customerId == null) {
                     continue;
                 }
 
-                salesInfo = customerSalesInfoMapper.selectByCustomerId(customerId);
-                if (salesInfo != null) {
-                    salesInfo.setSalesPersonId(salesPersonId);
-                    salesInfo.setBelongingDepartmentId(deptId);
-                    updateList.add(salesInfo);
+                customerInfo = baseMapper.selectById(customerId);
+                if (customerInfo != null) {
+                    customerInfo.setSalesPersonId(salesPersonId);
+                    customerInfo.setBelongingDepartmentId(deptId);
+                    updateList.add(customerInfo);
                 } else {
                     log.warn("客户 ID: {} 的销售信息不存在,跳过更新", customerId);
                 }
             }
 
             if (!updateList.isEmpty()) {
-                boolean success = customerSalesInfoMapper.updateBatchById(updateList);
+                boolean success = baseMapper.updateBatchById(updateList);
                 if (success) {
                     log.info("成功转移 {} 个客户的业务人员,目标业务员 ID: {}, 部门 ID: {}",
                         updateList.size(), salesPersonId, deptId);
@@ -1261,24 +1322,24 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         }
 
         try {
-            List<CustomerSalesInfo> updateList = new ArrayList<>();
-            CustomerSalesInfo salesInfo = null;
+            List<CustomerInfo> updateList = new ArrayList<>();
+            CustomerInfo customerInfo = null;
             for (Long customerId : customerIds) {
                 if (customerId == null) {
                     continue;
                 }
 
-                salesInfo = customerSalesInfoMapper.selectByCustomerId(customerId);
-                if (salesInfo != null) {
-                    salesInfo.setServiceStaffId(serviceStaffId);
-                    updateList.add(salesInfo);
+                customerInfo = baseMapper.selectById(customerId);
+                if (customerInfo != null) {
+                    customerInfo.setServiceStaffId(serviceStaffId);
+                    updateList.add(customerInfo);
                 } else {
                     log.warn("客户 ID: {} 的销售信息不存在,跳过更新", customerId);
                 }
             }
 
             if (!updateList.isEmpty()) {
-                boolean success = customerSalesInfoMapper.updateBatchById(updateList);
+                boolean success = baseMapper.updateBatchById(updateList);
                 if (success) {
                     log.info("成功转移 {} 个客户的客服人员,目标客服人员 ID: {}",
                         updateList.size(), serviceStaffId);

+ 14 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/PartnerInfoServiceImpl.java

@@ -10,7 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.customer.domain.CustomerInfo;
 import org.dromara.customer.domain.SupplierInfo;
+import org.dromara.customer.domain.vo.CustomerInfoVo;
 import org.springframework.stereotype.Service;
 import org.dromara.customer.domain.bo.PartnerInfoBo;
 import org.dromara.customer.domain.vo.PartnerInfoVo;
@@ -186,4 +188,16 @@ public class PartnerInfoServiceImpl extends ServiceImpl<PartnerInfoMapper, Partn
 
         return resultMap;
     }
+
+    @Override
+    public List<PartnerInfoVo> selectByPartnerName(String partnerName) {
+        if (StringUtils.isBlank(partnerName)) {
+            return Collections.emptyList();
+        }
+
+        LambdaQueryWrapper<PartnerInfo> wrapper = new LambdaQueryWrapper<PartnerInfo>()
+            .like(PartnerInfo::getPartnerName, partnerName);
+
+        return baseMapper.selectVoList(wrapper);
+    }
 }

+ 12 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java

@@ -2410,4 +2410,16 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
     public SupplierInfoVo selectSupplierByEnterpriseName(String enterpriseName) {
         return baseMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfo>().eq(SupplierInfo::getEnterpriseName, enterpriseName));
     }
+
+    @Override
+    public List<SupplierInfoVo> selectBySupplierName(String supplierName) {
+        if (StringUtils.isBlank(supplierName)) {
+            return Collections.emptyList();
+        }
+
+        LambdaQueryWrapper<SupplierInfo> wrapper = new LambdaQueryWrapper<SupplierInfo>()
+            .like(SupplierInfo::getEnterpriseName, supplierName);
+
+        return baseMapper.selectVoList(wrapper);
+    }
 }

+ 11 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/pc/PcComStaffController.java

@@ -1,9 +1,12 @@
 package org.dromara.system.controller.pc;
 
 import lombok.RequiredArgsConstructor;
+import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.web.core.BaseController;
+
+import java.util.List;
 import org.dromara.system.domain.bo.ComBankBo;
 import org.dromara.system.domain.bo.ComStaffBo;
 import org.dromara.system.domain.vo.ComBankVo;
@@ -26,4 +29,12 @@ public class PcComStaffController extends BaseController {
     public TableDataInfo<ComStaffVo> list(ComStaffBo bo, PageQuery pageQuery) {
         return comStaffService.queryPageList(bo, pageQuery);
     }
+
+    /**
+     * 获取人员下拉列表
+     */
+    @GetMapping("/options")
+    public R<List<ComStaffVo>> options(ComStaffBo bo) {
+        return R.ok(comStaffService.queryList(bo));
+    }
 }

+ 9 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/AddressAreaVo.java

@@ -3,7 +3,10 @@ package org.dromara.system.domain.vo;
 import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
 import cn.idev.excel.annotation.ExcelProperty;
 import io.github.linpeilie.annotations.AutoMapper;
+import io.github.linpeilie.annotations.AutoMappers;
+import io.github.linpeilie.annotations.AutoMapping;
 import lombok.Data;
+import org.dromara.system.api.domain.dto.AddressAreaDTO;
 import org.dromara.system.domain.AddressArea;
 
 import java.io.Serial;
@@ -20,7 +23,10 @@ import java.util.List;
  */
 @Data
 @ExcelIgnoreUnannotated
-@AutoMapper(target = AddressArea.class)
+@AutoMappers({
+    @AutoMapper(target = AddressArea.class),
+    @AutoMapper(target = AddressAreaDTO.class)
+})
 public class AddressAreaVo implements Serializable {
 
     @Serial
@@ -36,6 +42,7 @@ public class AddressAreaVo implements Serializable {
      * 地区编码
      */
     @ExcelProperty(value = "地区编码")
+    @AutoMapping(target = "areaId", targetClass = AddressAreaDTO.class)
     private String areaCode;
 
     /**
@@ -48,6 +55,7 @@ public class AddressAreaVo implements Serializable {
      * 父类ID
      */
     @ExcelProperty(value = "父类ID")
+    @AutoMapping(target = "parentCode", targetClass = AddressAreaDTO.class)
     private Long parentId;
 
     /**

+ 6 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ComCompanyVo.java

@@ -10,7 +10,9 @@ import cn.idev.excel.annotation.ExcelProperty;
 import org.dromara.common.excel.annotation.ExcelDictFormat;
 import org.dromara.common.excel.convert.ExcelDictConvert;
 import io.github.linpeilie.annotations.AutoMapper;
+import io.github.linpeilie.annotations.AutoMappers;
 import lombok.Data;
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
 
 import java.io.Serial;
 import java.io.Serializable;
@@ -25,7 +27,10 @@ import java.util.Date;
  */
 @Data
 @ExcelIgnoreUnannotated
-@AutoMapper(target = ComCompany.class)
+@AutoMappers({
+    @AutoMapper(target = ComCompany.class),
+    @AutoMapper(target = RemoteComCompanyVo.class)
+})
 public class ComCompanyVo implements Serializable {
 
     @Serial

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteAddressAreaServiceImpl.java

@@ -6,6 +6,7 @@ import org.dromara.system.api.RemoteAddressAreaService;
 import org.dromara.system.api.domain.dto.AddressAreaDTO;
 import org.dromara.system.domain.AddressArea;
 import org.dromara.system.service.IAddressAreaService;
+import org.dromara.common.core.utils.MapstructUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -38,4 +39,9 @@ public class RemoteAddressAreaServiceImpl implements RemoteAddressAreaService {
         AddressArea one = addressAreaService.lambdaQuery().eq(AddressArea::getAreaName, province).select(AddressArea::getId).one();
         return one == null ? 0L : one.getId();
     }
+
+    @Override
+    public List<AddressAreaDTO> getChinaArea() {
+        return MapstructUtils.convert(addressAreaService.getChinaArea(), AddressAreaDTO.class);
+    }
 }

+ 7 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCompanyServiceImpl.java

@@ -7,10 +7,12 @@ import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.system.api.RemoteComCompanyService;
 import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
 import org.dromara.system.api.domain.vo.RemoteComStaffVo;
+import org.dromara.system.domain.bo.ComCompanyBo;
 import org.dromara.system.domain.vo.ComCompanyVo;
 import org.dromara.system.service.IComCompanyService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -32,4 +34,9 @@ public class RemoteComCompanyServiceImpl implements RemoteComCompanyService {
         ComCompanyVo comCompanyVo = comCompanyService.selectByCompanyName(companyName);
         return BeanUtil.toBean(comCompanyVo, RemoteComCompanyVo.class);
     }
+
+    @Override
+    public List<RemoteComCompanyVo> selectCompanyList() {
+        return MapstructUtils.convert(comCompanyService.queryList(new ComCompanyBo()), RemoteComCompanyVo.class);
+    }
 }

+ 8 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerLevelServiceImpl.java

@@ -3,10 +3,13 @@ package org.dromara.system.dubbo;
 import cn.hutool.core.bean.BeanUtil;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.system.api.RemoteComCustomerLevelService;
 import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
+import org.dromara.system.domain.bo.ComCustomerLevelBo;
 import org.dromara.system.domain.vo.ComCustomerLevelVo;
 import org.dromara.system.service.IComCustomerLevelService;
+import org.dromara.common.core.utils.MapstructUtils;
 import org.springframework.stereotype.Service;
 
 import cn.hutool.core.collection.CollUtil;
@@ -39,4 +42,9 @@ public class RemoteComCustomerLevelServiceImpl implements RemoteComCustomerLevel
             .collect(Collectors.toList());
         return list.stream().collect(Collectors.toMap(ComCustomerLevelVo::getId, ComCustomerLevelVo::getLevelName, (v1, v2) -> v1));
     }
+
+    @Override
+    public List<RemoteComCustomerLevelVo> selectCustomerLevelList() {
+        return MapstructUtils.convert(comCustomerLevelService.queryList(new ComCustomerLevelBo()), RemoteComCustomerLevelVo.class);
+    }
 }