|
|
@@ -308,6 +308,7 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
svc := contractReview.GetOilContractReviewService(utils.DBE)
|
|
|
|
|
|
var items []contractEvaluationItems.OilContractEvaluationItems
|
|
|
+ var items1 []contractEvaluationItems.OilContractEvaluationItems
|
|
|
itemSvc := contractEvaluationItems.GetOilContractEvaluationItemsService(utils.DBE)
|
|
|
|
|
|
var contractModel contract.OilContract
|
|
|
@@ -316,38 +317,46 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
where := " Id = '" + Id + "'"
|
|
|
svc.GetEntityByWhere(OilContractReviewName, where, &model)
|
|
|
|
|
|
- where2 := " ContentReviewId=" + Id + " AND Category = 0 "
|
|
|
- itemSvc.GetEntitysByWhere(OilContractEvaluationItemsName, where2, &items)
|
|
|
-
|
|
|
where3 := " Id= '" + utils.ToStr(model.ContractId) + "' "
|
|
|
contractSvc.GetEntityByWhere(OilContractName, where3, &contractModel)
|
|
|
|
|
|
- var supplierEntity supplier.OilSupplier
|
|
|
- supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
- supplierSvc.GetEntityByIdBytbl(OilSupplierName, contractModel.SupplierId, &supplierEntity)
|
|
|
-
|
|
|
- datamap := structToMapDemo(model)
|
|
|
-
|
|
|
var score = 0.00
|
|
|
var normalScore = 0.00
|
|
|
- // 新增配置项
|
|
|
- for i, v := range items {
|
|
|
- fmt.Print(i)
|
|
|
- fmt.Print(utils.ToStr(v.ItemId))
|
|
|
-
|
|
|
- if v.Type == 1 {
|
|
|
- datamap["score_"+utils.ToStr(v.ItemId)] = v.Score
|
|
|
- datamap["content_"+utils.ToStr(v.ItemId)] = v.Remark
|
|
|
- if v.ParentId == 0 {
|
|
|
- tmp, _ := strconv.ParseFloat(v.Score, 64)
|
|
|
- score = score + tmp
|
|
|
- normal, _ := strconv.ParseFloat(v.NormalScore, 64)
|
|
|
- normalScore = normalScore + normal
|
|
|
+ var count = 1.00
|
|
|
+ datamap := structToMapDemo(model)
|
|
|
+ where2 := " b.ContentReviewId = " + Id + " AND a.Type = '" + contractModel.ContractClass + "'"
|
|
|
+ itemSvc.GetSumScore(&items, where2)
|
|
|
+
|
|
|
+ where2 = " ContentReviewId = " + Id
|
|
|
+ itemSvc.GetCountItems(&items1, where2)
|
|
|
+
|
|
|
+ if len(items1) == 2 {
|
|
|
+ count += 1
|
|
|
+ }
|
|
|
+ if items != nil {
|
|
|
+ for i, v := range items {
|
|
|
+ fmt.Print(i)
|
|
|
+ fmt.Print(utils.ToStr(v.ItemId))
|
|
|
+
|
|
|
+ if v.Type == 1 {
|
|
|
+ Score1, _ := strconv.ParseFloat(v.Score, 64)
|
|
|
+ datamap["score_"+utils.ToStr(v.ItemId)] = Score1/count
|
|
|
+ datamap["content_"+utils.ToStr(v.ItemId)] = v.Remark
|
|
|
+ if v.ParentId == 0 {
|
|
|
+ score = score + (Score1/count)
|
|
|
+ normal, _ := strconv.ParseFloat(v.NormalScore, 64)
|
|
|
+ normalScore = normalScore + (normal/count)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ datamap["bool_"+utils.ToStr(v.ItemId)] = If(v.Value == 1, "是", "否")
|
|
|
}
|
|
|
- } else {
|
|
|
- datamap["bool_"+utils.ToStr(v.ItemId)] = If(v.Value == 1, "是", "否")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ var supplierEntity supplier.OilSupplier
|
|
|
+ supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
+ supplierSvc.GetEntityByIdBytbl(OilSupplierName, contractModel.SupplierId, &supplierEntity)
|
|
|
+
|
|
|
datamap["Score"] = utils.ToStr(score)
|
|
|
datamap["Standard"] = utils.ToStr(normalScore)
|
|
|
datamap["Discount"] = score
|
|
|
@@ -355,7 +364,7 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
if contractModel.Id != 0 {
|
|
|
datamap["Amount"] = contractModel.Amount
|
|
|
datamap["SupplierName"] = contractModel.SupplierName
|
|
|
- datamap["ProjectName"] = contractModel.ProjectName
|
|
|
+ datamap["ProjectName"] = contractModel.ContractName
|
|
|
datamap["ContractNo"] = contractModel.ContractNo
|
|
|
datamap["SubPackage"] = If(contractModel.SubPackage == 1, "是", "否")
|
|
|
if contractModel.ProjectType == "咨询" {
|