Commit 18fabaf1 by mushishixian

fix

parent 204e81fb
Showing with 11 additions and 12 deletions
package service package service
import ( import (
"fmt"
"github.com/imroc/req" "github.com/imroc/req"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"github.com/uniplaces/carbon" "github.com/uniplaces/carbon"
"gopkg.in/olivere/elastic.v5" "gopkg.in/olivere/elastic.v5"
"regexp" "regexp"
"search_server/pkg/config" "search_server/pkg/config"
"search_server/pkg/es"
"search_server/protopb/bom" "search_server/protopb/bom"
"search_server/requests" "search_server/requests"
"strings" "strings"
...@@ -73,22 +71,23 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []*bom.GoodsModel, err error) { ...@@ -73,22 +71,23 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []*bom.GoodsModel, err error) {
} }
//根据供应商获取商品信息 //根据供应商获取商品信息
func GetGoodsInfoBySupplier(req requests.QuoteIndexRequest) error{ func GetGoodsInfoBySupplier(req requests.QuoteIndexRequest) error {
supplierIndex := config.Get("es.search_supplier").String() //supplierIndex := config.Get("es.search_supplier").String()
//获取查询条件 ////获取查询条件
queryString := getSupplierQuery(req) //queryString := getSupplierQuery(req)
res, err := es.CurlES(supplierIndex, queryString) //res, err := es.CurlES(supplierIndex, queryString)
if err != nil { //if err != nil {
return err // return err
} //}
fmt.Println(supplierIndex) //fmt.Println(supplierIndex)
return nil
} }
func getSupplierIndex(supplierId string) string { func getSupplierIndex(supplierId string) string {
return "temp" return "temp"
} }
func getSupplierQuery(req requests.QuoteIndexRequest) string { func getSupplierQuery(req requests.QuoteIndexRequest) (string, error) {
req.SupplierId = strings.TrimSpace(req.SupplierId) req.SupplierId = strings.TrimSpace(req.SupplierId)
source := elastic.NewSearchSource() source := elastic.NewSearchSource()
query := elastic.NewBoolQuery() query := elastic.NewBoolQuery()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment