| | |
| | |
|
| | | ctx.Ok()
|
| | | }
|
| | |
|
| | | // checkServiceFollowupParams
|
| | | func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) {
|
| | | //if serviceFollowup.Number == "" {
|
| | |
| | | return
|
| | | }
|
| | |
|
| | | serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.KeywordType, params.Keyword) |
| | | serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.KeywordType, params.Keyword, params.ServiceOrderId)
|
| | | if errCode != ecode.OK {
|
| | | ctx.Fail(errCode)
|
| | | return
|
| | |
| | | return |
| | | } |
| | | |
| | | serviceOrder, total, errCode := service.NewServiceOrderService().GetServiceOrderList(params.Page, params.PageSize, params.QueryClass, params.KeywordType, params.Keyword) |
| | | serviceOrder, total, errCode := service.NewServiceOrderService().GetServiceOrderList(params.Page, params.PageSize, params.QueryClass, params.KeywordType, params.Keyword, params.ServiceContractId, params.SalesDetailsId) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | |
| | | "satisfactionId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceOrder": { |
| | | "$ref": "#/definitions/model.ServiceOrder" |
| | | }, |
| | | "serviceOrderId": { |
| | | "type": "integer" |
| | | }, |
| | | "solveRate": { |
| | | "$ref": "#/definitions/model.SolveRate" |
| | |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | | "contract": { |
| | | "$ref": "#/definitions/model.Contract" |
| | | }, |
| | | "contractId": { |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "orderManage": { |
| | |
| | | "description": "销售机会id", |
| | | "type": "integer" |
| | | }, |
| | | "salesDetails": { |
| | | "$ref": "#/definitions/model.SalesDetails" |
| | | }, |
| | | "salesDetailsId": { |
| | | "description": "销售明细id", |
| | | "type": "integer" |
| | | }, |
| | | "serviceContract": { |
| | | "$ref": "#/definitions/model.ServiceContract" |
| | | }, |
| | | "serviceContractId": { |
| | | "description": "服务合同id", |
| | | "type": "integer" |
| | | }, |
| | | "serviceManId": { |
| | | "description": "服务人员", |
| | | "type": "integer" |
| | |
| | | }, |
| | | "serviceOrderStatus": { |
| | | "$ref": "#/definitions/model.ServiceOrderStatus" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceType": { |
| | | "$ref": "#/definitions/model.ServiceType" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | "description": "服务单编号", |
| | | "type": "string" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "serviceOrderId": { |
| | | "description": "服务回访单id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | "queryClass": { |
| | | "$ref": "#/definitions/constvar.ServiceOrderQueryClass" |
| | | }, |
| | | "salesDetailsId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceContractId": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "服务单编号", |
| | | "type": "string" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | "satisfactionId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceOrder": { |
| | | "$ref": "#/definitions/model.ServiceOrder" |
| | | }, |
| | | "serviceOrderId": { |
| | | "type": "integer" |
| | | }, |
| | | "solveRate": { |
| | | "$ref": "#/definitions/model.SolveRate" |
| | |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | | "contract": { |
| | | "$ref": "#/definitions/model.Contract" |
| | | }, |
| | | "contractId": { |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "orderManage": { |
| | |
| | | "description": "销售机会id", |
| | | "type": "integer" |
| | | }, |
| | | "salesDetails": { |
| | | "$ref": "#/definitions/model.SalesDetails" |
| | | }, |
| | | "salesDetailsId": { |
| | | "description": "销售明细id", |
| | | "type": "integer" |
| | | }, |
| | | "serviceContract": { |
| | | "$ref": "#/definitions/model.ServiceContract" |
| | | }, |
| | | "serviceContractId": { |
| | | "description": "服务合同id", |
| | | "type": "integer" |
| | | }, |
| | | "serviceManId": { |
| | | "description": "服务人员", |
| | | "type": "integer" |
| | |
| | | }, |
| | | "serviceOrderStatus": { |
| | | "$ref": "#/definitions/model.ServiceOrderStatus" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceType": { |
| | | "$ref": "#/definitions/model.ServiceType" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | "description": "服务单编号", |
| | | "type": "string" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "serviceOrderId": { |
| | | "description": "服务回访单id", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | "queryClass": { |
| | | "$ref": "#/definitions/constvar.ServiceOrderQueryClass" |
| | | }, |
| | | "salesDetailsId": { |
| | | "type": "integer" |
| | | }, |
| | | "serviceContractId": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "服务单编号", |
| | | "type": "string" |
| | | }, |
| | | "serviceOrderStatusId": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "处理状态", |
| | | "type": "integer" |
| | | }, |
| | | "subject": { |
| | | "description": "主题", |
| | |
| | | $ref: '#/definitions/model.Satisfaction' |
| | | satisfactionId: |
| | | type: integer |
| | | serviceId: |
| | | type: integer |
| | | serviceOrder: |
| | | $ref: '#/definitions/model.ServiceOrder' |
| | | serviceOrderId: |
| | | type: integer |
| | | solveRate: |
| | | $ref: '#/definitions/model.SolveRate' |
| | | solveRateId: |
| | |
| | | contactId: |
| | | description: 联系人id |
| | | type: integer |
| | | contract: |
| | | $ref: '#/definitions/model.Contract' |
| | | contractId: |
| | | description: 合同id |
| | | type: integer |
| | | expectTime: |
| | | description: 希望处理时间 |
| | | type: string |
| | |
| | | description: 故障类别id |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | orderId: |
| | | description: 销售订单id |
| | | type: integer |
| | | orderManage: |
| | | $ref: '#/definitions/model.OrderManage' |
| | |
| | | saleChanceId: |
| | | description: 销售机会id |
| | | type: integer |
| | | salesDetails: |
| | | $ref: '#/definitions/model.SalesDetails' |
| | | salesDetailsId: |
| | | description: 销售明细id |
| | | type: integer |
| | | serviceContract: |
| | | $ref: '#/definitions/model.ServiceContract' |
| | | serviceContractId: |
| | | description: 服务合同id |
| | | type: integer |
| | | serviceManId: |
| | | description: 服务人员 |
| | | type: integer |
| | |
| | | type: string |
| | | serviceOrderStatus: |
| | | $ref: '#/definitions/model.ServiceOrderStatus' |
| | | serviceOrderStatusId: |
| | | description: 处理状态 |
| | | type: integer |
| | | serviceType: |
| | | $ref: '#/definitions/model.ServiceType' |
| | | serviceTypeId: |
| | |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | | description: 处理状态 |
| | | type: integer |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | |
| | | serviceNumber: |
| | | description: 服务单编号 |
| | | type: string |
| | | serviceOrderStatusId: |
| | | description: 处理状态 |
| | | type: integer |
| | | serviceTypeId: |
| | | description: 服务方式id |
| | | type: integer |
| | |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | | description: 处理状态 |
| | | type: integer |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | serviceOrderId: |
| | | description: 服务回访单id |
| | | type: integer |
| | | type: object |
| | | request.GetServiceOrderList: |
| | | properties: |
| | |
| | | type: integer |
| | | queryClass: |
| | | $ref: '#/definitions/constvar.ServiceOrderQueryClass' |
| | | salesDetailsId: |
| | | type: integer |
| | | serviceContractId: |
| | | type: integer |
| | | type: object |
| | | request.GetSubOrderList: |
| | | properties: |
| | |
| | | serviceNumber: |
| | | description: 服务单编号 |
| | | type: string |
| | | serviceOrderStatusId: |
| | | description: 处理状态 |
| | | type: integer |
| | | serviceTypeId: |
| | | description: 服务方式id |
| | | type: integer |
| | |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | | description: 处理状态 |
| | | type: integer |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | |
| | | PageInfo
|
| | | KeywordType constvar.ServiceFollowupKeywordType `json:"keywordType"`
|
| | | Keyword string `json:"keyword"`
|
| | | ServiceOrderId int `json:"serviceOrderId"` //服务回访单id
|
| | | }
|
| | |
|
| | | type DeleteServiceFollowup struct {
|
| | |
| | | QueryClass constvar.ServiceOrderQueryClass `json:"queryClass" form:"queryClass"` |
| | | KeywordType constvar.ServiceOrderKeywordType `json:"keywordType" form:"keywordType"` |
| | | Keyword string `json:"keyword" form:"keyword"` |
| | | ServiceContractId int `json:"serviceContractId" form:"serviceContractId"` |
| | | SalesDetailsId int `json:"salesDetailsId" form:"salesDetailsId"` |
| | | } |
| | |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:合同编号"` |
| | | ContactId int `json:"contactId" gorm:"column:contact_id;type:int;comment:联系人id"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId"` |
| | | ServiceId int `json:"serviceId" gorm:"column:service_id;type:int;comment:客户服务单id"` |
| | | ServiceOrderId int `json:"serviceOrderId" gorm:"column:service_order_id;type:int;comment:客户服务单id"` |
| | | ServiceOrder ServiceOrder `gorm:"foreignKey:ServiceId"` |
| | | CustomerServiceSheet CustomerServiceSheet `json:"customerServiceSheet" gorm:"foreignKey:ServiceId"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:服务人员id"` |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) SetServiceOrderId(id int) *ServiceFollowupSearch { |
| | | slf.ServiceOrderId = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) SetPreload(preload bool) *ServiceFollowupSearch { |
| | | slf.Preload = preload |
| | | return slf |
| | |
| | | ServiceNumber string `gorm:"column:service_number;type:varchar(255);not null;default:'';comment:服务单编号" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"column:client_id;type:int;not null;default:0;comment:客户id" json:"clientId"` // 客户id |
| | | Client Client `gorm:"foreignKey:ClientId"` |
| | | ContractId int `gorm:"column:contract_id;type:int;not null;default:0;comment:合同id" json:"contractId"` // 合同id |
| | | Contract Contract `gorm:"foreignKey:ContractId"` |
| | | OrderId int `gorm:"column:order_id;type:int;not null;default:0;comment:销售订单id" json:"orderId"` // 销售订单id |
| | | ServiceContractId int `gorm:"column:contract_id;type:int;not null;default:0;comment:服务合同id" json:"serviceContractId"` // 服务合同id |
| | | ServiceContract ServiceContract `gorm:"foreignKey:ServiceContractId"` |
| | | SalesDetailsId int `gorm:"column:order_id;type:int;not null;default:0;comment:销售订单id" json:"salesDetailsId"` // 销售明细id |
| | | SalesDetails SalesDetails `gorm:"foreignKey:SalesDetailsId"` |
| | | OrderManage OrderManage `gorm:"foreignKey:OrderId"` |
| | | Subject string `gorm:"column:subject;type:varchar(255);not null;default:'';comment:主题" json:"subject"` // 主题 |
| | | ProductId int `gorm:"column:product_id;type:int;not null;default:0;comment:产品id" json:"productId"` // 产品id |
| | |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.ServiceContractId != 0 { |
| | | db = db.Where("service_contract_id = ?", slf.ServiceContractId) |
| | | } |
| | | if slf.SalesDetailsId != 0 { |
| | | db = db.Where("sales_details_id = ?", slf.SalesDetailsId) |
| | | } |
| | | if slf.Preload { |
| | | db = db. |
| | | Preload("Client"). |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetServiceContractId(id int) *ServiceOrderSearch { |
| | | slf.ServiceContractId = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetSalesDetailsId(id int) *ServiceOrderSearch { |
| | | slf.SalesDetailsId = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetPage(page, size int) *ServiceOrderSearch { |
| | | slf.PageNum, slf.PageSize = page, size |
| | | return slf |
| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (FollowupService) GetServiceFollowupList(page, pageSize int, keywordType constvar.ServiceFollowupKeywordType, keyword string) ([]*model.ServiceFollowup, int64, int) { |
| | | func (FollowupService) GetServiceFollowupList(page, pageSize int, keywordType constvar.ServiceFollowupKeywordType, keyword string, serviceOrderId int) ([]*model.ServiceFollowup, int64, int) { |
| | | // get contact list |
| | | contacts, total, err := model.NewServiceFollowupSearch(). |
| | | SetKeywordType(keywordType). |
| | | SetKeyword(keyword). |
| | | SetPage(page, pageSize). |
| | | SetPreload(true). |
| | | SetServiceOrderId(serviceOrderId). |
| | | FindAll() |
| | | if err != nil { |
| | | return nil, 0, ecode.ServiceFollowupListErr |
| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (ServiceOrderService) GetServiceOrderList(page, pageSize int, queryClass constvar.ServiceOrderQueryClass, keywordType constvar.ServiceOrderKeywordType, keyword string) ([]*model.ServiceOrder, int64, int) { |
| | | func (ServiceOrderService) GetServiceOrderList(page, pageSize int, queryClass constvar.ServiceOrderQueryClass, keywordType constvar.ServiceOrderKeywordType, keyword string, serviceContractId, salesDetailsId int) ([]*model.ServiceOrder, int64, int) { |
| | | list, total, err := model.NewServiceOrderSearch(). |
| | | SetPage(page, pageSize). |
| | | SetKeyword(keyword). |
| | | SetKeywordType(keywordType). |
| | | SetQueryClass(queryClass). |
| | | SetPreload(true). |
| | | SetServiceContractId(serviceContractId). |
| | | SetSalesDetailsId(salesDetailsId). |
| | | Find() |
| | | if err != nil { |
| | | return nil, 0, ecode.DBErr |