浏览代码

feat:人脉通

wangchuanjin 1 年之前
父节点
当前提交
feb1e78ec7

+ 131 - 89
api/application.api

@@ -20,15 +20,15 @@ type (
 		EntId        int64   `header:"entId,optional"`
 		AccountId    int64   `header:"accountId,optional"`
 		EntDeptId    int64   `header:"entDeptId,optional"`
-		CluesSource  string  `json:"cluesSource"` //线索来源
-		ClueName     string  `json:"clueName"` //线索名称
-		Summary      string  `json:"summary"` //概要信息
+		CluesSource  string  `json:"cluesSource"`           //线索来源
+		ClueName     string  `json:"clueName"`              //线索名称
+		Summary      string  `json:"summary"`               //概要信息
 		FollowUpTime int64   `json:"followUpTime,optional"` //下次跟进时间(时间戳)
-		Types        int64   `json:"types"` //处理方式 1自办;2转办;3待处理
-		User         []int64 `json:"user,optional"` //企业用户id
+		Types        int64   `json:"types"`                 //处理方式 1自办;2转办;3待处理
+		User         []int64 `json:"user,optional"`         //企业用户id
 		EmployInfoId int64   `json:"employInfoId,optional"` //资讯收录id
-		CreateName   string  `json:"createName"` //创建人
-		Channel      string  `json:"channel"` //渠道来源:网页、手动创建
+		CreateName   string  `json:"createName"`            //创建人
+		Channel      string  `json:"channel"`               //渠道来源:网页、手动创建
 	}
 	SaleChanceReq {
 		AppId             string  `header:"appId,default=10000"`
@@ -38,23 +38,23 @@ type (
 		EntId             int64   `header:"entId,optional"`
 		AccountId         int64   `header:"accountId,optional"`
 		EntDeptId         int64   `header:"entDeptId,optional"`
-		ChanceName        string  `json:"chanceName"` //机会名称
-		Summary           string  `json:"summary"` //概要信息
-		ChanceClassify    int64   `json:"chanceClassify"` //机会分类
+		ChanceName        string  `json:"chanceName"`                 //机会名称
+		Summary           string  `json:"summary"`                    //概要信息
+		ChanceClassify    int64   `json:"chanceClassify"`             //机会分类
 		ExpectedOrderTime int64   `json:"expectedOrderTime,optional"` //最初预计落单段时间 时间戳
-		ExpectedMoney     float64 `json:"expectedMoney,optional"` //最初预计落单金额
-		CustomName        string  `json:"customName"` //客户全称
-		BusinessType      int64   `json:"businessType"` //业务类型  1新客户需求 2老客户需求 3简易项目流程
-		Remarks           string  `json:"remarks,optional"` //备注
-		NextfollowUpTime  int64   `json:"nextfollowUpTime,optional"` //下次跟进时间戳
-		Types             int64   `json:"types"` //处理方式 1自办;2转办;3待处理
-		User              []int64 `json:"user,optional"` //企业用户id
-		EmployInfoId      int64   `json:"employInfoId,optional"` //资讯收录id
-		CustomId          int64   `json:"customId,optional"` //客户id
-		CreateName        string  `json:"createName"` //创建人
-		ChanceSource      int64   `json:"chanceSource"` //机会来源
-		OwnerId           int64   `json:"ownerId,optional"` //潜客收录id(人脉)
-		BusinessId        int64   `json:"businessId,optional"` //商机收录id(人脉)
+		ExpectedMoney     float64 `json:"expectedMoney,optional"`     //最初预计落单金额
+		CustomName        string  `json:"customName"`                 //客户全称
+		BusinessType      int64   `json:"businessType"`               //业务类型  1新客户需求 2老客户需求 3简易项目流程
+		Remarks           string  `json:"remarks,optional"`           //备注
+		NextfollowUpTime  int64   `json:"nextfollowUpTime,optional"`  //下次跟进时间戳
+		Types             int64   `json:"types"`                      //处理方式 1自办;2转办;3待处理
+		User              []int64 `json:"user,optional"`              //企业用户id
+		EmployInfoId      int64   `json:"employInfoId,optional"`      //资讯收录id
+		CustomId          int64   `json:"customId,optional"`          //客户id
+		CreateName        string  `json:"createName"`                 //创建人
+		ChanceSource      int64   `json:"chanceSource"`               //机会来源
+		OwnerId           int64   `json:"ownerId,optional"`           //潜客收录id(人脉)
+		BusinessId        int64   `json:"businessId,optional"`        //商机收录id(人脉)
 	}
 	EmployOperateReq {
 		AppId      string `header:"appId,default=10000"`
@@ -62,8 +62,8 @@ type (
 		PositionId int64  `header:"positionId,optional"`
 		EntUserId  int64  `header:"entUserId,optional"`
 		EntId      int64  `header:"entId,optional"`
-		IdArr      string `json:"idArr"` //信息id多条信息
-		IsEmploy   bool   `json:"isEmploy"` //是否收录true收录 false取消收录
+		IdArr      string `json:"idArr"`      //信息id多条信息
+		IsEmploy   bool   `json:"isEmploy"`   //是否收录true收录 false取消收录
 		EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
 		EntDeptId  int64  `header:"entDeptId,optional"`
 		From       string `json:"from,optional"` //来源
@@ -83,8 +83,8 @@ type (
 		PositionId int64  `header:"positionId,optional"`
 		EntUserId  int64  `header:"entUserId,optional"`
 		EntId      int64  `header:"entId,optional"`
-		IdArr      string `json:"idArr"` //id集合
-		IsIgnore   bool   `json:"isIgnore"` //是否忽略 true 忽略 false取消忽略
+		IdArr      string `json:"idArr"`      //id集合
+		IsIgnore   bool   `json:"isIgnore"`   //是否忽略 true 忽略 false取消忽略
 		EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
 	}
 	InfoEmployinfoReq {
@@ -94,13 +94,13 @@ type (
 		EntUserId    int64  `header:"entUserId,optional"`
 		EntId        int64  `header:"entId,optional"`
 		EmployType   int64  `json:"employType"` //1标采购、2企业、3采购单位、4拟在建项目
-		IdArr        string `json:"idArr"` //id
+		IdArr        string `json:"idArr"`      //id
 		EntNicheDis  int64  `header:"entNicheDis,optional"`
 		EntDeptId    int64  `header:"entDeptId,optional"`
 		PositionType int64  `header:"positionType,optional"` //职位类型 0个人 1企业
-		AccountId    int64  `header:"accountId,optional"` //账户id
+		AccountId    int64  `header:"accountId,optional"`    //账户id
 		EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
-		From         string `json:"from,optional"` //来源
+		From         string `json:"from,optional"`           //来源
 	}
 	CustomAddReq {
 		AppId                string  `header:"appId,default=10000"`
@@ -110,28 +110,28 @@ type (
 		EntId                int64   `header:"entId,optional"`
 		AccountId            int64   `header:"accountId,optional"`
 		EntDeptId            int64   `header:"entDeptId,optional"`
-		CustomType           int64   `json:"customType"` //客户类型
-		Summary              string  `json:"summary"` //概要信息
-		CustomAllName        string  `json:"customAllName"` //客户全称
-		CustomAbbreviation   string  `json:"customAbbreviation"` //客户简称
-		CustomLevel          int64   `json:"customLevel,optional"` //客户级别
-		CustomIndustry       int64   `json:"customIndustry"` //客户行业
-		CustomDetailIndustry int64   `json:"customDetailIndustry"` //客户细分行业
-		Province             string  `json:"province,optional"` //省份
-		City                 string  `json:"city,optional"` //城市
-		District             string  `json:"district,optional"` //地区
-		Address              string  `json:"address,optional"` //详细地址
-		CompanyPhone         string  `json:"companyPhone,optional"` //公司电话
-		NextfollowUpTime     int64   `json:"nextfollowUpTime,optional"` //下次跟进时间戳
-		Types                int64   `json:"types"` //处理方式 1自办;2转办
-		User                 []int64 `json:"user,optional"` //转办用户
+		CustomType           int64   `json:"customType"`                       //客户类型
+		Summary              string  `json:"summary"`                          //概要信息
+		CustomAllName        string  `json:"customAllName"`                    //客户全称
+		CustomAbbreviation   string  `json:"customAbbreviation"`               //客户简称
+		CustomLevel          int64   `json:"customLevel,optional"`             //客户级别
+		CustomIndustry       int64   `json:"customIndustry"`                   //客户行业
+		CustomDetailIndustry int64   `json:"customDetailIndustry"`             //客户细分行业
+		Province             string  `json:"province,optional"`                //省份
+		City                 string  `json:"city,optional"`                    //城市
+		District             string  `json:"district,optional"`                //地区
+		Address              string  `json:"address,optional"`                 //详细地址
+		CompanyPhone         string  `json:"companyPhone,optional"`            //公司电话
+		NextfollowUpTime     int64   `json:"nextfollowUpTime,optional"`        //下次跟进时间戳
+		Types                int64   `json:"types"`                            //处理方式 1自办;2转办
+		User                 []int64 `json:"user,optional"`                    //转办用户
 		EmployCustomId       int64   `json:"employCustomId,optional,optional"` //客户收录id
-		EmployInfoId         int64   `json:"employInfoId,optional,optional"` //资讯收录id
-		Remarks              string  `json:"remarks,optional"` //备注
-		CreateName           string  `json:"createName"` //创建人
-		Source               string  `json:"source,optional"` //来源
-		OwnerId              int64   `json:"ownerId,optional"` //潜客收录id(人脉)
-		BusinessId           int64   `json:"businessId,optional"` //商机收录id(人脉)
+		EmployInfoId         int64   `json:"employInfoId,optional,optional"`   //资讯收录id
+		Remarks              string  `json:"remarks,optional"`                 //备注
+		CreateName           string  `json:"createName"`                       //创建人
+		Source               string  `json:"source,optional"`                  //来源
+		OwnerId              int64   `json:"ownerId,optional"`                 //潜客收录id(人脉)
+		BusinessId           int64   `json:"businessId,optional"`              //商机收录id(人脉)
 	}
 	FileUploadReq {
 		AppId      string `header:"appId,default=10000"`
@@ -140,8 +140,8 @@ type (
 		EntUserId  int64  `header:"entUserId,optional"`
 		EntId      int64  `header:"entId,optional"`
 		BusinessId int64  `form:"businessId"` //业务id
-		Types      int64  `form:"type"` //类型;1:跟进记录-线下 2:跟进记录-线上 3:跟进记录-备忘 4:销售机会-项目文档 5:客户-客户档案
-		FileType   int64  `form:"fileType"` //文件类型,产品介绍、项目方案、立项报告、报价文件、招标文件、投标文件、中标通知书、合同、发票、其他文件
+		Types      int64  `form:"type"`       //类型;1:跟进记录-线下 2:跟进记录-线上 3:跟进记录-备忘 4:销售机会-项目文档 5:客户-客户档案
+		FileType   int64  `form:"fileType"`   //文件类型,产品介绍、项目方案、立项报告、报价文件、招标文件、投标文件、中标通知书、合同、发票、其他文件
 	}
 	EmployDistributeReq {
 		AppId       string             `header:"appId,default=10000"`
@@ -168,12 +168,12 @@ type (
 		PositionId int64   `header:"positionId,optional"`
 		EntUserId  int64   `header:"entUserId,optional"`
 		EntId      int64   `header:"entId,optional"`
-		Title      string  `json:"title"` //标题
-		Content    string  `json:"content"` //内容
-		PcHref     string  `json:"pcHref"` //pc跳转地址
-		MobileHref string  `json:"mobileHref"` //移动端跳转地址
+		Title      string  `json:"title"`         //标题
+		Content    string  `json:"content"`       //内容
+		PcHref     string  `json:"pcHref"`        //pc跳转地址
+		MobileHref string  `json:"mobileHref"`    //移动端跳转地址
 		User       []int64 `json:"user,optional"` //企业用户id
-		MsgType    string  `json:"msgType"` //消息类型 1-活动优惠 2-服务通知 3-订阅消息 4-项目动态 5-企业动态 6-分析报告 7-系统通知 11-待办
+		MsgType    string  `json:"msgType"`       //消息类型 1-活动优惠 2-服务通知 3-订阅消息 4-项目动态 5-企业动态 6-分析报告 7-系统通知 11-待办
 	}
 	CanAddReq {
 		AppId          string `header:"appId,default=10000"`
@@ -183,24 +183,24 @@ type (
 		EntId          int64  `header:"entId,optional"`
 		AccountId      int64  `header:"accountId,optional"`
 		EntDeptId      int64  `header:"entDeptId,optional"`
-		EmployInfoId   int64  `json:"employInfoId"` //资讯收录id
+		EmployInfoId   int64  `json:"employInfoId"`            //资讯收录id
 		EmployCustomId int64  `json:"employCustomId,optional"` //客户收录id
-		Key            string `json:"key"` //创建线索:more_create_clue 创建机会:more_create_chance 创建客户:more_create_custom
+		Key            string `json:"key"`                     //创建线索:more_create_clue 创建机会:more_create_chance 创建客户:more_create_custom
 	}
 	ProjectListReq {
-		pageNum      int64  `json:"pageNum"`
-		pageSize     int64  `json:"pageSize"`
-		businessType string `json:"businessType"`
-		saleStatus   string `json:"saleStatus"`
-		projectName  string `json:"projectName"`
-		startTime    int64  `json:"startTime"`
-		entTime      int64  `json:"entTime"`
-		area         string `json:"area"`
-		city         string `json:"city"`
-		district     string `json:"district"`
-		propertyForm string `json:"propertyForm"`
-		subClass     string `json:"subClass"`
-		amount       string `json:"amount"`
+		PageNum      int64  `json:"pageNum"`
+		PageSize     int64  `json:"pageSize"`
+		BusinessType string `json:"businessType"`
+		SaleStatus   string `json:"saleStatus"`
+		ProjectName  string `json:"projectName"`
+		StartTime    int64  `json:"startTime"`
+		EntTime      int64  `json:"entTime"`
+		Area         string `json:"area"`
+		City         string `json:"city"`
+		District     string `json:"district"`
+		PropertyForm string `json:"propertyForm"`
+		SubClass     string `json:"subClass"`
+		Amount       string `json:"amount"`
 	}
 	PnameAssReq {
 		ProjectName string `json:"projectName"`
@@ -208,6 +208,33 @@ type (
 	CoopHistoryReq {
 		Pid string `json:"porjectId"`
 	}
+	AddOrUpdateReq {
+		PositionId             int64  `header:"positionId"`
+		EntUserId              int64  `header:"entUserId,optional"`
+		EntId                  int64  `header:"entId,optional"`
+		EntDeptId              int64  `header:"entDeptId,optional"`
+		Company_id             string `json:"company_id,optional"`
+		Company_name           string `json:"company_name,optional"`
+		Contact_person         string `json:"contact_person,optional"`
+		Contact_phone          string `json:"contact_phone,optional"`
+		Introduce_owner_id     string `json:"introduce_owner_id,optional"`
+		Introduce_owner_name   string `json:"introduce_owner_name,optional"`
+		Introduce_project_id   string `json:"introduce_project_id,optional"`
+		Introduce_project_name string `json:"introduce_project_name,optional"`
+		Id                     string `json:"id,optional"`
+		Type                   string `json:"type,optional"`
+	}
+	AssociateReq {
+		Name string `json:"name"`
+		Type string `json:"type"`
+	}
+	AllprojectReq {
+		PositionId int64  `header:"positionId"`
+		Name       string `json:"name,optional"`
+	}
+	NetWorkListReq {
+		PositionId int64 `header:"positionId"`
+	}
 )
 
 @server (
@@ -218,61 +245,76 @@ service crmApplication {
 	@doc "添加线索"
 	@handler clueAdd
 	post /crmApplication/clue/add (ClueAddReq) returns (Reply)
-
+	
 	@doc "创建销售机会"
 	@handler saleChanceAdd
 	post /crmApplication/saleChance/add (SaleChanceReq) returns (Reply)
-
+	
 	@doc "收录操作"
 	@handler employOperate
 	post /crmApplication/employ/operate (EmployOperateReq) returns (Reply)
-
+	
 	@doc "商业资讯的转办"
 	@handler transfer
 	post /crmApplication/information/transfer (TransferReq) returns (Reply)
-
+	
 	@doc "忽略操作"
 	@handler ignoreOperate
 	post /crmApplication/ignore/operate (IgnoreOperateReq) returns (Reply)
-
+	
 	@doc "收录情况"
 	@handler employInfo
 	post /crmApplication/employ/info (InfoEmployinfoReq) returns (InfoReply)
-
+	
 	@doc "创建客户"
 	@handler customAdd
 	post /crmApplication/custom/add (CustomAddReq) returns (Reply)
-
+	
 	@doc "文件上传"
 	@handler fileUpload
 	post /crmApplication/file/upload (FileUploadReq) returns (Reply)
-
+	
 	@doc "分发"
 	@handler employDistribute
 	post /crmApplication/employ/distribute (EmployDistributeReq) returns (Reply)
-
+	
 	@doc "企业详情"
 	@handler entinfo
 	post /crmApplication/ent/info (EntInfoReq) returns (Reply)
-
+	
 	@doc "消息推送"
 	@handler pushMsg
 	post /crmApplication/info/push (PushMsgReq) returns (Reply)
-
+	
 	@doc "是否可以创建"
 	@handler canAddReq
 	post /crmApplication/info/canAdd (CanAddReq) returns (Reply)
-
+	
 	@doc "人脉可达商机列表"
 	@handler projectList
 	post /crmApplication/network/project/list (ProjectListReq) returns (Reply)
-
+	
 	@doc "项目公关渠道分析-项目名称联想"
 	@handler PrPnameAss
 	post /crmApplication/pr/pname/ass (PnameAssReq) returns (Reply)
-
+	
 	@doc "项目公关渠道分析-与业主合作历史"
 	@handler CoopHistoryList
 	post /crmApplication/pr/coop/history (CoopHistoryReq) returns (Reply)
-}
-
+	
+	@doc "人脉库-添加/修改人脉"
+	@handler addOrUpdate
+	post /crmApplication/network/addOrUpdate (AddOrUpdateReq) returns (Reply)
+	
+	@doc "人脉库-业主名称联想"
+	@handler associate
+	post /crmApplication/network/associate (AssociateReq) returns (Reply)
+	
+	@doc "人脉库-全部人脉项目"
+	@handler allproject
+	post /crmApplication/network/allproject (AllprojectReq) returns (Reply)
+	
+	@doc "人脉库-列表"
+	@handler list
+	post /crmApplication/network/list (NetWorkListReq) returns (Reply)
+}

+ 28 - 0
api/internal/handler/addorupdatehandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/logic"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func addOrUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AddOrUpdateReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAddOrUpdateLogic(r.Context(), svcCtx)
+		resp, err := l.AddOrUpdate(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/allprojecthandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/logic"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func allprojectHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AllprojectReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAllprojectLogic(r.Context(), svcCtx)
+		resp, err := l.Allproject(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/associatehandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/logic"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func associateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AssociateReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewAssociateLogic(r.Context(), svcCtx)
+		resp, err := l.Associate(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/listhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/logic"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func listHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.NetWorkListReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewListLogic(r.Context(), svcCtx)
+		resp, err := l.List(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 40 - 21
api/internal/handler/routes.go

@@ -19,28 +19,33 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/custom/add",
-				Handler: customAddHandler(serverCtx),
+				Path:    "/crmApplication/saleChance/add",
+				Handler: saleChanceAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/distribute",
-				Handler: employDistributeHandler(serverCtx),
+				Path:    "/crmApplication/employ/operate",
+				Handler: employOperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/info",
-				Handler: employInfoHandler(serverCtx),
+				Path:    "/crmApplication/information/transfer",
+				Handler: transferHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/operate",
-				Handler: employOperateHandler(serverCtx),
+				Path:    "/crmApplication/ignore/operate",
+				Handler: ignoreOperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/ent/info",
-				Handler: entinfoHandler(serverCtx),
+				Path:    "/crmApplication/employ/info",
+				Handler: employInfoHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/custom/add",
+				Handler: customAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -49,13 +54,13 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/ignore/operate",
-				Handler: ignoreOperateHandler(serverCtx),
+				Path:    "/crmApplication/employ/distribute",
+				Handler: employDistributeHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/info/canAdd",
-				Handler: canAddReqHandler(serverCtx),
+				Path:    "/crmApplication/ent/info",
+				Handler: entinfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -64,14 +69,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/information/transfer",
-				Handler: transferHandler(serverCtx),
+				Path:    "/crmApplication/info/canAdd",
+				Handler: canAddReqHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/crmApplication/network/project/list",
 				Handler: projectListHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/pr/pname/ass",
+				Handler: PrPnameAssHandler(serverCtx),
+			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/crmApplication/pr/coop/history",
@@ -79,15 +89,24 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/pr/pname/ass",
-				Handler: PrPnameAssHandler(serverCtx),
+				Path:    "/crmApplication/network/addOrUpdate",
+				Handler: addOrUpdateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/saleChance/add",
-				Handler: saleChanceAddHandler(serverCtx),
+				Path:    "/crmApplication/network/associate",
+				Handler: associateHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/network/allproject",
+				Handler: allprojectHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/network/list",
+				Handler: listHandler(serverCtx),
 			},
 		},
-		rest.WithMaxBytes(104857600),
 	)
 }

+ 30 - 0
api/internal/logic/addorupdatelogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AddOrUpdateLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAddOrUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddOrUpdateLogic {
+	return &AddOrUpdateLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AddOrUpdateLogic) AddOrUpdate(req *types.AddOrUpdateReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 30 - 0
api/internal/logic/allprojectlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AllprojectLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAllprojectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AllprojectLogic {
+	return &AllprojectLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AllprojectLogic) Allproject(req *types.AllprojectReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 30 - 0
api/internal/logic/associatelogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AssociateLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAssociateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssociateLogic {
+	return &AssociateLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *AssociateLogic) Associate(req *types.AssociateReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 30 - 0
api/internal/logic/listlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic {
+	return &ListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *ListLogic) List(req *types.NetWorkListReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 103 - 0
api/internal/service/network.go

@@ -0,0 +1,103 @@
+package service
+
+import (
+	"database/sql"
+	"strings"
+
+	. "app.yhyue.com/moapp/jybase/date"
+	. "bp.jydev.jianyu360.cn/CRM/application/api/common"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+)
+
+var VarNetwork = &Network{}
+
+type Network struct {
+}
+
+//人脉库-添加/修改人脉
+func (n *Network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
+	reply := &types.Reply{}
+	itype := 0
+	//firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
+	switch in.Type {
+	case "firstparty":
+		itype = 1
+	case "supplier:供应商":
+		itype = 2
+	case "adiffb":
+		itype = 3
+	case "middleman":
+		itype = 4
+	case "agency":
+		itype = 5
+	}
+	nowFormat := NowFormat(Date_Full_Layout)
+	var getValues = func(cid int64) []interface{} {
+		values := []interface{}{}
+		if in.Introduce_owner_id != "" {
+			for k, v := range strings.Split(in.Introduce_owner_id, ",") {
+				values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, strings.Split(in.Introduce_owner_name, ",")[k], 1, nowFormat)
+			}
+		}
+		if in.Introduce_project_id != "" {
+			for k, v := range strings.Split(in.Introduce_project_id, ",") {
+				values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, strings.Split(in.Introduce_project_name, ",")[k], 1, nowFormat)
+			}
+		}
+		return values
+	}
+	if in.Id > 0 {
+		if CrmMysql.ExecTx("更新人脉", func(tx *sql.Tx) bool {
+			r1 := CrmMysql.UpdateOrDeleteBySqlByTx(`update connection set company_name=?,company_id=?,contact_person=?,contact_phone=?,update_time=? where id=? and position_id=?`, in.Company_name, in.Company_id, in.Contact_person, in.Contact_phone, nowFormat, in.Id, in.PositionId)
+			r2 := CrmMysql.UpdateOrDeleteBySqlByTx(`delete from connection_introduce where connection_id=? and position_id=?`, in.Id, in.PositionId)
+			var r3 int64
+			if len(values) > 0 {
+				_, r3 = CrmMysql.InsertBatchByTx(tx, "connection_introduce", []string{"connection_id", "relate_id", "relate_name", "itype", "create_time"}, getValues(r1))
+			}
+			return r1 > 0 && r2 >= 0 && r3 >= 0
+		}) {
+			reply.Data = map[string]interface{}{
+				"status": 1,
+			}
+		} else {
+			reply.Data = map[string]interface{}{
+				"status": 0,
+			}
+		}
+	} else {
+		id := 0
+		if CrmMysql.ExecTx("新增人脉", func(tx *sql.Tx) bool {
+			_, r1 := CrmMysql.InsertBatchByTx(tx, "connection", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "itype", "company_name", "company_id", "position_id", "contact_name", "contact_phone", "status", "create_time", "update_time"}, []interface{}{in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, itype, in.Company_name, in.Company_id, in.Contact_person, in.Contact_phone, 1, nowFormat, nowFormat})
+			var r2 int64
+			if len(values) > 0 {
+				_, r2 = CrmMysql.InsertBatchByTx(tx, "connection_introduce", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "connection_id", "relate_id", "relate_name", "itype", "create_time"}, values)
+			}
+			return r1 > 0 && r2 >= 0
+		}) {
+			reply.Data = map[string]interface{}{
+				"status": 1,
+				"id":     id,
+			}
+		} else {
+			reply.Data = map[string]interface{}{
+				"status": 0,
+			}
+		}
+	}
+	return reply
+}
+
+//人脉库-业主名称联想
+func (n *Network) Associate(in *types.AssociateReq) *types.Reply {
+	return nil
+}
+
+//人脉库-全部人脉项目
+func (n *Network) Allproject(in *types.AllprojectReq) *types.Reply {
+	return nil
+}
+
+//人脉库-列表
+func (n *Network) List(in *types.NetWorkListReq) *types.Reply {
+	return nil
+}

+ 38 - 0
api/internal/service/network_test.go

@@ -0,0 +1,38 @@
+package service
+
+import (
+	"log"
+	"testing"
+
+	"app.yhyue.com/moapp/jybase/mysql"
+	. "bp.jydev.jianyu360.cn/CRM/application/api/common"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+)
+
+func initDb() {
+	CrmMysql = &mysql.Mysql{
+		Address:      "192.168.3.14:4000",
+		UserName:     "root",
+		PassWord:     "=PDT49#80Z!RVv52_z",
+		DBName:       "crm",
+		MaxOpenConns: 5,
+		MaxIdleConns: 5,
+	}
+	CrmMysql.Init()
+}
+func TestDeduction(t *testing.T) {
+	initDb()
+	res := VarNetwork.AddOrUpdate(&types.AddOrUpdateReq{
+		PositionId:             943,
+		Company_id:             "123456",
+		Company_name:           "王传进的测试企业",
+		Contact_person:         "王传进",
+		Contact_phone:          "15037870765",
+		Introduce_owner_id:     "1,2,3",
+		Introduce_owner_name:   "a,b,c",
+		Introduce_project_id:   "4,5,6",
+		Introduce_project_name: "d,e,f",
+		Type:                   "middleman",
+	})
+	log.Println(res)
+}

+ 4 - 3
api/internal/service/plistService.go

@@ -1,11 +1,12 @@
 package service
 
 import (
+	"fmt"
+	"strings"
+
 	"app.yhyue.com/moapp/jybase/common"
 	P "app.yhyue.com/moapp/jybase/mapping"
 	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
-	"fmt"
-	"strings"
 )
 
 const (
@@ -124,7 +125,7 @@ func getSql(req *types.ProjectListReq) (countSql, findSql string) {
 		}
 		querys = append(querys, fmt.Sprintf(" a.property_form in (%s) ", strings.Join(arr, ",")))
 	}
-
+	userStr := ""
 	//查询数量
 	countSql = fmt.Sprintf("select count(1) as count from %s  a  where  %s   %s", "", userStr, strings.Join(querys, " and "))
 	//列表查询语句

+ 153 - 122
api/internal/types/types.go

@@ -1,17 +1,17 @@
 // Code generated by goctl. DO NOT EDIT.
 package types
 
-type CanAddReq struct {
-	AppId          string `header:"appId,default=10000"`
-	BaseUserId     int64  `header:"newUserId"`
-	PositionId     int64  `header:"positionId,optional"`
-	EntUserId      int64  `header:"entUserId,optional"`
-	EntId          int64  `header:"entId,optional"`
-	AccountId      int64  `header:"accountId,optional"`
-	EntDeptId      int64  `header:"entDeptId,optional"`
-	EmployInfoId   int64  `json:"employInfoId"`            //资讯收录id
-	EmployCustomId int64  `json:"employCustomId,optional"` //客户收录id
-	Key            string `json:"key"`                     //创建线索:more_create_clue 创建机会:more_create_chance 创建客户:more_create_custom
+type Reply struct {
+	Error_code int64       `json:"error_code"`
+	Error_msg  string      `json:"error_msg"`
+	Data       interface{} `json:"data"`
+}
+
+type InfoReply struct {
+	Error_code  int64       `json:"error_code"`
+	Error_msg   string      `json:"error_msg"`
+	Data        interface{} `json:"data"`
+	BatchEmploy int64       `json:"batchEmploy"`
 }
 
 type ClueAddReq struct {
@@ -33,8 +33,81 @@ type ClueAddReq struct {
 	Channel      string  `json:"channel"`               //渠道来源:网页、手动创建
 }
 
-type CoopHistoryReq struct {
-	Pid string `json:"porjectId"`
+type SaleChanceReq struct {
+	AppId             string  `header:"appId,default=10000"`
+	BaseUserId        int64   `header:"newUserId"`
+	PositionId        int64   `header:"positionId,optional"`
+	EntUserId         int64   `header:"entUserId,optional"`
+	EntId             int64   `header:"entId,optional"`
+	AccountId         int64   `header:"accountId,optional"`
+	EntDeptId         int64   `header:"entDeptId,optional"`
+	ChanceName        string  `json:"chanceName"`                 //机会名称
+	Summary           string  `json:"summary"`                    //概要信息
+	ChanceClassify    int64   `json:"chanceClassify"`             //机会分类
+	ExpectedOrderTime int64   `json:"expectedOrderTime,optional"` //最初预计落单段时间 时间戳
+	ExpectedMoney     float64 `json:"expectedMoney,optional"`     //最初预计落单金额
+	CustomName        string  `json:"customName"`                 //客户全称
+	BusinessType      int64   `json:"businessType"`               //业务类型  1新客户需求 2老客户需求 3简易项目流程
+	Remarks           string  `json:"remarks,optional"`           //备注
+	NextfollowUpTime  int64   `json:"nextfollowUpTime,optional"`  //下次跟进时间戳
+	Types             int64   `json:"types"`                      //处理方式 1自办;2转办;3待处理
+	User              []int64 `json:"user,optional"`              //企业用户id
+	EmployInfoId      int64   `json:"employInfoId,optional"`      //资讯收录id
+	CustomId          int64   `json:"customId,optional"`          //客户id
+	CreateName        string  `json:"createName"`                 //创建人
+	ChanceSource      int64   `json:"chanceSource"`               //机会来源
+	OwnerId           int64   `json:"ownerId,optional"`           //潜客收录id(人脉)
+	BusinessId        int64   `json:"businessId,optional"`        //商机收录id(人脉)
+}
+
+type EmployOperateReq struct {
+	AppId      string `header:"appId,default=10000"`
+	BaseUserId int64  `header:"newUserId"`
+	PositionId int64  `header:"positionId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	IdArr      string `json:"idArr"`      //信息id多条信息
+	IsEmploy   bool   `json:"isEmploy"`   //是否收录true收录 false取消收录
+	EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
+	EntDeptId  int64  `header:"entDeptId,optional"`
+	From       string `json:"from,optional"` //来源
+}
+
+type TransferReq struct {
+	AppId         string   `header:"appId,default=10000"`
+	BaseUserId    int64    `header:"newUserId"`
+	PositionId    int64    `header:"positionId,optional"`
+	EntUserId     int64    `header:"entUserId,optional"`
+	EntId         int64    `header:"entId,optional"`
+	EmplouIdArr   []string `json:"emplouIdArr"`
+	PositionIdArr []string `json:"positionIdArr"`
+}
+
+type IgnoreOperateReq struct {
+	AppId      string `header:"appId,default=10000"`
+	BaseUserId int64  `header:"newUserId"`
+	PositionId int64  `header:"positionId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	IdArr      string `json:"idArr"`      //id集合
+	IsIgnore   bool   `json:"isIgnore"`   //是否忽略 true 忽略 false取消忽略
+	EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
+}
+
+type InfoEmployinfoReq struct {
+	AppId        string `header:"appId,default=10000"`
+	BaseUserId   int64  `header:"newUserId"`
+	PositionId   int64  `header:"positionId,optional"`
+	EntUserId    int64  `header:"entUserId,optional"`
+	EntId        int64  `header:"entId,optional"`
+	EmployType   int64  `json:"employType"` //1标采购、2企业、3采购单位、4拟在建项目
+	IdArr        string `json:"idArr"`      //id
+	EntNicheDis  int64  `header:"entNicheDis,optional"`
+	EntDeptId    int64  `header:"entDeptId,optional"`
+	PositionType int64  `header:"positionType,optional"` //职位类型 0个人 1企业
+	AccountId    int64  `header:"accountId,optional"`    //账户id
+	EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
+	From         string `json:"from,optional"`           //来源
 }
 
 type CustomAddReq struct {
@@ -69,10 +142,15 @@ type CustomAddReq struct {
 	BusinessId           int64   `json:"businessId,optional"`              //商机收录id(人脉)
 }
 
-type DistributePerson struct {
-	PositionId int64 `json:"positionId"`
-	EntUserId  int64 `json:"entUserId"`
-	EntDeptId  int64 `json:"entDeptId"`
+type FileUploadReq struct {
+	AppId      string `header:"appId,default=10000"`
+	BaseUserId int64  `header:"newUserId"`
+	PositionId int64  `header:"positionId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	BusinessId int64  `form:"businessId"` //业务id
+	Types      int64  `form:"type"`       //类型;1:跟进记录-线下 2:跟进记录-线上 3:跟进记录-备忘 4:销售机会-项目文档 5:客户-客户档案
+	FileType   int64  `form:"fileType"`   //文件类型,产品介绍、项目方案、立项报告、报价文件、招标文件、投标文件、中标通知书、合同、发票、其他文件
 }
 
 type EmployDistributeReq struct {
@@ -87,70 +165,41 @@ type EmployDistributeReq struct {
 	EntDeptId   int64              `header:"entDeptId,optional"`
 }
 
-type EmployOperateReq struct {
-	AppId      string `header:"appId,default=10000"`
-	BaseUserId int64  `header:"newUserId"`
-	PositionId int64  `header:"positionId,optional"`
-	EntUserId  int64  `header:"entUserId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	IdArr      string `json:"idArr"`      //信息id多条信息
-	IsEmploy   bool   `json:"isEmploy"`   //是否收录true收录 false取消收录
-	EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
-	EntDeptId  int64  `header:"entDeptId,optional"`
-	From       string `json:"from,optional"` //来源
+type DistributePerson struct {
+	PositionId int64 `json:"positionId"`
+	EntUserId  int64 `json:"entUserId"`
+	EntDeptId  int64 `json:"entDeptId"`
 }
 
 type EntInfoReq struct {
 	EntName string `json:"entName"`
 }
 
-type FileUploadReq struct {
-	AppId      string `header:"appId,default=10000"`
-	BaseUserId int64  `header:"newUserId"`
-	PositionId int64  `header:"positionId,optional"`
-	EntUserId  int64  `header:"entUserId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	BusinessId int64  `form:"businessId"` //业务id
-	Types      int64  `form:"type"`       //类型;1:跟进记录-线下 2:跟进记录-线上 3:跟进记录-备忘 4:销售机会-项目文档 5:客户-客户档案
-	FileType   int64  `form:"fileType"`   //文件类型,产品介绍、项目方案、立项报告、报价文件、招标文件、投标文件、中标通知书、合同、发票、其他文件
-}
-
-type IgnoreOperateReq struct {
-	AppId      string `header:"appId,default=10000"`
-	BaseUserId int64  `header:"newUserId"`
-	PositionId int64  `header:"positionId,optional"`
-	EntUserId  int64  `header:"entUserId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	IdArr      string `json:"idArr"`      //id集合
-	IsIgnore   bool   `json:"isIgnore"`   //是否忽略 true 忽略 false取消忽略
-	EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
-}
-
-type InfoEmployinfoReq struct {
-	AppId        string `header:"appId,default=10000"`
-	BaseUserId   int64  `header:"newUserId"`
-	PositionId   int64  `header:"positionId,optional"`
-	EntUserId    int64  `header:"entUserId,optional"`
-	EntId        int64  `header:"entId,optional"`
-	EmployType   int64  `json:"employType"` //1标采购、2企业、3采购单位、4拟在建项目
-	IdArr        string `json:"idArr"`      //id
-	EntNicheDis  int64  `header:"entNicheDis,optional"`
-	EntDeptId    int64  `header:"entDeptId,optional"`
-	PositionType int64  `header:"positionType,optional"` //职位类型 0个人 1企业
-	AccountId    int64  `header:"accountId,optional"`    //账户id
-	EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
-	From         string `json:"from,optional"`           //来源
-}
-
-type InfoReply struct {
-	Error_code  int64       `json:"error_code"`
-	Error_msg   string      `json:"error_msg"`
-	Data        interface{} `json:"data"`
-	BatchEmploy int64       `json:"batchEmploy"`
+type PushMsgReq struct {
+	AppId      string  `header:"appId,default=10000"`
+	BaseUserId int64   `header:"newUserId"`
+	PositionId int64   `header:"positionId,optional"`
+	EntUserId  int64   `header:"entUserId,optional"`
+	EntId      int64   `header:"entId,optional"`
+	Title      string  `json:"title"`         //标题
+	Content    string  `json:"content"`       //内容
+	PcHref     string  `json:"pcHref"`        //pc跳转地址
+	MobileHref string  `json:"mobileHref"`    //移动端跳转地址
+	User       []int64 `json:"user,optional"` //企业用户id
+	MsgType    string  `json:"msgType"`       //消息类型 1-活动优惠 2-服务通知 3-订阅消息 4-项目动态 5-企业动态 6-分析报告 7-系统通知 11-待办
 }
 
-type PnameAssReq struct {
-	ProjectName string `json:"projectName"`
+type CanAddReq struct {
+	AppId          string `header:"appId,default=10000"`
+	BaseUserId     int64  `header:"newUserId"`
+	PositionId     int64  `header:"positionId,optional"`
+	EntUserId      int64  `header:"entUserId,optional"`
+	EntId          int64  `header:"entId,optional"`
+	AccountId      int64  `header:"accountId,optional"`
+	EntDeptId      int64  `header:"entDeptId,optional"`
+	EmployInfoId   int64  `json:"employInfoId"`            //资讯收录id
+	EmployCustomId int64  `json:"employCustomId,optional"` //客户收录id
+	Key            string `json:"key"`                     //创建线索:more_create_clue 创建机会:more_create_chance 创建客户:more_create_custom
 }
 
 type ProjectListReq struct {
@@ -169,59 +218,41 @@ type ProjectListReq struct {
 	Amount       string `json:"amount"`
 }
 
-type PushMsgReq struct {
-	AppId      string  `header:"appId,default=10000"`
-	BaseUserId int64   `header:"newUserId"`
-	PositionId int64   `header:"positionId,optional"`
-	EntUserId  int64   `header:"entUserId,optional"`
-	EntId      int64   `header:"entId,optional"`
-	Title      string  `json:"title"`         //标题
-	Content    string  `json:"content"`       //内容
-	PcHref     string  `json:"pcHref"`        //pc跳转地址
-	MobileHref string  `json:"mobileHref"`    //移动端跳转地址
-	User       []int64 `json:"user,optional"` //企业用户id
-	MsgType    string  `json:"msgType"`       //消息类型 1-活动优惠 2-服务通知 3-订阅消息 4-项目动态 5-企业动态 6-分析报告 7-系统通知 11-待办
+type PnameAssReq struct {
+	ProjectName string `json:"projectName"`
 }
 
-type Reply struct {
-	Error_code int64       `json:"error_code"`
-	Error_msg  string      `json:"error_msg"`
-	Data       interface{} `json:"data"`
+type CoopHistoryReq struct {
+	Pid string `json:"porjectId"`
 }
 
-type SaleChanceReq struct {
-	AppId             string  `header:"appId,default=10000"`
-	BaseUserId        int64   `header:"newUserId"`
-	PositionId        int64   `header:"positionId,optional"`
-	EntUserId         int64   `header:"entUserId,optional"`
-	EntId             int64   `header:"entId,optional"`
-	AccountId         int64   `header:"accountId,optional"`
-	EntDeptId         int64   `header:"entDeptId,optional"`
-	ChanceName        string  `json:"chanceName"`                 //机会名称
-	Summary           string  `json:"summary"`                    //概要信息
-	ChanceClassify    int64   `json:"chanceClassify"`             //机会分类
-	ExpectedOrderTime int64   `json:"expectedOrderTime,optional"` //最初预计落单段时间 时间戳
-	ExpectedMoney     float64 `json:"expectedMoney,optional"`     //最初预计落单金额
-	CustomName        string  `json:"customName"`                 //客户全称
-	BusinessType      int64   `json:"businessType"`               //业务类型  1新客户需求 2老客户需求 3简易项目流程
-	Remarks           string  `json:"remarks,optional"`           //备注
-	NextfollowUpTime  int64   `json:"nextfollowUpTime,optional"`  //下次跟进时间戳
-	Types             int64   `json:"types"`                      //处理方式 1自办;2转办;3待处理
-	User              []int64 `json:"user,optional"`              //企业用户id
-	EmployInfoId      int64   `json:"employInfoId,optional"`      //资讯收录id
-	CustomId          int64   `json:"customId,optional"`          //客户id
-	CreateName        string  `json:"createName"`                 //创建人
-	ChanceSource      int64   `json:"chanceSource"`               //机会来源
-	OwnerId           int64   `json:"ownerId,optional"`           //潜客收录id(人脉)
-	BusinessId        int64   `json:"businessId,optional"`        //商机收录id(人脉)
+type AddOrUpdateReq struct {
+	PositionId             int64  `header:"positionId"`
+	EntUserId              int64  `header:"entUserId,optional"`
+	EntId                  int64  `header:"entId,optional"`
+	EntDeptId              int64  `header:"entDeptId,optional"`
+	Company_id             string `json:"company_id,optional"`
+	Company_name           string `json:"company_name,optional"`
+	Contact_person         string `json:"contact_person,optional"`
+	Contact_phone          string `json:"contact_phone,optional"`
+	Introduce_owner_id     string `json:"introduce_owner_id,optional"`
+	Introduce_owner_name   string `json:"introduce_owner_name,optional"`
+	Introduce_project_id   string `json:"introduce_project_id,optional"`
+	Introduce_project_name string `json:"introduce_project_name,optional"`
+	Id                     string `json:"id,optional"`
+	Type                   string `json:"type,optional"`
 }
 
-type TransferReq struct {
-	AppId         string   `header:"appId,default=10000"`
-	BaseUserId    int64    `header:"newUserId"`
-	PositionId    int64    `header:"positionId,optional"`
-	EntUserId     int64    `header:"entUserId,optional"`
-	EntId         int64    `header:"entId,optional"`
-	EmplouIdArr   []string `json:"emplouIdArr"`
-	PositionIdArr []string `json:"positionIdArr"`
+type AssociateReq struct {
+	Name string `json:"name"`
+	Type string `json:"type"`
+}
+
+type AllprojectReq struct {
+	PositionId int64  `header:"positionId"`
+	Name       string `json:"name,optional"`
+}
+
+type NetWorkListReq struct {
+	PositionId int64 `header:"positionId"`
 }

+ 2 - 2
go.mod

@@ -13,7 +13,9 @@ require (
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
 	github.com/RoaringBitmap/roaring v1.5.0
 	github.com/gogf/gf/v2 v2.0.6
+	github.com/golang/protobuf v1.5.3
 	github.com/zeromicro/go-zero v1.5.5
+	google.golang.org/grpc v1.57.0
 )
 
 require (
@@ -46,7 +48,6 @@ require (
 	github.com/gogo/protobuf v1.3.2 // indirect
 	github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
 	github.com/golang/mock v1.6.0 // indirect
-	github.com/golang/protobuf v1.5.3 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/google/gnostic v0.5.7-v3refs // indirect
@@ -123,7 +124,6 @@ require (
 	google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
 	google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
-	google.golang.org/grpc v1.57.0 // indirect
 	google.golang.org/protobuf v1.31.0 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect