|
@@ -120,16 +120,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
|
@@ -120,16 +120,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
120
|
}
|
120
|
}
|
121
|
nowTime := time.Now()
|
121
|
nowTime := time.Now()
|
122
|
achievementData.UpdateAt = nowTime
|
122
|
achievementData.UpdateAt = nowTime
|
123
|
- achievementData.DepartmentId = editData.DepartmentId
|
|
|
124
|
- achievementData.UserCompanyId = editData.UserCompanyId
|
|
|
125
|
achievementData.ChanceTypeId = editData.ChanceTypeId
|
123
|
achievementData.ChanceTypeId = editData.ChanceTypeId
|
126
|
achievementData.AuditTemplateId = editData.AuditTemplateId
|
124
|
achievementData.AuditTemplateId = editData.AuditTemplateId
|
127
|
achievementData.SourceContent = editData.SourceContent
|
125
|
achievementData.SourceContent = editData.SourceContent
|
128
|
achievementData.GraspScore = editData.GraspScore
|
126
|
achievementData.GraspScore = editData.GraspScore
|
129
|
- achievementData.UserGraspScore = editData.UserGraspScore
|
|
|
130
|
achievementData.UpdateAt = nowTime
|
127
|
achievementData.UpdateAt = nowTime
|
131
|
cols := []string{
|
128
|
cols := []string{
|
132
|
- "UpdateAt", "DepartmentId", "UserCompanyId", "ChanceTypeId", "AuditTemplateId", "SourceContent", "GraspScore",
|
129
|
+ "UpdateAt", "ChanceTypeId", "AuditTemplateId", "SourceContent", "GraspScore",
|
133
|
}
|
130
|
}
|
134
|
o := orm.NewOrm()
|
131
|
o := orm.NewOrm()
|
135
|
o.Begin()
|
132
|
o.Begin()
|
|
@@ -149,30 +146,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
|
@@ -149,30 +146,13 @@ func EditAchievement(editData *protocol.RequestEditAchievement, companyid int64) |
149
|
log.Info("删除achievement_chance数据失败:%s", err)
|
146
|
log.Info("删除achievement_chance数据失败:%s", err)
|
150
|
return protocol.NewErrWithMessage("1")
|
147
|
return protocol.NewErrWithMessage("1")
|
151
|
}
|
148
|
}
|
152
|
- //删除achievement_prover旧数据
|
|
|
153
|
- _, err = o.QueryTable(&models.AchievementProvider{}).
|
|
|
154
|
- Filter("achievement_id", editData.AchievementId).
|
|
|
155
|
- Delete()
|
|
|
156
|
- if err != nil {
|
|
|
157
|
- o.Rollback()
|
|
|
158
|
- log.Info("删除achievement_chance数据失败:%s", err)
|
|
|
159
|
- return protocol.NewErrWithMessage("1")
|
|
|
160
|
- }
|
149
|
+
|
161
|
err = addAchievementChance(editData.ChanceData, achievementData.Id, o)
|
150
|
err = addAchievementChance(editData.ChanceData, achievementData.Id, o)
|
162
|
if err != nil {
|
151
|
if err != nil {
|
163
|
log.Error("添加achievement_chance失败:%s", err)
|
152
|
log.Error("添加achievement_chance失败:%s", err)
|
164
|
o.Rollback()
|
153
|
o.Rollback()
|
165
|
return protocol.NewErrWithMessage("1")
|
154
|
return protocol.NewErrWithMessage("1")
|
166
|
}
|
155
|
}
|
167
|
- //操作achievement_provider 成果提供人表
|
|
|
168
|
- if len(editData.Provider) > 0 {
|
|
|
169
|
- err = addAchievementProvider(editData.Provider, achievementData.Id, o)
|
|
|
170
|
- if err != nil {
|
|
|
171
|
- log.Error("添加achievement_provider失败:%s", err)
|
|
|
172
|
- o.Rollback()
|
|
|
173
|
- return protocol.NewErrWithMessage("1")
|
|
|
174
|
- }
|
|
|
175
|
- }
|
|
|
176
|
o.Commit()
|
156
|
o.Commit()
|
177
|
return nil
|
157
|
return nil
|
178
|
}
|
158
|
}
|