Merge branch 'master' of http://192.168.5.5:10010/r/aps/crm
| | |
| | | "encoder": "console" |
| | | }, |
| | | "mysql": { |
| | | "dsn": "root:c++java123@tcp(192.168.20.119:3306)/aps_crm?charset=utf8&parseTime=True&loc=Local", |
| | | "dsn": "root:c++java123@tcp(192.168.20.119:3306)/crm?charset=utf8&parseTime=True&loc=Local", |
| | | "host": "%", |
| | | "logMode": true, |
| | | "maxIdleCon": 50, |
| | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "gorm.io/gorm" |
| | | "sync" |
| | | ) |
| | | |
| | | type ( |
| | |
| | | var db = slf.build() |
| | | return db.Updates(values).Error |
| | | } |
| | | |
| | | func (slf *ClientStatusSearch) CreateBatch(records []*ClientStatus) error { |
| | | var db = slf.build() |
| | | return db.Create(records).Error |
| | | } |
| | | |
| | | // InitDefaultData 初始化数据 |
| | | func (slf *ClientStatusSearch) InitDefaultData(errCh chan<- error, wg *sync.WaitGroup) { |
| | | var ( |
| | | db = slf.Orm.Table(slf.TableName()) |
| | | total int64 = 0 |
| | | ) |
| | | defer wg.Done() |
| | | if err := db.Count(&total).Error; err != nil { |
| | | errCh <- err |
| | | return |
| | | } |
| | | if total != 0 { |
| | | return |
| | | } |
| | | records := []*ClientStatus{ |
| | | {1, "初期沟通"}, |
| | | {2, "需求分析"}, |
| | | {3, "方案报价"}, |
| | | {4, "商务谈判"}, |
| | | {5, "成功结案"}, |
| | | } |
| | | |
| | | err := slf.CreateBatch(records) |
| | | if err != nil { |
| | | errCh <- err |
| | | return |
| | | } |
| | | } |
| | |
| | | NewRepositorySearch(), |
| | | NewSaleStageSearch(), |
| | | NewQuotationStatusSearch(), |
| | | NewSalesSourcesSearch(), |
| | | NewClientStatusSearch(), |
| | | } |
| | | |
| | | for _, model := range models { |
| | |
| | | PageInfo |
| | | SourceType constvar.ReceiptSourceType `json:"sourceType" form:"sourceType"` //来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单) |
| | | SourceId int `json:"sourceId" form:"sourceId"` |
| | | ClientId int `json:"clientId"` //客户id |
| | | ClientId int `json:"clientId" form:"clientId"` //客户id |
| | | } |
| | |
| | | {2, "需求分析"}, |
| | | {3, "商务谈判"}, |
| | | {4, "成功关闭"}, |
| | | {4, "成功结案"}, |
| | | {5, "成功结案"}, |
| | | } |
| | | err := slf.CreateBatch(records) |
| | | if err != nil { |
| | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "gorm.io/gorm" |
| | | "sync" |
| | | ) |
| | | |
| | | type ( |
| | |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | | } |
| | | |
| | | func (slf *SalesSourcesSearch) CreateBatch(records []*SalesSources) error { |
| | | var db = slf.build() |
| | | return db.Create(records).Error |
| | | } |
| | | |
| | | // InitDefaultData 初始化数据 |
| | | func (slf *SalesSourcesSearch) InitDefaultData(errCh chan<- error, wg *sync.WaitGroup) { |
| | | var ( |
| | | db = slf.Orm.Table(slf.TableName()) |
| | | total int64 = 0 |
| | | ) |
| | | defer wg.Done() |
| | | if err := db.Count(&total).Error; err != nil { |
| | | errCh <- err |
| | | return |
| | | } |
| | | if total != 0 { |
| | | return |
| | | } |
| | | records := []*SalesSources{ |
| | | {1, "电话来访"}, |
| | | {2, "公司分配"}, |
| | | {3, "客户介绍"}, |
| | | {4, "独立开发"}, |
| | | } |
| | | |
| | | err := slf.CreateBatch(records) |
| | | if err != nil { |
| | | errCh <- err |
| | | return |
| | | } |
| | | } |