diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java new file mode 100644 index 00000000..ca707160 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.custom.controller.admin; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.company.entity.DlCompany; +import cn.iocoder.yudao.module.company.service.DlCompanyService; +import cn.iocoder.yudao.module.company.vo.CompanyReqVO; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; +import cn.iocoder.yudao.module.custom.vo.CustomerMainPageReqVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import java.io.IOException; +import java.util.List; + +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 客户管理(每个租户的下属客户信息) + * @author : http://www.chiner.pro + * @date : 2024-7-31 + */ +@RestController +@RequestMapping("/base/custom") +@Tag(name = "管理后台 - BASE 企业管理") +@Validated +public class CustomerMainController { + @PostMapping("/create") + @Operation(summary = "创建客户管理") + @PreAuthorize("@ss.hasPermission('base:customer-main:create')") + public CommonResult createCustomerMain(@Valid @RequestBody CustomerMainSaveReqVO createReqVO) { + return success(true); + } + + @PutMapping("/update") + @Operation(summary = "更新客户管理") + @PreAuthorize("@ss.hasPermission('base:customer-main:update')") + public CommonResult updateCustomerMain(@Valid @RequestBody CustomerMainSaveReqVO updateReqVO) { + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除客户管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('base:customer-main:delete')") + public CommonResult deleteCustomerMain(@RequestParam("id") String id) { + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得客户管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('base:customer-main:query')") + public CommonResult getCustomerMain(@RequestParam("id") String id) { + return success(true); + } + + @GetMapping("/page") + @Operation(summary = "获得客户管理分页") + @PreAuthorize("@ss.hasPermission('base:customer-main:query')") + public CommonResult getCustomerMainPage(@Valid CustomerMainPageReqVO pageReqVO) { + return success(true); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出客户管理 Excel") + @PreAuthorize("@ss.hasPermission('base:customer-main:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportCustomerMainExcel(@Valid CustomerMainPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); +// List list = customerMainService.getCustomerMainPage(pageReqVO).getList(); +// // 导出 Excel +// ExcelUtils.write(response, "客户管理.xls", "数据", CustomerMainRespVO.class, +// BeanUtils.toBean(list, CustomerMainRespVO.class)); + } +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java new file mode 100644 index 00000000..303bbf52 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.custom.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; + +/** + * 客户管理 DO + * + * @author pqz + */ +@TableName("base_customer_main") +@KeySequence("base_customer_main_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CustomerMain extends TenantBaseDO { + + /** + * uuid + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * sys_user表id + */ + private String userId; + /** + * 用户类型 + */ + private String typeCode; + /** + * 所属企业code(部门表code) + */ + private String deptCode; + /** + * 客户名称(政企客户填企业名称) + */ + private String cusName; + /** + * 联系方式 + */ + private String phoneNumber; + /** + * 生日 + */ + private LocalDateTime birthday; + /** + * 住址 + */ + private String address; + /** + * 性别 + */ + private String sex; + /** + * 身份证号 + */ + private String idCard; + /** + * 身份证照片 + */ + private String idCardImage; + /** + * 客户初始来源 + */ + private String dataFrom; + /** + * 最近业务办理时间 + */ + private LocalDateTime nearDoTime; + /** + * 最近办理业务(数据字典业务标识) + */ + private String nearDoContent; + /** + * 邀请者user_id + */ + private String inviter; + /** + * 邀请者类型 + */ + private String inviterType; + /** + * 客户状态 + */ + private String status; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerMainMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerMainMapper.java new file mode 100644 index 00000000..badc804a --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerMainMapper.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.custom.mapper; + +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户管理 Mapper + * + * @author pqz + */ +@Mapper +public interface CustomerMainMapper extends BaseMapper { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerMainService.java new file mode 100644 index 00000000..037e121b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerMainService.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.custom.service; + +import cn.iocoder.yudao.module.company.entity.DlCompany; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 客户管理 Service 接口 + * + * @author pqz + */ +public interface CustomerMainService extends IService { + + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java new file mode 100644 index 00000000..d7737995 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.custom.service.impl; + +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.mapper.CustomerMainMapper; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 客户管理 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class CustomerMainServiceImpl extends ServiceImpl implements CustomerMainService { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainPageReqVO.java new file mode 100644 index 00000000..d9b3b4a6 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainPageReqVO.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.custom.vo; + +import lombok.*; +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_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 客户管理分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CustomerMainPageReqVO extends PageParam { + + @Schema(description = "sys_user表id", example = "17679") + private String userId; + + @Schema(description = "用户类型") + private String typeCode; + + @Schema(description = "所属企业code(部门表code)") + private String deptCode; + + @Schema(description = "客户名称(政企客户填企业名称)", example = "赵六") + private String cusName; + + @Schema(description = "联系方式") + private String phoneNumber; + + @Schema(description = "生日") + private LocalDateTime birthday; + + @Schema(description = "住址") + private String address; + + @Schema(description = "性别") + private String sex; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "身份证照片") + private String idCardImage; + + @Schema(description = "客户初始来源") + private String dataFrom; + + @Schema(description = "最近业务办理时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] nearDoTime; + + @Schema(description = "最近办理业务(数据字典业务标识)") + private String nearDoContent; + + @Schema(description = "邀请者user_id") + private String inviter; + + @Schema(description = "邀请者类型", example = "2") + private String inviterType; + + @Schema(description = "客户状态", example = "1") + private String status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java new file mode 100644 index 00000000..05f60aec --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java @@ -0,0 +1,87 @@ +package cn.iocoder.yudao.module.custom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +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 CustomerMainRespVO { + + @Schema(description = "uuid", requiredMode = Schema.RequiredMode.REQUIRED, example = "29951") + @ExcelProperty("uuid") + private String id; + + @Schema(description = "sys_user表id", example = "17679") + @ExcelProperty("sys_user表id") + private String userId; + + @Schema(description = "用户类型") + @ExcelProperty("用户类型") + private String typeCode; + + @Schema(description = "所属企业code(部门表code)") + @ExcelProperty("所属企业code(部门表code)") + private String deptCode; + + @Schema(description = "客户名称(政企客户填企业名称)", example = "赵六") + @ExcelProperty("客户名称(政企客户填企业名称)") + private String cusName; + + @Schema(description = "联系方式") + @ExcelProperty("联系方式") + private String phoneNumber; + + @Schema(description = "生日") + @ExcelProperty("生日") + private LocalDateTime birthday; + + @Schema(description = "住址") + @ExcelProperty("住址") + private String address; + + @Schema(description = "性别") + @ExcelProperty("性别") + private String sex; + + @Schema(description = "身份证号") + @ExcelProperty("身份证号") + private String idCard; + + @Schema(description = "身份证照片") + @ExcelProperty("身份证照片") + private String idCardImage; + + @Schema(description = "客户初始来源") + @ExcelProperty("客户初始来源") + private String dataFrom; + + @Schema(description = "最近业务办理时间") + @ExcelProperty("最近业务办理时间") + private LocalDateTime nearDoTime; + + @Schema(description = "最近办理业务(数据字典业务标识)") + @ExcelProperty("最近办理业务(数据字典业务标识)") + private String nearDoContent; + + @Schema(description = "邀请者user_id") + @ExcelProperty("邀请者user_id") + private String inviter; + + @Schema(description = "邀请者类型", example = "2") + @ExcelProperty("邀请者类型") + private String inviterType; + + @Schema(description = "客户状态", example = "1") + @ExcelProperty("客户状态") + private String status; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java new file mode 100644 index 00000000..de58d5bd --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.custom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 客户管理新增/修改 Request VO") +@Data +public class CustomerMainSaveReqVO { + + @Schema(description = "uuid", requiredMode = Schema.RequiredMode.REQUIRED, example = "29951") + private String id; + + @Schema(description = "sys_user表id", example = "17679") + private String userId; + + @Schema(description = "用户类型") + private String typeCode; + + @Schema(description = "所属企业code(部门表code)") + private String deptCode; + + @Schema(description = "客户名称(政企客户填企业名称)", example = "赵六") + private String cusName; + + @Schema(description = "联系方式") + private String phoneNumber; + + @Schema(description = "生日") + private LocalDateTime birthday; + + @Schema(description = "住址") + private String address; + + @Schema(description = "性别") + private String sex; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "身份证照片") + private String idCardImage; + + @Schema(description = "客户初始来源") + private String dataFrom; + + @Schema(description = "最近业务办理时间") + private LocalDateTime nearDoTime; + + @Schema(description = "最近办理业务(数据字典业务标识)") + private String nearDoContent; + + @Schema(description = "邀请者user_id") + private String inviter; + + @Schema(description = "邀请者类型", example = "2") + private String inviterType; + + @Schema(description = "客户状态", example = "1") + private String status; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/DlCompanyMapper.xml b/dl-module-base/src/main/resources/mapper/company/DlCompanyMapper.xml similarity index 77% rename from dl-module-base/src/main/resources/mapper/custom/DlCompanyMapper.xml rename to dl-module-base/src/main/resources/mapper/company/DlCompanyMapper.xml index 093dc2bf..a77b078c 100644 --- a/dl-module-base/src/main/resources/mapper/custom/DlCompanyMapper.xml +++ b/dl-module-base/src/main/resources/mapper/company/DlCompanyMapper.xml @@ -1,7 +1,7 @@ - + diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml new file mode 100644 index 00000000..69ca8114 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file