zhangqian
2024-03-29 f14c22065bf5c3b615a8d909c29b90f37ef6419d
api/v1/salesDetails.go
@@ -377,7 +377,7 @@
      storeInfo := inputProductMap[product.Number]
      if storeInfo == nil { //没有入库信息
         storeInfo = &response.StoreInfo{
            Name:            product.Number,
            Name:            product.Name,
            Number:          product.Number,
            OrderAmount:     product.Amount,
            FinishAmount:    decimal.Decimal{},
@@ -470,7 +470,7 @@
      return
   }
   err = model.NewSalesDetailsSearch().SetId(salesDetails.Id).UpdateByMap(map[string]interface{}{"status": constvar.OverOutbound})
   err = model.NewSalesDetailsSearch().SetId(salesDetails.Id).UpdateByMap(map[string]interface{}{"status": constvar.WaitOutbound})
   if err != nil {
      ctx.FailWithMsg(ecode.DBErr, "修改失败")
@@ -581,15 +581,15 @@
   if !ok {
      return
   }
   //clientName := ""
   //if params.ClientId > 0 {
   //   first, err := model.NewClientSearch(nil).SetId(params.ClientId).First()
   //   if err != nil {
   //      ctx.FailWithMsg(ecode.UnknownErr, "客户信息查询失败")
   //      return
   //   }
   //   clientName = first.Name
   //}
   clientName := ""
   if params.ClientId > 0 {
      first, err := model.NewClientSearch(nil).SetId(params.ClientId).First()
      if err != nil {
         ctx.FailWithMsg(ecode.UnknownErr, "客户信息查询失败")
         return
      }
      clientName = first.Name
   }
   m := make(map[string]interface{})
   m["status"] = params.Status
   m["project_id"] = params.ProjectId
@@ -637,14 +637,15 @@
   clientAps := crm_aps.NewCrmAndApsGrpcServiceClient(grpc_init.CrmApsGrpcServiceConn)
   _, err = clientAps.SendSalesDetailsToApsProject(c, &crm_aps.SendSalesDetailsToApsProjectRequest{
      Number:       params.Number,
      ClientName:   params.Client.Name,
      ClientName:   clientName,
      MemberName:   params.Member.Username,
      SignTime:     params.SignTime,
      DeliveryDate: params.DeliveryDate,
      Source:       params.Source,
      Source:       "CRM",
      ProductTotal: total.IntPart(),
      ProjectId:    params.ProjectId,
      Products:     ApsProducts,
      DeliverType:  int64(params.DeliverType),
   })
   if err != nil {
      //状态还原