WH01243 2 years ago
parent
commit
264abd6606

+ 2 - 3
api/medical/etc/medical-api.yaml

@@ -1,6 +1,6 @@
 Name: medical-api
 Name: medical-api
 Host: 0.0.0.0
 Host: 0.0.0.0
-Port: 8888
+Port: 8881
 WebRpcPort: 8016
 WebRpcPort: 8016
 Timeout: 10000
 Timeout: 10000
 Medical:
 Medical:
@@ -12,5 +12,4 @@ Medical:
 Gateway:
 Gateway:
   ServerCode: medical
   ServerCode: medical
   Etcd:
   Etcd:
-    - 127.0.0.1:2379
-Timeout:  5000
+    - 127.0.0.1:2379

+ 6 - 2
api/medical/internal/handler/auth/userauthinfohandler.go

@@ -1,18 +1,22 @@
 package auth
 package auth
 
 
 import (
 import (
-	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
 	"net/http"
 	"net/http"
 
 
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/logic/auth"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/logic/auth"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
+	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
 	"github.com/zeromicro/go-zero/rest/httpx"
 	"github.com/zeromicro/go-zero/rest/httpx"
 )
 )
 
 
 func UserAuthInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 func UserAuthInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
 	return func(w http.ResponseWriter, r *http.Request) {
-		l := auth.NewUserAuthInfoLogic(r.Context(), svcCtx)
 		var req types.CommonReq
 		var req types.CommonReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+		l := auth.NewUserAuthInfoLogic(r.Context(), svcCtx)
 		resp, err := l.UserAuthInfo(&req)
 		resp, err := l.UserAuthInfo(&req)
 		if err != nil {
 		if err != nil {
 			httpx.Error(w, err)
 			httpx.Error(w, err)

+ 2 - 2
api/medical/internal/logic/auth/userauthinfologic.go

@@ -3,6 +3,7 @@ package auth
 import (
 import (
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
 	"context"
 	"context"
+	"log"
 
 
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
@@ -26,7 +27,6 @@ func NewUserAuthInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *User
 
 
 func (l *UserAuthInfoLogic) UserAuthInfo(req *types.CommonReq) (*types.CommonRes, error) {
 func (l *UserAuthInfoLogic) UserAuthInfo(req *types.CommonReq) (*types.CommonRes, error) {
 	// todo: add your logic here and delete this line
 	// todo: add your logic here and delete this line
-
 	resp, err := l.svcCtx.Medical.UserAuthInfo(l.ctx, &medical.CommonReq{
 	resp, err := l.svcCtx.Medical.UserAuthInfo(l.ctx, &medical.CommonReq{
 		UserId: req.NewUserId,
 		UserId: req.NewUserId,
 		Appid:  req.AppId,
 		Appid:  req.AppId,
@@ -34,10 +34,10 @@ func (l *UserAuthInfoLogic) UserAuthInfo(req *types.CommonReq) (*types.CommonRes
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}
+	log.Println(resp.Data)
 	return &types.CommonRes{
 	return &types.CommonRes{
 		Error_msg:  resp.ErrorMsg,
 		Error_msg:  resp.ErrorMsg,
 		Error_code: int(resp.ErrorCode),
 		Error_code: int(resp.ErrorCode),
 		Data:       resp.Data,
 		Data:       resp.Data,
-		State:      resp.Status,
 	}, nil
 	}, nil
 }
 }

+ 0 - 1
api/medical/internal/logic/auth/userauthinfosavelogic.go

@@ -35,7 +35,6 @@ func (l *UserAuthInfoSaveLogic) UserAuthInfoSave(req *types.UserInfoReq) (*types
 		Position:      req.Position,
 		Position:      req.Position,
 		Department:    req.Department,
 		Department:    req.Department,
 		EntName:       req.EntName,
 		EntName:       req.EntName,
-		EntCode:       req.EntCode,
 		OperationType: req.OperationType,
 		OperationType: req.OperationType,
 	})
 	})
 	if err != nil {
 	if err != nil {

+ 10 - 3
api/medical/internal/logic/distributor/searchdistributorlogic.go

@@ -27,14 +27,21 @@ func NewSearchDistributorLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 //搜索经销商请求
 //搜索经销商请求
 func (l *SearchDistributorLogic) SearchDistributor(req *types.SearchDistributorReq) (*types.CommonRes, error) {
 func (l *SearchDistributorLogic) SearchDistributor(req *types.SearchDistributorReq) (*types.CommonRes, error) {
 	// todo: add your logic here and delete this line
 	// todo: add your logic here and delete this line
+	businessScopeList := []*medical.Business_Scope{}
+	for _, scope := range req.BusinessScope {
+		businessScopeList = append(businessScopeList, &medical.Business_Scope{
+			Key:       scope.Key,
+			Appendkey: scope.Appendkey,
+			Notkey:    scope.Notkey,
+		})
+	}
 	resp, _ := l.svcCtx.Medical.Distributor(l.ctx, &medical.SearchDistributorReq{
 	resp, _ := l.svcCtx.Medical.Distributor(l.ctx, &medical.SearchDistributorReq{
 		CompanyName:   req.CompanyName,
 		CompanyName:   req.CompanyName,
 		AreaCode:      req.AreaCode,
 		AreaCode:      req.AreaCode,
-		BusinessScope: req.BusinessScope,
+		BusinessScope: businessScopeList,
 		Brand:         req.Brand,
 		Brand:         req.Brand,
 		ProductModel:  req.ProductModel,
 		ProductModel:  req.ProductModel,
-		CountOrder:    int64(req.CountOrder),
-		MoneyOrder:    int64(req.MoneyOrder),
+		Sort:          int64(req.Sort),
 	})
 	})
 	return &types.CommonRes{
 	return &types.CommonRes{
 		Error_msg:  resp.ErrorMsg,
 		Error_msg:  resp.ErrorMsg,

+ 10 - 3
api/medical/internal/logic/institution/searchinstitutionlogic.go

@@ -26,15 +26,22 @@ func NewSearchInstitutionLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 
 
 //医疗机构搜索
 //医疗机构搜索
 func (l *SearchInstitutionLogic) SearchInstitution(req *types.SearchInstitutionReq) (*types.CommonRes, error) {
 func (l *SearchInstitutionLogic) SearchInstitution(req *types.SearchInstitutionReq) (*types.CommonRes, error) {
+	businessScopeList := []*medical.Business_Scope{}
+	for _, scope := range req.SdequipmentCode {
+		businessScopeList = append(businessScopeList, &medical.Business_Scope{
+			Key:       scope.Key,
+			Appendkey: scope.Appendkey,
+			Notkey:    scope.Notkey,
+		})
+	}
 	resp, _ := l.svcCtx.Medical.Institution(l.ctx, &medical.SearchInstitutionReq{
 	resp, _ := l.svcCtx.Medical.Institution(l.ctx, &medical.SearchInstitutionReq{
 		CompanyName:      req.CompanyName,
 		CompanyName:      req.CompanyName,
 		AreaCode:         req.AreaCode,
 		AreaCode:         req.AreaCode,
 		LevelCode:        req.LevelCode,
 		LevelCode:        req.LevelCode,
 		MiTypeCode:       req.MiTypeCode,
 		MiTypeCode:       req.MiTypeCode,
 		BusinessTypeCode: int64(req.BusinessTypeCode),
 		BusinessTypeCode: int64(req.BusinessTypeCode),
-		SdequipmentCode:  req.SdequipmentCode,
-		CountOrder:       int64(req.CountOrder),
-		MoneyOrder:       int64(req.MoneyOrder),
+		SdequipmentCode:  businessScopeList,
+		Sort:             int64(req.Sort),
 	})
 	})
 	return &types.CommonRes{
 	return &types.CommonRes{
 		Error_msg:  resp.ErrorMsg,
 		Error_msg:  resp.ErrorMsg,

+ 21 - 19
api/medical/internal/types/types.go

@@ -5,28 +5,31 @@ type CommonRes struct {
 	Error_code int         `json:"error_code"`
 	Error_code int         `json:"error_code"`
 	Error_msg  string      `json:"error_msg"`
 	Error_msg  string      `json:"error_msg"`
 	Data       interface{} `json:"data"`
 	Data       interface{} `json:"data"`
-	State      bool        `json:"state"`
 }
 }
 
 
 type SearchInstitutionReq struct {
 type SearchInstitutionReq struct {
-	CompanyName      string `json:"company_name,optional"`       // 要搜索的医疗机构
-	AreaCode         string `json:"area_code,optional"`          // 区域代码
-	LevelCode        string `json:"level_code,optional"`         // 医院等级代码
-	MiTypeCode       string `json:"mi_type_code,optional"`       // 机构类型
-	BusinessTypeCode int    `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
-	SdequipmentCode  string `json:"sdequipment_code,optional"`   // 业务范围
-	CountOrder       int    `json:"count_order,optional"`        // 项目数量排序 0-不排序 1-数量倒序
-	MoneyOrder       int    `json:"money_order,optional"`        // 金额数量排序:0- 不参与排序  1-按金额倒序
+	CompanyName      string           `json:"company_name,optional"`       // 要搜索的医疗机构
+	AreaCode         string           `json:"area_code,optional"`          // 区域代码
+	LevelCode        string           `json:"level_code,optional"`         // 医院等级代码
+	MiTypeCode       string           `json:"mi_type_code,optional"`       // 机构类型
+	BusinessTypeCode int              `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
+	SdequipmentCode  []Business_Scope `json:"sdequipment_code,optional"`   // 业务范围
+	Sort             int              `json:"sort,optional"`               // 0是数量   1是金额
 }
 }
 
 
 type SearchDistributorReq struct {
 type SearchDistributorReq struct {
-	CompanyName   string `json:"company_name,optional"`   // 要搜索的经销商
-	AreaCode      string `json:"area_code,optional"`      // 区域代码
-	BusinessScope string `json:"business_scope,optional"` // 业务范围
-	Brand         string `json:"brand,optional,optional"` // 品牌
-	ProductModel  string `json:"product_model,optional"`  // 产品型号
-	CountOrder    int    `json:"count_order,optional"`    // 项目数量排序 0-不排序 1-数量倒序
-	MoneyOrder    int    `json:"money_order,optional"`    // 金额数量排序:0- 不参与排序  1-按金额倒序
+	CompanyName   string           `json:"company_name,optional"`   // 要搜索的经销商
+	AreaCode      string           `json:"area_code,optional"`      // 区域代码
+	BusinessScope []Business_Scope `json:"business_scope,optional"` // 业务范围
+	Brand         string           `json:"brand,optional,optional"` // 品牌
+	ProductModel  string           `json:"product_model,optional"`  // 产品型号
+	Sort          int              `json:"sort,optional"`           // 0是数量   1是金额
+}
+
+type Business_Scope struct {
+	Key       []string `json:"key,optional"`       //关键词
+	Appendkey []string `json:"appendkey,optional"` //附加词
+	Notkey    []string `json:"notkey,optional"`    //排除词
 }
 }
 
 
 type PortraitReq struct {
 type PortraitReq struct {
@@ -86,7 +89,6 @@ type UserInfoReq struct {
 	Phone         string `json:"phone"`          // 手机号
 	Phone         string `json:"phone"`          // 手机号
 	Position      string `json:"position"`       // 个人职务
 	Position      string `json:"position"`       // 个人职务
 	Department    string `json:"department"`     // 所在部门
 	Department    string `json:"department"`     // 所在部门
-	EntCode       string `json:"ent_code"`       // 企业标识
 	EntName       string `json:"ent_name"`       // 企业名称
 	EntName       string `json:"ent_name"`       // 企业名称
 	Mail          string `json:"mail"`           // 邮箱
 	Mail          string `json:"mail"`           // 邮箱
 	OperationType string `json:"operation_type"` // add新增 update 修改
 	OperationType string `json:"operation_type"` // add新增 update 修改
@@ -95,6 +97,6 @@ type UserInfoReq struct {
 }
 }
 
 
 type CommonReq struct {
 type CommonReq struct {
-	NewUserId int64  `json:"newUserId"`
-	AppId     string `json:"appId"`
+	NewUserId int64  `header:"newUserId"`
+	AppId     string `header:"appId"`
 }
 }

+ 23 - 21
api/medical/medical.api

@@ -3,29 +3,31 @@ type CommonRes {
 	Error_code int         `json:"error_code"`
 	Error_code int         `json:"error_code"`
 	Error_msg  string      `json:"error_msg"`
 	Error_msg  string      `json:"error_msg"`
 	Data       interface{} `json:"data"`
 	Data       interface{} `json:"data"`
-	State      bool        `json:"state"`
 }
 }
 
 
 // 搜索医疗机构
 // 搜索医疗机构
 type SearchInstitutionReq {
 type SearchInstitutionReq {
-	CompanyName      string `json:"company_name,optional"`       // 要搜索的医疗机构
-	AreaCode         string `json:"area_code,optional"`          // 区域代码
-	LevelCode        string `json:"level_code,optional"`         // 医院等级代码
-	MiTypeCode       string `json:"mi_type_code,optional"`       // 机构类型
-	BusinessTypeCode int    `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
-	SdequipmentCode  string `json:"sdequipment_code,optional"`   // 业务范围
-	CountOrder       int    `json:"count_order,optional"`        // 项目数量排序 0-不排序 1-数量倒序
-	MoneyOrder       int    `json:"money_order,optional"`        // 金额数量排序:0- 不参与排序  1-按金额倒序
+	CompanyName      string           `json:"company_name,optional"`       // 要搜索的医疗机构
+	AreaCode         string           `json:"area_code,optional"`          // 区域代码
+	LevelCode        string           `json:"level_code,optional"`         // 医院等级代码
+	MiTypeCode       string           `json:"mi_type_code,optional"`       // 机构类型
+	BusinessTypeCode int              `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
+	SdequipmentCode  []Business_Scope `json:"sdequipment_code,optional"`   // 业务范围
+	Sort             int              `json:"sort,optional"`               // 0是数量   1是金额
 }
 }
 // 搜索经销商请求
 // 搜索经销商请求
 type SearchDistributorReq {
 type SearchDistributorReq {
-	CompanyName   string `json:"company_name,optional"`   // 要搜索的经销商
-	AreaCode      string `json:"area_code,optional"`      // 区域代码
-	BusinessScope string `json:"business_scope,optional"` // 业务范围
-	Brand         string `json:"brand,optional,optional"` // 品牌
-	ProductModel  string `json:"product_model,optional"`  // 产品型号
-	CountOrder    int    `json:"count_order,optional"`    // 项目数量排序 0-不排序 1-数量倒序
-	MoneyOrder    int    `json:"money_order,optional"`    // 金额数量排序:0- 不参与排序  1-按金额倒序
+	CompanyName   string           `json:"company_name,optional"`   // 要搜索的经销商
+	AreaCode      string           `json:"area_code,optional"`      // 区域代码
+	BusinessScope []Business_Scope `json:"business_scope,optional"` // 业务范围
+	Brand         string           `json:"brand,optional,optional"` // 品牌
+	ProductModel  string           `json:"product_model,optional"`  // 产品型号
+	Sort          int              `json:"sort,optional"`           // 0是数量   1是金额
+}
+type Business_Scope {
+	Key       []string `json:"key,optional"`       //关键词
+	Appendkey []string `json:"appendkey,optional"` //附加词
+	Notkey    []string `json:"notkey,optional"`    //排除词
 }
 }
 
 
 // 获取机构信息请求
 // 获取机构信息请求
@@ -141,7 +143,6 @@ type UserInfoReq {
 	Phone         string `json:"phone"`          // 手机号
 	Phone         string `json:"phone"`          // 手机号
 	Position      string `json:"position"`       // 个人职务
 	Position      string `json:"position"`       // 个人职务
 	Department    string `json:"department"`     // 所在部门
 	Department    string `json:"department"`     // 所在部门
-	EntCode       string `json:"ent_code"`       // 企业标识
 	EntName       string `json:"ent_name"`       // 企业名称
 	EntName       string `json:"ent_name"`       // 企业名称
 	Mail          string `json:"mail"`           // 邮箱
 	Mail          string `json:"mail"`           // 邮箱
 	OperationType string `json:"operation_type"` // add新增 update 修改
 	OperationType string `json:"operation_type"` // add新增 update 修改
@@ -149,8 +150,8 @@ type UserInfoReq {
 	AppId         string `header:"appId"`
 	AppId         string `header:"appId"`
 }
 }
 type CommonReq {
 type CommonReq {
-	NewUserId int64  `json:"newUserId"`
-	AppId     string `json:"appId"`
+	NewUserId int64  `header:"newUserId"`
+	AppId     string `header:"appId"`
 }
 }
 // 认证
 // 认证
 @server(
 @server(
@@ -158,10 +159,11 @@ type CommonReq {
 	prefix: domain
 	prefix: domain
 )
 )
 service medical-api {
 service medical-api {
-	@handler userAuthInfoSave
+	
 	// 用户认证信息保存
 	// 用户认证信息保存
+	@handler userAuthInfoSave
 	post /userAuthInfoSave (UserInfoReq) returns (CommonRes);
 	post /userAuthInfoSave (UserInfoReq) returns (CommonRes);
-	@handler userAuthInfo
 	// 用户认证信息查询
 	// 用户认证信息查询
+	@handler userAuthInfo
 	post /userAuthInfo (CommonReq) returns (CommonRes);
 	post /userAuthInfo (CommonReq) returns (CommonRes);
 }
 }

+ 3 - 1
entity/code.go

@@ -4,7 +4,7 @@ package entity
 const (
 const (
 	CODE_MEDICAL_INSTITUTION_LEVEL = "code_level"
 	CODE_MEDICAL_INSTITUTION_LEVEL = "code_level"
 	CODE_MEDICAL_INSTITUTION_TYPE  = "code_type"
 	CODE_MEDICAL_INSTITUTION_TYPE  = "code_type"
-	DOMAIN_CAPITAL_RETENTION       = "domain_capital_retention"
+	DOMAIN_CAPITAL_RETENTION       = "capital_retention"
 	TableDomainEntClaim            = "domain_ent_claim" // 认领表
 	TableDomainEntClaim            = "domain_ent_claim" // 认领表
 	TableCompanyBasInfo            = "company_baseinfo" // 企业信息表
 	TableCompanyBasInfo            = "company_baseinfo" // 企业信息表
 )
 )
@@ -23,6 +23,8 @@ const (
 const (
 const (
 	TypeInstitution = 1 // 医疗机构
 	TypeInstitution = 1 // 医疗机构
 	TypeDistributor = 2 // 经销商
 	TypeDistributor = 2 // 经销商
+	BIDFIELD        = "0101"
+	MEDICALDOMAIN   = "medical_domain"
 )
 )
 
 
 // 认领状态
 // 认领状态

+ 46 - 1
entity/util.go

@@ -6,7 +6,9 @@ import (
 	_ "encoding"
 	_ "encoding"
 	"encoding/json"
 	"encoding/json"
 	"log"
 	"log"
+	"reflect"
 	"runtime"
 	"runtime"
+	"strconv"
 	"strings"
 	"strings"
 )
 )
 
 
@@ -44,7 +46,17 @@ func SplicingString(name, str string) string {
 	qury += `]}}`
 	qury += `]}}`
 	return qury
 	return qury
 }
 }
-
+func SplicingArr(name string, arr []string) string {
+	qury := `{"terms":{"` + name + `":[`
+	for key, value := range arr {
+		if key > 0 {
+			qury += `,`
+		}
+		qury += `"` + value + `"`
+	}
+	qury += `]}}`
+	return qury
+}
 func GetAggs(P_INDEX, P_TYPE, potComQ string) []AggressJson {
 func GetAggs(P_INDEX, P_TYPE, potComQ string) []AggressJson {
 	regList := []AggressJson{}
 	regList := []AggressJson{}
 	defer quitl.Catch()
 	defer quitl.Catch()
@@ -95,3 +107,36 @@ func GetAggs(P_INDEX, P_TYPE, potComQ string) []AggressJson {
 
 
 	return regList
 	return regList
 }
 }
+
+//金额转化   金额:0-万元以下单位为元  ,万元以上至亿元以下单位为万元 ,亿元以上单位为亿元。保留 小数点后 2 位,不进行四舍五入。
+func ConversionMoeny(i_money interface{}) string {
+	m := ""
+	if reflect.TypeOf(i_money).Name() == "float64" {
+		m = strconv.FormatFloat(quitl.Float64All(i_money), 'f', -1, 64)
+	} else {
+		m = quitl.ObjToString(i_money)
+	}
+	if m == "" {
+		return m
+	}
+	m_arr := strings.Split(m, ".")
+	m_1 := m_arr[0]
+	len_m1 := len([]rune(m_1))
+	if len_m1 >= 9 {
+		m = m_1[0:len_m1-8] + "." + m_1[len_m1-8:len_m1-6] + "亿元"
+	} else if len_m1 >= 5 {
+		m = m_1[0:len_m1-4] + "." + m_1[len_m1-4:len_m1-2] + "万元"
+	} else {
+		if len(m_arr) == 1 {
+			return m + ".00元"
+		}
+		m_2 := m_arr[1]
+		if len([]rune(m_2)) > 1 {
+			m_2 = m_2[0:2]
+		} else {
+			m_2 = m_2[0:1] + "0"
+		}
+		m = m_1 + "." + m_2 + "元"
+	}
+	return m
+}

+ 1 - 1
rpc/medical/internal/logic/distributorlogic.go

@@ -39,7 +39,7 @@ func (l *DistributorLogic) Distributor(in *medical.SearchDistributorReq) (*medic
 			CompanyName:  quitl.InterfaceToStr(value["supplier"]),
 			CompanyName:  quitl.InterfaceToStr(value["supplier"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			City:         quitl.InterfaceToStr(value["city"]),
 			City:         quitl.InterfaceToStr(value["city"]),
-			ProjectMoney: quitl.InterfaceToStr(value["project_money"]),
+			ProjectMoney: entity.ConversionMoeny(value["project_money"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
 		}
 		}
 		companyList = append(companyList, &data)
 		companyList = append(companyList, &data)

+ 1 - 1
rpc/medical/internal/logic/institutionlogic.go

@@ -38,7 +38,7 @@ func (l *InstitutionLogic) Institution(in *medical.SearchInstitutionReq) (*medic
 			CompanyName:  quitl.InterfaceToStr(value["mi_name"]),
 			CompanyName:  quitl.InterfaceToStr(value["mi_name"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			City:         quitl.InterfaceToStr(value["city"]),
 			City:         quitl.InterfaceToStr(value["city"]),
-			ProjectMoney: quitl.InterfaceToStr(value["project_money"]),
+			ProjectMoney: entity.ConversionMoeny(value["project_money"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
 		}
 		}
 		companyList = append(companyList, &data)
 		companyList = append(companyList, &data)

+ 4 - 4
rpc/medical/internal/logic/userauthinfologic.go

@@ -33,7 +33,6 @@ func (l *UserAuthInfoLogic) UserAuthInfo(in *medical.CommonReq) (*medical.UserIn
 	data := m.UserAuthInfo(in)
 	data := m.UserAuthInfo(in)
 	result := &medical.UserInfoResp{}
 	result := &medical.UserInfoResp{}
 	if data != nil {
 	if data != nil {
-		result.Status = true
 		result.Data = &medical.UserInfo{
 		result.Data = &medical.UserInfo{
 			Mail:       quitl.InterfaceToStr((*data)["mail"]),
 			Mail:       quitl.InterfaceToStr((*data)["mail"]),
 			Name:       quitl.InterfaceToStr((*data)["name"]),
 			Name:       quitl.InterfaceToStr((*data)["name"]),
@@ -41,11 +40,12 @@ func (l *UserAuthInfoLogic) UserAuthInfo(in *medical.CommonReq) (*medical.UserIn
 			EntName:    quitl.InterfaceToStr((*data)["ent_name"]),
 			EntName:    quitl.InterfaceToStr((*data)["ent_name"]),
 			Position:   quitl.InterfaceToStr((*data)["position"]),
 			Position:   quitl.InterfaceToStr((*data)["position"]),
 			Department: quitl.InterfaceToStr((*data)["department"]),
 			Department: quitl.InterfaceToStr((*data)["department"]),
-			EntCode:    quitl.InterfaceToStr((*data)["ent_code"]),
+			Status:     true,
 		}
 		}
+		result.State = true
 	} else {
 	} else {
-		result.Status = false
+		result.State = false
 	}
 	}
 	result.ErrorCode = entity.SUCCESSCODE
 	result.ErrorCode = entity.SUCCESSCODE
-	return &medical.UserInfoResp{}, nil
+	return result, nil
 }
 }

+ 20 - 18
rpc/medical/medical.proto

@@ -30,21 +30,23 @@ message SearchInstitutionReq {
   string      levelCode        =3;      // 医院等级代码
   string      levelCode        =3;      // 医院等级代码
   string      miTypeCode       =4;      // 机构类型
   string      miTypeCode       =4;      // 机构类型
   int64       businessTypeCode =5;      // 经营性质 1-公立 2-民营 3-其他
   int64       businessTypeCode =5;      // 经营性质 1-公立 2-民营 3-其他
-  string      sdequipmentCode  =6;      // 业务范围
-  int64       countOrder       =7;      // 项目数量排序 0-不排序 1-数量倒序
-  int64       moneyOrder       =8;      // 金额数量排序:0- 不参与排序  1-按金额倒序
-  string      cityCode         =9;      // 区域代码
+  repeated    Business_Scope  sdequipmentCode  =6;      // 业务范围
+  int64       sort       =7;            // 0是数量   1是金额
 }
 }
 message SearchDistributorReq {
 message SearchDistributorReq {
   string      companyName     =1;          // 要搜索的经销商
   string      companyName     =1;          // 要搜索的经销商
   string      areaCode        =2;          // 区域代码
   string      areaCode        =2;          // 区域代码
-  string      businessScope   =3;          // 业务范围
+  repeated    Business_Scope   businessScope   =3;          // 业务范围
   string      brand           =4;          // 品牌
   string      brand           =4;          // 品牌
-  string      ProductModel    =5;          // 产品型号
-  int64      countOrder       =6;          // 项目数量排序 0-不排序 1-数量倒序
-  int64      moneyOrder       =7;          // 金额数量排序:0- 不参与排序  1-按金额倒序
-  string      cityCode        =8;          // 区域代码
+  string      productModel    =5;          // 产品型号
+  int64       sort       =6;              // 0是数量   1是金额
 }
 }
+message Business_Scope{
+  repeated string      key               =1; //关键词
+  repeated string      appendkey         =2; //附加词
+  repeated string      notkey            =3; //排除词
+}
+
 message CompanyData {
 message CompanyData {
   string      company_id     =1;          // 唯一标识
   string      company_id     =1;          // 唯一标识
   string      company_name   =2;          // 机构名称
   string      company_name   =2;          // 机构名称
@@ -85,22 +87,22 @@ message FilterItemResp{
 }
 }
 //认证信息
 //认证信息
 message UserInfo {
 message UserInfo {
-  string             name          =1;          // 姓名
-  string             phone         =2;          // 手机号
-  string             position      =3;          //个人职务
-  string             department    =4;          // 所在部门
-  string             mail          =5;          // 个人邮箱
-  string             ent_code           =6;          // 企业代码
+  string             name               =1;          // 姓名
+  string             phone              =2;          // 手机号
+  string             position           =3;          //个人职务
+  string             department         =4;          // 所在部门
+  string             mail               =5;          // 个人邮箱
   string             ent_name           =7;          // 企业名称
   string             ent_name           =7;          // 企业名称
   string             operation_type     =8;          //  add新增 update 修改
   string             operation_type     =8;          //  add新增 update 修改
-  int64             user_id            =9;          //用户标识
-  string             appid=10;
+  int64              user_id            =9;          //用户标识
+  string             appid              =10;
+  bool               status             =6;
 }
 }
 message UserInfoResp{
 message UserInfoResp{
   int64           error_code  =1;          // 唯一标识
   int64           error_code  =1;          // 唯一标识
   string          error_msg   =2;        // 机构名称
   string          error_msg   =2;        // 机构名称
   UserInfo        data        =3;
   UserInfo        data        =3;
-  bool            status      =4;
+  bool state=4;
 }
 }
 //医疗机构画像入参
 //医疗机构画像入参
 message PortraitReq{
 message PortraitReq{

File diff suppressed because it is too large
+ 430 - 399
rpc/medical/medical/medical.pb.go


+ 5 - 5
service/AuthService.go

@@ -34,10 +34,10 @@ func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) {
 			"position":   in.Position,
 			"position":   in.Position,
 			"department": in.Department,
 			"department": in.Department,
 			"mail":       in.Mail,
 			"mail":       in.Mail,
-			"ent_code":   in.EntCode,
 			"ent_name":   in.EntName,
 			"ent_name":   in.EntName,
+			"source":     entity.MEDICALDOMAIN,
 		}
 		}
-		ok1 := entity.BaseMysql.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId, "appid": in.Appid}, data)
+		ok1 := entity.BaseMysql.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN}, data)
 		if ok1 {
 		if ok1 {
 			return true, ""
 			return true, ""
 		} else {
 		} else {
@@ -52,11 +52,11 @@ func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) {
 			"position":    in.Position,
 			"position":    in.Position,
 			"department":  in.Department,
 			"department":  in.Department,
 			"mail":        in.Mail,
 			"mail":        in.Mail,
-			"ent_code":    in.EntCode,
 			"ent_name":    in.EntName,
 			"ent_name":    in.EntName,
 			"user_id":     in.UserId,
 			"user_id":     in.UserId,
 			"create_time": time.Now().Local(),
 			"create_time": time.Now().Local(),
 			"appid":       in.Appid,
 			"appid":       in.Appid,
+			"source":      entity.MEDICALDOMAIN,
 		}
 		}
 		ok := entity.BaseMysql.Insert(entity.DOMAIN_CAPITAL_RETENTION, data)
 		ok := entity.BaseMysql.Insert(entity.DOMAIN_CAPITAL_RETENTION, data)
 		if ok > 0 {
 		if ok > 0 {
@@ -72,7 +72,7 @@ func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) {
 func (b AuthService) UserAuthInfo(in *medical.CommonReq) *map[string]interface{} {
 func (b AuthService) UserAuthInfo(in *medical.CommonReq) *map[string]interface{} {
 	//先判断用户是否存在
 	//先判断用户是否存在
 	user := entity.BaseMysql.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
 	user := entity.BaseMysql.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
-		"user_id": in.UserId, "appid": in.Appid,
-	}, "id", "")
+		"user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN,
+	}, "*", "")
 	return user
 	return user
 }
 }

+ 129 - 53
service/InstitutionService.go

@@ -1,6 +1,7 @@
 package service
 package service
 
 
 import (
 import (
+	quitl "app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
@@ -24,17 +25,34 @@ func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]i
 func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataList []map[string]interface{}) {
 func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataList []map[string]interface{}) {
 	//先查询医疗机构
 	//先查询医疗机构
 	//医疗机构查询拼接
 	//医疗机构查询拼接
-	query := `{"query":{"bool":{"must":[%s],"minimum_should_match": %d}}, "from": %d,"size": %d}`
+	query := `{"query":{"bool":{"must":[%s],"must_not": [%s],"should":[%s],"minimum_should_match": %d}}, "from": %d,"size": %d}`
+	shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
+	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
 	musts := []string{}
 	musts := []string{}
+	shoulds := []string{}
 	//省份处理
 	//省份处理
+	cityArr := []string{}
+	areaArr := []string{}
 	if in.AreaCode != "" {
 	if in.AreaCode != "" {
-		areaQuery := entity.SplicingString("area", in.AreaCode)
-		musts = append(musts, areaQuery)
+		areaCode := quitl.ObjToMap(in.AreaCode)
+		for k, v := range *areaCode {
+			if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 {
+				areaArr = append(areaArr, k)
+			} else {
+				cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
+			}
+		}
+	}
+
+	//省份处理
+	if len(areaArr) > 0 {
+		areaQuery := entity.SplicingArr("area", areaArr)
+		shoulds = append(shoulds, areaQuery)
 	}
 	}
 	//城市处理
 	//城市处理
-	if in.CityCode != "" {
-		cityQuery := entity.SplicingString("city", in.CityCode)
-		musts = append(musts, cityQuery)
+	if len(cityArr) > 0 {
+		cityQuery := entity.SplicingArr("city", cityArr)
+		shoulds = append(shoulds, cityQuery)
 	}
 	}
 	//医疗等级处理
 	//医疗等级处理
 	if in.LevelCode != "" {
 	if in.LevelCode != "" {
@@ -57,11 +75,42 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 		musts = append(musts, companyNameQuery)
 		musts = append(musts, companyNameQuery)
 	}
 	}
 	//业务范围处理
 	//业务范围处理
-	if in.SdequipmentCode != "" {
-		sdequipmentQuery := entity.SplicingString("sdequipment", in.SdequipmentCode)
-		musts = append(musts, sdequipmentQuery)
+	boolsNum := 0
+	businessShoulds := []string{}
+	businessMust_not := []string{}
+	if len(in.SdequipmentCode) > 0 {
+		boolsNum = 1
+		findfields := `"sdequipment"`
+		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+		for _, v := range in.SdequipmentCode {
+			//关键词
+			for _, keyV := range v.Key {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
+			}
+			//附加词
+			for _, AppendV := range v.Appendkey {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
+			}
+			//排除词
+			for _, notV := range v.Notkey {
+				businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
+			}
+		}
 	}
 	}
-	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), len(musts), 0, 500)
+	shouldNumber := 0
+	if len(shoulds) > 0 {
+		shouldNumber = 1
+	}
+	shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
+	musts = append(musts, shouldStr)
+	//添加
+	notStr := ""
+	if len(businessShoulds) > 0 {
+		if len(businessMust_not) > 0 {
+			notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
+		}
+	}
+	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), notStr, strings.Join(businessShoulds, ","), boolsNum, 0, 500)
 	//再根据医疗机构名称查找项目金额总数
 	//再根据医疗机构名称查找项目金额总数
 	companyList := elastic.Get(entity.INSTITUTION_INDEX, entity.INSTITUTION_TYPE, queryStr)
 	companyList := elastic.Get(entity.INSTITUTION_INDEX, entity.INSTITUTION_TYPE, queryStr)
 	log.Println(queryStr)
 	log.Println(queryStr)
@@ -79,25 +128,13 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 		return
 		return
 	}
 	}
 	orderField := "_count"
 	orderField := "_count"
-	orderType := "asc"
+	orderType := "desc"
 	//排序处理
 	//排序处理
-	if in.CountOrder != 0 {
-		orderField = "_count"
-		if in.CountOrder == 1 {
-			orderType = "desc"
-		} else {
-			orderType = "asc"
-		}
+	if in.Sort == 1 {
+		orderField = "count"
 	}
 	}
-	if in.MoneyOrder != 0 {
-		orderField = "_count"
-		if in.CountOrder == 1 {
-			orderType = "desc"
-		} else {
-			orderType = "asc"
-		}
-	}
-	aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}}],"minimum_should_match":2}},"aggs":{"group_field":{"terms":{"field":"buyer","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyName, orderField, orderType)
+
+	aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}},{"term":{"bid_field":"%s"}}],"minimum_should_match":0}},"aggs":{"group_field":{"terms":{"field":"buyer","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyName, entity.BIDFIELD, orderField, orderType)
 	log.Println(aggStr)
 	log.Println(aggStr)
 	countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
 	countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
 	if len(countList) > 0 && countList != nil {
 	if len(countList) > 0 && countList != nil {
@@ -118,22 +155,61 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataList []map[string]interface{}) {
 func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataList []map[string]interface{}) {
 	//先查询医疗机构
 	//先查询医疗机构
 	//医疗机构查询拼接
 	//医疗机构查询拼接
-	query := `{"query":{"bool":{"must":[%s],"minimum_should_match": %d}}, "from": %d,"size": %d}`
+	query := `{"query":{"bool":{"must":[%s],"must_not": [%s],"should":[%s],"minimum_should_match": %d}}, "from": %d,"size": %d}`
+	shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
+	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
 	musts := []string{}
 	musts := []string{}
+	shoulds := []string{}
 	//省份处理
 	//省份处理
+	cityArr := []string{}
+	areaArr := []string{}
 	if in.AreaCode != "" {
 	if in.AreaCode != "" {
-		areaQuery := entity.SplicingString("area", in.AreaCode)
-		musts = append(musts, areaQuery)
+		areaCode := quitl.ObjToMap(in.AreaCode)
+		for k, v := range *areaCode {
+			if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 {
+				areaArr = append(areaArr, k)
+			} else {
+				cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
+			}
+		}
+	}
+
+	//省份处理
+	if len(areaArr) > 0 {
+		areaQuery := entity.SplicingArr("area", areaArr)
+		shoulds = append(shoulds, areaQuery)
 	}
 	}
 	//城市处理
 	//城市处理
-	if in.CityCode != "" {
-		cityQuery := entity.SplicingString("city", in.CityCode)
-		musts = append(musts, cityQuery)
+	if len(cityArr) > 0 {
+		cityQuery := entity.SplicingArr("city", cityArr)
+		shoulds = append(shoulds, cityQuery)
 	}
 	}
 	//业务范围处理
 	//业务范围处理
-	if in.BusinessScope != "" {
+	/*	if in.BusinessScope != "" {
 		businessScopeQuery := entity.SplicingString("productlist.name", in.BusinessScope)
 		businessScopeQuery := entity.SplicingString("productlist.name", in.BusinessScope)
 		musts = append(musts, businessScopeQuery)
 		musts = append(musts, businessScopeQuery)
+	}*/
+	boolsNum := 0
+	businessShoulds := []string{}
+	businessMust_not := []string{}
+	if len(in.BusinessScope) > 0 {
+		boolsNum = 1
+		findfields := `"productlist.name"`
+		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+		for _, v := range in.BusinessScope {
+			//关键词
+			for _, keyV := range v.Key {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
+			}
+			//附加词
+			for _, AppendV := range v.Appendkey {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
+			}
+			//排除词
+			for _, notV := range v.Notkey {
+				businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
+			}
+		}
 	}
 	}
 	//品牌处理
 	//品牌处理
 	if in.Brand != "" {
 	if in.Brand != "" {
@@ -150,7 +226,20 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 		companyNameQuery := entity.SplicingString("p_supplier", in.CompanyName)
 		companyNameQuery := entity.SplicingString("p_supplier", in.CompanyName)
 		musts = append(musts, companyNameQuery)
 		musts = append(musts, companyNameQuery)
 	}
 	}
-	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), len(musts), 0, 500)
+	shouldNumber := 0
+	if len(shoulds) > 0 {
+		shouldNumber = 1
+	}
+	shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
+	musts = append(musts, shouldStr)
+	//添加
+	notStr := ""
+	if len(businessShoulds) > 0 {
+		if len(businessMust_not) > 0 {
+			notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
+		}
+	}
+	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), notStr, strings.Join(businessShoulds, ","), boolsNum, 0, 500)
 	//再根据医疗机构名称查找项目金额总数
 	//再根据医疗机构名称查找项目金额总数
 	companyList := elastic.Get(entity.SUPPLIER_PRODUCT_INDEX, entity.SUPPLIER_PRODUCT_TYPE, queryStr)
 	companyList := elastic.Get(entity.SUPPLIER_PRODUCT_INDEX, entity.SUPPLIER_PRODUCT_TYPE, queryStr)
 	log.Println(queryStr)
 	log.Println(queryStr)
@@ -167,26 +256,13 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 	} else {
 	} else {
 		return
 		return
 	}
 	}
-	orderField := "_count"
-	orderType := "asc"
 	//排序处理
 	//排序处理
-	if in.CountOrder != 0 {
-		orderField = "_count"
-		if in.CountOrder == 1 {
-			orderType = "desc"
-		} else {
-			orderType = "asc"
-		}
-	}
-	if in.MoneyOrder != 0 {
-		orderField = "_count"
-		if in.CountOrder == 1 {
-			orderType = "desc"
-		} else {
-			orderType = "asc"
-		}
+	orderField := "_count"
+	orderType := "desc"
+	if in.Sort == 1 {
+		orderField = "count"
 	}
 	}
-	aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"entidlist":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}}],"minimum_should_match":2}},"aggs":{"group_field":{"terms":{"field":"entidlist","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyIds, orderField, orderType)
+	aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"entidlist":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}},{"term":{"bid_field":"%s"}}],"minimum_should_match":0}},"aggs":{"group_field":{"terms":{"field":"entidlist","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyIds, entity.BIDFIELD, orderField, orderType)
 	log.Println(aggStr)
 	log.Println(aggStr)
 	countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
 	countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
 	if len(countList) > 0 && countList != nil {
 	if len(countList) > 0 && countList != nil {

+ 18 - 15
service/InstitutionService_test.go

@@ -76,14 +76,16 @@ func TestInstitutionService_Institution(t *testing.T) {
 			name: "医疗机构搜索",
 			name: "医疗机构搜索",
 			args: args{
 			args: args{
 				&medical.SearchInstitutionReq{
 				&medical.SearchInstitutionReq{
-					CompanyName:      "医院",
-					AreaCode:         "河南",
-					CityCode:         "郑州市",
-					LevelCode:        "0104,0201,0202",
-					MiTypeCode:       "17,03",
-					SdequipmentCode:  "装置,电动",
+					CompanyName: "医院",
+					AreaCode:    "{'河南':['郑州市','开封市'],'上海':[]}",
+					LevelCode:   "0104,0201,0202",
+					MiTypeCode:  "17,03",
+					SdequipmentCode: []*medical.Business_Scope{
+						{Key: []string{"装置", "电动"},
+							Appendkey: []string{},
+							Notkey:    []string{}},
+					},
 					BusinessTypeCode: 0,
 					BusinessTypeCode: 0,
-					CountOrder:       0,
 				}},
 				}},
 		},
 		},
 	}
 	}
@@ -111,14 +113,15 @@ func TestInstitutionService_Distributor(t *testing.T) {
 			name: "经销商查询",
 			name: "经销商查询",
 			args: args{
 			args: args{
 				&medical.SearchDistributorReq{
 				&medical.SearchDistributorReq{
-					CompanyName:   "",
-					AreaCode:      "江苏",
-					BusinessScope: "",
-					Brand:         "",
-					ProductModel:  "",
-					CountOrder:    0,
-					MoneyOrder:    0,
-					CityCode:      "扬州市",
+					CompanyName: "公司",
+					AreaCode:    "{'河南':['郑州市','开封市'],'北京':[]}",
+					BusinessScope: []*medical.Business_Scope{
+						{Key: []string{"缓冲液", "细胞保存液"},
+							Appendkey: []string{},
+							Notkey:    []string{}},
+					},
+					Brand:        "",
+					ProductModel: "",
 				}},
 				}},
 		},
 		},
 	}
 	}

