作者 yangfu

修改 提交筛选内容修改

@@ -94,6 +94,7 @@ func SiftingResults(header *protocol.RequestHeader, request *protocol.SiftingRes @@ -94,6 +94,7 @@ func SiftingResults(header *protocol.RequestHeader, request *protocol.SiftingRes
94 func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecksRequest) (rsp *protocol.SubmitChecksResponse, err error) { 94 func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecksRequest) (rsp *protocol.SubmitChecksResponse, err error) {
95 var ( 95 var (
96 p *models.AuditFlowProcess 96 p *models.AuditFlowProcess
  97 + chance *models.Chance
97 ) 98 )
98 //测试 99 //测试
99 if request.Uid != 0 { 100 if request.Uid != 0 {
@@ -103,6 +104,15 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks @@ -103,6 +104,15 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks
103 log.Error(err) 104 log.Error(err)
104 return 105 return
105 } 106 }
  107 + if chance, err = models.GetChanceById(request.ChanceId); err != nil {
  108 + log.Error(err)
  109 + err = protocol.NewCustomMessage(5102, "该机会已被关闭")
  110 + return
  111 + }
  112 + if chance.Status == models.ChanceStatusClose {
  113 + err = protocol.NewCustomMessage(5102, "该机会已被关闭")
  114 + return
  115 + }
106 if _, result := CheckIsCommitAllCheck(request.ChanceId); result { 116 if _, result := CheckIsCommitAllCheck(request.ChanceId); result {
107 err = protocol.NewCustomMessage(1, "所有人均已提交,不允许修改自查内容") 117 err = protocol.NewCustomMessage(1, "所有人均已提交,不允许修改自查内容")
108 return 118 return
@@ -120,7 +130,7 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks @@ -120,7 +130,7 @@ func SubmitChecks(header *protocol.RequestHeader, request *protocol.SubmitChecks
120 var ( 130 var (
121 DeleteAll = `delete from chance_check_result where chance_id =? and user_company_id=? ` 131 DeleteAll = `delete from chance_check_result where chance_id =? and user_company_id=? `
122 UpdateCommitStatus = `update audit_flow_process set submit_check_status=? ,submit_check_time=now() where chance_id=? and id=?` 132 UpdateCommitStatus = `update audit_flow_process set submit_check_status=? ,submit_check_time=now() where chance_id=? and id=?`
123 - UpdateChanceCheckResultStatus = `update chance set check_result_status=?,check_result=? where id=?` 133 + UpdateChanceCheckResultStatus = `update chance set check_result_status=?,check_result=?,check_time=now() where id=?`
124 ) 134 )
125 if err = utils.ExecuteSQLWithOrmer(o, DeleteAll, request.ChanceId, header.UserId); err != nil { 135 if err = utils.ExecuteSQLWithOrmer(o, DeleteAll, request.ChanceId, header.UserId); err != nil {
126 log.Error(err) 136 log.Error(err)