优化功能,通知功能,任务功能

This commit is contained in:
PandaGoAdmin
2021-12-24 16:50:06 +08:00
parent d71b0154f6
commit 816791f148
31 changed files with 521 additions and 72 deletions

View File

@@ -3,6 +3,7 @@ package utils
import (
"bytes"
"github.com/kakuilan/kgo"
"log"
"strings"
"text/template"
)
@@ -68,3 +69,29 @@ func IdsStrToIdsIntGroup(keys string) []int64 {
}
return IDS
}
// 获取部门
// isP 是父ID 否则子ID
func DeptPCIds(deptIds []string, id int64, isP bool) []int64 {
pRes := make([]int64, 0)
cRes := make([]int64, 0)
is := true
for _, deptId := range deptIds {
did := kgo.KConv.Str2Int64(deptId)
log.Println(did)
if is {
pRes = append(pRes, did)
}
if kgo.KConv.Str2Int64(deptId) == id {
is = false
}
if !is {
cRes = append(cRes, did)
}
}
if isP {
return pRes
} else {
return cRes
}
}