vacationDuration4

This commit is contained in:
jiangyong27 2025-05-06 17:44:34 +08:00
parent 867487cc3f
commit ab10f90ac6
2 changed files with 4 additions and 2 deletions

View File

@ -3,8 +3,10 @@ package main
import ( import (
"enterprise/common/config" "enterprise/common/config"
"enterprise/common/global" "enterprise/common/global"
"enterprise/common/model"
_ "enterprise/plugin" _ "enterprise/plugin"
"enterprise/server" "enterprise/server"
"enterprise/worker"
) )
func main() { func main() {
@ -13,7 +15,7 @@ func main() {
config.LoadCorpConfig() config.LoadCorpConfig()
global.InitGlobal() global.InitGlobal()
//worker.NewApproval(1000).Sync("202504", model.ApprovalTypeVacation) worker.NewApproval(1000).Sync("202504", model.ApprovalTypeVacation)
if err := server.Start(); err != nil { if err := server.Start(); err != nil {
panic(err) panic(err)
} }

View File

@ -144,7 +144,7 @@ func (a *Approve) handleVacation(detail *qyweixin.ApproveDetail, spStatus int) {
endTime, _ := time.ParseInLocation("2006-01-02 15:04:05", newData.VacationEndTime, time.Local) endTime, _ := time.ParseInLocation("2006-01-02 15:04:05", newData.VacationEndTime, time.Local)
cnt := 1 cnt := 1
for st := startTime; st.Format("2006-01-02") != endTime.Format("2006-01-02"); st.AddDate(0, 0, 1) { for st := startTime; st.Format("2006-01-02") != endTime.Format("2006-01-02"); st = st.AddDate(0, 0, 1) {
cnt += 1 cnt += 1
} }
if newData.VacationDuration > float64(cnt) { if newData.VacationDuration > float64(cnt) {