Commit 7b36eb888e84465147085b9e93b550ab358f39c9

Authored by puhui999
1 parent ff9cef6a

CRM-合同:RespVO 添加导出注解

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java
1 1 package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
2 2  
  3 +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
  4 +import com.alibaba.excel.annotation.ExcelProperty;
3 5 import io.swagger.v3.oas.annotations.media.Schema;
4 6 import lombok.Data;
  7 +import org.springframework.format.annotation.DateTimeFormat;
5 8  
6 9 import java.time.LocalDateTime;
7 10  
8   -// TODO @puhui999:导出注解哈
  11 +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  12 +
9 13 @Schema(description = "管理后台 - CRM 合同 Response VO")
10 14 @Data
  15 +@ExcelIgnoreUnannotated
11 16 public class CrmContractRespVO {
12 17  
13 18 @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
  19 + @ExcelProperty("合同编号")
14 20 private Long id;
15 21  
16 22 @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
  23 + @ExcelProperty("合同名称")
17 24 private String name;
18 25  
19 26 @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18336")
  27 + @ExcelProperty("客户编号")
20 28 private Long customerId;
21 29  
22 30 @Schema(description = "商机编号", example = "10864")
  31 + @ExcelProperty("商机编号")
23 32 private Long businessId;
24 33  
25 34 @Schema(description = "工作流编号", example = "1043")
  35 + @ExcelProperty("工作流编号")
26 36 private Long processInstanceId;
27 37  
28 38 @Schema(description = "下单日期", requiredMode = Schema.RequiredMode.REQUIRED)
  39 + @ExcelProperty("下单日期")
  40 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
29 41 private LocalDateTime orderDate;
30 42  
31 43 @Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17144")
  44 + @ExcelProperty("负责人的用户编号")
32 45 private Long ownerUserId;
33 46  
34 47 // TODO @芋艿:未来应该支持自动生成;
35 48 @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20230101")
  49 + @ExcelProperty("合同编号")
36 50 private String no;
37 51  
38 52 @Schema(description = "开始时间")
  53 + @ExcelProperty("开始时间")
  54 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
39 55 private LocalDateTime startTime;
40 56  
41 57 @Schema(description = "结束时间")
  58 + @ExcelProperty("结束时间")
  59 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
42 60 private LocalDateTime endTime;
43 61  
44 62 @Schema(description = "合同金额", example = "5617")
  63 + @ExcelProperty("合同金额")
45 64 private Integer price;
46 65  
47 66 @Schema(description = "整单折扣")
  67 + @ExcelProperty("整单折扣")
48 68 private Integer discountPercent;
49 69  
50 70 @Schema(description = "产品总金额", example = "19510")
  71 + @ExcelProperty("产品总金额")
51 72 private Integer productPrice;
52 73  
53 74 @Schema(description = "联系人编号", example = "18546")
  75 + @ExcelProperty("联系人编号")
54 76 private Long contactId;
55 77  
56 78 @Schema(description = "公司签约人", example = "14036")
  79 + @ExcelProperty("公司签约人")
57 80 private Long signUserId;
58 81  
59 82 @Schema(description = "最后跟进时间")
  83 + @ExcelProperty("最后跟进时间")
  84 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
60 85 private LocalDateTime contactLastTime;
61 86  
62 87 @Schema(description = "备注", example = "你猜")
  88 + @ExcelProperty("备注")
63 89 private String remark;
64 90  
65 91 @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  92 + @ExcelProperty("创建时间")
  93 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
66 94 private LocalDateTime createTime;
67 95  
68 96 @Schema(description = "创建人", example = "25682")
  97 + @ExcelProperty("创建人")
69 98 private String creator;
70 99  
71 100 @Schema(description = "创建人名字", example = "test")
  101 + @ExcelProperty("创建人名字")
72 102 private String creatorName;
73 103  
74 104 @Schema(description = "客户名字", example = "test")
  105 + @ExcelProperty("客户名字")
75 106 private String customerName;
76 107  
77 108 @Schema(description = "负责人", example = "test")
  109 + @ExcelProperty("负责人")
78 110 private String ownerUserName;
79 111  
80 112 @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  113 + @ExcelProperty("审批状态")
81 114 private Integer auditStatus;
82 115  
83 116 }
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImpl.java
... ... @@ -165,7 +165,7 @@ public class CrmClueServiceImpl implements CrmClueService {
165 165 // 1. 创建客户
166 166 CrmCustomerSaveReqVO customerSaveReqVO = BeanUtils.toBean(clue, CrmCustomerSaveReqVO.class).setId(null);
167 167 Long customerId = customerService.createCustomer(customerSaveReqVO, userId);
168   - // TODO @puhui999:如果有跟进记录,需要一起转过去;
  168 + // TODO @puhui999:如果有跟进记录,需要一起转过去;提问:艿艿这里是复制线索所有的跟进吗?还是直接把线索相关的跟进 bizType、bizId 全改为关联客户?
169 169 // 2. 更新线索
170 170 clueMapper.updateById(new CrmClueDO().setId(clue.getId())
171 171 .setTransformStatus(Boolean.TRUE).setCustomerId(customerId));
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
... ... @@ -235,8 +235,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService {
235 235 // 3. 删除负责人数据权限
236 236 permissionService.deletePermission(CrmBizTypeEnum.CRM_CUSTOMER.getType(), customer.getId(),
237 237 CrmPermissionLevelEnum.OWNER.getLevel());
238   - // TODO @puhui999:联系人的负责人,也要设置为 null;这块和领取是对应的;因为领取后,负责人也要关联过来;
239   - // 提问:那是不是可以这样理解客户所有联系人的负责人默认为客户的负责人,然后添加客户团队成员时才存在“同时分配给”的操作?
  238 + // 联系人的负责人,也要设置为 null;这块和领取是对应的;因为领取后,负责人也要关联过来;
240 239 contactService.updateOwnerUserIdByCustomerId(customer.getId(), null);
241 240  
242 241 // 记录操作日志上下文
... ...