作者 tangxvhui

调整任务输出列表

@@ -5,26 +5,27 @@ import ( @@ -5,26 +5,27 @@ import (
5 ) 5 )
6 6
7 type TaskItem struct { 7 type TaskItem struct {
8 - Id int `json:"id,string"`  
9 - Name string `json:"name"` // 任务名称  
10 - Alias string `json:"alias"` // 任务别名  
11 - Leader string `json:"leader"` // 任务负责人  
12 - Status int `json:"status"` // 任务的状态  
13 - StatusDescript string `json:"statusDescript"` // 任务的整体状态描述  
14 - SortBy int `json:"level"` // 优先级,值越小优先级越高  
15 - LevelName string `json:"levelName"` // 任务分类名称  
16 - StageA TaskStage `json:"stageA"` // 里程碑1  
17 - StageB TaskStage `json:"stageB"` // 里程碑2  
18 - StageC TaskStage `json:"stageC"` // 里程碑3  
19 - StageD TaskStage `json:"stageD"` // 里程碑4  
20 - StageE TaskStage `json:"stageE"` // 里程碑5  
21 - LastStage TaskStage `json:"lastStage"` //  
22 - CurrentStage TaskStage `json:"currentStage"` //  
23 - UpdatedAt string `json:"updatedAt"` //  
24 - Anomaly int `json:"anomaly"` // 异常反馈情况  
25 - WarnFlag int `json:"warnFlag"` // 里程碑完成时间异常标记 0:正常 1标记为异常  
26 - AnomalyDesc []string `json:"anomalyDesc"` // 异常状态  
27 - Marks map[string]string `json:"marks"` // 标记 8 + Id int `json:"id,string"`
  9 + Name string `json:"name"` // 任务名称
  10 + Alias string `json:"alias"` // 任务别名
  11 + Leader string `json:"leader"` // 任务负责人
  12 + Status int `json:"status"` // 任务的状态
  13 + StatusDescript string `json:"statusDescript"` // 任务的整体状态描述
  14 + SortBy int `json:"level"` // 优先级,值越小优先级越高
  15 + LevelName string `json:"levelName"` // 任务分类名称
  16 + StageA TaskStage `json:"stageA"` // 里程碑1
  17 + StageB TaskStage `json:"stageB"` // 里程碑2
  18 + StageC TaskStage `json:"stageC"` // 里程碑3
  19 + StageD TaskStage `json:"stageD"` // 里程碑4
  20 + StageE TaskStage `json:"stageE"` // 里程碑5
  21 + LastStage TaskStage `json:"lastStage"` //
  22 + CurrentStage TaskStage `json:"currentStage"` //
  23 + UpdatedAt string `json:"updatedAt"` //
  24 + Anomaly int `json:"anomaly"` // 异常反馈情况
  25 + WarnFlag int `json:"warnFlag"` // 里程碑完成时间异常标记 0:正常 1标记为异常
  26 + AnomalyDesc []string `json:"anomalyDesc"` // 异常状态
  27 + AnomalyDesc2 []map[string]string `json:"anomalyDesc2"`
  28 + Marks map[string]string `json:"marks"` // 标记
28 } 29 }
29 30
30 func (t *TaskItem) GenStatusDescript() { 31 func (t *TaskItem) GenStatusDescript() {
@@ -4,5 +4,5 @@ type MarkTaskAnomalyCommand struct { @@ -4,5 +4,5 @@ type MarkTaskAnomalyCommand struct {
4 Id int `json:"id,string"` //异常记录id 4 Id int `json:"id,string"` //异常记录id
5 CompanyId int `json:"-"` 5 CompanyId int `json:"-"`
6 UserId int `json:"-"` 6 UserId int `json:"-"`
7 - MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导 7 + MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去找上级,d:去辅导
8 } 8 }
@@ -2,11 +2,13 @@ package service @@ -2,11 +2,13 @@ package service
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/log_opt"  
6 "strconv" 5 "strconv"
7 "strings" 6 "strings"
8 "time" 7 "time"
9 8
  9 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/log_opt"
  10 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/utils/xtime"
  11 +
10 "github.com/linmadan/egglib-go/core/application" 12 "github.com/linmadan/egglib-go/core/application"
11 "github.com/linmadan/egglib-go/utils/tool_funs" 13 "github.com/linmadan/egglib-go/utils/tool_funs"
12 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 14 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
@@ -1211,8 +1213,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1211,8 +1213,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1211 RealCompletedAt: "", 1213 RealCompletedAt: "",
1212 IsRef: false, 1214 IsRef: false,
1213 }, 1215 },
1214 - AnomalyDesc: []string{},  
1215 - Marks: map[string]string{}, 1216 + AnomalyDesc: []string{},
  1217 + AnomalyDesc2: []map[string]string{},
  1218 + Marks: map[string]string{},
