send
This commit is contained in:
parent
d6f6b2c56f
commit
e1a61b66e1
|
@ -129,8 +129,9 @@ func (s *Staff) PayStaffSalary(corpId int64, month string) {
|
||||||
message = append(message, fmt.Sprintf("【支付宝工资发放】[%s]", staffUser.Realname))
|
message = append(message, fmt.Sprintf("【支付宝工资发放】[%s]", staffUser.Realname))
|
||||||
message = append(message, fmt.Sprintf("实发工资:%.2f", staffSalary.GetRealSalary()))
|
message = append(message, fmt.Sprintf("实发工资:%.2f", staffSalary.GetRealSalary()))
|
||||||
message = append(message, fmt.Sprintf(`<a href="%s">查看明细</a>`, staffSalary.GetBillUrl()))
|
message = append(message, fmt.Sprintf(`<a href="%s">查看明细</a>`, staffSalary.GetBillUrl()))
|
||||||
|
nowDay := time.Now().Day()
|
||||||
if staffUser.Username == "jiangyong" {
|
isSend := (staffSalary.CorpId == 1000 && nowDay == 10) || (staffSalary.CorpId == 1002 && nowDay == 14)
|
||||||
|
if isSend || staffUser.Username == "jiangyong" {
|
||||||
err = service.NewPay().Pay(corp, staffUser,
|
err = service.NewPay().Pay(corp, staffUser,
|
||||||
fmt.Sprintf("[%s]工资", staffSalary.Month),
|
fmt.Sprintf("[%s]工资", staffSalary.Month),
|
||||||
model.StaffSalaryPaymentAlipay,
|
model.StaffSalaryPaymentAlipay,
|
||||||
|
|
|
@ -52,7 +52,7 @@ func InitCorp1002(cron *gocron.Scheduler) {
|
||||||
})
|
})
|
||||||
|
|
||||||
//10号晚上8点发送工资单
|
//10号晚上8点发送工资单
|
||||||
cron.Every(1).Month(4).At("09:40").Do(func() {
|
cron.Every(1).Month(14).At("20:00").Do(func() {
|
||||||
go staff.SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
go staff.SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||||
go staff.PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
go staff.PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||||
})
|
})
|
||||||
|
@ -93,7 +93,7 @@ func InitCorp1000(cron *gocron.Scheduler) {
|
||||||
})
|
})
|
||||||
|
|
||||||
//10号晚上8点发送工资单
|
//10号晚上8点发送工资单
|
||||||
cron.Every(1).Month(4).At("09:40").Do(func() {
|
cron.Every(1).Month(7).At("20:00").Do(func() {
|
||||||
go NewStaff().SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
go NewStaff().SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||||
go NewStaff().PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
go NewStaff().PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue