切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
about a year ago
提交
a0ce957f2c67979989d3abcf254574e4f3813a1c
1 个父辈
8ac9bbea
更新
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
48 行增加
和
27 行删除
pkg/application/notify/sms_staff_assess.go
pkg/application/notify/sms_staff_assess.go
查看文件 @
a0ce957
...
...
@@ -19,33 +19,6 @@ func (notices notifyStaffAssess) from() string {
}
// makeNotify 生成待执行的短信通知内容
// func (notices notifyStaffAssess) makeNotify(param *domain.StaffAssess) *domain.LogSms {
// newSms := domain.LogSms{
// Id: 0,
// Phone: param.Executor.Account,
// TemplateId: 5475050,
// Template: "您好,#name#,百忙之中不要忘记填写今天的绩效自评反馈哦",
// Value: map[string]string{
// "name": param.Executor.UserName,
// },
// Result: "",
// Status: domain.SmsWait,
// From: notices.from(),
// Index: param.Id,
// // ExecuteAt: executeAt,
// CreatedAt: time.Now(),
// }
// // 每日自评 结束前30 分钟
// // newSms.ExecuteAt = param.EndTime.Add(-1800 * time.Second)
// //改为 固定在截止时间 那天的 前一天晚上10
// y, m, d := param.EndTime.Local().Date()
// dayTime := time.Date(y, m, d, 0, 0, 0, 0, time.Local)
// newSms.ExecuteAt = dayTime.Add(-2 * time.Hour)
// return &newSms
// }
//
// makeNotify 生成待执行的短信通知内容
func
(
notices
notifyStaffAssess
)
makeNotify
(
param
*
domain
.
StaffAssess
)
*
domain
.
LogSms
{
year
,
month
,
dayNumber
:=
param
.
BeginTime
.
Local
()
.
Date
()
...
...
@@ -109,3 +82,51 @@ func (notices notifyStaffAssess) ifSend(index int) (bool, error) {
}
return
false
,
nil
}
// TODO
type
notifyStaffAssess2
struct
{
}
var
_
notifySendOrNot
=
(
*
notifyStaffAssess2
)(
nil
)
func
(
notices
notifyStaffAssess2
)
from
()
string
{
return
"StaffAssess2"
}
// makeNotify 生成待执行的短信通知内容
func
(
notices
notifyStaffAssess2
)
makeNotify
(
param
*
domain
.
StaffAssess
)
*
domain
.
LogSms
{
year
,
month
,
dayNumber
:=
param
.
BeginTime
.
Local
()
.
Date
()
// 限制只有 在每月的15号进行每日评估填报时,才进行短信消息提醒
if
dayNumber
!=
15
{
return
nil
}
// 每月15日的每日评估必做,15日上午9点 发送短信提醒
dayTime
:=
time
.
Date
(
year
,
month
,
dayNumber
,
9
,
0
,
0
,
0
,
time
.
Local
)
newSms
:=
domain
.
LogSms
{
Id
:
0
,
Phone
:
param
.
Executor
.
Account
,
TemplateId
:
5824230
,
Template
:
"您好,#name#,百忙之中不要忘记填写#date#的绩效自评反馈哦"
,
Value
:
map
[
string
]
string
{
"name"
:
param
.
Executor
.
UserName
,
"date"
:
"本月15日"
,
},
Result
:
""
,
Status
:
domain
.
SmsWait
,
From
:
notices
.
from
(),
Index
:
param
.
Id
,
ExecuteAt
:
dayTime
,
CreatedAt
:
time
.
Now
(),
}
return
&
newSms
}
// ifSend 确认是否发送通知
func
(
notices
notifyStaffAssess2
)
ifSend
(
index
int
)
(
bool
,
error
)
{
if
constant
.
Env
!=
"prd"
{
return
false
,
nil
}
return
true
,
nil
}
...
...
请
注册
或
登录
后发表评论