|
@@ -14,7 +14,14 @@ func StartCronJob() {
|
|
|
// 创建一个新的 cron 实例
|
|
|
c := cron.New(cron.WithSeconds())
|
|
|
//constr := "0 17 * * * *"
|
|
|
- constr := "*/5 * * * * *"
|
|
|
+ //constr := "*/5 * * * * *"
|
|
|
+ var constr string
|
|
|
+ if global.CONFIG.HTFutures.SyncTask.SyncTaskInterval == "" {
|
|
|
+ constr = "0 0 0 * * *"
|
|
|
+ } else {
|
|
|
+ constr = global.CONFIG.HTFutures.SyncTask.SyncTaskInterval
|
|
|
+ }
|
|
|
+ //constr := "0 0 0 * * *"
|
|
|
// 添加定时任务
|
|
|
_, err := c.AddFunc(constr, func() {
|
|
|
|
|
@@ -89,6 +96,9 @@ func SyncETA() {
|
|
|
}
|
|
|
var Employee []eta.Admin
|
|
|
for _, item := range staffList {
|
|
|
+ if item.LOGINID == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
var department *eta.SysDepartment
|
|
|
department, err = eta.GetDepartmentById(item.SUBCOMPANYID1)
|
|
|
if err != nil {
|
|
@@ -188,6 +198,9 @@ func syncCrmOAInfo() {
|
|
|
}
|
|
|
var Employee []wx_crm.SysUser
|
|
|
for _, item := range staffList {
|
|
|
+ if item.LOGINID == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
idList, departmentErr := GetEmployeeDepartmentList(item.DEPARTMENTID)
|
|
|
if departmentErr != nil {
|
|
|
global.FILE_LOG.Error("获取员工部门组织架构失败:", departmentErr.Error(), "跳过同步员工", item.WORKCODE)
|