完善供应商和客户功能
This commit is contained in:
+22
-18
@@ -8,24 +8,28 @@ import (
|
||||
|
||||
// Contact 联系人模型(对应表 yz_tenant_crm_contact)
|
||||
type Contact struct {
|
||||
Id int64 `orm:"pk;auto" json:"id"`
|
||||
TenantId string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
RelatedType int `orm:"column(related_type)" json:"related_type"` // 1=客户 2=供应商
|
||||
RelatedId string `orm:"column(related_id);size(64)" json:"related_id"`
|
||||
ContactName string `orm:"column(contact_name);size(50)" json:"contact_name"`
|
||||
Gender int8 `orm:"column(gender);null" json:"gender"`
|
||||
Mobile string `orm:"column(mobile);size(20);null" json:"mobile"`
|
||||
Phone string `orm:"column(phone);size(20);null" json:"phone"`
|
||||
Email string `orm:"column(email);size(100);null" json:"email"`
|
||||
Position string `orm:"column(position);size(50);null" json:"position"`
|
||||
Department string `orm:"column(department);size(50);null" json:"department"`
|
||||
IsPrimary int8 `orm:"column(is_primary);null" json:"is_primary"`
|
||||
Remark string `orm:"column(remark);size(500);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
CreateBy int64 `orm:"column(create_by);null" json:"create_by"`
|
||||
UpdateBy int64 `orm:"column(update_by);null" json:"update_by"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);null" json:"is_deleted"`
|
||||
Id int64 `orm:"pk;auto" json:"id,omitempty"`
|
||||
TenantId string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
RelatedType int `orm:"column(related_type)" json:"related_type"` // 1=客户 2=供应商
|
||||
RelatedId string `orm:"column(related_id);size(64)" json:"related_id"`
|
||||
ContactName string `orm:"column(contact_name);size(50)" json:"contact_name"`
|
||||
Gender int8 `orm:"column(gender);null" json:"gender"`
|
||||
Phone1 string `orm:"column(phone1);size(20);null" json:"phone1"`
|
||||
Phone2 string `orm:"column(phone2);size(20);null" json:"phone2"`
|
||||
Phone3 string `orm:"column(phone3);size(20);null" json:"phone3"`
|
||||
Qq string `orm:"column(qq);size(255);null" json:"qq"`
|
||||
Wechat string `orm:"column(wechat);size(255);null" json:"wechat"`
|
||||
Email string `orm:"column(email);size(100);null" json:"email"`
|
||||
Position string `orm:"column(position);size(50);null" json:"position"`
|
||||
Department string `orm:"column(department);size(50);null" json:"department"`
|
||||
IsPrimary int8 `orm:"column(is_primary);null" json:"is_primary"`
|
||||
HomeAddress string `orm:"column(home_address);size(65535);null" json:"home_address"`
|
||||
Remark string `orm:"column(remark);size(65535);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time,omitempty"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time,omitempty"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time,omitempty"`
|
||||
CreateBy int64 `orm:"column(create_by);null" json:"create_by"`
|
||||
UpdateBy int64 `orm:"column(update_by);null" json:"update_by"`
|
||||
}
|
||||
|
||||
func (t *Contact) TableName() string {
|
||||
|
||||
@@ -22,6 +22,12 @@ type Customer struct {
|
||||
ExpireTime *time.Time `orm:"column(expire_time);null;type(date)" json:"expire_time"`
|
||||
Status string `orm:"column(status);size(20)" json:"status"`
|
||||
Remark string `orm:"column(remark);type(text);null" json:"remark"`
|
||||
InvoiceTitle string `orm:"column(invoice_title);size(100);null" json:"invoice_title"`
|
||||
TaxNumber string `orm:"column(tax_number);size(50);null" json:"tax_number"`
|
||||
BankName string `orm:"column(bank_name);size(100);null" json:"bank_name"`
|
||||
BankAccount string `orm:"column(bank_account);size(50);null" json:"bank_account"`
|
||||
RegisteredAddress string `orm:"column(registered_address);size(255);null" json:"registered_address"`
|
||||
RegisteredPhone string `orm:"column(registered_phone);size(50);null" json:"registered_phone"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
|
||||
|
||||
+24
-18
@@ -8,23 +8,29 @@ import (
|
||||
|
||||
// Supplier 供应商模型(对应表 yz_tenant_crm_supplier)
|
||||
type Supplier struct {
|
||||
Id string `orm:"pk;size(36)" json:"id"`
|
||||
TenantId string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
SupplierName string `orm:"column(supplier_name);size(100)" json:"supplier_name"`
|
||||
SupplierType string `orm:"column(supplier_type);size(20)" json:"supplier_type"`
|
||||
ContactPerson string `orm:"column(contact_person);size(50)" json:"contact_person"`
|
||||
ContactPhone string `orm:"column(contact_phone);size(20)" json:"contact_phone"`
|
||||
ContactEmail string `orm:"column(contact_email);size(100);null" json:"contact_email"`
|
||||
SupplierLevel string `orm:"column(supplier_level);size(20);null" json:"supplier_level"`
|
||||
Industry string `orm:"column(industry);size(50);null" json:"industry"`
|
||||
Address string `orm:"column(address);size(255);null" json:"address"`
|
||||
RegisterTime *time.Time `orm:"column(register_time);null;type(date)" json:"register_time"`
|
||||
ExpireTime *time.Time `orm:"column(expire_time);null;type(date)" json:"expire_time"`
|
||||
Status string `orm:"column(status);size(20)" json:"status"`
|
||||
Remark string `orm:"column(remark);type(text);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
|
||||
Id int64 `orm:"pk;auto" json:"id"`
|
||||
TenantId string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
SupplierName string `orm:"column(supplier_name);size(100)" json:"supplier_name"`
|
||||
SupplierType string `orm:"column(supplier_type);size(20)" json:"supplier_type"`
|
||||
ContactPerson string `orm:"column(contact_person);size(50)" json:"contact_person"`
|
||||
ContactPhone string `orm:"column(contact_phone);size(20)" json:"contact_phone"`
|
||||
ContactEmail string `orm:"column(contact_email);size(100);null" json:"contact_email"`
|
||||
SupplierLevel string `orm:"column(supplier_level);size(20);null" json:"supplier_level"`
|
||||
Industry string `orm:"column(industry);size(50);null" json:"industry"`
|
||||
Address string `orm:"column(address);size(255);null" json:"address"`
|
||||
RegisterTime *time.Time `orm:"column(register_time);null;type(date)" json:"register_time"`
|
||||
ExpireTime *time.Time `orm:"column(expire_time);null;type(date)" json:"expire_time"`
|
||||
Status string `orm:"column(status);size(20)" json:"status"`
|
||||
Remark string `orm:"column(remark);type(text);null" json:"remark"`
|
||||
InvoiceTitle string `orm:"column(invoice_title);size(255);null" json:"invoice_title"`
|
||||
TaxNumber string `orm:"column(tax_number);size(20);null" json:"tax_number"`
|
||||
BankName string `orm:"column(bank_name);size(50);null" json:"bank_name"`
|
||||
BankAccount string `orm:"column(bank_account);size(50);null" json:"bank_account"`
|
||||
RegisteredAddress string `orm:"column(registered_address);size(255);null" json:"registered_address"`
|
||||
RegisteredPhone string `orm:"column(registered_phone);size(20);null" json:"registered_phone"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);null;type(datetime)" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (t *Supplier) TableName() string {
|
||||
@@ -33,4 +39,4 @@ func (t *Supplier) TableName() string {
|
||||
|
||||
func init() {
|
||||
orm.RegisterModel(new(Supplier))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user