1216 } 1219 }
1217 if val.LastStage.RealCompletedAt > 0 { 1220 if val.LastStage.RealCompletedAt > 0 {
1218 tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02") 1221 tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
@@ -1257,26 +1260,94 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1257,26 +1260,94 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1257 } 1260 }
1258 } 1261 }
1259 tk.GenStatusDescript() 1262 tk.GenStatusDescript()
1260 - for _, val := range taskAnomalyList {  
1261 - if tk.Id != val.TaskId { 1263 + for _, val3 := range taskAnomalyList {
  1264 + if tk.Id != val3.TaskId {
1262 continue 1265 continue
1263 } 1266 }
1264 - if val.Marks == nil {  
1265 - val.Marks = map[string]string{} 1267 + if val3.Marks == nil {
  1268 + val3.Marks = map[string]string{}
1266 } 1269 }
1267 - r := val.Remark + ",该条异常已通知"  
1268 - for _, val2 := range val.NoticeWho {  
1269 - r += val2["name"] + " " 1270 + noticeWho := []string{}
  1271 + for _, val2 := range val3.NoticeWho {
  1272 + noticeWho = append(noticeWho, val2["name"])
  1273 + }
  1274 + switch val3.Category {
  1275 + case domain.AnomalyCategoryType1:
  1276 + {
  1277 + //里程碑异常
  1278 + if val3.TaskStageCheck.RealCompletedAt == 0 && val3.TaskStageCheck.Id > 0 {
  1279 + //逾期未完成
  1280 + planCompletedAt := time.Unix(val3.TaskStageCheck.PlanCompletedAt, 0)
  1281 + subDay := xtime.SubDayAbs(val3.CreatedAt, planCompletedAt)
  1282 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf("里程碑%s已逾期%d天", val3.TaskStageCheck.Name, subDay))
  1283 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1284 + "types": "10",
  1285 + "stageName": val3.TaskStageCheck.Name,
  1286 + "interval": strconv.Itoa(subDay),
  1287 + "noticeWho": strings.Join(noticeWho, ","),
  1288 + })
  1289 + } else if val3.TaskStageCheck.RealCompletedAt > 0 && val3.TaskStageCheck.Id > 0 {
  1290 + //逾期完成
  1291 + planCompletedAt := time.Unix(val3.TaskStageCheck.PlanCompletedAt, 0)
  1292 + realCompletedAt := time.Unix(val3.TaskStageCheck.RealCompletedAt, 0)
  1293 + subDay := xtime.SubDayAbs(realCompletedAt, planCompletedAt)
  1294 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf("里程碑%s逾期%d天完成", val3.TaskStageCheck.Name, subDay))
  1295 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1296 + "types": "11",
  1297 + "stageName": val3.TaskStageCheck.Name,
  1298 + "interval": strconv.Itoa(subDay),
  1299 + "noticeWho": strings.Join(noticeWho, ","),
  1300 + })
  1301 + }
  1302 + }
  1303 + case domain.AnomalyCategoryType2:
  1304 + //反馈异常
  1305 + {
  1306 + recordBegin := time.Unix(val3.RecordBegin, 0)
  1307 + subDay := xtime.SubDayAbs(val3.CreatedAt, recordBegin)
  1308 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf(
  1309 + "本任务自%s未正常反馈项目进度,已异常%d天",
  1310 + recordBegin.Local().Format("2006-01-02"),
  1311 + subDay,
  1312 + ))
  1313 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1314 + "types": "2",
  1315 + "dayTime": recordBegin.Local().Format("2006-01-02"),
  1316 + "interval": strconv.Itoa(subDay),
  1317 + "noticeWho": strings.Join(noticeWho, ","),
  1318 + })
  1319 + }
  1320 + case domain.AnomalyCategoryType3:
  1321 + //辅导异常
  1322 + {
  1323 + recordBegin := time.Unix(val3.RecordBegin, 0)
  1324 + subDay := xtime.SubDayAbs(val3.CreatedAt, recordBegin)
  1325 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf(
  1326 + "本任务计划于%s完成辅导,已逾期%d天",
  1327 + recordBegin.Local().Format("2006-01-02"),
  1328 + subDay,
  1329 + ))
  1330 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1331 + "types": "3",
  1332 + "dayTime": recordBegin.Local().Format("2006-01-02"),
  1333 + "interval": strconv.Itoa(subDay),
  1334 + "noticeWho": strings.Join(noticeWho, ","),
  1335 + })
  1336 + }
