Parcourir la source

后端: 合同评价分数段值配置

baichengfei il y a 4 ans
Parent
commit
e5c2176e4c

+ 64 - 19
src/dashoo.cn/backend/api/business/oilcontract/contractSumScore/contractSumScoreService.go

@@ -3,6 +3,7 @@ package contractSumScore
 import (
 	"dashoo.cn/backend/api/controllers"
 	. "dashoo.cn/backend/api/mydb"
+	baseparameter "dashoo.cn/business/parameter"
 	"dashoo.cn/utils"
 	"github.com/go-xorm/xorm"
 	"strconv"
@@ -18,7 +19,7 @@ func GetOilContractSumScoreService(xormEngine *xorm.Engine) *OilContractSumScore
 	return s
 }
 
-func (s *OilContractSumScoreService)GetMyPagingEntitiesWithOrderBytbl(pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
+func (s *OilContractSumScoreService) GetMyPagingEntitiesWithOrderBytbl(pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
 	var resultsSlice []map[string][]byte
 	//获取总记录数
 	sqlCount := ` select count(*) from ` + controllers.OilContractSumScoreName + ` score `
@@ -26,7 +27,7 @@ func (s *OilContractSumScoreService)GetMyPagingEntitiesWithOrderBytbl(pageIndex,
 	sqlCount += ` where ` + where
 
 	var sql string
-	sql =  `select * `
+	sql = `select * `
 	sql += ` from ` + controllers.OilContractSumScoreName + ` score `
 	sql += ` left join ` + controllers.OilContractSumScoreItemsName + ` items on items.SumScoreId = score.id `
 	sql += ` where ` + where
@@ -36,7 +37,7 @@ func (s *OilContractSumScoreService)GetMyPagingEntitiesWithOrderBytbl(pageIndex,
 	} else {
 		sql += ` order by ` + orderby + ` DESC `
 	}
-	if (pageIndex != 0 && itemsPerPage !=0) {
+	if pageIndex != 0 && itemsPerPage != 0 {
 		sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 	}
 
@@ -51,9 +52,9 @@ func (s *OilContractSumScoreService)GetMyPagingEntitiesWithOrderBytbl(pageIndex,
 	}
 	return total
 }
-func (s *OilContractSumScoreService)GetMyEntitiesWithOrderBytbl( orderby string, asc bool, entitiesPtr interface{}, where string) () {
+func (s *OilContractSumScoreService) GetMyEntitiesWithOrderBytbl(orderby string, asc bool, entitiesPtr interface{}, where string) {
 	var sql string
-	sql =  `select * `
+	sql = `select * `
 	sql += ` from ` + controllers.OilContractSumScoreName + ` score `
 	sql += ` left join ` + controllers.OilContractSumScoreItemsName + ` items on items.SumScoreId = score.id `
 	sql += ` where ` + where
@@ -64,7 +65,22 @@ func (s *OilContractSumScoreService)GetMyEntitiesWithOrderBytbl( orderby string,
 	}
 	s.DBE.SQL(sql).Find(entitiesPtr)
 }
-func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string,having string) (total int64) {
+func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string, having string) (total int64) {
+	// 优秀、合格分数值从配置中取
+	var paramEntityList []baseparameter.Base_Parameter
+	paramsSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	paramEntityList = paramsSvc.GetBaseparameterbyid("GFGL1", "paramset")
+	good := "80"
+	pass := "60"
+	for _, i := range paramEntityList {
+		if i.Parametercode == "yearEvaGood" {
+			good = i.Parametercontent
+		}
+		if i.Parametercode == "yearEvaPass" {
+			pass = i.Parametercontent
+		}
+	}
+
 	var resultsSlice []map[string][]byte
 	//获取总记录数
 	sqlCount := ` select count(*) from ( `
@@ -76,7 +92,7 @@ func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(page
 	sqlCount += ` ) t `
 
 	var sql string
-	sql =  `select YEAR(NOW()) as Year,contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
+	sql = `select YEAR(NOW()) as Year,contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
 
 	sql += ` sum(case when items.SequenceNo in  ('1') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B1, `
 	sql += ` sum(case when items.SequenceNo in  ('2') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B2, `
@@ -97,7 +113,7 @@ func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(page
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('8') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score8,  `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('9') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score9,  `
 	sql += ` ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) Score,  `
-	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <60 then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <80 then 2 else 1 end as Evaluate `
+	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + pass + ` then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + good + ` then 2 else 1 end as Evaluate `
 	sql += ` from ` + controllers.OilContractReviewName + ` review `
 	sql += ` left join ` + controllers.OilContractName + ` contract on review.ContractId=contract.id `
 	sql += ` left join ` + controllers.OilContractEvaluationItemsName + ` items on items.ContentReviewId=review.id and items.LevelCode=1 `
@@ -109,7 +125,7 @@ func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(page
 	} else {
 		sql += ` order by ` + orderby + ` DESC `
 	}
-	if (pageIndex != 0 && itemsPerPage !=0) {
+	if pageIndex != 0 && itemsPerPage != 0 {
 		sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 	}
 
@@ -125,8 +141,23 @@ func (s *OilContractSumScoreService) GetPagingComputeEntitiesWithOrderBytbl(page
 	return total
 }
 func (s *OilContractSumScoreService) GetComputeEntity(entitiesPtr interface{}, where string) {
+	// 优秀、合格分数值从配置中取
+	var paramEntityList []baseparameter.Base_Parameter
+	paramsSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	paramEntityList = paramsSvc.GetBaseparameterbyid("GFGL1", "paramset")
+	good := "80"
+	pass := "60"
+	for _, i := range paramEntityList {
+		if i.Parametercode == "yearEvaGood" {
+			good = i.Parametercontent
+		}
+		if i.Parametercode == "yearEvaPass" {
+			pass = i.Parametercontent
+		}
+	}
+
 	var sql string
-	sql =  `select YEAR(NOW()) as Year,contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
+	sql = `select YEAR(NOW()) as Year,contract.ContractClass,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
 
 	sql += ` sum(case when items.SequenceNo in  ('1') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B1, `
 	sql += ` sum(case when items.SequenceNo in  ('2') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B2, `
@@ -147,7 +178,7 @@ func (s *OilContractSumScoreService) GetComputeEntity(entitiesPtr interface{}, w
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('8') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score8,  `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('9') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score9,  `
 	sql += ` ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) Score,  `
-	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <60 then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <80 then 2 else 1 end as Evaluate `
+	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + pass + ` then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + good + ` then 2 else 1 end as Evaluate `
 	sql += ` from ` + controllers.OilContractReviewName + ` review `
 	sql += ` left join ` + controllers.OilContractName + ` contract on review.ContractId=contract.id `
 	sql += ` left join ` + controllers.OilContractEvaluationItemsName + ` items on items.ContentReviewId=review.id and items.LevelCode=1 `
@@ -158,7 +189,7 @@ func (s *OilContractSumScoreService) GetComputeEntity(entitiesPtr interface{}, w
 }
 func (s *OilContractSumScoreService) GetComputeEntity1(entitiesPtr interface{}, where string) {
 	var sql string
-	sql =  `select group_concat(DISTINCT items.Remark) as Content1`
+	sql = `select group_concat(DISTINCT items.Remark) as Content1`
 	sql += ` from ` + controllers.OilContractEvaluationItemsName + ` items `
 	sql += ` left join ` + controllers.OilContractReviewName + ` review on items.ContentReviewId=review.id and items.LevelCode=2 `
 	sql += ` left join ` + controllers.OilContractName + ` contract on review.ContractId=contract.id `
@@ -170,7 +201,7 @@ func (s *OilContractSumScoreService) GetComputeEntity1(entitiesPtr interface{},
 func (s *OilContractSumScoreService) GetSumListEntitiesWithOrderBytbl(entitiesPtr interface{}, where string) {
 
 	var sql string
-	sql =  `select contract.Id,contract.SupplierId,contract.SupplierName,contract.Amount, `
+	sql = `select contract.Id,contract.SupplierId,contract.SupplierName,contract.Amount, `
 	sql += ` ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2)  Result1, `
 	sql += ` sum(case when items.Type = 2 AND items.Value = 1 then 1 else 0 end)  Result2 `
 	sql += ` from ` + controllers.OilContractReviewName + ` review `
@@ -181,11 +212,26 @@ func (s *OilContractSumScoreService) GetSumListEntitiesWithOrderBytbl(entitiesPt
 
 	s.DBE.SQL(sql).Find(entitiesPtr)
 }
-func (s *OilContractSumScoreService) GetComputeEntityBytbl(where string) OilContractComputeSumScoreVo{
+func (s *OilContractSumScoreService) GetComputeEntityBytbl(where string) OilContractComputeSumScoreVo {
+	// 优秀、合格分数值从配置中取
+	var paramEntityList []baseparameter.Base_Parameter
+	paramsSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	paramEntityList = paramsSvc.GetBaseparameterbyid("GFGL1", "paramset")
+	good := "80"
+	pass := "60"
+	for _, i := range paramEntityList {
+		if i.Parametercode == "yearEvaGood" {
+			good = i.Parametercontent
+		}
+		if i.Parametercode == "yearEvaPass" {
+			pass = i.Parametercontent
+		}
+	}
+
 	var model OilContractComputeSumScoreVo
 	// contract.ContractClass,
 	var sql string
-	sql =  `select YEAR(NOW()) as Year,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
+	sql = `select YEAR(NOW()) as Year,contract.SupplierId,contract.SupplierName,count(review.id) as count, `
 	sql += ` sum(case when items.SequenceNo in  ('1') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B1, `
 	sql += ` sum(case when items.SequenceNo in  ('2') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B2, `
 	sql += ` sum(case when items.SequenceNo in  ('3') AND items.Type = 2 AND items.Value > 0 then 1 else 0 end )  B3, `
@@ -204,7 +250,7 @@ func (s *OilContractSumScoreService) GetComputeEntityBytbl(where string) OilCont
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('8') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score8,  `
 	sql += ` ROUND(sum(case when items.SequenceNo in  ('9') AND items.Type =1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type =1 then 1 else 0 end),2) Score9,  `
 	sql += ` ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) Score,  `
-	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <60 then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <80 then 2 else 1 end as Evaluate `
+	sql += ` case when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + pass + ` then 3 when ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < ` + good + ` then 2 else 1 end as Evaluate `
 	sql += ` from ` + controllers.OilContractReviewName + ` review `
 	sql += ` left join ` + controllers.OilContractName + ` contract on review.ContractId=contract.id `
 	sql += ` left join ` + controllers.OilContractEvaluationItemsName + ` items on items.ContentReviewId=review.id and items.LevelCode=1 `
@@ -215,7 +261,7 @@ func (s *OilContractSumScoreService) GetComputeEntityBytbl(where string) OilCont
 	return model
 }
 
-func (s *OilContractSumScoreService)GetCount(where string) (total int64) {
+func (s *OilContractSumScoreService) GetCount(where string) (total int64) {
 	var resultsSlice []map[string][]byte
 	//获取总记录数
 	sqlCount := ` select count(*) from OilContract`
@@ -232,11 +278,10 @@ func (s *OilContractSumScoreService)GetCount(where string) (total int64) {
 	return total
 }
 
-func (s *OilContractSumScoreService)GetSum(entitiesPtr interface{},where string){
+func (s *OilContractSumScoreService) GetSum(entitiesPtr interface{}, where string) {
 
 	sql := ` select sum(Amount) as Amount from OilContract`
 	sql += ` where ` + where
 
 	s.DBE.SQL(sql).Get(entitiesPtr)
 }
-

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

@@ -4,6 +4,7 @@ import (
 	"dashoo.cn/backend/api/business/oilcontract/contract"
 	"dashoo.cn/backend/api/business/oilcontract/contractSumScoreItems"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
+	baseparameter "dashoo.cn/business/parameter"
 	"dashoo.cn/business2/permission"
 	"fmt"
 
@@ -141,7 +142,7 @@ func (this *OilContractSumScoreController) GetEntityList() {
 func (this *OilContractSumScoreController) GetComputeEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
-	where  := " 1=1 "
+	where := " 1=1 "
 	having := " 1=1 "
 	orderby := "contract.SupplierId"
 	asc := false
@@ -165,13 +166,27 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
 		where = where + " and contract.ContractClass = '" + ContractClass + "'"
 	}
 
+	// 优秀、合格分数值从配置中取
+	var paramEntityList []baseparameter.Base_Parameter
+	paramsSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	paramEntityList = paramsSvc.GetBaseparameterbyid("GFGL1", "paramset")
+	good := "80"
+	pass := "60"
+	for _, i := range paramEntityList {
+		if i.Parametercode == "yearEvaGood" {
+			good = i.Parametercontent
+		}
+		if i.Parametercode == "yearEvaPass" {
+			pass = i.Parametercontent
+		}
+	}
 
-	if Evaluate == "1" {  // 优秀
+	if Evaluate == "1" { // 优秀
 
-	} else if Evaluate == "2" {  // 合格
-		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <80"
-	} else if Evaluate == "3" {  // 不合格
-		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <60"
+	} else if Evaluate == "2" { // 合格
+		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < " + good + " "
+	} else if Evaluate == "3" { // 不合格
+		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < " + pass + " "
 	}
 	// 今年的汇总
 	year := strconv.Itoa(time.Now().Year())
@@ -193,7 +208,7 @@ 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)
+	total := svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where, having)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total
@@ -202,11 +217,12 @@ func (this *OilContractSumScoreController) GetComputeEntityList() {
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }
+
 // @Title 获取核算实体
 // @Description get user by token
 // @Success 200 {object} []contractSumScore.OilContractSumScore
 // @router /compute-entity/:id [get]
-func (this *OilContractSumScoreController) GetComputeEntity(){
+func (this *OilContractSumScoreController) GetComputeEntity() {
 	Id := this.Ctx.Input.Param(":id")
 	ContractClass := this.GetString("ContractClass", "01")
 	where := " contract.SupplierId = " + Id
@@ -221,11 +237,12 @@ func (this *OilContractSumScoreController) GetComputeEntity(){
 	where = where + " and review.CreateOn>='" + year + "-" + month + "-" + day + "' "
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
 	var entity contractSumScore.OilContractComputeSumScoreVo
-	entity = svc.GetComputeEntityBytbl( where)
+	entity = svc.GetComputeEntityBytbl(where)
 
 	this.Data["json"] = &entity
 	this.ServeJSON()
 }
+
 // @Title 获取字典列表
 // @Description get user by token
 // @Success 200 {object} map[string]interface{}
@@ -773,7 +790,7 @@ func (this *OilContractSumScoreController) DocExport() {
 
 	var supplierModel supplier.OilSupplier
 	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
-	supplierSvc.GetEntityById (SupplierId, &supplierModel)
+	supplierSvc.GetEntityById(SupplierId, &supplierModel)
 
 	var model contractSumScore.OilContractSumScore
 	//svc.GetEntity(&model, "SupplierId = " + supplierModel.Id)
@@ -784,12 +801,12 @@ func (this *OilContractSumScoreController) DocExport() {
 
 	var item []contractSumScoreItems.OilContractSumScoreItems
 	var con contract.OilContract
-	svc.GetComputeEntity1(&item, "contract.SupplierId = " + SupplierId)
+	svc.GetComputeEntity1(&item, "contract.SupplierId = "+SupplierId)
 	//itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
 	//where1 := " 1=1 AND SumScoreId= '" + utils.ToStr(model.Id) + "' AND Category =  '0' "
 	//itemSvc.GetEntityByWhere(OilContractSumScoreItemsName, where1, &item)
-	total := svc.GetCount( "SupplierId = " + SupplierId)
-	svc.GetSum(&con,"SupplierId = " + SupplierId + " and PlanFinishDate >= '"+ year + "-01-01" + "' and PlanFinishDate <= '"+ year + "-12-31'")
+	total := svc.GetCount("SupplierId = " + SupplierId)
+	svc.GetSum(&con, "SupplierId = "+SupplierId+" and PlanFinishDate >= '"+year+"-01-01"+"' and PlanFinishDate <= '"+year+"-12-31'")
 
 	datamap := structToMapDemo(model)
 	datamap["SupplierName"] = supplierModel.SupplierName
@@ -811,9 +828,9 @@ func (this *OilContractSumScoreController) DocExport() {
 	datamap["Count"] = total
 	Amount := 10000.00
 	if con.Amount != "" {
-		Amount ,_ = strconv.ParseFloat(con.Amount, 64)
+		Amount, _ = strconv.ParseFloat(con.Amount, 64)
 	}
-	datamap["Money"] = Amount/10000
+	datamap["Money"] = Amount / 10000
 	datamap["Content1"] = strings.TrimLeft(item[0].Content1, ",")
 	datamap["SumScore2"] = list.Score2
 	datamap["Content2"] = strings.TrimLeft(item[1].Content1, ",")
@@ -886,7 +903,7 @@ func (this *OilContractSumScoreController) DocExport() {
 func (this *OilContractSumScoreController) ExcelExport() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
-	where  := " 1=1 "
+	where := " 1=1 "
 	having := " 1=1 "
 	orderby := "contract.SupplierId"
 	asc := false
@@ -910,13 +927,27 @@ func (this *OilContractSumScoreController) ExcelExport() {
 		where = where + " and contract.ContractClass = '" + ContractClass + "'"
 	}
 
+	// 优秀、合格分数值从配置中取
+	var paramEntityList []baseparameter.Base_Parameter
+	paramsSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	paramEntityList = paramsSvc.GetBaseparameterbyid("GFGL1", "paramset")
+	good := "80"
+	pass := "60"
+	for _, i := range paramEntityList {
+		if i.Parametercode == "yearEvaGood" {
+			good = i.Parametercontent
+		}
+		if i.Parametercode == "yearEvaPass" {
+			pass = i.Parametercontent
+		}
+	}
 
-	if Evaluate == "1" {  // 优秀
+	if Evaluate == "1" { // 优秀
 
-	} else if Evaluate == "2" {  // 合格
-		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <80"
-	} else if Evaluate == "3" {  // 不合格
-		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) <60"
+	} else if Evaluate == "2" { // 合格
+		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < " + good + " "
+	} else if Evaluate == "3" { // 不合格
+		having = "ROUND(sum(case when items.ParentId = 0 AND items.Type = 1 then items.Score else 0 end)/sum(case when items.SequenceNo in  ('1') AND items.Type = 1 then 1 else 0 end),2) < " + pass + " "
 	}
 	// 今年的汇总
 	year := strconv.Itoa(time.Now().Year())
@@ -938,7 +969,7 @@ func (this *OilContractSumScoreController) ExcelExport() {
 
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
 	var list []contractSumScore.OilContractComputeSumScoreVo
-	svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where,having)
+	svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where, having)
 
 	var datainfo ErrorDataInfo
 	if len(list) == 0 {