|
@@ -3,6 +3,7 @@ package marketAnalysis
|
|
|
import (
|
|
|
. "app.yhyue.com/moapp/jybase/api"
|
|
|
qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
+ elastic "app.yhyue.com/moapp/jybase/es"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
@@ -68,11 +69,15 @@ func (this *AnalysisReportPdf) GetPdfDetail() {
|
|
|
"ent": entId,
|
|
|
}, nil, nil
|
|
|
}
|
|
|
- if buyerName := this.GetString("buyerName"); buyerName != "" {
|
|
|
+ if buyerId := this.GetString("buyerId"); buyerId != "" {
|
|
|
//根据采购单位id查询采购单位名称
|
|
|
+ list := elastic.Get("buyer", "buyer", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"id":"%s"}}]}},"size":1,"_source":["name"]}`, buyerId))
|
|
|
+ if list == nil || len(*list) == 0 {
|
|
|
+ return nil, nil, fmt.Errorf("未知采购单位")
|
|
|
+ }
|
|
|
return map[string]interface{}{
|
|
|
"type": 2,
|
|
|
- "ent": buyerName,
|
|
|
+ "ent": gconv.String((*list)[0]["name"]),
|
|
|
}, nil, nil
|
|
|
}
|
|
|
return nil, nil, fmt.Errorf("请求参数异常")
|