|
@@ -448,9 +448,15 @@ func (this *SubVipPortrait) BuyerPortrait() {
|
|
userId := qutil.ObjToString(this.GetSession("userId"))
|
|
userId := qutil.ObjToString(this.GetSession("userId"))
|
|
rData, errMsg := func() (interface{}, error) {
|
|
rData, errMsg := func() (interface{}, error) {
|
|
buyerName := this.GetString("buyer")
|
|
buyerName := this.GetString("buyer")
|
|
|
|
+ //id转中文
|
|
|
|
+ if len(buyerName) > 0 && len([]rune(buyerName)) == len(buyerName) {
|
|
|
|
+ //获取中文名字
|
|
|
|
+ buyerName = getBuyerNameById(util.DecodeId(buyerName))
|
|
|
|
+ }
|
|
if buyerName == "" {
|
|
if buyerName == "" {
|
|
return nil, fmt.Errorf("参数异常")
|
|
return nil, fmt.Errorf("参数异常")
|
|
}
|
|
}
|
|
|
|
+
|
|
cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
|
|
cepm, power, err, isFree := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerPortrait", buyerName, false, this.Session())
|
|
cepm.Session = this.Session()
|
|
cepm.Session = this.Session()
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -507,7 +513,7 @@ func getEntListMsg(ids []string) (dMap map[string]map[string]interface{}) {
|
|
// getBuyerListMsg 获取采购单位基本信息
|
|
// getBuyerListMsg 获取采购单位基本信息
|
|
func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{}) {
|
|
func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{}) {
|
|
dMap = make(map[string]map[string]interface{})
|
|
dMap = make(map[string]map[string]interface{})
|
|
- rData := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer_name":["%s"]}}]}},"size":%d,"_source":["buyer_name","city","province","buyerclass"]}`, strings.Join(buyerNames, `","`), len(buyerNames)))
|
|
|
|
|
|
+ rData := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"_id":"%s"}}]}},"size":1,"_source":["name"]}`, strings.Join(buyerNames, `","`)))
|
|
if rData == nil || len(*rData) == 0 {
|
|
if rData == nil || len(*rData) == 0 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -529,3 +535,12 @@ func getBuyerListMsg(buyerNames []string) (dMap map[string]map[string]interface{
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func getBuyerNameById(buyerId string) (buyerName string) {
|
|
|
|
+ r := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"_id":["%s"]}}]}},"size":1,"_source":["name"]}`, buyerId))
|
|
|
|
+ if r == nil || len(*r) == 0 {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ buyerName, _ = (*r)[0]["name"].(string)
|
|
|
|
+ return
|
|
|
|
+}
|