CrmContract.java 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. package org.dromara.crm.domain;
  2. import com.baomidou.mybatisplus.annotation.*;
  3. import lombok.Data;
  4. import lombok.EqualsAndHashCode;
  5. import org.dromara.common.tenant.core.TenantEntity;
  6. import java.io.Serial;
  7. import java.math.BigDecimal;
  8. import java.time.LocalDate;
  9. import java.time.LocalDateTime;
  10. /**
  11. * CRM合同对象 crm_contract
  12. *
  13. * @author AI Assistant
  14. * @date 2025-10-04
  15. */
  16. @Data
  17. @EqualsAndHashCode(callSuper = true)
  18. @TableName("crm_contract")
  19. public class CrmContract extends TenantEntity {
  20. @Serial
  21. private static final long serialVersionUID = 1L;
  22. /**
  23. * 主键ID
  24. */
  25. @TableId(value = "id", type = IdType.ASSIGN_ID)
  26. private Long id;
  27. /**
  28. * 合同编号(SX/X-JT+yyyyMMdd+3位流水号,示例:SX/X-JT20250926002)
  29. */
  30. private String contractNo;
  31. /**
  32. * 合同名称
  33. */
  34. private String contractName;
  35. /**
  36. * 客户ID
  37. */
  38. private Long customerId;
  39. /**
  40. * 客户名称(冗余字段)
  41. */
  42. private String customerName;
  43. /**
  44. * 商机ID
  45. */
  46. private Long opportunityId;
  47. /**
  48. * 报价单ID
  49. */
  50. private Long quoteId;
  51. /**
  52. * 原合同ID(续签时关联)
  53. */
  54. private Long parentContractId;
  55. /**
  56. * 续签次数
  57. */
  58. private Integer renewalCount;
  59. /**
  60. * 合同模板ID
  61. */
  62. private Long templateId;
  63. /**
  64. * 合同模版(shanxia-山峡模版/customer-客户模版)
  65. */
  66. private String contractTemplate;
  67. /**
  68. * 联系人ID
  69. */
  70. private Long contactId;
  71. /**
  72. * 联系人姓名(冗余字段)
  73. */
  74. private String contactName;
  75. /**
  76. * 联系人手机(冗余字段)
  77. */
  78. private String contactMobile;
  79. /**
  80. * 合同类型(sale-销售合同/service-服务合同/lease-租赁合同/other-其他)
  81. */
  82. private String contractType;
  83. /**
  84. * 合同性质(new-新签/renewal-续签/change-变更)
  85. */
  86. private String contractNature;
  87. /**
  88. * 合同金额
  89. */
  90. private BigDecimal amount;
  91. /**
  92. * 币种(CNY-人民币/USD-美元/EUR-欧元)
  93. */
  94. private String currency;
  95. /**
  96. * 税率(%)
  97. */
  98. private BigDecimal taxRate;
  99. /**
  100. * 含税金额
  101. */
  102. private BigDecimal amountWithTax;
  103. /**
  104. * 签订日期
  105. */
  106. private LocalDate signDate;
  107. /**
  108. * 实际签订日期
  109. */
  110. private LocalDate actualSignDate;
  111. /**
  112. * 开始日期
  113. */
  114. private LocalDate startDate;
  115. /**
  116. * 结束日期
  117. */
  118. private LocalDate endDate;
  119. /**
  120. * 合同期限(月)
  121. */
  122. private Integer contractPeriod;
  123. /**
  124. * 合同状态(draft-草稿/approving-审批中/approved-已审批/executing-执行中/finished-已完成/invalid-已作废)
  125. */
  126. private String status;
  127. /**
  128. * 履约状态(normal-正常/delayed-延期/abnormal-异常/completed-已完成)
  129. */
  130. private String performanceStatus;
  131. /**
  132. * 履约完成度(%)
  133. */
  134. private BigDecimal performanceRate;
  135. /**
  136. * 客户满意度(1-5星)
  137. */
  138. private Integer customerSatisfaction;
  139. /**
  140. * 审批状态(pending-待审批/approved-已通过/rejected-已驳回)
  141. */
  142. private String approvalStatus;
  143. /**
  144. * 审批流程ID(关联工作流)
  145. */
  146. private Long approvalFlowId;
  147. /**
  148. * 合同文件路径(扫描件或电子版)
  149. */
  150. private String contractFile;
  151. /**
  152. * 附件文件(多个文件用逗号分隔)
  153. */
  154. private String attachmentFiles;
  155. /**
  156. * 负责人ID
  157. */
  158. private Long ownerUserId;
  159. /**
  160. * 负责人姓名(冗余字段)
  161. */
  162. private String ownerUserName;
  163. /**
  164. * 已回款金额
  165. */
  166. private BigDecimal receivedAmount;
  167. /**
  168. * 未回款金额
  169. */
  170. private BigDecimal unreceivedAmount;
  171. /**
  172. * 已开票金额
  173. */
  174. private BigDecimal invoiceAmount;
  175. /**
  176. * 未开票金额
  177. */
  178. private BigDecimal uninvoiceAmount;
  179. /**
  180. * 甲方(客户方)
  181. */
  182. private String partyA;
  183. /**
  184. * 甲方地址
  185. */
  186. private String partyAAddress;
  187. /**
  188. * 甲方联系人
  189. */
  190. private String partyAContact;
  191. /**
  192. * 甲方联系电话
  193. */
  194. private String partyAMobile;
  195. /**
  196. * 甲方法定代表人
  197. */
  198. private String partyALegalPerson;
  199. /**
  200. * 甲方代理人
  201. */
  202. private String partyAAgent;
  203. /**
  204. * 甲方电话/传真
  205. */
  206. private String partyAPhoneFax;
  207. /**
  208. * 甲方开户银行
  209. */
  210. private String partyABank;
  211. /**
  212. * 甲方银行账号
  213. */
  214. private String partyAAccount;
  215. /**
  216. * 供方主体ID(关联crm_supplier_info表)
  217. */
  218. private Long supplierId;
  219. /**
  220. * 结算方式(arrive_payment-货到付款/advance_payment-款到发货)
  221. */
  222. private String settlementMethod;
  223. /**
  224. * 乙方(我方)
  225. */
  226. private String partyB;
  227. /**
  228. * 乙方地址
  229. */
  230. private String partyBAddress;
  231. /**
  232. * 乙方联系人
  233. */
  234. private String partyBContact;
  235. /**
  236. * 乙方联系电话
  237. */
  238. private String partyBMobile;
  239. /**
  240. * 乙方法定代表人
  241. */
  242. private String partyBLegalPerson;
  243. /**
  244. * 乙方代理人
  245. */
  246. private String partyBAgent;
  247. /**
  248. * 乙方电话/传真
  249. */
  250. private String partyBPhoneFax;
  251. /**
  252. * 乙方开户银行
  253. */
  254. private String partyBBank;
  255. /**
  256. * 乙方银行账号
  257. */
  258. private String partyBAccount;
  259. /**
  260. * 付款条款
  261. */
  262. private String paymentTerms;
  263. /**
  264. * 交付条款
  265. */
  266. private String deliveryTerms;
  267. /**
  268. * 合同条款
  269. */
  270. private String contractTerms;
  271. /**
  272. * 作废原因
  273. */
  274. private String invalidReason;
  275. /**
  276. * 作废时间
  277. */
  278. private LocalDateTime invalidTime;
  279. /**
  280. * 逻辑删除标志(0存在 1删除)
  281. */
  282. @TableLogic
  283. private Integer delFlag;
  284. /**
  285. * 版本号
  286. */
  287. @Version
  288. private Integer version;
  289. /**
  290. * 合同模板内容(富文本HTML)
  291. */
  292. private String templateContent;
  293. /**
  294. * 第五条结算方式草稿(按结算方式区分的JSON)
  295. */
  296. private String settlementClauseDrafts;
  297. /**
  298. * 备注
  299. */
  300. private String remark;
  301. }