正在显示
4 个修改的文件
包含
20 行增加
和
0 行删除
@@ -1763,3 +1763,10 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA | @@ -1763,3 +1763,10 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA | ||
1763 | 1763 | ||
1764 | return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil | 1764 | return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil |
1765 | } | 1765 | } |
1766 | + | ||
1767 | +// DeletedAssessTask 删除评估任务 | ||
1768 | +// 根据项目 EvaluationProject.Id 对应的"EvaluationProjectId" 删除评估任务 | ||
1769 | +// func (srv StaffAssessServeice) DeleteAssessTask(transactionContext application.TransactionContext, evaluationProjectId int) error { | ||
1770 | + | ||
1771 | +// return nil | ||
1772 | +// } |
@@ -41,4 +41,5 @@ type StaffAssessTaskRepository interface { | @@ -41,4 +41,5 @@ type StaffAssessTaskRepository interface { | ||
41 | Remove(id int) error | 41 | Remove(id int) error |
42 | FindOne(queryOptions map[string]interface{}) (*StaffAssessTask, error) | 42 | FindOne(queryOptions map[string]interface{}) (*StaffAssessTask, error) |
43 | Find(queryOptions map[string]interface{}) (int, []*StaffAssessTask, error) | 43 | Find(queryOptions map[string]interface{}) (int, []*StaffAssessTask, error) |
44 | + RemoveByProjectId(id int) error | ||
44 | } | 45 | } |
@@ -69,6 +69,7 @@ func (d *StaffAssessDao) SearchAssessTaskMe(executorId int, companyId int, limit | @@ -69,6 +69,7 @@ func (d *StaffAssessDao) SearchAssessTaskMe(executorId int, companyId int, limit | ||
69 | sqlStr := `SELECT DISTINCT staff_assess_task.* FROM staff_assess_task | 69 | sqlStr := `SELECT DISTINCT staff_assess_task.* FROM staff_assess_task |
70 | JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" | 70 | JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" |
71 | WHERE staff_assess.company_id=? | 71 | WHERE staff_assess.company_id=? |
72 | + and staff_assess_task.deleted_at isnull | ||
72 | and staff_assess.executor->>'userId'='?' | 73 | and staff_assess.executor->>'userId'='?' |
73 | order by staff_assess_task.id desc | 74 | order by staff_assess_task.id desc |
74 | limit ? offset ? | 75 | limit ? offset ? |
@@ -88,6 +89,7 @@ func (d *StaffAssessDao) CountAssessTaskMe(executorId int, companyId int) (int, | @@ -88,6 +89,7 @@ func (d *StaffAssessDao) CountAssessTaskMe(executorId int, companyId int) (int, | ||
88 | sqlStr := `SELECT count( DISTINCT staff_assess_task."id") FROM staff_assess_task | 89 | sqlStr := `SELECT count( DISTINCT staff_assess_task."id") FROM staff_assess_task |
89 | JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" | 90 | JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" |
90 | WHERE staff_assess.company_id=? | 91 | WHERE staff_assess.company_id=? |
92 | + and staff_assess_task.deleted_at isnull | ||
91 | and staff_assess.executor->>'userId'='?' | 93 | and staff_assess.executor->>'userId'='?' |
92 | ` | 94 | ` |
93 | tx := d.transactionContext.PgTx | 95 | tx := d.transactionContext.PgTx |
@@ -137,3 +137,13 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{}) | @@ -137,3 +137,13 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{}) | ||
137 | } | 137 | } |
138 | return count, arrays, nil | 138 | return count, arrays, nil |
139 | } | 139 | } |
140 | + | ||
141 | +func (repo *StaffAssessTaskRepository) RemoveByProjectId(id int) error { | ||
142 | + tx := repo.transactionContext.PgTx | ||
143 | + nowTime := time.Now() | ||
144 | + _, err := tx.Model(&models.StaffAssessTask{}). | ||
145 | + Where("evaluation_project_id=?", id). | ||
146 | + Set("deleted_at=?", nowTime). | ||
147 | + Update() | ||
148 | + return err | ||
149 | +} |
-
请 注册 或 登录 后发表评论