1270 } 1337 }
1271 - tk.AnomalyDesc = append(tk.AnomalyDesc, r)  
1272 - switch val.Category { 1338 + userId := strconv.Itoa(param.UserId)
  1339 + switch val3.Category {
1273 case domain.AnomalyCategoryType1: 1340 case domain.AnomalyCategoryType1:
1274 - tk.Marks["a"] = val.Marks["a"]  
1275 - tk.Marks["c"] = val.Marks["c"] 1341 + if userId == val.LeaderId {
  1342 + tk.Marks["a"] = val3.Marks["a"]
  1343 + tk.Marks["c"] = val3.Marks["c"]
  1344 + } else {
  1345 + tk.Marks["d"] = val3.Marks["d"]
  1346 + }
1276 case domain.AnomalyCategoryType2: 1347 case domain.AnomalyCategoryType2:
1277 - tk.Marks["b"] = val.Marks["b"] 1348 + tk.Marks["b"] = val3.Marks["b"]
1278 case domain.AnomalyCategoryType3: 1349 case domain.AnomalyCategoryType3:
1279 - tk.Marks["d"] = val.Marks["d"] 1350 + tk.Marks["d"] = val3.Marks["d"]
1280 } 1351 }
1281 } 1352 }
1282 taskResult = append(taskResult, &tk) 1353 taskResult = append(taskResult, &tk)
@@ -1394,6 +1465,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1394,6 +1465,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1394 PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"), 1465 PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
1395 RealCompletedAt: "", 1466 RealCompletedAt: "",
1396 }, 1467 },
  1468 + Marks: map[string]string{},
