正在显示
5 个修改的文件
包含
17 行增加
和
6 行删除
| @@ -49,9 +49,9 @@ func (notices *notifySms) addTask(task *domain.LogSms) error { | @@ -49,9 +49,9 @@ func (notices *notifySms) addTask(task *domain.LogSms) error { | ||
| 49 | 49 | ||
| 50 | // RunTask 执行短信通知任务 | 50 | // RunTask 执行短信通知任务 |
| 51 | func (notices *notifySms) runTask() { | 51 | func (notices *notifySms) runTask() { |
| 52 | - // if constant.Env != "prd" { | ||
| 53 | - // return | ||
| 54 | - // } | 52 | + if constant.Env != "prd" { |
| 53 | + return | ||
| 54 | + } | ||
| 55 | timer := time.NewTimer(notices.interval) | 55 | timer := time.NewTimer(notices.interval) |
| 56 | for { | 56 | for { |
| 57 | select { | 57 | select { |
| @@ -104,13 +104,13 @@ where 1=1 | @@ -104,13 +104,13 @@ where 1=1 | ||
| 104 | and staff_assess.cycle_id =? and "types" ='self' | 104 | and staff_assess.cycle_id =? and "types" ='self' |
| 105 | and staff_assess.evaluation_project_id in ( | 105 | and staff_assess.evaluation_project_id in ( |
| 106 | select t_project_4.project_id from t_project_4 | 106 | select t_project_4.project_id from t_project_4 |
| 107 | -) order by evaluation_item_used.sort_by ` | 107 | +) ` |
| 108 | condition := []interface{}{cycleId} | 108 | condition := []interface{}{cycleId} |
| 109 | if len(exportUserIds) > 0 { | 109 | if len(exportUserIds) > 0 { |
| 110 | sqlStr += ` and staff_assess.target_user->>'userId' in(?) ` | 110 | sqlStr += ` and staff_assess.target_user->>'userId' in(?) ` |
| 111 | condition = append(condition, pg.In(exportUserIds)) | 111 | condition = append(condition, pg.In(exportUserIds)) |
| 112 | } | 112 | } |
| 113 | - sqlStr = withSql + sqlStr | 113 | + sqlStr = withSql + sqlStr + " order by evaluation_item_used.sort_by " |
| 114 | result := []DataEvaluationItemUsed2{} | 114 | result := []DataEvaluationItemUsed2{} |
| 115 | tx := d.transactionContext.PgTx | 115 | tx := d.transactionContext.PgTx |
| 116 | _, err := tx.Query(&result, sqlStr, condition...) | 116 | _, err := tx.Query(&result, sqlStr, condition...) |
| @@ -4,6 +4,8 @@ import ( | @@ -4,6 +4,8 @@ import ( | ||
| 4 | "bytes" | 4 | "bytes" |
| 5 | "encoding/json" | 5 | "encoding/json" |
| 6 | "errors" | 6 | "errors" |
| 7 | + "fmt" | ||
| 8 | + "io" | ||
| 7 | "net/http" | 9 | "net/http" |
| 8 | "time" | 10 | "time" |
| 9 | 11 | ||
| @@ -55,6 +57,8 @@ func (ssrv SmsService) SendNoticeSms(phone string, tplId int, tplValues map[stri | @@ -55,6 +57,8 @@ func (ssrv SmsService) SendNoticeSms(phone string, tplId int, tplValues map[stri | ||
| 55 | jDecoder := json.NewDecoder(resp.Body) | 57 | jDecoder := json.NewDecoder(resp.Body) |
| 56 | err = jDecoder.Decode(&result) | 58 | err = jDecoder.Decode(&result) |
| 57 | if err != nil { | 59 | if err != nil { |
| 60 | + bt, _ := io.ReadAll(resp.Body) | ||
| 61 | + fmt.Println(string(bt)) | ||
| 58 | return err | 62 | return err |
| 59 | } | 63 | } |
| 60 | if result.Code != 0 { | 64 | if result.Code != 0 { |
| @@ -13,3 +13,10 @@ func TestPushInfo(t *testing.T) { | @@ -13,3 +13,10 @@ func TestPushInfo(t *testing.T) { | ||
| 13 | } | 13 | } |
| 14 | t.Logf("%v", resp) | 14 | t.Logf("%v", resp) |
| 15 | } | 15 | } |
| 16 | + | ||
| 17 | +func TestSms(t *testing.T) { | ||
| 18 | + c := SmsService{} | ||
| 19 | + err := c.SendNoticeSms("18060823798", 5475050, map[string]string{ | ||
| 20 | + "name": "名字1"}) | ||
| 21 | + t.Log(err) | ||
| 22 | +} |
| @@ -33,7 +33,7 @@ func init() { | @@ -33,7 +33,7 @@ func init() { | ||
| 33 | web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存) | 33 | web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存) |
| 34 | web.NSCtrlPost("/summary", (*controllers.StaffAssessController).QuerySummary), //员工绩效-项目管理-总览 | 34 | web.NSCtrlPost("/summary", (*controllers.StaffAssessController).QuerySummary), //员工绩效-项目管理-总览 |
| 35 | web.NSCtrlPost("/summary/users", (*controllers.StaffAssessController).QueryMemberSummary), //员工绩效-综合管理-成员列表 | 35 | web.NSCtrlPost("/summary/users", (*controllers.StaffAssessController).QueryMemberSummary), //员工绩效-综合管理-成员列表 |
| 36 | - web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标 | 36 | + web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效指标 |
| 37 | web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标 | 37 | web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标 |
| 38 | web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表 | 38 | web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表 |
| 39 | web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结 | 39 | web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结 |
-
请 注册 或 登录 后发表评论