Commit fe0bde8417582d10f4e831b533fc4efb3d3381d7
1 parent
ed34b18d
CRM:【线索】 CrmClueExcelVO 融合到 CrmClueRespVO 里
Showing
4 changed files
with
62 additions
and
128 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/CrmClueController.java
| ... | ... | @@ -84,8 +84,8 @@ public class CrmClueController { |
| 84 | 84 | pageReqVO.setPageSize(PAGE_SIZE_NONE); |
| 85 | 85 | List<CrmClueDO> list = clueService.getCluePage(pageReqVO, getLoginUserId()).getList(); |
| 86 | 86 | // 导出 Excel |
| 87 | - List<CrmClueExcelVO> datas = BeanUtils.toBean(list, CrmClueExcelVO.class); | |
| 88 | - ExcelUtils.write(response, "线索.xls", "数据", CrmClueExcelVO.class, datas); | |
| 87 | + List<CrmClueRespVO> datas = BeanUtils.toBean(list, CrmClueRespVO.class); | |
| 88 | + ExcelUtils.write(response, "线索.xls", "数据", CrmClueRespVO.class, datas); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | @PutMapping("/transfer") | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueBaseVO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.clue.vo; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.common.validation.Mobile; | |
| 4 | -import cn.iocoder.yudao.framework.common.validation.Telephone; | |
| 5 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | -import jakarta.validation.constraints.NotEmpty; | |
| 7 | -import lombok.Data; | |
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | - | |
| 10 | -import java.time.LocalDateTime; | |
| 11 | - | |
| 12 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * 线索 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 16 | - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 17 | - */ | |
| 18 | -@Data | |
| 19 | -public class CrmClueBaseVO { | |
| 20 | - | |
| 21 | - @Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx") | |
| 22 | - @NotEmpty(message = "线索名称不能为空") | |
| 23 | - private String name; | |
| 24 | - | |
| 25 | - @Schema(description = "客户 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520") | |
| 26 | - private Long customerId; | |
| 27 | - | |
| 28 | - @Schema(description = "下次联系时间", example = "2023-10-18 01:00:00") | |
| 29 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 30 | - private LocalDateTime contactNextTime; | |
| 31 | - | |
| 32 | - @Schema(description = "电话", example = "18000000000") | |
| 33 | - @Telephone | |
| 34 | - private String telephone; | |
| 35 | - | |
| 36 | - @Schema(description = "手机号", example = "18000000000") | |
| 37 | - @Mobile | |
| 38 | - private String mobile; | |
| 39 | - | |
| 40 | - @Schema(description = "地址", example = "北京市海淀区") | |
| 41 | - private String address; | |
| 42 | - | |
| 43 | - @Schema(description = "最后跟进时间") | |
| 44 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 45 | - private LocalDateTime contactLastTime; | |
| 46 | - | |
| 47 | - @Schema(description = "负责人编号") | |
| 48 | - private Long ownerUserId; | |
| 49 | - | |
| 50 | - @Schema(description = "备注", example = "随便") | |
| 51 | - private String remark; | |
| 52 | - | |
| 53 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.clue.vo; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | |
| 4 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | -import lombok.*; | |
| 6 | -import java.util.*; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import java.time.LocalDateTime; | |
| 9 | -import java.time.LocalDateTime; | |
| 10 | -import java.time.LocalDateTime; | |
| 11 | - | |
| 12 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 13 | -import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | |
| 14 | -import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | |
| 15 | - | |
| 16 | -/** | |
| 17 | - * 线索 Excel VO | |
| 18 | - * | |
| 19 | - * @author Wanwan | |
| 20 | - */ | |
| 21 | -@Data | |
| 22 | -public class CrmClueExcelVO { | |
| 23 | - | |
| 24 | - @ExcelProperty("编号") | |
| 25 | - private Long id; | |
| 26 | - | |
| 27 | - @ExcelProperty(value = "转化状态", converter = DictConvert.class) | |
| 28 | - @DictFormat(DictTypeConstants.BOOLEAN_STRING) | |
| 29 | - private Boolean transformStatus; | |
| 30 | - | |
| 31 | - @ExcelProperty(value = "跟进状态", converter = DictConvert.class) | |
| 32 | - @DictFormat(DictTypeConstants.BOOLEAN_STRING) | |
| 33 | - private Boolean followUpStatus; | |
| 34 | - | |
| 35 | - @ExcelProperty("线索名称") | |
| 36 | - private String name; | |
| 37 | - | |
| 38 | - // TODO 这里需要导出成客户名称 | |
| 39 | - @ExcelProperty("客户id") | |
| 40 | - private Long customerId; | |
| 41 | - | |
| 42 | - @ExcelProperty("下次联系时间") | |
| 43 | - private LocalDateTime contactNextTime; | |
| 44 | - | |
| 45 | - @ExcelProperty("电话") | |
| 46 | - private String telephone; | |
| 47 | - | |
| 48 | - @ExcelProperty("手机号") | |
| 49 | - private String mobile; | |
| 50 | - | |
| 51 | - @ExcelProperty("地址") | |
| 52 | - private String address; | |
| 53 | - | |
| 54 | - @ExcelProperty("负责人的用户编号") | |
| 55 | - private Long ownerUserId; | |
| 56 | - | |
| 57 | - @ExcelProperty("最后跟进时间") | |
| 58 | - private LocalDateTime contactLastTime; | |
| 59 | - | |
| 60 | - @ExcelProperty("备注") | |
| 61 | - private String remark; | |
| 62 | - | |
| 63 | - @ExcelProperty("创建时间") | |
| 64 | - private LocalDateTime createTime; | |
| 65 | - | |
| 66 | -} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.controller.admin.clue.vo; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | |
| 4 | +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | |
| 5 | +import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | |
| 6 | +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | |
| 7 | +import com.alibaba.excel.annotation.ExcelProperty; | |
| 3 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 9 | +import lombok.Data; | |
| 10 | +import lombok.ToString; | |
| 11 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 5 | 12 | |
| 6 | -import jakarta.validation.constraints.NotNull; | |
| 7 | 13 | import java.time.LocalDateTime; |
| 8 | 14 | |
| 15 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 16 | + | |
| 9 | 17 | @Schema(description = "管理后台 - 线索 Response VO") |
| 10 | 18 | @Data |
| 11 | -@EqualsAndHashCode(callSuper = true) | |
| 12 | 19 | @ToString(callSuper = true) |
| 13 | -public class CrmClueRespVO extends CrmClueBaseVO { | |
| 20 | +@ExcelIgnoreUnannotated | |
| 21 | +public class CrmClueRespVO { | |
| 14 | 22 | |
| 15 | 23 | @Schema(description = "编号,主键自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "10969") |
| 24 | + @ExcelProperty("编号") | |
| 16 | 25 | private Long id; |
| 17 | 26 | |
| 18 | - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 19 | - private LocalDateTime createTime; | |
| 20 | - | |
| 21 | 27 | @Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| 28 | + @ExcelProperty(value = "转化状态", converter = DictConvert.class) | |
| 29 | + @DictFormat(DictTypeConstants.BOOLEAN_STRING) | |
| 22 | 30 | private Boolean transformStatus; |
| 23 | 31 | |
| 24 | 32 | @Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| 33 | + @ExcelProperty(value = "跟进状态", converter = DictConvert.class) | |
| 34 | + @DictFormat(DictTypeConstants.BOOLEAN_STRING) | |
| 25 | 35 | private Boolean followUpStatus; |
| 26 | 36 | |
| 37 | + @Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx") | |
| 38 | + @ExcelProperty("线索名称") | |
| 39 | + private String name; | |
| 40 | + | |
| 41 | + @Schema(description = "客户 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520") | |
| 42 | + // TODO 这里需要导出成客户名称 | |
| 43 | + @ExcelProperty("客户id") | |
| 44 | + private Long customerId; | |
| 45 | + | |
| 46 | + @Schema(description = "下次联系时间", example = "2023-10-18 01:00:00") | |
| 47 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 48 | + @ExcelProperty("下次联系时间") | |
| 49 | + private LocalDateTime contactNextTime; | |
| 50 | + | |
| 51 | + @Schema(description = "电话", example = "18000000000") | |
| 52 | + @ExcelProperty("电话") | |
| 53 | + private String telephone; | |
| 54 | + | |
| 55 | + @Schema(description = "手机号", example = "18000000000") | |
| 56 | + @ExcelProperty("手机号") | |
| 57 | + private String mobile; | |
| 58 | + | |
| 59 | + @Schema(description = "地址", example = "北京市海淀区") | |
| 60 | + @ExcelProperty("地址") | |
| 61 | + private String address; | |
| 62 | + | |
| 63 | + @Schema(description = "负责人编号") | |
| 64 | + @ExcelProperty("负责人的用户编号") | |
| 65 | + private Long ownerUserId; | |
| 66 | + | |
| 67 | + @Schema(description = "最后跟进时间") | |
| 68 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 69 | + @ExcelProperty("最后跟进时间") | |
| 70 | + private LocalDateTime contactLastTime; | |
| 71 | + | |
| 72 | + @Schema(description = "备注", example = "随便") | |
| 73 | + @ExcelProperty("备注") | |
| 74 | + private String remark; | |
| 75 | + | |
| 76 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 77 | + @ExcelProperty("创建时间") | |
| 78 | + private LocalDateTime createTime; | |
| 79 | + | |
| 27 | 80 | } | ... | ... |