zhangqian
2023-08-17 b654a22b6d2e579cf32e1d70f7a8a7791a501e81
初始化一些数据
8个文件已修改
136 ■■■■■ 已修改文件
model/courierCompany.go 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/index.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/invoiceStatus.go 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/invoiceType.go 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/priorityLevel.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceType.go 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/severity.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/timeSpent.go 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/courierCompany.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -135,6 +135,10 @@
    if total != 0 {
        return nil
    }
    records := []*CourierCompany{}
    records := []*CourierCompany{
        {1, "顺丰"},
        {2, "德邦"},
        {3, "中远海运"},
    }
    return slf.CreateBatch(records)
}
model/index.go
@@ -103,6 +103,9 @@
        NewPriorityLevelSearch(),
        NewSeveritySearch(),
        NewTimeSpentSearch(),
        NewInvoiceTypeSearch(),
        NewInvoiceStatusSearch(),
        NewCourierCompanySearch(),
    }
    for _, model := range models {
        if id, ok := model.(InitDefaultData); ok {
model/invoiceStatus.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -135,6 +135,10 @@
    if total != 0 {
        return nil
    }
    records := []*InvoiceStatus{}
    records := []*InvoiceStatus{
        {1, "已创建"},
        {2, "已寄送"},
        {3, "自动创建"},
    }
    return slf.CreateBatch(records)
}
model/invoiceType.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -135,6 +135,10 @@
    if total != 0 {
        return nil
    }
    records := []*InvoiceType{}
    records := []*InvoiceType{
        {1, "增票6%"},
        {2, "增票16%"},
        {3, "增票17%"},
    }
    return slf.CreateBatch(records)
}
model/priorityLevel.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -130,6 +130,11 @@
    if total != 0 {
        return nil
    }
    records := []*PriorityLevel{}
    records := []*PriorityLevel{
        {1, "低"},
        {2, "一般"},
        {3, "高"},
        {4, "紧急"},
    }
    return slf.CreateBatch(records)
}
model/serviceType.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -130,6 +130,12 @@
    if total != 0 {
        return nil
    }
    records := []*ServiceType{}
    records := []*ServiceType{
        {1, "电话"},
        {2, "远程"},
        {3, "送修"},
        {4, "上门"},
        {5, "其他"},
    }
    return slf.CreateBatch(records)
}
model/severity.go
@@ -12,18 +12,18 @@
    // 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
    }
)
@@ -130,6 +130,11 @@
    if total != 0 {
        return nil
    }
    records := []*Severity{}
    records := []*Severity{
        {1, "轻"},
        {2, "严重"},
        {3, "较严重"},
        {4, "特严重"},
    }
    return slf.CreateBatch(records)
}
model/timeSpent.go
@@ -130,6 +130,13 @@
    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)
}