作者 tangxvhui

调整 短信下发规则

@@ -47,10 +47,6 @@ func (notices notifyStaffAssess) from() string { @@ -47,10 +47,6 @@ func (notices notifyStaffAssess) from() string {
47 // makeNotify 生成待执行的短信通知内容 47 // makeNotify 生成待执行的短信通知内容
48 func (notices notifyStaffAssess) makeNotify(param *domain.StaffAssess) *domain.LogSms { 48 func (notices notifyStaffAssess) makeNotify(param *domain.StaffAssess) *domain.LogSms {
49 year, month, dayNumber := param.BeginTime.Local().Date() 49 year, month, dayNumber := param.BeginTime.Local().Date()
50 - // 限制只有 在每月的15号进行每日评估填报时,才进行短信消息提醒  
51 - if dayNumber != 15 {  
52 - return nil  
53 - }  
54 // 每月15日的每日评估必做,未填写的在晚上10点下发短信提醒 50 // 每月15日的每日评估必做,未填写的在晚上10点下发短信提醒
55 dayTime := time.Date(year, month, dayNumber, 22, 0, 0, 0, time.Local) 51 dayTime := time.Date(year, month, dayNumber, 22, 0, 0, 0, time.Local)
56 newSms := domain.LogSms{ 52 newSms := domain.LogSms{
@@ -77,6 +73,7 @@ func (notices notifyStaffAssess) ifSend(index int) (bool, error) { @@ -77,6 +73,7 @@ func (notices notifyStaffAssess) ifSend(index int) (bool, error) {
77 // if constant.Env != "prd" { 73 // if constant.Env != "prd" {
78 // return false, nil 74 // return false, nil
79 // } 75 // }
  76 +
80 transactionContext, err := factory.CreateTransactionContext(nil) 77 transactionContext, err := factory.CreateTransactionContext(nil)
81 if err != nil { 78 if err != nil {
82 return false, err 79 return false, err
@@ -92,6 +89,11 @@ func (notices notifyStaffAssess) ifSend(index int) (bool, error) { @@ -92,6 +89,11 @@ func (notices notifyStaffAssess) ifSend(index int) (bool, error) {
92 if err != nil { 89 if err != nil {
93 return false, err 90 return false, err
94 } 91 }
  92 + _, _, dayNumber := assessData.BeginTime.Local().Date()
  93 + // 限制只有 在每月的15号进行每日评估填报时,才进行短信消息提醒
  94 + if dayNumber != 15 {
  95 + return false, nil
  96 + }
95 //还未完成评估填写,时发送短信 97 //还未完成评估填写,时发送短信
96 if assessData.Status == domain.StaffAssessUncompleted { 98 if assessData.Status == domain.StaffAssessUncompleted {
97 return true, nil 99 return true, nil