Browse Source

部门集合新增

WH01243 1 year ago
parent
commit
9b23838b4a
1 changed files with 13 additions and 0 deletions
  1. 13 0
      service/infoService.go

+ 13 - 0
service/infoService.go

@@ -20,6 +20,18 @@ func (l *InfoService) Myinfo(sid string) map[string]string {
 	if info_i != nil {
 	if info_i != nil {
 		info_m, _ := info_i.(map[string]interface{})
 		info_m, _ := info_i.(map[string]interface{})
 		entNicheDis := common.Int64All(info_m["entNicheDis"])
 		entNicheDis := common.Int64All(info_m["entNicheDis"])
+		depIDArr := ""
+		if entNicheDis > 0 {
+			//查询所有部门标识
+			entId := gconv.String(info_m["entId"])
+			entDeptId := gconv.String(info_m["entDeptId"])
+			deptArr := entity.JyMysql.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)))", entId, entDeptId, entDeptId)
+			if len(*deptArr) > 0 {
+				depIDArr = common.InterfaceToStr((*deptArr)[0]["depIDArr"])
+			}
+		}
 		infoMap = map[string]string{
 		infoMap = map[string]string{
 			"nickName":     RsaEncrypt([]byte(gconv.String(info_m["s_nickname"]))),
 			"nickName":     RsaEncrypt([]byte(gconv.String(info_m["s_nickname"]))),
 			"entRole":      RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entRole"])))),
 			"entRole":      RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entRole"])))),
@@ -33,6 +45,7 @@ func (l *InfoService) Myinfo(sid string) map[string]string {
 			"entUserId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entUserId"])))),
 			"entUserId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entUserId"])))),
 			"userId":       RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["base_user_id"])))),
 			"userId":       RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["base_user_id"])))),
 			"entDeptId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entDeptId"])))),
 			"entDeptId":    RsaEncrypt([]byte(gconv.String(common.Int64All(info_m["entDeptId"])))),
+			"entChildDept": RsaEncrypt([]byte(depIDArr)),
 		}
 		}
 	}
 	}
 	return infoMap
 	return infoMap