|
@@ -3,6 +3,7 @@ package front
|
|
|
|
|
|
import (
|
|
import (
|
|
"math"
|
|
"math"
|
|
|
|
+
|
|
//"container/list"
|
|
//"container/list"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
@@ -205,6 +206,7 @@ func (i *Front) Biaozhu() error {
|
|
}
|
|
}
|
|
title := qu.ObjToString(obj[0]["title"])
|
|
title := qu.ObjToString(obj[0]["title"])
|
|
isext, _ := obj[0]["checkType"].(bool)
|
|
isext, _ := obj[0]["checkType"].(bool)
|
|
|
|
+ istag, _ := obj[0]["checkAllTag"].(bool)
|
|
status := qu.IntAll(obj[0]["status"])
|
|
status := qu.IntAll(obj[0]["status"])
|
|
switch title {
|
|
switch title {
|
|
case "基本字段":
|
|
case "基本字段":
|
|
@@ -212,7 +214,7 @@ func (i *Front) Biaozhu() error {
|
|
case "时间地点":
|
|
case "时间地点":
|
|
BzSJDD(content, set, unset, errset)
|
|
BzSJDD(content, set, unset, errset)
|
|
case "标的信息":
|
|
case "标的信息":
|
|
- BzBDXX(content, set, unset, errset, isext, status)
|
|
|
|
|
|
+ BzBDXX(content, set, unset, errset, isext, istag, status)
|
|
case "多包信息":
|
|
case "多包信息":
|
|
BzDBXX(content, set, unset, errset, isext, status)
|
|
BzDBXX(content, set, unset, errset, isext, status)
|
|
case "中标候选人信息":
|
|
case "中标候选人信息":
|
|
@@ -231,12 +233,13 @@ func (i *Front) Biaozhu() error {
|
|
// return nil
|
|
// return nil
|
|
}
|
|
}
|
|
isext, _ := val["checkType"].(bool)
|
|
isext, _ := val["checkType"].(bool)
|
|
|
|
+ istag, _ := val["checkAllTag"].(bool)
|
|
if j == 0 { //基本信息
|
|
if j == 0 { //基本信息
|
|
BzJBZD(content, set, unset, errset)
|
|
BzJBZD(content, set, unset, errset)
|
|
} else if j == 1 { //时间地点
|
|
} else if j == 1 { //时间地点
|
|
BzSJDD(content, set, unset, errset)
|
|
BzSJDD(content, set, unset, errset)
|
|
} else if j == 2 { //标的物
|
|
} else if j == 2 { //标的物
|
|
- BzBDXX(content, set, unset, errset, isext, status)
|
|
|
|
|
|
+ BzBDXX(content, set, unset, errset, isext, istag, status)
|
|
} else if j == 3 { //多包
|
|
} else if j == 3 { //多包
|
|
BzDBXX(content, set, unset, errset, isext, status)
|
|
BzDBXX(content, set, unset, errset, isext, status)
|
|
} else if j == 4 { //候选人
|
|
} else if j == 4 { //候选人
|
|
@@ -246,144 +249,126 @@ func (i *Front) Biaozhu() error {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // qu.Debug("errset---", errset)
|
|
|
|
- // qu.Debug("set---", set)
|
|
|
|
- // qu.Debug("unset---", unset)
|
|
|
|
|
|
+ qu.Debug("errset---", errset)
|
|
|
|
+ qu.Debug("set---", set)
|
|
|
|
+ qu.Debug("unset---", unset)
|
|
|
|
+ userInfo := map[string]interface{}{} //记录本次标注日志
|
|
|
|
+ modifyFields := map[string]interface{}{} //本次标注所有字段
|
|
|
|
+ unerrset := map[string]interface{}{} //记录errdata错误信息表删除
|
|
|
|
+
|
|
loginuser := i.GetSession("loginuser").(string)
|
|
loginuser := i.GetSession("loginuser").(string)
|
|
- unerrset := map[string]interface{}{} //记录errdata错误信息表删除
|
|
|
|
coll := i.GetSession("coll").(string)
|
|
coll := i.GetSession("coll").(string)
|
|
- data, _ := util.MgoM.FindById(coll, _id, nil)
|
|
|
|
- //标注误操作处理
|
|
|
|
|
|
+ data, _ := util.MgoM.FindById(coll, _id, nil) //查询标注保存前的原始信息
|
|
|
|
+ modifyuser := qu.ObjToString((*data)["modifyuser"])
|
|
|
|
+ //标注多次操作处理
|
|
if len(set) > 0 { //set中为本次标注保存的数据(ck_bidopentime:1;ck_buyer:2;buyer:"XXX")
|
|
if len(set) > 0 { //set中为本次标注保存的数据(ck_bidopentime:1;ck_buyer:2;buyer:"XXX")
|
|
for s, sv := range set {
|
|
for s, sv := range set {
|
|
|
|
+ //特殊字段处理
|
|
|
|
+ if s == "ck_pclistag" && (*data)["ck_pclistag"] != nil {
|
|
|
|
+ delete(set, s)
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
//区分是标记字段,还是普通字段(标记字段:ck_buyer;普通字段:buyer)
|
|
//区分是标记字段,还是普通字段(标记字段:ck_buyer;普通字段:buyer)
|
|
- if strings.HasPrefix(s, preKey) { //标记字段
|
|
|
|
- status := qu.IntAll(sv)
|
|
|
|
- field := s[3:] //去除前缀,获得字段
|
|
|
|
- if s == preKey+"package" || s == preKey+"purchasinglist" || s == preKey+"winnerorder" {
|
|
|
|
- if (*data)[s] != nil { //package、purchasinglist、winnerorder已标注,不再修改
|
|
|
|
- delete(set, s)
|
|
|
|
- delete(set, field)
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if set[field] == nil && status != 4 { //表示该字段没有要修改的值,此时标记为1或4(亦或是ck_wodrisext;ck_pkgisext;ck_pclisext)
|
|
|
|
|
|
+ if strings.HasPrefix(s, preKey) {
|
|
|
|
+ status := qu.IntAll(sv) //标注字段状态
|
|
|
|
+ field := s[3:] //去除前缀,被标注字段
|
|
|
|
+ checkedStatus := qu.IntAll((*data)[s]) //数据库被标注状态
|
|
|
|
+ if status == 1 && (checkedStatus == 2 || checkedStatus == 1) { //数据库已有标记,且页面标注正确,此次该字段不做标注保存
|
|
|
|
+ qu.Debug("已标注字段field---", field)
|
|
|
|
+ delete(set, field)
|
|
|
|
+ delete(set, s)
|
|
continue
|
|
continue
|
|
- } else { //此时有修改的值和标记2、3、4
|
|
|
|
- if checkedStatus := qu.IntAll((*data)[s]); checkedStatus != 0 { //已有标注信息的状态
|
|
|
|
- if status == 2 && checkedStatus == 4 { //4>2,errdata删除,marked新增该字段,标记变为1
|
|
|
|
- unerrset[field] = ""
|
|
|
|
- set[s] = 1
|
|
|
|
- } else if status == 3 {
|
|
|
|
- if checkedStatus == 2 { //2>3,marked 修改该字段,标记变为2
|
|
|
|
- set[s] = 2
|
|
|
|
- } else if checkedStatus == 3 { //3>3,对比errdata错误值:相等变为1,errdata删除;不等变为3,marked修改该字段
|
|
|
|
- errdata, _ := util.MgoM.FindById(util.Config.Totablel, _id, `{"`+field+`":1}`)
|
|
|
|
|
|
+ } else {
|
|
|
|
+ qu.Debug("未标注字段field---", field, status)
|
|
|
|
+ if set[field] == nil && status != 2 { //表示该字段没有要修改的值,此时标记为1或2(亦或是ck_wodrisext;ck_pkgisext;ck_pclisext)
|
|
|
|
+ modifyFields[field] = set[s] //目前会有pclisext、pclistag、pkgisext、wodrisext
|
|
|
|
+ continue
|
|
|
|
+ } else { //此时有修改的值和标记2
|
|
|
|
+ modifyFields[field] = status //记录标注的字段和状态
|
|
|
|
+ if checkedStatus != 0 { //已有标注信息的状态
|
|
|
|
+ if status == 2 && checkedStatus == 2 { //字段已被修改且本次也为修改
|
|
|
|
+ errdata, _ := util.MgoM.FindById(util.Config.Totablel, _id, map[string]interface{}{"userinfo": 0})
|
|
|
|
+ //if field == "package" || field == "purchasinglist" || field == "winnerorder" {
|
|
|
|
+ //}
|
|
if errdata != nil && len(*errdata) != 0 {
|
|
if errdata != nil && len(*errdata) != 0 {
|
|
|
|
+ qu.Debug(field, (*errdata)[field] != nil, fmt.Sprint((*errdata)[field]))
|
|
|
|
+ delete(errset, field) //errdata中有该字段的错误记录,不再更新errdata
|
|
|
|
+ //对比errdata错误值:相等变为1,errdata删除;不等变为2,标注表修改该字段
|
|
errText := fmt.Sprint((*errdata)[field])
|
|
errText := fmt.Sprint((*errdata)[field])
|
|
text := fmt.Sprint(set[field])
|
|
text := fmt.Sprint(set[field])
|
|
|
|
+ qu.Debug("errText---", errText, text)
|
|
if errText == text {
|
|
if errText == text {
|
|
- set[s] = 1
|
|
|
|
- unerrset[field] = ""
|
|
|
|
|
|
+ set[s] = 1 //更新标注表字段状态
|
|
|
|
+ unerrset[field] = "" //删除errdata表字段
|
|
|
|
+ //delete(errset, field)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if status == 4 {
|
|
|
|
- if checkedStatus == 2 { //2>4,errdata删除,marked删除该字段,标记变为1
|
|
|
|
- unerrset[field] = ""
|
|
|
|
- set[s] = 1
|
|
|
|
- unset[field] = ""
|
|
|
|
- } else if checkedStatus == 3 { //3>4,marked删除该字段,标记变为4
|
|
|
|
- set[s] = 4
|
|
|
|
- unset[field] = ""
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ qu.Debug("errset---", errset)
|
|
|
|
+ qu.Debug("set---", set)
|
|
|
|
+ qu.Debug("unset---", unset)
|
|
|
|
+ qu.Debug("unerrset---", unerrset)
|
|
|
|
+ //1、errdata操作
|
|
//存储原错误信息
|
|
//存储原错误信息
|
|
- errUpdata := map[string]interface{}{}
|
|
|
|
- if len(errset) > 0 {
|
|
|
|
- for f, v := range errset {
|
|
|
|
- if (*data)[preKey+f] != nil { //已标注保存过不再记录错误信息
|
|
|
|
- delete(errset, f)
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- // if ck, ok := (*data)[preKey+f].(int32); ok && ck != 1 { //已标注保存过不再记录错误信息
|
|
|
|
- // delete(errset, f)
|
|
|
|
- // continue
|
|
|
|
- // }
|
|
|
|
- if f == "purchasinglist" || f == "winnerorder" {
|
|
|
|
- pcl, _ := (*data)[f].([]interface{})
|
|
|
|
- pcl_err := v.([]interface{})
|
|
|
|
- for j, perr := range pcl_err {
|
|
|
|
- perrMap := perr.(map[string]interface{})
|
|
|
|
- if len(perrMap) > 0 {
|
|
|
|
- for k, status := range perrMap {
|
|
|
|
- if pMap, ok := pcl[j].(map[string]interface{}); ok && len(pMap) > 0 { //避免手动增加的子包找不到原数据
|
|
|
|
- pMap[preErr+k] = status //打上错误标记
|
|
|
|
- pMap[k] = pMap[k]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- errset[f] = (*data)[f]
|
|
|
|
- } else if f == "package" {
|
|
|
|
- pkg_err, _ := v.(map[string]interface{})
|
|
|
|
- pkg := (*data)["package"].(map[string]interface{})
|
|
|
|
- for num, v := range pkg_err {
|
|
|
|
- result_err := map[string]interface{}{}
|
|
|
|
- vMap := v.(map[string]interface{})
|
|
|
|
- for k, status := range vMap {
|
|
|
|
- if pMap, ok := pkg[num].(map[string]interface{}); ok && len(pMap) > 0 {
|
|
|
|
- result_err[preErr+k] = status
|
|
|
|
- result_err[k] = pMap[k]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- pkg_err[num] = result_err
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- errset[f] = (*data)[f]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //qu.Debug("errset---", errset)
|
|
|
|
- if len(errset) > 0 {
|
|
|
|
- errset["updatetime"] = time.Now().Unix()
|
|
|
|
- errset["modifyuser"] = loginuser
|
|
|
|
- errUpdata["$set"] = errset
|
|
|
|
|
|
+ errUpdata := map[string]interface{}{} //errdata所有要更新内容
|
|
|
|
+ for f, v := range errset {
|
|
|
|
+ qu.Debug("err filed---", f, v)
|
|
|
|
+ //if f != "package" && f != "purchasinglist" && f != "winnerorder" {
|
|
|
|
+ errset[f] = (*data)[f]
|
|
|
|
+ //}
|
|
|
|
+ }
|
|
|
|
+ if len(modifyFields) > 0 { //有标注字段,记录标注信息
|
|
|
|
+ errset["updatetime"] = time.Now().Unix()
|
|
|
|
+ errset["modifyuser"] = loginuser
|
|
|
|
+ userInfo["fields"] = modifyFields
|
|
|
|
+ userInfo["updatetime"] = time.Now().Unix()
|
|
|
|
+ userInfo["modifyuser"] = loginuser
|
|
|
|
+ errUpdata["$push"] = map[string]interface{}{
|
|
|
|
+ "userinfo": map[string]interface{}{
|
|
|
|
+ "$each": []interface{}{userInfo},
|
|
|
|
+ "$position": 0,
|
|
|
|
+ },
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ qu.Debug("set---", set)
|
|
|
|
+ qu.Debug("errset---", errset)
|
|
|
|
+ qu.Debug("unerrset---", unerrset)
|
|
|
|
+ qu.Debug("userInfo---", userInfo)
|
|
|
|
+ if len(errset) > 0 {
|
|
|
|
+ errUpdata["$set"] = errset
|
|
}
|
|
}
|
|
if len(unerrset) > 0 {
|
|
if len(unerrset) > 0 {
|
|
- //qu.Debug("unerrset---", unerrset)
|
|
|
|
errUpdata["$unset"] = unerrset
|
|
errUpdata["$unset"] = unerrset
|
|
}
|
|
}
|
|
if len(errUpdata) > 0 {
|
|
if len(errUpdata) > 0 {
|
|
util.MgoM.Update(util.Config.Totablel, `{"_id":"`+_id+`"}`, errUpdata, true, false)
|
|
util.MgoM.Update(util.Config.Totablel, `{"_id":"`+_id+`"}`, errUpdata, true, false)
|
|
}
|
|
}
|
|
|
|
+ //更新表操作
|
|
//qu.Debug("set---", set)
|
|
//qu.Debug("set---", set)
|
|
//更新正确信息
|
|
//更新正确信息
|
|
update := map[string]interface{}{}
|
|
update := map[string]interface{}{}
|
|
if len(set) > 0 {
|
|
if len(set) > 0 {
|
|
set["ck_data"] = stype
|
|
set["ck_data"] = stype
|
|
set["updatetime"] = time.Now().Unix()
|
|
set["updatetime"] = time.Now().Unix()
|
|
- set["modifyuser"] = loginuser
|
|
|
|
|
|
+ if modifyuser == "" {
|
|
|
|
+ set["modifyuser"] = modifyuser
|
|
|
|
+ }
|
|
update["$set"] = set
|
|
update["$set"] = set
|
|
}
|
|
}
|
|
|
|
+ qu.Debug("unset---", unset)
|
|
if len(unset) > 0 {
|
|
if len(unset) > 0 {
|
|
update["$unset"] = unset
|
|
update["$unset"] = unset
|
|
}
|
|
}
|
|
|
|
+ qu.Debug("update---", update)
|
|
if len(update) > 0 {
|
|
if len(update) > 0 {
|
|
b = util.MgoM.Update(coll, `{"_id":"`+_id+`"}`, update, false, false)
|
|
b = util.MgoM.Update(coll, `{"_id":"`+_id+`"}`, update, false, false)
|
|
if b {
|
|
if b {
|
|
- //for e := IdList.Front(); e != nil; e = e.Next() { //遍历IdList,删除元素
|
|
|
|
- // if _id == qu.ObjToString(e.Value) {
|
|
|
|
- // IdList.Remove(e)
|
|
|
|
- // break
|
|
|
|
- // }
|
|
|
|
- //}
|
|
|
|
if coll != util.Config.Fromtable && isSaveMarked { //util.coll此时的标注表 util.Config.Fromtable默认标注表
|
|
if coll != util.Config.Fromtable && isSaveMarked { //util.coll此时的标注表 util.Config.Fromtable默认标注表
|
|
data, _ := util.MgoM.FindById(coll, _id, nil)
|
|
data, _ := util.MgoM.FindById(coll, _id, nil)
|
|
if data != nil && len(*data) > 0 {
|
|
if data != nil && len(*data) > 0 {
|
|
@@ -398,6 +383,8 @@ func (i *Front) Biaozhu() error {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
i.ServeJson(b)
|
|
i.ServeJson(b)
|
|
|
|
+ } else {
|
|
|
|
+ i.ServeJson(true)
|
|
}
|
|
}
|
|
|
|
|
|
return nil
|
|
return nil
|
|
@@ -431,9 +418,10 @@ func (i *Front) Detail(id string) error {
|
|
i.T["worder"] = rep["worder"]
|
|
i.T["worder"] = rep["worder"]
|
|
i.T["packs"] = rep["packs"]
|
|
i.T["packs"] = rep["packs"]
|
|
i.T["packskey"] = rep["packskey"]
|
|
i.T["packskey"] = rep["packskey"]
|
|
- i.T["ck_pclisext"] = rep["ck_pclisext"]
|
|
|
|
- i.T["ck_wodrisext"] = rep["ck_wodrisext"]
|
|
|
|
- i.T["ck_pkgisext"] = rep["ck_pkgisext"]
|
|
|
|
|
|
+ //i.T["ck_pclisext"] = rep["ck_pclisext"]
|
|
|
|
+ i.T["ck_pclistag"] = rep["ck_pclistag"]
|
|
|
|
+ //i.T["ck_wodrisext"] = rep["ck_wodrisext"]
|
|
|
|
+ //i.T["ck_pkgisext"] = rep["ck_pkgisext"]
|
|
i.T["timeplace"] = rep["timeplace"]
|
|
i.T["timeplace"] = rep["timeplace"]
|
|
i.T["purchasinglist"] = rep["purchasinglist"]
|
|
i.T["purchasinglist"] = rep["purchasinglist"]
|
|
i.T["other"] = rep["other"]
|
|
i.T["other"] = rep["other"]
|
|
@@ -451,6 +439,7 @@ func (i *Front) Detail(id string) error {
|
|
checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
|
|
checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
|
|
i.T["checkednum"] = checkedNum
|
|
i.T["checkednum"] = checkedNum
|
|
i.T["allnum"] = allNum
|
|
i.T["allnum"] = allNum
|
|
|
|
+ i.T["fields"] = util.Config.Fields
|
|
//存入Redis
|
|
//存入Redis
|
|
redis.Put("extcheck", coll+"_"+id, "", util.Config.RedisTimeout*60) //正在标注的数据存入redis避免多人同时标注(加上coll左前缀避免不同表相同id数据不能同时标注)
|
|
redis.Put("extcheck", coll+"_"+id, "", util.Config.RedisTimeout*60) //正在标注的数据存入redis避免多人同时标注(加上coll左前缀避免不同表相同id数据不能同时标注)
|
|
return i.Render("detail.html", &i.T)
|
|
return i.Render("detail.html", &i.T)
|
|
@@ -762,12 +751,14 @@ func getDetail(id, coll string) map[string]interface{} {
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
info["_id"] = mgo.BsonIdToSId(info["_id"])
|
|
info["_id"] = mgo.BsonIdToSId(info["_id"])
|
|
- ck_pclisext, _ := info["ck_pclisext"].(bool)
|
|
|
|
- ck_wodrisext, _ := info["ck_wodrisext"].(bool)
|
|
|
|
- ck_pkgisext, _ := info["ck_pkgisext"].(bool)
|
|
|
|
- rep["ck_pclisext"] = ck_pclisext
|
|
|
|
- rep["ck_wodrisext"] = ck_wodrisext
|
|
|
|
- rep["ck_pkgisext"] = ck_pkgisext
|
|
|
|
|
|
+ //ck_pclisext, _ := info["ck_pclisext"].(bool)
|
|
|
|
+ ck_pclistag, _ := info["ck_pclistag"].(bool)
|
|
|
|
+ //ck_wodrisext, _ := info["ck_wodrisext"].(bool)
|
|
|
|
+ //ck_pkgisext, _ := info["ck_pkgisext"].(bool)
|
|
|
|
+ //rep["ck_pclisext"] = ck_pclisext
|
|
|
|
+ rep["ck_pclistag"] = ck_pclistag
|
|
|
|
+ //rep["ck_wodrisext"] = ck_wodrisext
|
|
|
|
+ //rep["ck_pkgisext"] = ck_pkgisext
|
|
href := qu.ObjToString(info["href"])
|
|
href := qu.ObjToString(info["href"])
|
|
if !strings.HasPrefix(href, "http") {
|
|
if !strings.HasPrefix(href, "http") {
|
|
info["href"] = "http://" + href
|
|
info["href"] = "http://" + href
|
|
@@ -784,9 +775,9 @@ func getDetail(id, coll string) map[string]interface{} {
|
|
rep["packs"] = packs
|
|
rep["packs"] = packs
|
|
rep["packskey"] = packskey
|
|
rep["packskey"] = packskey
|
|
rep["pkg_new"] = pkg_new
|
|
rep["pkg_new"] = pkg_new
|
|
- purchasinglist, pcl_new := setPurchasingMap(info) //标的物
|
|
|
|
|
|
+ purchasinglist, isNewStatus := setPurchasingMap(info) //标的物
|
|
rep["purchasinglist"] = purchasinglist
|
|
rep["purchasinglist"] = purchasinglist
|
|
- rep["pcl_new"] = pcl_new
|
|
|
|
|
|
+ rep["pcl_new"] = isNewStatus
|
|
worder, worder_new := setWorderMap(info) //中标候选人
|
|
worder, worder_new := setWorderMap(info) //中标候选人
|
|
rep["worder"] = worder
|
|
rep["worder"] = worder
|
|
rep["worder_new"] = worder_new
|
|
rep["worder_new"] = worder_new
|
|
@@ -912,28 +903,33 @@ func DealData(tmpLen int, publishtime float64, tmp []map[string]interface{}, mor
|
|
}
|
|
}
|
|
|
|
|
|
//拼装中标候选人
|
|
//拼装中标候选人
|
|
-func setWorderMap(info map[string]interface{}) ([]interface{}, []bool) {
|
|
|
|
|
|
+func setWorderMap(info map[string]interface{}) ([]interface{}, []map[string]interface{}) {
|
|
//基本参数--中标候选人
|
|
//基本参数--中标候选人
|
|
winnerorder, _ := util.Config.Biaozhu["winnerorder"].([]interface{})
|
|
winnerorder, _ := util.Config.Biaozhu["winnerorder"].([]interface{})
|
|
worders := []interface{}{}
|
|
worders := []interface{}{}
|
|
- isNewWorder := []bool{} //记录子包是否是新增的
|
|
|
|
|
|
+ isNewAndStatus := []map[string]interface{}{}
|
|
if tmpwds, ok := info["winnerorder"].([]interface{}); ok {
|
|
if tmpwds, ok := info["winnerorder"].([]interface{}); ok {
|
|
for _, v := range tmpwds {
|
|
for _, v := range tmpwds {
|
|
if wd, ok := v.(map[string]interface{}); ok {
|
|
if wd, ok := v.(map[string]interface{}); ok {
|
|
- isNew, _ := wd["ck_isnew"].(bool)
|
|
|
|
- isNewWorder = append(isNewWorder, isNew)
|
|
|
|
|
|
+ //isNew, _ := wd["ck_isnew"].(bool)
|
|
|
|
+ isNew := false
|
|
|
|
+ status := "-1"
|
|
|
|
+ if wd["ck_winnerorder"] != nil {
|
|
|
|
+ status = "1"
|
|
|
|
+ }
|
|
|
|
+ isNewAndStatus = append(isNewAndStatus, map[string]interface{}{"isnew": isNew, "status": status})
|
|
wds := []interface{}{}
|
|
wds := []interface{}{}
|
|
for _, cp := range winnerorder {
|
|
for _, cp := range winnerorder {
|
|
cp, _ := cp.(map[string]interface{})
|
|
cp, _ := cp.(map[string]interface{})
|
|
|
|
+ value := wd[qu.ObjToString(cp["key"])]
|
|
|
|
+ if value == nil {
|
|
|
|
+ value = ""
|
|
|
|
+ }
|
|
tp := map[string]interface{}{
|
|
tp := map[string]interface{}{
|
|
"key": cp["key"],
|
|
"key": cp["key"],
|
|
"descript": cp["descript"],
|
|
"descript": cp["descript"],
|
|
- "value": wd[qu.ObjToString(cp["key"])],
|
|
|
|
- }
|
|
|
|
- if wd[preKey+fmt.Sprint(tp["key"])] == nil {
|
|
|
|
- tp["status"] = "-1"
|
|
|
|
- } else {
|
|
|
|
- tp["status"] = "1"
|
|
|
|
|
|
+ "value": value,
|
|
|
|
+ "status": status,
|
|
}
|
|
}
|
|
wds = append(wds, tp)
|
|
wds = append(wds, tp)
|
|
}
|
|
}
|
|
@@ -941,19 +937,26 @@ func setWorderMap(info map[string]interface{}) ([]interface{}, []bool) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return worders, isNewWorder
|
|
|
|
|
|
+ return worders, isNewAndStatus
|
|
}
|
|
}
|
|
|
|
|
|
//拼装标的物
|
|
//拼装标的物
|
|
-func setPurchasingMap(info map[string]interface{}) ([]interface{}, []bool) {
|
|
|
|
|
|
+func setPurchasingMap(info map[string]interface{}) ([]interface{}, []map[string]interface{}) {
|
|
purchasinglist, _ := util.Config.Biaozhu["purchasinglist"].([]interface{})
|
|
purchasinglist, _ := util.Config.Biaozhu["purchasinglist"].([]interface{})
|
|
purchasinglists := []interface{}{}
|
|
purchasinglists := []interface{}{}
|
|
- isNewPcl := []bool{} //记录子包是否是新增的
|
|
|
|
|
|
+ //isNewPcl := []bool{} //记录子包是否是新增的
|
|
|
|
+ isNewAndStatus := []map[string]interface{}{}
|
|
if tmpcls, ok := info["purchasinglist"].([]interface{}); ok {
|
|
if tmpcls, ok := info["purchasinglist"].([]interface{}); ok {
|
|
for _, v := range tmpcls {
|
|
for _, v := range tmpcls {
|
|
if pcl, ok := v.(map[string]interface{}); ok {
|
|
if pcl, ok := v.(map[string]interface{}); ok {
|
|
- isNew, _ := pcl["ck_isnew"].(bool)
|
|
|
|
- isNewPcl = append(isNewPcl, isNew)
|
|
|
|
|
|
+ //isNew, _ := pcl["ck_isnew"].(bool)
|
|
|
|
+ isNew := false
|
|
|
|
+ status := "-1"
|
|
|
|
+ if pcl["ck_purchasinglist"] != nil {
|
|
|
|
+ status = "1"
|
|
|
|
+ }
|
|
|
|
+ //isNewPcl = append(isNewPcl, isNew)
|
|
|
|
+ isNewAndStatus = append(isNewAndStatus, map[string]interface{}{"isnew": isNew, "status": status})
|
|
pcls := []interface{}{}
|
|
pcls := []interface{}{}
|
|
for _, ps := range purchasinglist {
|
|
for _, ps := range purchasinglist {
|
|
ps, _ := ps.(map[string]interface{})
|
|
ps, _ := ps.(map[string]interface{})
|
|
@@ -965,23 +968,24 @@ func setPurchasingMap(info map[string]interface{}) ([]interface{}, []bool) {
|
|
"key": ps["key"],
|
|
"key": ps["key"],
|
|
"descript": ps["descript"],
|
|
"descript": ps["descript"],
|
|
"value": value,
|
|
"value": value,
|
|
|
|
+ "status": status,
|
|
}
|
|
}
|
|
- if pcl[preKey+fmt.Sprint(tp["key"])] == nil {
|
|
|
|
- tp["status"] = "-1"
|
|
|
|
- } else {
|
|
|
|
- tp["status"] = "1"
|
|
|
|
- }
|
|
|
|
|
|
+ // if pcl[preKey+fmt.Sprint(tp["key"])] == nil {
|
|
|
|
+ // tp["status"] = "-1"
|
|
|
|
+ // } else {
|
|
|
|
+ // tp["status"] = "1"
|
|
|
|
+ // }
|
|
pcls = append(pcls, tp)
|
|
pcls = append(pcls, tp)
|
|
}
|
|
}
|
|
purchasinglists = append(purchasinglists, pcls)
|
|
purchasinglists = append(purchasinglists, pcls)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return purchasinglists, isNewPcl
|
|
|
|
|
|
+ return purchasinglists, isNewAndStatus
|
|
}
|
|
}
|
|
|
|
|
|
//拼装子包信息
|
|
//拼装子包信息
|
|
-func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string, map[string]bool) {
|
|
|
|
|
|
+func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string, []bool) {
|
|
var confpack []interface{}
|
|
var confpack []interface{}
|
|
confpack, _ = util.Config.Biaozhu["package"].([]interface{})
|
|
confpack, _ = util.Config.Biaozhu["package"].([]interface{})
|
|
packs := map[string]map[string]interface{}{}
|
|
packs := map[string]map[string]interface{}{}
|
|
@@ -990,7 +994,12 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
|
|
if packages, ok := info["package"].(map[string]interface{}); ok && len(packages) > 0 {
|
|
if packages, ok := info["package"].(map[string]interface{}); ok && len(packages) > 0 {
|
|
for k, tmpackage := range packages { //遍历分包
|
|
for k, tmpackage := range packages { //遍历分包
|
|
if tmppack, ok := tmpackage.(map[string]interface{}); ok {
|
|
if tmppack, ok := tmpackage.(map[string]interface{}); ok {
|
|
- isNew, _ := tmppack["ck_isnew"].(bool)
|
|
|
|
|
|
+ //isNew, _ := tmppack["ck_isnew"].(bool)
|
|
|
|
+ isNew := false
|
|
|
|
+ status := "-1"
|
|
|
|
+ if tmppack["ck_package"] != nil {
|
|
|
|
+ status = "1"
|
|
|
|
+ }
|
|
isNewPkg[k] = isNew
|
|
isNewPkg[k] = isNew
|
|
sortpackskey = append(sortpackskey, k)
|
|
sortpackskey = append(sortpackskey, k)
|
|
pack := []interface{}{}
|
|
pack := []interface{}{}
|
|
@@ -1009,20 +1018,12 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
|
|
} else {
|
|
} else {
|
|
tp["value"] = ""
|
|
tp["value"] = ""
|
|
}
|
|
}
|
|
- if tmppack[preKey+fmt.Sprint(tp["key"])] == nil {
|
|
|
|
- tp["status"] = "-1"
|
|
|
|
- } else {
|
|
|
|
- tp["status"] = "1"
|
|
|
|
- }
|
|
|
|
|
|
+ tp["status"] = status
|
|
pack = append(pack, tp)
|
|
pack = append(pack, tp)
|
|
}
|
|
}
|
|
//特殊处理中标单位和中标金额
|
|
//特殊处理中标单位和中标金额
|
|
winnerall := []interface{}{}
|
|
winnerall := []interface{}{}
|
|
if tmpWinnerAll, ok := tmppack["winner_all"].([]interface{}); ok && len(tmpWinnerAll) > 0 {
|
|
if tmpWinnerAll, ok := tmppack["winner_all"].([]interface{}); ok && len(tmpWinnerAll) > 0 {
|
|
- status := "-1"
|
|
|
|
- if tmppack[preKey+"winner_all"] != nil {
|
|
|
|
- status = "1"
|
|
|
|
- }
|
|
|
|
for _, tmp := range tmpWinnerAll {
|
|
for _, tmp := range tmpWinnerAll {
|
|
tmpMap := tmp.(map[string]interface{})
|
|
tmpMap := tmp.(map[string]interface{})
|
|
win := map[string]interface{}{
|
|
win := map[string]interface{}{
|
|
@@ -1039,7 +1040,7 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
|
|
bidamount = fmt.Sprint(tmpMap["bidamount"])
|
|
bidamount = fmt.Sprint(tmpMap["bidamount"])
|
|
}
|
|
}
|
|
bid := map[string]interface{}{
|
|
bid := map[string]interface{}{
|
|
- "descript": "标段(包)中金额",
|
|
|
|
|
|
+ "descript": "标段(包)中标金额",
|
|
"key": "bidamount",
|
|
"key": "bidamount",
|
|
"status": status,
|
|
"status": status,
|
|
"value": bidamount,
|
|
"value": bidamount,
|
|
@@ -1054,25 +1055,28 @@ func setPaceMap(info map[string]interface{}) ([]map[string]interface{}, []string
|
|
"value": "",
|
|
"value": "",
|
|
})
|
|
})
|
|
winnerall = append(winnerall, map[string]interface{}{
|
|
winnerall = append(winnerall, map[string]interface{}{
|
|
- "descript": "标段(包)中标价",
|
|
|
|
|
|
+ "descript": "标段(包)中标金额",
|
|
"key": "bidamount",
|
|
"key": "bidamount",
|
|
"status": "-1",
|
|
"status": "-1",
|
|
"value": "",
|
|
"value": "",
|
|
})
|
|
})
|
|
}
|
|
}
|
|
packs[k] = map[string]interface{}{
|
|
packs[k] = map[string]interface{}{
|
|
- "pack": pack,
|
|
|
|
- "winnerall": winnerall,
|
|
|
|
|
|
+ "pack": pack,
|
|
|
|
+ "packstatus": status,
|
|
|
|
+ "winnerall": winnerall,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
sort.Strings(sortpackskey)
|
|
sort.Strings(sortpackskey)
|
|
packages := []map[string]interface{}{}
|
|
packages := []map[string]interface{}{}
|
|
|
|
+ isNewPkgArr := []bool{}
|
|
for _, v := range sortpackskey {
|
|
for _, v := range sortpackskey {
|
|
packages = append(packages, packs[v])
|
|
packages = append(packages, packs[v])
|
|
|
|
+ isNewPkgArr = append(isNewPkgArr, isNewPkg[v])
|
|
}
|
|
}
|
|
- return packages, sortpackskey, isNewPkg
|
|
|
|
|
|
+ return packages, sortpackskey, isNewPkgArr
|
|
}
|
|
}
|
|
|
|
|
|
//拼装抽取common值
|
|
//拼装抽取common值
|
|
@@ -1171,26 +1175,31 @@ func BzJBZD(content []interface{}, set, unset, errset map[string]interface{}) {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
if status == 2 || status == 3 { //新增、修改
|
|
if status == 2 || status == 3 { //新增、修改
|
|
- input := tmpMap["input"] //值
|
|
|
|
- if key == "subtype" || key == "attach_discern" || key == "attach_ext" || key == "isrepeat" { //附件识别、抽取select
|
|
|
|
|
|
+ input := tmpMap["input"] //值
|
|
|
|
+ if key == "bidamounttype" || key == "subtype" || key == "attach_discern" || key == "attach_ext" || key == "isrepeat" { //附件识别、抽取select
|
|
input = tmpMap["select"]
|
|
input = tmpMap["select"]
|
|
- } else if key == "budget" || key == "bidamount" || key == "biddiscount" {
|
|
|
|
- input = qu.Float64All(input)
|
|
|
|
}
|
|
}
|
|
- if key == "subtype" {
|
|
|
|
- if topsubtype := strings.Split(qu.ObjToString(input), "-"); len(topsubtype) == 2 {
|
|
|
|
- set["toptype"] = topsubtype[0]
|
|
|
|
- set[key] = topsubtype[1]
|
|
|
|
- }
|
|
|
|
|
|
+ if input == "" {
|
|
|
|
+ unset[key] = "" //表示删除
|
|
} else {
|
|
} else {
|
|
- set[key] = input
|
|
|
|
|
|
+ if key == "budget" || key == "bidamount" || key == "biddiscount" {
|
|
|
|
+ input = qu.Float64All(input)
|
|
|
|
+ }
|
|
|
|
+ if key == "subtype" {
|
|
|
|
+ if topsubtype := strings.Split(qu.ObjToString(input), "-"); len(topsubtype) == 2 {
|
|
|
|
+ set["toptype"] = topsubtype[0]
|
|
|
|
+ set[key] = topsubtype[1]
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ set[key] = input
|
|
|
|
+ }
|
|
}
|
|
}
|
|
errset[key] = status
|
|
errset[key] = status
|
|
} else if status == 4 { //删除
|
|
} else if status == 4 { //删除
|
|
unset[key] = ""
|
|
unset[key] = ""
|
|
errset[key] = status
|
|
errset[key] = status
|
|
}
|
|
}
|
|
- set[preKey+key] = status
|
|
|
|
|
|
+ set[preKey+key] = status //记录状态
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1209,13 +1218,17 @@ func BzSJDD(content []interface{}, set, unset, errset map[string]interface{}) {
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
if status == 2 || status == 3 { //新增、修改
|
|
if status == 2 || status == 3 { //新增、修改
|
|
input := tmpMap["input"] //值
|
|
input := tmpMap["input"] //值
|
|
- if key == "bidopentime" || key == "publishtime" || key == "bidendtime" || key == "project_startdate" || key == "project_completedate" {
|
|
|
|
- inputTmp, _ := time.ParseInLocation(qu.Date_Full_Layout, input.(string), time.Local)
|
|
|
|
- input = inputTmp.Unix()
|
|
|
|
- } else if key == "project_duration" {
|
|
|
|
- input = qu.IntAll(input)
|
|
|
|
|
|
+ if input == "" {
|
|
|
|
+ unset[key] = ""
|
|
|
|
+ } else {
|
|
|
|
+ if key == "bidopentime" || key == "publishtime" || key == "bidendtime" || key == "project_startdate" || key == "project_completedate" {
|
|
|
|
+ inputTmp, _ := time.ParseInLocation(qu.Date_Full_Layout, input.(string), time.Local)
|
|
|
|
+ input = inputTmp.Unix()
|
|
|
|
+ } else if key == "project_duration" {
|
|
|
|
+ input = qu.IntAll(input)
|
|
|
|
+ }
|
|
|
|
+ set[key] = input
|
|
}
|
|
}
|
|
- set[key] = input
|
|
|
|
errset[key] = status
|
|
errset[key] = status
|
|
} else if status == 4 { //删除
|
|
} else if status == 4 { //删除
|
|
unset[key] = ""
|
|
unset[key] = ""
|
|
@@ -1231,14 +1244,14 @@ func BzSJDD(content []interface{}, set, unset, errset map[string]interface{}) {
|
|
}
|
|
}
|
|
|
|
|
|
//标注标的信息
|
|
//标注标的信息
|
|
-func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, isext bool, status int) {
|
|
|
|
|
|
+func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, isext, istag bool, status int) {
|
|
//qu.Debug("是否抽取:", status, isext, len(content), errset)
|
|
//qu.Debug("是否抽取:", status, isext, len(content), errset)
|
|
if status == -1 {
|
|
if status == -1 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- set["ck_pclisext"] = isext //标的信息是否抽取标记
|
|
|
|
|
|
+ //set["ck_pclisext"] = isext //标的信息是否抽取标记
|
|
|
|
+ set["ck_pclistag"] = istag //标的信息是否标注完全
|
|
purchasinglist := []interface{}{}
|
|
purchasinglist := []interface{}{}
|
|
- errList := []interface{}{}
|
|
|
|
delpclson := 0
|
|
delpclson := 0
|
|
for _, con := range content {
|
|
for _, con := range content {
|
|
info, _ := con.(map[string]interface{})
|
|
info, _ := con.(map[string]interface{})
|
|
@@ -1251,43 +1264,50 @@ func BzBDXX(content []interface{}, set, unset, errset map[string]interface{}, is
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
"ck_isnew": isNew,
|
|
"ck_isnew": isNew,
|
|
}
|
|
}
|
|
- errResult := map[string]interface{}{}
|
|
|
|
for _, tmp := range uInputs {
|
|
for _, tmp := range uInputs {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
input := tmpMap["input"] //值
|
|
input := tmpMap["input"] //值
|
|
- status := qu.IntAll(tmpMap["status"])
|
|
|
|
|
|
+ //status := qu.IntAll(tmpMap["status"])
|
|
isNull := false
|
|
isNull := false
|
|
- if key == "number" || key == "unitprice" || key == "totalprice" {
|
|
|
|
- if input != "" { //有值
|
|
|
|
- isNull = false
|
|
|
|
- input = qu.Float64All(input)
|
|
|
|
- } else {
|
|
|
|
- isNull = true
|
|
|
|
- }
|
|
|
|
- } else if key == "pclisover" {
|
|
|
|
- input = tmpMap["select"]
|
|
|
|
|
|
+ if input == "" { //判断前台页面是否填值,无值不进行字段存储
|
|
|
|
+ isNull = true
|
|
|
|
+ } else if key == "number" || key == "unitprice" || key == "totalprice" {
|
|
|
|
+ input = qu.Float64All(input)
|
|
}
|
|
}
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
result[key] = input
|
|
result[key] = input
|
|
}
|
|
}
|
|
- result[preKey+key] = status
|
|
|
|
- if !isNew && (status == 2 || status == 3 || status == 4) {
|
|
|
|
- errResult[key] = status //记录哪个字段错误
|
|
|
|
- }
|
|
|
|
|
|
+ //result[preKey+key] = status
|
|
|
|
+ // if !isNew && (status == 2 || status == 3 || status == 4) {
|
|
|
|
+ // errResult[key] = status //记录哪个字段错误
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if pclSonStatus != -1 { //没有标注的标的信息不打标记
|
|
|
|
+ result["ck_purchasinglist"] = pclSonStatus
|
|
|
|
+ }
|
|
if len(result) > 0 && pclSonStatus != 4 {
|
|
if len(result) > 0 && pclSonStatus != 4 {
|
|
purchasinglist = append(purchasinglist, result)
|
|
purchasinglist = append(purchasinglist, result)
|
|
}
|
|
}
|
|
- errList = append(errList, errResult)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- errset["purchasinglist"] = errList
|
|
|
|
|
|
+ if status != 1 { //如果purchasinglist状态不是1,errdata则记录原purchasinglist字段
|
|
|
|
+ errset["purchasinglist"] = true
|
|
|
|
+ }
|
|
|
|
+ qu.Debug("purchasinglist", len(purchasinglist))
|
|
if len(purchasinglist)+delpclson == len(content) {
|
|
if len(purchasinglist)+delpclson == len(content) {
|
|
- set["purchasinglist"] = purchasinglist
|
|
|
|
|
|
+ if len(purchasinglist) > 0 {
|
|
|
|
+ set["purchasinglist"] = purchasinglist
|
|
|
|
+ }
|
|
set[preKey+"purchasinglist"] = status
|
|
set[preKey+"purchasinglist"] = status
|
|
|
|
+ if len(content) > 0 && delpclson == len(content) { //只有删除
|
|
|
|
+ unset["purchasinglist"] = ""
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ qu.Debug("set---", set)
|
|
|
|
+ qu.Debug("errset---", errset)
|
|
|
|
+ qu.Debug("unset---", unset)
|
|
}
|
|
}
|
|
|
|
|
|
//标注多包信息
|
|
//标注多包信息
|
|
@@ -1296,9 +1316,9 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
|
|
if status == -1 {
|
|
if status == -1 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- set["ck_pkgisext"] = isext //多包是否抽取标记
|
|
|
|
|
|
+ //set["ck_pkgisext"] = isext //多包是否抽取标记
|
|
pkgs := map[string]interface{}{}
|
|
pkgs := map[string]interface{}{}
|
|
- errMap := map[string]interface{}{}
|
|
|
|
|
|
+ //errMap := map[string]interface{}{}
|
|
newNum := 1
|
|
newNum := 1
|
|
delpkgson := 0 //记录子包删除个数
|
|
delpkgson := 0 //记录子包删除个数
|
|
for _, con := range content {
|
|
for _, con := range content {
|
|
@@ -1317,47 +1337,95 @@ func BzDBXX(content []interface{}, set, unset, errset map[string]interface{}, is
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
"ck_isnew": isNew,
|
|
"ck_isnew": isNew,
|
|
}
|
|
}
|
|
- errResult := map[string]interface{}{}
|
|
|
|
|
|
+ //errResult := map[string]interface{}{}
|
|
|
|
+ winnerArr := []interface{}{}
|
|
|
|
+ bidamountArr := []interface{}{}
|
|
for _, tmp := range uInputs {
|
|
for _, tmp := range uInputs {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
input := tmpMap["input"] //值
|
|
input := tmpMap["input"] //值
|
|
- status := qu.IntAll(tmpMap["status"])
|
|
|
|
- isNull := false
|
|
|
|
- if key == "bidamount" || key == "budget" {
|
|
|
|
- if input != "" { //有值
|
|
|
|
- isNull = false
|
|
|
|
|
|
+ //status := qu.IntAll(tmpMap["status"])
|
|
|
|
+ isNull := false //记录字段是否有值
|
|
|
|
+ if key == "bidamounttype" {
|
|
|
|
+ input = tmpMap["select"]
|
|
|
|
+ } else {
|
|
|
|
+ if input == "" { //判断前台页面是否填值,无值不进行字段存储
|
|
|
|
+ isNull = true
|
|
|
|
+ } else if key == "bidamount" || key == "budget" {
|
|
input = qu.Float64All(input)
|
|
input = qu.Float64All(input)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if key == "winner" {
|
|
|
|
+ if isNull {
|
|
|
|
+ winnerArr = append(winnerArr, nil)
|
|
} else {
|
|
} else {
|
|
- isNull = true
|
|
|
|
|
|
+ winnerArr = append(winnerArr, input)
|
|
}
|
|
}
|
|
|
|
+ continue
|
|
|
|
+ } else if key == "bidamount" {
|
|
|
|
+ if isNull {
|
|
|
|
+ bidamountArr = append(bidamountArr, nil)
|
|
|
|
+ } else {
|
|
|
|
+ bidamountArr = append(bidamountArr, input)
|
|
|
|
+ }
|
|
|
|
+ continue
|
|
}
|
|
}
|
|
|
|
+
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
result[key] = input
|
|
result[key] = input
|
|
}
|
|
}
|
|
- result[preKey+key] = status
|
|
|
|
- if !isNew && (status == 2 || status == 3 || status == 4) {
|
|
|
|
- errResult[key] = status //记录哪个字段错误
|
|
|
|
|
|
+ //result[preKey+key] = status
|
|
|
|
+ // if !isNew && status >= 2 {
|
|
|
|
+ // errResult[key] = status //记录哪个字段错误
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ winner_all := []interface{}{}
|
|
|
|
+ if len(winnerArr) == len(bidamountArr) {
|
|
|
|
+ for i, w := range winnerArr {
|
|
|
|
+ b := bidamountArr[i]
|
|
|
|
+ wbMap := map[string]interface{}{}
|
|
|
|
+ if w != nil {
|
|
|
|
+ wbMap["winner"] = w
|
|
|
|
+ }
|
|
|
|
+ if b != nil {
|
|
|
|
+ wbMap["bidamount"] = b
|
|
|
|
+ }
|
|
|
|
+ if len(wbMap) > 0 {
|
|
|
|
+ winner_all = append(winner_all, wbMap)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if len(errResult) > 0 {
|
|
|
|
- errMap[num] = errResult
|
|
|
|
|
|
+ if len(winner_all) > 0 {
|
|
|
|
+ result["winner_all"] = winner_all
|
|
}
|
|
}
|
|
|
|
+ result["ck_package"] = pkgSonStatus
|
|
|
|
+ // if len(errResult) > 0 {
|
|
|
|
+ // errMap[num] = errResult
|
|
|
|
+ // }
|
|
if len(result) > 0 && pkgSonStatus != 4 { //要删除的子包不再保存
|
|
if len(result) > 0 && pkgSonStatus != 4 { //要删除的子包不再保存
|
|
pkgs[num] = result
|
|
pkgs[num] = result
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if len(errMap) > 0 {
|
|
|
|
- errset["package"] = errMap
|
|
|
|
|
|
+ if status != 1 { //如果package状态不是1,errdata则记录原package字段
|
|
|
|
+ errset["package"] = true
|
|
}
|
|
}
|
|
|
|
+ // if len(errMap) > 0 {
|
|
|
|
+ // errset["package"] = errMap
|
|
|
|
+ // }
|
|
|
|
+ qu.Debug("pkgs", len(pkgs))
|
|
if len(pkgs)+delpkgson == len(content) {
|
|
if len(pkgs)+delpkgson == len(content) {
|
|
- set["package"] = pkgs
|
|
|
|
|
|
+ if len(pkgs) > 0 {
|
|
|
|
+ set["package"] = pkgs
|
|
|
|
+ }
|
|
set[preKey+"package"] = status
|
|
set[preKey+"package"] = status
|
|
|
|
+ if len(content) > 0 && delpkgson == len(content) { //只有删除
|
|
|
|
+ unset["package"] = ""
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// qu.Debug("set---", set)
|
|
// qu.Debug("set---", set)
|
|
- // qu.Debug("unset---", unset)
|
|
|
|
|
|
+ // qu.Debug("errset---", errset)
|
|
}
|
|
}
|
|
|
|
|
|
//标注中标候选人信息
|
|
//标注中标候选人信息
|
|
@@ -1366,9 +1434,8 @@ func BzZBHXRXX(content []interface{}, set, unset, errset map[string]interface{},
|
|
if status == -1 {
|
|
if status == -1 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- set["ck_wodrisext"] = isext //中标候选人是否抽取标记
|
|
|
|
|
|
+ //set["ck_wodrisext"] = isext //中标候选人是否抽取标记
|
|
winnerorder := []interface{}{}
|
|
winnerorder := []interface{}{}
|
|
- errList := []interface{}{}
|
|
|
|
delwodrson := 0
|
|
delwodrson := 0
|
|
for _, con := range content {
|
|
for _, con := range content {
|
|
info, _ := con.(map[string]interface{})
|
|
info, _ := con.(map[string]interface{})
|
|
@@ -1381,44 +1448,47 @@ func BzZBHXRXX(content []interface{}, set, unset, errset map[string]interface{},
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
"ck_isnew": isNew,
|
|
"ck_isnew": isNew,
|
|
}
|
|
}
|
|
- errResult := map[string]interface{}{}
|
|
|
|
for _, tmp := range uInputs {
|
|
for _, tmp := range uInputs {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
input := tmpMap["input"] //值
|
|
input := tmpMap["input"] //值
|
|
- status := qu.IntAll(tmpMap["status"])
|
|
|
|
isNull := false
|
|
isNull := false
|
|
- if key == "price" {
|
|
|
|
- if input != "" { //有值
|
|
|
|
- isNull = false
|
|
|
|
- input = qu.Float64All(input)
|
|
|
|
- } else {
|
|
|
|
- isNull = true
|
|
|
|
- }
|
|
|
|
|
|
+ if input == "" { //判断前台页面是否填值,无值不进行字段存储
|
|
|
|
+ isNull = true
|
|
|
|
+ } else if key == "price" {
|
|
|
|
+ input = qu.Float64All(input)
|
|
}
|
|
}
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
if !isNull { //避免数字类型的字段在没有填写值的情况默认给0
|
|
result[key] = input
|
|
result[key] = input
|
|
}
|
|
}
|
|
- result[preKey+key] = status
|
|
|
|
- if !isNew && (status == 2 || status == 3 || status == 4) {
|
|
|
|
- errResult[key] = status //记录哪个字段错误
|
|
|
|
- }
|
|
|
|
|
|
+ result["ck_winnerorder"] = wodrSonStatus
|
|
|
|
+ // result[preKey+key] = status
|
|
|
|
+ // if !isNew && (status == 2 || status == 3 || status == 4) {
|
|
|
|
+ // errResult[key] = status //记录哪个字段错误
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if len(result) > 0 && wodrSonStatus != 4 {
|
|
if len(result) > 0 && wodrSonStatus != 4 {
|
|
winnerorder = append(winnerorder, result)
|
|
winnerorder = append(winnerorder, result)
|
|
}
|
|
}
|
|
- errList = append(errList, errResult)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- errset["winnerorder"] = errList
|
|
|
|
|
|
+ if status != 1 { //如果winnerorder状态不是1,errdata则记录原winnerorder字段
|
|
|
|
+ errset["winnerorder"] = true
|
|
|
|
+ }
|
|
|
|
+ qu.Debug("winnerorder", len(winnerorder))
|
|
if len(winnerorder)+delwodrson == len(content) {
|
|
if len(winnerorder)+delwodrson == len(content) {
|
|
- set["winnerorder"] = winnerorder
|
|
|
|
|
|
+ if len(winnerorder) > 0 {
|
|
|
|
+ set["winnerorder"] = winnerorder
|
|
|
|
+ }
|
|
set[preKey+"winnerorder"] = status
|
|
set[preKey+"winnerorder"] = status
|
|
|
|
+ if len(content) > 0 && delwodrson == len(content) { //只有删除
|
|
|
|
+ unset["winnerorder"] = ""
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- // qu.Debug("set---", set)
|
|
|
|
- // qu.Debug("unset---", unset)
|
|
|
|
- // qu.Debug("errset---", errset)
|
|
|
|
|
|
+ qu.Debug("set---", set)
|
|
|
|
+ qu.Debug("unset---", unset)
|
|
|
|
+ qu.Debug("errset---", errset)
|
|
}
|
|
}
|
|
|
|
|
|
//标注其余信息
|
|
//标注其余信息
|
|
@@ -1429,17 +1499,23 @@ func BzQYXX(content []interface{}, set, unset, errset map[string]interface{}) {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
if tmpMap, ok := tmp.(map[string]interface{}); ok {
|
|
if status := qu.IntAll(tmpMap["status"]); status != -1 {
|
|
if status := qu.IntAll(tmpMap["status"]); status != -1 {
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
key := qu.ObjToString(tmpMap["key"]) //字段
|
|
- if status == 2 || status == 3 { //新增、修改
|
|
|
|
|
|
+ qu.Debug(key, "-----", status)
|
|
|
|
+ if status == 2 || status == 3 { //新增、修改
|
|
input := tmpMap["input"] //值
|
|
input := tmpMap["input"] //值
|
|
if key == "isppp" || key == "contract_guarantee" || key == "bid_guarantee" {
|
|
if key == "isppp" || key == "contract_guarantee" || key == "bid_guarantee" {
|
|
input = tmpMap["select"]
|
|
input = tmpMap["select"]
|
|
- } else if key == "signaturedate" { //
|
|
|
|
- inputTmp, _ := time.ParseInLocation(qu.Date_Full_Layout, input.(string), time.Local)
|
|
|
|
- input = inputTmp.Unix()
|
|
|
|
- } else if key == "bid_bond" || key == "contract_bond" || key == "supervisorrate" || key == "agencyrate" || key == "docamount" || key == "agencyfee" {
|
|
|
|
- input = qu.Float64All(input)
|
|
|
|
}
|
|
}
|
|
- set[key] = input
|
|
|
|
|
|
+ if input == "" {
|
|
|
|
+ unset[key] = ""
|
|
|
|
+ } else {
|
|
|
|
+ if key == "signaturedate" { //
|
|
|
|
+ inputTmp, _ := time.ParseInLocation(qu.Date_Full_Layout, input.(string), time.Local)
|
|
|
|
+ input = inputTmp.Unix()
|
|
|
|
+ } else if key == "bid_bond" || key == "contract_bond" || key == "supervisorrate" || key == "agencyrate" || key == "docamount" || key == "agencyfee" {
|
|
|
|
+ input = qu.Float64All(input)
|
|
|
|
+ }
|
|
|
|
+ set[key] = input
|
|
|
|
+ }
|
|
errset[key] = status
|
|
errset[key] = status
|
|
} else if status == 4 { //删除
|
|
} else if status == 4 { //删除
|
|
unset[key] = ""
|
|
unset[key] = ""
|