客户管理初始化
This commit is contained in:
parent
b90448c2d1
commit
db38ccc609
@ -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<Boolean> createCustomerMain(@Valid @RequestBody CustomerMainSaveReqVO createReqVO) {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新客户管理")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-main:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<Boolean> getCustomerMain(@RequestParam("id") String id) {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得客户管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:customer-main:query')")
|
||||
public CommonResult<Boolean> 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<CustomerMain> list = customerMainService.getCustomerMainPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "客户管理.xls", "数据", CustomerMainRespVO.class,
|
||||
// BeanUtils.toBean(list, CustomerMainRespVO.class));
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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<CustomerMain> {
|
||||
|
||||
|
||||
}
|
@ -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<CustomerMain> {
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<CustomerMainMapper, CustomerMain> implements CustomerMainService {
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<?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.custom.mapper.DlCompanyMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.company.mapper.DlCompanyMapper">
|
||||
<select id="selectListPage" resultType="cn.iocoder.yudao.module.company.entity.DlCompany">
|
||||
select * from base_company
|
||||
</select>
|
@ -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.custom.mapper.CustomerMainMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user