ziwen 1 år sedan
förälder
incheckning
145ca87465
2 ändrade filer med 15 tillägg och 4 borttagningar
  1. 8 3
      controllers/company.go
  2. 7 1
      services/cygx/activity_special.go

+ 8 - 3
controllers/company.go

@@ -9217,7 +9217,7 @@ func (this *CompanyTodoController) CompanyActivitySpecialPointsBill() {
 	}
 	//chartMap := map[int]string{utils.YI_YAO_ID: utils.YI_YAO_NAME, utils.XIAO_FEI_ID: utils.XIAO_FEI_NAME, utils.KE_JI_ID: utils.KE_JI_NAME, utils.ZHI_ZAO_ID: utils.ZHI_ZAO_NAME}
 	resp := new(cygx.CygxActivitySpecialPointsBillResp)
-	for _, v := range list {
+	for i, v := range list {
 		item := cygx.CygxActivitySpecialPointsBillRespItem{
 			Id:                  v.Id,
 			Content:             v.ActivityName,
@@ -9234,16 +9234,21 @@ func (this *CompanyTodoController) CompanyActivitySpecialPointsBill() {
 			item.Content = v.Content
 		}
 		if userType == 2 {
-			item.Total += strconv.Itoa(tripRemaining-v.BillDetailed) + "次,"
+			if i== 0{
+				item.Total += strconv.Itoa(tripRemaining) + "次"
+			}
+			item.Total += strconv.Itoa(tripRemaining-v.BillDetailed) + "次"
 		} else {
 			for k, num := range mapChartName {
 				if num > 0 {
+					if i== 0{
+						item.Total += k + strconv.Itoa(num) + "次+"
+					}
 					item.Total += k + strconv.Itoa(num-v.BillDetailed) + "次+"
 				}
 			}
 			item.Total = strings.TrimRight(item.Total, "+")
 		}
-
 		resp.List = append(resp.List, &item)
 	}
 

+ 7 - 1
services/cygx/activity_special.go

@@ -264,6 +264,9 @@ func GetSpecialSurplusByCompany(companyId int) (specialSurplus string, err error
 			//}
 			var TripBillNum int
 			for _, v := range listTripBill {
+				if v.ActivityId == 0 {
+					continue
+				}
 				TripBillNum += v.BillDetailed
 			}
 			// CRM13.2 70w客户有16次专项调研, 45w有10次
@@ -282,7 +285,7 @@ func GetSpecialSurplusByCompany(companyId int) (specialSurplus string, err error
 			//	specialSurplus += chartMap[k] + strconv.Itoa(tripRemaining) + "次,"
 			//}
 			//specialSurplus = strings.TrimRight(specialSurplus, ",")
-			specialSurplus = specialSurplus + "次"
+			specialSurplus = strconv.Itoa(tripRemaining) + "次"
 			//tripRemaining = 12 - tripTota
 		} else {
 			list, e := company.GetCompanyReportPermissionUpgrade(companyId, 2)
@@ -334,6 +337,9 @@ func GetSpecialSurplusByCompany(companyId int) (specialSurplus string, err error
 			}
 			//var TripBillNum int
 			for _, v := range listTripBill {
+				if v.ActivityId == 0 {
+					continue
+				}
 				mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
 			}
 			for _, v := range chartList {