jianghan 5 luni în urmă
părinte
comite
713b2d6c69

+ 11 - 2
api/biService.api

@@ -3,7 +3,7 @@ syntax = "v1"
 type (
 	biResp {
 		Error_code int64       `json:"error_code"` //响应代码
-		Error_msg  string      `json:"error_msg"`  //响应消息
+		Error_msg  string      `json:"error_msg"` //响应消息
 		Data       interface{} `json:"data"`
 	}
 	myDataAssetReq {
@@ -153,8 +153,12 @@ type (
 	}
 	FindClueInfoReq {
 		UserId     string `header:"userId,optional"`
+		Phone      string `json:"phone"`
 		PositionId int64  `header:"positionId,optional"`
 	}
+	ClueInfoReq {
+		SearchName string `json:"searchName"`
+	}
 )
 
 @server (
@@ -250,4 +254,9 @@ service biService-api {
 	@doc "线索查询"
 	@handler findClueInfo
 	post /biService/findClueInfo (FindClueInfoReq) returns (biResp)
-}
+
+	@doc "线索验重 列表"
+	@handler getClueInfoList
+	post /biService/getClueInfoList (ClueInfoReq) returns (biResp)
+}
+

+ 29 - 0
api/internal/handler/getclueinfolisthandler.go

@@ -0,0 +1,29 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+// 线索验重 列表
+func getClueInfoListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.ClueInfoReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewGetClueInfoListLogic(r.Context(), svcCtx)
+		resp, err := l.GetClueInfoList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 62 - 42
api/internal/handler/routes.go

@@ -14,38 +14,41 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/myDataAsset",
-				Handler: MyDataAssetHandler(serverCtx),
+				Path:    "/biService/ClueAdd",
+				Handler: ClueAddHandler(serverCtx),
 			},
 			{
+				// 新增受理单
 				Method:  http.MethodPost,
-				Path:    "/biService/addProject",
-				Handler: AddProjectReqHandler(serverCtx),
+				Path:    "/biService/addAcceptance",
+				Handler: addAcceptanceHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/getInfoId",
-				Handler: GetInfoIdHandler(serverCtx),
+				Path:    "/biService/addProject",
+				Handler: AddProjectReqHandler(serverCtx),
 			},
 			{
+				// 资讯全量导出
 				Method:  http.MethodPost,
-				Path:    "/biService/drawClue",
-				Handler: DrawClueHandler(serverCtx),
+				Path:    "/biService/allInfoExport",
+				Handler: allInfoExportHandler(serverCtx),
 			},
 			{
+				// 项目全量导出
 				Method:  http.MethodPost,
-				Path:    "/biService/call",
-				Handler: CallHandler(serverCtx),
+				Path:    "/biService/allProjectExport",
+				Handler: allProjectExportHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/distributeClue",
-				Handler: DistributeClueHandler(serverCtx),
+				Path:    "/biService/autoFollow",
+				Handler: AutoFollowHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/distributeClueShow",
-				Handler: DistributeClueShowHandler(serverCtx),
+				Path:    "/biService/call",
+				Handler: CallHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -54,88 +57,105 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/ClueAdd",
-				Handler: ClueAddHandler(serverCtx),
+				Path:    "/biService/clueImportTt",
+				Handler: ClueImportTlHandler(serverCtx),
 			},
 			{
+				// 创建线索
 				Method:  http.MethodPost,
-				Path:    "/biService/clueImportTt",
-				Handler: ClueImportTlHandler(serverCtx),
+				Path:    "/biService/createClueByPhone",
+				Handler: createClueHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/autoFollow",
-				Handler: AutoFollowHandler(serverCtx),
+				Path:    "/biService/distributeClue",
+				Handler: DistributeClueHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/sqlManage",
-				Handler: sqlManageHandler(serverCtx),
+				Path:    "/biService/distributeClueShow",
+				Handler: DistributeClueShowHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/myInfo",
-				Handler: MyinfoHandler(serverCtx),
+				Path:    "/biService/drawClue",
+				Handler: DrawClueHandler(serverCtx),
 			},
 			{
+				// 线索查询
 				Method:  http.MethodPost,
-				Path:    "/biService/resEmpower",
-				Handler: ResEmpowerHandler(serverCtx),
+				Path:    "/biService/findClueInfo",
+				Handler: findClueInfoHandler(serverCtx),
 			},
 			{
+				// 线索验重 列表
 				Method:  http.MethodPost,
-				Path:    "/biService/allProjectExport",
-				Handler: allProjectExportHandler(serverCtx),
+				Path:    "/biService/getClueInfoList",
+				Handler: getClueInfoListHandler(serverCtx),
 			},
 			{
+				// 公司类型
 				Method:  http.MethodPost,
-				Path:    "/biService/allInfoExport",
-				Handler: allInfoExportHandler(serverCtx),
+				Path:    "/biService/getCompanyType",
+				Handler: getCompanyTypeHandler(serverCtx),
 			},
 			{
+				Method:  http.MethodPost,
+				Path:    "/biService/getInfoId",
+				Handler: GetInfoIdHandler(serverCtx),
+			},
+			{
+				// 资讯操作
 				Method:  http.MethodPost,
 				Path:    "/biService/infoOperate",
 				Handler: infoOperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/getCompanyType",
-				Handler: getCompanyTypeHandler(serverCtx),
+				Path:    "/biService/myDataAsset",
+				Handler: MyDataAssetHandler(serverCtx),
 			},
 			{
+				// 用户身份
 				Method:  http.MethodPost,
-				Path:    "/biService/sendMail",
-				Handler: sendMailHandler(serverCtx),
+				Path:    "/biService/myInfo",
+				Handler: MyinfoHandler(serverCtx),
 			},
 			{
+				// 资源中台授权
 				Method:  http.MethodPost,
-				Path:    "/biService/upFile",
-				Handler: upFileHandler(serverCtx),
+				Path:    "/biService/resEmpower",
+				Handler: ResEmpowerHandler(serverCtx),
 			},
 			{
+				// 发送邮件
 				Method:  http.MethodPost,
 				Path:    "/biService/sendCommonndMail",
 				Handler: sendComMailHandler(serverCtx),
 			},
 			{
+				// 数据导出(通用),发邮件
 				Method:  http.MethodPost,
-				Path:    "/biService/addAcceptance",
-				Handler: addAcceptanceHandler(serverCtx),
+				Path:    "/biService/sendMail",
+				Handler: sendMailHandler(serverCtx),
 			},
 			{
+				// bi通用接口
 				Method:  http.MethodPost,
-				Path:    "/biService/createClueByPhone",
-				Handler: createClueHandler(serverCtx),
+				Path:    "/biService/sqlManage",
+				Handler: sqlManageHandler(serverCtx),
 			},
 			{
+				// 客成线索移交
 				Method:  http.MethodPost,
 				Path:    "/biService/transferClueByPhone",
 				Handler: transferClueSuccHandler(serverCtx),
 			},
 			{
+				// 附件上传
 				Method:  http.MethodPost,
-				Path:    "/biService/findClueInfo",
-				Handler: findClueInfoHandler(serverCtx),
+				Path:    "/biService/upFile",
+				Handler: upFileHandler(serverCtx),
 			},
 		},
 		rest.WithMaxBytes(104857600),

