Browse Source

批量操作配置项回显

WH01243 1 năm trước cách đây
mục cha
commit
d9b16e4090
3 tập tin đã thay đổi với 44 bổ sung22 xóa
  1. 12 9
      api/application.api
  2. 20 4
      api/internal/service/employService.go
  3. 12 9
      api/internal/types/types.go

+ 12 - 9
api/application.api

@@ -84,15 +84,18 @@ type (
 	}
 
 	InfoEmployinfoReq {
-		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"`
+		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
 	}
 
 	CustomAddReq {

+ 20 - 4
api/internal/service/employService.go

@@ -48,6 +48,20 @@ func (e *EmPloyService) InfoEmployinfo(in *types.InfoEmployinfoReq) []map[string
 			return data
 		}
 	}
+	//是否可以批量收录配置回显
+	batchEmploy := 0
+	accountId := int64(0)
+	if in.PositionType == 0 {
+		accountId = in.AccountId
+	} else {
+		accountId = in.EntAccountId
+	}
+	configData := MC.BaseMysql.FindOne("config_tenant", map[string]interface{}{
+		"account_id": accountId,
+	}, "batch_employ", "")
+	if configData != nil {
+		batchEmploy = gconv.Int((*configData)["batch_employ"])
+	}
 	for _, v := range strings.Split(in.IdArr, ",") {
 		id := ""
 		id = idFormat(v, in.EmployType)
@@ -57,9 +71,9 @@ func (e *EmPloyService) InfoEmployinfo(in *types.InfoEmployinfoReq) []map[string
 			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, batchEmploy))
 		} 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, batchEmploy))
 		}
 	}
 	return data
@@ -555,7 +569,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, batchEmploy int) map[string]interface{} {
 	valueMap := map[string]interface{}{
 		"id": v,
 	}
@@ -620,11 +634,12 @@ func employInfoPerson(v, table, id, employKey, findKey string, source int64, in
 		valueMap["isIgnore"] = false
 		valueMap["customCount"] = 0
 	}
+	valueMap["batchEmploy"] = batchEmploy
 	return valueMap
 }
 
 // 企业收录情况查询
-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, batchEmploy int) map[string]interface{} {
 	valueMap := map[string]interface{}{
 		"id":          v,
 		"isIgnore":    false,
@@ -680,5 +695,6 @@ func employInfoEnt(v, table, id, employKey, findKey, depIDArr string, source int
 		valueMap["clueCount"] = 0
 		valueMap["customCount"] = 0
 	}
+	valueMap["batchEmploy"] = batchEmploy
 	return valueMap
 }

+ 12 - 9
api/internal/types/types.go

@@ -84,15 +84,18 @@ type IgnoreOperateReq struct {
 }
 
 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"`
+	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
 }
 
 type CustomAddReq struct {