config.go 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. package main
  2. import (
  3. "time"
  4. )
  5. type GlobalConf struct {
  6. Mongob MgoConf
  7. Cron CronConf
  8. Mongop MgoConf
  9. Mysql MysqlConf
  10. Log Log
  11. Mongospider MgoConf
  12. Email EmailConf
  13. Clickhouse CkConf
  14. }
  15. type MgoConf struct {
  16. Host string
  17. DB string
  18. Coll string // 查询表
  19. Username string
  20. Password string
  21. Size int
  22. }
  23. // CronConf 定时任务
  24. type CronConf struct {
  25. Spec string
  26. Url string
  27. Start int
  28. End int
  29. Delete int
  30. }
  31. type CkConf struct {
  32. Host string
  33. Username string
  34. Password string
  35. DB string
  36. }
  37. type MysqlConf struct {
  38. Address string
  39. Dbname string
  40. Dbname2 string
  41. Dbname3 string
  42. Username string
  43. Password string
  44. Table string
  45. Table2 string
  46. Table3 string
  47. Table4 string
  48. Table5 string
  49. Table6 string
  50. Table7 string
  51. Stime string
  52. Etime string
  53. Test bool
  54. }
  55. type Log struct {
  56. LogPath string
  57. MaxSize int
  58. Compress bool
  59. MaxAge int
  60. MaxBackups int
  61. LogLevel string
  62. Format string
  63. }
  64. type EmailConf struct {
  65. Api string
  66. To string
  67. }
  68. // DataexportOrder 原来的订单表
  69. type DataexportOrder struct {
  70. ID int `gorm:"primaryKey"` // 自增 ID
  71. OrderCode string `gorm:"column:order_code"` // 订单编号
  72. PayMoney int `gorm:"column:pay_money"` // 支付金额,精确到分
  73. OrderMoney int `gorm:"column:order_money"` // 订单金额,精确到分
  74. UserNickname string `gorm:"column:user_nickname"` // 昵称
  75. PayTime *time.Time `gorm:"column:pay_time"` // 支付时间
  76. OrderStatus int `gorm:"column:order_status"` // 订单状态 0:未支付 1:已支付 -1:逻辑删除 -2:已取消 -3:已退款
  77. CreateTime *time.Time `gorm:"column:create_time"` // 创建时间
  78. UserOpenid string `gorm:"column:user_openid"` // 用户 openid
  79. ServiceStatus uint `gorm:"column:service_status"` // 服务状态,1 已提供服务及已经下载,0 未服务
  80. ServiceTime *time.Time `gorm:"column:service_time"` // 服务时间
  81. Filter string `gorm:"column:filter"` // 筛选条件
  82. PrepayId string `gorm:"column:prepay_id"` // 预支付交易会话标识
  83. CodeUrl string `gorm:"column:code_url"` // 二维码地址
  84. OutTradeNo string `gorm:"column:out_trade_no"` // 商户订单号
  85. FilterKeys string `gorm:"column:filter_keys"` // 筛选条件,所有的关键词
  86. FilterPublishtime string `gorm:"column:filter_publishtime"` // 筛选条件,发布时间
  87. DataCount int `gorm:"column:data_count"` // 匹配到的数据总数
  88. UserMail string `gorm:"column:user_mail"` // 用户邮箱
  89. DataSpec string `gorm:"column:data_spec"` // 数据规格 1-标准字段包 2-高级字段包
  90. OriginalPrice int `gorm:"column:original_price"` // 原价,精确到分
  91. PrepayTime *time.Time `gorm:"column:prepay_time"` // 预订单生成时间
  92. ProductType string `gorm:"column:product_type"` // 订单类型 1-历史数据
  93. FilterID string `gorm:"column:filter_id"` // 过滤条件在 mongodb 中的 id
  94. PayWay string `gorm:"column:pay_way"` // 支付方式
  95. UserPhone string `gorm:"column:user_phone"` // 用户手机号
  96. ApplybillStatus int `gorm:"column:applybill_status"` // 0:默认未申请发票 1:申请发票 2:已开具
  97. DownloadUrl string `gorm:"column:download_url"` // 下载链接
  98. ApplybillType int `gorm:"column:applybill_type"` // 0:默认为个人 1:公司
  99. ApplybillTaxnum string `gorm:"column:applybill_taxnum"` // 公司申请发票-纳税人识别号
  100. ApplybillCompany string `gorm:"column:applybill_company"` // 公司申请发票 公司名称
  101. UserID string `gorm:"column:user_id"` // 用户 id
  102. RemindStatus int `gorm:"column:remind_status"` // 订单提醒 1-下单时间 2 小时提醒 2-剩余 2 小时自动关闭时再次提醒
  103. VipStarttime *time.Time `gorm:"column:vip_starttime"` // vip 订阅-开始时间
  104. VipEndtime *time.Time `gorm:"column:vip_endtime"` // vip 订阅-结束时间
  105. VipType int `gorm:"column:vip_type"` // vip 订阅-0:试用 1:续费 2:升级
  106. CourseStatus int `gorm:"column:course_status"` // 1:对公转账未上传凭证;2:对公转账审核中;3:对公转账审核未通过;4:对公转账审核通过(同时修改订单状态为已完成);5:退款审核中;6:已退款;(1,2,3 为订单未支付状态;4,5,6 为订单完成状态)
  107. ApplyRefundName string `gorm:"column:apply_refund_name"` // 退票申请人
  108. ApplyRefundReason string `gorm:"column:apply_refund_reason"` // 退票原因
  109. ApplyRefundTime int64 `gorm:"column:apply_refund_time"` // 退票时间
  110. DelStatus int `gorm:"column:del_status"` // 删除状态:0:未删除; 1:已删除
  111. DelTime *time.Time `gorm:"column:del_time"` // 删除时间
  112. DisWord string `gorm:"column:dis_word"` // 分销口令
  113. DiscountPrice int `gorm:"column:discount_price"` // 剑鱼折扣金额
  114. DRelationID string `gorm:"column:d_relation_id"` // 优惠关联 id;--用户领取卡卷的记录 id
  115. ReturnStatus int `gorm:"column:return_status"` // 回款状态,1-全额回款 2-部分回款 0-未回款
  116. RefundStatus int `gorm:"column:refund_status"` // 退款状态,1-全额退款 2-部分退款 0-未退款
  117. IsBackstageOrder int `gorm:"column:is_backstage_order"` // 是否后台创建订单,1-是 0-不是
  118. Salesperson string `gorm:"column:salesperson"` // 销售人员
  119. CompanyName string `gorm:"column:company_name"` // 公司名称
  120. BillingMode int `gorm:"column:billingMode"` // 计费模式:0-免费、1-收费
  121. SaleTime *time.Time `gorm:"column:sale_time"` // 销售时间
  122. Commission int `gorm:"column:commission"` // 佣金(单位分)
  123. ProceduresMoney int `gorm:"column:procedures_money"` // 手续费(单位分)
  124. OrderChannel string `gorm:"column:order_channel"` // 下单渠道
  125. DistributionChannel string `gorm:"column:distribution_channel"` // 销售渠道
  126. SalespersonID string `gorm:"column:salesperson_id"` // 销售人员在剑鱼后台的用户 id
  127. CreatePerson string `gorm:"column:create_person"` // 创建人
  128. LastUpdatePerson string `gorm:"column:last_update_person"` // 最近一次更新人
  129. LastUpdateTime *time.Time `gorm:"column:last_update_time"` // 最近一次更新时间
  130. SigningSubject string `gorm:"column:signing_subject"` // 签约主体
  131. ExpirationTime *time.Time `gorm:"column:expiration_time"` // 到期时间 (活动有效)
  132. AuditStatus int `gorm:"column:audit_status"` // 审核状态 0:待提交 1:待审核 2:审核中 3:审核通过
  133. BuySubject int `gorm:"column:buy_subject"` // 购买主体;1:个人 2:企业
  134. EntID int `gorm:"column:ent_id"` // 企业 id
  135. BuyCount int `gorm:"column:buy_count"` // 购买数量
  136. AutoUpdate *time.Time `gorm:"column:autoUpdate"` // 自动更新时间
  137. SaleDep string `gorm:"column:saleDep"` // 业绩归属部门
  138. SaleMoney string `gorm:"column:saleMoney"` // 销售业绩
  139. ContractNature int `gorm:"column:contract_nature"` // 合同性质
  140. }
  141. func (DataexportOrder) TableName() string {
  142. return "dataexport_order"
  143. }
  144. // DwdFAccountOrder 归集后的订单表
  145. type DwdFAccountOrder struct {
  146. ID int `gorm:"primaryKey"` // 自增 ID
  147. OrderCode string `gorm:"column:order_code"` // 订单编号
  148. SalerName string `gorm:"column:saler_name"` // 销售人员
  149. SalerDept string `gorm:"column:saler_dept"` // 部门
  150. CompanyName string `gorm:"column:company_name"` // 公司名称
  151. UserRegtime *time.Time `gorm:"column:user_regtime"` // 用户注册时间
  152. CreateTime *time.Time `gorm:"column:create_time"` // 订单创建时间
  153. ReturnTime *time.Time `gorm:"column:return_time"` // 回款时间
  154. SaleTime *time.Time `gorm:"column:sale_time"` // 业绩统计
  155. RefundTime *time.Time `gorm:"column:refund_time"` // 退款日期
  156. OriginalPrice int `gorm:"column:original_price"` // 标准售价
  157. ContractMoney int `gorm:"column:contract_money"` // 合同金额
  158. Commission int `gorm:"column:commission"` // 佣金
  159. ProceduresMoney int `gorm:"column:procedures_money"` // 手续费
  160. ReceivableAmount int `gorm:"column:receivable_amount"` // 应收金额
  161. TotalReceived int `gorm:"column:total_received"` // 累计已收
  162. ProductType string `gorm:"column:product_type"` // 产品类型
  163. DataSpec string `gorm:"column:data_spec"` // 规格
  164. OrderStatus string `gorm:"column:order_status"` // 订单状态
  165. ReturnStatus string `gorm:"column:return_status"` // 回款状态
  166. RefundStatus string `gorm:"column:refund_status"` // 退款状态
  167. VipType string `gorm:"column:vip_type"` // 付费类型
  168. UserPhone string `gorm:"column:user_phone"` // 手机号
  169. UserID string `gorm:"column:user_id"` // 用户 ID
  170. VipStarttime *time.Time `gorm:"column:vip_starttime"` // 服务开始时间
  171. VipEndtime *time.Time `gorm:"column:vip_endtime"` // 服务结束时间
  172. ContractStatus string `gorm:"column:contract_status"` // 合同状态
  173. ContractCode string `gorm:"column:contract_code"` // 合同编号
  174. ContractTime *time.Time `gorm:"column:contract_time"` // 合同时间
  175. SigningSubject string `gorm:"column:signing_subject"` // 签约主体
  176. OrderChannel string `gorm:"column:order_channel"` // 下单渠道
  177. DistributionChannel string `gorm:"column:distribution_channel"` // 销售渠道
  178. IsBackstageOrder string `gorm:"column:is_backstage_order"` // 是否是后台订单
  179. PayWay string `gorm:"column:pay_way"` // 付款方式
  180. Comeintime *time.Time `gorm:"column:comeintime;autoCreateTime"` // 入库时间
  181. Updatetime *time.Time `gorm:"column:updatetime;autoUpdateTime"` // 更新时间
  182. }
  183. func (DwdFAccountOrder) TableName() string {
  184. if GF.Mysql.Test {
  185. return "dwd_f_account_order_test"
  186. } else {
  187. return "dwd_f_account_order"
  188. }
  189. }
  190. // OrderSaleRecord 原来的业绩变更表
  191. type OrderSaleRecord struct {
  192. ID int `gorm:"primaryKey;autoIncrement"`
  193. Ordercode string `gorm:"column:ordercode;unique;comment:'订单编号'"`
  194. State int `gorm:"column:state;comment:'1 生效业绩,2:待生效业绩 -2:作废业绩 -1:历史业绩变更'"`
  195. SalerID int `gorm:"column:saler_Id;comment:'销售人员在剑鱼后台的用户 id'"`
  196. SalerName string `gorm:"column:saler_name;comment:'销售人员名字'"`
  197. SalerDept string `gorm:"column:saler_dept;comment:'销售部门'"`
  198. SalerDeptID int `gorm:"column:saler_dept_id;comment:'销售部门 id'"`
  199. Money int `gorm:"column:money;comment:'销售业绩,单位分'"`
  200. ChangeValue int `gorm:"column:change_value;comment:'变更值'"`
  201. GroupUUID string `gorm:"column:group_uuid;comment:'业绩组 id'"`
  202. LastGroupUUID string `gorm:"column:last_group_uuid;comment:'上次业绩组 id'"`
  203. ChangeReason string `gorm:"column:change_reason;comment:'变更原因'"`
  204. Operator string `gorm:"column:operator;comment:'操作人'"`
  205. DistributionChannel string `gorm:"column:distribution_channel"` // 销售渠道
  206. StatisticsTime *time.Time `gorm:"column:statistics_time;comment:'业绩统计时间'"`
  207. CreateTime *time.Time `gorm:"column:create_time;comment:'创建时间'"`
  208. AutoUpdate *time.Time `gorm:"column:autoUpdate;comment:'自动更新时间'"`
  209. }
  210. func (OrderSaleRecord) TableName() string {
  211. return "order_sale_record"
  212. }
  213. // DwdFUserbaseBaseinfo 剑鱼用户表-个人身份表
  214. type DwdFUserbaseBaseinfo struct {
  215. ID int `gorm:"primaryKey"`
  216. Uid string `gorm:"column:uid"`
  217. Userid string `gorm:"column:userid"`
  218. BaseUserID int `gorm:"column:base_user_id"`
  219. Name string `gorm:"column:name"`
  220. Nickname string `gorm:"column:nickname"`
  221. Province string `gorm:"column:province"`
  222. City string `gorm:"column:city"`
  223. CompanyName string `gorm:"column:company_name"`
  224. Phone string `gorm:"column:phone"`
  225. ISpush int `gorm:"column:i_ispush"`
  226. LRegistedate *time.Time `gorm:"column:l_registedate"`
  227. IAppid int `gorm:"column:i_appid"`
  228. Rsource string `gorm:"column:rsource"`
  229. SAppponetype string `gorm:"column:s_appponetype"`
  230. ISex int `gorm:"column:i_sex"`
  231. Email string `gorm:"column:email"`
  232. SMOpenid string `gorm:"column:s_m_openid"`
  233. AMOpenid string `gorm:"column:a_m_openid"`
  234. Unionid string `gorm:"column:unionid"`
  235. Status int `gorm:"column:status"`
  236. LogOffCause string `gorm:"column:log_off_cause"`
  237. LogOffTime *time.Time `gorm:"column:log_off_time"`
  238. Updatetime *time.Time `gorm:"column:updatetime"`
  239. Source string `gorm:"column:source"`
  240. Createtime *time.Time `gorm:"column:createtime"`
  241. SRegsource string `gorm:"column:s_regsource"`
  242. SSourceid string `gorm:"column:s_sourceid"`
  243. BelongTo string `gorm:"column:belong_to"`
  244. Remark string `gorm:"column:remark"`
  245. Shuoming string `gorm:"column:shuoming"`
  246. SPlatform string `gorm:"column:s_platform"`
  247. LoginPositionid int `gorm:"column:login_positionid"`
  248. ClueOperateStatus int `gorm:"column:clue_operate_status"`
  249. }
  250. func (DwdFUserbaseBaseinfo) TableName() string {
  251. return "dwd_f_userbase_baseinfo"
  252. }
  253. // DwdFUserbaseIdMapping 剑鱼用户表-企业身份
  254. type DwdFUserbaseIdMapping struct {
  255. ID int `gorm:"primaryKey"`
  256. Userid string `gorm:"column:userid"`
  257. BaseUserID int `gorm:"column:base_user_id"`
  258. PositionID int `gorm:"column:position_id"`
  259. Type int8 `gorm:"column:type"`
  260. AccountID int `gorm:"column:account_id"`
  261. EntID int `gorm:"column:ent_id"`
  262. AccountName string `gorm:"column:account_name"`
  263. PersonName string `gorm:"column:person_name"`
  264. Createtime *time.Time `gorm:"column:createtime"`
  265. Uid string `gorm:"column:uid"`
  266. Shuoming string `gorm:"column:shuoming"`
  267. }
  268. func (DwdFUserbaseIdMapping) TableName() string {
  269. return "dwd_f_userbase_id_mapping"
  270. }
  271. // ReturnMoneyRecord 回款记录表结构体
  272. type ReturnMoneyRecord struct {
  273. ID int `gorm:"primaryKey"` // 自增 id
  274. OrderCode string `gorm:"column:order_code"` // 订单编号
  275. ReturnTime *time.Time `gorm:"column:return_time"` // 回款时间
  276. ReturnMoney int `gorm:"column:return_money"` // 回款金额,单位:分
  277. ReturnType int `gorm:"column:return_type"` // 回款方式,1-微信 2-支付宝 3-对公转账
  278. ReturnRemark string `gorm:"column:return_remark"` // 回款说明/备注
  279. ReturnCode string `gorm:"column:return_code"` // 回款单号
  280. ReturnInvoiceStatus int `gorm:"column:return_invoice_status"` // 回款发票状态,0-未申请 1-已申请 2-已开具
  281. ReturnVoucherUrl string `gorm:"column:return_voucher_url"` // 回款凭证地址
  282. OperatePerson string `gorm:"column:operate_person"` // 操作人
  283. OperateTime *time.Time `gorm:"column:operate_time"` // 操作时间
  284. FlowMoney int `gorm:"column:flow_money"` // 流水金额
  285. BankName string `gorm:"column:bank_name"` // 银行名称
  286. BankFlow string `gorm:"column:bank_flow"` // 银行流水号
  287. OperateType int `gorm:"column:operate_type"` // 回款操作方式 1-手动回款 2-自动回款
  288. FlowType int `gorm:"column:flow_type"` // 流水方式 0cds 回款 1 手动录入
  289. PayAccountName string `gorm:"column:pay_account_name"` // 支付户名
  290. State int64 `gorm:"column:state"` // 回款状态 1 有效 0 无效
  291. AutoUpdate *time.Time `gorm:"column:autoUpdate"` // 自动更新时间
  292. }
  293. func (ReturnMoneyRecord) TableName() string {
  294. return "return_money_record"
  295. }
  296. // Contract 合同表结构体
  297. type Contract struct {
  298. ID int `gorm:"primaryKey"` // 自增 ID
  299. OrderCode string `gorm:"column:order_code"` // 订单编号
  300. CustomerName string `gorm:"column:customer_name"` // 客户名称
  301. ContractCode string `gorm:"column:contract_code"` // 协议编号
  302. ContractTime *time.Time `gorm:"column:contract_time"` // 协议签订时间
  303. ContractStatus int `gorm:"column:contract_status"` // 协议状态 1-已签协议 0-未签协议
  304. ContractMoney int `gorm:"column:contract_money"` // 合同金额 单位:分
  305. SealType int `gorm:"column:seal_type"` // 1:有电子章,2:无电子章
  306. PartyAType int `gorm:"column:partyA_type"` // 1:个人,2:企业
  307. PartyAName string `gorm:"column:partyA_name"` // 甲方名称
  308. PartyAPerson string `gorm:"column:partyA_person"` // 甲方联系人
  309. PartyATel string `gorm:"column:partyA_tel"` // 甲方联系方式
  310. PartyAAddress string `gorm:"column:partyA_address"` // 甲方地址
  311. PartyBPerson string `gorm:"column:partyB_person"` // 乙方联系人
  312. Remark string `gorm:"column:remark"` // 电子合同备注
  313. ContractFileURL string `gorm:"column:contract_file_url"` // 合同文件地址
  314. ContractArchiveStatus int `gorm:"column:contract_archive_status"` // 协议归档状态 0-未归档 1-已归档
  315. ContractArchiveTime *time.Time `gorm:"column:contract_archive_time"` // 协议归档时间
  316. ContractArchiveNum int `gorm:"column:contract_archive_num"` // 协议归档份数
  317. AutoUpdate *time.Time `gorm:"column:autoUpdate"` // 自动更新时间
  318. }
  319. func (Contract) TableName() string {
  320. return "contract"
  321. }
  322. // DwdFAccountOrderChange 归集后的-剑鱼业绩变更表结构体;
  323. type DwdFAccountOrderChange struct {
  324. ID int `gorm:"primaryKey"`
  325. OrderCode string `gorm:"column:order_code;not null;comment:'订单编号'"`
  326. SalerName string `gorm:"column:saler_name;comment:'销售人员'"`
  327. SalerDept string `gorm:"column:saler_dept;comment:'部门'"`
  328. CompanyName string `gorm:"column:company_name;comment:'公司名称'"`
  329. UserRegtime *time.Time `gorm:"column:user_regtime;comment:'用户注册时间'"`
  330. CreateTime *time.Time `gorm:"column:create_time;comment:'订单创建时间'"`
  331. SaleTime *time.Time `gorm:"column:sale_time;comment:'业绩统计时间'"`
  332. OriginalPrice int `gorm:"column:original_price;comment:'标准售价'"`
  333. ContractMoney int `gorm:"column:contract_money;comment:'合同金额'"`
  334. Commission int `gorm:"column:commission;comment:'佣金'"`
  335. ProceduresMoney int `gorm:"column:procedures_money;comment:'手续费'"`
  336. ReceivableAmount int `gorm:"column:receivable_amount;comment:'应收金额'"`
  337. ChangeValue int `gorm:"column:change_value;comment:'业绩变动额'"`
  338. ChangeReason string `gorm:"column:change_reason;comment:'变更类型'"`
  339. TotalReceived int `gorm:"column:total_received;comment:'累计已收'"`
  340. ProductType string `gorm:"column:product_type;comment:'产品类型'"`
  341. DataSpec string `gorm:"column:data_spec;comment:'规格'"`
  342. OrderStatus string `gorm:"column:order_status;comment:'订单状态'"`
  343. ReturnStatus string `gorm:"column:return_status;comment:'回款状态'"`
  344. RefundStatus string `gorm:"column:refund_status;comment:'退款状态'"`
  345. VipType string `gorm:"column:vip_type;comment:'付费类型'"`
  346. UserPhone string `gorm:"column:user_phone;comment:'手机号'"`
  347. UserID string `gorm:"column:user_id;comment:'用户ID'"`
  348. VipStarttime *time.Time `gorm:"column:vip_starttime;comment:'服务开始时间'"`
  349. VipEndtime *time.Time `gorm:"column:vip_endtime;comment:'服务结束时间'"`
  350. ContractStatus string `gorm:"column:contract_status;comment:'合同状态'"`
  351. ContractCode string `gorm:"column:contract_code;comment:'合同编号'"`
  352. ContractTime *time.Time `gorm:"column:contract_time;comment:'合同时间'"`
  353. SigningSubject string `gorm:"column:signing_subject;comment:'签约主体'"`
  354. OrderChannel string `gorm:"column:order_channel;comment:'下单渠道'"`
  355. DistributionChannel string `gorm:"column:distribution_channel;comment:'销售渠道'"`
  356. IsBackstageOrder string `gorm:"column:is_backstage_order;comment:'是否是后台订单'"`
  357. PayWay string `gorm:"column:pay_way;comment:'付款方式'"`
  358. Comeintime *time.Time `gorm:"column:comeintime;default:CURRENT_TIMESTAMP;comment:'数据进入时间'"`
  359. Updatetime *time.Time `gorm:"column:updatetime;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;comment:'更新时间'"`
  360. OrderSaleRecordID int `gorm:"column:order_sale_record_id;comment:'业绩变更表ID'"`
  361. RefundRecordID int `gorm:"column:refund_record_id;comment:'退款表ID'"`
  362. }
  363. func (DwdFAccountOrderChange) TableName() string {
  364. if GF.Mysql.Test {
  365. return "dwd_f_account_order_change_test"
  366. } else {
  367. return "dwd_f_account_order_change"
  368. }
  369. }
  370. // RefundRecord 退款表结构体
  371. type RefundRecord struct {
  372. ID int `gorm:"primaryKey"`
  373. OrderCode string `gorm:"column:order_code;not null;comment:'订单编号'"`
  374. RefundTime *time.Time `gorm:"column:refund_time;comment:'退款时间'"`
  375. RefundMoney int `gorm:"column:refund_money;not null;comment:'退款金额,单位:分'"`
  376. RefundReason string `gorm:"column:refund_reason;comment:'退款原因'"`
  377. RefundReasonType string `gorm:"column:refund_reason_type;comment:'退款原因类型'"`
  378. }
  379. func (RefundRecord) TableName() string {
  380. return "refund_record"
  381. }
  382. // DwdFAccountReturn 归集后的-剑鱼回款表结构体
  383. type DwdFAccountReturn struct {
  384. ID int `gorm:"primaryKey"`
  385. OrderCode string `gorm:"column:order_code;comment:'订单编号'"`
  386. SalerName string `gorm:"column:saler_name;comment:'销售人员'"`
  387. SalerDept string `gorm:"column:saler_dept;comment:'部门'"`
  388. UserPhone string `gorm:"column:user_phone;comment:'用户手机号'"`
  389. CompanyName string `gorm:"column:company_name;comment:'公司名称'"`
  390. ProductType string `gorm:"column:product_type;comment:'产品类型'"`
  391. DataSpec string `gorm:"column:data_spec;comment:'规格'"`
  392. ReturnType string `gorm:"column:return_type;comment:'回款方式'"`
  393. SaleTime *time.Time `gorm:"column:sale_time;comment:'业绩统计日期'"`
  394. ReturnTime *time.Time `gorm:"column:return_time;comment:'回款日期'"`
  395. ReturnMoney int `gorm:"column:return_money;comment:'回款金额'"`
  396. SigningSubject string `gorm:"column:signing_subject;comment:'签约主体'"`
  397. ReturnSubject string `gorm:"column:return_subject;comment:'回款主体'"`
  398. SubjectCheck string `gorm:"column:subject_check;comment:'主体校验'"`
  399. PaymentNumber string `gorm:"column:payment_number;comment:'支付单号'"`
  400. BankFlow string `gorm:"column:bank_flow;comment:'银行流水号'"`
  401. BankName string `gorm:"column:bank_name;comment:'银行名称'"`
  402. OrderChannel string `gorm:"column:order_channel;comment:'下单渠道'"`
  403. DistributionChannel string `gorm:"column:distribution_channel;comment:'销售渠道'"`
  404. RefundStatus string `gorm:"column:refund_status;comment:'退款状态'"`
  405. OperateType string `gorm:"column:operate_type;comment:'关联方式'"`
  406. OperatePerson string `gorm:"column:operate_person;comment:'创建人'"`
  407. ReturnMoneyRecordState int `gorm:"column:return_money_record_state;comment:'数据状态'"`
  408. Comeintime *time.Time `gorm:"column:comeintime;default:CURRENT_TIMESTAMP;comment:'入库时间'"`
  409. Updatetime *time.Time `gorm:"column:updatetime;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;comment:'更新时间'"`
  410. ReturnMoneyRecordID int `gorm:"column:return_money_record_id;comment:'回款表 id'"`
  411. DataexportOrderID int `gorm:"column:dataexport_order_id;comment:'订单表 id'"`
  412. PayAccountName string `gorm:"column:pay_account_name"` // 支付户名
  413. }
  414. func (DwdFAccountReturn) TableName() string {
  415. if GF.Mysql.Test {
  416. return "dwd_f_account_return_test"
  417. } else {
  418. return "dwd_f_account_return"
  419. }
  420. }
  421. // AliPay 结构体表示支付宝支付记录表
  422. type AliPay struct {
  423. ID int `gorm:"primaryKey;autoIncrement"`
  424. TransactionID string `gorm:"column:transaction_id;unique;comment:'支付订单号'"` // TransactionID 是支付订单号,唯一索引
  425. OutTradeNo string `gorm:"column:out_trade_no;index;comment:'商户订单号'"` // OutTradeNo 是商户订单号,索引
  426. CreateTime *time.Time `gorm:"column:create_time;comment:'创建时间'"` // CreateTime 是记录创建时间,在更新时自动更新为当前时间戳
  427. TotalFee int `gorm:"column:total_fee;comment:'标价金额-订单总金额,单位为分'"` // TotalFee 是标价金额-订单总金额,单位为分
  428. CashFee int `gorm:"column:cash_fee;comment:'现金支付金额-现金支付金额订单现金支付金额'"` // CashFee 是现金支付金额-现金支付金额订单现金支付金额
  429. TimeEnd string `gorm:"column:time_end;comment:'支付完成时间'"` // TimeEnd 是支付完成时间
  430. }
  431. // TableName 返回表名
  432. func (AliPay) TableName() string {
  433. return "ali_pay"
  434. }
  435. // WeixinPay 结构体表示微信支付记录表
  436. type WeixinPay struct {
  437. ID int `gorm:"primaryKey;autoIncrement"`
  438. TransactionID string `gorm:"column:transaction_id;unique;comment:'微信支付订单号'"` // TransactionID 是微信支付订单号,唯一索引
  439. OutTradeNo string `gorm:"column:out_trade_no;index;comment:'商户订单号'"`
  440. UserOpenid string `gorm:"column:user_openid;comment:'用户 openid'"`
  441. TotalFee int `gorm:"column:total_fee;comment:'标价金额-订单总金额,单位为分'"`
  442. CreateTime *time.Time `gorm:"column:create_time;comment:'创建时间'"`
  443. CashFee int `gorm:"column:cash_fee;comment:'现金支付金额-现金支付金额订单现金支付金额'"`
  444. TimeEnd string `gorm:"column:time_end;comment:'支付完成时间'"`
  445. UserID string `gorm:"column:user_id;comment:'用户 ID'"`
  446. PayChannel int `gorm:"column:pay_channel;comment:'0-微信;1-微信小店'"`
  447. }
  448. // TableName 返回表名
  449. func (WeixinPay) TableName() string {
  450. return "weixin_pay"
  451. }
  452. // DwdFAccountReturnChange 归集后-剑鱼回款变更表
  453. type DwdFAccountReturnChange struct {
  454. ID int `gorm:"primaryKey;autoIncrement;comment:'自增唯一标识'"`
  455. OrderCode string `gorm:"column:order_code;comment:'订单编号'"`
  456. SalerName string `gorm:"column:saler_name;comment:'销售人员'"`
  457. SalerDept string `gorm:"column:saler_dept;comment:'部门'"`
  458. UserPhone string `gorm:"column:user_phone;comment:'用户手机号'"`
  459. CompanyName string `gorm:"column:company_name;comment:'公司名称'"`
  460. ProductType string `gorm:"column:product_type;comment:'产品类型'"`
  461. DataSpec string `gorm:"column:data_spec;comment:'规格'"`
  462. ReturnType string `gorm:"column:return_type;comment:'回款方式'"`
  463. SaleTime *time.Time `gorm:"column:sale_time;comment:'业绩变更日期'"`
  464. ReturnTime *time.Time `gorm:"column:return_time;comment:'回款日期'"`
  465. ReturnMoney int `gorm:"column:return_money;comment:'回款金额'"`
  466. ChangeValue int `gorm:"column:change_value;comment:'业绩变动额'"`
  467. ChangeReason string `gorm:"column:change_reason;comment:'变更类型'"`
  468. SigningSubject string `gorm:"column:signing_subject;comment:'签约主体'"`
  469. ReturnSubject string `gorm:"column:return_subject;comment:'回款主体'"`
  470. SubjectCheck string `gorm:"column:subject_check;comment:'主体校验'"`
  471. PaymentNumber string `gorm:"column:payment_number;comment:'支付单号'"`
  472. BankFlow string `gorm:"column:bank_flow;comment:'银行流水号'"`
  473. BankName string `gorm:"column:bank_name;comment:'银行名称'"`
  474. OrderChannel string `gorm:"column:order_channel;comment:'下单渠道'"`
  475. DistributionChannel string `gorm:"column:distribution_channel;comment:'销售渠道'"`
  476. RefundStatus string `gorm:"column:refund_status;comment:'退款状态'"`
  477. OperateType string `gorm:"column:operate_type;comment:'关联方式'"`
  478. OperatePerson string `gorm:"column:operate_person;comment:'创建人'"`
  479. OrderSaleRecordID int `gorm:"column:order_sale_record_id;comment:'业绩变更表 ID'"`
  480. RefundRecordID int `gorm:"column:refund_record_id;comment:'退款表 ID'"`
  481. Comeintime *time.Time `gorm:"column:comeintime;default:CURRENT_TIMESTAMP;comment:'入库时间'"`
  482. Updatetime *time.Time `gorm:"column:updatetime;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;comment:'更新时间'"`
  483. PayAccountName string `gorm:"column:pay_account_name"` // 支付户名
  484. }
  485. // TableName 返回表名
  486. func (DwdFAccountReturnChange) TableName() string {
  487. if GF.Mysql.Test {
  488. return "dwd_f_account_return_change_test"
  489. } else {
  490. return "dwd_f_account_return_change"
  491. }
  492. }