Browse Source

featxiugai

wangchuanjin 1 year ago
parent
commit
fcf607f79b

+ 120 - 119
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,20 +183,20 @@ 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
 	}
 	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"`
@@ -206,12 +206,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"`
@@ -239,20 +239,22 @@ type (
 		ChannelType  string `json:"channelType"`
 	}
 	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"`
-		Contact_phone          string `json:"contact_phone"`
-		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                     int64  `json:"id,optional"`
-		Type                   string `json:"type"`
+		PositionId              int64  `header:"positionId"`
+		EntUserId               int64  `header:"entUserId,optional"`
+		EntId                   int64  `header:"entId,optional"`
+		EntDeptId               int64  `header:"entDeptId,optional"`
+		Qyxy_id                 string `json:"company_id,optional"`
+		Company_id              string `json:"company_id,optional"`
+		Company_name            string `json:"company_name,optional"`
+		Contact_person          string `json:"contact_person"`
+		Contact_phone           string `json:"contact_phone"`
+		Introduce_owner_id      string `json:"introduce_owner_id,optional"`
+		Introduce_owner_qyxy_id string `json:"introduce_owner_qyxy_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                      int64  `json:"id,optional"`
+		Type                    string `json:"type"`
 	}
 	AssociateReq {
 		EntAccountId int64  `header:"entAccountId"`
@@ -264,7 +266,7 @@ type (
 		EntAccountId int64  `header:"entAccountId"`
 		PositionId   int64  `header:"positionId"`
 		Name         string `json:"name,optional"`
-		Type         int64  `json:"type,optional"`
+		Type         string `json:"type,optional"`
 		Id           string `json:"id,optional"`
 	}
 	NetWorkListReq {
@@ -302,11 +304,11 @@ type (
 		WinnerId string `json:"winnerId"`
 	}
 	ChannelListReq {
-		PartyA       string `json:"partyA,optional"` //甲方
-		Supplier     string `json:"supplier,optional"` //供应商
-		Heterotophy  string `json:"heterotophy,optional"` //同甲异业
+		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"`       //代理机构
 		PositionId   int64  `header:"positionId,optional"`
 	}
 	RouteOwnerListReq {
@@ -330,105 +332,104 @@ 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 ownerList
 	post /crmApplication/owner/list (OwnerListReq) 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/project/analyse (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 networkList
 	post /crmApplication/network/networkList (NetWorkListReq) returns (Reply)
-
+	
 	@doc "忽略操作"
 	@handler ignoreAction
 	post /crmApplication/ignore/action (IgnoreReq) returns (Reply)
-
+	
 	@doc "情报详情"
 	@handler infoDetail
 	post /crmApplication/infomation/detail (InfoDetailReq) returns (Reply)
-
+	
 	@doc "人脉项目分析-业主合作历史"
 	@handler projectHistory
 	post /crmApplication/pr/project/history (PrjectHistoryReq) returns (Reply)
-
+	
 	@doc "可介绍业主路径"
 	@handler ownerRoute
 	post /crmApplication/owner/route (RouteOwnerListReq) returns (Reply)
-
+	
 	@doc "可介绍业主合作次数"
 	@handler ownerCooperate
 	post /crmApplication/owner/cooperate (CooperateOwnerListReq) returns (Reply)
-
+	
 	@doc "候选渠道列表"
 	@handler candidateChannel
 	post /crmApplication/candidate/channel (ChannelListReq) returns (Reply)
-}
-
+}

+ 2 - 3
api/common/initconfig.go

