zhaopeiqing 8 mesiacov pred
rodič
commit
7f6601a419
27 zmenil súbory, kde vykonal 1750 pridanie a 0 odobranie
  1. 1 0
      pom.xml
  2. 25 0
      yudao-module-customer/pom.xml
  3. 34 0
      yudao-module-customer/yudao-module-customer-api/pom.xml
  4. 11 0
      yudao-module-customer/yudao-module-customer-api/src/main/java/cn/iocoder/yudao/module/employee/api/CustomerApi.java
  5. 15 0
      yudao-module-customer/yudao-module-customer-api/src/main/java/cn/iocoder/yudao/module/employee/enums/ErrorCodeConstants.java
  6. 102 0
      yudao-module-customer/yudao-module-customer-biz/pom.xml
  7. 14 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/api/info/CustomerApiImpl.java
  8. 112 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/CustomerBusinessOpportunityController.java
  9. 71 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunityPageReqVO.java
  10. 101 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunityRespVO.java
  11. 68 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunitySaveReqVO.java
  12. 113 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/CustomerInfoController.java
  13. 87 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoPageReqVO.java
  14. 121 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoRespVO.java
  15. 83 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoSaveReqVO.java
  16. 97 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/dataobject/businessopportunity/CustomerBusinessOpportunityDO.java
  17. 120 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/dataobject/info/CustomerInfoDO.java
  18. 41 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/businessopportunity/CustomerBusinessOpportunityMapper.java
  19. 48 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/info/CustomerInfoMapper.java
  20. 9 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/package-info.java
  21. 63 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/businessopportunity/CustomerBusinessOpportunityService.java
  22. 158 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/businessopportunity/CustomerBusinessOpportunityServiceImpl.java
  23. 65 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/info/CustomerInfoService.java
  24. 161 0
      yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/info/CustomerInfoServiceImpl.java
  25. 12 0
      yudao-module-customer/yudao-module-customer-biz/src/main/resources/mapper/businessopportunity/CustomerBusinessOpportunityMapper.xml
  26. 12 0
      yudao-module-customer/yudao-module-customer-biz/src/main/resources/mapper/info/CustomerInfoMapper.xml
  27. 6 0
      yudao-server/pom.xml

+ 1 - 0
pom.xml

@@ -25,6 +25,7 @@
 <!--        <module>yudao-module-crm</module>-->
 <!--        <module>yudao-module-erp</module>-->
         <module>yudao-module-finance</module>
+        <module>yudao-module-customer</module>
     </modules>
 
     <name>${project.artifactId}</name>

+ 25 - 0
yudao-module-customer/pom.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yudao</artifactId>
+        <groupId>cn.iocoder.boot</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>yudao-module-customer</artifactId>
+    <packaging>pom</packaging>
+
+    <name>${project.artifactId}</name>
+
+    <description>
+        客户大模块
+    </description>
+    <modules>
+        <module>yudao-module-customer-api</module>
+        <module>yudao-module-customer-biz</module>
+    </modules>
+
+</project>

+ 34 - 0
yudao-module-customer/yudao-module-customer-api/pom.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.iocoder.boot</groupId>
+        <artifactId>yudao-module-customer</artifactId>
+        <version>${revision}</version>
+    </parent>
+
+    <artifactId>yudao-module-customer-api</artifactId>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>
+        customer 模块 API,暴露给其它模块调用
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-common</artifactId>
+        </dependency>
+
+        <!-- 参数校验 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+</project>

+ 11 - 0
yudao-module-customer/yudao-module-customer-api/src/main/java/cn/iocoder/yudao/module/employee/api/CustomerApi.java

@@ -0,0 +1,11 @@
+package cn.iocoder.yudao.module.employee.api;
+
+
+/**
+ * 客户 API 接口
+ *
+ * @author zhaopq
+ */
+public interface CustomerApi {
+
+}

+ 15 - 0
yudao-module-customer/yudao-module-customer-api/src/main/java/cn/iocoder/yudao/module/employee/enums/ErrorCodeConstants.java

@@ -0,0 +1,15 @@
+package cn.iocoder.yudao.module.employee.enums;
+
+import cn.iocoder.yudao.framework.common.exception.ErrorCode;
+
+/**
+ * Customer 错误码枚举类
+ *
+ * customer 系统,使用 1-014-000-000
+ */
+public interface ErrorCodeConstants {
+
+    // ========== 客户模块 1-014-000-000 ==========
+    ErrorCode CUSTOMER_INFO_NOT_EXISTS = new ErrorCode(1_014_000_000, "客户信息不存在");
+    ErrorCode CUSTOMER_BUSINESS_OPPORTUNITY_NOT_EXISTS = new ErrorCode(1_014_000_001, "客户商机不存在");
+}

+ 102 - 0
yudao-module-customer/yudao-module-customer-biz/pom.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>cn.iocoder.boot</groupId>
+        <artifactId>yudao-module-customer</artifactId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>yudao-module-customer-biz</artifactId>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>
+        customer 模块,主要实现客户相关功能
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-module-customer-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-module-employee-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <!-- 业务组件 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
+        </dependency>
+
+        <!-- Web 相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+        <!-- DB 相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-mybatis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-redis</artifactId>
+        </dependency>
+
+        <!-- Job 定时任务相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-job</artifactId>
+        </dependency>
+
+        <!-- 消息队列相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-mq</artifactId>
+        </dependency>
+
+        <!-- Test 测试相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- 工具类相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-excel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+
+
+        <!-- 三方云服务相关 -->
+
+    </dependencies>
+
+</project>

+ 14 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/api/info/CustomerApiImpl.java

@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.customer.api.info;
+
+import cn.iocoder.yudao.module.employee.api.CustomerApi;
+import org.springframework.stereotype.Service;
+
+/**
+ * 客户 API 实现类
+ *
+ * @author zhaopq
+ */
+@Service
+public class CustomerApiImpl implements CustomerApi {
+
+}

+ 112 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/CustomerBusinessOpportunityController.java

