Explorar el Código

Merge branch 'master' of http://192.168.3.207:8080/ApplicationCenter/medicalField

fuwencai hace 2 años
padre
commit
48e321766c

+ 1 - 1
api/medical/etc/medical-api.yaml

@@ -1,7 +1,7 @@
 Name: medical-api
 Host: 0.0.0.0
 Port: 8881
-WebRpcPort: 8016
+WebRpcPort: 8017
 Timeout: 10000
 Medical:
   Etcd:

+ 1 - 1
api/medical/internal/logic/institution/getnewmsglistlogic.go

@@ -35,8 +35,8 @@ func (l *GetNewMsgListLogic) GetNewMsgList(req *types.GetNewMsgListReq) (resp *t
 		PageSize:    req.PageSize,
 	})
 	if err != nil || ret == nil {
-		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 		resp.Error_code, resp.Error_msg = -1, "查看失败"
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 	} else {
 		resp.Data = map[string]interface{}{
 			"count": ret.Count,

+ 2 - 2
service/AuthService.go

@@ -1,6 +1,7 @@
 package service
 
 import (
+	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/go-xweb/log"
 	"app.yhyue.com/moapp/jybase/mysql"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
@@ -9,7 +10,6 @@ import (
 	"context"
 	"database/sql"
 	"fmt"
-	"time"
 )
 
 type AuthService struct {
@@ -62,7 +62,7 @@ func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) {
 			"mail":        in.Mail,
 			"ent_name":    in.EntName,
 			"user_id":     in.UserId,
-			"create_time": time.Now(),
+			"create_time": date.NowFormat(date.Date_Full_Layout),
 			"appid":       in.Appid,
 			"source":      entity.MEDICALDOMAIN,
 		}

+ 11 - 7
service/InstitutionService.go

@@ -101,7 +101,7 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 	companyMap := make(map[string]map[string]interface{})
 	if len(*companyList) > 0 && companyList != nil {
 		//认领数据查询
-		companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
+		companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeInstitution)
 		for key, value := range *companyList {
 			if key > 0 {
 				companyName += `,`
@@ -260,11 +260,14 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 }
 
 //  ClaimCompanyData 已认领企业查询处理
-// @param  appId 用户标识
-// @param  newUserId 用户标识
-// @param  claimType 数据类型
+//  @Description:
+//  @param appId 用户标识
+//  @param newUserId 用户标识
+//  @param claimType 数据类型
+//  @return map[string]map[string]interface{} 认领的企业信息
+//
 func (b InstitutionService) ClaimCompanyData(appId string, newUserId, claimType int64) map[string]map[string]interface{} {
-	claimList := b.MysqlConn.Find(entity.TableDomainEntClaim, map[string]interface{}{
+	claimList := b.BasesqlCon.Find(entity.TableDomainEntClaim, map[string]interface{}{
 		"user_id": newUserId,
 		"status":  1,
 		"type":    claimType,
@@ -283,12 +286,13 @@ func (b InstitutionService) ClaimCompanyData(appId string, newUserId, claimType
 // BusinessScopehandle 业务范围处理
 func BusinessScopehandle(BusinessScope []*medical.Business_Scope, multi_match, findfields, query_bool_must_and string, bools []string) (int, []string) {
 	boolsNum := 0
-	businessShoulds := []string{}
-	businessMust_not := []string{}
 	if len(BusinessScope) > 0 {
 		boolsNum = 1
+
 		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
 		for _, v := range BusinessScope {
+			businessShoulds := []string{}
+			businessMust_not := []string{}
 			//关键词
 			for _, keyV := range v.Key {
 				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))

+ 31 - 8
service/InstitutionService_test.go

@@ -129,11 +129,14 @@ func TestInstitutionService_Institution(t *testing.T) {
 					LevelCode:   "0104,0201,0202",
 					MiTypeCode:  "17,03",
 					SdequipmentCode: []*medical.Business_Scope{
-						{Key: []string{"装置", "电动"},
+						{Key: []string{"装置"},
 							Appendkey: []string{},
 							Notkey:    []string{"1", "2"}},
 					},
-					BusinessTypeCode: "0",
+					BusinessTypeCode: "1",
+					NewUserId:        68819,
+					ResourceUseCount: int64(100),
+					Appid:            "10000",
 				}},
 		},
 	}
@@ -161,16 +164,20 @@ func TestInstitutionService_Distributor(t *testing.T) {
 			args: args{
 				&medical.SearchDistributorReq{
 					CompanyName: "公司",
-					AreaCode:    "{'gaung':['郑州市','开封市'],'北京':[]}",
+					AreaCode:    "{'河南':['郑州市','开封市'],'北京':[]}",
 					BusinessScope: []*medical.Business_Scope{
-						{Key: []string{"降钙素原", "细胞保存液"},
+						{Key: []string{"定制式义齿"},
 							Appendkey: []string{},
 							Notkey:    []string{"1", "2"}},
+						{Key: []string{"细胞保存液"},
+							Appendkey: []string{"释放剂"},
+							Notkey:    []string{"1", "2"}},
 					},
-					Brand:        "",
-					ProductModel: "",
-					Appid:        "10000",
-					NewUserId:    68819,
+					Brand:            "",
+					ProductModel:     "",
+					Appid:            "10000",
+					NewUserId:        68819,
+					ResourceUseCount: int64(100),
 				}},
 		},
 	}
@@ -224,6 +231,22 @@ func TestClaimCompanyData(t *testing.T) {
 		want map[string]map[string]interface{}
 	}{
 		// TODO: Add test cases.
+		{
+			name: "认领医疗机构查询",
+			args: args{
+				appId:     "10000",
+				newUserId: int64(68819),
+				claimType: entity.TypeInstitution,
+			},
+		},
+		{
+			name: "认领经销商查询",
+			args: args{
+				appId:     "10000",
+				newUserId: int64(68819),
+				claimType: entity.TypeInstitution,
+			},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {

+ 1 - 812
service/coverage.html

@@ -3,7 +3,7 @@
 <html>
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-		<title>service: Go Coverage Report</title>
+		<title>Go Coverage Report</title>
 		<style>
 			body {
 				background: black;
@@ -55,14 +55,6 @@
 			<div id="nav">
 				<select id="files">
 				
-				<option value="file0">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go (77.4%)</option>
-				
-				<option value="file1">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go (60.2%)</option>
-				
-				<option value="file2">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go (100.0%)</option>
-				
-				<option value="file3">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go (44.0%)</option>
-				
 				</select>
 			</div>
 			<div id="legend">
@@ -84,809 +76,6 @@
 		</div>
 		<div id="content">
 		
-		<pre class="file" id="file0" style="display: none">package service
-
-import (
-        "app.yhyue.com/moapp/jybase/go-xweb/log"
-        "app.yhyue.com/moapp/jybase/mysql"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
-        "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/resource"
-        "context"
-        "database/sql"
-        "fmt"
-        "time"
-)
-
-type AuthService struct {
-        GoodsCode   string
-        GoodsSpecId int64
-        BasesqlConn *mysql.Mysql
-}
-
-//认证信息保存
-func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) <span class="cov10" title="4">{
-        //先判断用户是否存在
-        user := b.BasesqlConn.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
-                "user_id": in.UserId, "appid": in.Appid,
-        }, "id", "")
-        if user != nil </span><span class="cov8" title="3">{
-                if in.OperationType == "add" </span><span class="cov1" title="1">{
-                        return false, "用户已验证"
-                }</span>
-        } else<span class="cov1" title="1"> {
-                if in.OperationType == "update" </span><span class="cov0" title="0">{
-                        return false, "用户未认证,不可修改"
-                }</span>
-        }
-
-        <span class="cov8" title="3">if in.OperationType == "update" </span><span class="cov5" title="2">{
-                //修改处理
-                data := map[string]interface{}{
-                        "name":       in.Name,
-                        "phone":      in.Phone,
-                        "position":   in.Position,
-                        "department": in.Department,
-                        "mail":       in.Mail,
-                        "ent_name":   in.EntName,
-                        "source":     entity.MEDICALDOMAIN,
-                }
-                ok1 := b.BasesqlConn.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN}, data)
-                if ok1 </span><span class="cov5" title="2">{
-                        return true, ""
-                }</span> else<span class="cov0" title="0"> {
-                        log.Println(fmt.Sprintf("认证修改失败:入参:%v:%v,", in.UserId, data))
-                        return false, "修改失败"
-                }</span>
-        } else<span class="cov1" title="1"> {
-                //新增处理
-                data := map[string]interface{}{
-                        "name":        in.Name,
-                        "phone":       in.Phone,
-                        "position":    in.Position,
-                        "department":  in.Department,
-                        "mail":        in.Mail,
-                        "ent_name":    in.EntName,
-                        "user_id":     in.UserId,
-                        "create_time": time.Now(),
-                        "appid":       in.Appid,
-                        "source":      entity.MEDICALDOMAIN,
-                }
-                msg := ""
-                ok := b.BasesqlConn.ExecTx("认证信息保存", func(tx *sql.Tx) bool </span><span class="cov1" title="1">{
-                        ok1 := b.BasesqlConn.InsertByTx(tx, entity.DOMAIN_CAPITAL_RETENTION, data)
-                        if ok1 &lt;= 0 </span><span class="cov0" title="0">{
-                                log.Println(fmt.Sprintf("认证失败:参数:%v", data))
-                                msg = "认证信息保存失败"
-                                return false
-                        }</span>
-                        //开通权益
-                        <span class="cov1" title="1">req := &amp;resource.PowerReq{
-                                Appid:       in.Appid,
-                                GoodsCode:   b.GoodsCode,
-                                GoodsSpecId: b.GoodsSpecId,
-                                EntId:       0,
-                                UserId:      in.UserId,
-                                BuyNum:      1,
-                                Type:        int64(1),
-                        }
-                        resq, err := entity.ResourceLib.PowerHandle(context.Background(), req)
-                        if err != nil || resq.Status != 1 </span><span class="cov1" title="1">{
-                                log.Println("权益开通调用失败:", req, resq)
-                                msg = "权益开通调用失败"
-                                return false
-                        }</span>
-                        <span class="cov0" title="0">return ok1 &gt; 0</span>
-                })
-                <span class="cov1" title="1">return ok, msg</span>
-        }
-}
-
-//认证信息查询
-func (b AuthService) UserAuthInfo(in *medical.CommonReq) *map[string]interface{} <span class="cov5" title="2">{
-        //先判断用户是否存在
-        user := b.BasesqlConn.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
-                "user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN,
-        }, "*", "")
-        return user
-}</span>
-</pre>
-		
-		<pre class="file" id="file1" style="display: none">package service
-
-import (
-        quitl "app.yhyue.com/moapp/jybase/common"
-        elastic "app.yhyue.com/moapp/jybase/esv1"
-        "app.yhyue.com/moapp/jybase/mysql"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
-        "fmt"
-        "log"
-        "strings"
-)
-
-type InstitutionService struct {
-        Bidfield   string
-        BasesqlCon *mysql.Mysql
-        MysqlConn  *mysql.Mysql
-}
-
-// GetFilterItem 医疗机构搜索条件
-func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]interface{}) <span class="cov1" title="1">{
-        //机构类型
-        levelSql := fmt.Sprintf("select  * from %s where  name!='%s'", entity.CODE_MEDICAL_INSTITUTION_LEVEL, "其它")
-        levelList = b.MysqlConn.SelectBySql(levelSql)
-        //医院等级
-        typeSql := fmt.Sprintf("select  * from %s where  name!='%s' and  level=1", entity.CODE_MEDICAL_INSTITUTION_TYPE, "其它")
-        typeList = b.MysqlConn.SelectBySql(typeSql)
-        return
-}</span>
-
-// Institution 医疗机构搜索条件
-func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataList []map[string]interface{}) <span class="cov1" title="1">{
-        //先查询医疗机构
-        //医疗机构查询拼接
-        query := `{"query":{"bool":{"must":[%s],"must_not": [{"term": {"p_miname": ""}}],"should":[%s],"minimum_should_match": %d}},"sort":{"id":{"order":"desc"}}, "from": %d,"size": %d}`
-        shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
-        multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
-        musts := []string{}
-        var query_bool_must_and = `{"bool": {"must": [%s]%s}}`
-        shoulds := []string{}
-        bools := []string{}
-        //省份处理
-        cityArr := []string{}
-        areaArr := []string{}
-        if in.AreaCode != "" </span><span class="cov1" title="1">{
-                areaCode := quitl.ObjToMap(in.AreaCode)
-                for k, v := range *areaCode </span><span class="cov5" title="2">{
-                        if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 </span><span class="cov1" title="1">{
-                                areaArr = append(areaArr, k)
-                        }</span> else<span class="cov1" title="1"> {
-                                cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
-                        }</span>
-                }
-        }
-
-        //省份处理
-        <span class="cov1" title="1">if len(areaArr) &gt; 0 </span><span class="cov1" title="1">{
-                areaQuery := entity.SplicingArr("area", areaArr)
-                shoulds = append(shoulds, areaQuery)
-        }</span>
-        //城市处理
-        <span class="cov1" title="1">if len(cityArr) &gt; 0 </span><span class="cov1" title="1">{
-                cityQuery := entity.SplicingArr("city", cityArr)
-                shoulds = append(shoulds, cityQuery)
-        }</span>
-        //医疗等级处理
-        <span class="cov1" title="1">if in.LevelCode != "" </span><span class="cov1" title="1">{
-                levelQuery := entity.SplicingString("level_code", in.LevelCode)
-                musts = append(musts, levelQuery)
-        }</span>
-        //机构类型处理
-        <span class="cov1" title="1">if in.MiTypeCode != "" </span><span class="cov1" title="1">{
-                miTyprQuery := entity.SplicingString("mi_type_code", in.MiTypeCode)
-                musts = append(musts, miTyprQuery)
-        }</span>
-        //经营性质处理
-        <span class="cov1" title="1">if in.BusinessTypeCode != "" </span><span class="cov1" title="1">{
-                businessTypeQuery := entity.SplicingString("business_type", in.BusinessTypeCode)
-                musts = append(musts, businessTypeQuery)
-        }</span>
-        //机构名称处理
-        <span class="cov1" title="1">if in.CompanyName != "" </span><span class="cov1" title="1">{
-                /*companyNameQuery := entity.SplicingString("p_miname", in.CompanyName)
-                musts = append(musts, companyNameQuery)*/
-                musts = append(musts, fmt.Sprintf(multi_match, "\""+in.CompanyName+"\"", "\"p_miname\""))
-        }</span>
-        //业务范围处理
-        <span class="cov1" title="1">boolsNum, bools := BusinessScopehandle(in.SdequipmentCode, multi_match, `"sdequipment"`, query_bool_must_and, bools)
-        shouldNumber := 0
-        if len(shoulds) &gt; 0 </span><span class="cov1" title="1">{
-                shouldNumber = 1
-        }</span>
-        <span class="cov1" title="1">shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
-        musts = append(musts, shouldStr)
-        queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, in.ResourceUseCount)
-        //医疗机构查找
-        companyList := elastic.Get(entity.INSTITUTION_INDEX, entity.INSTITUTION_TYPE, queryStr)
-        log.Println(queryStr)
-        //再根据医疗机构名称查找项目金额总数
-        companyName := ""
-        companyMap := make(map[string]map[string]interface{})
-        if len(*companyList) &gt; 0 &amp;&amp; companyList != nil </span><span class="cov0" title="0">{
-                //认领数据查询
-                companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
-                for key, value := range *companyList </span><span class="cov0" title="0">{
-                        if key &gt; 0 </span><span class="cov0" title="0">{
-                                companyName += `,`
-                        }</span>
-                        <span class="cov0" title="0">companyName += `"` + fmt.Sprint(value["mi_name"]) + `"`
-                        value["project_money"] = float64(0.00)
-                        value["project_count"] = 0
-                        if companyIdMap[fmt.Sprint(value["company_id"])] == nil </span><span class="cov0" title="0">{
-                                value["isClaim"] = false
-                        }</span> else<span class="cov0" title="0"> {
-                                value["isClaim"] = true
-                        }</span>
-                        <span class="cov0" title="0">companyMap[fmt.Sprint(value["mi_name"])] = value</span>
-                }
-
-        } else<span class="cov1" title="1"> {
-                return
-        }</span>
-        <span class="cov0" title="0">orderField := "_count"
-        orderType := "desc"
-        //排序处理
-        if in.Sort == 1 </span><span class="cov0" title="0">{
-                orderField = "count"
-        }</span>
-        <span class="cov0" title="0">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, b.Bidfield, orderField, orderType)
-        log.Println(aggStr)
-        countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
-        //
-        if len(countList) &gt; 0 &amp;&amp; countList != nil </span><span class="cov0" title="0">{
-                for _, value := range countList </span><span class="cov0" title="0">{
-                        if companyMap[value.CompanyName] != nil </span><span class="cov0" title="0">{
-                                companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
-                                companyMap[value.CompanyName]["project_count"] = value.ProjectCount
-                                dataList = append(dataList, companyMap[value.CompanyName])
-                                delete(companyMap, value.CompanyName)
-                        }</span>
-                }
-                <span class="cov0" title="0">for _, value := range companyMap </span><span class="cov0" title="0">{
-                        dataList = append(dataList, value)
-                }</span>
-        } else<span class="cov0" title="0"> {
-                dataList = *companyList
-
-        }</span>
-        <span class="cov0" title="0">return</span>
-}
-
-// Distributor 经销商搜索
-func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataList []map[string]interface{}) <span class="cov1" title="1">{
-        //先查询医疗机构
-        //医疗机构查询拼接
-        query := `{"query":{"bool":{"must":[%s],"must_not": [{"term": {"p_supplier": ""}}],"should":[%s],"minimum_should_match": %d}}, "sort":{"id":{"order":"desc"}},"from": %d,"size": %d}`
-        shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
-        multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
-        var query_bool_must_and = `{"bool": {"must": [%s]%s}}`
-        musts := []string{}
-        shoulds := []string{}
-        bools := []string{}
-        //省份处理
-        cityArr := []string{}
-        areaArr := []string{}
-        if in.AreaCode != "" </span><span class="cov1" title="1">{
-                areaCode := quitl.ObjToMap(in.AreaCode)
-                for k, v := range *areaCode </span><span class="cov5" title="2">{
-                        if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 </span><span class="cov1" title="1">{
-                                areaArr = append(areaArr, k)
-                        }</span> else<span class="cov1" title="1"> {
-                                cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
-                        }</span>
-                }
-        }
-        //省份处理
-        <span class="cov1" title="1">if len(areaArr) &gt; 0 </span><span class="cov1" title="1">{
-                areaQuery := entity.SplicingArr("area", areaArr)
-                shoulds = append(shoulds, areaQuery)
-        }</span>
-        //城市处理
-        <span class="cov1" title="1">if len(cityArr) &gt; 0 </span><span class="cov1" title="1">{
-                cityQuery := entity.SplicingArr("city", cityArr)
-                shoulds = append(shoulds, cityQuery)
-        }</span>
-        //业务范围处理
-        <span class="cov1" title="1">boolsNum, bools := BusinessScopehandle(in.BusinessScope, multi_match, `"productlist.name"`, query_bool_must_and, bools)
-        //品牌处理
-        if in.Brand != "" </span><span class="cov0" title="0">{
-                brandQuery := entity.SplicingString("productlist.brand", in.Brand)
-                musts = append(musts, brandQuery)
-        }</span>
-        //产品型号处理
-        <span class="cov1" title="1">if in.ProductModel != "" </span><span class="cov0" title="0">{
-                productModelQuery := entity.SplicingString("productlist.model", in.ProductModel)
-                musts = append(musts, productModelQuery)
-        }</span>
-        //机构名称处理
-        <span class="cov1" title="1">if in.CompanyName != "" </span><span class="cov1" title="1">{
-                musts = append(musts, fmt.Sprintf(multi_match, "\""+in.CompanyName+"\"", "\"p_supplier\""))
-        }</span>
-        <span class="cov1" title="1">shouldNumber := 0
-        if len(shoulds) &gt; 0 </span><span class="cov1" title="1">{
-                shouldNumber = 1
-        }</span>
-        <span class="cov1" title="1">shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
-        musts = append(musts, shouldStr)
-        queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, in.ResourceUseCount)
-        //医疗机构查找
-        companyList := elastic.Get(entity.SUPPLIER_PRODUCT_INDEX, entity.SUPPLIER_PRODUCT_TYPE, queryStr)
-        log.Println(queryStr)
-        //再根据医疗机构名称查找项目金额总数
-        companyIds := ""
-        companyMap := make(map[string]map[string]interface{})
-        if len(*companyList) &gt; 0 &amp;&amp; companyList != nil </span><span class="cov0" title="0">{
-                //认领数据查询
-                companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
-                for key, value := range *companyList </span><span class="cov0" title="0">{
-                        if key &gt; 0 </span><span class="cov0" title="0">{
-                                companyIds += `,`
-                        }</span>
-                        <span class="cov0" title="0">companyIds += `"` + fmt.Sprint(value["company_id"]) + `"`
-                        value["project_money"] = float64(0.00)
-                        value["project_count"] = 0
-                        if companyIdMap[fmt.Sprint(value["company_id"])] == nil </span><span class="cov0" title="0">{
-                                value["isClaim"] = false
-                        }</span> else<span class="cov0" title="0"> {
-                                value["isClaim"] = true
-                        }</span>
-                        <span class="cov0" title="0">companyMap[fmt.Sprint(value["company_id"])] = value</span>
-                }
-        } else<span class="cov1" title="1"> {
-                return
-        }</span>
-        //排序处理
-        <span class="cov0" title="0">orderField := "_count"
-        orderType := "desc"
-        if in.Sort == 1 </span><span class="cov0" title="0">{
-                orderField = "count"
-        }</span>
-        <span class="cov0" title="0">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, b.Bidfield, orderField, orderType)
-        log.Println(aggStr)
-        countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
-        if len(countList) &gt; 0 &amp;&amp; countList != nil </span><span class="cov0" title="0">{
-                for _, value := range countList </span><span class="cov0" title="0">{
-                        if companyMap[value.CompanyName] != nil </span><span class="cov0" title="0">{
-                                companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
-                                companyMap[value.CompanyName]["project_count"] = value.ProjectCount
-                                dataList = append(dataList, companyMap[value.CompanyName])
-                                delete(companyMap, value.CompanyName)
-                        }</span>
-                }
-                <span class="cov0" title="0">for _, value := range companyMap </span><span class="cov0" title="0">{
-                        dataList = append(dataList, value)
-                }</span>
-        } else<span class="cov0" title="0"> {
-                dataList = *companyList
-        }</span>
-        <span class="cov0" title="0">return</span>
-}
-
-//  ClaimCompanyData 已认领企业查询处理
-// @param  appId 用户标识
-// @param  newUserId 用户标识
-// @param  claimType 数据类型
-func (b InstitutionService) ClaimCompanyData(appId string, newUserId, claimType int64) map[string]map[string]interface{} <span class="cov0" title="0">{
-        claimList := b.MysqlConn.Find(entity.TableDomainEntClaim, map[string]interface{}{
-                "user_id": newUserId,
-                "status":  1,
-                "type":    claimType,
-                "appid":   appId,
-        }, "ent_id", "", -1, -1)
-        companyIdMap := make(map[string]map[string]interface{})
-        if claimList == nil || len(*claimList) == 0 </span><span class="cov0" title="0">{
-                return companyIdMap
-        }</span>
-        <span class="cov0" title="0">for _, m := range *claimList </span><span class="cov0" title="0">{
-                companyIdMap[quitl.InterfaceToStr(m["ent_id"])] = m
-        }</span>
-        <span class="cov0" title="0">return companyIdMap</span>
-}
-
-// BusinessScopehandle 业务范围处理
-func BusinessScopehandle(BusinessScope []*medical.Business_Scope, multi_match, findfields, query_bool_must_and string, bools []string) (int, []string) <span class="cov5" title="2">{
-        boolsNum := 0
-        businessShoulds := []string{}
-        businessMust_not := []string{}
-        if len(BusinessScope) &gt; 0 </span><span class="cov5" title="2">{
-                boolsNum = 1
-                multi_match = fmt.Sprintf(multi_match, "%s", findfields)
-                for _, v := range BusinessScope </span><span class="cov5" title="2">{
-                        //关键词
-                        for _, keyV := range v.Key </span><span class="cov10" title="4">{
-                                businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
-                        }</span>
-                        //附加词
-                        <span class="cov5" title="2">for _, AppendV := range v.Appendkey </span><span class="cov0" title="0">{
-                                businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
-                        }</span>
-                        //排除词
-                        <span class="cov5" title="2">for _, notV := range v.Notkey </span><span class="cov10" title="4">{
-                                businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
-                        }</span>
-                        //添加
-                        <span class="cov5" title="2">if len(businessShoulds) &gt; 0 </span><span class="cov5" title="2">{
-                                notStr := ""
-                                if len(businessShoulds) &gt; 0 </span><span class="cov5" title="2">{
-                                        notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
-                                }</span>
-                                <span class="cov5" title="2">bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(businessShoulds, ","), notStr))</span>
-                        }
-                }
-        }
-        <span class="cov5" title="2">return boolsNum, bools</span>
-}
-</pre>
-		
-		<pre class="file" id="file2" style="display: none">package service
-
-import (
-        "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/date"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "fmt"
-        "github.com/zeromicro/go-zero/core/logx"
-        "strings"
-)
-
-// EntClaimService 企业认领
-type EntClaimService struct {
-        *entity.Conn
-}
-
-// NewEntClaimSrv 创建一个EntClaimSrv实例
-func NewEntClaimSrv(conn *entity.Conn) *EntClaimService <span class="cov1" title="1">{
-        return &amp;EntClaimService{
-                conn,
-        }
-}</span>
-
-// Claim 认领
-func (e *EntClaimService) Claim(data *entity.EntClaim) (int64, error) <span class="cov7" title="4">{
-        if e.IsClaimed(data.UserId, data.AppId, data.EntId, data.Type) </span><span class="cov4" title="2">{
-                return 0, entity.RepeatErr
-        }</span>
-        <span class="cov4" title="2">return e.BaseMysql.Insert(entity.TableDomainEntClaim, common.StructToMapMore(data)), nil</span>
-}
-
-// UnclaimedByEnt 根据企业id取消认领
-func (e EntClaimService) UnclaimedByEnt(userId int, entId string, type_ int) (bool, int) <span class="cov7" title="4">{
-
-        query := map[string]interface{}{
-                "user_id": userId,
-                "status":  entity.StatusClaimed,
-                "ent_id":  entId,
-                "type":    type_,
-        }
-        // 1. 查询该条数据
-        rs := e.BaseMysql.FindOne(entity.TableDomainEntClaim, query, "id", "")
-        if rs == nil || len(*rs) == 0 </span><span class="cov4" title="2">{
-
-                logx.Errorf("取消认领:无效的企业id %v", entId)
-                return false, 0
-        }</span>
-        <span class="cov4" title="2">query2 := map[string]interface{}{
-                "id": (*rs)["id"],
-        }
-        // 2. 取消认领
-        update := map[string]interface{}{
-                "status":      entity.StatusUnClaimed,
-                "update_time": date.NowFormat(date.Date_Full_Layout),
-        }
-        return e.BaseMysql.Update(entity.TableDomainEntClaim, query2, update), common.IntAll((*rs)["id"])</span>
-}
-
-// IsClaimed 是否认领
-func (e *EntClaimService) IsClaimed(userId int, appId string, entId string, typeCode int) bool <span class="cov10" title="6">{
-        query := map[string]interface{}{
-                "user_id": userId,
-                "type":    typeCode,
-                "ent_id":  entId,
-                "status":  entity.StatusClaimed,
-        }
-        return e.BaseMysql.Count(entity.TableDomainEntClaim, query) &gt; 0
-}</span>
-
-// DistributorList 关注的经销商列表
-func (e *EntClaimService) DistributorList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov4" title="2">{
-
-        query := map[string]interface{}{
-                "user_id": userId,
-                "appid":   appId,
-                "type":    entity.TypeDistributor,
-                "status":  entity.StatusClaimed,
-        }
-        field := "id,appid,user_id,ent_id,ent_name,create_time"
-        order := "create_time desc"
-        total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
-        if total == 0 </span><span class="cov1" title="1">{
-                return nil, 0
-        }</span>
-        <span class="cov1" title="1">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
-}
-
-// InstitutionList  我关注的医疗机构列表
-func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov4" title="2">{
-        query := map[string]interface{}{
-                "user_id": userId,
-                "appid":   appId,
-                "type":    entity.TypeInstitution,
-                "status":  entity.StatusClaimed,
-        }
-        field := "id,appid,user_id,ent_id,ent_name,create_time"
-        order := "create_time desc"
-        total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
-        if total == 0 </span><span class="cov1" title="1">{
-                return nil, 0
-        }</span>
-        <span class="cov1" title="1">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
-}
-
-// GetInstitution 获取机构信息
-func (e EntClaimService) GetInstitution(id string) *map[string]interface{} <span class="cov4" title="2">{
-        query := map[string]interface{}{
-                "company_id": id,
-        }
-        field := "company_name,establish_date,company_address,capital,company_phone"
-        return e.GlobalCommonData.FindOne(entity.TableCompanyBasInfo, query, field, "")
-}</span>
-
-// GetInstitutionByIds GetInstitution 批量获取机构详细信息
-func (e EntClaimService) GetInstitutionByIds(ids []string) *[]map[string]interface{} <span class="cov6" title="3">{
-        if len(ids) == 0 </span><span class="cov1" title="1">{
-                return &amp;[]map[string]interface{}{}
-        }</span>
-        <span class="cov4" title="2">q := "select a.company_id,a.company_name,a.establish_date,a.company_address,a.capital,a.company_phone,b.area,b.city from %v a left join %v b on a.area_code=b.code  where a.company_id in (\"%v\")  "
-        query := fmt.Sprintf(q, entity.TableCompanyBasInfo, entity.TableCodeArea, strings.Join(ids, "\" , \""))
-        return e.GlobalCommonData.SelectBySql(query)</span>
-}
-</pre>
-		
-		<pre class="file" id="file3" style="display: none">// @Description   画像相关
-package service
-
-import (
-        "errors"
-        "fmt"
-        "log"
-        "regexp"
-        "strings"
-        "time"
-
-        . "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/encrypt"
-        elastic "app.yhyue.com/moapp/jybase/esv1"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-)
-
-//画像
-type PortraitService struct {
-        *entity.Conn
-}
-
-var ClearHtml = regexp.MustCompile("&lt;[^&gt;]*&gt;")
-
-// @description           生成结构体
-// @param                     conn 数据库实例
-// @return                    Portrait 画像实例
-func NewPortrait(conn *entity.Conn) *PortraitService <span class="cov1" title="1">{
-        return &amp;PortraitService{
-                conn,
-        }
-}</span>
-
-// @description           获取画像内容
-// @param                     companyId 机构id
-// @param                     user_id   base_user_id
-// @return                    PortraitInfo 画像信息
-// @return                    error 错误信息
-func (this *PortraitService) Info(companyId string, user_id int64) (*entity.PortraitInfo, error) <span class="cov10" title="3">{
-        //判断是否存在companyid
-        // if companyId == "" || user_id == 0 {
-        //         return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        // }
-        //获取信息
-        data := this.Mysql.SelectBySql(fmt.Sprintf(`SELECT a.sdequipment_code,a.area_code,a.beds,a.visit_perday,a.doctorsnum,a.address,a.website,a.business_type,replace(a.equipment,",","、") equipment, replace(e.equipment,",","、") sdleveltypeequip ,a.mi_name,a.establish_date,b.name LEVEL,c.name miType,d.class FROM %s a 
-                                                                                                        LEFT JOIN %s b ON a.level_code=b.code 
-                                                                                                        LEFT JOIN %s c ON c.code =a.mi_type_code
-                                                                                                        LEFT JOIN (SELECT GROUP_CONCAT(DISTINCT departname_class1 SEPARATOR  '、') class,company_id FROM %s WHERE company_id=?)  AS d ON d.company_id =a.company_id
-                                                                                                        left join %s e on e.code =a.sdequipment_code
-                                                                                                        WHERE  a.company_id=?`, entity.Institution_baseinfo, entity.Code_level, entity.Code_type, entity.Institution_department, entity.Code_sdleveltypeequip), companyId, companyId)
-        if data == nil || len(*data) == 0 </span><span class="cov6" title="2">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        //获取area_code 省份,城市,区县
-        <span class="cov1" title="1">area, city, district := "", "", ""
-        rdata := (*data)[0]
-        adata := this.GlobalCommonData.SelectBySql(fmt.Sprintf(`select area,city,district from %s where code =? limit 1`, entity.Code_area), ObjToString(rdata["area_code"]))
-        if adata != nil &amp;&amp; len(*adata) &gt; 0 </span><span class="cov1" title="1">{
-                area = ObjToString((*adata)[0]["area"])
-                city = ObjToString((*adata)[0]["city"])
-                district = ObjToString((*adata)[0]["district"])
-        }</span>
-        //医疗设备如果基本信息表中没有,则根据sdequipment_code、code联合查询得到equipment
-        <span class="cov1" title="1">equipment := ObjToString(rdata["equipment"])
-        sdleveltypeequip := ObjToString(rdata["sdleveltypeequip"])
-        if equipment == "" &amp;&amp; sdleveltypeequip != "" </span><span class="cov1" title="1">{
-                equipment = ObjToString(rdata["sdleveltypeequip"])
-        }</span>
-        //医疗画像结果
-        <span class="cov1" title="1">portraitInfo := &amp;entity.PortraitInfo{
-                Beds:          Int64All(rdata["beds"]),
-                VisitPerday:   Int64All(rdata["visit_perday"]),      // 门诊量/日
-                Doctorsnum:    Int64All(rdata["doctorsnum"]),        //医生人数
-                Address:       ObjToString(rdata["address"]),        //医疗机构地址
-                Website:       ObjToString(rdata["website"]),        //医疗机构网站
-                Area:          area,                                 //省
-                City:          city,                                 //市
-                District:      district,                             //区
-                BusinessType:  Int64All(rdata["business_type"]),     //医疗机构经营方式(0:公立、1:民营、2:其它)
-                Level:         ObjToString(rdata["level"]),          //医疗机构等级
-                MiType:        ObjToString(rdata["miType"]),         //医疗机构类型
-                Equipment:     equipment,                            //医院设备
-                Departnames:   ObjToString(rdata["class"]),          //医院科室
-                Follow:        this.IsFollow(companyId, user_id, 1), //是否关注 0-未关注 1已关注
-                CompanyName:   ObjToString(rdata["mi_name"]),        //医疗机构名称
-                EstablishDate: ObjToString(rdata["establish_date"]), //成立日期
-        }
-        return portraitInfo, nil</span>
-}
-
-// @description           获取医疗机构画像相关招标动态
-// @param                     companyName 机构名称
-// @param                     pageSize 条数
-// @param                     pageNum 页码
-// @param                     isExport 是否用于数据导出
-// @return                    GetNewMsgList 招标动态
-// @return                    count 招标数量
-// @return                    error 错误信息
-func (this *PortraitService) List(companyName string, pageSize, pageNum int64, isExport bool) (*[]*entity.GetNewMsgList, int64, error) <span class="cov1" title="1">{
-        //判断是否存在companyid
-        if companyName == "" </span><span class="cov0" title="0">{
-                return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov1" title="1">var total int64
-        mustQueryArr := this.CommonPare(companyName)
-        log.Println("~~~~,", mustQueryArr)
-        //仅第一页查询总量(非数据导出)
-
-        if pageNum == 1 </span><span class="cov1" title="1">{
-                total = elastic.Count(entity.BiddingIndex, entity.BiddingIndex, fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), ""))
-                if total &lt;= 0 </span><span class="cov1" title="1">{
-                        return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-        }
-        <span class="cov0" title="0">start, limit := (pageNum-1)*pageSize, pageSize
-        fields := `"title","area","subtype","_id","projectname","publishtime"`
-        if isExport </span><span class="cov0" title="0">{
-                start, limit = 0, entity.DataExportNumLimit
-                fields = `"_id","title"`
-        }</span>
-        <span class="cov0" title="0">list := &amp;[]*entity.GetNewMsgList{}
-        //列表查询
-        if total &lt;= entity.DataExportBatchSearchLimit </span><span class="cov0" title="0">{
-                listQuery := fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(entity.ListSearchLimit, fields, "publishtime", start, limit))
-                log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
-                newData := elastic.Get(entity.BiddingIndex, entity.BiddingType, listQuery)
-                if newData == nil || len(*newData) == 0 </span><span class="cov0" title="0">{
-                        return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-                <span class="cov0" title="0">log.Println("newdata:", newData)
-                for k, v := range *newData </span><span class="cov0" title="0">{
-                        if len(v) &gt; 0 </span><span class="cov0" title="0">{
-                                if v["_id"] != nil </span><span class="cov0" title="0">{
-                                        (*newData)[k]["id"] = EncodeId(v["_id"].(string))
-                                        delete((*newData)[k], "_id") //删除未加密id
-                                }</span>
-                                <span class="cov0" title="0">title := ObjToString(ObjToString(v["title"]))
-                                if title == "" </span><span class="cov0" title="0">{
-                                        title = ObjToString(v["projectname"])
-                                }</span>
-                                <span class="cov0" title="0">(*newData)[k]["title"] = ClearHtml.ReplaceAllString(title, "")</span>
-                        }
-                        <span class="cov0" title="0">*list = append(*list, &amp;entity.GetNewMsgList{
-                                Area:      ObjToString(v["area"]),
-                                Bidstatus: ObjToString(v["subtype"]),           //信息类型
-                                Firsttime: Int64All(v["publishtime"]),          //时间
-                                Id:        ObjToString((*newData)[k]["id"]),    //加密信息id
-                                Title:     ObjToString((*newData)[k]["title"]), //标题
-                        })
-                        log.Println("~~list:", list)</span>
-                }
-                <span class="cov0" title="0">return list, total, nil</span>
-        }
-        <span class="cov0" title="0">return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)</span>
-}
-
-//医疗机构画像查询语句拼接
-func (this *PortraitService) CommonPare(companyName string) (mustQueryArr []string) <span class="cov1" title="1">{
-        sTime, eTime := this.PareTimeSelect()
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"term":{"buyer":"%s"}}`, companyName))
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"term":{"bid_field":"%s"}}`, entity.BidField))
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"range":{"publishtime":{"gte":"%d","lte":"%d"}}}`, sTime.Unix(), eTime.Unix()))
-
-        return
-}</span>
-
-//PareTimeSelect 默认2年
-func (this *PortraitService) PareTimeSelect() (st, et time.Time) <span class="cov1" title="1">{
-        now := time.Now()
-        sYear := now.Year() - 2
-        eYear := now.Year()
-        //返回默认时间
-        sTimeStamp := time.Date(sYear, 1, 1, 0, 0, 0, 0, time.Local)
-        eTimeStamp := time.Date(eYear+1, 1, 1, 0, 0, -1, 0, time.Local)
-        if eYear == now.Year() </span><span class="cov1" title="1">{
-                eTimeStamp = time.Date(eYear, now.Month(), now.Day(), now.Hour(), now.Minute(), 0, 0, time.Local)
-        }</span>
-        <span class="cov1" title="1">return sTimeStamp, eTimeStamp</span>
-}
-
-//短地址加密
-func EncodeId(sid string) string <span class="cov0" title="0">{
-        if sid == "" || sid == "-" </span><span class="cov0" title="0">{ //不存在的id为-
-                return ""
-        }</span>
-        <span class="cov0" title="0">return encrypt.EncodeArticleId2ByCheck(sid)</span>
-}
-
-// @description           判断用户是否关注该项目
-// @param                     companyId 机构id
-// @param                     user_id base_user_id
-// @param                     types 类型 1医疗机构 2经销商
-// @return                    int64 是否关注 1关注 0未关注
-func (this *PortraitService) IsFollow(companyId string, user_id, types int64) int64 <span class="cov1" title="1">{
-        if this.BaseMysql.CountBySql(fmt.Sprintf(`select count(1) from %s where user_id =? and ent_id =? and type =?`, entity.Domain_ent_claim), user_id, companyId, types) &gt; 0 </span><span class="cov0" title="0">{
-                return 1
-        }</span>
-        <span class="cov1" title="1">return 0</span>
-}
-
-// @description           获取医疗机构画像相关招标动态导出的加密戳 用于数据导出支付页面
-// @param                     mongoUid mongodb用户id
-// @param                     companyName 机构名称
-// @param                     ids 选中的招标信息 多个,隔开 全部则传空字符串
-// @return                    string 生成的数据导出加密戳
-// @return                    error 错误信息
-func (this *PortraitService) Export(mongoUid, companyName, ids string) (string, error) <span class="cov0" title="0">{
-        //判断是否存在companyid
-        if companyName == "" </span><span class="cov0" title="0">{
-                return "", errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov0" title="0">sTime, eTime := this.PareTimeSelect()
-        idsArr := []string{}
-        if ids == "" </span><span class="cov0" title="0">{
-                //获取全部id
-                list, _, err := this.List(companyName, -1, -1, true)
-                if err != nil || list == nil || len(*list) == 0 </span><span class="cov0" title="0">{
-                        return "", errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-                <span class="cov0" title="0">for k, v := range *list </span><span class="cov0" title="0">{
-                        ids += v.Id
-                        if k != len(*list)-1 </span><span class="cov0" title="0">{
-                                ids += ","
-                        }</span>
-                }
-        }
-        <span class="cov0" title="0">for _, v := range strings.Split(ids, ",") </span><span class="cov0" title="0">{
-                id := encrypt.DecodeArticleId2ByCheck(v) //解密id
-                if len(id) &gt; 0 </span><span class="cov0" title="0">{
-                        //
-                        idsArr = append(idsArr, id[0])
-                }</span>
-        }
-        //
-        <span class="cov0" title="0">saveMap := map[string]interface{}{
-                "s_userid":    mongoUid,
-                "comeinfrom":  "medicalPortrait", //来源
-                "comeintime":  time.Now().Unix(),
-                "selectIds":   idsArr,
-                "area":        []string{},
-                "publishtime": fmt.Sprintf("%d_%d", sTime.Unix(), eTime.Unix()),
-                "industry":    []string{},
-                "keywords":    []string{},
-                "selectType":  "",
-                "buyer":       []string{companyName},
-        }
-
-        if _id := this.MgoJy.Save("export_search", saveMap); _id != "" </span><span class="cov0" title="0">{
-                return encrypt.SE.Encode2Hex(_id), nil
-        }</span>
-        <span class="cov0" title="0">return "", errors.New(entity.NO_DATA_ERROR_MSG)</span>
-}
-</pre>
-		
 		</div>
 	</body>
 	<script>

+ 0 - 180
service/test_cover.out

@@ -1,181 +1 @@
 mode: count
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:22.76,27.17 2 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.2,37.34 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:27.17,28.32 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:28.32,30.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:31.8,32.35 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:32.35,34.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.34,49.10 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:49.10,51.4 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:51.9,54.4 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:55.8,70.74 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:95.3,95.17 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:70.74,72.16 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:78.4,88.38 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:93.4,93.18 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:72.16,76.5 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:88.38,92.5 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:100.82,106.2 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:21.93,29.2 5 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:32.111,45.23 10 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.2,57.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.2,62.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.2,67.24 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.2,72.25 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.2,77.31 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.2,82.26 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:88.2,90.22 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:93.2,102.49 8 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:123.2,126.18 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:129.2,133.44 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:149.2,149.8 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:45.23,47.31 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:47.31,48.60 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:48.60,50.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:50.10,52.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.22,60.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.22,65.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.24,70.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.25,75.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.31,80.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.26,86.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:90.22,92.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:102.49,105.40 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:105.40,106.15 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:109.4,112.60 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:117.4,117.52 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:106.15,108.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:112.60,114.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:114.10,116.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:120.8,122.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:126.18,128.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:133.44,134.35 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.3,142.36 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:134.35,135.44 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:135.44,140.5 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.36,144.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:145.8,148.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:153.111,166.23 10 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.2,177.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.2,182.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:187.2,189.20 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.2,194.27 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.2,199.26 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:202.2,203.22 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:206.2,215.49 8 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:236.2,238.18 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:241.2,244.44 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:259.2,259.8 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:166.23,168.31 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:168.31,169.60 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:169.60,171.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:171.10,173.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.22,180.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.22,185.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:189.20,192.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.27,197.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.26,201.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:203.22,205.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:215.49,218.40 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:218.40,219.15 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:222.4,225.60 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:230.4,230.55 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:219.15,221.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:225.60,227.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:227.10,229.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:232.8,234.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:238.18,240.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:244.44,245.35 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.3,253.36 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:245.35,246.44 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:246.44,251.5 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.36,255.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:256.8,258.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:266.122,274.46 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:277.2,277.31 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:280.2,280.21 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:274.46,276.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:277.31,279.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:284.152,288.28 4 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:314.2,314.24 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:288.28,291.35 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:291.35,293.31 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:297.4,297.40 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.4,301.34 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.4,305.32 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:293.31,295.5 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:297.40,299.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.34,303.5 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.32,307.33 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:310.5,310.104 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:307.33,309.6 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:18.57,22.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:25.71,26.65 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:29.2,29.90 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:26.65,28.3 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:33.90,43.32 3 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:48.2,56.99 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:43.32,47.3 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:60.96,68.2 2 6
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:71.126,82.16 5 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:85.2,85.115 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:82.16,84.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:89.126,99.16 5 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:102.2,102.115 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:99.16,101.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:106.76,112.2 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:115.86,116.19 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:119.2,121.46 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:116.19,118.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:28.54,32.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:39.98,51.36 2 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:55.2,58.37 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:64.2,66.47 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:70.2,88.26 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:51.36,53.3 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:58.37,62.3 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:66.47,68.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:99.136,101.23 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:104.2,109.18 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:115.2,117.14 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:121.2,123.48 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:154.2,154.53 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:101.23,103.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:109.18,111.17 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:111.17,113.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:117.14,120.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:123.48,127.43 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:130.3,131.30 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:152.3,152.26 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:127.43,129.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:131.30,132.18 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:143.4,150.32 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:132.18,133.24 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:137.5,138.20 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:141.5,141.67 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:133.24,136.6 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:138.20,140.6 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:158.85,165.2 5 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:168.66,175.25 6 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:178.2,178.31 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:175.25,177.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:182.34,183.29 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:186.2,186.45 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:183.29,185.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:194.85,195.170 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:198.2,198.10 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:195.170,197.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:207.88,209.23 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:212.2,214.15 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:227.2,227.44 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:235.2,248.65 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:251.2,251.49 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:209.23,211.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:214.15,217.51 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:220.3,220.27 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:217.51,219.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:220.27,222.25 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:222.25,224.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:227.44,229.18 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:229.18,232.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:248.65,250.3 1 0