@@ -4,10 +4,11 @@ import (
 	"context"
 	"flag"
 	"fmt"
-	"github.com/zeromicro/go-zero/zrpc"
 	"log"
 	"time"
 
+	"github.com/zeromicro/go-zero/zrpc"
+
 	"app.yhyue.com/moapp/jypkg/middleground"
 
 	. "app.yhyue.com/moapp/jybase/es"
@@ -176,8 +177,6 @@ func InitConf() {
 	SocialPlatformRpc = social.NewSocial(zrpc.MustNewClient(C.SocialPlatformRpc))
 	Middleground = middleground.NewMiddleground(C.BaseCenterRpc.Etcd.Hosts).
 		RegResourceCenter(C.ResourceCenterKey)
-	/*	Middleground = middleground.NewMiddleground([]string{"192.168.3.206:2379"}).
-		//	RegResourceCenter(C.ResourceCenterKey)*/
 	conf.MustLoad(*pushFile, &Push)
 	ConnectClickhouse(DB.Clickhouse)
 }

+ 3 - 3
api/etc/crmapplication.yaml

@@ -1,11 +1,11 @@
-Name: crmApplication
+Name: wcj_crmApplication
 Host: 0.0.0.0
 Port: 8887
 Timeout: 20000
 Gateway:
-  ServerCode: crmApplication
+  ServerCode: wcj_crmApplication
   Etcd:
-    - 127.0.0.1:2379
+    - 192.168.3.206:2379
 UserCenterRpc:
   Etcd:
     Hosts:

+ 1 - 1
api/etc/db.yaml

@@ -60,7 +60,7 @@ mongo:
         userName: jyDevGroup
         password: jy@DevGroup
 es:
-    addr: http://192.168.3.241:9205
+    addr: http://192.168.3.149:9200
     size: 50
     version: v7
     userName: ""

+ 48 - 49
api/internal/handler/routes.go

@@ -14,38 +14,38 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/candidate/channel",
-				Handler: candidateChannelHandler(serverCtx),
+				Path:    "/crmApplication/clue/add",
+				Handler: clueAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/clue/add",
-				Handler: clueAddHandler(serverCtx),
+				Path:    "/crmApplication/saleChance/add",
+				Handler: saleChanceAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/custom/add",
-				Handler: customAddHandler(serverCtx),
+				Path:    "/crmApplication/employ/operate",
+				Handler: employOperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/distribute",
-				Handler: employDistributeHandler(serverCtx),
+				Path:    "/crmApplication/information/transfer",
+				Handler: transferHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/info",
-				Handler: employInfoHandler(serverCtx),
+				Path:    "/crmApplication/ignore/operate",
+				Handler: ignoreOperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/employ/operate",
-				Handler: employOperateHandler(serverCtx),
+				Path:    "/crmApplication/employ/info",
+				Handler: employInfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/ent/info",
-				Handler: entinfoHandler(serverCtx),
+				Path:    "/crmApplication/custom/add",
+				Handler: customAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -54,13 +54,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/ignore/action",
-				Handler: ignoreActionHandler(serverCtx),
+				Path:    "/crmApplication/employ/distribute",
+				Handler: employDistributeHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/ignore/operate",
-				Handler: ignoreOperateHandler(serverCtx),
+				Path:    "/crmApplication/ent/info",
+				Handler: entinfoHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/info/push",
+				Handler: pushMsgHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -69,34 +74,39 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/info/push",
-				Handler: pushMsgHandler(serverCtx),
+				Path:    "/crmApplication/owner/list",
+				Handler: ownerListHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/infomation/detail",
-				Handler: infoDetailHandler(serverCtx),
+				Path:    "/crmApplication/network/project/list",
+				Handler: projectListHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/information/transfer",
-				Handler: transferHandler(serverCtx),
+				Path:    "/crmApplication/pr/pname/ass",
+				Handler: PrPnameAssHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/network/addOrUpdate",
-				Handler: addOrUpdateHandler(serverCtx),
+				Path:    "/crmApplication/pr/project/analyse",
+				Handler: CoopHistoryListHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/network/allProject",
-				Handler: allProjectHandler(serverCtx),
+				Path:    "/crmApplication/network/addOrUpdate",
+				Handler: addOrUpdateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/crmApplication/network/associate",
 				Handler: associateHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/network/allProject",
+				Handler: allProjectHandler(serverCtx),
+			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/crmApplication/network/networkList",
@@ -104,18 +114,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/network/project/list",
-				Handler: projectListHandler(serverCtx),
+				Path:    "/crmApplication/ignore/action",
+				Handler: ignoreActionHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/owner/cooperate",
-				Handler: ownerCooperateHandler(serverCtx),
+				Path:    "/crmApplication/infomation/detail",
+				Handler: infoDetailHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/owner/list",
-				Handler: ownerListHandler(serverCtx),
+				Path:    "/crmApplication/pr/project/history",
+				Handler: projectHistoryHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -124,25 +134,14 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/pr/pname/ass",
-				Handler: PrPnameAssHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/crmApplication/pr/project/analyse",
-				Handler: CoopHistoryListHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/crmApplication/pr/project/history",
-				Handler: projectHistoryHandler(serverCtx),
+				Path:    "/crmApplication/owner/cooperate",
+				Handler: ownerCooperateHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/saleChance/add",
-				Handler: saleChanceAddHandler(serverCtx),
+				Path:    "/crmApplication/candidate/channel",
+				Handler: candidateChannelHandler(serverCtx),
 			},
 		},
