|
@@ -508,7 +508,12 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
|
set["sourceinfourl"] = tmp["href"]
|
|
|
set["firsttime"] = tmp["publishtime"]
|
|
|
set["lasttime"] = tmp["publishtime"]
|
|
|
- set["pici"] = p.pici
|
|
|
+ //增量用系统时间,全量(历史)入库时间
|
|
|
+ if p.currentType == "project" {
|
|
|
+ set["pici"] = p.pici
|
|
|
+ }else {
|
|
|
+ set["pici"] = tmp["comeintime"]
|
|
|
+ }
|
|
|
set["ids"] = []string{thisinfo.Id}
|
|
|
if thisinfo.TopType == "招标" {
|
|
|
if thisinfo.SubType != "变更" && thisinfo.SubType != "其它" {
|
|
@@ -884,18 +889,14 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
if pInfo.Budget >= 0 && pInfo.Budgettag != 1 {
|
|
|
set["budget"] = pInfo.Budget
|
|
|
set["budgettag"] = 0
|
|
|
- } else {
|
|
|
- set["budgettag"] = 1
|
|
|
}
|
|
|
if pInfo.Bidamount >= 0 && pInfo.Bidamounttag != 1 {
|
|
|
set["bidamount"] = pInfo.Bidamount
|
|
|
set["bidamounttag"] = 0
|
|
|
- } else {
|
|
|
- set["bidamounttag"] = 1
|
|
|
}
|
|
|
- if pInfo.Bidamount > 0 {
|
|
|
+ if pInfo.Bidamount >= pInfo.Budget {
|
|
|
set["sortprice"] = pInfo.Bidamount
|
|
|
- }else if pInfo.Budget > 0 {
|
|
|
+ }else if pInfo.Budget >= pInfo.Bidamount {
|
|
|
set["sortprice"] = pInfo.Budget
|
|
|
}
|
|
|
|
|
@@ -919,7 +920,11 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
|
|
|
set["mpn"] = pInfo.MPN
|
|
|
set["mpc"] = pInfo.MPC
|
|
|
- set["pici"] = p.pici
|
|
|
+ if p.currentType == "project" {
|
|
|
+ set["pici"] = p.pici
|
|
|
+ }else {
|
|
|
+ set["pici"] = tmp["comeintime"]
|
|
|
+ }
|
|
|
update := map[string]interface{}{}
|
|
|
if len(set) > 0 {
|
|
|
update["$set"] = set
|
|
@@ -1133,8 +1138,6 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
|
project.Budgettag = 0
|
|
|
} else if info.Budget == 0 && tmp["budget"] != nil {
|
|
|
project.Budgettag = 0
|
|
|
- } else {
|
|
|
- project.Budgettag = 1
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1142,9 +1145,6 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
|
project.Budget = info.Budget
|
|
|
project.Budgettag = 0
|
|
|
}
|
|
|
- if tmp["budget"] == nil {
|
|
|
- project.Budgettag = 1
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
if info.SubType == "中标" || info.SubType == "成交" || info.SubType == "合同" {
|
|
@@ -1226,9 +1226,6 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if tmp["bidamount"] == nil {
|
|
|
- project.Budgettag = 1
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
} else {
|