1397 } 1469 }
1398 if val.LastStage.RealCompletedAt > 0 { 1470 if val.LastStage.RealCompletedAt > 0 {
1399 tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02") 1471 tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
@@ -1439,27 +1511,97 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1439,27 +1511,97 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1439 } 1511 }
1440 } 1512 }
1441 tk.GenStatusDescript() 1513 tk.GenStatusDescript()
1442 - for _, val := range taskAnomalyList {  
1443 - if tk.Id != val.TaskId { 1514 + for _, val3 := range taskAnomalyList {
  1515 + if tk.Id != val3.TaskId {
1444 continue 1516 continue
1445 } 1517 }
1446 - if len(val.Marks) == 0 {  
1447 - val.Marks = map[string]string{} 1518 + if val3.Marks == nil {
  1519 + val3.Marks = map[string]string{}
  1520 + }
  1521 + noticeWho := []string{}
  1522 + for _, val2 := range val3.NoticeWho {
  1523 + noticeWho = append(noticeWho, val2["name"])
  1524 + }
  1525 + switch val3.Category {
  1526 + case domain.AnomalyCategoryType1:
  1527 + {
  1528 + //里程碑异常
  1529 + if val3.TaskStageCheck.RealCompletedAt == 0 && val3.TaskStageCheck.Id > 0 {
  1530 + //逾期未完成
  1531 + planCompletedAt := time.Unix(val3.TaskStageCheck.PlanCompletedAt, 0)
  1532 + subDay := xtime.SubDayAbs(val3.CreatedAt, planCompletedAt)
  1533 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf("里程碑%s已逾期%d天", val3.TaskStageCheck.Name, subDay))
  1534 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1535 + "types": "10",
  1536 + "stageName": val3.TaskStageCheck.Name,
  1537 + "interval": strconv.Itoa(subDay),
  1538 + "noticeWho": strings.Join(noticeWho, ","),
  1539 + })
  1540 + } else if val3.TaskStageCheck.RealCompletedAt > 0 && val3.TaskStageCheck.Id > 0 {
  1541 + //逾期完成
  1542 + planCompletedAt := time.Unix(val3.TaskStageCheck.PlanCompletedAt, 0)
  1543 + realCompletedAt := time.Unix(val3.TaskStageCheck.RealCompletedAt, 0)
  1544 + subDay := xtime.SubDayAbs(realCompletedAt, planCompletedAt)
  1545 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf("里程碑%s逾期%d天完成", val3.TaskStageCheck.Name, subDay))
  1546 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1547 + "types": "11",
  1548 + "stageName": val3.TaskStageCheck.Name,
  1549 + "interval": strconv.Itoa(subDay),
  1550 + "noticeWho": strings.Join(noticeWho, ","),
  1551 + })
  1552 + }
  1553 + }
  1554 + case domain.AnomalyCategoryType2:
  1555 + //反馈异常
  1556 + {
  1557 + recordBegin := time.Unix(val3.RecordBegin, 0)
  1558 + subDay := xtime.SubDayAbs(val3.CreatedAt, recordBegin)
  1559 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf(
  1560 + "本任务自%s未正常反馈项目进度,已异常%d天",
  1561 + recordBegin.Local().Format("2006-01-02"),
  1562 + subDay,
  1563 + ))
  1564 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1565 + "types": "2",
  1566 + "dayTime": recordBegin.Local().Format("2006-01-02"),
  1567 + "interval": strconv.Itoa(subDay),
  1568 + "noticeWho": strings.Join(noticeWho, ","),
  1569 + })
  1570 + }
  1571 + case domain.AnomalyCategoryType3:
  1572 + //辅导异常
  1573 + {
  1574 + recordBegin := time.Unix(val3.RecordBegin, 0)
  1575 + subDay := xtime.SubDayAbs(val3.CreatedAt, recordBegin)
  1576 + tk.AnomalyDesc = append(tk.AnomalyDesc, fmt.Sprintf(
  1577 + "本任务计划于%s完成辅导,已逾期%d天",
  1578 + recordBegin.Local().Format("2006-01-02"),
  1579 + subDay,
  1580 + ))
  1581 + tk.AnomalyDesc2 = append(tk.AnomalyDesc2, map[string]string{
  1582 + "types": "3",
  1583 + "dayTime": recordBegin.Local().Format("2006-01-02"),
  1584 + "interval": strconv.Itoa(subDay),
  1585 + "noticeWho": strings.Join(noticeWho, ","),
  1586 + })
  1587 + }
1448 } 1588 }
1449 - r := val.Remark + ",该条异常已通知"  
1450 - for _, val2 := range val.NoticeWho {  
1451 - r += val2["name"] + " " 1589 + if len(val3.Marks) == 0 {
  1590 + val3.Marks = map[string]string{}
1452 } 1591 }
1453 - tk.AnomalyDesc = append(tk.AnomalyDesc, r)  
1454 - tk.Marks = map[string]string{}  
1455 - switch val.Category { 1592 + userId := strconv.Itoa(param.UserId)
  1593 + switch val3.Category {
1456 case domain.AnomalyCategoryType1: 1594 case domain.AnomalyCategoryType1:
1457 - tk.Marks["a"] = val.Marks["a"]  
1458 - tk.Marks["c"] = val.Marks["c"] 1595 + if userId == val.LeaderId {
  1596 + tk.Marks["a"] = val3.Marks["a"]
  1597 + tk.Marks["c"] = val3.Marks["c"]
  1598 + } else {
  1599 + tk.Marks["d"] = val3.Marks["d"]
  1600 + }
1459 case domain.AnomalyCategoryType2: 1601 case domain.AnomalyCategoryType2:
1460 - tk.Marks["b"] = val.Marks["b"] 1602 + tk.Marks["b"] = val3.Marks["b"]
1461 case domain.AnomalyCategoryType3: 1603 case domain.AnomalyCategoryType3:
1462 - tk.Marks["d"] = val.Marks["d"] 1604 + tk.Marks["d"] = val3.Marks["d"]
1463 } 1605 }
1464 } 1606 }
1465 taskResult = append(taskResult, &tk) 1607 taskResult = append(taskResult, &tk)
@@ -980,7 +980,23 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma @@ -980,7 +980,23 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
980 }, nil 980 }, nil
981 } 981 }
982 taskData := taskList[0] 982 taskData := taskList[0]
983 - _, anomalyList, err := taskAnomalyRepo.Find(map[string]interface{}{"isLast": 1, "companyId": param.CompanyId, "taskId": taskData.Id}) 983 + var category int
  984 + switch param.MarkType {
  985 + case "a":
  986 + category = domain.AnomalyCategoryType1
  987 + case "b":
  988 + category = domain.AnomalyCategoryType2
  989 + case "c":
  990 + category = domain.AnomalyCategoryType3
  991 + case "d":
  992 + category = domain.AnomalyCategoryType3
  993 + default:
  994 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "MarkType error")
  995 + }
  996 + _, anomalyList, err := taskAnomalyRepo.Find(map[string]interface{}{
  997 + "isLast": 1, "companyId": param.CompanyId,
  998 + "taskId": taskData.Id, "category": category,
  999 + })
