正在显示
1 个修改的文件
包含
29 行增加
和
13 行删除
@@ -25,7 +25,7 @@ func SiftingPool(header *protocol.RequestHeader, request *protocol.SiftingPoolRe | @@ -25,7 +25,7 @@ func SiftingPool(header *protocol.RequestHeader, request *protocol.SiftingPoolRe | ||
25 | if request.Uid != 0 { | 25 | if request.Uid != 0 { |
26 | header.UserId = request.Uid | 26 | header.UserId = request.Uid |
27 | } | 27 | } |
28 | - if rsp.Total, err = models.GetSiftingChance(header.UserId, request.SubmitStatus, protocol.Waiting, request.Offset(), request.PageSize, &ormItems); err != nil { | 28 | + if rsp.Total, err = models.GetSiftingChance(header.UserId, request.SubmitStatus, protocol.None, request.Offset(), request.PageSize, &ormItems); err != nil { |
29 | if err == orm.ErrNoRows { | 29 | if err == orm.ErrNoRows { |
30 | err = nil | 30 | err = nil |
31 | return | 31 | return |
@@ -104,6 +104,10 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks | @@ -104,6 +104,10 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks | ||
104 | log.Error(err) | 104 | log.Error(err) |
105 | return | 105 | return |
106 | } | 106 | } |
107 | + if _, result := CheckIsCommitAllCheck(request.ChanceId); result { | ||
108 | + err = protocol.NewCustomMessage(1, "所有人均已提交,不允许修改自查内容") | ||
109 | + return | ||
110 | + } | ||
107 | if p, err = models.GetAuditorLatestAuditFlowProcess(request.ChanceId, header.UserId); err != nil { | 111 | if p, err = models.GetAuditorLatestAuditFlowProcess(request.ChanceId, header.UserId); err != nil { |
108 | log.Error(request.ChanceId, header.UserId, err) | 112 | log.Error(request.ChanceId, header.UserId, err) |
109 | if err == orm.ErrNoRows { | 113 | if err == orm.ErrNoRows { |
@@ -173,6 +177,10 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks | @@ -173,6 +177,10 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks | ||
173 | } | 177 | } |
174 | 178 | ||
175 | func NewChanceCheckResult(c protocol.SelfCheck, chanceId int64, uid int64) *models.ChanceCheckResult { | 179 | func NewChanceCheckResult(c protocol.SelfCheck, chanceId int64, uid int64) *models.ChanceCheckResult { |
180 | + //不是否的时候 不需要理由 | ||
181 | + if c.Answer != protocol.OptionNo { | ||
182 | + c.Reason = "" | ||
183 | + } | ||
176 | return &models.ChanceCheckResult{ | 184 | return &models.ChanceCheckResult{ |
177 | Id: idgen.Next(), | 185 | Id: idgen.Next(), |
178 | ChanceId: chanceId, | 186 | ChanceId: chanceId, |
@@ -221,7 +229,8 @@ type chanceCheckResultTotal struct { | @@ -221,7 +229,8 @@ type chanceCheckResultTotal struct { | ||
221 | func collectChanceCheckResultData(checkResultData []*models.ChanceCheckResult) protocol.SelfChecks { | 229 | func collectChanceCheckResultData(checkResultData []*models.ChanceCheckResult) protocol.SelfChecks { |
222 | checkResultMap := map[int]*chanceCheckResultTotal{} | 230 | checkResultMap := map[int]*chanceCheckResultTotal{} |
223 | checkResultSlice := []*chanceCheckResultTotal{} | 231 | checkResultSlice := []*chanceCheckResultTotal{} |
224 | - for _, resultData := range checkResultData { | 232 | + for i := range checkResultData { |
233 | + resultData := checkResultData[i] | ||
225 | answerYes := 0 | 234 | answerYes := 0 |
226 | answerNo := 0 | 235 | answerNo := 0 |
227 | answerAny := 0 | 236 | answerAny := 0 |
@@ -269,29 +278,36 @@ func collectChanceCheckResultData(checkResultData []*models.ChanceCheckResult) p | @@ -269,29 +278,36 @@ func collectChanceCheckResultData(checkResultData []*models.ChanceCheckResult) p | ||
269 | dd := protocol.SelfCheck{ | 278 | dd := protocol.SelfCheck{ |
270 | CheckItem: checkResultSlice[i].CheckItem, | 279 | CheckItem: checkResultSlice[i].CheckItem, |
271 | GroupId: checkResultSlice[i].GroupId, | 280 | GroupId: checkResultSlice[i].GroupId, |
272 | - ParentId: checkResultSlice[i].CheckPid, | ||
273 | Id: checkResultSlice[i].CheckId, | 281 | Id: checkResultSlice[i].CheckId, |
282 | + ParentId: checkResultSlice[i].CheckPid, | ||
274 | } | 283 | } |
275 | - if checkResultSlice[i].AnswerYes > 0 { | 284 | + |
285 | + if checkResultSlice[i].AnswerNo > 0 { | ||
276 | dd.Answer = protocol.OptionNo | 286 | dd.Answer = protocol.OptionNo |
277 | - } else if checkResultSlice[i].AnswerNo > 0 { | 287 | + } |
288 | + if checkResultSlice[i].AnswerYes > 0 && checkResultSlice[i].AnswerNo == 0 && checkResultSlice[i].AnswerAny == 0 { | ||
278 | dd.Answer = protocol.OptionYes | 289 | dd.Answer = protocol.OptionYes |
279 | - } else if checkResultSlice[i].AnswerAny > 0 { | 290 | + } |
291 | + if checkResultSlice[i].AnswerNo == 0 && checkResultSlice[i].AnswerAny > 0 { | ||
280 | dd.Answer = protocol.OptionNoCertain | 292 | dd.Answer = protocol.OptionNoCertain |
281 | } | 293 | } |
282 | selfCheckData = append(selfCheckData, dd) | 294 | selfCheckData = append(selfCheckData, dd) |
283 | - for _, child := range checkResultSlice[i].Child { | 295 | + for j := range checkResultSlice[i].Child { |
296 | + child := checkResultSlice[i].Child[j] | ||
284 | dd := protocol.SelfCheck{ | 297 | dd := protocol.SelfCheck{ |
285 | CheckItem: child.CheckItem, | 298 | CheckItem: child.CheckItem, |
286 | GroupId: child.GroupId, | 299 | GroupId: child.GroupId, |
287 | - ParentId: checkResultSlice[i].CheckPid, | ||
288 | - Id: checkResultSlice[i].CheckId, | 300 | + Id: child.CheckId, |
301 | + ParentId: child.CheckPid, | ||
289 | } | 302 | } |
290 | - if child.AnswerYes > 0 { | ||
291 | - dd.Answer = protocol.OptionYes | ||
292 | - } else if child.AnswerNo > 0 { | 303 | + |
304 | + if child.AnswerNo > 0 { | ||
293 | dd.Answer = protocol.OptionNo | 305 | dd.Answer = protocol.OptionNo |
294 | - } else if child.AnswerAny > 0 { | 306 | + } |
307 | + if child.AnswerYes > 0 && child.AnswerNo == 0 && child.AnswerAny == 0 { | ||
308 | + dd.Answer = protocol.OptionYes | ||
309 | + } | ||
310 | + if child.AnswerNo == 0 && child.AnswerAny > 0 { | ||
295 | dd.Answer = protocol.OptionNoCertain | 311 | dd.Answer = protocol.OptionNoCertain |
296 | } | 312 | } |
297 | selfCheckData = append(selfCheckData, dd) | 313 | selfCheckData = append(selfCheckData, dd) |
-
请 注册 或 登录 后发表评论