New file |
| | |
| | | package v1 |
| | | |
| | | import ( |
| | | "aps_crm/model" |
| | | "aps_crm/model/request" |
| | | "aps_crm/pkg/contextx" |
| | | "aps_crm/pkg/ecode" |
| | | "github.com/gin-gonic/gin" |
| | | ) |
| | | |
| | | type CollectionProjectionApi struct{} |
| | | |
| | | // Add |
| | | // |
| | | // @Tags CollectionProjection |
| | | // @Summary 添加收款预测 |
| | | // @Produce application/json |
| | | // @Param object body request.AddCollectionProjection true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | | // @Router /api/collectionProjection/add [post] |
| | | func (cp *CollectionProjectionApi) Add(c *gin.Context) { |
| | | var params request.AddCollectionProjection |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | tmp := new(model.CollectionProjection) |
| | | tmp.EstimatedCollectionAmount = params.CollectionProjection.EstimatedCollectionAmount |
| | | tmp.EstimatedCollectionDate = params.CollectionProjection.EstimatedCollectionTime |
| | | tmp.SaleChanceId = params.CollectionProjection.SaleChanceId |
| | | |
| | | errCode := collectionProjectionService.AddCollectionProjection(tmp) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | ctx.Ok() |
| | | } |
| | |
| | | VettingApi |
| | | SatisfactionApi |
| | | AssignApi |
| | | CollectionProjectionApi |
| | | } |
| | | |
| | | var ApiGroup = new(Group) |
| | |
| | | quotationStatusService = service.ServiceGroup.QuotationStatusService |
| | | currencyService = service.ServiceGroup.CurrencyService |
| | | assignService = service.ServiceGroup.AssignService |
| | | collectionProjectionService = service.ServiceGroup.CollectionProjectionService |
| | | ) |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/collectionProjection/add": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "CollectionProjection" |
| | | ], |
| | | "summary": "添加收款预测", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.AddCollectionProjection" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/contact/add": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | | "type": "integer" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "type": "integer" |
| | | "type": "number" |
| | | }, |
| | | "desc": { |
| | | "type": "string" |
| | |
| | | "amountReceived": { |
| | | "description": "已收金额", |
| | | "type": "number" |
| | | }, |
| | | "amountUnInvoiced": { |
| | | "description": "未开票金额", |
| | | "type": "number" |
| | | }, |
| | | "client": { |
| | | "$ref": "#/definitions/model.Client" |
| | | }, |
| | | "clientId": { |
| | | "type": "integer" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddCollectionProjection": { |
| | | "type": "object", |
| | | "properties": { |
| | | "estimated_collection_amount": { |
| | | "description": "预计收款金额", |
| | | "type": "number" |
| | | }, |
| | | "estimated_collection_time": { |
| | | "description": "预计收款时间", |
| | | "type": "string" |
| | | }, |
| | | "sale_chance_id": { |
| | | "description": "销售机会id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddContact": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "principalId": { |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "description": "发票对应产品,从相应源单里获取", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | |
| | | }, |
| | | "request.UpdateInvoice": { |
| | | "type": "object", |
| | | "required": [ |
| | | "id" |
| | | ], |
| | | "properties": { |
| | | "clientId": { |
| | | "description": "客户id", |
| | |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "description": "发票对应产品,从相应源单里获取", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | | "type": "integer" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/collectionProjection/add": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "CollectionProjection" |
| | | ], |
| | | "summary": "添加收款预测", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.AddCollectionProjection" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/contact/add": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | | "type": "integer" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "amount": { |
| | | "type": "integer" |
| | | "type": "number" |
| | | }, |
| | | "desc": { |
| | | "type": "string" |
| | |
| | | "amountReceived": { |
| | | "description": "已收金额", |
| | | "type": "number" |
| | | }, |
| | | "amountUnInvoiced": { |
| | | "description": "未开票金额", |
| | | "type": "number" |
| | | }, |
| | | "client": { |
| | | "$ref": "#/definitions/model.Client" |
| | | }, |
| | | "clientId": { |
| | | "type": "integer" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddCollectionProjection": { |
| | | "type": "object", |
| | | "properties": { |
| | | "estimated_collection_amount": { |
| | | "description": "预计收款金额", |
| | | "type": "number" |
| | | }, |
| | | "estimated_collection_time": { |
| | | "description": "预计收款时间", |
| | | "type": "string" |
| | | }, |
| | | "sale_chance_id": { |
| | | "description": "销售机会id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddContact": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "principalId": { |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "description": "发票对应产品,从相应源单里获取", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | |
| | | }, |
| | | "request.UpdateInvoice": { |
| | | "type": "object", |
| | | "required": [ |
| | | "id" |
| | | ], |
| | | "properties": { |
| | | "clientId": { |
| | | "description": "客户id", |
| | |
| | | "description": "销售负责人id", |
| | | "type": "integer" |
| | | }, |
| | | "products": { |
| | | "description": "发票对应产品,从相应源单里获取", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "sourceId": { |
| | | "description": "源单id", |
| | | "type": "integer" |
| | |
| | | principalId: |
| | | description: 销售负责人id |
| | | type: integer |
| | | products: |
| | | items: |
| | | $ref: '#/definitions/model.Product' |
| | | type: array |
| | | sourceId: |
| | | description: 源单id |
| | | type: integer |
| | |
| | | model.Product: |
| | | properties: |
| | | amount: |
| | | type: integer |
| | | type: number |
| | | desc: |
| | | type: string |
| | | id: |
| | |
| | | amountReceived: |
| | | description: 已收金额 |
| | | type: number |
| | | amountUnInvoiced: |
| | | description: 未开票金额 |
| | | type: number |
| | | client: |
| | | $ref: '#/definitions/model.Client' |
| | | clientId: |
| | | type: integer |
| | | contactId: |
| | |
| | | required: |
| | | - name |
| | | type: object |
| | | request.AddCollectionProjection: |
| | | properties: |
| | | estimated_collection_amount: |
| | | description: 预计收款金额 |
| | | type: number |
| | | estimated_collection_time: |
| | | description: 预计收款时间 |
| | | type: string |
| | | sale_chance_id: |
| | | description: 销售机会id |
| | | type: integer |
| | | type: object |
| | | request.AddContact: |
| | | properties: |
| | | birthday: |
| | |
| | | principalId: |
| | | description: 销售负责人id |
| | | type: integer |
| | | products: |
| | | description: 发票对应产品,从相应源单里获取 |
| | | items: |
| | | $ref: '#/definitions/model.Product' |
| | | type: array |
| | | sourceId: |
| | | description: 源单id |
| | | type: integer |
| | |
| | | principalId: |
| | | description: 销售负责人id |
| | | type: integer |
| | | products: |
| | | description: 发票对应产品,从相应源单里获取 |
| | | items: |
| | | $ref: '#/definitions/model.Product' |
| | | type: array |
| | | sourceId: |
| | | description: 源单id |
| | | type: integer |
| | |
| | | taxpayerIdNumber: |
| | | description: 纳税识别号 |
| | | type: string |
| | | required: |
| | | - id |
| | | type: object |
| | | request.UpdateInvoiceStatus: |
| | | properties: |
| | |
| | | summary: 更新客户类型 |
| | | tags: |
| | | - ClientType |
| | | /api/collectionProjection/add: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.AddCollectionProjection' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/contextx.Response' |
| | | summary: 添加收款预测 |
| | | tags: |
| | | - CollectionProjection |
| | | /api/contact/add: |
| | | post: |
| | | parameters: |
New file |
| | |
| | | package model |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | | type ( |
| | | CollectionProjection struct { |
| | | Id int `json:"id" gorm:"column:id;primaryKey;autoIncrement;not null"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | Creator int `json:"creator" gorm:"column:creator;type:int(11);comment:创建人"` |
| | | Modifier int `json:"modifier" gorm:"column:modifier;type:int(11);comment:修改人"` |
| | | EstimatedCollectionDate string `json:"estimated_collection_date" gorm:"column:estimated_collection_date;type:datetime;comment:预计收款日期"` |
| | | EstimatedCollectionAmount float64 `json:"estimated_collection_amount" gorm:"column:estimated_collection_amount;type:decimal(10,2);comment:预计收款金额"` |
| | | gorm.Model |
| | | } |
| | | |
| | | CollectionProjectionSearch struct { |
| | | CollectionProjection |
| | | |
| | | Orm *gorm.DB |
| | | OrderBy string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | | func (CollectionProjection) TableName() string { |
| | | return "collection_projection" |
| | | } |
| | | |
| | | func NewCollectionProjectionSearch() *CollectionProjectionSearch { |
| | | return &CollectionProjectionSearch{ |
| | | Orm: mysqlx.GetDB(), |
| | | } |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&CollectionProjection{}) |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) Create(record *CollectionProjection) (err error) { |
| | | var db = slf.build() |
| | | err = db.Create(record).Error |
| | | return |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) Update(record *CollectionProjection) (err error) { |
| | | var db = slf.build() |
| | | err = db.Updates(record).Error |
| | | return |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) Delete() (err error) { |
| | | var db = slf.build() |
| | | err = db.Delete(&CollectionProjection{}).Error |
| | | return |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) Find() (record CollectionProjection, err error) { |
| | | var db = slf.build() |
| | | err = db.First(&record).Error |
| | | return |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) SetID(id int) *CollectionProjectionSearch { |
| | | slf.Id = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) SetSaleChanceId(saleChanceId int) *CollectionProjectionSearch { |
| | | slf.SaleChanceId = saleChanceId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) SetPage(page, size int) *CollectionProjectionSearch { |
| | | slf.PageNum, slf.PageSize = page, size |
| | | return slf |
| | | } |
| | |
| | | package model
|
| | |
|
| | | import (
|
| | | "aps_crm/conf"
|
| | | "aps_crm/pkg/logx"
|
| | | "aps_crm/pkg/mysqlx"
|
| | | "aps_crm/pkg/safe"
|
| | | "gorm.io/gorm/schema"
|
| | | )
|
| | |
|
| | | func Init() error {
|
| | | if err := mysqlx.Init(&conf.Conf.Mysql, logx.GetLogger()); err != nil {
|
| | | return err
|
| | | }
|
| | |
|
| | | if err := RegisterTables(); err != nil {
|
| | | return err
|
| | | }
|
| | | safe.Go(func() {
|
| | | InsertDefaultData()
|
| | | })
|
| | | return nil
|
| | | }
|
| | |
|
| | | func RegisterTables() error {
|
| | | db := mysqlx.GetDB()
|
| | | err := db.AutoMigrate(
|
| | | User{},
|
| | | Menu{},
|
| | | JwtBlacklist{},
|
| | | Country{},
|
| | | Province{},
|
| | | City{},
|
| | | Client{},
|
| | | ClientLevel{},
|
| | | ClientOrigin{},
|
| | | ClientStatus{},
|
| | | ClientType{},
|
| | | Contact{},
|
| | | EnterpriseNature{},
|
| | | EnterpriseScale{},
|
| | | FollowRecord{},
|
| | | Industry{},
|
| | | RegisteredCapital{},
|
| | | SaleChance{},
|
| | | SalesLeads{},
|
| | | SalesSources{},
|
| | | SaleStage{},
|
| | | SaleType{},
|
| | | RegularCustomers{},
|
| | | Possibility{},
|
| | | Status{},
|
| | | Quotation{},
|
| | | MasterOrder{},
|
| | | SubOrder{},
|
| | | Product{},
|
| | | SalesDetails{},
|
| | | SalesReturn{},
|
| | | SalesRefund{},
|
| | | Contract{},
|
| | | Plan{},
|
| | | ServiceContract{},
|
| | | OrderManage{},
|
| | | ServiceFollowup{},
|
| | | CustomerServiceSheet{},
|
| | | ServiceFeeManage{},
|
| | | Authority{},
|
| | | Api{},
|
| | | Department{},
|
| | | Satisfaction{},
|
| | | TimelyRate{},
|
| | | SolveRate{},
|
| | | IsVisit{},
|
| | | IsVisit{},
|
| | | ReportSource{},
|
| | | OrderType{},
|
| | | ServiceContractStatus{},
|
| | | ServiceContractType{},
|
| | | RefundMethod{},
|
| | | IsInvoice{},
|
| | | AccountId{},
|
| | | SalesReturnStatus{},
|
| | | Repository{},
|
| | | QuotationStatus{},
|
| | | Currency{},
|
| | | )
|
| | | return err
|
| | | }
|
| | |
|
| | | type InitDefaultData interface {
|
| | | InitDefaultData() error
|
| | | }
|
| | |
|
| | | func InsertDefaultData() {
|
| | | models := []interface{}{
|
| | | NewServiceTypeSearch(),
|
| | | NewPriorityLevelSearch(),
|
| | | NewSeveritySearch(),
|
| | | NewTimeSpentSearch(),
|
| | | }
|
| | | for _, model := range models {
|
| | | if id, ok := model.(InitDefaultData); ok {
|
| | | if err := id.InitDefaultData(); err != nil {
|
| | | logx.Errorf("InitDefaultData for table: %v, err :%v", model.(schema.Tabler).TableName(), err.Error())
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | package model |
| | | |
| | | import ( |
| | | "aps_crm/conf" |
| | | "aps_crm/pkg/logx" |
| | | "aps_crm/pkg/mysqlx" |
| | | "aps_crm/pkg/safe" |
| | | "gorm.io/gorm/schema" |
| | | ) |
| | | |
| | | func Init() error { |
| | | if err := mysqlx.Init(&conf.Conf.Mysql, logx.GetLogger()); err != nil { |
| | | return err |
| | | } |
| | | |
| | | if err := RegisterTables(); err != nil { |
| | | return err |
| | | } |
| | | safe.Go(func() { |
| | | InsertDefaultData() |
| | | }) |
| | | return nil |
| | | } |
| | | |
| | | func RegisterTables() error { |
| | | db := mysqlx.GetDB() |
| | | err := db.AutoMigrate( |
| | | User{}, |
| | | Menu{}, |
| | | JwtBlacklist{}, |
| | | Country{}, |
| | | Province{}, |
| | | City{}, |
| | | Client{}, |
| | | ClientLevel{}, |
| | | ClientOrigin{}, |
| | | ClientStatus{}, |
| | | ClientType{}, |
| | | Contact{}, |
| | | EnterpriseNature{}, |
| | | EnterpriseScale{}, |
| | | FollowRecord{}, |
| | | Industry{}, |
| | | RegisteredCapital{}, |
| | | SaleChance{}, |
| | | SalesLeads{}, |
| | | SalesSources{}, |
| | | SaleStage{}, |
| | | SaleType{}, |
| | | RegularCustomers{}, |
| | | Possibility{}, |
| | | Status{}, |
| | | Quotation{}, |
| | | MasterOrder{}, |
| | | SubOrder{}, |
| | | Product{}, |
| | | SalesDetails{}, |
| | | SalesReturn{}, |
| | | SalesRefund{}, |
| | | Contract{}, |
| | | Plan{}, |
| | | ServiceContract{}, |
| | | OrderManage{}, |
| | | ServiceFollowup{}, |
| | | CustomerServiceSheet{}, |
| | | ServiceFeeManage{}, |
| | | Authority{}, |
| | | Api{}, |
| | | Department{}, |
| | | Satisfaction{}, |
| | | TimelyRate{}, |
| | | SolveRate{}, |
| | | IsVisit{}, |
| | | IsVisit{}, |
| | | ReportSource{}, |
| | | OrderType{}, |
| | | ServiceContractStatus{}, |
| | | ServiceContractType{}, |
| | | RefundMethod{}, |
| | | IsInvoice{}, |
| | | AccountId{}, |
| | | SalesReturnStatus{}, |
| | | Repository{}, |
| | | QuotationStatus{}, |
| | | Currency{}, |
| | | ) |
| | | return err |
| | | } |
| | | |
| | | type InitDefaultData interface { |
| | | InitDefaultData() error |
| | | } |
| | | |
| | | func InsertDefaultData() { |
| | | models := []interface{}{ |
| | | NewServiceTypeSearch(), |
| | | NewPriorityLevelSearch(), |
| | | NewSeveritySearch(), |
| | | NewTimeSpentSearch(), |
| | | } |
| | | for _, model := range models { |
| | | if id, ok := model.(InitDefaultData); ok { |
| | | if err := id.InitDefaultData(); err != nil { |
| | | logx.Errorf("InitDefaultData for table: %v, err :%v", model.(schema.Tabler).TableName(), err.Error()) |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package request |
| | | |
| | | type AddCollectionProjection struct { |
| | | CollectionProjection |
| | | } |
| | | |
| | | type CollectionProjection struct { |
| | | EstimatedCollectionAmount float64 `json:"estimated_collection_amount"` // 预计收款金额 |
| | | EstimatedCollectionTime string `json:"estimated_collection_time"` // 预计收款时间 |
| | | SaleChanceId int `json:"sale_chance_id"` // 销售机会id |
| | | } |
| | |
| | | AssignWrongId = 5700003 // 分配失败,分配对象为空 |
| | | AssignWrongModelType = 5700004 // 分配失败,分配对象类型为空 |
| | | |
| | | CollectionProjectionExist = 5800001 // 收款预测已存在 |
| | | CollectionProjectionNotExist = 5800002 // 收款预测不存在 |
| | | CollectionProjectionListErr = 5800003 // 获取收款预测列表失败 |
| | | CollectionProjectionSetErr = 5800004 // 设置收款预测失败 |
| | | CollectionProjectionUpdateErr = 5800005 // 更新收款预测失败 |
| | | ) |
New file |
| | |
| | | package router |
| | | |
| | | import ( |
| | | v1 "aps_crm/api/v1" |
| | | "github.com/gin-gonic/gin" |
| | | ) |
| | | |
| | | type CollectionProjectionRouter struct{} |
| | | |
| | | func (c *CollectionProjectionRouter) InitCollectionProjectionRouter(router *gin.RouterGroup) { |
| | | collectionProjectionRouter := router.Group("collectionProjection") |
| | | collectionProjectionApi := v1.ApiGroup.CollectionProjectionApi |
| | | { |
| | | collectionProjectionRouter.POST("add", collectionProjectionApi.Add) // 添加收款预测 |
| | | //collectionProjectionRouter.DELETE("delete", collectionProjectionApi.Delete) // 删除收款预测 |
| | | //collectionProjectionRouter.PUT("update", collectionProjectionApi.Update) // 更新收款预测 |
| | | //collectionProjectionRouter.POST("list", collectionProjectionApi.List) // 获取收款预测列表 |
| | | } |
| | | } |
| | |
| | | DepartmentRouter |
| | | SatisfactionRouter |
| | | AssignRouter |
| | | CollectionProjectionRouter |
| | | } |
| | | |
| | | func InitRouter() *gin.Engine { |
| | |
| | | InitInvoiceTypeRouter(PrivateGroup) |
| | | InitCourierCompanyRouter(PrivateGroup) |
| | | InitProductRouter(PrivateGroup) |
| | | |
| | | InitServiceCollectionPlanRouter(PrivateGroup) |
| | | } |
| | | return Router |
| | | } |
New file |
| | |
| | | package service |
| | | |
| | | import ( |
| | | "aps_crm/model" |
| | | "aps_crm/pkg/ecode" |
| | | ) |
| | | |
| | | type CollectionProjectionService struct{} |
| | | |
| | | func (CollectionProjectionService) AddCollectionProjection(collectionProjection *model.CollectionProjection) int { |
| | | err := model.NewCollectionProjectionSearch().Create(collectionProjection) |
| | | if err != nil { |
| | | return ecode.CollectionProjectionExist |
| | | } |
| | | |
| | | return ecode.OK |
| | | } |
| | |
| | | QuotationStatusService |
| | | CurrencyService |
| | | AssignService |
| | | CollectionProjectionService |
| | | } |
| | | |
| | | var ServiceGroup = new(Group) |