作者 tangxvhui

更新脚本

@@ -1726,7 +1726,10 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi @@ -1726,7 +1726,10 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi
1726 } 1726 }
1727 } 1727 }
1728 } 1728 }
1729 - 1729 + err = itemValueRepo.RemoveBySummaryEvaluationId(result.Id)
  1730 + if err != nil {
  1731 + return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  1732 + }
1730 for i := range itemValues { 1733 for i := range itemValues {
1731 if err := itemValueRepo.Save(itemValues[i]); err != nil { 1734 if err := itemValueRepo.Save(itemValues[i]); err != nil {
1732 return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1735 return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -27,6 +27,7 @@ type SummaryEvaluationValue struct { @@ -27,6 +27,7 @@ type SummaryEvaluationValue struct {
27 type SummaryEvaluationValueRepository interface { 27 type SummaryEvaluationValueRepository interface {
28 Save(param *SummaryEvaluationValue) error 28 Save(param *SummaryEvaluationValue) error
29 Remove(id int) error 29 Remove(id int) error
  30 + RemoveBySummaryEvaluationId(id int) error
30 FindOne(queryOptions map[string]interface{}) (*SummaryEvaluationValue, error) 31 FindOne(queryOptions map[string]interface{}) (*SummaryEvaluationValue, error)
31 Find(queryOptions map[string]interface{}) (int, []*SummaryEvaluationValue, error) 32 Find(queryOptions map[string]interface{}) (int, []*SummaryEvaluationValue, error)
32 } 33 }
@@ -186,7 +186,7 @@ func (t *Task) CheckAndRecordAnomaly(taskRecordData *TaskRecord) { @@ -186,7 +186,7 @@ func (t *Task) CheckAndRecordAnomaly(taskRecordData *TaskRecord) {
186 { 186 {
187 if taskRecordData.TaskStageCheck.Id > 0 { 187 if taskRecordData.TaskStageCheck.Id > 0 {
188 if taskRecordData.TaskStageCheck.PlanCompletedAt >= taskRecordData.TaskStageCheck.RealCompletedAt { 188 if taskRecordData.TaskStageCheck.PlanCompletedAt >= taskRecordData.TaskStageCheck.RealCompletedAt {
189 - //正常逾期 189 + //正常完成
190 t.WarnFlag = 0 190 t.WarnFlag = 0
191 } 191 }
192 if taskRecordData.TaskStageCheck.PlanCompletedAt < nowTime && taskRecordData.TaskStageCheck.RealCompletedAt == 0 { 192 if taskRecordData.TaskStageCheck.PlanCompletedAt < nowTime && taskRecordData.TaskStageCheck.RealCompletedAt == 0 {
@@ -80,6 +80,13 @@ func (repo *SummaryEvaluationValueRepository) Remove(id int) error { @@ -80,6 +80,13 @@ func (repo *SummaryEvaluationValueRepository) Remove(id int) error {
80 return err 80 return err
81 } 81 }
82 82
  83 +func (repo *SummaryEvaluationValueRepository) RemoveBySummaryEvaluationId(summaryEvaluationId int) error {
  84 + tx := repo.transactionContext.PgTx
  85 + _, err := tx.Model(&models.SummaryEvaluationValue{}).
  86 + Where("summary_evaluation_id=?", summaryEvaluationId).Delete()
  87 + return err
  88 +}
  89 +
83 func (repo *SummaryEvaluationValueRepository) FindOne(queryOptions map[string]interface{}) (*domain.SummaryEvaluationValue, error) { 90 func (repo *SummaryEvaluationValueRepository) FindOne(queryOptions map[string]interface{}) (*domain.SummaryEvaluationValue, error) {
84 tx := repo.transactionContext.PgTx 91 tx := repo.transactionContext.PgTx
85 m := new(models.SummaryEvaluationValue) 92 m := new(models.SummaryEvaluationValue)
@@ -16,6 +16,30 @@ ALTER TABLE public.task_record @@ -16,6 +16,30 @@ ALTER TABLE public.task_record
16 16
17 COMMENT ON COLUMN public.task_record.assist_state IS '辅导异常状态'; 17 COMMENT ON COLUMN public.task_record.assist_state IS '辅导异常状态';
18 18
  19 +-- 增加task表字段 sort_by 优先级
  20 +ALTER TABLE public.task
  21 + ADD sort_by int8 NOT NULL DEFAULT 0;
  22 +
  23 +-- 增加task表字段 end_time 截止时间
  24 +ALTER TABLE public.task
  25 + ADD end_time int8 NOT NULL DEFAULT 0;
  26 +
  27 +-- 增加task表字段 use_end_time 是否应用截止时间
  28 +ALTER TABLE public.task
  29 + ADD use_end_time int8 NOT NULL DEFAULT 0;
  30 +
  31 +-- 增加task表字段 created_by 创建来源
  32 +ALTER TABLE public.task
  33 + ADD created_by int4 NOT NULL DEFAULT 0;
  34 +
  35 +-- 增加task表字段 assist_flag 辅导异常
  36 +ALTER TABLE public.task
  37 + ADD assist_flag int4 NOT NULL DEFAULT 0;
  38 +
  39 +-- 增加task表字段 assist_flag 辅导异常最大值
  40 +ALTER TABLE public.task
  41 + ADD assist_flag_max int4 NOT NULL DEFAULT 0;
  42 +
19 -- 创建新表 task_anomaly 异常的任务记录 43 -- 创建新表 task_anomaly 异常的任务记录
20 CREATE TABLE public.task_anomaly( 44 CREATE TABLE public.task_anomaly(
21 id bigserial NOT NULL, 45 id bigserial NOT NULL,