|
@@ -1,7 +1,9 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
+ "math"
|
|
|
"strconv"
|
|
|
+
|
|
|
//"fmt"
|
|
|
"log"
|
|
|
"qfw/util"
|
|
@@ -124,6 +126,10 @@ func projectTask(data []byte, project, mapInfo map[string]interface{}) {
|
|
|
//不生索引字段
|
|
|
delete(tmp, "package")
|
|
|
delete(tmp, "infofield")
|
|
|
+
|
|
|
+ bidopentime := util.Int64All(tmp["bidopentime"]) //开标日期
|
|
|
+ fzb_publishtime := int64(0) //记录第一个招标信息的publishtime
|
|
|
+ bidcycle_flag := false //判断是否已计算出标书表编制周期
|
|
|
list := tmp["list"].([]interface{})
|
|
|
for _, m := range list {
|
|
|
tmpM := m.(map[string]interface{})
|
|
@@ -139,6 +145,35 @@ func projectTask(data []byte, project, mapInfo map[string]interface{}) {
|
|
|
if len(listProjectscopeRune) > 1000 {
|
|
|
tmpM["projectscope"] = string(listProjectscopeRune[:1000])
|
|
|
}
|
|
|
+ //计算bidcycle标书表编制周期字段
|
|
|
+ if !bidcycle_flag && bidopentime > 0 { //bidopentime>0证明list中有bidopentime,无则不用计算bidcycle
|
|
|
+ if toptype := util.ObjToString(tmpM["toptype"]); toptype == "招标" {
|
|
|
+ zb_bidopentime := util.Int64All(tmpM["bidopentime"])
|
|
|
+ zb_publishtime := util.Int64All(tmpM["publishtime"])
|
|
|
+ if zb_publishtime > 0 {
|
|
|
+ if zb_bidopentime > 0 {
|
|
|
+ if tmpTime := zb_bidopentime - zb_publishtime; tmpTime > 0 {
|
|
|
+ f_day := float64(tmpTime) / float64(86400)
|
|
|
+ day := math.Ceil(f_day)
|
|
|
+ tmp["bidcycle"] = int(day)
|
|
|
+ bidcycle_flag = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if fzb_publishtime == 0 { //仅赋值第一个招标信息的publishtime
|
|
|
+ fzb_publishtime = zb_publishtime
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //计算bidcycle标书表编制周期字段
|
|
|
+ //list中招标信息中未能计算出bidcycle,用第一个招标信息的fzb_publishtime和外围bidopentime计算
|
|
|
+ if !bidcycle_flag && bidopentime > 0 && fzb_publishtime > 0 {
|
|
|
+ if tmpTime := bidopentime - fzb_publishtime; tmpTime > 0 {
|
|
|
+ f_day := float64(tmpTime) / float64(86400)
|
|
|
+ day := math.Ceil(f_day)
|
|
|
+ tmp["bidcycle"] = int(day)
|
|
|
+ }
|
|
|
}
|
|
|
//projectscope截断
|
|
|
projectscopeRune := []rune(util.ObjToString(tmp["projectscope"]))
|