01-db.rst.txt
19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
数据库设计
=======================
销售合同表
++++++++++++
表名: tb_contract
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| contract_unid | *是* | PK | <=32 | 是 | 合同id |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| salesperson_unid | *是* | string | <=255 | 否 |销售员id,通过auth服务获取|
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| project_unid | *是* | FK | | 否 | 项目id(int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| customer_unid | *是* | FK | | 否 | 客户id(int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| province | *否* | string | <=32 | 否 | 项目所在地的省份,通过 |
| | | | | | code服务行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| city | *否* | string | <=32 | 否 | 项目所在地的市,通过 |
| | | | | | code服务行选择行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| county | *否* | string | <=32 | 否 | 项目所在地的县(区),通 |
| | | | | | 过code服务进行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| guarantee_period | *否* | int | | 否 | 质保周期,单位是月 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| sign_date | *否* | date | | 否 | 签订时间 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| product_line_type | *否* | string | <=32 | 否 | 产品线类型,通过code服务 |
| | | | | | 进行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_state | *否* | string | <=32 | 否 | 合同状态,通过code服务进 |
| | | | | | 行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_type | *否* | string | <=32 | 否 | 合同类型,通过code服务进 |
| | | | | | 行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_amount | *否* | float | | 否 | 合同金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| deduct_amount | *否* | float | | 否 | 抵扣金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_amount_note | *否* | text | | 否 | 合同金额备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| stop_amount | *否* | float | | 否 | 暂停金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| reback_note | *否* | text | | 否 | 累计回款额备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| exemptions_amount | *否* | float | | 否 | 豁免金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_remain_note | *否* | text | | 否 | 合同余额备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| is_archive | *否* | bool | | 否 | 是否归档 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| bad_amount | *否* | float | | 否 | 坏账金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| bad_amount_note | *否* | text | | 否 | 坏账金额备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| confirm_income_amount | *否* | float | | 否 | 确定收入金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| amount_state_unid | *否* | string | <=32 | 否 | 账款状态,通过code服务进行|
| | | | | | 选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| start_guarantee_date | *否* | date | | 否 | 维保服务期开始时间 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| end_guarantee_date | *否* | date | | 否 | 维保服务期结束时间 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| mainten_start_point | *否* | string | <=32 | 否 | 质保期开始节点 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_note | *否* | text | | 否 | 合同备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| is_delete | *否* | bool | | 否 | 合同删除标识 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
付款约定表
++++++++++++
表名:tb_payment_agree
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| payment_unid | *是* | PK | | 是 | 主键(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_unid | *是* | FK | <=32 | 否 | 合同编号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| payment_type | *是* | string | <=32 | 否 | 付款类型,通过code服务进 |
| | | | | | 行选择 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| payment_progress | *是* | int | | 否 | 付款进度 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| days | *是* | int | | 否 | 天数 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| payment_propority | *是* | float | | 否 | 付款比例 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| payment_requirement | *否* | text | | 否 | 付款条件 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
合同回款信息表
++++++++++++++++++
表名:tb_return_info
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| reback_unid | *是* | PK | | 是 | 主键(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_unid | *是* | FK | <=32 | 否 | 合同编号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| reback_progress | *是* | int | | 否 | 回款进度 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| reback_date | *是* | date | | 否 | 回款时间 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| actual_reback_amount | *是* | float | | 否 | 实际回款数额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| reback_note | *否* | text | | 否 | 回款备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
合同开票信息表
+++++++++++++++++++++
表名:tb_receipt
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| receipt_unid | *是* | PK | | 是 |主键(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_unid | *是* | FK | <=32 | 否 | 合同编号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| receipt_progress | *是* | int | | 否 | 开票进度 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| receipt_amount | *是* | float | | 否 | 开票金额 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| oa_flow_id | *是* | string | <=32 | 否 | oa流水号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| receipt_note | *否* | text | | 否 | 发票备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| create_date | *是* | date | | 否 | 开票日期 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
发货信息表
++++++++++++++++
表名:tb_deliver_goods
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| deliver_unid | *是* | PK | | 是 | 主键(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_unid | *是* | FK | <=32 | 否 | 合同编号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| deliver_goods_date | *是* | date | | 否 | 发货日期 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| goods_acceptanc_date | *是* | date | | 否 | 到货验收日期 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
工程验收信息表
+++++++++++++++++++
表名:tb_project_acceptanc
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| acceptanc_unid | *是* | PK | | 是 | 主键(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| contract_unid | *是* | FK | <=32 | 否 | 合同编号 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| acceptanc_type | *是* | string | <=32 | 否 | 验收类型(1为初验、2为终验|
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| acceptanc_date | *是* | date | | 否 | 验收时间 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| acceptanc_note | *否* | text | | 否 | 验收备注 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
附件表
++++++++++++
表名:tb_appendix
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| appendix_unid | *是* | PK | | 是 | 附件主键(自增长的int类型)|
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| business_table | *是* | string | <=32 | 否 | 业务表名 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| business_unid | *是* | string | <=32 | 否 | 业务表主键 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| appendix_name | *是* | string | <=255 | 否 | 附件文件名 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| appendix_type | *是* | string | <=32 | 否 | 附件类型 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| appendix_url | *是* | string | <=255 | 否 | 附件下载地址 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
项目表
++++++++++++
表名:tb_project
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| project_unid | *是* | PK | | 是 | 项目id(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| project_name | *是* | string | <=255 | 是 | 项目名称 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
客户表
++++++++++++
表名:tb_customer
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| 字段名称 | 是否必填 | 类型 | 限制 | 唯一 | 说明 |
+=======================+=============+===========+===========+=========+==========================+
| customer_unid | *是* | PK | | 是 | 客户id(自增长的int类型) |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+
| customer_name | *是* | string | <=255 | 是 | 客户名称 |
+-----------------------+-------------+-----------+-----------+---------+--------------------------+