ziwen 1 年之前
父节点
当前提交
a24242342d
共有 1 个文件被更改,包括 0 次插入140 次删除
  1. 0 140
      controller/census/invoice_payment.go

+ 0 - 140
controller/census/invoice_payment.go

@@ -1236,59 +1236,6 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
 
 				//fmt.Println("partAccumulate:",partAccumulate)
 			}
-			//else {
-			//	//刚好跨过20230301的,各查一部分
-			//	//fmt.Println("查询3")
-			//	var historyAmountTotal float64
-			//	histrtyCond += ` AND (invoice_time BETWEEN ? AND '2023-03-01 23:59:59' ) `
-			//	historyPars = append(historyPars, st)
-			//	//// 开票到款金额合计(换算后)
-			//	var amountTotal float64
-			//	results, e := fms.GetIncomeHistory(histrtyCond, historyPars)
-			//	if e != nil {
-			//		err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
-			//		return
-			//	}
-			//	var amountSum float64
-			//	for _, result := range results {
-			//		incomeChart.DataList = append(incomeChart.DataList, result)
-			//		amountSum += result.Amount
-			//	}
-			//	amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
-			//	accumulate += amountTotal
-			//	historyAmountTotal = amountTotal
-			//
-			//	cond += ` AND ((c.invoice_time BETWEEN '2023-03-02 00:00:00' AND ?) or (d.invoice_time BETWEEN '2023-03-02 00:00:00' AND ?))`
-			//	pars = append(pars, ed, ed)
-			//	summaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(cond, pars)
-			//	if e != nil {
-			//		return
-			//	}
-			//
-			//	if len(summaryIds) > 0 {
-			//		amountCond := `a.id IN ? AND (a.invoice_id <> 0 OR (a.payment_id <> 0 AND a.invoice_id =0))`
-			//		amountPars := make([]interface{}, 0)
-			//		amountPars = append(amountPars, summaryIds)
-			//		results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
-			//		if e != nil {
-			//			err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
-			//			return
-			//		}
-			//		var amountSum float64
-			//		for _, result := range results {
-			//			incomeChart.DataList = append(incomeChart.DataList, result)
-			//			amountSum += result.Amount
-			//		}
-			//		amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
-			//		accumulate += amountTotal
-			//	}
-			//	if req.ListParam == "4" {
-			//		totalMoneySlice = append(totalMoneySlice, accumulate)
-			//	} else {
-			//		totalMoneySlice = append(totalMoneySlice, amountTotal+historyAmountTotal)
-			//	}
-			//
-			//}
 
 		}
 
@@ -1375,58 +1322,6 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
 				}
 				//fmt.Println("partHistoryAccumulate:",partHistoryAccumulate)
 			}
-			//else {
-			//	//刚好跨过20230301的,各查一部分
-			//	var historyAmountTotal float64
-			//	prevHistoryCond += ` AND (invoice_time BETWEEN ? AND '2023-03-01 23:59:59' ) `
-			//	prevHistoryPars = append(prevHistoryPars, prevSt)
-			//	// 开票到款金额合计(换算后)
-			//	var amountTotal float64
-			//	results, e := fms.GetIncomeHistory(prevHistoryCond, prevHistoryPars)
-			//	if e != nil {
-			//		err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
-			//		return
-			//	}
-			//	var amountSum float64
-			//	for _, result := range results {
-			//		amountSum += result.Amount
-			//	}
-			//	amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
-			//	historyAccumulate += amountTotal
-			//
-			//
-			//	prevCond += ` AND ((c.invoice_time BETWEEN '2023-03-02 00:00:00' AND ?) or (d.invoice_time BETWEEN '2023-03-02 00:00:00' AND ?))`
-			//	prevPars = append(prevPars, prevEd, prevEd)
-			//	prevSummaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(prevCond, prevPars)
-			//	if e != nil {
-			//		return
-			//	}
-			//
-			//	// 开票到款金额合计(换算后)
-			//	var prevAmountTotal float64
-			//
-			//	if len(prevSummaryIds) > 0 {
-			//		amountCond := `a.id IN ? AND (a.invoice_id <> 0 OR (a.payment_id <> 0 AND a.invoice_id =0))`
-			//		amountPars := make([]interface{}, 0)
-			//		amountPars = append(amountPars, prevSummaryIds)
-			//		results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
-			//		if e != nil {
-			//			err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
-			//			return
-			//		}
-			//		var amountSum float64
-			//		for _, result := range results {
-			//			amountSum += result.Amount
-			//		}
-			//		prevAmountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
-			//		historyAccumulate += prevAmountTotal
-			//	}
-			//	if req.ListParam == "4" {
-			//		prevTotalMoneySlice = append(prevTotalMoneySlice, historyAccumulate)
-			//	} else {
-			//		prevTotalMoneySlice = append(prevTotalMoneySlice, prevAmountTotal+historyAmountTotal)
-			//	}
-			//}
 			if req.ListParam == "1" && i == j {
 				if i == 0{
 					dateSlice = append(dateSlice, startDateTime.AddDate(0, 2, 0).Format("06/01"))
@@ -1457,41 +1352,6 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
 			}
 		}
 	}
-	//for i, v := range dataList {
-	//	amountTotal, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", v.Amount), 64)
-	//	accumulate += amountTotal
-	//
-	//	if req.ListParam == "4" {
-	//		totalMoneySlice = append(totalMoneySlice, accumulate)
-	//	} else {
-	//		totalMoneySlice = append(totalMoneySlice, amountTotal)
-	//	}
-	//	if req.ListParam == "1" {
-	//		i = i + 2
-	//	} else if req.ListParam == "2" {
-	//		i = i + 5
-	//	} else if req.ListParam == "3" {
-	//		i = i + 11
-	//	}
-	//}
-	//
-	//for i, v := range historydataList {
-	//	historyAmountTotal, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", v.Amount), 64)
-	//	historyAccumulate += historyAmountTotal
-	//
-	//	if req.ListParam == "4" {
-	//		prevTotalMoneySlice = append(prevTotalMoneySlice, historyAccumulate)
-	//	} else {
-	//		prevTotalMoneySlice = append(prevTotalMoneySlice, historyAmountTotal)
-	//	}
-	//	if req.ListParam == "1" {
-	//		i = i + 2
-	//	} else if req.ListParam == "2" {
-	//		i = i + 5
-	//	} else if req.ListParam == "3" {
-	//		i = i + 11
-	//	}
-	//}
 
 	fmt.Println("prevTotalMoneySlice:", len(prevTotalMoneySlice))
 	fmt.Println("totalMoneySlice:", len(totalMoneySlice))