|
|
@@ -1,20 +1,20 @@
|
|
|
package oilcontract
|
|
|
|
|
|
import (
|
|
|
-
|
|
|
- "dashoo.cn/backend/api/business/oilcontract/contractEvaluationItems"
|
|
|
"dashoo.cn/backend/api/business/oilcontract/contract"
|
|
|
+ "dashoo.cn/backend/api/business/oilcontract/contractEvaluationItems"
|
|
|
+ "dashoo.cn/backend/api/business/organize"
|
|
|
"dashoo.cn/business2/permission"
|
|
|
|
|
|
+ "dashoo.cn/backend/api/business/baseUser"
|
|
|
"dashoo.cn/backend/api/business/oilcontract/contractReview"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
- "fmt"
|
|
|
- "dashoo.cn/backend/api/business/baseUser"
|
|
|
// "dashoo.cn/backend/api/business/items"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/business2/userRole"
|
|
|
@@ -269,7 +269,8 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
|
|
|
datamap := structToMapDemo(model)
|
|
|
|
|
|
- var score = 0
|
|
|
+ var score = 0.00
|
|
|
+ var normalScore = 0.00
|
|
|
// 新增配置项
|
|
|
for i,v := range items {
|
|
|
fmt.Print(i)
|
|
|
@@ -278,21 +279,47 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
datamap["score_"+utils.ToStr(v.ItemId)] = v.Score
|
|
|
datamap["content_"+utils.ToStr(v.ItemId)] = v.Remark
|
|
|
if v.ParentId == 0{
|
|
|
- tmp ,_ := strconv.Atoi(v.Score)
|
|
|
+ tmp ,_ := strconv.ParseFloat(v.Score,64)
|
|
|
score = score + tmp
|
|
|
+ normal,_ := strconv.ParseFloat(v.NormalScore,64)
|
|
|
+ normalScore = normalScore + normal
|
|
|
}
|
|
|
}else{
|
|
|
datamap["bool_"+ utils.ToStr(v.ItemId)] = If(v.Value == 1,"是","否")
|
|
|
}
|
|
|
}
|
|
|
- datamap["score"] = utils.ToStr(score)
|
|
|
+ datamap["Score"] = utils.ToStr(score)
|
|
|
+ datamap["Standard"] = utils.ToStr(normalScore)
|
|
|
+ datamap["Discount"] = score
|
|
|
|
|
|
if contractModel.Id != 0 {
|
|
|
+ datamap["Amount"] = contractModel.Amount
|
|
|
datamap["SupplierName"] = contractModel.SupplierName
|
|
|
datamap["ProjectName"] = contractModel.ProjectName
|
|
|
datamap["ContractNo"] = contractModel.ContractNo
|
|
|
datamap["SubPackage"] = If(contractModel.SubPackage == 1 , "是" , "否")
|
|
|
+ if contractModel.ProjectType == "咨询" {
|
|
|
+ datamap["ProjectType"] = "☑咨询 □勘察 □设计 □施工\n□监理 □检测 □工程总承包"
|
|
|
+ }else if contractModel.ContractClass == "勘探" {
|
|
|
+ datamap["ProjectType"] = "□咨询 ☑勘察 □设计 □施工\n□监理 □检测 □工程总承包"
|
|
|
+ }else if contractModel.ContractClass == "设计"{
|
|
|
+ datamap["ProjectType"] = "□咨询 □勘察 ☑设计 □施工\n□监理 □检测 □工程总承包"
|
|
|
+ }else if contractModel.ContractClass == "施工"{
|
|
|
+ datamap["ProjectType"] = "□咨询 □勘察 □设计 ☑施工\n□监理 □检测 □工程总承包"
|
|
|
+ }
|
|
|
+
|
|
|
+ datamap["ContractPeriod"] = contractModel.ContractPeriod
|
|
|
+ datamap["OpenDate"] = contractModel.OpenDate.Format("2006年01月02日")
|
|
|
+ datamap["PlanFinishDate"] = contractModel.PlanFinishDate.Format("2006年01月02日")
|
|
|
+ datamap["ConstructionUnit"] = contractModel.ConstructionUnit
|
|
|
+ datamap["ConstructionOwner"] = contractModel.ConstructionOwner
|
|
|
+ datamap["ConstructionTelphone"] = contractModel.ConstructionTelphone
|
|
|
}
|
|
|
+
|
|
|
+ // 获取组织名称
|
|
|
+ svcorg := organize.GetOrganizeService(utils.DBE)
|
|
|
+ datamap["DepartName"] = svcorg.GetNameById(strconv.Itoa(this.User.UnitId))
|
|
|
+
|
|
|
fileName = ""
|
|
|
Url = ""
|
|
|
if contractModel.ContractClass == "01"{
|
|
|
@@ -306,6 +333,12 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
Url = utils.Cfg.MustValue("workflow", "reviewServiceUrl")
|
|
|
}
|
|
|
|
|
|
+ t := time.Now()
|
|
|
+ datamap["CreateDate"] = t.Format("2006年01月02日")
|
|
|
+ datamap["Year"] = t.Format("2006")
|
|
|
+ datamap["Creater"] = this.User.Realname
|
|
|
+
|
|
|
+
|
|
|
//datamap["TableComment"] = []string{"MajorEquipments", "ThreeYears", "Patent", "Winning"}
|
|
|
retDocUrl := svcActiviti.FillWordTemplate(datamap, Url, fileName)
|
|
|
//retDocUrl := svcActiviti.FillWordWatermarkTemplate(datamap, Url, fileName, model.SupplierName)
|