-		rest.WithMaxBytes(104857600),
 	)
 }

+ 2 - 1
api/internal/logic/ownerlistlogic.go

@@ -1,9 +1,10 @@
 package logic
 
 import (
-	"bp.jydev.jianyu360.cn/CRM/application/api/internal/service"
 	"context"
 
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/service"
+
 	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
 	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
 

+ 83 - 38
api/internal/service/network.go

@@ -31,11 +31,12 @@ type networkTree struct {
 	Children []*networkTreeChild `json:"children"`
 }
 type networkTreeChild struct {
-	Count      int64  `json:"count"`
-	Name       string `json:"name"`
-	Id         string `json:"id"`
-	Type       string `json:"type"`
-	CreateTime string `json:"createTime"`
+	Count       int64  `json:"count"`
+	Id          int64  `json:"id"`
+	CompanyId   string `json:"companyId"`
+	CompanyName string `json:"companyName"`
+	Type        string `json:"type"`
+	CreateTime  string `json:"createTime"`
 }
 
 func (s *networkTree) Len() int {
@@ -44,7 +45,7 @@ func (s *networkTree) Len() int {
 
 func (s *networkTree) Less(i, j int) bool {
 	if s.Name == "甲方" {
-		return s.Children[i].Name < s.Children[j].Name
+		return s.Children[i].CompanyName < s.Children[j].CompanyName
 	}
 	it, err1 := time.ParseInLocation(Date_Full_Layout, s.Children[i].CreateTime, time.Local)
 	if err1 != nil {
@@ -91,12 +92,13 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 		}
 		values := []interface{}{}
 		ioi := strings.Split(in.Introduce_owner_id, ",")
+		ioqi := strings.Split(in.Introduce_owner_qyxy_id, ",")
 		ion := strings.Split(in.Introduce_owner_name, ",")
-		if len(ioi) != len(ion) {
+		if len(ioi) != len(ion) || len(ioi) != len(ioqi) {
 			return false
 		}
 		for k, v := range ioi {
-			values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, ion[k], 1, nowFormat)
+			values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, ioqi[k], v, ion[k], 1, nowFormat)
 		}
 		ipi := strings.Split(in.Introduce_project_id, ",")
 		ipn := strings.Split(in.Introduce_project_name, ",")
@@ -104,13 +106,13 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 			return false
 		}
 		for k, v := range ipi {
-			values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, ipn[k], 2, nowFormat)
+			values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, nil, v, ipn[k], 2, nowFormat)
 		}
 		var r2 int64
 		if isUpdate {
 			r2 = CrmMysql.UpdateOrDeleteBySqlByTx(tx, `delete from crm.connection_introduce where connection_id=? and position_id=?`, in.Id, in.PositionId)
 		}
-		r3, _ := CrmMysql.InsertBatchByTx(tx, "crm.connection_introduce", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "connection_id", "relate_id", "relate_name", "itype", "create_time"}, values)
+		r3, _ := CrmMysql.InsertBatchByTx(tx, "crm.connection_introduce", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "connection_id", "qyxy_id", "relate_id", "relate_name", "itype", "create_time"}, values)
 		return r2 >= 0 && r3 > 0
 	}
 	itype := n.TypeStrConvert(in.Type)