984 if err != nil { 1000 if err != nil {
985 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1001 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
986 } 1002 }
1 -package domain  
2 -  
3 -import (  
4 - "time"  
5 -)  
6 -  
7 -// 对异常记录的操作标记  
8 -type TaskAnomalyMark struct {  
9 - Id int  
10 - CreatedAt time.Time `json:"createdAt"`  
11 - UpdatedAt time.Time `json:"updatedAt"`  
12 - CompanyId int `json:"companyId,string"` // 公司id  
13 - UserId int `json:"userId,string"` // 操作人id  
14 - TaskId int `json:"taskId,string"` // 任务id  
15 - TaskAnomalyId int `json:"taskAnomalyId,string"` // 异常记录id  
16 - Marks string `json:"marks"` // 已经操作的标记  
17 -  
18 -}  
19 -  
20 -// 已点击“去更新”  
21 -func (t *TaskAnomalyMark) MarkA() {  
22 - t.Marks = "已更新"  
23 -}  
24 -  
25 -// 已点击 "去反馈"  
26 -func (t *TaskAnomalyMark) MarkB() {  
27 - t.Marks = "已反馈"  
28 -}  
29 -  
30 -// 已点击 "找上级"  
31 -func (t *TaskAnomalyMark) MarkC() {  
32 - t.Marks = "已求助"  
33 -}  
34 -  
35 -// 已点击 "去辅导"  
36 -func (t *TaskAnomalyMark) MarkD() {  
37 - t.Marks = "已辅导"  
38 -}  
39 -  
40 -type TaskAnomalyMarkRepository interface {  
41 - Save(param *TaskAnomalyMark) error  
42 - FindOne(queryOptions map[string]interface{}) (*TaskAnomalyMark, error)  
43 - Find(queryOptions map[string]interface{}) (int, []*TaskAnomalyMark, error)  
44 -}  
@@ -475,6 +475,7 @@ type ListTask struct { @@ -475,6 +475,7 @@ type ListTask struct {
475 TaskId int `pg:"task_id"` 475 TaskId int `pg:"task_id"`
476 Alias string `pg:"alias"` 476 Alias string `pg:"alias"`
477 LeaderName string `pg:"leader_name"` 477 LeaderName string `pg:"leader_name"`
  478 + LeaderId string `pg:"leader_id"`
478 Level int `pg:"level"` 479 Level int `pg:"level"`
479 LevelName string `pg:"level_name"` 480 LevelName string `pg:"level_name"`
480 Anomaly int `pg:"anomaly"` 481 Anomaly int `pg:"anomaly"`
@@ -506,6 +507,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error) @@ -506,6 +507,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
506 task.id , 507 task.id ,
507 task.alias , 508 task.alias ,
508 task.leader ->>'name' as leader_name, 509 task.leader ->>'name' as leader_name,
  510 + task.leader ->>'id' as leader_id,
509 task."level", 511 task."level",
510 task.level_name , 512 task.level_name ,
511 task.anomaly , 513 task.anomaly ,
@@ -538,6 +540,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error) @@ -538,6 +540,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
538 t_task.id as task_id, 540 t_task.id as task_id,
539 t_task.alias , 541 t_task.alias ,
540 t_task.leader_name, 542 t_task.leader_name,
  543 + t_task.leader_id,
