| | |
| | | // CourierCompany 物流公司 |
| | | CourierCompany struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // CourierCompanySearch 物流公司搜索条件 |
| | | CourierCompanySearch struct { |
| | | CourierCompany |
| | | Orm *gorm.DB |
| | | QueryClass constvar.CourierCompanyQueryClass |
| | | KeywordType constvar.CourierCompanyKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.CourierCompanyQueryClass |
| | | KeywordType constvar.CourierCompanyKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*CourierCompany{} |
| | | records := []*CourierCompany{ |
| | | {1, "顺丰"}, |
| | | {2, "德邦"}, |
| | | {3, "中远海运"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | NewPriorityLevelSearch(), |
| | | NewSeveritySearch(), |
| | | NewTimeSpentSearch(), |
| | | NewInvoiceTypeSearch(), |
| | | NewInvoiceStatusSearch(), |
| | | NewCourierCompanySearch(), |
| | | } |
| | | for _, model := range models { |
| | | if id, ok := model.(InitDefaultData); ok { |
| | |
| | | // InvoiceStatus 发票状态 |
| | | InvoiceStatus struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // InvoiceStatusSearch 发票状态搜索条件 |
| | | InvoiceStatusSearch struct { |
| | | InvoiceStatus |
| | | Orm *gorm.DB |
| | | QueryClass constvar.InvoiceStatusQueryClass |
| | | KeywordType constvar.InvoiceStatusKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.InvoiceStatusQueryClass |
| | | KeywordType constvar.InvoiceStatusKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*InvoiceStatus{} |
| | | records := []*InvoiceStatus{ |
| | | {1, "已创建"}, |
| | | {2, "已寄送"}, |
| | | {3, "自动创建"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // InvoiceType 发票类型 |
| | | InvoiceType struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // InvoiceTypeSearch 发票类型搜索条件 |
| | | InvoiceTypeSearch struct { |
| | | InvoiceType |
| | | Orm *gorm.DB |
| | | QueryClass constvar.InvoiceTypeQueryClass |
| | | KeywordType constvar.InvoiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.InvoiceTypeQueryClass |
| | | KeywordType constvar.InvoiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*InvoiceType{} |
| | | records := []*InvoiceType{ |
| | | {1, "增票6%"}, |
| | | {2, "增票16%"}, |
| | | {3, "增票17%"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // PriorityLevel 优先级别 |
| | | PriorityLevel struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // PriorityLevelSearch 优先级别搜索条件 |
| | | PriorityLevelSearch struct { |
| | | PriorityLevel |
| | | Orm *gorm.DB |
| | | QueryClass constvar.PriorityLevelQueryClass |
| | | KeywordType constvar.PriorityLevelKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.PriorityLevelQueryClass |
| | | KeywordType constvar.PriorityLevelKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*PriorityLevel{} |
| | | records := []*PriorityLevel{ |
| | | {1, "低"}, |
| | | {2, "一般"}, |
| | | {3, "高"}, |
| | | {4, "紧急"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // ServiceType 服务方式 |
| | | ServiceType struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // ServiceTypeSearch 服务方式搜索条件 |
| | | ServiceTypeSearch struct { |
| | | ServiceType |
| | | Orm *gorm.DB |
| | | QueryClass constvar.ServiceTypeQueryClass |
| | | KeywordType constvar.ServiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.ServiceTypeQueryClass |
| | | KeywordType constvar.ServiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*ServiceType{} |
| | | records := []*ServiceType{ |
| | | {1, "电话"}, |
| | | {2, "远程"}, |
| | | {3, "送修"}, |
| | | {4, "上门"}, |
| | | {5, "其他"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // Severity 严重程度 |
| | | Severity struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // SeveritySearch 严重程度搜索条件 |
| | | SeveritySearch struct { |
| | | Severity |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*Severity{} |
| | | records := []*Severity{ |
| | | {1, "轻"}, |
| | | {2, "严重"}, |
| | | {3, "较严重"}, |
| | | {4, "特严重"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*TimeSpent{} |
| | | records := []*TimeSpent{ |
| | | {1, "1小时"}, |
| | | {2, "2小时"}, |
| | | {3, "0.5个工作日"}, |
| | | {4, "1个工作日"}, |
| | | {5, "2个工作日"}, |
| | | {6, "2个工作日以上"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |