Przeglądaj źródła

后:年度导出优化

dubch 4 lat temu
rodzic
commit
43a6f0102f

+ 22 - 16
src/dashoo.cn/backend/api/controllers/oilcontract/contractSumScore.go

@@ -219,14 +219,17 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
 	var list []contractSumScore.OilContractComputeSumScoreVo
 	total := svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where, having, ScoreType)
-	for index, item := range list {
-		where1 := where + " and contract.SupplierId = " + strconv.Itoa(item.SupplierId)
-		var list1 []contractSumScore.OilContractSumScoreResult
-		svc.GetSumListEntitiesWithOrderBytbl(&list1, where1)
-		if len(list1) > 0 {
-			for _, value := range list1 {
-				if value.Result2 == "0" {
-					list[index].Result = "0"
+
+	if ContractClass == "02" {
+		for index, item := range list {
+			where1 := where + " and contract.SupplierId = " + strconv.Itoa(item.SupplierId)
+			var list1 []contractSumScore.OilContractSumScoreResult
+			svc.GetSumListEntitiesWithOrderBytbl(&list1, where1)
+			if len(list1) > 0 {
+				for _, value := range list1 {
+					if value.Result2 == "0" {
+						list[index].Result = "0"
+					}
 				}
 			}
 		}
@@ -1024,14 +1027,17 @@ func (this *OilContractSumScoreController) ExcelExport() {
 	var list []contractSumScore.OilContractComputeSumScoreVo
 	svc.GetPagingComputeEntitiesWithOrderBytbl(0, 0, orderby, asc, &list, where, having, ScoreType)
 
-	for index, item := range list {
-		where1 := where + " and contract.SupplierId = " + strconv.Itoa(item.SupplierId)
-		var list1 []contractSumScore.OilContractSumScoreResult
-		svc.GetSumListEntitiesWithOrderBytbl(&list1, where1)
-		if len(list1) > 0 {
-			for _, value := range list1 {
-				if value.Result2 == "0" {
-					list[index].Result = "0"
+
+	if ContractClass == "02" {
+		for index, item := range list {
+			where1 := where + " and contract.SupplierId = " + strconv.Itoa(item.SupplierId)
+			var list1 []contractSumScore.OilContractSumScoreResult
+			svc.GetSumListEntitiesWithOrderBytbl(&list1, where1)
+			if len(list1) > 0 {
+				for _, value := range list1 {
+					if value.Result2 == "0" {
+						list[index].Result = "0"
+					}
 				}
 			}
 		}