541 t_task."level", 544 t_task."level",
542 t_task.level_name , 545 t_task.level_name ,
543 t_task.anomaly , 546 t_task.anomaly ,
@@ -591,6 +594,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error) @@ -591,6 +594,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error)
591 task.id , 594 task.id ,
592 task.alias , 595 task.alias ,
593 task.leader ->>'name' as leader_name, 596 task.leader ->>'name' as leader_name,
  597 + task.leader ->>'id' as leader_id,
594 task."level", 598 task."level",
595 task.level_name , 599 task.level_name ,
596 task.anomaly , 600 task.anomaly ,
@@ -622,6 +626,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error) @@ -622,6 +626,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error)
622 t_task.id as task_id, 626 t_task.id as task_id,
623 t_task.alias , 627 t_task.alias ,
624 t_task.leader_name, 628 t_task.leader_name,
  629 + t_task.leader_id,
625 t_task."level", 630 t_task."level",
626 t_task.level_name , 631 t_task.level_name ,
627 t_task.anomaly , 632 t_task.anomaly ,
@@ -674,6 +679,7 @@ func (d *TaskDao) ListTaskIgnore(param ListTaskCondition) ([]ListTask, error) { @@ -674,6 +679,7 @@ func (d *TaskDao) ListTaskIgnore(param ListTaskCondition) ([]ListTask, error) {
674 task.id as task_id , 679 task.id as task_id ,
675 task.alias , 680 task.alias ,
676 task.leader ->>'name' as leader_name, 681 task.leader ->>'name' as leader_name,
  682 + task.leader ->>'id' as leader_id,
677 task."level" , 683 task."level" ,
678 task.level_name , 684 task.level_name ,
679 task.anomaly , 685 task.anomaly ,
1 -  
2 -  
3 -- 增加任务记录字段 1 -- 增加任务记录字段
4 ALTER TABLE public.task_record 2 ALTER TABLE public.task_record
5 ADD remark_content jsonb NULL; 3 ADD remark_content jsonb NULL;
6 4
7 COMMENT ON COLUMN public.task_record.remark_content IS '填写反馈进度'; 5 COMMENT ON COLUMN public.task_record.remark_content IS '填写反馈进度';
8 6
9 -  
10 -- 增加任务记录字段 7 -- 增加任务记录字段
11 ALTER TABLE public.task_record 8 ALTER TABLE public.task_record
12 ADD task_created_by int NOT NULL DEFAULT 0; 9 ADD task_created_by int NOT NULL DEFAULT 0;
@@ -18,3 +15,27 @@ ALTER TABLE public.task_record @@ -18,3 +15,27 @@ ALTER TABLE public.task_record
18 ADD assist_state int NOT NULL DEFAULT 1; 15 ADD assist_state int NOT NULL DEFAULT 1;
19 16
20 COMMENT ON COLUMN public.task_record.assist_state IS '辅导异常状态'; 17 COMMENT ON COLUMN public.task_record.assist_state IS '辅导异常状态';
  18 +
  19 +-- task_record 处理旧数据
  20 +WITH t_taff_assess_content AS (
  21 + SELECT
  22 + staff_assess_content.staff_assess_id,
  23 + staff_assess_content.category,
  24 + staff_assess_content."name",
  25 + staff_assess_content.remark
  26 + FROM
  27 + task_record
  28 + JOIN staff_assess_content ON task_record.staff_assess_id = staff_assess_content.staff_assess_id
  29 + AND staff_assess_content."name" = task_record.task_name
  30 + WHERE
  31 + 1 = 1)
  32 +UPDATE
  33 + task_record
  34 +SET
  35 + remark_content = t_taff_assess_content.remark
  36 +FROM
  37 + t_taff_assess_content
  38 +WHERE
  39 + task_record.staff_assess_id = t_taff_assess_content.staff_assess_id
  40 + AND t_taff_assess_content."name" = task_record.task_name;
  41 +