沐梦. преди 1 месец
родител
ревизия
732a753bcc
променени са 13 файла, в които са добавени 92 реда и са изтрити 9 реда
  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. 18 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/CustomerInfoController.java
  6. 14 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/pc/PcAddressController.java
  7. 0 6
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoVo.java
  8. 11 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/pc/PcComStaffController.java
  9. 9 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/AddressAreaVo.java
  10. 6 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ComCompanyVo.java
  11. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteAddressAreaServiceImpl.java
  12. 7 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCompanyServiceImpl.java
  13. 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;
+
 }

+ 18 - 0
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.*;
@@ -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());
+    }
 }

+ 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

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

+ 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);
+    }
 }