|
@@ -1262,21 +1262,23 @@ func (rg *RegisterController) Invoice(c *gin.Context) {
|
|
|
resp.FailMsg("获取到款数据失败", "获取到款数据失败, Err: "+err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- sellerItem := sellerMap[newInvoice[0].SellerId]
|
|
|
- if sellerItem == nil {
|
|
|
- resp.Fail("销售信息异常", c)
|
|
|
- return
|
|
|
- }
|
|
|
- invoiceItem.SellerId = sellerItem.SellerId
|
|
|
- invoiceItem.SellerName = sellerItem.SellerName
|
|
|
- invoiceItem.SellerGroupId = sellerItem.GroupId
|
|
|
- invoiceItem.SellerGroupName = sellerItem.GroupName
|
|
|
- invoiceItem.SellerTeamId = sellerItem.TeamId
|
|
|
- invoiceItem.SellerTeamName = sellerItem.TeamName
|
|
|
- e = invoiceItem.Update([]string{"SellerId","SellerName","SellerGroupId","SellerGroupName","SellerTeamId","SellerTeamName"})
|
|
|
- if e != nil {
|
|
|
- resp.FailMsg("更新到款销售失败", "更新到款销售失败, Err: "+e.Error(), c)
|
|
|
- return
|
|
|
+ if err == nil {
|
|
|
+ sellerItem := sellerMap[newInvoice[0].SellerId]
|
|
|
+ if sellerItem == nil {
|
|
|
+ resp.Fail("销售信息异常", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ invoiceItem.SellerId = sellerItem.SellerId
|
|
|
+ invoiceItem.SellerName = sellerItem.SellerName
|
|
|
+ invoiceItem.SellerGroupId = sellerItem.GroupId
|
|
|
+ invoiceItem.SellerGroupName = sellerItem.GroupName
|
|
|
+ invoiceItem.SellerTeamId = sellerItem.TeamId
|
|
|
+ invoiceItem.SellerTeamName = sellerItem.TeamName
|
|
|
+ e = invoiceItem.Update([]string{"SellerId","SellerName","SellerGroupId","SellerGroupName","SellerTeamId","SellerTeamName"})
|
|
|
+ if e != nil {
|
|
|
+ resp.FailMsg("更新到款销售失败", "更新到款销售失败, Err: "+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|