作者 tangxvhui

更新

... ... @@ -191,7 +191,8 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -216,7 +217,8 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -241,7 +243,8 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -267,7 +270,8 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -382,7 +386,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
"taskAlias": val.Alias,
"leaderName": val.LeaderName,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -407,7 +414,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
"taskAlias": val.Alias,
"leaderName": val.LeaderName,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ... @@ -432,7 +442,10 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
Content: s,
})
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"id": strconv.Itoa(val.Id),
"taskName": val.Name,
"taskAlias": val.Alias,
"leaderName": val.LeaderName,
}
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
... ...
... ... @@ -386,9 +386,9 @@ func (d *TaskDao) IncreaseAnomaly(id []int, incr int) error {
// TaskStageData
type TaskStageData struct {
Id int
Name string
LeaderName string
Id int `pg:"id"`
Name string `pg:"name"`
LeaderName string `pg:"leader_name"`
}
// 根据负责人获取超期未完成的异常的里程碑任务
... ...
... ... @@ -3,6 +3,7 @@ package repository
import (
"errors"
"fmt"
"strconv"
"time"
"github.com/go-pg/pg/v10"
... ... @@ -135,6 +136,16 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d
if val, ok := queryOptions["status"]; ok {
query.Where("task.status=?", val)
}
if val, ok := queryOptions["limit"]; ok {
if limit, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
query.Limit(limit)
}
}
if val, ok := queryOptions["offset"]; ok {
if offset, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
query.Offset(offset)
}
}
query.Order("id desc")
count, err := query.SelectAndCount()
if err != nil {
... ...