trade.jdl 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. /** 账户类型 */
  2. enum UserType {
  3. ENTERPRISE ("企业"),
  4. PERSONAL ("个人"),
  5. GOVERNMENT("政府"),
  6. ORGANIZATION ("组织"),
  7. PLATFORM ("平台")
  8. }
  9. /** 审核状态 */
  10. enum AuditStatus {
  11. PENDING ("待审核"),
  12. PASSED ("已通过"),
  13. UNPASSED ("未通过")
  14. }
  15. /** 评价状态 */
  16. enum JudgeStatus {
  17. PENDING ("待评价"),
  18. PASSED ("已评价")
  19. }
  20. /** 实名认证状态 */
  21. enum VerifiedStatus {
  22. PENDING ("待认证"),
  23. VERIFYING ("认证中"),
  24. PASSED ("已通过"),
  25. UNPASSED ("未通过")
  26. }
  27. /** 机构类型 */
  28. enum InstitutionType {
  29. PERFORM("履约机构"),
  30. UNPERFORM("非履约机构"),
  31. SINKTRADE("项目减排业主")
  32. }
  33. /** 个人认证方式 */
  34. enum AuthType {
  35. FACE("人脸识别"),
  36. IVS("三要素"),
  37. BANK("银行卡")
  38. }
  39. /** 角色 */
  40. entity Role(sys_role) {
  41. code String required unique /** 角色编码 */
  42. name String required unique /** 角色名称 */
  43. systemed Boolean required /** 是否为系统角色 */
  44. }
  45. /** 账户 */
  46. entity User(sys_user) {
  47. login String /** 用户名 */
  48. password String required /** 密码 */
  49. roleCode String required /** 角色编码 */
  50. name String /** 企业/个人名称 */
  51. refId Long /** 账户关联id, 平台为null */
  52. userType UserType required /** 账户类型 */
  53. phone String required /** 手机号码 */
  54. email String /** 企业/个人邮箱 */
  55. auditStatus AuditStatus /** 审核状态 */
  56. registApplyTime ZonedDateTime required /** 注册申请时间 */
  57. registAuditTime ZonedDateTime /** 注册审核时间 */
  58. auditUnpassedReason String /** 注册审核未通过原因 */
  59. freezed Boolean required /** 是否已冻结 */
  60. freezedReason String /** 冻结原因 */
  61. verifiedStatus VerifiedStatus /** 实名认证状态 */
  62. verifyUnpassedReason String /** 实名认证未通过原因 */
  63. authId String /** 实名认证链接申请id */
  64. authUrl String /** 实名认证链接申请Url */
  65. disclaimerId String /** 免责声明链接申请id */
  66. disclaimerSigned Boolean /** 免责声明是否签署 */
  67. authHasPassed Boolean /** 是否曾认证成功 */
  68. disclaimerDocId String /** 免责文档id */
  69. storeId Long /** 店铺信息ID */
  70. depositPaid Boolean /** 是否已缴纳保证金 */
  71. }
  72. /** 企业账户 */
  73. entity Enterprise(usr_enterprise) {
  74. userType UserType /** 账户类型 */
  75. roleCode String required /** 角色编码 */
  76. auditStatus AuditStatus /** 审核状态 */
  77. registApplyTime ZonedDateTime /** 注册申请时间 */
  78. registAuditTime ZonedDateTime /** 注册审核时间 */
  79. auditUnpassedReason String /** 注册审核未通过原因 */
  80. greenQualification TextBlob /** 绿色资质json文件 */ // -- 绿色
  81. name String /** 申请单位名称 */
  82. phone String /** 联系人手机号 */
  83. email String /** 联系人邮箱 */
  84. judgeStatus JudgeStatus /** 评价状态 */ // -- 绿色
  85. judgeLevel Integer /** 评价等级 */ // -- 绿色
  86. storeId Long /** 店铺id */
  87. institutionType InstitutionType /** 机构类型 */
  88. registAddress String /** 企业注册地(省市) */
  89. address String /** 企业地址 */
  90. registMoney Integer /** 注册资本(万元) */
  91. legalPerson String /** 企业法人 */
  92. creditCode String /** 统一社会信用代码 */
  93. license String /** 企业营业执照 */
  94. businessScope String maxlength(1000) /** 经营范围 */
  95. contactPerson String /** 联系人 */
  96. zipCode String /** 邮编 */
  97. landLine String /** 座机 */
  98. fax String /** 传真 */
  99. website String /** 网址 */
  100. }
  101. /** 个人账户 */
  102. entity Personal(usr_personal) {
  103. userType UserType /** 账户类型 */
  104. roleCode String required /** 角色编码 */
  105. auditStatus AuditStatus /** 审核状态 */
  106. registApplyTime ZonedDateTime /** 注册申请时间 */
  107. registAuditTime ZonedDateTime /** 注册审核时间 */
  108. auditUnpassedReason String /** 注册审核未通过原因 */
  109. storeId Long /** 店铺id */
  110. name String required /** 姓名 */
  111. phone String required /** 手机号 */
  112. email String /** 邮箱 */
  113. idCardNumber String /** 身份证号 */
  114. address String /** 详细地址 */
  115. areaCode String /** 省市区code, 仅存区code即可 */
  116. areaName String /** 省市区名称 */
  117. idCardFront String /** 身份证原件(正面) */
  118. idCardBack String /** 身份证原件(反面) */
  119. bankCardNo String /** 银行卡号 */
  120. bankPhone String /** 银行预留手机号 */
  121. authType String /** 认证选择方式 FACE-人脸; IVS-手机号; BANK-银行卡号 */
  122. }
  123. /** 银行账户 */
  124. entity BankAccount(usr_bank_account) {
  125. userId Long required /** 账户ID */
  126. accountName String required /** 户名 */
  127. accountNumber String required /** 卡号 */
  128. issuingBank String required /** 开户行 */
  129. interBankNumber String required /** 联行号 */
  130. issuingAddress String required /** 开户地 */
  131. defaultFlag Boolean required /** 是否为默认账户 */
  132. }
  133. /** 电子签章记录 */
  134. entity EsignLog(sys_esign_log) {
  135. esignType EsignType required /** 业务类型 */
  136. orderNumber String /** 订单编号 */
  137. callerId String required /** 业务发起人ID */
  138. caller String required /** 业务发起人 */
  139. callTime ZonedDateTime required /** 业务发起时间 */
  140. succeed Boolean required /** 签章状态 */
  141. requestParam TextBlob /** 请求参数 */
  142. responseData TextBlob /** 返回数据 */
  143. }
  144. /** 电子签章业务类型 */
  145. enum EsignType {
  146. REGIST ("注册"),
  147. SIGN ("签章"),
  148. BACK ("契约锁回调")
  149. }
  150. /** 银行交易记录 */
  151. entity BankLog(sys_bank_log) {
  152. bankLogType BankLogType required /** 业务类型 */
  153. orderNumber String required /** 订单编号 */
  154. payerId String required /** 付款人ID */
  155. payer String required /** 付款人 */
  156. callTime ZonedDateTime required /** 业务发起时间 */
  157. payerBank String /** 付款银行 */
  158. payerAccount String /** 付款账户 */
  159. amount BigDecimal /** 付款金额 */
  160. payeeId String /** 收款人ID */
  161. payee String /** 收款人 */
  162. payeeBank String /** 收款银行 */
  163. payeeAccount String /** 收款账户 */
  164. succeed Boolean required /** 交易状态 */
  165. requestParam TextBlob /** 请求参数 */
  166. responseData TextBlob /** 返回数据 */
  167. }
  168. /** 银行交易业务类型 */
  169. enum BankLogType {
  170. PAY_MARGIN ("支付保证金"),
  171. PAY_FINAL ("支付尾款"),
  172. PAY_LOAN ("平台放款"),
  173. DEFAULT_DEDUCTION ("违约扣款")
  174. }
  175. /** 短信发送记录 */
  176. entity SmsLog(sys_sms_log) {
  177. smsLogType SmsLogType required /** 业务类型 */
  178. orderNumber String /** 订单编号 */
  179. caller String required /** 业务发起人 */
  180. callTime ZonedDateTime required /** 业务发起时间 */
  181. templateCode String required /** 模板编码 */
  182. phoneNumber String required /** 手机号码 */
  183. succeed Boolean required /** 发送状态 */
  184. requestParam TextBlob /** 请求参数 */
  185. responseData TextBlob /** 返回数据 */
  186. }
  187. /** 短信发送业务类型 */
  188. enum SmsLogType {
  189. COOPERATION("合作留言"),
  190. CODE_MESSAGE("发送验证码"),
  191. SYS_REGIST_PASSED("系统添加用户"),
  192. REGIST_PASSED("商家通过入驻审核"),
  193. REGIST_UNPASSED("商家未通过入驻审核"),
  194. ACCOUNT_FREEZED("冻结账户"),
  195. ACCOUNT_UNFREEZED("解除冻结账户"),
  196. ACCOUNT_RESET("重置密码"),
  197. REGIST_BUYER("买家注册")
  198. }
  199. /** 新闻动态 */
  200. entity News(biz_news) {
  201. title String required /** 标题 */
  202. newsType NewsType required /** 类型 */
  203. content TextBlob required /** 内容 */
  204. linkUrl String /** 访问链接 */
  205. publishTime ZonedDateTime /** 发布时间 */
  206. published Boolean required /** 发布状态 */
  207. }
  208. /** 新闻动态类型 */
  209. enum NewsType {
  210. ENTERPRISE_NEWS ("企业新闻"),
  211. TRADE_NEWS ("交易动态"),
  212. MARKET_PRICE ("市场行情"),
  213. SYSTEM_NOTIFICATION ("系统公告")
  214. }
  215. /** 项目类型 */
  216. enum ProjectType {
  217. CCER ("CCER"),
  218. VCS ("VCS"),
  219. TANPH ("碳普惠")
  220. }
  221. /** 项目状态 */
  222. enum ProjectStatus {
  223. UN_SALE ("未上架"),
  224. ON_SALE_AUDIT ("上架中"),
  225. ON_SALE ("已上架"),
  226. OFF_SALE ("已下架")
  227. }
  228. /** 项目 */
  229. entity Project(biz_project) {
  230. projectOwnerId Long required /** 项目业主ID */
  231. name String required /** 项目名称 */
  232. code String required /** 项目编码 */
  233. type ProjectType required /** 项目类型 */
  234. sinType String required /** 碳汇种类: 农业|林业|海洋|生物质|红树林|其他 */
  235. price BigDecimal required /** 单价(元/吨) */
  236. totalCarbonSink BigDecimal required /** 总碳汇量(吨) */
  237. soldCarbonSink BigDecimal required /** 已售碳汇量(吨) */
  238. remainingCarbonSink BigDecimal required /** 剩余碳汇量(吨) */
  239. ptBizUserId Long /** 平台业务员ID */
  240. province String required /** 项目所在省份 */
  241. projectArea BigDecimal required /** 项目面积(公顷) */
  242. projectedEmiReduction BigDecimal required /** 项目计入期内预计减排量(万吨) */
  243. averageEmiReduction BigDecimal required /** 年均减排量(万吨) */
  244. startTime ZonedDateTime required /** 项目开始时间 */
  245. endTime ZonedDateTime required /** 项目结束时间 */
  246. monitorTimes String required /** 碳汇成熟年份 */
  247. methodology String required /** 方法学编号 */
  248. methodologyName String required /** 方法学名称 */
  249. issuingAgency String required /** 减排量签发机构 */
  250. displayOrder Integer required /** 项目展示顺序 */
  251. shopDisplayOrder Integer required /** 项目店铺内展示顺序 */
  252. slogan String required /** 项目标语 */
  253. overviewTitle String required /** 项目简介-标题 */
  254. overviewContent TextBlob required /** 项目简介-正文 */
  255. storyTitle String required /** 项目故事-标题 */
  256. storyContent TextBlob required /** 项目故事-正文 */
  257. storyEnding TextBlob required /** 项目故事-结尾 */
  258. storyImage String required /** 项目故事-图片 */
  259. images TextBlob required /** 项目图片 */
  260. longitude Long required /** 项目位置(经度) */
  261. latitude Long required /** 项目位置(纬度) */
  262. circle TextBlob /** 项目的地图圈 */
  263. projectFiles TextBlob required /** 项目文件 */
  264. projectStatus ProjectStatus required /** 项目状态 */
  265. bizAuditFlag Boolean /** 上架中时业务员是否审批 */
  266. creator String required /** 录入人名称 */
  267. createTime ZonedDateTime required /** 录入时间 */
  268. highQuality Boolean required /** 是否优质项目 */
  269. }
  270. /** 项目快照 */
  271. entity ProjectSnapshot(biz_project_snapshot) {
  272. projectOwnerId Long required /** 项目业主ID */
  273. projectId Long required /** 项目ID */
  274. name String required /** 项目名称 */
  275. code String required /** 项目编码 */
  276. type ProjectType required /** 项目类型 */
  277. sinType String required /** 碳汇种类: 农业|林业|海洋|生物质|红树林|其他 */
  278. price BigDecimal required /** 单价(元/吨) */
  279. totalCarbonSink BigDecimal required /** 总碳汇量(吨) */
  280. soldCarbonSink BigDecimal required /** 已售碳汇量(吨) */
  281. remainingCarbonSink BigDecimal required /** 剩余碳汇量(吨) */
  282. ptBizUserId Long /** 平台业务员ID */
  283. province String required /** 项目所在省份 */
  284. projectArea BigDecimal required /** 项目面积(公顷) */
  285. projectedEmiReduction BigDecimal required /** 项目计入期内预计减排量(万吨) */
  286. averageEmiReduction BigDecimal required /** 年均减排量(万吨) */
  287. startTime ZonedDateTime required /** 项目开始时间 */
  288. endTime ZonedDateTime required /** 项目结束时间 */
  289. monitorTimes String required /** 碳汇成熟年份 */
  290. methodology String required /** 方法学编号 */
  291. methodologyName String required /** 方法学名称 */
  292. issuingAgency String required /** 减排量签发机构 */
  293. displayOrder Integer required /** 项目展示顺序 */
  294. shopDisplayOrder Integer required /** 项目店铺内展示顺序 */
  295. slogan String required /** 项目标语 */
  296. overviewTitle String required /** 项目简介-标题 */
  297. overviewContent TextBlob required /** 项目简介-正文 */
  298. storyTitle String required /** 项目故事-标题 */
  299. storyContent TextBlob required /** 项目故事-正文 */
  300. storyEnding TextBlob required /** 项目故事-结尾 */
  301. storyImage String required /** 项目故事-图片 */
  302. images TextBlob required /** 项目图片 */
  303. longitude Long required /** 项目位置(经度) */
  304. latitude Long required /** 项目位置(纬度) */
  305. circle TextBlob /** 项目的地图圈 */
  306. projectFiles TextBlob required /** 项目文件 */
  307. projectStatus ProjectStatus required /** 项目状态 */
  308. bizAuditFlag Boolean /** 上架中时业务员是否审批 */
  309. creator String required /** 录入人名称 */
  310. createTime ZonedDateTime required /** 录入时间 */
  311. highQuality Boolean required /** 是否优质项目 */
  312. }
  313. /** 购物车 */
  314. entity ShoppingCart(biz_cart) {
  315. buyerId Long required unique /** 买方ID */
  316. projectInfo TextBlob required /** 采购明细 */
  317. }
  318. /** 订单状态 */
  319. enum OrderStatus {
  320. UNCONFIRMED("待确认"),
  321. FINISHED("已完成")
  322. }
  323. /** 订单 */
  324. entity Order(biz_order) {
  325. orderNumber String required unique /** 订单编号 */
  326. projectSnapshotId Long required /** 项目快照ID */
  327. price BigDecimal required /** 单价(元/吨) */
  328. amount BigDecimal required /** 数量(吨) */
  329. totalPrice BigDecimal required /** 总价(元) */
  330. earnest BigDecimal required /** 意向金(元) */
  331. sellerId Long required /** 卖方ID */
  332. sellerName String required /** 卖方name */
  333. buyerId Long required /** 买方ID */
  334. buyerName String required /** 买方name */
  335. orderStatus OrderStatus required /** 订单状态 */
  336. createTime ZonedDateTime required /** 创建时间 */
  337. confirmTime ZonedDateTime /** 确认时间 */
  338. finishTime ZonedDateTime /** 完成时间 */
  339. sellerRated Boolean required /** 卖方评价状态 */
  340. sellerRatedTime ZonedDateTime /** 卖方评价时间 */
  341. sellerRatedInfo TextBlob /** 卖方评价信息 */
  342. buyerRated Boolean required /** 买方评价状态 */
  343. buyerRatedTime ZonedDateTime /** 买方评价时间 */
  344. buyerRatedInfo TextBlob /** 买方评价信息 */
  345. receiptInfo TextBlob /** 交易回执单信息 */
  346. receiptContractId String /** 回执单合同ID */
  347. receiptDocumentId String /** 回执单合同ID */
  348. }
  349. /** 登录日志 */
  350. entity SysLoginLog {
  351. userId Long /** 用户ID */
  352. login String /** 登录账号 */
  353. ip String /** 来源IP */
  354. loginTime Instant /** 登录时间 */
  355. success Boolean /** 是否登录成功 */
  356. }
  357. /** 联系我们 */
  358. entity Cooperation(biz_cooperation) {
  359. consultingType String required /** 咨询类型 */
  360. name String required /** 联系人 */
  361. companyName String required /** 公司名称 */
  362. phoneNumber String required /** 联系电话 */
  363. email String /** 电子邮箱 */
  364. otherRequirement TextBlob /** 其他需求 */
  365. messageTime ZonedDateTime /** 留言时间 */
  366. }
  367. /*
  368. * ---------- Stage 2 ------------
  369. * @Date 230330
  370. * @ApiNote Stage 2 , Modify
  371. * @author czz
  372. */
  373. /** 店铺信息 */
  374. entity Shop(shop) {
  375. name String required unique /** 店铺名称 notNull */
  376. slogan String /** 店铺标语 */
  377. logo String /** 店铺logo */
  378. banner String /** 店铺横幅 */
  379. ownerId Long /** 业主id(UserId) */
  380. userType UserType /** 卖家用户类型 */
  381. createTime ZonedDateTime /** 首次开店时间 */
  382. refId Long /** 关联信息id(企业|政府|个人) */
  383. }
  384. /** 浏览历史足迹 */
  385. entity VisitTrack(visit_track) {
  386. visitTime ZonedDateTime /** 浏览时间 */
  387. visitDate LocalDate /** 浏览日期 */
  388. shopId Long /** 店铺id */
  389. shopName String /** 店铺名称 */
  390. projectId Long /** 项目ID */
  391. projectName String /** 项目名称 */
  392. type String /** 类型: 1-店铺|2-项目 */
  393. userId Long /** 所属用户id */
  394. visitCount Integer /** 当日访问次数 */
  395. }
  396. /** 收藏 */
  397. entity ShoppingCollection(shopping_collection) {
  398. collectTime ZonedDateTime /** 浏览时间 */
  399. collectDate LocalDate /** 浏览日期 */
  400. shopId Long /** 店铺id */
  401. shopName String /** 店铺名称 */
  402. projectId Long /** 项目ID */
  403. projectName String /** 项目名称 */
  404. type String /** 类型: 1-店铺|2-项目 */
  405. userId Long /** 所属用户id */
  406. }
  407. /** 验证码 */
  408. entity VerificationCode(verification_code) {
  409. sendTime ZonedDateTime /** 发送时间 */
  410. expiredTime ZonedDateTime /** 到期时间 */
  411. phone String /** 手机号 */
  412. code String /** 验证码 */
  413. type String /** 验证码类型(注册校验-signUp|登录校验-signIn|更改校验-edit|查看入驻审核进度校验-checkAudit) */
  414. used Boolean /** 验证码是否已被使用 */
  415. }
  416. /** 微信支付记录 */
  417. entity WechatPayRecord(wechat_pay_record) {
  418. payTime ZonedDateTime required /** 支付时间 */
  419. outTradeNo String required unique /** 订单号 */
  420. orderInfo TextBlob required /** 订单信息 */
  421. notifyId String /** 通知ID */
  422. notifyTime ZonedDateTime /** 回调时间 */
  423. transactionId String /** 微信支付订单号 */
  424. tradeType String /** 交易类型 */
  425. tradeState String /** 交易状态 */
  426. tradeStateDesc String /** 交易状态描述 */
  427. successTime ZonedDateTime /** 支付成功时间 */
  428. version Integer /** 乐观锁 */
  429. }
  430. /**
  431. relationship OneToMany {
  432. User to BankAccount
  433. User to Project
  434. User to Order
  435. ShoppingCart to Project
  436. }
  437. relationship OneToOne {
  438. User to Role
  439. User to Enterprise
  440. User to Personal
  441. User to ShoppingCart
  442. ProjectSnapshot to Order
  443. }
  444. */