作者 tangxvhui

周期列表 周期列表输出

... ... @@ -3,7 +3,7 @@ package adapter
//综合评估的周期列表
type CycleListAdapter struct {
CycleId string `json:"cycleId"` //周期id
CycleName string `json:"cycleName"` //
SummaryEvaluationId string `json:"summaryEvaluationId"`
CycleId string `json:"cycleId"` //周期id
CycleName string `json:"cycleName"` //
}
... ...
... ... @@ -540,9 +540,8 @@ func (srv *SummaryEvaluationService) GetTargetUserCycleList(param *command.Query
cycleList := []adapter.CycleListAdapter{}
for _, v := range cycleData {
m := adapter.CycleListAdapter{
SummaryEvaluationId: v.SummaryEvaluationId,
CycleId: v.CycleId,
CycleName: v.CycleName,
CycleId: v.CycleId,
CycleName: v.CycleName,
}
cycleList = append(cycleList, m)
... ... @@ -1350,7 +1349,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
evaluationItems []*domain.EvaluationItemUsed,
updatedValue []command.UpdatedItemValue,
defaultItemValue []*domain.SummaryEvaluationValue,
IsTemporary bool,
isTemporary bool,
) error {
evaluationItemMap := map[int]*domain.EvaluationItemUsed{}
evaluationValueMap := map[int]*domain.SummaryEvaluationValue{}
... ... @@ -1358,7 +1357,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
for _, v := range evaluationItems {
newValue := &domain.SummaryEvaluationValue{}
newValue.SetBlankValue(evaluationData, v)
if IsTemporary {
if isTemporary {
newValue.IsTemporary = 1
}
evaluationValueMap[v.Id] = newValue
... ... @@ -1366,6 +1365,7 @@ func (srv *SummaryEvaluationService) editEvaluationValue(
//重置计数
evaluationData.ResetTotalRating(v)
}
//如果存在旧值
//新值的id 替换为旧值id
for _, v := range *itemValueList {
if mValue, ok := evaluationValueMap[v.EvaluationItemId]; ok {
... ...
... ... @@ -21,9 +21,8 @@ func NewSummaryEvaluationDao(options map[string]interface{}) *SummaryEvaluationD
}
type PersonalCycle struct {
CycleId string `pg:"cycle_id" ` //周期id
CycleName string `pg:"cycle_name"` //周期名称
SummaryEvaluationId string `pg:"summary_evaluation_id"` //评估任务id
CycleId string `pg:"cycle_id" ` //周期id
CycleName string `pg:"cycle_name"` //周期名称
}
// GetExecutorCycleList 获取执行人拥有的周期列表
... ... @@ -82,7 +81,6 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation
func (d *SummaryEvaluationDao) GetTargetUserCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) {
sqlStr := `select
distinct
summary_evaluation.id as summary_evaluation_id,
summary_evaluation.cycle_id ,
summary_evaluation.cycle_name
from summary_evaluation
... ...