Jianghan 9 сар өмнө
parent
commit
caf4ce67bf

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

@@ -13,84 +13,100 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 	server.AddRoutes(
 		[]rest.Route{
 			{
+				// 情报详情
 				Method:  http.MethodPost,
-				Path:    "/networkManage/owner/list",
-				Handler: ownerListHandler(serverCtx),
+				Path:    "/networkManage/infomation/detail",
+				Handler: infoDetailHandler(serverCtx),
 			},
 			{
+				// 初始化设置查看
 				Method:  http.MethodPost,
-				Path:    "/networkManage/network/project/list",
-				Handler: projectListHandler(serverCtx),
+				Path:    "/networkManage/init/findInitInfo",
+				Handler: findInitInfoHandler(serverCtx),
 			},
 			{
+				// 初始化设置
 				Method:  http.MethodPost,
-				Path:    "/networkManage/pr/pname/ass",
-				Handler: PrPnameAssHandler(serverCtx),
+				Path:    "/networkManage/init/updateInitInfo",
+				Handler: updateInitInfoHandler(serverCtx),
 			},
 			{
+				// 人脉库-添加/修改人脉
 				Method:  http.MethodPost,
-				Path:    "/networkManage/pr/project/analyse",
-				Handler: CoopHistoryListHandler(serverCtx),
+				Path:    "/networkManage/network/addOrUpdate",
+				Handler: addOrUpdateHandler(serverCtx),
 			},
 			{
+				// 人脉库-全部人脉项目
 				Method:  http.MethodPost,
-				Path:    "/networkManage/network/addOrUpdate",
-				Handler: addOrUpdateHandler(serverCtx),
+				Path:    "/networkManage/network/allProject",
+				Handler: allProjectHandler(serverCtx),
 			},
 			{
+				// 人脉库-业主名称联想
 				Method:  http.MethodPost,
 				Path:    "/networkManage/network/associate",
 				Handler: associateHandler(serverCtx),
 			},
 			{
+				// 人脉库-列表
 				Method:  http.MethodPost,
-				Path:    "/networkManage/network/allProject",
-				Handler: allProjectHandler(serverCtx),
+				Path:    "/networkManage/network/networkList",
+				Handler: networkListHandler(serverCtx),
 			},
 			{
+				// 人脉可达商机列表
 				Method:  http.MethodPost,
-				Path:    "/networkManage/network/networkList",
-				Handler: networkListHandler(serverCtx),
+				Path:    "/networkManage/network/project/list",
+				Handler: projectListHandler(serverCtx),
 			},
 			{
+				// 可介绍业主合作次数
 				Method:  http.MethodPost,
-				Path:    "/networkManage/infomation/detail",
-				Handler: infoDetailHandler(serverCtx),
+				Path:    "/networkManage/owner/cooperate",
+				Handler: ownerCooperateHandler(serverCtx),
 			},
 			{
+				// 人脉可达潜客业主列表
 				Method:  http.MethodPost,
-				Path:    "/networkManage/pr/project/history",
-				Handler: projectHistoryHandler(serverCtx),
+				Path:    "/networkManage/owner/list",
+				Handler: ownerListHandler(serverCtx),
 			},
 			{
+				// 可介绍业主路径
 				Method:  http.MethodPost,
 				Path:    "/networkManage/owner/route",
 				Handler: ownerRouteHandler(serverCtx),
 			},
 			{
+				// 公关渠道-标讯收藏项目找人脉
 				Method:  http.MethodPost,
-				Path:    "/networkManage/owner/cooperate",
-				Handler: ownerCooperateHandler(serverCtx),
+				Path:    "/networkManage/pr/collect/list",
+				Handler: PrCollectListHandler(serverCtx),
 			},
 			{
+				// 公关渠道-业主监控项目找人脉
 				Method:  http.MethodPost,
 				Path:    "/networkManage/pr/monitor/list",
 				Handler: PrMonitorListHandler(serverCtx),
 			},
 			{
+				// 项目公关渠道分析-项目名称联想
 				Method:  http.MethodPost,
-				Path:    "/networkManage/pr/collect/list",
-				Handler: PrCollectListHandler(serverCtx),
+				Path:    "/networkManage/pr/pname/ass",
+				Handler: PrPnameAssHandler(serverCtx),
 			},
 			{
+				// 项目公关渠道分析-与业主合作历史
 				Method:  http.MethodPost,
-				Path:    "/networkManage/init/findInitInfo",
-				Handler: findInitInfoHandler(serverCtx),
+				Path:    "/networkManage/pr/project/analyse",
+				Handler: CoopHistoryListHandler(serverCtx),
 			},
 			{
+				// 人脉项目分析-业主合作历史
 				Method:  http.MethodPost,
-				Path:    "/networkManage/init/updateInitInfo",
-				Handler: updateInitInfoHandler(serverCtx),
+				Path:    "/networkManage/pr/project/history",
+				Handler: projectHistoryHandler(serverCtx),
 			},
 		},
 	)

