作者 yangfu

修改 提交筛选内容修改

... ... @@ -94,6 +94,7 @@ func SiftingResults(header *protocol.RequestHeader, request *protocol.SiftingRes
func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecksRequest) (rsp *protocol.SubmitChecksResponse, err error) {
var (
p *models.AuditFlowProcess
chance *models.Chance
)
//测试
if request.Uid != 0 {
... ... @@ -103,6 +104,15 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks
log.Error(err)
return
}
if chance, err = models.GetChanceById(request.ChanceId); err != nil {
log.Error(err)
err = protocol.NewCustomMessage(5102, "该机会已被关闭")
return
}
if chance.Status == models.ChanceStatusClose {
err = protocol.NewCustomMessage(5102, "该机会已被关闭")
return
}
if _, result := CheckIsCommitAllCheck(request.ChanceId); result {
err = protocol.NewCustomMessage(1, "所有人均已提交,不允许修改自查内容")
return
... ... @@ -120,7 +130,7 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks
var (
DeleteAll = `delete from chance_check_result where chance_id =? and user_company_id=? `
UpdateCommitStatus = `update audit_flow_process set submit_check_status=? ,submit_check_time=now() where chance_id=? and id=?`
UpdateChanceCheckResultStatus = `update chance set check_result_status=?,check_result=? where id=?`
UpdateChanceCheckResultStatus = `update chance set check_result_status=?,check_result=?,check_time=now() where id=?`
)
if err = utils.ExecuteSQLWithOrmer(o, DeleteAll, request.ChanceId, header.UserId); err != nil {
log.Error(err)
... ...