fix
wangpengfei
2023-08-18 9a7e0a7da01a9f9625ceaca0c61a59c540c6438f
api/v1/serviceFollowup.go
@@ -7,7 +7,6 @@
   "aps_crm/pkg/contextx"
   "aps_crm/pkg/ecode"
   "github.com/gin-gonic/gin"
   "strconv"
)
type ServiceFollowupApi struct{}
@@ -47,17 +46,17 @@
//   @Tags      ServiceFollowup
//   @Summary   删除服务跟进
//   @Produce   application/json
//   @Param      id   path      int   true   "查询参数"
//   @Param      object   body      request.DeleteServiceFollowup true   "查询参数"
//   @Success   200   {object}   contextx.Response{}
//   @Router      /api/serviceFollowup/delete/{id} [delete]
//   @Router      /api/serviceFollowup/delete [delete]
func (s *ServiceFollowupApi) Delete(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   var params request.DeleteServiceFollowup
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
      return
   }
   id, _ := strconv.Atoi(c.Param("id"))
   errCode := serviceFollowupService.DeleteServiceFollowup(id)
   errCode := serviceFollowupService.DeleteServiceFollowup(params.Ids)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
@@ -87,6 +86,8 @@
      return
   }
   serviceFollowup.Id = params.Id
   errCode = serviceFollowupService.UpdateServiceFollowup(&serviceFollowup)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
@@ -94,30 +95,6 @@
   }
   ctx.Ok()
}
// List
//
//   @Tags      ServiceFollowup
//   @Summary   服务跟进列表
//   @Produce   application/json
//   @Success   200   {object}   contextx.Response{data=response.ServiceFollowupResponse}
//   @Router      /api/serviceFollowup/list [get]
func (s *ServiceFollowupApi) List(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   if !ok {
      return
   }
   list, errCode := serviceFollowupService.GetServiceFollowupList()
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.ServiceFollowupResponse{
      List: list,
   })
}
// checkServiceFollowupParams
@@ -131,20 +108,47 @@
   //}
   serviceFollowupModel = model.ServiceFollowup{
      ClientId:     serviceFollowup.ClientId,
      Number:       serviceFollowup.Number,
      ContactId:    serviceFollowup.ContactId,
      ServiceId:    serviceFollowup.ServiceId,
      MemberId:     serviceFollowup.MemberId,
      PlanId:       serviceFollowup.PlanId,
      Satisfaction: serviceFollowup.Satisfaction,
      TimelyRate:   serviceFollowup.TimelyRate,
      SolveRate:    serviceFollowup.SolveRate,
      IsVisit:      serviceFollowup.IsVisit,
      OldMemberId:  serviceFollowup.OldMemberId,
      Remark:       serviceFollowup.Remark,
      File:         serviceFollowup.File,
      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),
   })
}