+ 2 - 2
api/internal/service/CoopHistoryService.go

@@ -78,7 +78,8 @@ type Cooperate struct {
 
 func GetPrList(req *types.CoopHistoryReq) (result []*ResultData, size_1, size_2, size_3, size_4 int64) {
 	pTmp := ProjectTmp{}
-	err := T.ClickhouseConn.QueryRow(context.TODO(), sql_2_0, req.Pid).ScanStruct(&pTmp)
+	pid := encrypt.CommonDecodeArticle("content", req.Pid)
+	err := T.ClickhouseConn.QueryRow(context.TODO(), sql_2_0, pid).ScanStruct(&pTmp)
 	if err != nil {
 		return nil, 0, 0, 0, 0
 	}
@@ -329,7 +330,6 @@ func LastTimeCoop(buyerId, ent, stype string) (bool, int64) {
 	return near, zbtime
 }
 
-//
 func LastTimeCoopBath(positionId int64, buyerIds, winners, agencys []string) (map[string]map[string]*Cooperate, map[string]map[string]*Cooperate) {
 	if len(buyerIds) > 50 {
 		buyerIds = buyerIds[:50]

+ 111 - 111
api/internal/types/types.go

@@ -1,71 +1,6 @@
 // Code generated by goctl. DO NOT EDIT.
 package types
 
-type Reply struct {
-	Error_code int64       `json:"error_code"`
-	Error_msg  string      `json:"error_msg"`
-	Data       interface{} `json:"data"`
-}
-
-type OwnerListReq struct {
-	PartyA           string `json:"partyA,optional"`           //甲方
-	Supplier         string `json:"supplier,optional"`         //供应商
-	Heterotophy      string `json:"heterotophy,optional"`      //同甲异业
-	Intermediary     string `json:"intermediary,optional"`     //中间人
-	Agency           string `json:"agency,optional"`           //代理机构
-	SearchEntName    string `json:"searchEntName,optional"`    //搜索企业名称
-	SourceType       string `json:"sourceType,optional"`       //搜索类型 1 只看转介绍成功率高2只看已监控的
-	ProcessingStatus string `json:"processingStatus,optional"` //处理状态1未处理2已忽略3已建客户
-	Area             string `json:"area,optional"`             //项目地区
-	PositionId       int64  `header:"positionId,optional"`
-	PageSize         int64  `json:"pageSize,optional"`
-	PageIndex        int64  `json:"pageIndex,optional"`
-	ProjectType      string `json:"projectType,optional"`
-	EntAccountId     int64  `header:"entAccountId"`
-	EntId            int64  `header:"entId,optional"`
-	MgoUserId        string `header:"mgoUserId,optional"` //原userId
-}
-
-type ProjectListReq struct {
-	UserId       string `header:"userId,optional"`
-	PositionId   int64  `header:"positionId,optional"`
-	EntId        string `header:"entId,optional"`
-	EntUserId    string `header:"entUserId,optional"`
-	DeptId       string `header:"deptId,optional"`     //部门id
-	PartyA       string `json:"partyA,optional"`       //甲方
-	Supplier     string `json:"supplier,optional"`     //供应商
-	Heterotophy  string `json:"heterotophy,optional"`  //同甲异业
-	Intermediary string `json:"intermediary,optional"` //中间人
-	Agency       string `json:"agency,optional"`       //代理机构
-	PageNum      int    `json:"pageNum"`
-	PageSize     int    `json:"pageSize"`
-	BusinessType string `json:"businessType"`
-	SaleStatus   string `json:"saleStatus"`
-	ProjectName  string `json:"projectName,optional"`
-	StartTime    int64  `json:"startTime,optional"`
-	EntTime      int64  `json:"entTime,optional"`
-	Area         string `json:"area,optional"`
-	City         string `json:"city,optional"`
-	District     string `json:"district,optional"`
-	PropertyForm string `json:"propertyForm,optional"`
-	SubClass     string `json:"subClass,optional"`
-	Amount       string `json:"amount,optional"`
-}
-
-type PnameAssReq struct {
-	ProjectName string `json:"projectName"`
-}
-
-type CoopHistoryReq struct {
-	EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
-	PositionId   int64  `header:"positionId,optional"`
-	EntId        string `header:"entId,optional"`
-	EntUserId    string `header:"entUserId,optional"`
-	DeptId       string `header:"deptId,optional"` //部门id
-	Pid          string `json:"projectId"`
-	ChannelType  string `json:"channelType"`
-}
-
 type AddOrUpdateReq struct {
 	PositionId              int64  `header:"positionId"`
 	EntUserId               int64  `header:"entUserId,optional"`
@@ -85,6 +20,16 @@ type AddOrUpdateReq struct {
 	Type                    string `json:"type"`
 }
 
+type AllprojectReq struct {
+	EntId        int64  `header:"entId"`
+	MgoUserId    string `header:"mgoUserId"`
+	EntAccountId int64  `header:"entAccountId"`
+	PositionId   int64  `header:"positionId"`
+	Name         string `json:"name,optional"`
+	Type         string `json:"type,optional"`
+	Id           string `json:"id,optional"`
+}
+
 type AssociateReq struct {
 	EntId        int64  `header:"entId"`
 	MgoUserId    string `header:"mgoUserId"`
@@ -94,14 +39,37 @@ type AssociateReq struct {
 	Type         string `json:"type"`
 }
 
-type AllprojectReq struct {
-	EntId        int64  `header:"entId"`
-	MgoUserId    string `header:"mgoUserId"`
-	EntAccountId int64  `header:"entAccountId"`
-	PositionId   int64  `header:"positionId"`
-	Name         string `json:"name,optional"`
-	Type         string `json:"type,optional"`
-	Id           string `json:"id,optional"`
+type CoopHistoryReq struct {
+	EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
+	PositionId   int64  `header:"positionId,optional"`
+	EntId        string `header:"entId,optional"`
+	EntUserId    string `header:"entUserId,optional"`
+	DeptId       string `header:"deptId,optional"` //部门id
+	Pid          string `json:"projectId"`
+	ChannelType  string `json:"channelType"`
+}
+
+type CooperateOwnerListReq struct {
+	BuyerId       string `json:"buyerId,optional"`
+	BuyerName     string `json:"buyerName,optional"`
+	WinnerId      string `json:"winnerId,optional"`
+	WinnerName    string `json:"winnerName,optional"`
+	CooperateType string `json:"cooperateType,optional"`
+	PositionId    int64  `header:"positionId,optional"`
+}
+
+type FindInitInfoReq struct {
+	EntId        int64  `header:"entId,optional"`
+	MgoUserId    string `header:"mgoUserId,optional"` //原userId
+	PositionType int64  `header:"positionType,optional"`
+	NewUserId    int64  `header:"newUserId"`
+	AccountId    int64  `header:"accountId,optional"`
+	PositionId   int64  `header:"positionId,optional"`
+	EntUserId    int64  `header:"entUserId,optional"`
+}
+
+type InfoDetailReq struct {
+	InfoId string `json:"infoId"`
 }
 
 type NetWorkListReq struct {
@@ -125,8 +93,44 @@ type NetWorkListReq struct {
 	Monitorcount_end   int64  `json:"monitorcount_end,optional"`
 }
 
-type InfoDetailReq struct {
-	InfoId string `json:"infoId"`
+type OwnerListReq struct {
+	PartyA           string `json:"partyA,optional"`           //甲方
+	Supplier         string `json:"supplier,optional"`         //供应商
+	Heterotophy      string `json:"heterotophy,optional"`      //同甲异业
+	Intermediary     string `json:"intermediary,optional"`     //中间人
+	Agency           string `json:"agency,optional"`           //代理机构
+	SearchEntName    string `json:"searchEntName,optional"`    //搜索企业名称
+	SourceType       string `json:"sourceType,optional"`       //搜索类型 1 只看转介绍成功率高2只看已监控的
+	ProcessingStatus string `json:"processingStatus,optional"` //处理状态1未处理2已忽略3已建客户
+	Area             string `json:"area,optional"`             //项目地区
+	PositionId       int64  `header:"positionId,optional"`
+	PageSize         int64  `json:"pageSize,optional"`
+	PageIndex        int64  `json:"pageIndex,optional"`
+	ProjectType      string `json:"projectType,optional"`
+	EntAccountId     int64  `header:"entAccountId"`
+	EntId            int64  `header:"entId,optional"`
+	MgoUserId        string `header:"mgoUserId,optional"` //原userId
+}
+
+type PnameAssReq struct {
+	ProjectName string `json:"projectName"`
+}
+
+type PrCollectListReq struct {
+	UserId     string `header:"userId,optional"`
+	MgoUserId  string `header:"mgoUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	PageSize   int    `json:"pageSize"`
+	PageNum    int    `json:"pageNum"`
+}
+
+type PrMonitorListReq struct {
+	MgoUserId  string `header:"mgoUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	PageSize   int    `json:"pageSize"`
+	PageNum    int    `json:"pageNum"`
 }
 
 type PrjectHistoryReq struct {
@@ -135,21 +139,44 @@ type PrjectHistoryReq struct {
 	WinnerId string `json:"winnerId"`
 }
 
+type ProjectListReq struct {
+	UserId       string `header:"userId,optional"`
+	PositionId   int64  `header:"positionId,optional"`
+	EntId        string `header:"entId,optional"`
+	EntUserId    string `header:"entUserId,optional"`
+	DeptId       string `header:"deptId,optional"`     //部门id
+	PartyA       string `json:"partyA,optional"`       //甲方
+	Supplier     string `json:"supplier,optional"`     //供应商
+	Heterotophy  string `json:"heterotophy,optional"`  //同甲异业
+	Intermediary string `json:"intermediary,optional"` //中间人
+	Agency       string `json:"agency,optional"`       //代理机构
+	PageNum      int    `json:"pageNum"`
+	PageSize     int    `json:"pageSize"`
+	BusinessType string `json:"businessType"`
+	SaleStatus   string `json:"saleStatus"`
+	ProjectName  string `json:"projectName,optional"`
+	StartTime    int64  `json:"startTime,optional"`
+	EntTime      int64  `json:"entTime,optional"`
+	Area         string `json:"area,optional"`
+	City         string `json:"city,optional"`
+	District     string `json:"district,optional"`
+	PropertyForm string `json:"propertyForm,optional"`
+	SubClass     string `json:"subClass,optional"`
+	Amount       string `json:"amount,optional"`
+}
+
+type Reply struct {
+	Error_code int64       `json:"error_code"`
+	Error_msg  string      `json:"error_msg"`
+	Data       interface{} `json:"data"`
+}
+
 type RouteOwnerListReq struct {
 	BuyerId    string `json:"buyerId,optional"`
 	BuyerName  string `json:"buyerName,optional"`
 	PositionId int64  `header:"positionId,optional"`
 }
 
-type CooperateOwnerListReq struct {
-	BuyerId       string `json:"buyerId,optional"`
-	BuyerName     string `json:"buyerName,optional"`
-	WinnerId      string `json:"winnerId,optional"`
-	WinnerName    string `json:"winnerName,optional"`
-	CooperateType string `json:"cooperateType,optional"`
-	PositionId    int64  `header:"positionId,optional"`
-}
-
 type UpdateInitInfoReq struct {
 	Business     string `json:"business,optional"`
 	Company      string `json:"company,optional"`
@@ -164,30 +191,3 @@ type UpdateInitInfoReq struct {
 	EntName      string `header:"entName,optional"`
 	EntDeptId    int64  `header:"entDeptId,optional"`
 }
-
-type FindInitInfoReq struct {
-	EntId        int64  `header:"entId,optional"`
-	MgoUserId    string `header:"mgoUserId,optional"` //原userId
-	PositionType int64  `header:"positionType,optional"`
-	NewUserId    int64  `header:"newUserId"`
-	AccountId    int64  `header:"accountId,optional"`
-	PositionId   int64  `header:"positionId,optional"`
-	EntUserId    int64  `header:"entUserId,optional"`
-}
-
-type PrMonitorListReq struct {
-	MgoUserId  string `header:"mgoUserId,optional"`
-	PositionId int64  `header:"positionId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	PageSize   int    `json:"pageSize"`
-	PageNum    int    `json:"pageNum"`
-}
-
-type PrCollectListReq struct {
-	UserId     string `header:"userId,optional"`
-	MgoUserId  string `header:"mgoUserId,optional"`
-	PositionId int64  `header:"positionId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	PageSize   int    `json:"pageSize"`
-	PageNum    int    `json:"pageNum"`
-}

+ 30 - 29
api/networkmanage.api

@@ -7,15 +7,15 @@ type (
 		Data       interface{} `json:"data"`
 	}
 	OwnerListReq {
-		PartyA           string `json:"partyA,optional"`           //甲方
-		Supplier         string `json:"supplier,optional"`         //供应商
-		Heterotophy      string `json:"heterotophy,optional"`      //同甲异业
-		Intermediary     string `json:"intermediary,optional"`     //中间人
-		Agency           string `json:"agency,optional"`           //代理机构
-		SearchEntName    string `json:"searchEntName,optional"`    //搜索企业名称
-		SourceType       string `json:"sourceType,optional"`       //搜索类型 1 只看转介绍成功率高2只看已监控的
+		PartyA           string `json:"partyA,optional"` //甲方
+		Supplier         string `json:"supplier,optional"` //供应商
+		Heterotophy      string `json:"heterotophy,optional"` //同甲异业
+		Intermediary     string `json:"intermediary,optional"` //中间人
+		Agency           string `json:"agency,optional"` //代理机构
+		SearchEntName    string `json:"searchEntName,optional"` //搜索企业名称
+		SourceType       string `json:"sourceType,optional"` //搜索类型 1 只看转介绍成功率高2只看已监控的
 		ProcessingStatus string `json:"processingStatus,optional"` //处理状态1未处理2已忽略3已建客户
-		Area             string `json:"area,optional"`             //项目地区
+		Area             string `json:"area,optional"` //项目地区
 		PositionId       int64  `header:"positionId,optional"`
 		PageSize         int64  `json:"pageSize,optional"`
 		PageIndex        int64  `json:"pageIndex,optional"`
@@ -29,12 +29,12 @@ type (
 		PositionId   int64  `header:"positionId,optional"`
 		EntId        string `header:"entId,optional"`
 		EntUserId    string `header:"entUserId,optional"`
-		DeptId       string `header:"deptId,optional"`     //部门id
-		PartyA       string `json:"partyA,optional"`       //甲方
-		Supplier     string `json:"supplier,optional"`     //供应商
-		Heterotophy  string `json:"heterotophy,optional"`  //同甲异业
+		DeptId       string `header:"deptId,optional"` //部门id
+		PartyA       string `json:"partyA,optional"` //甲方
+		Supplier     string `json:"supplier,optional"` //供应商
+		Heterotophy  string `json:"heterotophy,optional"` //同甲异业
 		Intermediary string `json:"intermediary,optional"` //中间人
-		Agency       string `json:"agency,optional"`       //代理机构
+		Agency       string `json:"agency,optional"` //代理机构
 		PageNum      int    `json:"pageNum"`
 		PageSize     int    `json:"pageSize"`
 		BusinessType string `json:"businessType"`
@@ -181,64 +181,65 @@ service networkManage {
 	@doc "人脉可达潜客业主列表"
 	@handler ownerList
 	post /networkManage/owner/list (OwnerListReq) returns (Reply)
-	
+
 	@doc "人脉可达商机列表"
 	@handler projectList
 	post /networkManage/network/project/list (ProjectListReq) returns (Reply)
-	
+
 	@doc "项目公关渠道分析-项目名称联想"
 	@handler PrPnameAss
 	post /networkManage/pr/pname/ass (PnameAssReq) returns (Reply)
-	
+
 	@doc "项目公关渠道分析-与业主合作历史"
 	@handler CoopHistoryList
 	post /networkManage/pr/project/analyse (CoopHistoryReq) returns (Reply)
-	
+
 	@doc "人脉库-添加/修改人脉"
 	@handler addOrUpdate
 	post /networkManage/network/addOrUpdate (AddOrUpdateReq) returns (Reply)
-	
+
 	@doc "人脉库-业主名称联想"
 	@handler associate
 	post /networkManage/network/associate (AssociateReq) returns (Reply)
-	
+
 	@doc "人脉库-全部人脉项目"
 	@handler allProject
 	post /networkManage/network/allProject (AllprojectReq) returns (Reply)
-	
+
 	@doc "人脉库-列表"
 	@handler networkList
 	post /networkManage/network/networkList (NetWorkListReq) returns (Reply)
-	
+
 	@doc "情报详情"
 	@handler infoDetail
 	post /networkManage/infomation/detail (InfoDetailReq) returns (Reply)
-	
+
 	@doc "人脉项目分析-业主合作历史"
 	@handler projectHistory
 	post /networkManage/pr/project/history (PrjectHistoryReq) returns (Reply)
-	
+
 	@doc "可介绍业主路径"
 	@handler ownerRoute
 	post /networkManage/owner/route (RouteOwnerListReq) returns (Reply)
-	
+
 	@doc "可介绍业主合作次数"
 	@handler ownerCooperate
 	post /networkManage/owner/cooperate (CooperateOwnerListReq) returns (Reply)
-	
+
 	@doc "公关渠道-业主监控项目找人脉"
 	@handler PrMonitorList
 	post /networkManage/pr/monitor/list (PrMonitorListReq) returns (Reply)
-	
+
 	@doc "公关渠道-标讯收藏项目找人脉"
 	@handler PrCollectList
 	post /networkManage/pr/collect/list (PrCollectListReq) returns (Reply)
-	
+
 	@doc "初始化设置查看"
 	@handler findInitInfo
 	post /networkManage/init/findInitInfo (FindInitInfoReq) returns (Reply)
-	
+
 	@doc "初始化设置"
 	@handler updateInitInfo
 	post /networkManage/init/updateInitInfo (UpdateInitInfoReq) returns (Reply)
-}
+}
+