diff --git a/pom.xml b/pom.xml
index 5f33b2c..cdad8d7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,14 +15,15 @@
yudao-module-system
yudao-module-infra
-
+ yudao-module-customer
+
-
+ yudao-module-erp
diff --git a/yudao-module-customer/pom.xml b/yudao-module-customer/pom.xml
new file mode 100644
index 0000000..ca49b53
--- /dev/null
+++ b/yudao-module-customer/pom.xml
@@ -0,0 +1,64 @@
+
+
+
+ cn.iocoder.boot
+ yudao
+ ${revision}
+
+ 4.0.0
+ yudao-module-customer
+ jar
+
+ ${project.artifactId}
+
+ customer 包下,客户管理
+
+
+
+
+ cn.iocoder.boot
+ yudao-module-system
+ ${revision}
+
+
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-web
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-security
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-mybatis
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-redis
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-excel
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-test
+
+
+
+
+
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/ManagementController.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/ManagementController.java
new file mode 100644
index 0000000..01fd3d2
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/ManagementController.java
@@ -0,0 +1,104 @@
+package cn.iocoder.yudao.module.cus.controller.admin.management;
+
+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.cus.controller.admin.management.vo.*;
+import cn.iocoder.yudao.module.cus.dal.dataobject.management.ManagementDO;
+import cn.iocoder.yudao.module.cus.service.management.ManagementService;
+
+@Tag(name = "管理后台 - 客户管理")
+@RestController
+@RequestMapping("/cus/management")
+@Validated
+public class ManagementController {
+
+ @Resource
+ private ManagementService managementService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建客户管理")
+ @PreAuthorize("@ss.hasPermission('cus:management:create')")
+ public CommonResult createManagement(@Valid @RequestBody ManagementSaveReqVO createReqVO) {
+ return success(managementService.createManagement(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新客户管理")
+ @PreAuthorize("@ss.hasPermission('cus:management:update')")
+ public CommonResult updateManagement(@Valid @RequestBody ManagementSaveReqVO updateReqVO) {
+ managementService.updateManagement(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除客户管理")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('cus:management:delete')")
+ public CommonResult deleteManagement(@RequestParam("id") Long id) {
+ managementService.deleteManagement(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除客户管理")
+ @PreAuthorize("@ss.hasPermission('cus:management:delete')")
+ public CommonResult deleteManagementList(@RequestParam("ids") List ids) {
+ managementService.deleteManagementListByIds(ids);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得客户管理")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('cus:management:query')")
+ public CommonResult getManagement(@RequestParam("id") Long id) {
+ ManagementDO management = managementService.getManagement(id);
+ return success(BeanUtils.toBean(management, ManagementRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得客户管理分页")
+ @PreAuthorize("@ss.hasPermission('cus:management:query')")
+ public CommonResult> getManagementPage(@Valid ManagementPageReqVO pageReqVO) {
+ PageResult pageResult = managementService.getManagementPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, ManagementRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出客户管理 Excel")
+ @PreAuthorize("@ss.hasPermission('cus:management:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportManagementExcel(@Valid ManagementPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = managementService.getManagementPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "客户管理.xls", "数据", ManagementRespVO.class,
+ BeanUtils.toBean(list, ManagementRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementPageReqVO.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementPageReqVO.java
new file mode 100644
index 0000000..4d49bf0
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementPageReqVO.java
@@ -0,0 +1,72 @@
+package cn.iocoder.yudao.module.cus.controller.admin.management.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
+public class ManagementPageReqVO extends PageParam {
+
+ @Schema(description = "客户编码")
+ private String customerCode;
+
+ @Schema(description = "客户名称", example = "张三")
+ private String customerName;
+
+ @Schema(description = "备注", example = "随便")
+ private String remark;
+
+ @Schema(description = "售后负责人")
+ private String afterSalesManager;
+
+ @Schema(description = "国家编码")
+ private String countryCode;
+
+ @Schema(description = "国家名称", example = "王五")
+ private String countryName;
+
+ @Schema(description = "省编码")
+ private String provinceCode;
+
+ @Schema(description = "省名称", example = "王五")
+ private String provinceName;
+
+ @Schema(description = "城市编码")
+ private String cityCode;
+
+ @Schema(description = "城市名称", example = "赵六")
+ private String cityName;
+
+ @Schema(description = "详细地址")
+ private String address;
+
+ @Schema(description = "经度")
+ private BigDecimal longitude;
+
+ @Schema(description = "纬度")
+ private BigDecimal latitude;
+
+ @Schema(description = "数据库IP")
+ private String dbIp;
+
+ @Schema(description = "数据库端口")
+ private Integer dbPort;
+
+ @Schema(description = "数据库账号", example = "赵六")
+ private String dbUsername;
+
+ @Schema(description = "数据库密码")
+ private String dbPassword;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementRespVO.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementRespVO.java
new file mode 100644
index 0000000..ccdbcd4
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementRespVO.java
@@ -0,0 +1,92 @@
+package cn.iocoder.yudao.module.cus.controller.admin.management.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import cn.idev.excel.annotation.*;
+
+@Schema(description = "管理后台 - 客户管理 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ManagementRespVO {
+
+ @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14051")
+ @ExcelProperty("id")
+ private Long id;
+
+ @Schema(description = "客户编码")
+ @ExcelProperty("客户编码")
+ private String customerCode;
+
+ @Schema(description = "客户名称", example = "张三")
+ @ExcelProperty("客户名称")
+ private String customerName;
+
+ @Schema(description = "备注", example = "随便")
+ @ExcelProperty("备注")
+ private String remark;
+
+ @Schema(description = "售后负责人")
+ @ExcelProperty("售后负责人")
+ private String afterSalesManager;
+
+ @Schema(description = "国家编码")
+ @ExcelProperty("国家编码")
+ private String countryCode;
+
+ @Schema(description = "国家名称", example = "王五")
+ @ExcelProperty("国家名称")
+ private String countryName;
+
+ @Schema(description = "省编码")
+ @ExcelProperty("省编码")
+ private String provinceCode;
+
+ @Schema(description = "省名称", example = "王五")
+ @ExcelProperty("省名称")
+ private String provinceName;
+
+ @Schema(description = "城市编码")
+ @ExcelProperty("城市编码")
+ private String cityCode;
+
+ @Schema(description = "城市名称", example = "赵六")
+ @ExcelProperty("城市名称")
+ private String cityName;
+
+ @Schema(description = "详细地址")
+ @ExcelProperty("详细地址")
+ private String address;
+
+ @Schema(description = "经度")
+ @ExcelProperty("经度")
+ private BigDecimal longitude;
+
+ @Schema(description = "纬度")
+ @ExcelProperty("纬度")
+ private BigDecimal latitude;
+
+ @Schema(description = "数据库IP")
+ @ExcelProperty("数据库IP")
+ private String dbIp;
+
+ @Schema(description = "数据库端口")
+ @ExcelProperty("数据库端口")
+ private Integer dbPort;
+
+ @Schema(description = "数据库账号", example = "赵六")
+ @ExcelProperty("数据库账号")
+ private String dbUsername;
+
+ @Schema(description = "数据库密码")
+ @ExcelProperty("数据库密码")
+ private String dbPassword;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementSaveReqVO.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementSaveReqVO.java
new file mode 100644
index 0000000..b4df2e7
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/controller/admin/management/vo/ManagementSaveReqVO.java
@@ -0,0 +1,67 @@
+package cn.iocoder.yudao.module.cus.controller.admin.management.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 ManagementSaveReqVO {
+
+ @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14051")
+ private Long id;
+
+ @Schema(description = "客户编码")
+ private String customerCode;
+
+ @Schema(description = "客户名称", example = "张三")
+ private String customerName;
+
+ @Schema(description = "备注", example = "随便")
+ private String remark;
+
+ @Schema(description = "售后负责人")
+ private String afterSalesManager;
+
+ @Schema(description = "国家编码")
+ private String countryCode;
+
+ @Schema(description = "国家名称", example = "王五")
+ private String countryName;
+
+ @Schema(description = "省编码")
+ private String provinceCode;
+
+ @Schema(description = "省名称", example = "王五")
+ private String provinceName;
+
+ @Schema(description = "城市编码")
+ private String cityCode;
+
+ @Schema(description = "城市名称", example = "赵六")
+ private String cityName;
+
+ @Schema(description = "详细地址")
+ private String address;
+
+ @Schema(description = "经度")
+ private BigDecimal longitude;
+
+ @Schema(description = "纬度")
+ private BigDecimal latitude;
+
+ @Schema(description = "数据库IP")
+ private String dbIp;
+
+ @Schema(description = "数据库端口")
+ private Integer dbPort;
+
+ @Schema(description = "数据库账号", example = "赵六")
+ private String dbUsername;
+
+ @Schema(description = "数据库密码")
+ private String dbPassword;
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/dataobject/management/ManagementDO.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/dataobject/management/ManagementDO.java
new file mode 100644
index 0000000..4bcb290
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/dataobject/management/ManagementDO.java
@@ -0,0 +1,106 @@
+package cn.iocoder.yudao.module.cus.dal.dataobject.management;
+
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+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 芋道源码
+ */
+@TableName("cus_management")
+@KeySequence("cus_management_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ManagementDO extends BaseDO {
+
+ /**
+ * id
+ */
+ @TableId
+ private Long id;
+ /**
+ * 客户编码
+ */
+ private String customerCode;
+ /**
+ * 客户名称
+ */
+ private String customerName;
+ /**
+ * 备注
+ */
+ private String remark;
+ /**
+ * 售后负责人
+ */
+ private String afterSalesManager;
+ /**
+ * 国家编码
+ */
+ private String countryCode;
+ /**
+ * 国家名称
+ */
+ private String countryName;
+ /**
+ * 省编码
+ */
+ private String provinceCode;
+ /**
+ * 省名称
+ */
+ private String provinceName;
+ /**
+ * 城市编码
+ */
+ private String cityCode;
+ /**
+ * 城市名称
+ */
+ private String cityName;
+ /**
+ * 详细地址
+ */
+ private String address;
+ /**
+ * 经度
+ */
+ private BigDecimal longitude;
+ /**
+ * 纬度
+ */
+ private BigDecimal latitude;
+ /**
+ * 数据库IP
+ */
+ private String dbIp;
+ /**
+ * 数据库端口
+ */
+ private Integer dbPort;
+ /**
+ * 数据库账号
+ */
+ private String dbUsername;
+ /**
+ * 数据库密码
+ */
+ private String dbPassword;
+ /**
+ * 租户编号
+ */
+ private Long tenantId;
+
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/mysql/management/ManagementMapper.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/mysql/management/ManagementMapper.java
new file mode 100644
index 0000000..5fb10db
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/dal/mysql/management/ManagementMapper.java
@@ -0,0 +1,43 @@
+package cn.iocoder.yudao.module.cus.dal.mysql.management;
+
+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.cus.dal.dataobject.management.ManagementDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.cus.controller.admin.management.vo.*;
+
+/**
+ * 客户管理 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface ManagementMapper extends BaseMapperX {
+
+ default PageResult selectPage(ManagementPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(ManagementDO::getCustomerCode, reqVO.getCustomerCode())
+ .likeIfPresent(ManagementDO::getCustomerName, reqVO.getCustomerName())
+ .eqIfPresent(ManagementDO::getRemark, reqVO.getRemark())
+ .eqIfPresent(ManagementDO::getAfterSalesManager, reqVO.getAfterSalesManager())
+ .eqIfPresent(ManagementDO::getCountryCode, reqVO.getCountryCode())
+ .likeIfPresent(ManagementDO::getCountryName, reqVO.getCountryName())
+ .eqIfPresent(ManagementDO::getProvinceCode, reqVO.getProvinceCode())
+ .likeIfPresent(ManagementDO::getProvinceName, reqVO.getProvinceName())
+ .eqIfPresent(ManagementDO::getCityCode, reqVO.getCityCode())
+ .likeIfPresent(ManagementDO::getCityName, reqVO.getCityName())
+ .eqIfPresent(ManagementDO::getAddress, reqVO.getAddress())
+ .eqIfPresent(ManagementDO::getLongitude, reqVO.getLongitude())
+ .eqIfPresent(ManagementDO::getLatitude, reqVO.getLatitude())
+ .eqIfPresent(ManagementDO::getDbIp, reqVO.getDbIp())
+ .eqIfPresent(ManagementDO::getDbPort, reqVO.getDbPort())
+ .likeIfPresent(ManagementDO::getDbUsername, reqVO.getDbUsername())
+ .eqIfPresent(ManagementDO::getDbPassword, reqVO.getDbPassword())
+ .betweenIfPresent(ManagementDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(ManagementDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/framework/web/config/CusWebConfiguration.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/framework/web/config/CusWebConfiguration.java
new file mode 100644
index 0000000..fa1d39e
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/framework/web/config/CusWebConfiguration.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.cus.framework.web.config;
+
+import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration;
+import org.springdoc.core.GroupedOpenApi;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * cus 模块的 web 组件的 Configuration
+ *
+ * @author 芋道源码
+ */
+@Configuration(proxyBeanMethods = false)
+public class CusWebConfiguration {
+
+ /**
+ * cus 模块的 API 分组
+ */
+ @Bean
+ public GroupedOpenApi cusGroupedOpenApi() {
+ return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("cus");
+ }
+
+}
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementService.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementService.java
new file mode 100644
index 0000000..968b48d
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementService.java
@@ -0,0 +1,62 @@
+package cn.iocoder.yudao.module.cus.service.management;
+
+import java.util.*;
+import javax.validation.*;
+import cn.iocoder.yudao.module.cus.controller.admin.management.vo.*;
+import cn.iocoder.yudao.module.cus.dal.dataobject.management.ManagementDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+
+/**
+ * 客户管理 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface ManagementService {
+
+ /**
+ * 创建客户管理
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createManagement(@Valid ManagementSaveReqVO createReqVO);
+
+ /**
+ * 更新客户管理
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateManagement(@Valid ManagementSaveReqVO updateReqVO);
+
+ /**
+ * 删除客户管理
+ *
+ * @param id 编号
+ */
+ void deleteManagement(Long id);
+
+ /**
+ * 批量删除客户管理
+ *
+ * @param ids 编号
+ */
+ void deleteManagementListByIds(List ids);
+
+ /**
+ * 获得客户管理
+ *
+ * @param id 编号
+ * @return 客户管理
+ */
+ ManagementDO getManagement(Long id);
+
+ /**
+ * 获得客户管理分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 客户管理分页
+ */
+ PageResult getManagementPage(ManagementPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementServiceImpl.java b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementServiceImpl.java
new file mode 100644
index 0000000..5ec217d
--- /dev/null
+++ b/yudao-module-customer/src/main/java/cn/iocoder/yudao/module/cus/service/management/ManagementServiceImpl.java
@@ -0,0 +1,81 @@
+package cn.iocoder.yudao.module.cus.service.management;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.*;
+import cn.iocoder.yudao.module.cus.controller.admin.management.vo.*;
+import cn.iocoder.yudao.module.cus.dal.dataobject.management.ManagementDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+import cn.iocoder.yudao.module.cus.dal.mysql.management.ManagementMapper;
+
+import static cn.iocoder.yudao.module.cus.enums.ErrorCodeConstants.MANAGEMENT_NOT_EXISTS;
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+
+/**
+ * 客户管理 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class ManagementServiceImpl implements ManagementService {
+
+ @Resource
+ private ManagementMapper managementMapper;
+
+ @Override
+ public Long createManagement(ManagementSaveReqVO createReqVO) {
+ // 插入
+ ManagementDO management = BeanUtils.toBean(createReqVO, ManagementDO.class);
+ managementMapper.insert(management);
+
+ // 返回
+ return management.getId();
+ }
+
+ @Override
+ public void updateManagement(ManagementSaveReqVO updateReqVO) {
+ // 校验存在
+ validateManagementExists(updateReqVO.getId());
+ // 更新
+ ManagementDO updateObj = BeanUtils.toBean(updateReqVO, ManagementDO.class);
+ managementMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteManagement(Long id) {
+ // 校验存在
+ validateManagementExists(id);
+ // 删除
+ managementMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteManagementListByIds(List ids) {
+ // 删除
+ managementMapper.deleteByIds(ids);
+ }
+
+
+ private void validateManagementExists(Long id) {
+ if (managementMapper.selectById(id) == null) {
+ throw exception(MANAGEMENT_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public ManagementDO getManagement(Long id) {
+ return managementMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getManagementPage(ManagementPageReqVO pageReqVO) {
+ return managementMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-customer/src/main/resources/mapper/management/ManagementMapper.xml b/yudao-module-customer/src/main/resources/mapper/management/ManagementMapper.xml
new file mode 100644
index 0000000..ebf7b9b
--- /dev/null
+++ b/yudao-module-customer/src/main/resources/mapper/management/ManagementMapper.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml
index 97ee0da..da92cdc 100644
--- a/yudao-server/pom.xml
+++ b/yudao-server/pom.xml
@@ -95,11 +95,11 @@
-
-
-
-
-
+
+ cn.iocoder.boot
+ yudao-module-erp
+ ${revision}
+
@@ -115,6 +115,13 @@
+
+
+ cn.iocoder.boot
+ yudao-module-customer
+ ${revision}
+
+
org.springframework.boot