Explorar el Código

Merge branch 'new_2.6'

ziwen hace 1 año
padre
commit
9505a7eeb5
Se han modificado 1 ficheros con 21 adiciones y 24 borrados
  1. 21 24
      controller/census/invoice_payment.go

+ 21 - 24
controller/census/invoice_payment.go

@@ -781,7 +781,7 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
 				v.SellerName = summaryList[i].SellerName
 				v.SellerGroupId = summaryList[i].SellerGroupId
 				v.SellerGroupName = summaryList[i].SellerGroupName
-				if seller, ok := sellerMap[summaryList[i].SellerId]; ok{
+				if seller, ok := sellerMap[summaryList[i].SellerId]; ok {
 					v.SellerType = sellerTypeMap[seller.DepartmentId]
 				}
 				v.PaymentId = summaryList[i].PaymentId
@@ -1660,8 +1660,8 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 		for _, v := range serviceAmountList {
 			if _, ok := serviceAmountMap[v.ContractRegisterId]; !ok {
 				serviceAmountMap[v.ContractRegisterId] = make(map[int]*fms.ContractServiceAmount)
-				serviceAmountMap[v.ContractRegisterId][v.ProductId] = v
 			}
+			serviceAmountMap[v.ContractRegisterId][v.ProductId] = v
 		}
 
 		var listErr, totalErr, totalGroupErr error
@@ -1680,7 +1680,6 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 			summaryPars := pars
 			summaryPars = append(summaryPars, queryRegisterIds)
 
-
 			summaryData, e := fms.GetNotInvoicePaymentCensusSummaryData(summaryCond, summaryPars)
 			if e != nil {
 				resp.FailMsg("获取失败", "获取商品到款汇总列表失败, Err: "+e.Error(), c)
@@ -1710,7 +1709,6 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 
 			summaryList = append(summaryList, noSummaryData...)
 
-
 			//fmt.Println("len(NotInvoiceSummaryMap):", len(NotInvoiceSummaryMap))
 
 			for _, v := range summaryList {
@@ -1745,7 +1743,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 						NotInvoiceSummaryMap[v.ContractRegisterId] = append(NotInvoiceSummaryMap[v.ContractRegisterId], &item)
 					}
 				} else if (v.ProductIds == "1,2" || v.ProductIds == "2,1") && len(NotInvoiceSummaryMap[v.ContractRegisterId]) == 0 {
-					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok{
+					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
 						item1 := fms.NotInvoicePaymentSummaryItem{
 							NotInvoicedAmountTotal: serviceAmount[2].ServiceAmount,
 							ServiceProductId:       2,
@@ -1769,7 +1767,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 					}
 
 				} else if v.ProductIds == "1" && len(NotInvoiceSummaryMap[v.ContractRegisterId]) == 0 {
-					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok{
+					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
 						item1 := fms.NotInvoicePaymentSummaryItem{
 							NotInvoicedAmountTotal: serviceAmount[1].ServiceAmount,
 							ServiceProductId:       1,
@@ -1782,7 +1780,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 						NotInvoiceSummaryMap[v.ContractRegisterId] = append(NotInvoiceSummaryMap[v.ContractRegisterId], &item1)
 					}
 				} else if v.ProductIds == "2" && len(NotInvoiceSummaryMap[v.ContractRegisterId]) == 0 {
-					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok{
+					if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
 						item2 := fms.NotInvoicePaymentSummaryItem{
 							NotInvoicedAmountTotal: serviceAmount[2].ServiceAmount,
 							ServiceProductId:       2,
@@ -1836,26 +1834,26 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 					}
 					if v.SellerId > 0 && v.RaiSellerId > 0 {
 						if v.ServiceProductId == 1 {
-							if seller, ok := sellerMap[v.SellerId]; ok{
+							if seller, ok := sellerMap[v.SellerId]; ok {
 								v.SellerType = sellerTypeMap[seller.DepartmentId]
 								v.SellerGroupId = seller.GroupId
 								v.SellerGroupName = seller.GroupName
 							}
 						} else {
-							if seller, ok := sellerMap[v.RaiSellerId]; ok{
+							if seller, ok := sellerMap[v.RaiSellerId]; ok {
 								v.SellerType = sellerTypeMap[seller.DepartmentId]
 								v.RaiSellerGroupId = seller.GroupId
 								v.RaiSellerGroupName = seller.GroupName
 							}
 						}
 					} else if v.SellerId > 0 && v.RaiSellerId == 0 {
-						if seller, ok := sellerMap[v.SellerId]; ok{
+						if seller, ok := sellerMap[v.SellerId]; ok {
 							v.SellerType = sellerTypeMap[seller.DepartmentId]
 							v.SellerGroupId = seller.GroupId
 							v.SellerGroupName = seller.GroupName
 						}
 					} else if v.SellerId == 0 && v.RaiSellerId > 0 {
-						if seller, ok := sellerMap[v.RaiSellerId]; ok{
+						if seller, ok := sellerMap[v.RaiSellerId]; ok {
 							v.SellerType = sellerTypeMap[seller.DepartmentId]
 							v.RaiSellerGroupId = seller.GroupId
 							v.RaiSellerGroupName = seller.GroupName
@@ -1912,7 +1910,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 				if rate == 0.0 {
 					rate = 1.0
 				}
-				if _,ok := contractIdSumMap[v.ContractRegisterId]; !ok{
+				if _, ok := contractIdSumMap[v.ContractRegisterId]; !ok {
 					contractIdSumMap[v.ContractRegisterId] = 1
 					contractAmount += v.ContractAmount / v.RMBRate
 				}
@@ -1975,7 +1973,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
 				} else {
 					invoiceSumMap[v.CurrencyUnit] += v.PaymentAmount
 				}
-				if _,ok := contractIdSumMap[v.ContractRegisterId]; !ok{
+				if _, ok := contractIdSumMap[v.ContractRegisterId]; !ok {
 					contractIdSumMap[v.ContractRegisterId] = 1
 					contractSumMap[v.CurrencyUnit] += v.ContractAmount
 				}
@@ -2222,7 +2220,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
 				v.SellerName = summaryList[i].SellerName
 				v.SellerGroupId = summaryList[i].SellerGroupId
 				v.SellerGroupName = summaryList[i].SellerGroupName
-				if seller, ok := sellerMap[summaryList[i].SellerId]; ok{
+				if seller, ok := sellerMap[summaryList[i].SellerId]; ok {
 					v.SellerType = sellerTypeMap[seller.DepartmentId]
 				}
 
@@ -2516,7 +2514,7 @@ 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
-						if seller, ok := sellerMap[item.SellerId]; ok{
+						if seller, ok := sellerMap[item.SellerId]; ok {
 							item.SellerType = sellerTypeMap[seller.DepartmentId]
 						}
 						dataRow2.AddCell().SetString(item.SellerName)      // 销售
@@ -2524,7 +2522,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 						dataRow2.AddCell().SetString(item.SellerType)      // 销售类型
 					} else {
 						item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
-						if seller, ok := sellerMap[item.RaiSellerId]; ok{
+						if seller, ok := sellerMap[item.RaiSellerId]; ok {
 							item.SellerType = sellerTypeMap[seller.DepartmentId]
 						}
 						dataRow2.AddCell().SetString(item.RaiSellerName)      // 销售
@@ -2533,7 +2531,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 					}
 				} else if item.SellerId > 0 && item.RaiSellerId == 0 {
 					item.SellerGroupName = sellerMap[item.SellerId].GroupName
-					if seller, ok := sellerMap[item.SellerId]; ok{
+					if seller, ok := sellerMap[item.SellerId]; ok {
 						item.SellerType = sellerTypeMap[seller.DepartmentId]
 					}
 					dataRow2.AddCell().SetString(item.SellerName)      // 销售
@@ -2541,7 +2539,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 					dataRow2.AddCell().SetString(item.SellerType)      // 销售类型
 				} else if item.SellerId == 0 && item.RaiSellerId > 0 {
 					item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
-					if seller, ok := sellerMap[item.RaiSellerId]; ok{
+					if seller, ok := sellerMap[item.RaiSellerId]; ok {
 						item.SellerType = sellerTypeMap[seller.DepartmentId]
 					}
 					dataRow2.AddCell().SetString(item.RaiSellerName)      // 销售
@@ -2553,13 +2551,12 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 
 				dataRow.AddCell().SetString(fmt.Sprintf("%.2f", item.NotInvoicedAmountTotal)) // 未开票金额
 
-				dataRow.AddCell().SetString(serviceProductIdMap[item.ServiceProductId])       // 套餐类型
-
+				dataRow.AddCell().SetString(serviceProductIdMap[item.ServiceProductId]) // 套餐类型
 
 				if item.SellerId > 0 && item.RaiSellerId > 0 {
 					if item.ServiceProductId == 1 {
 						item.SellerGroupName = sellerMap[item.SellerId].GroupName
-						if seller, ok := sellerMap[item.SellerId]; ok{
+						if seller, ok := sellerMap[item.SellerId]; ok {
 							item.SellerType = sellerTypeMap[seller.DepartmentId]
 						}
 						dataRow.AddCell().SetString(item.SellerName)      // 销售
@@ -2567,7 +2564,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 						dataRow.AddCell().SetString(item.SellerType)      // 销售类型
 					} else {
 						item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
-						if seller, ok := sellerMap[item.RaiSellerId]; ok{
+						if seller, ok := sellerMap[item.RaiSellerId]; ok {
 							item.SellerType = sellerTypeMap[seller.DepartmentId]
 						}
 						dataRow.AddCell().SetString(item.RaiSellerName)      // 销售
@@ -2576,7 +2573,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 					}
 				} else if item.SellerId > 0 && item.RaiSellerId == 0 {
 					item.SellerGroupName = sellerMap[item.SellerId].GroupName
-					if seller, ok := sellerMap[item.SellerId]; ok{
+					if seller, ok := sellerMap[item.SellerId]; ok {
 						item.SellerType = sellerTypeMap[seller.DepartmentId]
 					}
 					dataRow.AddCell().SetString(item.SellerName)      // 销售
@@ -2584,7 +2581,7 @@ func ExportNotInvoiceCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
 					dataRow.AddCell().SetString(item.SellerType)      // 销售类型
 				} else if item.SellerId == 0 && item.RaiSellerId > 0 {
 					item.RaiSellerGroupName = sellerMap[item.RaiSellerId].GroupName
-					if seller, ok := sellerMap[item.RaiSellerId]; ok{
+					if seller, ok := sellerMap[item.RaiSellerId]; ok {
 						item.SellerType = sellerTypeMap[seller.DepartmentId]
 					}
 					dataRow.AddCell().SetString(item.RaiSellerName)      // 销售