瀏覽代碼

fenzhihebing

lianbingjie 1 年之前
父節點
當前提交
7c55f1d7a9

+ 31 - 0
api/application.api

@@ -6,6 +6,16 @@ type (
 		Error_msg  string      `json:"error_msg"`
 		Data       interface{} `json:"data"`
 	}
+<<<<<<< HEAD
+=======
+	InfoReply {
+		Error_code  int64       `json:"error_code"`
+		Error_msg   string      `json:"error_msg"`
+		Data        interface{} `json:"data"`
+		BatchEmploy int64       `json:"batchEmploy"`
+	}
+
+>>>>>>> master
 	ClueAddReq {
 		AppId        string  `header:"appId,default=10000"`
 		BaseUserId   int64   `header:"newUserId"`
@@ -58,6 +68,7 @@ type (
 		IsEmploy   bool   `json:"isEmploy"` //是否收录true收录 false取消收录
 		EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
 		EntDeptId  int64  `header:"entDeptId,optional"`
+		From       string `json:"from,optional"` //来源
 	}
 	TransferReq {
 		AppId         string   `header:"appId,default=10000"`
@@ -79,6 +90,7 @@ type (
 		EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
 	}
 	InfoEmployinfoReq {
+<<<<<<< HEAD
 		AppId       string `header:"appId,default=10000"`
 		BaseUserId  int64  `header:"newUserId"`
 		PositionId  int64  `header:"positionId,optional"`
@@ -88,6 +100,21 @@ type (
 		IdArr       string `json:"idArr"` //id
 		EntNicheDis int64  `header:"entNicheDis,optional"`
 		EntDeptId   int64  `header:"entDeptId,optional"`
+=======
+		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"`           //来源
+>>>>>>> master
 	}
 	CustomAddReq {
 		AppId                string  `header:"appId,default=10000"`
@@ -201,8 +228,12 @@ service crmApplication {
 
 	@doc "收录情况"
 	@handler employInfo
+<<<<<<< HEAD
 	post /crmApplication/employ/info (InfoEmployinfoReq) returns (Reply)
 
+=======
+	post /crmApplication/employ/info (InfoEmployinfoReq) returns (InfoReply)
+>>>>>>> master
 	@doc "创建客户"
 	@handler customAdd
 	post /crmApplication/custom/add (CustomAddReq) returns (Reply)

+ 6 - 3
api/common/initconfig.go

@@ -1,6 +1,7 @@
 package common
 
 import (
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"flag"
 	"log"
 
@@ -27,7 +28,6 @@ var logc entity.Logc
 var dbFile = flag.String("df", "etc/db.yaml", "the db file")
 var DB config.Db
 
-//
 var pushFile = flag.String("pf", "etc/push.yaml", "the push file")
 var Push config.Push
 
@@ -42,8 +42,9 @@ var (
 	FileCenterRpc     filecenter.FileCenter
 	BaseCenterRpc     basecenter.BaseCenter
 	SocialPlatformRpc social.Social
-	MgoProject    mongodb.MongodbSim
-	NiJian        *mysql.Mysql
+	MgoProject        mongodb.MongodbSim
+	NiJian            *mysql.Mysql
+	Middleground      *middleground.Middleground
 )
 
 func init() {
@@ -166,5 +167,7 @@ func init() {
 	FileCenterRpc = filecenter.NewFileCenter(zrpc.MustNewClient(C.FileCenterRpc))
 	BaseCenterRpc = basecenter.NewBaseCenter(zrpc.MustNewClient(C.BaseCenterRpc))
 	SocialPlatformRpc = social.NewSocial(zrpc.MustNewClient(C.SocialPlatformRpc))
+	Middleground = middleground.NewMiddleground(C.BaseCenterRpc.Etcd.Hosts).
+		RegResourceCenter(C.ResourceCenterKey)
 	conf.MustLoad(*pushFile, &Push)
 }

+ 2 - 1
api/etc/crmapplication.yaml

@@ -1,6 +1,6 @@
 Name: crmApplication
 Host: 0.0.0.0
-Port: 8888
+Port: 8887
 Timeout: 20000
 Gateway:
   ServerCode: crmApplication
@@ -29,3 +29,4 @@ SocialPlatformRpc:
     Hosts:
     - 192.168.3.206:2379
     Key: social.rpc
+ResourceCenterKey: resource.rpc

+ 1 - 0
api/internal/config/config.go

@@ -19,6 +19,7 @@ type Config struct {
 	BaseCenterRpc     zrpc.RpcClientConf
 	NextFollowUpTime  int
 	SocialPlatformRpc zrpc.RpcClientConf
+	ResourceCenterKey string
 }
 
 type Db struct {

+ 3 - 3
api/internal/logic/employinfologic.go

@@ -24,10 +24,10 @@ func NewEmployInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Employ
 	}
 }
 
-func (l *EmployInfoLogic) EmployInfo(req *types.InfoEmployinfoReq) (resp *types.Reply, err error) {
+func (l *EmployInfoLogic) EmployInfo(req *types.InfoEmployinfoReq) (resp *types.InfoReply, err error) {
 	// todo: add your logic here and delete this line
-	resp = &types.Reply{}
+	resp = &types.InfoReply{}
 	employService := &service.EmPloyService{}
-	resp.Data = employService.InfoEmployinfo(req)
+	resp.Data, resp.BatchEmploy = employService.InfoEmployinfo(req)
 	return
 }

+ 149 - 36
api/internal/service/employService.go

@@ -32,37 +32,61 @@ type PersonSmmary struct {
 }
 
 // InfoEmployinfo 收录情况查询
-func (e *EmPloyService) InfoEmployinfo(in *types.InfoEmployinfoReq) []map[string]interface{} {
+func (e *EmPloyService) InfoEmployinfo(in *types.InfoEmployinfoReq) ([]map[string]interface{}, int64) {
 	var data []map[string]interface{}
 	depIDArr := ""
+	batchEmploy := int64(0)
 	if in.EntNicheDis > 0 {
 		//查询所有部门标识
 		deptArr := MC.MainMysql.SelectBySql("select GROUP_CONCAT(DISTINCT b.id)  as depIDArr from entniche_department_parent a"+
 			"     INNER JOIN entniche_department b "+
 			"on (b.ent_id=? and (b.id=? or (a.pid=? and a.id=b.id)))", in.EntId, in.EntDeptId, in.EntDeptId)
 		if len(*deptArr) == 0 {
-			return data
+			return data, batchEmploy
 		}
 		depIDArr = common.InterfaceToStr((*deptArr)[0]["depIDArr"])
 		if depIDArr == "" {
-			return data
+			return data, batchEmploy
+		}
+	}
+	//是否可以批量收录配置回显
+
+	accountId := int64(0)
+	if in.PositionType == 0 {
+		accountId = in.AccountId
+	} else {
+		accountId = in.EntAccountId
+	}
+	configData := MC.CrmMysql.FindOne("config_tenant", map[string]interface{}{
+		"account_id": accountId,
+	}, "batch_employ", "")
+	if configData != nil {
+		batchEmploy = gconv.Int64((*configData)["batch_employ"])
+	}
+	//版本查询
+	res := MC.Middleground.ResourceCenter.Haspowers(in.AccountId, in.EntAccountId, in.EntId, in.EntUserId)
+	version := 0
+	for _, pCode := range res.Powers {
+		//0:通用版 1:物业专版
+		if pCode == "bi_yx_wyzb" {
+			version = 1
 		}
 	}
 	for _, v := range strings.Split(in.IdArr, ",") {
 		id := ""
 		id = idFormat(v, in.EmployType)
-		table, findKey, employKey, source, projectId, isNiJian := employKeyFormat(in.EmployType, id)
+		table, findKey, employKey, source, projectId, isNiJian, subtype := employKeyFormat(in.EmployType, id)
 		if id == "" {
 			log.Println(v, in.EmployType, "该信息查询不到数据")
 			continue
 		}
 		if in.EntNicheDis > 0 {
-			data = append(data, employInfoEnt(v, table, id, employKey, findKey, depIDArr, source, in, projectId, isNiJian))
+			data = append(data, employInfoEnt(v, table, id, employKey, findKey, depIDArr, source, in, projectId, isNiJian, version, subtype))
 		} else {
-			data = append(data, employInfoPerson(v, table, id, employKey, findKey, source, in, projectId, isNiJian))
+			data = append(data, employInfoPerson(v, table, id, employKey, findKey, source, in, projectId, isNiJian, version, subtype))
 		}
 	}
-	return data
+	return data, batchEmploy
 }
 
 // EmployOperate 收录操作
@@ -79,8 +103,7 @@ func (e *EmPloyService) EmployOperate(in *types.EmployOperateReq) (bool, string)
 			findMap := map[string]interface{}{}
 			findMap["position_id"] = in.PositionId
 			id = idFormat(v1, in.EmployType)
-			table, _, employKey, source, projectId, isNijian := employKeyFormat(in.EmployType, id)
-			findMap["source"] = source
+			table, _, employKey, source, projectId, isNijian, _ := employKeyFormat(in.EmployType, id)
 			if isNijian {
 				findMap[employKey] = projectId
 			} else {
@@ -122,6 +145,9 @@ func (e *EmPloyService) EmployOperate(in *types.EmployOperateReq) (bool, string)
 				fool = true
 			} else {
 				//取消收录
+				if in.From == "jhfp" {
+					findMap["type"] = 3
+				}
 				if MC.CrmMysql.Count(table, findMap) > 0 {
 					ok := MC.CrmMysql.UpdateByTx(tx, table, findMap, map[string]interface{}{
 						"status": -1,
@@ -209,6 +235,9 @@ func infoFind(id string, v1 string) map[string]interface{} {
 		pushTime = time.Unix(common.Int64All(obj["publishtime"]), 0).Format(date.Date_Full_Layout)
 		data["source"] = 1
 		data["source_id"] = id
+		if subtype == "拟建" {
+			data["source"] = 2
+		}
 		if toptype == "采购意向" || toptype == "预告" || toptype == "招标" || toptype == "" {
 			data["type"] = 2
 		} else {
@@ -220,14 +249,12 @@ func infoFind(id string, v1 string) map[string]interface{} {
 				data["type"] = 1
 			}
 		}
-
 		if obj["projectinfo"] != nil {
 			projectinfo := common.ObjToMap(obj["projectinfo"])
 			if (*projectinfo)["attachments"] != nil {
 				data["annex"] = 1
 			}
 		}
-
 		data["publishtime"] = pushTime
 		data["show_time"] = pushTime
 		data["projectname"] = obj["projectname"]
@@ -280,13 +307,14 @@ func idFormat(encryptionId string, employType int64) string {
 }
 
 // employKeyFormat 根据收录类型 字段处理 table,findKey,employKey,source
-func employKeyFormat(employType int64, id string) (string, string, string, int64, string, bool) {
+func employKeyFormat(employType int64, id string) (string, string, string, int64, string, bool, string) {
 	table := ""
 	employKey := "company_id"
 	findKey := "employ_custom_id"
 	projectId := ""
 	source := int64(0)
 	IsNiJian := false
+	subtype := ""
 	switch employType {
 	case 1:
 		table = entity.EMPLOY_INFO
@@ -305,7 +333,7 @@ func employKeyFormat(employType int64, id string) (string, string, string, int64
 			obj = *aobj
 		}
 		if ok && obj != nil && len(obj) > 0 {
-			subtype := common.InterfaceToStr(obj["subtype"])
+			subtype = common.InterfaceToStr(obj["subtype"])
 			if subtype == "拟建" {
 				project, _ := MC.MgoProject.FindOne("projectset_proposed", map[string]interface{}{
 					"ids": id,
@@ -329,7 +357,7 @@ func employKeyFormat(employType int64, id string) (string, string, string, int64
 		employKey = "source_id"
 		findKey = "employ_info_id"
 	}
-	return table, findKey, employKey, source, projectId, IsNiJian
+	return table, findKey, employKey, source, projectId, IsNiJian, subtype
 
 }
 
@@ -448,7 +476,6 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
 				findMap := map[string]interface{}{
 					"position_id": positionId,
 					"source_id":   v["source_id"],
-					"source":      v["source"],
 				}
 				if MC.CrmMysql.Count(entity.EMPLOY_INFO, findMap) == 0 {
 					//新增
@@ -466,7 +493,6 @@ func (e *EmPloyService) DistributePerson(in *types.EmployDistributeReq) bool {
 				findMap := map[string]interface{}{
 					"position_id": in.PositionId,
 					"source_id":   v["source_id"],
-					"source":      v["source"],
 				}
 				employPositionId := v["position_id"]
 				if employPositionId != in.PositionId {
@@ -555,7 +581,7 @@ func niJianHandle(infoId string, data map[string]interface{}, v1, pushTime strin
 }
 
 // 个人收录情况查询
-func employInfoPerson(v, table, id, employKey, findKey string, source int64, in *types.InfoEmployinfoReq, projectId string, isNiJian bool) map[string]interface{} {
+func employInfoPerson(v, table, id, employKey, findKey string, source int64, in *types.InfoEmployinfoReq, projectId string, isNiJian bool, version int, subtype string) map[string]interface{} {
 	valueMap := map[string]interface{}{
 		"id": v,
 	}
@@ -565,27 +591,67 @@ func employInfoPerson(v, table, id, employKey, findKey string, source int64, in
 	} else {
 		sourceId = id
 	}
-	employData := &map[string]interface{}{}
+
+	employData := &[]map[string]interface{}{}
 	if in.EmployType == 1 {
-		employData = MC.CrmMysql.FindOne(table, map[string]interface{}{
+		employData = MC.CrmMysql.Find(table, map[string]interface{}{
 			employKey:     sourceId,
 			"position_id": in.PositionId,
-			"source":      source,
-		}, "is_ignore,status,id,type", "")
+		}, "is_ignore,status,id,type", "id", -1, -1)
 	} else {
-		employData = MC.CrmMysql.FindOne(table, map[string]interface{}{
+		employData = MC.CrmMysql.Find(table, map[string]interface{}{
 			employKey:     sourceId,
 			"position_id": in.PositionId,
-			"source":      source,
-		}, "is_ignore,status,id", "")
+		}, "is_ignore,status,id", "id", -1, -1)
 	}
 	employId := int64(0)
 	if employData != nil && len(*employData) > 0 {
-		valueMap["isIgnore"] = common.If(common.Int64All((*employData)["is_ignore"]) == 1, true, false)
-		valueMap["isEmploy"] = common.If(common.Int64All((*employData)["status"]) == 1, true, false)
-		valueMap["type"] = common.Int64All((*employData)["type"])
-		employId = common.Int64All((*employData)["id"])
-		valueMap["employId"] = employId
+		if (subtype == "成交" || subtype == "中标" || subtype == "合同" || subtype == "验收" || subtype == "违规") && in.EmployType == 1 && version == 1 {
+			employ2 := false
+			employ3 := false
+			employIgnore := false
+			employType := int64(0)
+			is_ignore := int64(0)
+			for _, v1 := range *employData {
+				employType := common.Int64All(v1["type"])
+				employStatus := common.Int64All(v1["status"])
+				if in.From == "jhfp" && employType == 3 {
+					is_ignore = common.Int64All(v1["is_ignore"])
+				} else {
+					is_ignore = common.Int64All(v1["is_ignore"])
+				}
+				switch employType {
+				case 2:
+					if employStatus == 1 {
+						employ2 = true
+					}
+				case 3:
+					if employStatus == 1 {
+						employ3 = true
+					}
+				}
+				if is_ignore > 0 {
+					employIgnore = true
+				}
+				employType = common.Int64All(v1["type"])
+				employId = common.Int64All(v1["id"])
+			}
+			valueMap["isIgnore"] = employIgnore
+			if in.From == "jhfp" {
+				valueMap["isEmploy"] = employ3
+			} else {
+				valueMap["isEmploy"] = common.If(employ2 && employ3, true, false)
+			}
+			valueMap["type"] = employType
+			valueMap["employId"] = employId
+		} else {
+			valueMap["isIgnore"] = common.If(common.Int64All((*employData)[0]["is_ignore"]) == 1, true, false)
+			valueMap["isEmploy"] = common.If(common.Int64All((*employData)[0]["status"]) == 1, true, false)
+			valueMap["type"] = common.Int64All((*employData)[0]["type"])
+			employId = common.Int64All((*employData)[0]["id"])
+			valueMap["employId"] = employId
+		}
+
 	} else {
 		valueMap["isIgnore"] = false
 		valueMap["isEmploy"] = false
@@ -624,7 +690,7 @@ func employInfoPerson(v, table, id, employKey, findKey string, source int64, in
 }
 
 // 企业收录情况查询
-func employInfoEnt(v, table, id, employKey, findKey, depIDArr string, source int64, in *types.InfoEmployinfoReq, projectId string, isNiJian bool) map[string]interface{} {
+func employInfoEnt(v, table, id, employKey, findKey, depIDArr string, source int64, in *types.InfoEmployinfoReq, projectId string, isNiJian bool, version int, subtype string) map[string]interface{} {
 	valueMap := map[string]interface{}{
 		"id":          v,
 		"isIgnore":    false,
@@ -642,17 +708,64 @@ func employInfoEnt(v, table, id, employKey, findKey, depIDArr string, source int
 	}
 	employData := &[]map[string]interface{}{}
 	if in.EmployType == 1 {
-		employData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status,MAX(type) as  type from  %s   where %s=? and  source=? and    ent_dept_id in  (%s) ", table, employKey, depIDArr), sourceId, source)
+		if (subtype == "成交" || subtype == "中标" || subtype == "合同" || subtype == "验收" || subtype == "违规") && in.EmployType == 1 && version == 1 {
+			//物业版本查询
+			employData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  id,is_ignore,status ,type  from  %s   where %s=?  and status =1 and  source=? and    ent_dept_id in  (%s) ", table, employKey, depIDArr), sourceId, source)
+		} else {
+			employData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status,MAX(type) as  type from  %s   where %s=? and  source=? and    ent_dept_id in  (%s) ", table, employKey, depIDArr), sourceId, source)
+		}
 	} else {
 		employData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status from  %s   where %s=? and  source=? and    ent_dept_id in  (%s) ", table, employKey, depIDArr), sourceId, source)
 	}
 	employArrStr := ""
 	if employData != nil && len(*employData) > 0 {
-		valueMap["isIgnore"] = common.If(common.Int64All((*employData)[0]["is_ignore"]) == 1, true, false)
-		valueMap["isEmploy"] = common.If(common.Int64All((*employData)[0]["status"]) == 1, true, false)
-		valueMap["type"] = common.Int64All((*employData)[0]["type"])
-		employArrStr = common.InterfaceToStr((*employData)[0]["employIdArr"])
-		valueMap["employId"] = strings.Split(employArrStr, ",")[0]
+		if (subtype == "成交" || subtype == "中标" || subtype == "合同" || subtype == "验收" || subtype == "违规") && in.EmployType == 1 {
+			employ2 := false
+			employ3 := false
+			employIgnore := false
+			employType := int64(0)
+			employId := int64(0)
+			is_ignore := int64(0)
+			for _, v1 := range *employData {
+				employType := common.Int64All(v1["type"])
+				employStatus := common.Int64All(v1["status"])
+				if in.From == "jhfp" && employType == 3 {
+					is_ignore = common.Int64All(v1["is_ignore"])
+				} else {
+					is_ignore = common.Int64All(v1["is_ignore"])
+				}
+				switch employType {
+				case 2:
+					if employStatus == 1 {
+						employ2 = true
+					}
+				case 3:
+					if employStatus == 1 {
+						employ3 = true
+					}
+				}
+				if is_ignore > 0 {
+					employIgnore = true
+				}
+				employType = common.Int64All(v1["type"])
+				employId = common.Int64All(v1["id"])
+			}
+			valueMap["isIgnore"] = employIgnore
+			if in.From == "jhfp" {
+				valueMap["isEmploy"] = employ3
+			} else {
+				valueMap["isEmploy"] = common.If(employ2 && employ3, true, false)
+			}
+
+			valueMap["type"] = employType
+			valueMap["employId"] = employId
+		} else {
+			valueMap["isIgnore"] = common.If(common.Int64All((*employData)[0]["is_ignore"]) == 1, true, false)
+			valueMap["isEmploy"] = common.If(common.Int64All((*employData)[0]["status"]) == 1, true, false)
+			valueMap["type"] = common.Int64All((*employData)[0]["type"])
+			employArrStr = common.InterfaceToStr((*employData)[0]["employIdArr"])
+			valueMap["employId"] = strings.Split(employArrStr, ",")[0]
+		}
 	} else {
 		valueMap["isIgnore"] = false
 		valueMap["isIgnore"] = false

+ 85 - 0
api/internal/types/types.go

@@ -14,6 +14,13 @@ type CanAddReq struct {
 	Key            string `json:"key"`                     //创建线索:more_create_clue 创建机会:more_create_chance 创建客户:more_create_custom
 }
 
+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 {
 	AppId        string  `header:"appId,default=10000"`
 	BaseUserId   int64   `header:"newUserId"`
@@ -30,7 +37,85 @@ type ClueAddReq struct {
 	User         []int64 `json:"user,optional"`         //企业用户id
 	EmployInfoId int64   `json:"employInfoId,optional"` //资讯收录id
 	CreateName   string  `json:"createName"`            //创建人
+<<<<<<< HEAD
 	Channel      string  `json:"channel"`               //渠道来源:网页、手动创建
+=======
+}
+
+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转办
+	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"`               //机会来源
+}
+
+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"`           //来源
+>>>>>>> master
 }
 
 type CustomAddReq struct {

+ 5 - 5
service/util.go

@@ -8,7 +8,7 @@ import (
 	"github.com/gogf/gf/v2/util/gconv"
 )
 
-//CanAdd 是否允许多人针对一个创建
+// CanAdd 是否允许多人针对一个创建
 func CanAdd(entId int64, key string, employInfoId, employCustomId, positionId int64) (status int64, error_msg string) {
 	if employInfoId <= 0 && employCustomId <= 0 {
 		return 1, ""
@@ -49,7 +49,7 @@ func CanAdd(entId int64, key string, employInfoId, employCustomId, positionId in
 					if positionId == position_id {
 						return 1, ""
 					}
-					return -1, fmt.Sprintf("%v已经基于该咨询创建了线索", v["create_person"])
+					return -1, fmt.Sprintf("%v已经基于该资讯创建了线索", v["create_person"])
 				}
 			}
 
@@ -64,7 +64,7 @@ func CanAdd(entId int64, key string, employInfoId, employCustomId, positionId in
 					if positionId == position_id {
 						return 1, ""
 					}
-					return -1, fmt.Sprintf("%v已经基于该咨询创建了机会", v["create_person"])
+					return -1, fmt.Sprintf("%v已经基于该资讯创建了机会", v["create_person"])
 				}
 			}
 
@@ -77,7 +77,7 @@ func CanAdd(entId int64, key string, employInfoId, employCustomId, positionId in
 						if positionId == position_id {
 							return 1, ""
 						}
-						return -1, fmt.Sprintf("%v已经基于该咨询创建了客户", v["create_person"])
+						return -1, fmt.Sprintf("%v已经基于该资讯创建了客户", v["create_person"])
 					}
 				}
 			} else if employCustomId > 0 {
@@ -110,7 +110,7 @@ func CanAdd(entId int64, key string, employInfoId, employCustomId, positionId in
 	return 1, ""
 }
 
-//获取sql语句的in操作相关参数
+// 获取sql语句的in操作相关参数
 func GetInForCommaArr(ids []int64) ([]interface{}, string) {
 	args := []interface{}{}
 	ws := []string{}