|
@@ -760,7 +760,7 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
sellerTypeMap := map[int]string{2: "FICC销售", 5: "权益销售"}
|
|
|
- sellerList, e := crmService.GetSellerDepartmentListWithGroupAndTeam()
|
|
|
+ sellerList, e := crmService.GetSellerDepartmentListWithEnable()
|
|
|
if e != nil {
|
|
|
resp.FailData("获取销售失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
@@ -781,7 +781,9 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
v.SellerName = summaryList[i].SellerName
|
|
|
v.SellerGroupId = summaryList[i].SellerGroupId
|
|
|
v.SellerGroupName = summaryList[i].SellerGroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[summaryList[i].SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[summaryList[i].SellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
v.PaymentId = summaryList[i].PaymentId
|
|
|
v.PaymentDate = utils.TimeTransferString(utils.FormatDate, summaryList[i].PaymentDate)
|
|
|
v.PaymentAmount = summaryList[i].PaymentAmount
|
|
@@ -887,9 +889,9 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
totalGroupErr = fmt.Errorf("获取货币列表失败, Err: %s", e.Error())
|
|
|
return
|
|
|
}
|
|
|
- unitMap := make(map[string]string)
|
|
|
+ //unitMap := make(map[string]string)
|
|
|
for i := range currencyList {
|
|
|
- unitMap[currencyList[i].Code] = currencyList[i].UnitName
|
|
|
+ //unitMap[currencyList[i].Code] = currencyList[i].UnitName
|
|
|
invoiceCurrencyTotals = append(invoiceCurrencyTotals, &fms.InvoiceListCurrencyTotal{
|
|
|
Name: currencyList[i].Name,
|
|
|
UnitName: currencyList[i].UnitName,
|
|
@@ -1740,14 +1742,14 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
// //summaryIds = append(summaryIds, summaryList[i].SummaryId)
|
|
|
//}
|
|
|
|
|
|
- fmt.Println("len(NotInvoiceSummaryMap):", len(NotInvoiceSummaryMap))
|
|
|
+ //fmt.Println("len(NotInvoiceSummaryMap):", len(NotInvoiceSummaryMap))
|
|
|
|
|
|
for _, v := range summaryList {
|
|
|
- fmt.Println("ProductIds:", v.ProductIds)
|
|
|
- fmt.Println("ContractRegisterId:", v.ContractRegisterId)
|
|
|
- fmt.Println("ServiceProductId:", v.ServiceProductId)
|
|
|
- fmt.Println("RegisterId:", v.RegisterId)
|
|
|
- fmt.Println("len(NotInvoiceSummaryMap[v.RegisterId]):", len(NotInvoiceSummaryMap[v.ContractRegisterId]))
|
|
|
+ //fmt.Println("ProductIds:", v.ProductIds)
|
|
|
+ //fmt.Println("ContractRegisterId:", v.ContractRegisterId)
|
|
|
+ //fmt.Println("ServiceProductId:", v.ServiceProductId)
|
|
|
+ //fmt.Println("RegisterId:", v.RegisterId)
|
|
|
+ //fmt.Println("len(NotInvoiceSummaryMap[v.RegisterId]):", len(NotInvoiceSummaryMap[v.ContractRegisterId]))
|
|
|
if (v.ProductIds == "1,2" || v.ProductIds == "2,1") && len(NotInvoiceSummaryMap[v.ContractRegisterId]) == 1 {
|
|
|
if v.ServiceProductId == 1 {
|
|
|
item := fms.NotInvoicePaymentSummaryItem{
|
|
@@ -1821,7 +1823,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
// 重组汇总数据
|
|
|
- sellerList, e := crmService.GetSellerDepartmentListWithGroupAndTeam()
|
|
|
+ sellerList, e := crmService.GetSellerDepartmentListWithEnable()
|
|
|
if e != nil {
|
|
|
resp.FailData("获取销售失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
@@ -1861,20 +1863,28 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if v.ServiceProductId == 1 {
|
|
|
v.SellerGroupId = sellerMap[v.SellerId].GroupId
|
|
|
v.SellerGroupName = sellerMap[v.SellerId].GroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[v.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[v.SellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
} else {
|
|
|
v.RaiSellerGroupId = sellerMap[v.RaiSellerId].GroupId
|
|
|
v.RaiSellerGroupName = sellerMap[v.RaiSellerId].GroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[v.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[v.RaiSellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
}
|
|
|
} else if v.SellerId > 0 && v.RaiSellerId == 0 {
|
|
|
v.SellerGroupId = sellerMap[v.SellerId].GroupId
|
|
|
v.SellerGroupName = sellerMap[v.SellerId].GroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[v.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[v.SellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
} else if v.SellerId == 0 && v.RaiSellerId > 0 {
|
|
|
v.RaiSellerGroupId = sellerMap[v.RaiSellerId].GroupId
|
|
|
v.RaiSellerGroupName = sellerMap[v.RaiSellerId].GroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[v.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[v.RaiSellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2242,7 +2252,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
// }
|
|
|
// serviceAmountMap[v.ContractRegisterId][v.ProductId] = v
|
|
|
//}
|
|
|
- sellerList, e := crmService.GetSellerDepartmentListWithGroupAndTeam()
|
|
|
+ sellerList, e := crmService.GetSellerDepartmentListWithEnable()
|
|
|
if e != nil {
|
|
|
resp.FailData("获取销售失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
@@ -2263,7 +2273,10 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
v.SellerName = summaryList[i].SellerName
|
|
|
v.SellerGroupId = summaryList[i].SellerGroupId
|
|
|
v.SellerGroupName = summaryList[i].SellerGroupName
|
|
|
- v.SellerType = sellerTypeMap[sellerMap[summaryList[i].SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[summaryList[i].SellerId]; ok{
|
|
|
+ v.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
+
|
|
|
v.PaymentId = summaryList[i].PaymentId
|
|
|
v.PaymentDate = utils.TimeTransferString(utils.FormatDate, summaryList[i].PaymentDate)
|
|
|
v.PaymentAmount = summaryList[i].PaymentAmount
|
|
@@ -2493,7 +2506,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
incomeSummaryItemList := make([]*fms.NotPaymentCensusItem, 0)
|
|
|
incomeSummaryItemList = list
|
|
|
|
|
|
- sellerList, e := crmService.GetSellerDepartmentListWithGroupAndTeam()
|
|
|
+ sellerList, e := crmService.GetSellerDepartmentListWithEnable()
|
|
|
if e != nil {
|
|
|
resp.FailData("获取销售失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
@@ -2555,26 +2568,34 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
if item.SellerId > 0 && item.RaiSellerId > 0 {
|
|
|
if item.ServiceProductId == 1 {
|
|
|
item.SellerGroupName = sellerMap[item.SellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.SellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow2.AddCell().SetString(item.SellerName) // 销售
|
|
|
dataRow2.AddCell().SetString(item.SellerGroupName) // 销售组别
|
|
|
dataRow2.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
} else {
|
|
|
item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.RaiSellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow2.AddCell().SetString(item.RaiSellerName) // 销售
|
|
|
dataRow2.AddCell().SetString(item.RaiSellerGroupName) // 销售组别
|
|
|
dataRow2.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
}
|
|
|
} else if item.SellerId > 0 && item.RaiSellerId == 0 {
|
|
|
item.SellerGroupName = sellerMap[item.SellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.SellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow2.AddCell().SetString(item.SellerName) // 销售
|
|
|
dataRow2.AddCell().SetString(item.SellerGroupName) // 销售组别
|
|
|
dataRow2.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
} else if item.SellerId == 0 && item.RaiSellerId > 0 {
|
|
|
item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.RaiSellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow2.AddCell().SetString(item.RaiSellerName) // 销售
|
|
|
dataRow2.AddCell().SetString(item.RaiSellerGroupName) // 销售组别
|
|
|
dataRow2.AddCell().SetString(item.SellerType) // 销售类型
|
|
@@ -2590,26 +2611,34 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
if item.SellerId > 0 && item.RaiSellerId > 0 {
|
|
|
if item.ServiceProductId == 1 {
|
|
|
item.SellerGroupName = sellerMap[item.SellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.SellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow.AddCell().SetString(item.SellerName) // 销售
|
|
|
dataRow.AddCell().SetString(item.SellerGroupName) // 销售组别
|
|
|
dataRow.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
} else {
|
|
|
item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.RaiSellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow.AddCell().SetString(item.RaiSellerName) // 销售
|
|
|
dataRow.AddCell().SetString(item.RaiSellerGroupName) // 销售组别
|
|
|
dataRow.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
}
|
|
|
} else if item.SellerId > 0 && item.RaiSellerId == 0 {
|
|
|
item.SellerGroupName = sellerMap[item.SellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.SellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.SellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow.AddCell().SetString(item.SellerName) // 销售
|
|
|
dataRow.AddCell().SetString(item.SellerGroupName) // 销售组别
|
|
|
dataRow.AddCell().SetString(item.SellerType) // 销售类型
|
|
|
} else if item.SellerId == 0 && item.RaiSellerId > 0 {
|
|
|
item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
|
|
|
- item.SellerType = sellerTypeMap[sellerMap[item.RaiSellerId].DepartmentId]
|
|
|
+ if seller, ok := sellerMap[item.RaiSellerId]; ok{
|
|
|
+ item.SellerType = sellerTypeMap[seller.DepartmentId]
|
|
|
+ }
|
|
|
dataRow.AddCell().SetString(item.RaiSellerName) // 销售
|
|
|
dataRow.AddCell().SetString(item.RaiSellerGroupName) // 销售组别
|
|
|
dataRow.AddCell().SetString(item.SellerType) // 销售类型
|