zhangqian
2023-08-11 d8ac88cfb72e3aac3a89c3cfe77774be3024a24c
update
8个文件已修改
623 ■■■■■ 已修改文件
api/v1/serviceFollowup.go 308 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/serviceFollowup.go 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/serviceOrder.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceFollowup.go 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceOrder.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/serviceFollowup.go
@@ -1,154 +1,154 @@
package v1
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "github.com/gin-gonic/gin"
)
type ServiceFollowupApi struct{}
// Add
//
//    @Tags        ServiceFollowup
//    @Summary    添加服务跟进
//    @Produce    application/json
//    @Param        object    body        request.AddServiceFollowup    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/add [post]
func (s *ServiceFollowupApi) Add(c *gin.Context) {
    var params request.AddServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode, serviceFollowup := checkServiceFollowupParams(params.ServiceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    errCode = serviceFollowupService.AddServiceFollowup(&serviceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
//
//    @Tags        ServiceFollowup
//    @Summary    删除服务跟进
//    @Produce    application/json
//    @Param        object    body        request.DeleteServiceFollowup true    "查询参数"
//    @Success    200    {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/delete [delete]
func (s *ServiceFollowupApi) Delete(c *gin.Context) {
    var params request.DeleteServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := serviceFollowupService.DeleteServiceFollowup(params.Ids)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
//
//    @Tags        ServiceFollowup
//    @Summary    更新服务跟进
//    @Produce    application/json
//    @Param        object    body        request.UpdateServiceFollowup    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/update [put]
func (s *ServiceFollowupApi) Update(c *gin.Context) {
    var params request.UpdateServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode, serviceFollowup := checkServiceFollowupParams(params.ServiceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    serviceFollowup.Id = params.Id
    errCode = serviceFollowupService.UpdateServiceFollowup(&serviceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// checkServiceFollowupParams
func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) {
    //if serviceFollowup.Number == "" {
    //    return ecode.InvalidParams, serviceFollowupModel
    //}
    //
    //if serviceFollowup.MemberId == 0 {
    //    return ecode.InvalidParams, serviceFollowupModel
    //}
    serviceFollowupModel = model.ServiceFollowup{
        ClientId:       serviceFollowup.ClientId,
        Number:         serviceFollowup.Number,
        ContactId:      serviceFollowup.ContactId,
        ServiceId:      serviceFollowup.ServiceId,
        MemberId:       serviceFollowup.MemberId,
        PlanId:         serviceFollowup.PlanId,
        SatisfactionId: serviceFollowup.Satisfaction,
        TimelyRateId:   serviceFollowup.TimelyRate,
        SolveRateId:    serviceFollowup.SolveRate,
        IsVisitId:      serviceFollowup.IsVisit,
        OldMemberId:    serviceFollowup.OldMemberId,
        Remark:         serviceFollowup.Remark,
        File:           serviceFollowup.File,
    }
    return ecode.OK, serviceFollowupModel
}
// List
//
//    @Tags        ServiceFollowup
//    @Summary    回访单管理列表
//    @Produce    application/json
//    @Param        object    body        request.GetServiceFollowupList    true    "参数"
//    @Success    200        {object}    contextx.Response{data=response.ServiceFollowupResponse}
//    @Router        /api/serviceFollowup/list [post]
func (con *ServiceFollowupApi) List(c *gin.Context) {
    var params request.GetServiceFollowupList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.KeywordType, params.Keyword, params.ServiceOrderId)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.ServiceFollowupResponse{
        List:  serviceFollowups,
        Count: int(total),
    })
}
package v1
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "github.com/gin-gonic/gin"
)
type ServiceFollowupApi struct{}
// Add
//
//    @Tags        ServiceFollowup
//    @Summary    添加服务跟进
//    @Produce    application/json
//    @Param        object    body        request.AddServiceFollowup    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/add [post]
func (s *ServiceFollowupApi) Add(c *gin.Context) {
    var params request.AddServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode, serviceFollowup := checkServiceFollowupParams(params.ServiceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    errCode = serviceFollowupService.AddServiceFollowup(&serviceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
//
//    @Tags        ServiceFollowup
//    @Summary    删除服务跟进
//    @Produce    application/json
//    @Param        object    body        request.DeleteServiceFollowup true    "查询参数"
//    @Success    200    {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/delete [delete]
func (s *ServiceFollowupApi) Delete(c *gin.Context) {
    var params request.DeleteServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := serviceFollowupService.DeleteServiceFollowup(params.Ids)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
//
//    @Tags        ServiceFollowup
//    @Summary    更新服务跟进
//    @Produce    application/json
//    @Param        object    body        request.UpdateServiceFollowup    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/serviceFollowup/update [put]
func (s *ServiceFollowupApi) Update(c *gin.Context) {
    var params request.UpdateServiceFollowup
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode, serviceFollowup := checkServiceFollowupParams(params.ServiceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    serviceFollowup.Id = params.Id
    errCode = serviceFollowupService.UpdateServiceFollowup(&serviceFollowup)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// checkServiceFollowupParams
func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) {
    //if serviceFollowup.Number == "" {
    //    return ecode.InvalidParams, serviceFollowupModel
    //}
    //
    //if serviceFollowup.MemberId == 0 {
    //    return ecode.InvalidParams, serviceFollowupModel
    //}
    serviceFollowupModel = model.ServiceFollowup{
        ClientId:       serviceFollowup.ClientId,
        Number:         serviceFollowup.Number,
        ContactId:      serviceFollowup.ContactId,
        ServiceOrderId: serviceFollowup.ServiceOrderId,
        MemberId:       serviceFollowup.MemberId,
        PlanId:         serviceFollowup.PlanId,
        SatisfactionId: serviceFollowup.Satisfaction,
        TimelyRateId:   serviceFollowup.TimelyRate,
        SolveRateId:    serviceFollowup.SolveRate,
        IsVisitId:      serviceFollowup.IsVisit,
        OldMemberId:    serviceFollowup.OldMemberId,
        Remark:         serviceFollowup.Remark,
        File:           serviceFollowup.File,
    }
    return ecode.OK, serviceFollowupModel
}
// List
//
//    @Tags        ServiceFollowup
//    @Summary    回访单管理列表
//    @Produce    application/json
//    @Param        object    body        request.GetServiceFollowupList    true    "参数"
//    @Success    200        {object}    contextx.Response{data=response.ServiceFollowupResponse}
//    @Router        /api/serviceFollowup/list [post]
func (con *ServiceFollowupApi) List(c *gin.Context) {
    var params request.GetServiceFollowupList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.KeywordType, params.Keyword, params.ServiceOrderId)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.ServiceFollowupResponse{
        List:  serviceFollowups,
        Count: int(total),
    })
}
docs/docs.go
@@ -10865,32 +10865,6 @@
                }
            }
        },
        "model.CustomerServiceSheet": {
            "type": "object",
            "properties": {
                "handleStatus": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "memberId": {
                    "type": "integer"
                },
                "number": {
                    "type": "string"
                },
                "priority": {
                    "type": "integer"
                },
                "serviceFollowupId": {
                    "type": "integer"
                },
                "serviceMode": {
                    "type": "integer"
                }
            }
        },
        "model.Department": {
            "type": "object",
            "properties": {
@@ -12174,9 +12148,6 @@
                "contactId": {
                    "type": "integer"
                },
                "customerServiceSheet": {
                    "$ref": "#/definitions/model.CustomerServiceSheet"
                },
                "file": {
                    "type": "string"
                },
@@ -12286,9 +12257,6 @@
                },
                "id": {
                    "type": "integer"
                },
                "orderManage": {
                    "$ref": "#/definitions/model.OrderManage"
                },
                "priorityLevel": {
                    "$ref": "#/definitions/model.PriorityLevel"
@@ -13907,7 +13875,7 @@
                "satisfaction": {
                    "type": "integer"
                },
                "serviceId": {
                "serviceOrderId": {
                    "type": "integer"
                },
                "solveRate": {
@@ -13945,10 +13913,6 @@
                    "description": "联系人id",
                    "type": "integer"
                },
                "contractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
@@ -13959,10 +13923,6 @@
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priorityLevelId": {
@@ -13987,6 +13947,14 @@
                },
                "saleChanceId": {
                    "description": "销售机会id",
                    "type": "integer"
                },
                "salesDetailsId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "serviceContractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "serviceManId": {
@@ -17060,7 +17028,7 @@
                "satisfaction": {
                    "type": "integer"
                },
                "serviceId": {
                "serviceOrderId": {
                    "type": "integer"
                },
                "solveRate": {
@@ -17098,10 +17066,6 @@
                    "description": "联系人id",
                    "type": "integer"
                },
                "contractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
@@ -17115,10 +17079,6 @@
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priorityLevelId": {
@@ -17145,6 +17105,14 @@
                    "description": "销售机会id",
                    "type": "integer"
                },
                "salesDetailsId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "serviceContractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "serviceManId": {
                    "description": "服务人员",
                    "type": "integer"
docs/swagger.json
@@ -10853,32 +10853,6 @@
                }
            }
        },
        "model.CustomerServiceSheet": {
            "type": "object",
            "properties": {
                "handleStatus": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "memberId": {
                    "type": "integer"
                },
                "number": {
                    "type": "string"
                },
                "priority": {
                    "type": "integer"
                },
                "serviceFollowupId": {
                    "type": "integer"
                },
                "serviceMode": {
                    "type": "integer"
                }
            }
        },
        "model.Department": {
            "type": "object",
            "properties": {
@@ -12162,9 +12136,6 @@
                "contactId": {
                    "type": "integer"
                },
                "customerServiceSheet": {
                    "$ref": "#/definitions/model.CustomerServiceSheet"
                },
                "file": {
                    "type": "string"
                },
@@ -12274,9 +12245,6 @@
                },
                "id": {
                    "type": "integer"
                },
                "orderManage": {
                    "$ref": "#/definitions/model.OrderManage"
                },
                "priorityLevel": {
                    "$ref": "#/definitions/model.PriorityLevel"
@@ -13895,7 +13863,7 @@
                "satisfaction": {
                    "type": "integer"
                },
                "serviceId": {
                "serviceOrderId": {
                    "type": "integer"
                },
                "solveRate": {
@@ -13933,10 +13901,6 @@
                    "description": "联系人id",
                    "type": "integer"
                },
                "contractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
@@ -13947,10 +13911,6 @@
                },
                "faultTypeId": {
                    "description": "故障类别id",
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priorityLevelId": {
@@ -13975,6 +13935,14 @@
                },
                "saleChanceId": {
                    "description": "销售机会id",
                    "type": "integer"
                },
                "salesDetailsId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "serviceContractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "serviceManId": {
@@ -17048,7 +17016,7 @@
                "satisfaction": {
                    "type": "integer"
                },
                "serviceId": {
                "serviceOrderId": {
                    "type": "integer"
                },
                "solveRate": {
@@ -17086,10 +17054,6 @@
                    "description": "联系人id",
                    "type": "integer"
                },
                "contractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "expectTime": {
                    "description": "希望处理时间",
                    "type": "string"
@@ -17103,10 +17067,6 @@
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "orderId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "priorityLevelId": {
@@ -17133,6 +17093,14 @@
                    "description": "销售机会id",
                    "type": "integer"
                },
                "salesDetailsId": {
                    "description": "销售订单id",
                    "type": "integer"
                },
                "serviceContractId": {
                    "description": "合同id",
                    "type": "integer"
                },
                "serviceManId": {
                    "description": "服务人员",
                    "type": "integer"
docs/swagger.yaml
@@ -633,23 +633,6 @@
      name:
        type: string
    type: object
  model.CustomerServiceSheet:
    properties:
      handleStatus:
        type: integer
      id:
        type: integer
      memberId:
        type: integer
      number:
        type: string
      priority:
        type: integer
      serviceFollowupId:
        type: integer
      serviceMode:
        type: integer
    type: object
  model.Department:
    properties:
      id:
@@ -1501,8 +1484,6 @@
        $ref: '#/definitions/model.Contact'
      contactId:
        type: integer
      customerServiceSheet:
        $ref: '#/definitions/model.CustomerServiceSheet'
      file:
        type: string
      id:
@@ -1581,8 +1562,6 @@
        type: integer
      id:
        type: integer
      orderManage:
        $ref: '#/definitions/model.OrderManage'
      priorityLevel:
        $ref: '#/definitions/model.PriorityLevel'
      priorityLevelId:
@@ -2675,7 +2654,7 @@
        type: string
      satisfaction:
        type: integer
      serviceId:
      serviceOrderId:
        type: integer
      solveRate:
        type: integer
@@ -2702,9 +2681,6 @@
      contactId:
        description: 联系人id
        type: integer
      contractId:
        description: 合同id
        type: integer
      expectTime:
        description: 希望处理时间
        type: string
@@ -2713,9 +2689,6 @@
        type: integer
      faultTypeId:
        description: 故障类别id
        type: integer
      orderId:
        description: 销售订单id
        type: integer
      priorityLevelId:
        description: 优先级别id
@@ -2734,6 +2707,12 @@
        type: string
      saleChanceId:
        description: 销售机会id
        type: integer
      salesDetailsId:
        description: 销售订单id
        type: integer
      serviceContractId:
        description: 合同id
        type: integer
      serviceManId:
        description: 服务人员
@@ -4828,7 +4807,7 @@
        type: string
      satisfaction:
        type: integer
      serviceId:
      serviceOrderId:
        type: integer
      solveRate:
        type: integer
@@ -4855,9 +4834,6 @@
      contactId:
        description: 联系人id
        type: integer
      contractId:
        description: 合同id
        type: integer
      expectTime:
        description: 希望处理时间
        type: string
@@ -4868,9 +4844,6 @@
        description: 故障类别id
        type: integer
      id:
        type: integer
      orderId:
        description: 销售订单id
        type: integer
      priorityLevelId:
        description: 优先级别id
@@ -4890,6 +4863,12 @@
      saleChanceId:
        description: 销售机会id
        type: integer
      salesDetailsId:
        description: 销售订单id
        type: integer
      serviceContractId:
        description: 合同id
        type: integer
      serviceManId:
        description: 服务人员
        type: integer
model/request/serviceFollowup.go
@@ -1,39 +1,39 @@
package request
import "aps_crm/constvar"
type AddServiceFollowup struct {
    ServiceFollowup
}
type ServiceFollowup struct {
    ClientId     int    `json:"clientId"`
    Number       string `json:"number"`
    ContactId    int    `json:"contactId"`
    ServiceId    int    `json:"serviceId"`
    MemberId     int    `json:"memberId"`
    PlanId       int    `json:"planId"`
    Satisfaction int    `json:"satisfaction"`
    TimelyRate   int    `json:"timelyRate"`
    SolveRate    int    `json:"solveRate"`
    IsVisit      int    `json:"isVisit"`
    OldMemberId  int    `json:"oldMemberId"`
    Remark       string `json:"remark"`
    File         string `json:"file"`
}
type UpdateServiceFollowup struct {
    Id int `json:"id"`
    ServiceFollowup
}
type GetServiceFollowupList struct {
    PageInfo
    KeywordType    constvar.ServiceFollowupKeywordType `json:"keywordType"`
    Keyword        string                              `json:"keyword"`
    ServiceOrderId int                                 `json:"serviceOrderId"` //服务回访单id
}
type DeleteServiceFollowup struct {
    Ids []int `json:"ids"`
}
package request
import "aps_crm/constvar"
type AddServiceFollowup struct {
    ServiceFollowup
}
type ServiceFollowup struct {
    ClientId       int    `json:"clientId"`
    Number         string `json:"number"`
    ContactId      int    `json:"contactId"`
    ServiceOrderId int    `json:"serviceOrderId"`
    MemberId       int    `json:"memberId"`
    PlanId         int    `json:"planId"`
    Satisfaction   int    `json:"satisfaction"`
    TimelyRate     int    `json:"timelyRate"`
    SolveRate      int    `json:"solveRate"`
    IsVisit        int    `json:"isVisit"`
    OldMemberId    int    `json:"oldMemberId"`
    Remark         string `json:"remark"`
    File           string `json:"file"`
}
type UpdateServiceFollowup struct {
    Id int `json:"id"`
    ServiceFollowup
}
type GetServiceFollowupList struct {
    PageInfo
    KeywordType    constvar.ServiceFollowupKeywordType `json:"keywordType"`
    Keyword        string                              `json:"keyword"`
    ServiceOrderId int                                 `json:"serviceOrderId"` //服务回访单id
}
type DeleteServiceFollowup struct {
    Ids []int `json:"ids"`
}
model/request/serviceOrder.go
@@ -7,8 +7,8 @@
type AddServiceOrder struct {
    ServiceNumber        string  `gorm:"service_number" json:"serviceNumber"`                                                                    // 服务单编号
    ClientId             int     `gorm:"client_id" json:"clientId"`                                                                              // 客户id
    ContractId           int     `gorm:"contract_id" json:"contractId"`                                                                          // 合同id
    OrderId              int     `gorm:"order_id" json:"orderId"`                                                                                // 销售订单id
    ServiceContractId    int     `gorm:"service_contract_id" json:"serviceContractId"`                                                           // 合同id
    SalesDetailsId       int     `gorm:"sales_details_id" json:"salesDetailsId"`                                                                 // 销售订单id
    Subject              string  `gorm:"subject" json:"subject"`                                                                                 // 主题
    ProductId            int     `gorm:"product_id" json:"productId"`                                                                            // 产品id
    ServiceTypeId        int     `gorm:"service_type_id" json:"serviceTypeId"`                                                                   // 服务方式id
model/serviceFollowup.go
@@ -10,30 +10,29 @@
type (
    ServiceFollowup struct {
        Id                   int                  `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        ClientId             int                  `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"`
        Client               Client               `json:"client" gorm:"foreignKey:ClientId"`
        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"`
        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"`
        Member               User                 `json:"Member" gorm:"foreignKey:MemberId"`
        PlanId               int                  `json:"planId" gorm:"column:plan_id;type:int;comment:服务计划id"`
        SatisfactionId       int                  `json:"satisfactionId" gorm:"column:satisfaction_id;type:int;comment:满意度id"`
        Satisfaction         Satisfaction         `json:"satisfaction" gorm:"foreignKey:SatisfactionId"`
        TimelyRateId         int                  `json:"timelyRateId" gorm:"column:timely_rate_id;type:int;comment:及时率id"`
        TimelyRate           TimelyRate           `json:"timelyRate" gorm:"foreignKey:TimelyRateId"`
        SolveRateId          int                  `json:"solveRateId" gorm:"column:solve_rate_id;type:int;comment:解决率id"`
        SolveRate            SolveRate            `json:"solveRate" gorm:"foreignKey:SolveRateId"`
        IsVisitId            int                  `json:"isVisitId" gorm:"column:is_visit_id;type:int;comment:服务人员是否来过id"`
        IsVisit              IsVisit              `json:"isVisit"  gorm:"foreignKey:IsVisitId"`
        OldMemberId          int                  `json:"oldMemberId" gorm:"column:old_member_id;type:int;comment:原服务人员"`
        OldMember            User                 `json:"oldMember" gorm:"foreignKey:OldMemberId"`
        Remark               string               `json:"remark" gorm:"column:remark;type:text;comment:备注"`
        File                 string               `json:"file" gorm:"column:file;type:varchar(255);comment:附件"`
        Id             int          `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        ClientId       int          `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"`
        Client         Client       `json:"client" gorm:"foreignKey:ClientId"`
        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"`
        ServiceOrderId int          `json:"serviceOrderId" gorm:"column:service_order_id;type:int;comment:客户服务单id"`
        ServiceOrder   ServiceOrder `gorm:"foreignKey:ServiceOrderId"`
        MemberId       int          `json:"memberId" gorm:"column:member_id;type:int;comment:服务人员id"`
        Member         User         `json:"Member" gorm:"foreignKey:MemberId"`
        PlanId         int          `json:"planId" gorm:"column:plan_id;type:int;comment:服务计划id"`
        SatisfactionId int          `json:"satisfactionId" gorm:"column:satisfaction_id;type:int;comment:满意度id"`
        Satisfaction   Satisfaction `json:"satisfaction" gorm:"foreignKey:SatisfactionId"`
        TimelyRateId   int          `json:"timelyRateId" gorm:"column:timely_rate_id;type:int;comment:及时率id"`
        TimelyRate     TimelyRate   `json:"timelyRate" gorm:"foreignKey:TimelyRateId"`
        SolveRateId    int          `json:"solveRateId" gorm:"column:solve_rate_id;type:int;comment:解决率id"`
        SolveRate      SolveRate    `json:"solveRate" gorm:"foreignKey:SolveRateId"`
        IsVisitId      int          `json:"isVisitId" gorm:"column:is_visit_id;type:int;comment:服务人员是否来过id"`
        IsVisit        IsVisit      `json:"isVisit"  gorm:"foreignKey:IsVisitId"`
        OldMemberId    int          `json:"oldMemberId" gorm:"column:old_member_id;type:int;comment:原服务人员"`
        OldMember      User         `json:"oldMember" gorm:"foreignKey:OldMemberId"`
        Remark         string       `json:"remark" gorm:"column:remark;type:text;comment:备注"`
        File           string       `json:"file" gorm:"column:file;type:varchar(255);comment:附件"`
        gorm.Model `json:"-"`
    }
model/serviceOrder.go
@@ -21,7 +21,6 @@
        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
        Product              Product            `gorm:"foreignKey:ProductId"`