作者 tangxvhui

周期列表 周期列表输出

@@ -3,7 +3,7 @@ package adapter @@ -3,7 +3,7 @@ package adapter
3 //综合评估的周期列表 3 //综合评估的周期列表
4 4
5 type CycleListAdapter struct { 5 type CycleListAdapter struct {
6 - CycleId string `json:"cycleId"` //周期id  
7 - CycleName string `json:"cycleName"` //  
8 - SummaryEvaluationId string `json:"summaryEvaluationId"` 6 + CycleId string `json:"cycleId"` //周期id
  7 + CycleName string `json:"cycleName"` //
  8 +
9 } 9 }
@@ -540,9 +540,8 @@ func (srv *SummaryEvaluationService) GetTargetUserCycleList(param *command.Query @@ -540,9 +540,8 @@ func (srv *SummaryEvaluationService) GetTargetUserCycleList(param *command.Query
540 cycleList := []adapter.CycleListAdapter{} 540 cycleList := []adapter.CycleListAdapter{}
541 for _, v := range cycleData { 541 for _, v := range cycleData {
542 m := adapter.CycleListAdapter{ 542 m := adapter.CycleListAdapter{
543 - SummaryEvaluationId: v.SummaryEvaluationId,  
544 - CycleId: v.CycleId,  
545 - CycleName: v.CycleName, 543 + CycleId: v.CycleId,
  544 + CycleName: v.CycleName,
546 } 545 }
547 546
548 cycleList = append(cycleList, m) 547 cycleList = append(cycleList, m)
@@ -1350,7 +1349,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue( @@ -1350,7 +1349,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
1350 evaluationItems []*domain.EvaluationItemUsed, 1349 evaluationItems []*domain.EvaluationItemUsed,
1351 updatedValue []command.UpdatedItemValue, 1350 updatedValue []command.UpdatedItemValue,
1352 defaultItemValue []*domain.SummaryEvaluationValue, 1351 defaultItemValue []*domain.SummaryEvaluationValue,
1353 - IsTemporary bool, 1352 + isTemporary bool,
1354 ) error { 1353 ) error {
1355 evaluationItemMap := map[int]*domain.EvaluationItemUsed{} 1354 evaluationItemMap := map[int]*domain.EvaluationItemUsed{}
1356 evaluationValueMap := map[int]*domain.SummaryEvaluationValue{} 1355 evaluationValueMap := map[int]*domain.SummaryEvaluationValue{}
@@ -1358,7 +1357,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue( @@ -1358,7 +1357,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
1358 for _, v := range evaluationItems { 1357 for _, v := range evaluationItems {
1359 newValue := &domain.SummaryEvaluationValue{} 1358 newValue := &domain.SummaryEvaluationValue{}
1360 newValue.SetBlankValue(evaluationData, v) 1359 newValue.SetBlankValue(evaluationData, v)
1361 - if IsTemporary { 1360 + if isTemporary {
1362 newValue.IsTemporary = 1 1361 newValue.IsTemporary = 1
1363 } 1362 }
1364 evaluationValueMap[v.Id] = newValue 1363 evaluationValueMap[v.Id] = newValue
@@ -1366,6 +1365,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue( @@ -1366,6 +1365,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
1366 //重置计数 1365 //重置计数
1367 evaluationData.ResetTotalRating(v) 1366 evaluationData.ResetTotalRating(v)
1368 } 1367 }
  1368 + //如果存在旧值
1369 //新值的id 替换为旧值id 1369 //新值的id 替换为旧值id
1370 for _, v := range *itemValueList { 1370 for _, v := range *itemValueList {
1371 if mValue, ok := evaluationValueMap[v.EvaluationItemId]; ok { 1371 if mValue, ok := evaluationValueMap[v.EvaluationItemId]; ok {
@@ -21,9 +21,8 @@ func NewSummaryEvaluationDao(options map[string]interface{}) *SummaryEvaluationD @@ -21,9 +21,8 @@ func NewSummaryEvaluationDao(options map[string]interface{}) *SummaryEvaluationD
21 } 21 }
22 22
23 type PersonalCycle struct { 23 type PersonalCycle struct {
24 - CycleId string `pg:"cycle_id" ` //周期id  
25 - CycleName string `pg:"cycle_name"` //周期名称  
26 - SummaryEvaluationId string `pg:"summary_evaluation_id"` //评估任务id 24 + CycleId string `pg:"cycle_id" ` //周期id
  25 + CycleName string `pg:"cycle_name"` //周期名称
27 } 26 }
28 27
29 // GetExecutorCycleList 获取执行人拥有的周期列表 28 // GetExecutorCycleList 获取执行人拥有的周期列表
@@ -82,7 +81,6 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation @@ -82,7 +81,6 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation
82 func (d *SummaryEvaluationDao) GetTargetUserCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) { 81 func (d *SummaryEvaluationDao) GetTargetUserCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) {
83 sqlStr := `select 82 sqlStr := `select
84 distinct 83 distinct
85 - summary_evaluation.id as summary_evaluation_id,  
86 summary_evaluation.cycle_id , 84 summary_evaluation.cycle_id ,
87 summary_evaluation.cycle_name 85 summary_evaluation.cycle_name
88 from summary_evaluation 86 from summary_evaluation