Commit b47b2d33 by mushishixian

修改配置名称

parent 525c9513
[supplier_all] [SUPPLIER_ALL]
1 = future 1 = future
2 = powerandsignal 2 = powerandsignal
3 = rochester 3 = rochester
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 = rs 21 = rs
1676 = buerklin 1676 = buerklin
[search_supplier_merge] [SEARCH_SUPPLIER_MERGE]
17 = zhuanmai 17 = zhuanmai
1 = future 1 = future
3 = rochester 3 = rochester
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
20 = powell 20 = powell
21 = rs 21 = rs
#相似物料供应商 #相似物料供应商
[alike_supplier] [ALIKE_SUPPLIER]
1 = ti 1 = ti
[common] [common]
......
...@@ -27,8 +27,8 @@ func GetDataIndex(c *gin.Context) { ...@@ -27,8 +27,8 @@ func GetDataIndex(c *gin.Context) {
r.Stock = r.KNums r.Stock = r.KNums
} }
//获取所有合并供应商列表 //获取所有合并供应商列表
supplierList := config.GetSectionValues("search_supplier_merge") supplierList := config.GetSectionValues("SEARCH_SUPPLIER_MERGE")
supplierName := config.Get("supplier_all." + r.SupplierId).String() supplierName := config.Get("SUPPLIER_ALL." + r.SupplierId).String()
if supplierName == "" && r.IsSort != 2 { if supplierName == "" && r.IsSort != 2 {
c.JSON(200, common.ErrorResponse(1, "供应商id有误")) c.JSON(200, common.ErrorResponse(1, "供应商id有误"))
return return
...@@ -82,7 +82,7 @@ func getDataQueryStr(r requests.GetDataIndexRequest, supplierList []string) stri ...@@ -82,7 +82,7 @@ func getDataQueryStr(r requests.GetDataIndexRequest, supplierList []string) stri
//类似物料搜索的组装查询条件 //类似物料搜索的组装查询条件
alikeQuery, _ := getDataService.GetQuery(r.Keyword, "alike", "", r.GoodsNameEq, r.Stock) alikeQuery, _ := getDataService.GetQuery(r.Keyword, "alike", "", r.GoodsNameEq, r.Stock)
//类似物料供应商列表 //类似物料供应商列表
alikeSuppliers := config.GetSectionValues("alike_supplier") alikeSuppliers := config.GetSectionValues("ALIKE_SUPPLIER")
//构建msearch搜索json //构建msearch搜索json
var queryStr string var queryStr string
for _, supplierName := range supplierList { for _, supplierName := range supplierList {
......
...@@ -41,7 +41,7 @@ func QuoteIndex(c *gin.Context) { ...@@ -41,7 +41,7 @@ func QuoteIndex(c *gin.Context) {
return return
} }
//获取供应商名称 //获取供应商名称
supplierNameMap := config.Cfg.Section("supplier_all").KeysHash() supplierNameMap := config.Cfg.Section("SUPPLIER_ALL").KeysHash()
supplierName, exist := supplierNameMap[r.SupplierId] supplierName, exist := supplierNameMap[r.SupplierId]
if !exist { if !exist {
c.JSON(200, common.ErrorResponse(1, "供应商有误")) c.JSON(200, common.ErrorResponse(1, "供应商有误"))
......
...@@ -28,7 +28,7 @@ func CheckQuoteRequest(r QuoteIndexRequest) (errCode int, errMsg string) { ...@@ -28,7 +28,7 @@ func CheckQuoteRequest(r QuoteIndexRequest) (errCode int, errMsg string) {
return 1, "缺少参数" return 1, "缺少参数"
} }
//判断供应商 //判断供应商
if config.Get("supplier_all."+r.SupplierId).String() == "" { if config.Get("SUPPLIER_ALL."+r.SupplierId).String() == "" {
return 1, "供应商id有误" return 1, "供应商id有误"
} }
return return
......
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
) )
func GetSupplierIndex(supplierId string) (supplierIndex string) { func GetSupplierIndex(supplierId string) (supplierIndex string) {
supplierIndexMap := config.Cfg.Section("supplier_all").KeysHash() supplierIndexMap := config.Cfg.Section("SUPPLIER_ALL").KeysHash()
if index, exist := supplierIndexMap[supplierId]; exist { if index, exist := supplierIndexMap[supplierId]; exist {
return index return index
} }
...@@ -214,7 +214,7 @@ func GetGoodsBySupplierIdQuery(r requests.GetGoodsBySupplierRequest) (string, er ...@@ -214,7 +214,7 @@ func GetGoodsBySupplierIdQuery(r requests.GetGoodsBySupplierRequest) (string, er
//判断是否存在类似物料搜索 //判断是否存在类似物料搜索
supplierIndexName := GetSupplierIndex(r.SupplierId) supplierIndexName := GetSupplierIndex(r.SupplierId)
//获取相似物料供应商列表 //获取相似物料供应商列表
alikeSuppliers := config.Cfg.Section("alike_supplier").KeyStrings() alikeSuppliers := config.Cfg.Section("ALIKE_SUPPLIER").KeyStrings()
if php2go.InArray(supplierIndexName, alikeSuppliers) && keyword != "" { if php2go.InArray(supplierIndexName, alikeSuppliers) && keyword != "" {
query.Should(elastic.NewTermQuery("goods_name_alike", keyword)) query.Should(elastic.NewTermQuery("goods_name_alike", keyword))
} }
......
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