@@ -148,7 +150,7 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 		}
 		var r1 int64
 		if CrmMysql.ExecTx("新增人脉", func(tx *sql.Tx) bool {
-			_, r1 = CrmMysql.InsertBatchByTx(tx, "crm.connection", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "itype", "company_name", "company_id", "contact_person", "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})
+			_, r1 = CrmMysql.InsertBatchByTx(tx, "crm.connection", []string{"position_id", "ent_id", "ent_dept_id", "ent_user_id", "itype", "company_name", "company_id", "qyxy_id", "contact_person", "contact_phone", "status", "create_time", "update_time"}, []interface{}{in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, itype, in.Company_name, in.Company_id, in.Qyxy_id, in.Contact_person, in.Contact_phone, 1, nowFormat, nowFormat})
 			return r1 > 0 && saveIntroduce(tx, r1, false)
 		}) {
 			reply.Data = map[string]interface{}{
@@ -163,7 +165,7 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
 //人脉库-业主名称联想
 func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 middleman_owner:中间人-业主 middleman_project:中间人-项目 agency:招标代理机构
-	res := []map[string]interface{}{}
+	res := []map[string]string{}
 	reply = &types.Reply{Data: res}
 	in.Name = strings.TrimSpace(in.Name)
 	if in.Name == "" {
@@ -182,6 +184,7 @@ func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 				logx.Error(err)
 			} else {
 				repeat := map[string]bool{}
+				ids := []string{}
 				for rows.Next() {
 					var (
 						winner_id []string
@@ -199,18 +202,23 @@ func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 						if k >= len(winner_id) {
 							continue
 						}
-						res = append(res, map[string]interface{}{
+						ids = append(ids, winner_id[k])
+						res = append(res, map[string]string{
 							"company_name": v,
 							"company_id":   winner_id[k],
 						})
+						if len(res) == pageSize {
+							break
+						}
 					}
 				}
 				rows.Close()
 				if err := rows.Err(); err != nil {
 					logx.Error(err)
 				}
-				if len(res) > pageSize {
-					res = res[:pageSize]
+				qyxyId := n.GetQyxyId(ids)
+				for _, v := range res {
+					v["qyxy_id"] = qyxyId[v["company_id"]]
 				}
 			}
 		}
@@ -228,14 +236,15 @@ func (n *network) Associate(in *types.AssociateReq) (reply *types.Reply) {
 		case "agency":
 			must = append(must, `{"term":{"company_unit_type":4}}`)
 		}
-		q := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"size":%d,"_source":["id","company_name"]}`, strings.Join(must, ","), pageSize)
+		q := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"size":%d,"_source":["id","company_id","company_name"]}`, strings.Join(must, ","), pageSize)
 		logx.Info("人脉库-业主名称联想", q)
 		datas := VarEs.Get("ent_info", "ent_info", q)
 		if datas != nil {
 			for _, v := range *datas {
-				res = append(res, map[string]interface{}{
+				res = append(res, map[string]string{
 					"company_name": ObjToString(v["company_name"]),
 					"company_id":   ObjToString(v["id"]),
+					"qyxy_id":      ObjToString(v["company_id"]),
 				})
 			}
 		}
@@ -254,7 +263,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 	var count int64
 	var list []*networkTree
 	if in.Id != "" {
-		if in.Type == 1 {
+		if in.Type == "firstparty" {
 			result := n.FirstpartyNetwork(in.Name, []string{in.Id})
 			if result[in.Id] != nil {
 				nameIndex := map[string]int{}
@@ -273,12 +282,12 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 							wait.Done()
 						}()
 						ntc := &networkTreeChild{
-							Name: cName,
-							Id:   cId,
-							Type: "firstparty",
+							CompanyName: cName,
+							CompanyId:   cId,
+							Type:        "firstparty",
 						}
 						if wh != "" {
-							thisArgs := []interface{}{ntc.Id}
+							thisArgs := []interface{}{ntc.CompanyId}
 							thisArgs = append(thisArgs, newArgs...)
 							ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where buyer_id=? and hasAny(property_form,[`+wh+`])`, thisArgs...)
 						}
@@ -293,7 +302,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 			}
 		}
 	} else {
-		q := `SELECT a.company_id,a.company_name,a.itype,a.create_time,COUNT(b.id) AS ipc FROM crm.connection a 
+		q := `SELECT a.id,a.company_id,a.company_name,a.itype,a.create_time,COUNT(b.id) AS ipc FROM crm.connection a 
 			LEFT JOIN crm.connection_introduce b ON (b.position_id=? AND b.itype=2 AND a.id=b.connection_id) WHERE a.position_id=?`
 		args := []interface{}{in.PositionId, in.PositionId}
 		if in.Name != "" {
@@ -342,13 +351,14 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 					company_name = "未填写"
 				}
 				ntc := &networkTreeChild{
-					Name:       company_name,
-					Id:         ObjToString(v["company_id"]),
-					Type:       n.TypeIntConvert(Int64All(v["itype"])),
-					CreateTime: ObjToString(v["create_time"]),
+					Id:          Int64All(v["id"]),
+					CompanyName: company_name,
+					CompanyId:   ObjToString(v["company_id"]),
+					Type:        n.TypeIntConvert(Int64All(v["itype"])),
+					CreateTime:  ObjToString(v["create_time"]),
 				}
 				if wh != "" {
-					thisArgs := []interface{}{ntc.Id}
+					thisArgs := []interface{}{ntc.CompanyId}
 					thisArgs = append(thisArgs, newArgs...)
 					if itype == 1 {
 						ntc.Count = NetworkCom.Count(`select count(1) from information.transaction_info where buyer_id=? and hasAny(property_form,[`+wh+`])`, thisArgs...)
@@ -393,14 +403,18 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 			if pType != "" {
 				pType += ","
 			}
-			ID += vv.Id
+			tempId := vv.CompanyId
+			if vv.Type == "middleman" {
+				tempId = fmt.Sprint(vv.Id)
+			}
+			ID += tempId
 			pType += vv.Type
 			cm := map[string]interface{}{
-				"NAME":      vv.Name,
-				"ID":        vv.Id,
+				"NAME":      vv.CompanyName,
+				"ID":        tempId,
 				"SZ_PID0":   v.Name,
-				"SZ_PID1":   v.Name + ":" + vv.Id,
-				"CODE":      v.Name + ":" + vv.Id,
+				"SZ_PID1":   v.Name + ":" + tempId,
+				"CODE":      v.Name + ":" + tempId,
 				"PCODE":     v.Name,
 				"DATACOUNT": vv.Count,
 				"SZ_LEVEL":  1,
@@ -424,7 +438,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 
 //人脉库-列表
 func (n *network) List(in *types.NetWorkListReq) *types.Reply {
-	q := `select a.company_id,a.company_name,a.itype,a.contact_person as person,a.contact_phone as phone,count(DISTINCT if(b.itype=1,b.relate_id,null)) as buyer_count,count(DISTINCT if(b.itype=2,b.relate_id,null)) as project_count,GROUP_CONCAT(IF(b.itype=1,b.relate_id,NULL)) AS relate_buyer_id,GROUP_CONCAT(IF(b.itype=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a 
+	q := `select a.id,a.company_id,a.company_name,a.qyxy_id,a.itype,a.contact_person as person,a.contact_phone as phone,count(DISTINCT if(b.itype=1,b.relate_id,null)) as buyer_count,count(DISTINCT if(b.itype=2,b.relate_id,null)) as project_count,GROUP_CONCAT(IF(b.itype=1,b.relate_id,NULL)) AS relate_buyer_id,GROUP_CONCAT(IF(b.itype=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a 
 		left join crm.connection_introduce b on (a.id=b.connection_id) where a.position_id=?`
 	args := []interface{}{in.PositionId}
 	if in.Type != "" {
@@ -537,7 +551,7 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 			case 4:
 				itype = "中间人"
 				jump_type = "middleman"
-				jump_id = company_id
+				jump_id = fmt.Sprint(Int64All(v["id"]))
 				middleman_count++
 				buyer_count = Int64All(v["buyer_count"])
 				project_count = Int64All(v["project_count"])
@@ -587,16 +601,19 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 			} else if in.Project_matchme == 1 && project_count == 0 {
 				continue
 			}
-
 			export_url := ""
 			if len(export_id) > 0 {
 				export_url = "/subscribepay/network/projectExport?export_id=" + encrypt.SE.EncodeStringByCheck(strings.Join(export_id, ","))
 			}
+			url := ""
 			company_name, _ := v["company_name"].(string)
-			url := "/swordfish/page_big_pc/unit_portrayal/" + company_name
 			if company_name == "" {
 				company_name = "未填写"
-				url = ""
+			}
+			if qyxy_id := ObjToString(v["qyxy_id"]); qyxy_id != "" && (jump_type == "supplier" || jump_type == "adiffb") {
+				url = "/swordfish/page_big_pc/ent_portrait/" + encrypt.EncodeArticleId2ByCheck(qyxy_id)
+			} else if jump_type == "firstparty" && company_name != "" {
+				url = "/swordfish/page_big_pc/unit_portrayal/" + company_name
 			}
 			list = append(list, &map[string]interface{}{
 				"company_id":    company_id,
@@ -943,3 +960,31 @@ func (n *network) TypeIntConvert(itype int64) string {
 	}
 	return ""
 }
+
+//
+func (n *network) GetQyxyId(ids []string) map[string]string {
+	wh, args := NetworkCom.WhArgs(ids)
+	q := `select id,company_id from information.ent_info where id in (` + wh + `)`
+	rows, err := ClickhouseConn.Query(context.Background(), q, args...)
+	m := map[string]string{}
+	if err != nil {
+		logx.Error(err)
+	} else {
+		for rows.Next() {
+			var (
+				id         string
+				company_id string
+			)
+			if err := rows.Scan(&id, &company_id); err != nil {
+				logx.Error(err)
+				continue
+			}
+			m[id] = company_id
+		}
+		rows.Close()
+		if err := rows.Err(); err != nil {
+			logx.Error(err)
+		}
+	}
+	return m
+}

+ 14 - 1
api/internal/service/network_test.go

@@ -28,7 +28,7 @@ func initDb() {
 		Addr:         "192.168.3.207:19000",
 		UserName:     "jytop",
 		Password:     "pwdTopJy123",
-		DbName:       "jianyu",
+		DbName:       "information",
 		MaxIdleConns: 2,
 		MaxOpenConns: 2,
 	})
@@ -139,3 +139,16 @@ func TestAllProject(t *testing.T) {
 	b, _ := json.Marshal(res.Data)
 	log.Println(string(b))
 }
+
+func TestOwner(t *testing.T) {
+	initDb()
+	ownerService := &OwnerService{
+		Intermediary: "wcj_11111111f",
+		PositionId:   935,
+		PageIndex:    1,
+		PageSize:     100,
+	}
+	data := ownerService.OwnerlList()
+	b, _ := json.Marshal(data)
+	log.Println(string(b))
+}

+ 215 - 213
api/internal/types/types.go

@@ -1,58 +1,17 @@
 // Code generated by goctl. DO NOT EDIT.
 package types
 
-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"`
-	Contact_phone          string `json:"contact_phone"`
-	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                     int64  `json:"id,optional"`
-	Type                   string `json:"type"`
-}
-
-type AllprojectReq struct {
-	EntAccountId int64  `header:"entAccountId"`
-	PositionId   int64  `header:"positionId"`
-	Name         string `json:"name,optional"`
-	Type         int64  `json:"type,optional"`
-	Id           string `json:"id,optional"`
-}
-
-type AssociateReq struct {
-	EntAccountId int64  `header:"entAccountId"`
-	EntName      string `header:"entName"`
-	Name         string `json:"name"`
-	Type         string `json:"type"`
-}
-
-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 ChannelListReq 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"`       //代理机构
-	PositionId   int64  `header:"positionId,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 ClueAddReq struct {
@@ -74,22 +33,81 @@ type ClueAddReq struct {
 	Channel      string  `json:"channel"`               //渠道来源:网页、手动创建
 }
 
-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 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 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"`
+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 {
@@ -124,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 {
@@ -142,99 +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 IgnoreReq struct {
-	PositionId int64  `header:"positionId"`
-	EntUserId  int64  `header:"entUserId,optional"`
-	EntId      int64  `header:"entId,optional"`
-	EntDeptId  int64  `header:"entDeptId,optional"`
-	RelateId   string `json:"relateId,optional"`
-	Source     string `json:"source,optional"`
-	Action     string `json:"action,optional"`
-}
-
-type InfoDetailReq struct {
-	InfoId string `json:"infoId"`
-}
-
-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 NetWorkListReq struct {
-	UserId             string `header:"userId"`
-	EntAccountId       int64  `header:"entAccountId"`
-	PositionId         int64  `header:"positionId"`
-	Type               string `json:"type,optional"`
-	Name               string `json:"name,optional"`
-	Monitor            int64  `json:"monitor,optional"`
-	Starttime          string `json:"starttime,optional"`
-	Endtime            string `json:"endtime,optional"`
-	Order_amount       int64  `json:"order_amount,optional"`
-	Current_page       int64  `json:"current_page,optional"`
-	Page_size          int64  `json:"page_size,optional"`
-	Project_matchme    int64  `json:"project_matchme,optional"`
-	Buyercount_start   int64  `json:"buyercount_start,optional"`
-	Buyercount_end     int64  `json:"buyercount_end,optional"`
-	Monitorcount_start int64  `json:"monitorcount_start,optional"`
-	Monitorcount_end   int64  `json:"monitorcount_end,optional"`
+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 OwnerListReq struct {
@@ -252,15 +217,6 @@ type OwnerListReq struct {
 	PageIndex        int64  `json:"pageIndex,optional"`
 }
 
-type PnameAssReq struct {
-	ProjectName string `json:"projectName"`
-}
-
-type PrjectHistoryReq struct {
-	BuyerId  string `json:"buyerId"`
-	WinnerId string `json:"winnerId"`
-}
-
 type ProjectListReq struct {
 	UserId       string `header:"userId,optional"`
 	PositionId   int64  `header:"positionId,optional"`
@@ -287,24 +243,99 @@ type ProjectListReq struct {
 	Amount       string `json:"amount,optional"`
 }
 
-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 {
+	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"`
+	EntId                   int64  `header:"entId,optional"`
+	EntDeptId               int64  `header:"entDeptId,optional"`
+	Qyxy_id                 string `json:"company_id,optional"`
+	Company_id              string `json:"company_id,optional"`
+	Company_name            string `json:"company_name,optional"`
+	Contact_person          string `json:"contact_person"`
+	Contact_phone           string `json:"contact_phone"`
+	Introduce_owner_id      string `json:"introduce_owner_id,optional"`
+	Introduce_owner_qyxy_id string `json:"introduce_owner_qyxy_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                      int64  `json:"id,optional"`
+	Type                    string `json:"type"`
+}
+
+type AssociateReq struct {
+	EntAccountId int64  `header:"entAccountId"`
+	EntName      string `header:"entName"`
+	Name         string `json:"name"`
+	Type         string `json:"type"`
+}
+
+type AllprojectReq struct {
+	EntAccountId int64  `header:"entAccountId"`
+	PositionId   int64  `header:"positionId"`
+	Name         string `json:"name,optional"`
+	Type         string `json:"type,optional"`
+	Id           string `json:"id,optional"`
+}
+
+type NetWorkListReq struct {
+	UserId             string `header:"userId"`
+	EntAccountId       int64  `header:"entAccountId"`
+	PositionId         int64  `header:"positionId"`
+	Type               string `json:"type,optional"`
+	Name               string `json:"name,optional"`
+	Monitor            int64  `json:"monitor,optional"`
+	Starttime          string `json:"starttime,optional"`
+	Endtime            string `json:"endtime,optional"`
+	Order_amount       int64  `json:"order_amount,optional"`
+	Current_page       int64  `json:"current_page,optional"`
+	Page_size          int64  `json:"page_size,optional"`
+	Project_matchme    int64  `json:"project_matchme,optional"`
+	Buyercount_start   int64  `json:"buyercount_start,optional"`
+	Buyercount_end     int64  `json:"buyercount_end,optional"`
+	Monitorcount_start int64  `json:"monitorcount_start,optional"`
+	Monitorcount_end   int64  `json:"monitorcount_end,optional"`
+}
+
+type IgnoreReq struct {
+	PositionId int64  `header:"positionId"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	EntDeptId  int64  `header:"entDeptId,optional"`
+	RelateId   string `json:"relateId,optional"`
+	Source     string `json:"source,optional"`
+	Action     string `json:"action,optional"`
+}
+
+type InfoDetailReq struct {
+	InfoId string `json:"infoId"`
+}
+
+type PrjectHistoryReq struct {
+	BuyerId  string `json:"buyerId"`
+	WinnerId string `json:"winnerId"`
+}
+
+type ChannelListReq 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"`       //代理机构
+	PositionId   int64  `header:"positionId,optional"`
 }
 
 type RouteOwnerListReq struct {
@@ -312,39 +343,10 @@ type RouteOwnerListReq struct {
 	BuyerName string `json:"buyerName,optional"`
 }
 
-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 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 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"`
 }