@@ -0,0 +1,112 @@
+package cn.iocoder.yudao.module.customer.controller.admin.businessopportunity;
+
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import cn.iocoder.yudao.module.customer.service.businessopportunity.CustomerBusinessOpportunityService;
+
+@Tag(name = "管理后台 - 客户商机")
+@RestController
+@RequestMapping("/customer/business-opportunity")
+@Validated
+public class CustomerBusinessOpportunityController {
+
+    @Resource
+    private CustomerBusinessOpportunityService businessOpportunityService;
+    @Resource
+    private DeptApi deptApi;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建客户商机")
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:create')")
+    public CommonResult<Long> createBusinessOpportunity(@Valid @RequestBody CustomerBusinessOpportunitySaveReqVO createReqVO) {
+        return success(businessOpportunityService.createBusinessOpportunity(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新客户商机")
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:update')")
+    public CommonResult<Boolean> updateBusinessOpportunity(@Valid @RequestBody CustomerBusinessOpportunitySaveReqVO updateReqVO) {
+        businessOpportunityService.updateBusinessOpportunity(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除客户商机")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:delete')")
+    public CommonResult<Boolean> deleteBusinessOpportunity(@RequestParam("id") Long id) {
+        businessOpportunityService.deleteBusinessOpportunity(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得客户商机")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:query')")
+    public CommonResult<CustomerBusinessOpportunityRespVO> getBusinessOpportunity(@RequestParam("id") Long id) {
+        return success(businessOpportunityService.getById(id));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得客户商机分页")
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:query')")
+    public CommonResult<PageResult<CustomerBusinessOpportunityRespVO>> getBusinessOpportunityPage(@Valid CustomerBusinessOpportunityPageReqVO pageReqVO) {
+        PageResult<CustomerBusinessOpportunityDO> pageResult = businessOpportunityService.getBusinessOpportunityPage(pageReqVO);
+        PageResult<CustomerBusinessOpportunityRespVO> result = BeanUtils.toBean(pageResult, CustomerBusinessOpportunityRespVO.class);
+        if (result != null && result.getList() != null && result.getList().size() > 0) {
+            result.getList().forEach(respVO -> {
+                // 部门
+                if (respVO.getDeptId() != null) {
+                    DeptRespDTO dept = deptApi.getDept(respVO.getDeptId());
+                    respVO.setDeptName(dept.getName());
+                    if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                        respVO.setDeptName(dept.getName());
+                    }
+                }
+            });
+        }
+        return success(result);
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出客户商机 Excel")
+    @PreAuthorize("@ss.hasPermission('customer:business-opportunity:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportBusinessOpportunityExcel(@Valid CustomerBusinessOpportunityPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<CustomerBusinessOpportunityDO> list = businessOpportunityService.getBusinessOpportunityPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "客户商机.xls", "数据", CustomerBusinessOpportunityRespVO.class,
+                        BeanUtils.toBean(list, CustomerBusinessOpportunityRespVO.class));
+    }
+
+}

+ 71 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunityPageReqVO.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 客户商机分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class CustomerBusinessOpportunityPageReqVO extends PageParam {
+
+    @Schema(description = "商机uuid", example = "28138")
+    private String opportunityId;
+
+    @Schema(description = "客户id", example = "2835")
+    private Long customerId;
+
+    @Schema(description = "商机名称", example = "王五")
+    private String opportunityName;
+
+    @Schema(description = "项目类型", example = "1")
+    private String projectType;
+
+    @Schema(description = "创建人员工id", example = "28498")
+    private Long creatorEmployeeId;
+
+    @Schema(description = "创建人员工姓名", example = "张三")
+    private String creatorEmployeeName;
+
+    @Schema(description = "部门id", example = "8267")
+    private Long deptId;
+
+    @Schema(description = "赢单机率")
+    private String winRate;
+
+    @Schema(description = "预计合同金额")
+    private String estimatedContractAmount;
+
+    @Schema(description = "预计项目毛利")
+    private String estimatedProjectMargin;
+
+    @Schema(description = "预计项目成功率")
+    private String estimatedSuccessRate;
+
+    @Schema(description = "预计进单时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+    private LocalDate[] estimatedDealTime;
+
+    @Schema(description = "商机等级")
+    private String opportunityLevel;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 101 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunityRespVO.java

@@ -0,0 +1,101 @@
+package cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo;
+
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 客户商机 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class CustomerBusinessOpportunityRespVO {
+
+    @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6699")
+    @ExcelProperty("自增主键")
+    private Long id;
+
+    @Schema(description = "商机uuid", example = "28138")
+    @ExcelProperty("商机uuid")
+    private String opportunityId;
+
+    @Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2835")
+    @ExcelProperty("客户id")
+    private Long customerId;
+
+    @Schema(description = "商机名称", example = "王五")
+    @ExcelProperty("商机名称")
+    private String opportunityName;
+
+    @Schema(description = "项目类型", example = "1")
+    @ExcelProperty("项目类型")
+    private String projectType;
+
+    @Schema(description = "创建人员工id", example = "28498")
+    @ExcelProperty("创建人员工id")
+    private Long creatorEmployeeId;
+
+    @Schema(description = "创建人员工姓名", example = "张三")
+    @ExcelProperty("创建人员工姓名")
+    private String creatorEmployeeName;
+
+    @Schema(description = "部门id", example = "8267")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "部门名称", example = "人事部")
+    @ExcelProperty("部门名称")
+    private String deptName;
+
+    @Schema(description = "赢单机率")
+    @ExcelProperty("赢单机率")
+    private String winRate;
+
+    @Schema(description = "预计合同金额")
+    @ExcelProperty("预计合同金额")
+    private String estimatedContractAmount;
+
+    @Schema(description = "预计项目毛利")
+    @ExcelProperty("预计项目毛利")
+    private String estimatedProjectMargin;
+
+    @Schema(description = "预计项目成功率")
+    @ExcelProperty("预计项目成功率")
+    private String estimatedSuccessRate;
+
+    @Schema(description = "预计进单时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("预计进单时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDate estimatedDealTime;
+
+    @Schema(description = "商机等级")
+    @ExcelProperty("商机等级")
+    private String opportunityLevel;
+
+    @Schema(description = "备注")
+    @ExcelProperty("备注")
+    private String remarks;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("状态")
+    private Integer status;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
+    @ExcelProperty("租户编号")
+    private Long tenantId;
+
+    @Schema(description = "附件列表")
+    private List<FileDTO> fileList;
+
+}

+ 68 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/businessopportunity/vo/CustomerBusinessOpportunitySaveReqVO.java

@@ -0,0 +1,68 @@
+package cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 客户商机新增/修改 Request VO")
+@Data
+public class CustomerBusinessOpportunitySaveReqVO {
+
+    @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6699")
+    private Long id;
+
+    @Schema(description = "商机uuid", example = "28138")
+    private String opportunityId;
+
+    @Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2835")
+    @NotNull(message = "客户id不能为空")
+    private Long customerId;
+
+    @Schema(description = "商机名称", example = "王五")
+    private String opportunityName;
+
+    @Schema(description = "项目类型", example = "1")
+    private String projectType;
+
+    private Long creatorEmployeeId;
+
+    private String creatorEmployeeName;
+
+    private Long deptId;
+
+    @Schema(description = "赢单机率")
+    private String winRate;
+
+    @Schema(description = "预计合同金额")
+    private String estimatedContractAmount;
+
+    @Schema(description = "预计项目毛利")
+    private String estimatedProjectMargin;
+
+    @Schema(description = "预计项目成功率")
+    private String estimatedSuccessRate;
+
+    @Schema(description = "预计进单时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "预计进单时间不能为空")
+    private LocalDate estimatedDealTime;
+
+    @Schema(description = "商机等级")
+    private String opportunityLevel;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    private Integer status;
+
+    @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
+    private Long tenantId;
+
+    @Schema(description = "附件主键id", example = "[1, 2]")
+    private List<Long> fileIdList;
+
+}

+ 113 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/CustomerInfoController.java

@@ -0,0 +1,113 @@
+package cn.iocoder.yudao.module.customer.controller.admin.info;
+
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.CustomerBusinessOpportunityRespVO;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import cn.iocoder.yudao.module.customer.controller.admin.info.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.info.CustomerInfoDO;
+import cn.iocoder.yudao.module.customer.service.info.CustomerInfoService;
+
+@Tag(name = "管理后台 - 客户信息")
+@RestController
+@RequestMapping("/customer/info")
+@Validated
+public class CustomerInfoController {
+
+    @Resource
+    private CustomerInfoService infoService;
+    @Resource
+    private DeptApi deptApi;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建客户信息")
+    @PreAuthorize("@ss.hasPermission('customer:info:create')")
+    public CommonResult<Long> createInfo(@Valid @RequestBody CustomerInfoSaveReqVO createReqVO) {
+        return success(infoService.createInfo(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新客户信息")
+    @PreAuthorize("@ss.hasPermission('customer:info:update')")
+    public CommonResult<Boolean> updateInfo(@Valid @RequestBody CustomerInfoSaveReqVO updateReqVO) {
+        infoService.updateInfo(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除客户信息")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('customer:info:delete')")
+    public CommonResult<Boolean> deleteInfo(@RequestParam("id") Long id) {
+        infoService.deleteInfo(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得客户信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('customer:info:query')")
+    public CommonResult<CustomerInfoRespVO> getInfo(@RequestParam("id") Long id) {
+        return success(infoService.getById(id));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得客户信息分页")
+    @PreAuthorize("@ss.hasPermission('customer:info:query')")
+    public CommonResult<PageResult<CustomerInfoRespVO>> getInfoPage(@Valid CustomerInfoPageReqVO pageReqVO) {
+        PageResult<CustomerInfoDO> pageResult = infoService.getInfoPage(pageReqVO);
+        PageResult<CustomerInfoRespVO> result = BeanUtils.toBean(pageResult, CustomerInfoRespVO.class);
+        if (result != null && result.getList() != null && result.getList().size() > 0) {
+            result.getList().forEach(respVO -> {
+                // 部门
+                if (respVO.getDeptId() != null) {
+                    DeptRespDTO dept = deptApi.getDept(respVO.getDeptId());
+                    respVO.setDeptName(dept.getName());
+                    if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                        respVO.setDeptName(dept.getName());
+                    }
+                }
+            });
+        }
+        return success(result);
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出客户信息 Excel")
+    @PreAuthorize("@ss.hasPermission('customer:info:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportInfoExcel(@Valid CustomerInfoPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<CustomerInfoDO> list = infoService.getInfoPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "客户信息.xls", "数据", CustomerInfoRespVO.class,
+                        BeanUtils.toBean(list, CustomerInfoRespVO.class));
+    }
+
+}

+ 87 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoPageReqVO.java

@@ -0,0 +1,87 @@
+package cn.iocoder.yudao.module.customer.controller.admin.info.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 客户信息分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class CustomerInfoPageReqVO extends PageParam {
+
+    @Schema(description = "客户uuid", example = "178")
+    private String customerId;
+
+    @Schema(description = "客户编码")
+    private String customerCode;
+
+    @Schema(description = "客户名称", example = "张三")
+    private String customerName;
+
+    @Schema(description = "客户状态", example = "1")
+    private String customerStatus;
+
+    @Schema(description = "创建人员工id", example = "28498")
+    private Long creatorEmployeeId;
+
+    @Schema(description = "创建人员工姓名", example = "张三")
+    private String creatorEmployeeName;
+
+    @Schema(description = "部门id", example = "8267")
+    private Long deptId;
+
+    @Schema(description = "客户成立时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String[] registDate;
+
+    @Schema(description = "注册资本金(万元)")
+    private BigDecimal capital;
+
+    @Schema(description = "法人代表")
+    private String legalPerson;
+
+    @Schema(description = "员工人数")
+    private Integer workforce;
+
+    @Schema(description = "行业")
+    private String trade;
+
+    @Schema(description = "企业性质")
+    private String customerNature;
+
+    @Schema(description = "客户地址")
+    private String companyAddress;
+
+    @Schema(description = "客户联系人")
+    private String customerPerson;
+
+    @Schema(description = "客户联系手机号")
+    private String customerPersonPhone;
+
+    @Schema(description = "客户联系人办公地址")
+    private String companyPersonAddress;
+
+    @Schema(description = "客户来源")
+    private String customerFrom;
+
+    @Schema(description = "是否开启 0开启1关闭")
+    private Integer isOpen;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 121 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoRespVO.java

@@ -0,0 +1,121 @@
+package cn.iocoder.yudao.module.customer.controller.admin.info.vo;
+
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 客户信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class CustomerInfoRespVO {
+
+    @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8654")
+    @ExcelProperty("自增主键")
+    private Long id;
+
+    @Schema(description = "客户uuid", example = "178")
+    @ExcelProperty("客户uuid")
+    private String customerId;
+
+    @Schema(description = "客户编码")
+    @ExcelProperty("客户编码")
+    private String customerCode;
+
+    @Schema(description = "客户名称", example = "张三")
+    @ExcelProperty("客户名称")
+    private String customerName;
+
+    @Schema(description = "客户状态", example = "1")
+    @ExcelProperty("客户状态")
+    private String customerStatus;
+
+    @Schema(description = "创建人员工id", example = "28498")
+    @ExcelProperty("创建人员工id")
+    private Long creatorEmployeeId;
+
+    @Schema(description = "创建人员工姓名", example = "张三")
+    @ExcelProperty("创建人员工姓名")
+    private String creatorEmployeeName;
+
+    @Schema(description = "部门id", example = "8267")
+    @ExcelProperty("部门id")
+    private Long deptId;
+
+    @Schema(description = "部门名称", example = "人事部")
+    @ExcelProperty("部门名称")
+    private String deptName;
+
+    @Schema(description = "客户成立时间")
+    @ExcelProperty("客户成立时间")
+    private String registDate;
+
+    @Schema(description = "注册资本金(万元)")
+    @ExcelProperty("注册资本金(万元)")
+    private BigDecimal capital;
+
+    @Schema(description = "法人代表")
+    @ExcelProperty("法人代表")
+    private String legalPerson;
+
+    @Schema(description = "员工人数")
+    @ExcelProperty("员工人数")
+    private Integer workforce;
+
+    @Schema(description = "行业")
+    @ExcelProperty("行业")
+    private String trade;
+
+    @Schema(description = "企业性质")
+    @ExcelProperty("企业性质")
+    private String customerNature;
+
+    @Schema(description = "客户地址")
+    @ExcelProperty("客户地址")
+    private String companyAddress;
+
+    @Schema(description = "客户联系人")
+    @ExcelProperty("客户联系人")
+    private String customerPerson;
+
+    @Schema(description = "客户联系手机号")
+    @ExcelProperty("客户联系手机号")
+    private String customerPersonPhone;
+
+    @Schema(description = "客户联系人办公地址")
+    @ExcelProperty("客户联系人办公地址")
+    private String companyPersonAddress;
+
+    @Schema(description = "客户来源")
+    @ExcelProperty("客户来源")
+    private String customerFrom;
+
+    @Schema(description = "是否开启 0开启1关闭", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("是否开启 0开启1关闭")
+    private Integer isOpen;
+
+    @Schema(description = "备注")
+    @ExcelProperty("备注")
+    private String remarks;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("状态")
+    private Integer status;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
+    @ExcelProperty("租户编号")
+    private Long tenantId;
+
+    @Schema(description = "附件列表")
+    private List<FileDTO> fileList;
+
+}

+ 83 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/info/vo/CustomerInfoSaveReqVO.java

@@ -0,0 +1,83 @@
+package cn.iocoder.yudao.module.customer.controller.admin.info.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 客户信息新增/修改 Request VO")
+@Data
+public class CustomerInfoSaveReqVO {
+
+    @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8654")
+    private Long id;
+
+    @Schema(description = "客户uuid", example = "178")
+    private String customerId;
+
+    @Schema(description = "客户编码")
+    private String customerCode;
+
+    @Schema(description = "客户名称", example = "张三")
+    private String customerName;
+
+    @Schema(description = "客户状态", example = "1")
+    private String customerStatus;
+
+    private Long creatorEmployeeId;
+
+    private String creatorEmployeeName;
+
+    private Long deptId;
+
+    @Schema(description = "客户成立时间")
+    private String registDate;
+
+    @Schema(description = "注册资本金(万元)")
+    private BigDecimal capital;
+
+    @Schema(description = "法人代表")
+    private String legalPerson;
+
+    @Schema(description = "员工人数")
+    private Integer workforce;
+
+    @Schema(description = "行业")
+    private String trade;
+
+    @Schema(description = "企业性质")
+    private String customerNature;
+
+    @Schema(description = "客户地址")
+    private String companyAddress;
+
+    @Schema(description = "客户联系人")
+    private String customerPerson;
+
+    @Schema(description = "客户联系手机号")
+    private String customerPersonPhone;
+
+    @Schema(description = "客户联系人办公地址")
+    private String companyPersonAddress;
+
+    @Schema(description = "客户来源")
+    private String customerFrom;
+
+    @Schema(description = "是否开启 0开启1关闭", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "是否开启 0开启1关闭不能为空")
+    private Integer isOpen;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    private Integer status;
+
+    @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4014")
+    private Long tenantId;
+
+    @Schema(description = "附件主键id", example = "[1, 2]")
+    private List<Long> fileIdList;
+
+}

+ 97 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/dataobject/businessopportunity/CustomerBusinessOpportunityDO.java

@@ -0,0 +1,97 @@
+package cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 客户商机 DO
+ *
+ * @author zhaopq
+ */
+@TableName("customer_business_opportunity")
+@KeySequence("customer_business_opportunity_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class CustomerBusinessOpportunityDO extends BaseDO {
+
+    /**
+     * 自增主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 商机uuid
+     */
+    private String opportunityId;
+    /**
+     * 客户id
+     */
+    private Long customerId;
+    /**
+     * 商机名称
+     */
+    private String opportunityName;
+    /**
+     * 项目类型
+     */
+    private String projectType;
+    /**
+     * 创建人员工id
+     */
+    private Long creatorEmployeeId;
+    /**
+     * 创建人员工姓名
+     */
+    private String creatorEmployeeName;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+    /**
+     * 赢单机率
+     */
+    private String winRate;
+    /**
+     * 预计合同金额
+     */
+    private String estimatedContractAmount;
+    /**
+     * 预计项目毛利
+     */
+    private String estimatedProjectMargin;
+    /**
+     * 预计项目成功率
+     */
+    private String estimatedSuccessRate;
+    /**
+     * 预计进单时间
+     */
+    private LocalDate estimatedDealTime;
+    /**
+     * 商机等级
+     */
+    private String opportunityLevel;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 租户编号
+     */
+    private Long tenantId;
+
+}

+ 120 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/dataobject/info/CustomerInfoDO.java

@@ -0,0 +1,120 @@
+package cn.iocoder.yudao.module.customer.dal.dataobject.info;
+
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 客户信息 DO
+ *
+ * @author zhaopq
+ */
+@TableName("customer_info")
+@KeySequence("customer_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class CustomerInfoDO extends BaseDO {
+
+    /**
+     * 自增主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * 客户uuid
+     */
+    private String customerId;
+    /**
+     * 客户编码
+     */
+    private String customerCode;
+    /**
+     * 客户名称
+     */
+    private String customerName;
+    /**
+     * 客户状态
+     */
+    private String customerStatus;
+    /**
+     * 创建人员工id
+     */
+    private Long creatorEmployeeId;
+    /**
+     * 创建人员工姓名
+     */
+    private String creatorEmployeeName;
+    /**
+     * 部门id
+     */
+    private Long deptId;
+    /**
+     * 客户成立时间
+     */
+    private String registDate;
+    /**
+     * 注册资本金(万元)
+     */
+    private BigDecimal capital;
+    /**
+     * 法人代表
+     */
+    private String legalPerson;
+    /**
+     * 员工人数
+     */
+    private Integer workforce;
+    /**
+     * 行业
+     */
+    private String trade;
+    /**
+     * 企业性质
+     */
+    private String customerNature;
+    /**
+     * 客户地址
+     */
+    private String companyAddress;
+    /**
+     * 客户联系人
+     */
+    private String customerPerson;
+    /**
+     * 客户联系手机号
+     */
+    private String customerPersonPhone;
+    /**
+     * 客户联系人办公地址
+     */
+    private String companyPersonAddress;
+    /**
+     * 客户来源
+     */
+    private String customerFrom;
+    /**
+     * 是否开启 0开启1关闭
+     */
+    private Integer isOpen;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 租户编号
+     */
+    private Long tenantId;
+
+}

+ 41 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/businessopportunity/CustomerBusinessOpportunityMapper.java

@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.customer.dal.mysql.businessopportunity;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.*;
+
+/**
+ * 客户商机 Mapper
+ *
+ * @author zhaopq
+ */
+@Mapper
+public interface CustomerBusinessOpportunityMapper extends BaseMapperX<CustomerBusinessOpportunityDO> {
+
+    default PageResult<CustomerBusinessOpportunityDO> selectPage(CustomerBusinessOpportunityPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<CustomerBusinessOpportunityDO>()
+                .eqIfPresent(CustomerBusinessOpportunityDO::getOpportunityId, reqVO.getOpportunityId())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getCustomerId, reqVO.getCustomerId())
+                .likeIfPresent(CustomerBusinessOpportunityDO::getOpportunityName, reqVO.getOpportunityName())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getProjectType, reqVO.getProjectType())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getCreatorEmployeeId, reqVO.getCreatorEmployeeId())
+                .likeIfPresent(CustomerBusinessOpportunityDO::getCreatorEmployeeName, reqVO.getCreatorEmployeeName())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getWinRate, reqVO.getWinRate())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getEstimatedContractAmount, reqVO.getEstimatedContractAmount())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getEstimatedProjectMargin, reqVO.getEstimatedProjectMargin())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getEstimatedSuccessRate, reqVO.getEstimatedSuccessRate())
+                .betweenIfPresent(CustomerBusinessOpportunityDO::getEstimatedDealTime, reqVO.getEstimatedDealTime())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getOpportunityLevel, reqVO.getOpportunityLevel())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getRemarks, reqVO.getRemarks())
+                .eqIfPresent(CustomerBusinessOpportunityDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(CustomerBusinessOpportunityDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(CustomerBusinessOpportunityDO::getId));
+    }
+
+}

+ 48 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/dal/mysql/info/CustomerInfoMapper.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.customer.dal.mysql.info;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import cn.iocoder.yudao.module.customer.dal.dataobject.info.CustomerInfoDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.customer.controller.admin.info.vo.*;
+
+/**
+ * 客户信息 Mapper
+ *
+ * @author zhaopq
+ */
+@Mapper
+public interface CustomerInfoMapper extends BaseMapperX<CustomerInfoDO> {
+
+    default PageResult<CustomerInfoDO> selectPage(CustomerInfoPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<CustomerInfoDO>()
+                .eqIfPresent(CustomerInfoDO::getCustomerId, reqVO.getCustomerId())
+                .eqIfPresent(CustomerInfoDO::getCustomerCode, reqVO.getCustomerCode())
+                .likeIfPresent(CustomerInfoDO::getCustomerName, reqVO.getCustomerName())
+                .eqIfPresent(CustomerInfoDO::getCustomerStatus, reqVO.getCustomerStatus())
+                .eqIfPresent(CustomerInfoDO::getCreatorEmployeeId, reqVO.getCreatorEmployeeId())
+                .likeIfPresent(CustomerInfoDO::getCreatorEmployeeName, reqVO.getCreatorEmployeeName())
+                .eqIfPresent(CustomerInfoDO::getDeptId, reqVO.getDeptId())
+                .betweenIfPresent(CustomerInfoDO::getRegistDate, reqVO.getRegistDate())
+                .eqIfPresent(CustomerInfoDO::getCapital, reqVO.getCapital())
+                .eqIfPresent(CustomerInfoDO::getLegalPerson, reqVO.getLegalPerson())
+                .eqIfPresent(CustomerInfoDO::getWorkforce, reqVO.getWorkforce())
+                .eqIfPresent(CustomerInfoDO::getTrade, reqVO.getTrade())
+                .eqIfPresent(CustomerInfoDO::getCustomerNature, reqVO.getCustomerNature())
+                .eqIfPresent(CustomerInfoDO::getCompanyAddress, reqVO.getCompanyAddress())
+                .eqIfPresent(CustomerInfoDO::getCustomerPerson, reqVO.getCustomerPerson())
+                .eqIfPresent(CustomerInfoDO::getCustomerPersonPhone, reqVO.getCustomerPersonPhone())
+                .eqIfPresent(CustomerInfoDO::getCompanyPersonAddress, reqVO.getCompanyPersonAddress())
+                .eqIfPresent(CustomerInfoDO::getCustomerFrom, reqVO.getCustomerFrom())
+                .eqIfPresent(CustomerInfoDO::getIsOpen, reqVO.getIsOpen())
+                .eqIfPresent(CustomerInfoDO::getRemarks, reqVO.getRemarks())
+                .eqIfPresent(CustomerInfoDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(CustomerInfoDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(CustomerInfoDO::getId));
+    }
+
+}

+ 9 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/package-info.java

@@ -0,0 +1,9 @@
+/**
+ * customer 模块,我们放客户业务,提供客户的相关功能。
+ *
+ * 1. Controller URL:以 /customer/ 开头,避免和其它 Module 冲突
+ * 2. DataObject 表名:以 customer_ 开头,方便在数据库中区分
+ *
+ * 注意,由于 Customer 模块,容易重名,所以类名都加载 Customer 的前缀~
+ */
+package cn.iocoder.yudao.module.customer;

+ 63 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/businessopportunity/CustomerBusinessOpportunityService.java

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.module.customer.service.businessopportunity;
+
+import java.util.*;
+import javax.validation.*;
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+
+/**
+ * 客户商机 Service 接口
+ *
+ * @author zhaopq
+ */
+public interface CustomerBusinessOpportunityService {
+
+    /**
+     * 创建客户商机
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createBusinessOpportunity(@Valid CustomerBusinessOpportunitySaveReqVO createReqVO);
+
+    /**
+     * 更新客户商机
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateBusinessOpportunity(@Valid CustomerBusinessOpportunitySaveReqVO updateReqVO);
+
+    /**
+     * 删除客户商机
+     *
+     * @param id 编号
+     */
+    void deleteBusinessOpportunity(Long id);
+
+    /**
+     * 获得客户商机
+     *
+     * @param id 编号
+     * @return 客户商机
+     */
+    CustomerBusinessOpportunityDO getBusinessOpportunity(Long id);
+
+    /**
+     * 通过ID获得客户商机
+     *
+     * @param id
+     * @return
+     */
+    CustomerBusinessOpportunityRespVO getById(Long id);
+
+    /**
+     * 获得客户商机分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 客户商机分页
+     */
+    PageResult<CustomerBusinessOpportunityDO> getBusinessOpportunityPage(CustomerBusinessOpportunityPageReqVO pageReqVO);
+
+}

+ 158 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/businessopportunity/CustomerBusinessOpportunityServiceImpl.java

@@ -0,0 +1,158 @@
+package cn.iocoder.yudao.module.customer.service.businessopportunity;
+
+import cn.hutool.core.util.IdUtil;
+import cn.iocoder.yudao.framework.security.core.LoginUser;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
+import cn.iocoder.yudao.module.employee.api.EmployeeApi;
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
+import cn.iocoder.yudao.module.infra.api.file.FileApi;
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+import cn.iocoder.yudao.module.customer.dal.mysql.businessopportunity.CustomerBusinessOpportunityMapper;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.employee.enums.ErrorCodeConstants.CUSTOMER_BUSINESS_OPPORTUNITY_NOT_EXISTS;
+
+/**
+ * 客户商机 Service 实现类
+ *
+ * @author zhaopq
+ */
+@Service
+@Validated
+public class CustomerBusinessOpportunityServiceImpl implements CustomerBusinessOpportunityService {
+
+    @Resource
+    private CustomerBusinessOpportunityMapper businessOpportunityMapper;
+    @Resource
+    private FileApi fileApi;
+    @Resource
+    private DeptApi deptApi;
+    @Resource
+    private EmployeeApi employeeApi;
+
+    @Override
+    public Long createBusinessOpportunity(CustomerBusinessOpportunitySaveReqVO createReqVO) {
+        // 获取用户信息和租户ID
+        LoginUser user = SecurityFrameworkUtils.getLoginUser();
+        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+        Long userId = user != null && user.getId() != null ? user.getId() : 0L;
+        createReqVO.setTenantId(tenantId);
+        // 通过用户ID获取登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(userId);
+        // 创建人信息
+        if (loginEmployee != null) {
+            createReqVO.setCreatorEmployeeId(loginEmployee.getId());
+            createReqVO.setCreatorEmployeeName(loginEmployee.getName());
+            createReqVO.setDeptId(loginEmployee.getDeptId());
+        }
+        // 插入
+        String infoId = IdUtil.fastSimpleUUID();
+        createReqVO.setOpportunityId(infoId);
+        CustomerBusinessOpportunityDO businessOpportunity = BeanUtils.toBean(createReqVO, CustomerBusinessOpportunityDO.class);
+        businessOpportunityMapper.insert(businessOpportunity);
+        // 保存业务uuid到附件中
+        fileApi.updateFileBiz(createReqVO.getFileIdList(), infoId);
+        // 返回
+        return businessOpportunity.getId();
+    }
+
+    @Override
+    public void updateBusinessOpportunity(CustomerBusinessOpportunitySaveReqVO updateReqVO) {
+        // 校验存在
+        validateBusinessOpportunityExists(updateReqVO.getId());
+        // 保存业务uuid到附件中
+        fileApi.updateFileBiz(updateReqVO.getFileIdList(), updateReqVO.getOpportunityId());
+        // 获取用户信息和租户ID
+        LoginUser user = SecurityFrameworkUtils.getLoginUser();
+        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+        Long userId = user != null && user.getId() != null ? user.getId() : 0L;
+        // 通过用户ID获取登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(userId);
+        // 创建人信息
+        if (loginEmployee != null) {
+            updateReqVO.setCreatorEmployeeId(loginEmployee.getId());
+            updateReqVO.setCreatorEmployeeName(loginEmployee.getName());
+            updateReqVO.setDeptId(loginEmployee.getDeptId());
+        }
+        // 更新
+        CustomerBusinessOpportunityDO updateObj = BeanUtils.toBean(updateReqVO, CustomerBusinessOpportunityDO.class);
+        businessOpportunityMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteBusinessOpportunity(Long id) {
+        // 校验存在
+        validateBusinessOpportunityExists(id);
+        // 删除
+        businessOpportunityMapper.deleteById(id);
+    }
+
+    private void validateBusinessOpportunityExists(Long id) {
+        if (businessOpportunityMapper.selectById(id) == null) {
+            throw exception(CUSTOMER_BUSINESS_OPPORTUNITY_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public CustomerBusinessOpportunityDO getBusinessOpportunity(Long id) {
+        return businessOpportunityMapper.selectById(id);
+    }
+
+    @Override
+    @TenantIgnore
+    public CustomerBusinessOpportunityRespVO getById(Long id) {
+        // 第一步:检查ID是否为空
+        if (id == null) {
+            throw new IllegalArgumentException("ID cannot be null");
+        }
+        // 第二步:从数据库获取数据
+        CustomerBusinessOpportunityDO opportunityDO = businessOpportunityMapper.selectById(id);
+        if (opportunityDO == null) {
+            throw exception(CUSTOMER_BUSINESS_OPPORTUNITY_NOT_EXISTS);
+        }
+        // 第三步:将DO对象转换为VO对象
+        CustomerBusinessOpportunityRespVO respVO = BeanUtils.toBean(opportunityDO, CustomerBusinessOpportunityRespVO.class);
+        if (respVO == null) {
+            // 理论上BeanUtils.toBean不应该返回null,但为了安全起见,还是检查一下
+            throw new RuntimeException("Failed to convert DO to VO");
+        }
+        // 第四步:获取附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(opportunityDO.getOpportunityId());
+        if (fileList != null) {
+            // 如果fileList不为null,则设置到VO对象中
+            respVO.setFileList(fileList);
+        }
+        // 部门
+        if (opportunityDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(opportunityDO.getDeptId());
+            respVO.setDeptName(dept.getName());
+            if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                respVO.setDeptName(dept.getName());
+            }
+        }
+        // 第五步:返回VO对象
+        return respVO;
+    }
+
+    @Override
+    public PageResult<CustomerBusinessOpportunityDO> getBusinessOpportunityPage(CustomerBusinessOpportunityPageReqVO pageReqVO) {
+        return businessOpportunityMapper.selectPage(pageReqVO);
+    }
+
+}

+ 65 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/info/CustomerInfoService.java

@@ -0,0 +1,65 @@
+package cn.iocoder.yudao.module.customer.service.info;
+
+import java.util.*;
+import javax.validation.*;
+
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.CustomerBusinessOpportunityRespVO;
+import cn.iocoder.yudao.module.customer.controller.admin.info.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.info.CustomerInfoDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+
+/**
+ * 客户信息 Service 接口
+ *
+ * @author zhaopq
+ */
+public interface CustomerInfoService {
+
+    /**
+     * 创建客户信息
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createInfo(@Valid CustomerInfoSaveReqVO createReqVO);
+
+    /**
+     * 更新客户信息
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateInfo(@Valid CustomerInfoSaveReqVO updateReqVO);
+
+    /**
+     * 删除客户信息
+     *
+     * @param id 编号
+     */
+    void deleteInfo(Long id);
+
+    /**
+     * 获得客户信息
+     *
+     * @param id 编号
+     * @return 客户信息
+     */
+    CustomerInfoDO getInfo(Long id);
+
+    /**
+     * 通过ID获得客户信息
+     *
+     * @param id
+     * @return
+     */
+    CustomerInfoRespVO getById(Long id);
+
+    /**
+     * 获得客户信息分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 客户信息分页
+     */
+    PageResult<CustomerInfoDO> getInfoPage(CustomerInfoPageReqVO pageReqVO);
+
+}

+ 161 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/java/cn/iocoder/yudao/module/customer/service/info/CustomerInfoServiceImpl.java

@@ -0,0 +1,161 @@
+package cn.iocoder.yudao.module.customer.service.info;
+
+import cn.hutool.core.util.IdUtil;
+import cn.iocoder.yudao.framework.security.core.LoginUser;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
+import cn.iocoder.yudao.module.customer.controller.admin.businessopportunity.vo.CustomerBusinessOpportunityRespVO;
+import cn.iocoder.yudao.module.customer.dal.dataobject.businessopportunity.CustomerBusinessOpportunityDO;
+import cn.iocoder.yudao.module.employee.api.EmployeeApi;
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
+import cn.iocoder.yudao.module.infra.api.file.FileApi;
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.iocoder.yudao.module.customer.controller.admin.info.vo.*;
+import cn.iocoder.yudao.module.customer.dal.dataobject.info.CustomerInfoDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+import cn.iocoder.yudao.module.customer.dal.mysql.info.CustomerInfoMapper;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.employee.enums.ErrorCodeConstants.CUSTOMER_BUSINESS_OPPORTUNITY_NOT_EXISTS;
+import static cn.iocoder.yudao.module.employee.enums.ErrorCodeConstants.CUSTOMER_INFO_NOT_EXISTS;
+
+/**
+ * 客户信息 Service 实现类
+ *
+ * @author zhaopq
+ */
+@Service
+@Validated
+public class CustomerInfoServiceImpl implements CustomerInfoService {
+
+    @Resource
+    private CustomerInfoMapper infoMapper;
+    @Resource
+    private FileApi fileApi;
+    @Resource
+    private DeptApi deptApi;
+    @Resource
+    private EmployeeApi employeeApi;
+
+    @Override
+    public Long createInfo(CustomerInfoSaveReqVO createReqVO) {
+        // 获取用户信息和租户ID
+        LoginUser user = SecurityFrameworkUtils.getLoginUser();
+        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+        Long userId = user != null && user.getId() != null ? user.getId() : 0L;
+        createReqVO.setTenantId(tenantId);
+        // 通过用户ID获取登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(userId);
+        // 创建人信息
+        if (loginEmployee != null) {
+            createReqVO.setCreatorEmployeeId(loginEmployee.getId());
+            createReqVO.setCreatorEmployeeName(loginEmployee.getName());
+            createReqVO.setDeptId(loginEmployee.getDeptId());
+        }
+        // 插入
+        String infoId = IdUtil.fastSimpleUUID();
+        createReqVO.setCustomerId(infoId);
+        CustomerInfoDO info = BeanUtils.toBean(createReqVO, CustomerInfoDO.class);
+        infoMapper.insert(info);
+        // 保存业务uuid到附件中
+        fileApi.updateFileBiz(createReqVO.getFileIdList(), infoId);
+        // 返回
+        return info.getId();
+    }
+
+    @Override
+    public void updateInfo(CustomerInfoSaveReqVO updateReqVO) {
+        // 校验存在
+        validateInfoExists(updateReqVO.getId());
+        // 保存业务uuid到附件中
+        fileApi.updateFileBiz(updateReqVO.getFileIdList(), updateReqVO.getCustomerId());
+        // 获取用户信息和租户ID
+        LoginUser user = SecurityFrameworkUtils.getLoginUser();
+        Long tenantId = user != null && user.getTenantId() != null ? user.getTenantId() : 0L;
+        Long userId = user != null && user.getId() != null ? user.getId() : 0L;
+        // 通过用户ID获取登录员工信息
+        EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(userId);
+        // 创建人信息
+        if (loginEmployee != null) {
+            updateReqVO.setCreatorEmployeeId(loginEmployee.getId());
+            updateReqVO.setCreatorEmployeeName(loginEmployee.getName());
+            updateReqVO.setDeptId(loginEmployee.getDeptId());
+        }
+        // 更新
+        CustomerInfoDO updateObj = BeanUtils.toBean(updateReqVO, CustomerInfoDO.class);
+        infoMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteInfo(Long id) {
+        // 校验存在
+        validateInfoExists(id);
+        // 删除
+        infoMapper.deleteById(id);
+    }
+
+    private void validateInfoExists(Long id) {
+        if (infoMapper.selectById(id) == null) {
+            throw exception(CUSTOMER_INFO_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public CustomerInfoDO getInfo(Long id) {
+        return infoMapper.selectById(id);
+    }
+
+    @Override
+    @TenantIgnore
+    public CustomerInfoRespVO getById(Long id) {
+        // 第一步:检查ID是否为空
+        if (id == null) {
+            throw new IllegalArgumentException("ID cannot be null");
+        }
+        // 第二步:从数据库获取数据
+        CustomerInfoDO infoDO = infoMapper.selectById(id);
+        if (infoDO == null) {
+            throw exception(CUSTOMER_INFO_NOT_EXISTS);
+        }
+        // 第三步:将DO对象转换为VO对象
+        CustomerInfoRespVO respVO = BeanUtils.toBean(infoDO, CustomerInfoRespVO.class);
+        if (respVO == null) {
+            // 理论上BeanUtils.toBean不应该返回null,但为了安全起见,还是检查一下
+            throw new RuntimeException("Failed to convert DO to VO");
+        }
+        // 第四步:获取附件列表
+        List<FileDTO> fileList = fileApi.getFileDTOListByBiz(infoDO.getCustomerId());
+        if (fileList != null) {
+            // 如果fileList不为null,则设置到VO对象中
+            respVO.setFileList(fileList);
+        }
+        // 部门
+        if (infoDO.getDeptId() != null) {
+            DeptRespDTO dept = deptApi.getDept(infoDO.getDeptId());
+            respVO.setDeptName(dept.getName());
+            if (dept != null && StringUtils.isNotBlank(dept.getName())) {
+                respVO.setDeptName(dept.getName());
+            }
+        }
+        // 第五步:返回VO对象
+        return respVO;
+    }
+
+    @Override
+    public PageResult<CustomerInfoDO> getInfoPage(CustomerInfoPageReqVO pageReqVO) {
+        return infoMapper.selectPage(pageReqVO);
+    }
+
+}

+ 12 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/resources/mapper/businessopportunity/CustomerBusinessOpportunityMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.iocoder.yudao.module.customer.dal.mysql.businessopportunity.CustomerBusinessOpportunityMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
yudao-module-customer/yudao-module-customer-biz/src/main/resources/mapper/info/CustomerInfoMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.iocoder.yudao.module.customer.dal.mysql.info.CustomerInfoMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 6 - 0
yudao-server/pom.xml

@@ -150,6 +150,12 @@
             <artifactId>yudao-module-attendance-biz</artifactId>
             <version>${revision}</version>
         </dependency>
+        <!-- 客户相关模块。默认注释,保证编译速度 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-module-customer-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
 
         <!-- spring boot 配置所需依赖 -->
         <dependency>