作者 tangxvhui

修复bug

... ... @@ -49,9 +49,9 @@ func (notices *notifySms) addTask(task *domain.LogSms) error {
// RunTask 执行短信通知任务
func (notices *notifySms) runTask() {
// if constant.Env != "prd" {
// return
// }
if constant.Env != "prd" {
return
}
timer := time.NewTimer(notices.interval)
for {
select {
... ...
... ... @@ -104,13 +104,13 @@ where 1=1
and staff_assess.cycle_id =? and "types" ='self'
and staff_assess.evaluation_project_id in (
select t_project_4.project_id from t_project_4
) order by evaluation_item_used.sort_by `
) `
condition := []interface{}{cycleId}
if len(exportUserIds) > 0 {
sqlStr += ` and staff_assess.target_user->>'userId' in(?) `
condition = append(condition, pg.In(exportUserIds))
}
sqlStr = withSql + sqlStr
sqlStr = withSql + sqlStr + " order by evaluation_item_used.sort_by "
result := []DataEvaluationItemUsed2{}
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
... ...
... ... @@ -4,6 +4,8 @@ import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"time"
... ... @@ -55,6 +57,8 @@ func (ssrv SmsService) SendNoticeSms(phone string, tplId int, tplValues map[stri
jDecoder := json.NewDecoder(resp.Body)
err = jDecoder.Decode(&result)
if err != nil {
bt, _ := io.ReadAll(resp.Body)
fmt.Println(string(bt))
return err
}
if result.Code != 0 {
... ...
... ... @@ -13,3 +13,10 @@ func TestPushInfo(t *testing.T) {
}
t.Logf("%v", resp)
}
func TestSms(t *testing.T) {
c := SmsService{}
err := c.SendNoticeSms("18060823798", 5475050, map[string]string{
"name": "名字1"})
t.Log(err)
}
... ...
... ... @@ -33,7 +33,7 @@ func init() {
web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存)
web.NSCtrlPost("/summary", (*controllers.StaffAssessController).QuerySummary), //员工绩效-项目管理-总览
web.NSCtrlPost("/summary/users", (*controllers.StaffAssessController).QueryMemberSummary), //员工绩效-综合管理-成员列表
web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效指标
web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表
web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结
... ...