|
@@ -26,11 +26,8 @@ type DataIdentify struct {
|
|
|
|
|
|
func (d *DataIdentify) Execute(_id *string, reply *map[string]string) error {
|
|
func (d *DataIdentify) Execute(_id *string, reply *map[string]string) error {
|
|
log.Println("rpc接收到要识别的_id", _id)
|
|
log.Println("rpc接收到要识别的_id", _id)
|
|
- _, a, b, _ := Start(*_id)
|
|
|
|
|
|
+ _, a, b := Start(*_id)
|
|
*reply = map[string]string{}
|
|
*reply = map[string]string{}
|
|
- if !allQuoteMode[a] {
|
|
|
|
- a = "其他"
|
|
|
|
- }
|
|
|
|
if a == "费率模式" {
|
|
if a == "费率模式" {
|
|
a = "费率"
|
|
a = "费率"
|
|
} else if a == "单价模式" {
|
|
} else if a == "单价模式" {
|
|
@@ -39,6 +36,8 @@ func (d *DataIdentify) Execute(_id *string, reply *map[string]string) error {
|
|
a = "折扣率"
|
|
a = "折扣率"
|
|
} else if a == "整体报价模式" {
|
|
} else if a == "整体报价模式" {
|
|
a = "正常报价"
|
|
a = "正常报价"
|
|
|
|
+ } else {
|
|
|
|
+ a = "其他"
|
|
}
|
|
}
|
|
(*reply)["报价模式"] = a
|
|
(*reply)["报价模式"] = a
|
|
if b == 1 {
|
|
if b == 1 {
|
|
@@ -50,7 +49,7 @@ func (d *DataIdentify) Execute(_id *string, reply *map[string]string) error {
|
|
}
|
|
}
|
|
|
|
|
|
type Service interface {
|
|
type Service interface {
|
|
- Execute(b *BidInfo) (bool, string, int, map[string]interface{})
|
|
|
|
|
|
+ Execute(b *BidInfo) (bool, string, int)
|
|
}
|
|
}
|
|
type BidInfo struct {
|
|
type BidInfo struct {
|
|
Id, Detail, Subtype string
|
|
Id, Detail, Subtype string
|
|
@@ -59,19 +58,19 @@ type BidInfo struct {
|
|
Bidamount float64
|
|
Bidamount float64
|
|
}
|
|
}
|
|
|
|
|
|
-func Start(_id string) (bool, string, int, map[string]interface{}) {
|
|
|
|
|
|
+func Start(_id string) (bool, string, int) {
|
|
data, ok := Mgo_Main.FindById(g.Config().MustGet(gctx.New(), "mongodb.main.collection").String(), _id, SelectField)
|
|
data, ok := Mgo_Main.FindById(g.Config().MustGet(gctx.New(), "mongodb.main.collection").String(), _id, SelectField)
|
|
if !ok || data == nil || len(*data) == 0 {
|
|
if !ok || data == nil || len(*data) == 0 {
|
|
log.Println(_id, "没有找到标讯")
|
|
log.Println(_id, "没有找到标讯")
|
|
- return false, "", 0, nil
|
|
|
|
|
|
+ return false, "", 0
|
|
}
|
|
}
|
|
return Pretreatment(_id, *data)
|
|
return Pretreatment(_id, *data)
|
|
}
|
|
}
|
|
|
|
|
|
-func Pretreatment(_id string, m map[string]interface{}) (bool, string, int, map[string]interface{}) {
|
|
|
|
|
|
+func Pretreatment(_id string, m map[string]interface{}) (bool, string, int) {
|
|
if m == nil || len(m) == 0 {
|
|
if m == nil || len(m) == 0 {
|
|
log.Println(_id, "没有找到标讯")
|
|
log.Println(_id, "没有找到标讯")
|
|
- return false, "", 0, nil
|
|
|
|
|
|
+ return false, "", 0
|
|
}
|
|
}
|
|
detail, _ := m["detail"].(string)
|
|
detail, _ := m["detail"].(string)
|
|
subtype, _ := m["subtype"].(string)
|
|
subtype, _ := m["subtype"].(string)
|