|
@@ -1463,7 +1463,6 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
fmt.Println("prevTotalMoneySlice:", len(prevTotalMoneySlice))
|
|
|
fmt.Println("totalMoneySlice:", len(totalMoneySlice))
|
|
|
|
|
|
-
|
|
|
if req.CompanyType != 3 {
|
|
|
|
|
|
for i := range prevTotalMoneySlice {
|
|
@@ -1490,37 +1489,22 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
|
|
|
|
|
|
|
|
|
- if req.ListParam == "0" {
|
|
|
- for i := range prevTotalMoneySlice {
|
|
|
- totalMoneySlice[i], _ = strconv.ParseFloat(fmt.Sprintf("%.2f", prevTotalMoneySlice[i] - totalMoneySlice[i] ), 64)
|
|
|
- var yoy float64
|
|
|
- var yoyStr string
|
|
|
- if i > 1 {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- yoy = (totalMoneySlice[i] + totalMoneySlice[i-1] + totalMoneySlice[i-2]) / 3
|
|
|
- yoyStr = fmt.Sprintf("%.4f", yoy)
|
|
|
- yoySlice = append(yoySlice, yoyStr)
|
|
|
- } else {
|
|
|
- yoySlice = append(yoySlice, "")
|
|
|
- }
|
|
|
+ for i := range prevTotalMoneySlice {
|
|
|
+ totalMoneySlice[i], _ = strconv.ParseFloat(fmt.Sprintf("%.2f", prevTotalMoneySlice[i]-totalMoneySlice[i]), 64)
|
|
|
+
|
|
|
+ var yoy float64
|
|
|
+ var yoyStr string
|
|
|
+ if i > 1 && req.ListParam == "0" {
|
|
|
+
|
|
|
+ yoy = (totalMoneySlice[i] + totalMoneySlice[i-1] + totalMoneySlice[i-2]) / 3
|
|
|
+ yoyStr = fmt.Sprintf("%.4f", yoy)
|
|
|
+ yoySlice = append(yoySlice, yoyStr)
|
|
|
+ } else {
|
|
|
+ yoySlice = append(yoySlice, "")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
incomeChart.Title = "开票到款统计图"
|
|
|
incomeChart.Date = dateSlice
|
|
|
incomeChart.TotalMoney = totalMoneySlice
|
|
@@ -1676,7 +1660,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
page := new(base.Page)
|
|
|
page.SetPageSize(req.PageSize)
|
|
|
page.SetCurrent(req.Current)
|
|
|
-
|
|
|
+
|
|
|
if req.SortType == "" {
|
|
|
req.SortType = "asc"
|
|
|
}
|
|
@@ -1708,7 +1692,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
page.SetCurrent(1)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
cond += ` AND b.contract_amount <> b.invoiced_amount AND b.is_deleted = 0 AND b.contract_amount <> b.payment_amount AND b.contract_status <> 4 `
|
|
|
registerList, total, e := fms.GetInvoiceCensusPageList(page, cond, pars)
|
|
|
if e != nil {
|
|
@@ -1771,7 +1755,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
|
|
|
NotInvoiceSummaryMap := make(map[int][]*fms.NotInvoicePaymentSummaryItem, 0)
|
|
|
for _, v := range summaryList {
|
|
|
-
|
|
|
+
|
|
|
NotInvoiceSummaryMap[v.RegisterId] = append(NotInvoiceSummaryMap[v.RegisterId], v)
|
|
|
}
|
|
|
|
|
@@ -1791,17 +1775,17 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
summaryList = append(summaryList, noSummaryData...)
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
for _, v := range summaryList {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
fmt.Println("len(NotInvoiceSummaryMap[v.RegisterId]):", len(NotInvoiceSummaryMap[v.ContractRegisterId]))
|
|
|
if (v.ProductIds == "1,2" || v.ProductIds == "2,1") && len(NotInvoiceSummaryMap[v.ContractRegisterId]) == 1 {
|
|
|
|
|
@@ -1915,10 +1899,10 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
|
|
|
for registerId, list := range NotInvoiceSummaryMap {
|
|
|
for _, v := range list {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if v.NotInvoicedAmountTotal == 0 {
|
|
|
if v.InvoiceAmountTotal > v.PaymentAmountTotal {
|
|
|
|
|
@@ -2201,7 +2185,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
page := new(base.Page)
|
|
|
page.SetPageSize(req.PageSize)
|
|
|
page.SetCurrent(req.Current)
|
|
|
-
|
|
|
+
|
|
|
if req.SortType == "" {
|
|
|
req.SortType = "asc"
|
|
|
}
|
|
@@ -2234,7 +2218,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
}
|
|
|
fmt.Println("queryRegisterIds:", queryRegisterIds)
|
|
|
|
|
|
-
|
|
|
+
|
|
|
results := new(fms.NotInvoicePaymentCensusResp)
|
|
|
if len(queryRegisterIds) > 0 {
|
|
|
|
|
@@ -2254,7 +2238,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
var listErr, totalErr, totalGroupErr error
|
|
|
wg := sync.WaitGroup{}
|
|
|
|
|
@@ -2284,11 +2268,12 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
summaryList = summaryData
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
currencyOB := new(fms.CurrencyUnit)
|
|
|
currencyCond := `enable = 1`
|
|
@@ -2387,7 +2372,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
invoiceCurrencyTotals := make([]*fms.InvoiceListCurrencyTotal, 0)
|
|
|
paymentCurrencyTotals := make([]*fms.InvoiceListCurrencyTotal, 0)
|
|
|
notpaymentCurrencyTotals := make([]*fms.InvoiceListCurrencyTotal, 0)
|
|
|
-
|
|
|
+
|
|
|
wg.Add(1)
|
|
|
go func() {
|
|
|
defer wg.Done()
|