officalDay

This commit is contained in:
jiangyong27 2024-12-04 14:04:52 +08:00
parent bcc81e7ce3
commit 10b28f4b81
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func (s *Staff) MontorWorkAge() {
OfficialDate, _ := time.ParseInLocation("2006-01-02", staff.OfficialDate, time.Local)
entryMonth := (nowDate.Year()-entryDate.Year())*12 + int(nowDate.Month()) - int(entryDate.Month())
officelDay := (OfficialDate.Unix() - nowDate.Unix()) / 86400
officalDay := (OfficialDate.Unix() - nowDate.Unix()) / 86400
log.Infof("staff[%s] entryDate[%s] spanMonth[%.1f]", staff.Username, staff.EntryDate, float64(entryMonth)/12.0)
if nowDate.Day() == 1 && entryMonth%6 == 0 {
message := make([]string, 0)
@ -52,7 +52,7 @@ func (s *Staff) MontorWorkAge() {
}
}
if officelDay <= 30 && officelDay%7 == 0 {
if officalDay > 0 && officalDay <= 30 && officalDay%7 == 0 {
message := make([]string, 0)
message = append(message, fmt.Sprintf("【员工转账提醒】[%s]", staff.Realname))
message = append(message, fmt.Sprintf("入职时间:%s", staff.EntryDate))