+ 39 - 0
api/internal/logic/getclueinfolistlogic.go

@@ -0,0 +1,39 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetClueInfoListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+// 线索验重 列表
+func NewGetClueInfoListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClueInfoListLogic {
+	return &GetClueInfoListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetClueInfoListLogic) GetClueInfoList(req *types.ClueInfoReq) (resp *types.BiResp, err error) {
+	// todo: add your logic here and delete this line
+	if req.SearchName == "" {
+		return &types.BiResp{
+			Error_code: 1,
+			Error_msg:  "参数无效"}, nil
+	}
+	res, err := l.svcCtx.BiServiceRpc.GetClueInfoList(l.ctx, &biservice.ClueInfoReq{
+		SearchName: req.SearchName,
+	})
+	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
+}

+ 106 - 102
api/internal/types/types.go

@@ -1,42 +1,52 @@
 // Code generated by goctl. DO NOT EDIT.
 package types
 
-type BiResp struct {
-	Error_code int64       `json:"error_code"` //响应代码
-	Error_msg  string      `json:"error_msg"`  //响应消息
-	Data       interface{} `json:"data"`
-}
-
-type MyDataAssetReq struct {
-	UserId    string `header:"userId,optional"`
-	NewUserId int64  `header:"newUserId,optional"`
-	EntUserId int64  `header:"entUserId,optional"`
+type AcceptanceReq struct {
+	ProposeType     int64  `json:"proposeType,optional"`
+	Propose_time    string `json:"proposeTime,optional"`
+	Channel         string `json:"channel,optional"`
+	Acceptance_type int64  `json:"acceptanceType,optional"`
+	Status          int64  `json:"status,optional"`
+	Over_time       string `json:"overTime,optional"`
+	Remark          string `json:"remark,optional"`
+	PositionId      int64  `header:"positionId,optional"`
+	DeptId          string `header:"entDeptId,optional"` //部门id
+	EntUserName     string `header:"entUserName,optional"`
+	ParamData       string `json:"paramData,optional"`
 }
 
-type AddProjectReq struct {
-	PositionId   int64  `header:"positionId,optional"`
-	Source       int64  `json:"source,optional"`
-	InfoId       string `json:"info_id,optional"`
-	PositionType int64  `header:"positionType,optional"`
-	AccountId    int64  `header:"accountId,optional"`
-	CompanyName  string `header:"entName,optional"`
-	UserName     string `header:"userName,optional"`
-	UserId       int64  `header:"newUserId,optional"`
-	EntId        int64  `header:"entId,optional"`
-	EntUserName  string `header:"entUserName,optional"`
+type ClueAddReq struct {
+	Phone            string `json:"phone"`
+	Username         string `json:"username,optional"`
+	Source           string `json:"source"`
+	Status999        string `json:"status999"`
+	Owner            string `json:"owner"`
+	EmpNo            string `json:"empNo"`
+	Company          string `json:"company,optional"`
+	IsPolicymaker    string `json:"isPolicymaker,optional"`
+	BelongToIndustry string `json:"belongToIndustry,optional"`
+	Job              string `json:"job,optional"`
+	CustomerNeeds    string `json:"customerNeeds,optional"`
+	BelongTo         string `json:"belongTo,optional"`
+	WantGoods        string `json:"wantGoods,optional"`
+	CustomerBudget   string `json:"customerBudget,optional"`
 }
 
-type GetInfoIdReq struct {
-	PositionId int64 `header:"positionId,optional"`
+type ClueImportReq struct {
+	PositionId int64  `header:"positionId,optional"`
+	Pcbh       string `json:"pcbh"`
 }
 
-type DrawClueReq struct {
-	PositionId int64 `header:"positionId,optional"`
-	Count      int64 `json:"count,optional"`
+type ClueInfoReq struct {
+	SearchName string `json:"searchName"`
 }
 
-type CallReq struct {
+type CreateClueReq struct {
+	AppId      string `header:"appId,default=10000"`
+	UserId     string `header:"userId,optional"`
+	BaseUserId int64  `header:"newUserId"`
 	PositionId int64  `header:"positionId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
 	Phone      string `json:"phone"`
 }
 
@@ -57,31 +67,35 @@ type DistributeClueShowReq struct {
 	UpdatePositionID int64                    `json:"updatePositionID"`
 }
 
-type ClueImportReq struct {
+type ExportByDbReq struct {
+	Token    string                   `json:"token"`
+	Title    string                   `json:"title"`
+	Content  string                   `json:"content"`
+	Mails    string                   `json:"mails"`
+	FileName string                   `json:"filename"`
+	Datas    []map[string]interface{} `json:"datas"`
+}
+
+type ExportReq struct {
+	Mail       string   `json:"mail"`
+	Mapping    []string `json:"mapping"`
+	PositionId int64    `header:"positionId,optional"`
+}
+
+type FindClueInfoReq struct {
+	UserId     string `header:"userId,optional"`
+	Phone      string `json:"phone"`
 	PositionId int64  `header:"positionId,optional"`
-	Pcbh       string `json:"pcbh"`
 }
 
-type ClueAddReq struct {
-	Phone            string `json:"phone"`
-	Username         string `json:"username,optional"`
-	Source           string `json:"source"`
-	Status999        string `json:"status999"`
-	Owner            string `json:"owner"`
-	EmpNo            string `json:"empNo"`
-	Company          string `json:"company,optional"`
-	IsPolicymaker    string `json:"isPolicymaker,optional"`
-	BelongToIndustry string `json:"belongToIndustry,optional"`
-	Job              string `json:"job,optional"`
-	CustomerNeeds    string `json:"customerNeeds,optional"`
-	BelongTo         string `json:"belongTo,optional"`
-	WantGoods        string `json:"wantGoods,optional"`
-	CustomerBudget   string `json:"customerBudget,optional"`
+type MyInfoReq struct {
+	Bid string `json:"bid,optional"`
+	Sid string `json:"sid"`
 }
 
-type SqlManageReq struct {
-	Id     float64 `json:"id"`
-	Params []Param `json:"params"`
+type OperateReq struct {
+	NewId string `json:"newId"`
+	Type  int64  `json:"type"`
 }
 
 type Param struct {
@@ -89,11 +103,6 @@ type Param struct {
 	Type  string `json:"type"`
 }
 
-type MyInfoReq struct {
-	Bid string `json:"bid,optional"`
-	Sid string `json:"sid"`
-}
-
 type ResEmpowerReq struct {
 	EntId        int64  `header:"entId"`
 	ReqType      int64  `json:"reqType"`
@@ -102,28 +111,24 @@ type ResEmpowerReq struct {
 	PositionId   string `json:"positionId"`
 }
 
-type ExportReq struct {
-	Mail       string   `json:"mail"`
-	Mapping    []string `json:"mapping"`
-	PositionId int64    `header:"positionId,optional"`
-}
-
-type OperateReq struct {
-	NewId string `json:"newId"`
-	Type  int64  `json:"type"`
+type SendMailReq struct {
+	Title   string `json:"title"`
+	Content string `json:"content"`
+	Mails   string `json:"mails"`
 }
 
-type GetCompanyTypeReq struct {
-	CompanyName string `json:"companyName"`
+type SqlManageReq struct {
+	Id     float64 `json:"id"`
+	Params []Param `json:"params"`
 }
 
-type ExportByDbReq struct {
-	Token    string                   `json:"token"`
-	Title    string                   `json:"title"`
-	Content  string                   `json:"content"`
-	Mails    string                   `json:"mails"`
-	FileName string                   `json:"filename"`
-	Datas    []map[string]interface{} `json:"datas"`
+type TransferClueReq struct {
+	UserId     string `header:"userId,optional"`
+	BaseUserId int64  `header:"newUserId"`
+	PositionId int64  `header:"positionId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	Phone      string `json:"phone"`
+	OrderNo    string `json:"orderNo"`
 }
 
 type UpFileReq struct {
@@ -135,46 +140,45 @@ type UpFileReq struct {
 	FileType   string `form:"fileType"`
 }
 
-type SendMailReq struct {
-	Title   string `json:"title"`
-	Content string `json:"content"`
-	Mails   string `json:"mails"`
+type AddProjectReq struct {
+	PositionId   int64  `header:"positionId,optional"`
+	Source       int64  `json:"source,optional"`
+	InfoId       string `json:"info_id,optional"`
+	PositionType int64  `header:"positionType,optional"`
+	AccountId    int64  `header:"accountId,optional"`
+	CompanyName  string `header:"entName,optional"`
+	UserName     string `header:"userName,optional"`
+	UserId       int64  `header:"newUserId,optional"`
+	EntId        int64  `header:"entId,optional"`
+	EntUserName  string `header:"entUserName,optional"`
 }
 
-type AcceptanceReq struct {
-	ProposeType     int64  `json:"proposeType,optional"`
-	Propose_time    string `json:"proposeTime,optional"`
-	Channel         string `json:"channel,optional"`
-	Acceptance_type int64  `json:"acceptanceType,optional"`
-	Status          int64  `json:"status,optional"`
-	Over_time       string `json:"overTime,optional"`
-	Remark          string `json:"remark,optional"`
-	PositionId      int64  `header:"positionId,optional"`
-	DeptId          string `header:"entDeptId,optional"` //部门id
-	EntUserName     string `header:"entUserName,optional"`
-	ParamData       string `json:"paramData,optional"`
+type BiResp struct {
+	Error_code int64       `json:"error_code"` //响应代码
+	Error_msg  string      `json:"error_msg"`  //响应消息
+	Data       interface{} `json:"data"`
 }
 
-type CreateClueReq struct {
-	AppId      string `header:"appId,default=10000"`
-	UserId     string `header:"userId,optional"`
-	BaseUserId int64  `header:"newUserId"`
+type CallReq struct {
 	PositionId int64  `header:"positionId,optional"`
-	EntUserId  int64  `header:"entUserId,optional"`
 	Phone      string `json:"phone"`
 }
 
-type TransferClueReq struct {
-	UserId     string `header:"userId,optional"`
-	BaseUserId int64  `header:"newUserId"`
-	PositionId int64  `header:"positionId,optional"`
-	EntUserId  int64  `header:"entUserId,optional"`
-	Phone      string `json:"phone"`
-	OrderNo    string `json:"orderNo"`
+type DrawClueReq struct {
+	PositionId int64 `header:"positionId,optional"`
+	Count      int64 `json:"count,optional"`
 }
 
-type FindClueInfoReq struct {
-	UserId     string `header:"userId,optional"`
-	PositionId int64  `header:"positionId,optional"`
-	Phone      string `json:"phone"`
+type GetCompanyTypeReq struct {
+	CompanyName string `json:"companyName"`
+}
+
+type GetInfoIdReq struct {
+	PositionId int64 `header:"positionId,optional"`
+}
+
+type MyDataAssetReq struct {
+	UserId    string `header:"userId,optional"`
+	NewUserId int64  `header:"newUserId,optional"`
+	EntUserId int64  `header:"entUserId,optional"`
 }

+ 4 - 0
entity/clue.go

@@ -0,0 +1,4 @@
+package entity
+
+type ClueRepeatData struct {
+}

+ 1 - 1
go.mod

@@ -14,6 +14,7 @@ require (
 	github.com/tjfoc/gmsm v1.4.1
 	github.com/xuri/excelize/v2 v2.8.0
 	github.com/zeromicro/go-zero v1.6.1
+	go.mongodb.org/mongo-driver v1.13.1
 	google.golang.org/grpc v1.60.0
 	google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1
 )
@@ -96,7 +97,6 @@ require (
 	go.etcd.io/etcd/api/v3 v3.5.11 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.11 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.11 // indirect
-	go.mongodb.org/mongo-driver v1.13.1 // indirect
 	go.opentelemetry.io/otel v1.19.0 // indirect
 	go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect

+ 0 - 7
go.sum

@@ -1,6 +1,5 @@
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d h1:WPsYuuptAd3UEgN+jPzpnsDe/OvcshDUUtOTZPYGSJ8=
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d/go.mod h1:91/lSD/hS+ckMVP3WdidRzDhC60lLMdyce9QHy0cSMA=
-app.yhyue.com/moapp/jyInfo v1.0.0/go.mod h1:+RjyGNvk7PT1P8cglkVlaj1lLlBXuPB+f5LipoOtgPs=
 app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547 h1:cCmWQW8DUBD2nuZNDz9aIe6MrlioxTbdaA2YiJhlzjY=
 app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547/go.mod h1:JvIs8uKjdT963+7JnZGIEcL4ctBiBjwkoz0kNyigE78=
 app.yhyue.com/moapp/jyPoints v1.1.2-0.20231020023521-1a4b1bbf9736 h1:7Vl3qq1nJZyRQNyMDoCTC14ScKABZqbUmJP0WpOLnIQ=
@@ -10,8 +9,6 @@ app.yhyue.com/moapp/jybase v0.0.0-20220418104200-46c3fff161c7/go.mod h1:qNRA0sHu
 app.yhyue.com/moapp/jybase v0.0.0-20220420032112-668025915ee4/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
 app.yhyue.com/moapp/jybase v0.0.0-20220421060131-a1001013ba46/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jybase v0.0.0-20240205092729-2959d78b7619 h1:rzjJ4pK1P+DcoOYA4+hCOJUoLdSInQa3EHsYY2DKWqA=
-app.yhyue.com/moapp/jybase v0.0.0-20240205092729-2959d78b7619/go.mod h1:fjaD11Z3FIk9EyfOpdKAMQNs7nPZCpT/qKIw1oVsb9w=
 app.yhyue.com/moapp/jybase v0.0.0-20240523083821-42a82b37ae20 h1:F1ZHkzo7yHp5eNrZDqQxaXMIKFQU72bsI1dMq3ztJLA=
 app.yhyue.com/moapp/jybase v0.0.0-20240523083821-42a82b37ae20/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
 app.yhyue.com/moapp/jypkg v1.13.3 h1:qJdzwbjoddEZW2e96OqUypUz356/aVXlAqJn2kmeksE=
@@ -196,7 +193,6 @@ github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGE
 github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
 github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
 github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
-github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
 github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
 github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
 github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -224,7 +220,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
 github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
 github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
 github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
@@ -385,7 +380,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
 github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
-github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -1202,7 +1196,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
 google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
 google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=

+ 11 - 11
rpc/etc/biservice.yaml

@@ -9,14 +9,14 @@ Mode: test
 Mysql:
   JianYu:
     DBName: jianyu
-    Address: 192.168.3.14:4000
+    Address: 172.20.45.129:4000
     UserName: root
     PassWord: =PDT49#80Z!RVv52_z
     MaxOpenConns: 5
     MaxIdleConns: 5
   JyDoc:
     DBName: jydocs
-    Address: 192.168.3.14:4000
+    Address: 172.20.45.129:4000
     UserName: root
     PassWord: =PDT49#80Z!RVv52_z
     MaxOpenConns: 5
@@ -30,7 +30,7 @@ Mysql:
     MaxIdleConns: 30
   Tidb:
     DBName: base_service
-    Address: 192.168.3.217:4000
+    Address: 172.20.45.129:4000
     UserName: root
     PassWord: =PDT49#80Z!RVv52_z
     MaxOpenConns: 5
@@ -51,7 +51,7 @@ Mysql:
     MaxIdleConns: 5
   BiService:
     DBName: bi_service
-    Address: 192.168.3.217:4000
+    Address: 172.20.45.129:4000
     UserName: root
     PassWord: =PDT49#80Z!RVv52_z
     MaxOpenConns: 5
@@ -65,20 +65,20 @@ Mysql:
     MaxIdleConns: 5
 Mongo:
   Qfw:
-    MongodbAddr: 192.168.3.206:27080
+    MongodbAddr: 172.20.45.129:27002
     DbName: qfw
     Size: 10
   Bidding:
-    MongodbAddr: 192.168.3.206:27080
+    MongodbAddr: 172.20.45.129:27002
     DbName: qfw
     UserName:
     Password:
     Size: 10
   Qyxy:
-    MongodbAddr: 192.168.3.206:27002
+    MongodbAddr: 172.20.45.129:27002
     DbName: mixdata
-    UserName: jyDevGroup
-    Password: jy@DevGroup
+    UserName:
+    Password:
     Size: 10
   PingAn:
     MongodbAddr: 192.168.3.206:27002
@@ -87,7 +87,7 @@ Mongo:
     Password: jy@DevGroup
     Size: 4
 Es:
-  Address: http://192.168.3.241:9205,http://192.168.3.149:9200
+  Address: http://172.20.45.129:9206,http://172.20.45.130:9306
   DbSize: 10
   Version: v7
   UserName: ""
@@ -95,7 +95,7 @@ Es:
   Index: bidding
   IType: bidding
 EntEs:
-  Address: http://192.168.3.241:9205,http://192.168.3.149:9200
+  Address: http://172.20.45.129:9206,http://172.20.45.130:9306
   DbSize: 10
   Version: v7
   UserName: ""

+ 37 - 0
rpc/internal/logic/getclueinfolistlogic.go

@@ -0,0 +1,37 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/biService/service"
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetClueInfoListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetClueInfoListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClueInfoListLogic {
+	return &GetClueInfoListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetClueInfoListLogic) GetClueInfoList(in *pb.ClueInfoReq) (*pb.BiReply, error) {
+	if in.SearchTxt == "" {
+		return &pb.BiReply{
+			ErrorCode: 0,
+			ErrorMsg:  "搜索字段不能为空",
+			Data:      nil,
+		}, nil
+	}
+	res := service.CheckingList(in)
+	return res, nil
+}

+ 116 - 0
service/clueCheckingList.go

@@ -0,0 +1,116 @@
+package service
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"bp.jydev.jianyu360.cn/BaseService/biService/entity"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"math"
+)
+
+type ClueListData struct {
+	List        []*ClueInfo `json:"list"`
+	Count       int64       `json:"count"`
+	HasNextPage bool        `json:"hasNextPage"`
+}
+
+type ClueInfo struct {
+	ClueName         string `json:"cluename"`
+	CompanyNature    int    `json:"company_natural"`   // 公司性质  集团/非集团
+	LockStatus       int    `json:"lock_status"`       // 锁定状态
+	LockPerson       string `json:"lock_person"`       // 锁定人
+	LockTime         string `json:"lock_time"`         // 锁定时间
+	Name             string `json:"name"`              // 联系人
+	SalesPeople      int    `json:"sales_people"`      // 销售人员
+	IsAssign         int    `json:"is_assign"`         // 线索池
+	CustomerDemand   string `json:"customer_demand"`   // 客户需求
+	IntendedProducts string `json:"intended_products"` // 意向产品
+	CustomerBudget   int64  `json:"customer_budget"`   // 客户预算
+	Content          string `json:"content"`           // 最近跟进内容
+	TrailTime        string `json:"trail_time"`        // 最近跟进时间
+	StartTrailTime   string `json:"start_trail_time"`  // 开始跟进时间
+	ClueStatus       string `json:"clue_status"`       // 线索状态
+	//客成
+	SucManager string `json:"suc_manager"` // 客成经理
+	// 企业
+	LegalPerson string `json:"legal_person"` // 法人
+
+	ClueOwn string `json:"clue_own"` // 线索归属
+
+}
+
+func CheckingList(in *pb.ClueInfoReq) *pb.BiReply {
+	sql0 := `SELECT a1.*, a3.name as customer, a4.name as trailstatus_name FROM dwd_f_crm_clue_info a1 LEFT JOIN ent_relation a2 ON a1.cluename = a2.a_name OR a1.cluename = a2.b_name 
+    	LEFT JOIN dwd_f_csm_customer_info a3 ON a1.id = a3.clue_id 
+    	LEFT JOIN dwd_d_crm_trailstatus_code a4 ON a1.trailstatus = a4.code WHERE a1.cluename LIKE '%%%s%%' limit ? offset ?`
+	cq0 := `SELECT COUNT(1) FROM dwd_f_crm_clue_info a1 LEFT JOIN ent_relation a2 ON a1.cluename = a2.a_name OR a1.cluename = a2.b_name WHERE a1.cluename LIKE '%%%s%%'`
+
+	clueListData := &ClueListData{}
+
+	if in.PageSize == 0 {
+		in.PageSize = 10
+	}
+	if in.PageNum == 0 {
+		in.PageNum = 1
+	}
+	rows := entity.JyBiTidb.Query(fmt.Sprintf(sql0, in.SearchTxt), in.PageSize, in.PageNum)
+	var resultList []*ClueInfo
+	for _, m := range *rows {
+		resultList = append(resultList, getClueInfo(m))
+	}
+	clueListData.List = resultList
+	clueListData.Count = entity.JyBiTidb.CountBySql(fmt.Sprintf(cq0, in.SearchTxt))
+	totalPage := int64(math.Ceil(float64(clueListData.Count) / float64(in.PageSize)))
+	if totalPage > in.PageNum {
+		clueListData.HasNextPage = true
+	} else {
+		clueListData.HasNextPage = false
+	}
+	return &pb.BiReply{
+		ErrorCode: 0,
+		ErrorMsg:  "",
+		Data:      gconv.Bytes(resultList),
+	}
+}
+
+func getClueInfo(tmp map[string]interface{}) *ClueInfo {
+	clueInfo := &ClueInfo{
+		ClueName:         common.ObjToString(tmp["clue_name"]),
+		CompanyNature:    common.IntAll(tmp["COMPANY_NATURE"]),
+		LockStatus:       common.IntAll(tmp["lock_status"]),
+		LockTime:         common.ObjToString(tmp["lock_time"]),
+		Name:             common.ObjToString(tmp["name"]),
+		IsAssign:         common.IntAll(tmp["is_assign"]),
+		CustomerDemand:   common.ObjToString(tmp["customer_demand"]),
+		IntendedProducts: common.ObjToString(tmp["intended_products"]),
+		CustomerBudget:   common.Int64All(tmp["customer_budget"]),
+		Content:          common.ObjToString(tmp["content"]),
+		TrailTime:        common.ObjToString(tmp["trail_time"]),
+		SucManager:       common.ObjToString(tmp["customer"]),
+		ClueStatus:       common.ObjToString(tmp["trailstatus_name"]),
+	}
+	clueInfo.LockPerson, _ = getSeatNumber(common.Int64All(tmp["lock_position_id"]))
+	if common.IntAll(tmp["COMPANY_VERIFICATION"]) == 1 {
+		ent, b := entity.MgoQyxy.FindOneByField("qyxy_std", map[string]interface{}{"company_name": clueInfo.ClueName},
+			map[string]interface{}{"legal_person": 1})
+		if b && len(*ent) > 0 {
+			clueInfo.LegalPerson = common.ObjToString((*ent)["legal_person"])
+		}
+	}
+
+	if common.IntAll(tmp["IS_TRANSFER"]) == 1 {
+		clueInfo.ClueOwn = "客户成功组"
+	} else if clueInfo.IsAssign == -1 && tmp["position_id"] == nil {
+		clueInfo.ClueOwn = "销售一部、三部"
+	} else if clueInfo.IsAssign == -4 && tmp["position_id"] == nil {
+		clueInfo.ClueOwn = "/"
+	} else if tmp["position_id"] != nil {
+		info := entity.JyBiTidb.FindOne("dwd_d_crm_department_level_succbi", map[string]interface{}{"position_id": tmp["position_id"]}, "dept_name", "")
+		if info != nil && len(*info) > 0 {
+			clueInfo.ClueOwn = common.ObjToString(tmp["dept_name"])
+		}
+	}
+
+	return clueInfo
+}