|
@@ -429,11 +429,11 @@ var FIELDS = []string{
|
|
|
|
|
|
var bidtype = map[string]string{
|
|
var bidtype = map[string]string{
|
|
"招标": "招标",
|
|
"招标": "招标",
|
|
- "邀标": "邀标",
|
|
|
|
- "询价": "询价",
|
|
|
|
- "单一": "单一",
|
|
|
|
- "竞价": "竞价",
|
|
|
|
- "竞谈": "竞谈",
|
|
|
|
|
|
+ "邀标": "邀标",
|
|
|
|
+ "询价": "询价",
|
|
|
|
+ "单一": "单一",
|
|
|
|
+ "竞价": "竞价",
|
|
|
|
+ "竞谈": "竞谈",
|
|
}
|
|
}
|
|
|
|
|
|
var bidstatus = map[string]string{
|
|
var bidstatus = map[string]string{
|
|
@@ -483,13 +483,13 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
if bt == "招标" {
|
|
if bt == "招标" {
|
|
set["projectscope"] = qu.ObjToString(tmp["projectscope"])
|
|
set["projectscope"] = qu.ObjToString(tmp["projectscope"])
|
|
set["bidstatus"] = bt
|
|
set["bidstatus"] = bt
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if bidstatus[bs] != "" {
|
|
if bidstatus[bs] != "" {
|
|
set["bidstatus"] = thisinfo.SubType
|
|
set["bidstatus"] = thisinfo.SubType
|
|
} else if tmp["infoformat"] == 2 {
|
|
} else if tmp["infoformat"] == 2 {
|
|
set["bidstatus"] = "拟建"
|
|
set["bidstatus"] = "拟建"
|
|
- }else if bs == "" {
|
|
|
|
- set["bidstatus"] = ""
|
|
|
|
|
|
+ } else if bs == "" {
|
|
|
|
+ set["bidstatus"] = ""
|
|
} else {
|
|
} else {
|
|
set["bidstatus"] = "其它"
|
|
set["bidstatus"] = "其它"
|
|
}
|
|
}
|
|
@@ -524,7 +524,7 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
set["budget"] = thisinfo.Budget
|
|
set["budget"] = thisinfo.Budget
|
|
p1.Budgettag = 0
|
|
p1.Budgettag = 0
|
|
set["budgettag"] = 0
|
|
set["budgettag"] = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
p1.Budgettag = 1
|
|
p1.Budgettag = 1
|
|
set["budgettag"] = 1
|
|
set["budgettag"] = 1
|
|
}
|
|
}
|
|
@@ -532,7 +532,7 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
set["bidamount"] = thisinfo.Bidamount
|
|
set["bidamount"] = thisinfo.Bidamount
|
|
p1.Bidamounttag = 0
|
|
p1.Bidamounttag = 0
|
|
set["bidamounttag"] = 0
|
|
set["bidamounttag"] = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
p1.Bidamounttag = 1
|
|
p1.Bidamounttag = 1
|
|
set["bidamounttag"] = 1
|
|
set["bidamounttag"] = 1
|
|
}
|
|
}
|
|
@@ -656,7 +656,7 @@ func (p *ProjectTask) NewCachePinfo(id primitive.ObjectID, thisinfo *Info, bidty
|
|
Bidamount: thisinfo.Bidamount,
|
|
Bidamount: thisinfo.Bidamount,
|
|
Bidstatus: thisinfo.SubType,
|
|
Bidstatus: thisinfo.SubType,
|
|
Bidtype: bidtype,
|
|
Bidtype: bidtype,
|
|
- Winners: thisinfo.Winners,
|
|
|
|
|
|
+ Winners: thisinfo.Winners,
|
|
}
|
|
}
|
|
if thisinfo.LenPTC > 5 {
|
|
if thisinfo.LenPTC > 5 {
|
|
p1.MPC = append(p1.MPC, thisinfo.PTC)
|
|
p1.MPC = append(p1.MPC, thisinfo.PTC)
|
|
@@ -690,7 +690,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
pInfo.Jgtime = int64(0)
|
|
pInfo.Jgtime = int64(0)
|
|
set["jgtime"] = int64(0)
|
|
set["jgtime"] = int64(0)
|
|
}
|
|
}
|
|
- }else if thisinfo.TopType == "结果" {
|
|
|
|
|
|
+ } else if thisinfo.TopType == "结果" {
|
|
pInfo.Jgtime = thisinfo.Publishtime
|
|
pInfo.Jgtime = thisinfo.Publishtime
|
|
set["jgtime"] = thisinfo.Publishtime
|
|
set["jgtime"] = thisinfo.Publishtime
|
|
} else if thisinfo.SubType == "合同" {
|
|
} else if thisinfo.SubType == "合同" {
|
|
@@ -718,19 +718,19 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
}
|
|
}
|
|
set["bidstatus"] = bt
|
|
set["bidstatus"] = bt
|
|
pInfo.Bidstatus = bt
|
|
pInfo.Bidstatus = bt
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if bidstatus[bs] != "" {
|
|
if bidstatus[bs] != "" {
|
|
set["bidstatus"] = thisinfo.SubType
|
|
set["bidstatus"] = thisinfo.SubType
|
|
pInfo.Bidstatus = thisinfo.SubType
|
|
pInfo.Bidstatus = thisinfo.SubType
|
|
} else if tmp["infoformat"] == 2 {
|
|
} else if tmp["infoformat"] == 2 {
|
|
set["bidstatus"] = "拟建"
|
|
set["bidstatus"] = "拟建"
|
|
pInfo.Bidstatus = "拟建"
|
|
pInfo.Bidstatus = "拟建"
|
|
- }else if bs == "" {
|
|
|
|
- set["bidstatus"] = ""
|
|
|
|
|
|
+ } else if bs == "" {
|
|
|
|
+ set["bidstatus"] = ""
|
|
pInfo.Bidstatus = ""
|
|
pInfo.Bidstatus = ""
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
set["bidstatus"] = "其它"
|
|
set["bidstatus"] = "其它"
|
|
- pInfo.Bidstatus = "其它"
|
|
|
|
|
|
+ pInfo.Bidstatus = "其它"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
p.mapBidLock.Unlock()
|
|
p.mapBidLock.Unlock()
|
|
@@ -780,7 +780,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
set["buyerclass"] = ""
|
|
set["buyerclass"] = ""
|
|
}
|
|
}
|
|
if thisinfo.ContractCode != "" {
|
|
if thisinfo.ContractCode != "" {
|
|
- set["contractcode"] = pInfo.ContractCode + ","+thisinfo.ContractCode
|
|
|
|
|
|
+ set["contractcode"] = pInfo.ContractCode + "," + thisinfo.ContractCode
|
|
}
|
|
}
|
|
|
|
|
|
//8--代理机构
|
|
//8--代理机构
|
|
@@ -849,13 +849,13 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
if pInfo.Budget >= 0 && pInfo.Budgettag != 1 {
|
|
if pInfo.Budget >= 0 && pInfo.Budgettag != 1 {
|
|
set["budget"] = pInfo.Budget
|
|
set["budget"] = pInfo.Budget
|
|
set["budgettag"] = 0
|
|
set["budgettag"] = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
set["budgettag"] = 1
|
|
set["budgettag"] = 1
|
|
}
|
|
}
|
|
if pInfo.Bidamount >= 0 && pInfo.Bidamounttag != 1 {
|
|
if pInfo.Bidamount >= 0 && pInfo.Bidamounttag != 1 {
|
|
set["bidamount"] = pInfo.Bidamount
|
|
set["bidamount"] = pInfo.Bidamount
|
|
set["bidamounttag"] = 0
|
|
set["bidamounttag"] = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
set["bidamounttag"] = 1
|
|
set["bidamounttag"] = 1
|
|
}
|
|
}
|
|
|
|
|
|
@@ -870,7 +870,7 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
copyMap := Copy(pInfo.InfoFiled).(map[string]InfoField)
|
|
copyMap := Copy(pInfo.InfoFiled).(map[string]InfoField)
|
|
copyMap[thisinfo.Id] = infofiled
|
|
copyMap[thisinfo.Id] = infofiled
|
|
tmpMap := make(map[string]interface{})
|
|
tmpMap := make(map[string]interface{})
|
|
- for k, v := range copyMap{
|
|
|
|
|
|
+ for k, v := range copyMap {
|
|
tmpMap[k] = StructToMap(v)
|
|
tmpMap[k] = StructToMap(v)
|
|
}
|
|
}
|
|
tmpMap[thisinfo.Id] = StructToMap(infofiled)
|
|
tmpMap[thisinfo.Id] = StructToMap(infofiled)
|
|
@@ -917,15 +917,15 @@ func (p *ProjectTask) CompareStatus(project *ProjectInfo, info *Info) (bool, int
|
|
if info.TopType == "拟建" || info.TopType == "预告" || info.TopType == "招标" {
|
|
if info.TopType == "拟建" || info.TopType == "预告" || info.TopType == "招标" {
|
|
if project.Bidstatus == "拟建" || project.Bidstatus == "预告" || project.Bidstatus == "招标" {
|
|
if project.Bidstatus == "拟建" || project.Bidstatus == "预告" || project.Bidstatus == "招标" {
|
|
return false, 0
|
|
return false, 0
|
|
- }else if project.Bidstatus == "废标" || project.Bidstatus == "流标" {
|
|
|
|
|
|
+ } else if project.Bidstatus == "废标" || project.Bidstatus == "流标" {
|
|
return false, 0
|
|
return false, 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
return true, 0
|
|
return true, 0
|
|
}
|
|
}
|
|
} else if info.TopType == "结果" {
|
|
} else if info.TopType == "结果" {
|
|
if project.Bidstatus == "拟建" || project.Bidstatus == "预告" || project.Bidstatus == "招标" {
|
|
if project.Bidstatus == "拟建" || project.Bidstatus == "预告" || project.Bidstatus == "招标" {
|
|
return false, 0
|
|
return false, 0
|
|
- } else if project.Bidstatus == info.SubType {
|
|
|
|
|
|
+ } else if project.Bidstatus == info.SubType {
|
|
//状态一样,根据发布时间判断是否合并
|
|
//状态一样,根据发布时间判断是否合并
|
|
if (info.Publishtime - project.FirstTime) > p.statusTime {
|
|
if (info.Publishtime - project.FirstTime) > p.statusTime {
|
|
return true, 0
|
|
return true, 0
|
|
@@ -1048,16 +1048,16 @@ func PackageFormat(info *Info, project *ProjectInfo) map[string]interface{} {
|
|
func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if info.HasPackage {
|
|
if info.HasPackage {
|
|
budget := 0.0
|
|
budget := 0.0
|
|
- for _, v := range project.Package{
|
|
|
|
|
|
+ for _, v := range project.Package {
|
|
v1, _ := v.([]map[string]interface{})
|
|
v1, _ := v.([]map[string]interface{})
|
|
- for _, v2 := range v1{
|
|
|
|
|
|
+ for _, v2 := range v1 {
|
|
if v2["budget"] != nil {
|
|
if v2["budget"] != nil {
|
|
b1 := qu.Float64All(v2["budget"])
|
|
b1 := qu.Float64All(v2["budget"])
|
|
if b1 > 0 {
|
|
if b1 > 0 {
|
|
budget = budget + b1
|
|
budget = budget + b1
|
|
break
|
|
break
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
project.Budgettag = 1
|
|
project.Budgettag = 1
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1066,11 +1066,11 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if budget > 0 {
|
|
if budget > 0 {
|
|
project.Budget = budget
|
|
project.Budget = budget
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
- }else if budget == 0 && info.Budget > 0 {
|
|
|
|
|
|
+ } else if budget == 0 && info.Budget > 0 {
|
|
project.Budget = info.Budget
|
|
project.Budget = info.Budget
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//招标没有多包
|
|
//招标没有多包
|
|
k := KeyPackage.FindStringSubmatch(info.ProjectName)
|
|
k := KeyPackage.FindStringSubmatch(info.ProjectName)
|
|
if len(k) > 0 {
|
|
if len(k) > 0 {
|
|
@@ -1078,7 +1078,7 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if len(project.Package) > 0 {
|
|
if len(project.Package) > 0 {
|
|
//项目有多包
|
|
//项目有多包
|
|
flag := false
|
|
flag := false
|
|
- for _, v := range project.Package{
|
|
|
|
|
|
+ for _, v := range project.Package {
|
|
v1, _ := v.([]map[string]interface{})
|
|
v1, _ := v.([]map[string]interface{})
|
|
if len(v1) > 0 && v1[0]["name"] == info.ProjectName {
|
|
if len(v1) > 0 && v1[0]["name"] == info.ProjectName {
|
|
flag = true
|
|
flag = true
|
|
@@ -1088,18 +1088,18 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
project.Budget = project.Budget + info.Budget
|
|
project.Budget = project.Budget + info.Budget
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//项目没有多包
|
|
//项目没有多包
|
|
if info.Budget > 0 {
|
|
if info.Budget > 0 {
|
|
project.Budget = project.Budget + info.Budget
|
|
project.Budget = project.Budget + info.Budget
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
- }else if info.Budget == 0 && tmp["budget"] != nil {
|
|
|
|
|
|
+ } else if info.Budget == 0 && tmp["budget"] != nil {
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
project.Budgettag = 1
|
|
project.Budgettag = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if project.Budget < info.Budget {
|
|
if project.Budget < info.Budget {
|
|
project.Budget = info.Budget
|
|
project.Budget = info.Budget
|
|
project.Budgettag = 0
|
|
project.Budgettag = 0
|
|
@@ -1112,16 +1112,16 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if info.SubType == "中标" || info.SubType == "成交" || info.SubType == "合同" {
|
|
if info.SubType == "中标" || info.SubType == "成交" || info.SubType == "合同" {
|
|
if info.HasPackage {
|
|
if info.HasPackage {
|
|
bidamount := 0.0
|
|
bidamount := 0.0
|
|
- for _, v := range project.Package{
|
|
|
|
|
|
+ for _, v := range project.Package {
|
|
v1, _ := v.([]map[string]interface{})
|
|
v1, _ := v.([]map[string]interface{})
|
|
- for _, v2 := range v1{
|
|
|
|
|
|
+ for _, v2 := range v1 {
|
|
if tmp["bidamount"] != nil {
|
|
if tmp["bidamount"] != nil {
|
|
b1 := qu.Float64All(v2["bidamount"])
|
|
b1 := qu.Float64All(v2["bidamount"])
|
|
if b1 > 0 {
|
|
if b1 > 0 {
|
|
bidamount = bidamount + b1
|
|
bidamount = bidamount + b1
|
|
break
|
|
break
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
project.Bidamount = 1
|
|
project.Bidamount = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1129,11 +1129,11 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if bidamount > 0 {
|
|
if bidamount > 0 {
|
|
project.Bidamount = bidamount
|
|
project.Bidamount = bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
- }else if bidamount == 0 && info.Budget > 0 {
|
|
|
|
|
|
+ } else if bidamount == 0 && info.Budget > 0 {
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//招标没有多包
|
|
//招标没有多包
|
|
k := KeyPackage.FindStringSubmatch(info.ProjectName)
|
|
k := KeyPackage.FindStringSubmatch(info.ProjectName)
|
|
if len(k) > 0 {
|
|
if len(k) > 0 {
|
|
@@ -1141,7 +1141,7 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if len(project.Package) > 0 {
|
|
if len(project.Package) > 0 {
|
|
//项目有多包
|
|
//项目有多包
|
|
flag := false
|
|
flag := false
|
|
- for _, v := range project.Package{
|
|
|
|
|
|
+ for _, v := range project.Package {
|
|
v1, _ := v.([]map[string]interface{})
|
|
v1, _ := v.([]map[string]interface{})
|
|
if len(v1) > 0 && v1[0]["name"] == info.ProjectName {
|
|
if len(v1) > 0 && v1[0]["name"] == info.ProjectName {
|
|
flag = true
|
|
flag = true
|
|
@@ -1151,23 +1151,23 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//项目没有多包
|
|
//项目没有多包
|
|
if info.Bidamount > 0 {
|
|
if info.Bidamount > 0 {
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
- }else if info.Bidamount == 0 && tmp["bidamount"] != nil {
|
|
|
|
|
|
+ } else if info.Bidamount == 0 && tmp["bidamount"] != nil {
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
project.Bidamounttag = 1
|
|
project.Bidamounttag = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if info.SubType == "中标" || info.SubType == "成交" {
|
|
if info.SubType == "中标" || info.SubType == "成交" {
|
|
if project.Bidamount < info.Bidamount {
|
|
if project.Bidamount < info.Bidamount {
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
flag := false
|
|
flag := false
|
|
if project.InfoFiled != nil && len(project.InfoFiled) > 0 {
|
|
if project.InfoFiled != nil && len(project.InfoFiled) > 0 {
|
|
for _, res := range project.InfoFiled {
|
|
for _, res := range project.InfoFiled {
|
|
@@ -1183,7 +1183,7 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
if !flag {
|
|
if !flag {
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamount = project.Bidamount + info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
if project.Bidamount < info.Bidamount {
|
|
if project.Bidamount < info.Bidamount {
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamount = info.Bidamount
|
|
project.Bidamounttag = 0
|
|
project.Bidamounttag = 0
|
|
@@ -1197,7 +1197,7 @@ func CountAmount(project *ProjectInfo, info *Info, tmp map[string]interface{}) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
project.Bidamounttag = 1
|
|
project.Bidamounttag = 1
|
|
}
|
|
}
|
|
|
|
|