+ 3 - 4
service/portrait_test.go

@@ -41,9 +41,8 @@ func init() {
 	}
 	}
 	CommonMysql.Init()
 	CommonMysql.Init()
 	MyConn = &entity.Conn{
 	MyConn = &entity.Conn{
-		Mysql:       entity.Mysql,
-		BaseMysql:   BaseMysqlConn,
-		CommonMysql: CommonMysql,
+		Mysql:     entity.Mysql,
+		BaseMysql: BaseMysqlConn,
 	}
 	}
 	elastic.InitElasticSize("http://192.168.3.206:9800", 30)
 	elastic.InitElasticSize("http://192.168.3.206:9800", 30)
 
 
@@ -98,7 +97,7 @@ func TestPortraitService_Info(t *testing.T) {
 			this := &PortraitService{
 			this := &PortraitService{
 				Conn: tt.fields.Conn,
 				Conn: tt.fields.Conn,
 			}
 			}
-			got, err := this.Info(tt.args.companyId)
+			got, err := this.Info(tt.args.companyId, int64(0))
 			if (err != nil) != tt.wantErr {
 			if (err != nil) != tt.wantErr {
 				t.Errorf("Info() error = %v, wantErr %v", err, tt.wantErr)
 				t.Errorf("Info() error = %v, wantErr %v", err, tt.wantErr)
 				return
 				return

Some files were not shown because too many files changed in this diff