作者 tangxvhui

暂存

... ... @@ -451,6 +451,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageModify(param *command.Ge
_, messageList, err := messageRepo.Find(map[string]interface{}{
"types": domain.MessageTypesTaskModify,
"targetUserId": param.UserId,
"readFlag": domain.MessageUnread,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查个人消息的消息"+err.Error())
... ...
... ... @@ -14,4 +14,5 @@ type TaskItem struct {
StageD TaskStage `json:"stageD"` // 里程碑4
StageE TaskStage `json:"stageE"` // 里程碑5
UpdatedAt string `json:"updatedAt"` //
Anomaly int `json:"anomaly"` //异常反馈情况
}
... ...
... ... @@ -12,4 +12,5 @@ type TaskRecordAdapter struct {
AssistContent string `json:"assistContent" ` //comment:"上级辅导内容"
TaskStageCheck TaskStage `json:"taskStageCheck" ` //comment:"提交的里程碑"
CreatedAt string `json:"createdAt" ` //格式2006-01-02comment:"创建时间"
AnomalyState int `json:"anomalyState"` //
}
... ...
... ... @@ -297,7 +297,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string]
for _, val := range markStage {
for _, val2 := range taskData.RelatedUser {
t1 := time.Unix(val.PlanCompletedAt, 0).Format("2006-01-02")
s := fmt.Sprintf("【%s 任务里程碑 %s 完成时间变更为 %s,请知晓", taskData.Name, val.Name, t1)
s := fmt.Sprintf("【%s 任务里程碑 %s 完成时间变更为 %s,请知晓", taskData.Name, val.Name, t1)
payload := map[string]string{
"id": strconv.Itoa(val.Id),
"taskName": taskData.Name,
... ... @@ -577,6 +577,7 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
Status: int(val.Status),
Level: val.Level,
LevelName: val.LevelName,
Anomaly: val.Anomaly,
// StageA: adapter.TaskStage{},
// StageB: adapter.TaskStage{},
// StageC: adapter.TaskStage{},
... ... @@ -725,6 +726,7 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i
Status: val.TaskStatus,
Level: val.Level,
LevelName: val.LevelName,
Anomaly: val.Anomaly,
// StageA: adapter.TaskStage{},
// StageB: adapter.TaskStage{},
// StageC: adapter.TaskStage{},
... ... @@ -834,6 +836,7 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s
Status: val.TaskStatus,
Level: val.Level,
LevelName: val.LevelName,
Anomaly: val.Anomaly,
// StageA: adapter.TaskStage{},
// StageB: adapter.TaskStage{},
// StageC: adapter.TaskStage{},
... ... @@ -955,6 +958,7 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
TaskLeader: val.TaskLeader.Name,
AssistLevel: val.AssistLevel,
AssistContent: val.AssistContent,
AnomalyState: val.AnomalyState,
TaskStageCheck: adapter.TaskStage{
Id: val.Id,
Name: val.TaskStageCheck.Name,
... ...
... ... @@ -10,23 +10,31 @@ const (
TaskStop TaskState = 3 //任务停止
)
type TaskWarnFlag int
const (
TaskWarnNull TaskWarnFlag = 0
TaskWarn TaskWarnFlag = 1
)
// 任务
type Task struct {
Id int `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
CompanyId int `json:"companyId,string"`
Name string `json:"name"` // 任务名称
Alias string `json:"alias"` // 任务别名
Leader TaskLeader `json:"leader"` // 任务负责人
Status TaskState `json:"status"` // 任务的状态
Level int `json:"level"` // 优先级,值越小优先级越高
LevelName string `json:"levelName"` // 优先级名称
RelatedUser []int `json:"relatedUser"` // 相关的员工id
RunAt int64 `json:"runAt"` // 启动的时间戳,秒
StopAt int64 `json:"stopAt"` // 停止的时间戳,秒
Anomaly int `json:"anomaly"` // 异常反馈的次数
Id int `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
CompanyId int `json:"companyId,string"`
Name string `json:"name"` // 任务名称
Alias string `json:"alias"` // 任务别名
Leader TaskLeader `json:"leader"` // 任务负责人
Status TaskState `json:"status"` // 任务的状态
Level int `json:"level"` // 优先级,值越小优先级越高
LevelName string `json:"levelName"` // 优先级名称
RelatedUser []int `json:"relatedUser"` // 相关的员工id
RunAt int64 `json:"runAt"` // 启动的时间戳,秒
StopAt int64 `json:"stopAt"` // 停止的时间戳,秒
Anomaly int `json:"anomaly"` // 异常反馈的次数
WarnFlag TaskWarnFlag `json:"stageAnomaly"` // 里程碑异常标记
}
type TaskLeader struct {
... ...
... ... @@ -11,7 +11,7 @@ func TestGenerateToken(t *testing.T) {
CompanyId: 8,
UserId: 3438641393081088,
Phone: "17711111111",
PlatformId: 28,
PlatformId: 29,
AdminType: 1,
}
tk, _ := ut.CreateAccessToken()
... ...
... ... @@ -24,4 +24,5 @@ type Task struct {
RunAt int64 `pg:"run_at"` // 启动的时间
StopAt int64 `pg:"stop_at"` // 停止的时间
Anomaly int `json:"anomaly"` // 异常反馈的数量
}
... ...
... ... @@ -67,6 +67,9 @@ func (repo *MessagePersonalRepository) Find(param map[string]interface{}) (int,
if v, ok := param["types"]; ok {
query.Where("types=?", v)
}
if v, ok := param["readFlag"]; ok {
query.Where("read_flag=?", v)
}
if v, ok := param["payload"]; ok {
query.Where("payload @>?", v)
}
... ...