|
@@ -420,7 +420,6 @@ var FIELDS = []string{
|
|
|
"buyertel",
|
|
|
"winner",
|
|
|
"agency",
|
|
|
- "projectscope",
|
|
|
"topscopeclass",
|
|
|
"subscopeclass",
|
|
|
"winnerorder",
|
|
@@ -479,25 +478,31 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
|
bt := qu.ObjToString(tmp["toptype"])
|
|
|
bs := qu.ObjToString(tmp["subtype"])
|
|
|
p.mapBidLock.Lock()
|
|
|
- set["bidtype"] = bidtype[bs]
|
|
|
- if bt == "招标" {
|
|
|
- set["projectscope"] = qu.ObjToString(tmp["projectscope"])
|
|
|
- set["bidstatus"] = bt
|
|
|
- } else {
|
|
|
- if bidstatus[bs] != "" {
|
|
|
- set["bidstatus"] = thisinfo.SubType
|
|
|
- } else if tmp["infoformat"] == 2 {
|
|
|
- set["bidstatus"] = "拟建"
|
|
|
- } else if bs == "" {
|
|
|
- set["bidstatus"] = ""
|
|
|
+ if thisinfo.Infoformat == 2 {
|
|
|
+ set["bidstatus"] = "拟建"
|
|
|
+ bt = "拟建"
|
|
|
+ }else {
|
|
|
+ set["bidtype"] = bidtype[bs]
|
|
|
+ if bt == "招标" {
|
|
|
+ set["projectscope"] = qu.ObjToString(tmp["projectscope"])
|
|
|
+ set["bidstatus"] = bt
|
|
|
} else {
|
|
|
- set["bidstatus"] = "其它"
|
|
|
+ if bidstatus[bs] != "" {
|
|
|
+ set["bidstatus"] = thisinfo.SubType
|
|
|
+ bt = thisinfo.SubType
|
|
|
+ } else if bs == "" {
|
|
|
+ set["bidstatus"] = ""
|
|
|
+ bt = ""
|
|
|
+ } else {
|
|
|
+ set["bidstatus"] = "其它"
|
|
|
+ bt = "其它"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
p.mapBidLock.Unlock()
|
|
|
|
|
|
pkg := PackageFormat(thisinfo, nil)
|
|
|
- p1 := p.NewCachePinfo(pId, thisinfo, bt, pkg)
|
|
|
+ p1 := p.NewCachePinfo(pId, thisinfo, bs, bt, pkg)
|
|
|
|
|
|
now := time.Now().Unix()
|
|
|
set["createtime"] = now
|
|
@@ -512,8 +517,10 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
|
set["zbtime"] = tmp["publishtime"]
|
|
|
}
|
|
|
} else if thisinfo.TopType == "结果" || thisinfo.SubType == "合同" {
|
|
|
- set["jgtime"] = tmp["publishtime"]
|
|
|
- p1.Jgtime = thisinfo.Publishtime
|
|
|
+ if thisinfo.Infoformat != 2 {
|
|
|
+ set["jgtime"] = tmp["publishtime"]
|
|
|
+ p1.Jgtime = thisinfo.Publishtime
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if len(thisinfo.Subscopeclass) > 0 {
|
|
@@ -630,7 +637,7 @@ func (p *ProjectTask) PushListInfo(tmp map[string]interface{}, infoid string) bs
|
|
|
}
|
|
|
|
|
|
//生成存放在内存中的对象
|
|
|
-func (p *ProjectTask) NewCachePinfo(id primitive.ObjectID, thisinfo *Info, bidtype string, pkg map[string]interface{}) ProjectInfo {
|
|
|
+func (p *ProjectTask) NewCachePinfo(id primitive.ObjectID, thisinfo *Info, bidtype, bidstatus string, pkg map[string]interface{}) ProjectInfo {
|
|
|
p1 := ProjectInfo{
|
|
|
Id: id,
|
|
|
Ids: []string{thisinfo.Id},
|
|
@@ -654,7 +661,7 @@ func (p *ProjectTask) NewCachePinfo(id primitive.ObjectID, thisinfo *Info, bidty
|
|
|
Budget: thisinfo.Budget,
|
|
|
Package: pkg,
|
|
|
Bidamount: thisinfo.Bidamount,
|
|
|
- Bidstatus: thisinfo.SubType,
|
|
|
+ Bidstatus: bidstatus,
|
|
|
Bidtype: bidtype,
|
|
|
Winners: thisinfo.Winners,
|
|
|
}
|
|
@@ -683,7 +690,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
pInfo.LastTime = thisinfo.Publishtime
|
|
|
set["lasttime"] = thisinfo.Publishtime
|
|
|
if thisinfo.TopType == "招标" {
|
|
|
- if thisinfo.SubType != "变更" && thisinfo.SubType != "其它" {
|
|
|
+ if thisinfo.SubType != "变更" && thisinfo.SubType != "其它" && tmp["zbtime"] == nil {
|
|
|
set["zbtime"] = tmp["publishtime"]
|
|
|
}
|
|
|
if pInfo.Jgtime > 0 {
|
|
@@ -722,7 +729,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
if bidstatus[bs] != "" {
|
|
|
set["bidstatus"] = thisinfo.SubType
|
|
|
pInfo.Bidstatus = thisinfo.SubType
|
|
|
- } else if tmp["infoformat"] == 2 {
|
|
|
+ } else if thisinfo.Infoformat == 2 {
|
|
|
set["bidstatus"] = "拟建"
|
|
|
pInfo.Bidstatus = "拟建"
|
|
|
} else if bs == "" {
|
|
@@ -908,7 +915,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
/**
|
|
|
* 更新项目时,项目状态的处理
|
|
|
* 返回是否新增项目,异常标记
|
|
|
- * 1、项目时,新项目时,招标信息的状态(toptype)不是招标、拟建、预告 异常:1
|
|
|
+ * 1、新增项目时,招标信息的状态(toptype)不是招标、拟建、预告 异常:1
|
|
|
* 异常1是在项目新建的时候才会产生
|
|
|
* 3、项目合并时,项目状态是”流标“/”废标“,招标信息状态不是”招标“ 异常:2
|
|
|
* 4、项目合并时,项目状态是”合同“/”其它“,招标信息类型是”结果“ 异常:3
|
|
@@ -927,7 +934,7 @@ func (p *ProjectTask) CompareStatus(project *ProjectInfo, info *Info) (bool, int
|
|
|
return false, 0
|
|
|
} else if project.Bidstatus == info.SubType {
|
|
|
//状态一样,根据发布时间判断是否合并
|
|
|
- if (info.Publishtime - project.FirstTime) > p.statusTime {
|
|
|
+ if (info.Publishtime - project.LastTime) > p.statusTime {
|
|
|
return true, 0
|
|
|
} else {
|
|
|
return false, 0
|
|
@@ -1060,7 +1067,6 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
|
} else {
|
|
|
project.Budgettag = 1
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
if budget > 0 {
|