...
|
...
|
@@ -272,7 +272,10 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
suplusApprove SuplusApprove
|
|
|
approveType int
|
|
|
approveItemResponse ApproveItemResponse
|
|
|
mapProcess map[string]interface{}
|
|
|
mapChance map[string]interface{}
|
|
|
)
|
|
|
rsp = &protocol.ChanceApproveResponse{}
|
|
|
//TODO:测试注入
|
|
|
if request.Uid != 0 {
|
|
|
header.UserId = request.Uid
|
...
|
...
|
@@ -304,9 +307,29 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
err = protocol.NewErrWithMessage(5203)
|
|
|
return
|
|
|
}
|
|
|
if err = utils.UpdateTableByMap(process, map[string]interface{}{
|
|
|
"ReviewStatus": int8(request.ReviewStatus), "ApproveTime": time.Now()}); err != nil {
|
|
|
log.Error("更新机会审核状态失败 process_id:", process.Id, err)
|
|
|
{
|
|
|
mapProcess["ReviewStatus"] = int8(request.ReviewStatus)
|
|
|
mapProcess["ApproveTime"] = time.Now()
|
|
|
if request.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
mapProcess["BasicSorce"] = request.ApproveData.Score.BasicScore
|
|
|
mapProcess["ExtraSorce"] = request.ApproveData.Score.ExtraScore
|
|
|
mapProcess["ValueSorce"] = request.ApproveData.Score.ValueScore
|
|
|
mapProcess["DiscoverySorce"] = request.ApproveData.Score.DiscoveryScore
|
|
|
mapProcess["ApproveData"] = common.AssertJson(request.ApproveData)
|
|
|
|
|
|
mapChance["BasicSorce"] = request.ApproveData.Score.BasicScore
|
|
|
mapChance["ExtraSorce"] = request.ApproveData.Score.ExtraScore
|
|
|
mapChance["ValueSorce"] = request.ApproveData.Score.ValueScore
|
|
|
mapChance["DiscoverySorce"] = request.ApproveData.Score.DiscoveryScore
|
|
|
mapChance["ApproveData"] = common.AssertJson(request.ApproveData)
|
|
|
mapChance["PublishStatus"] = request.ApproveData.PublicData.PublishStatus
|
|
|
}
|
|
|
}
|
|
|
orm := orm.NewOrm()
|
|
|
orm.Begin()
|
|
|
if err = utils.UpdateTableByMapWithOrmer(orm, process, mapProcess); err != nil {
|
|
|
log.Error("更新机会审核流程 状态失败 process_id:", process.Id, err)
|
|
|
orm.Rollback()
|
|
|
return
|
|
|
}
|
|
|
log.Info(fmt.Sprintf("用户%v 更新机会审核状态 process_id:%v 状态:%v", header.UserId, process.Id, request.ReviewStatus))
|
...
|
...
|
@@ -315,10 +338,8 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
var nextApprovers []int64
|
|
|
if approveItemResponse.IsOver == 1 {
|
|
|
//结束审批
|
|
|
if err = utils.UpdateTableByMap(chance, map[string]interface{}{
|
|
|
"ReviewStatus": int8(request.ReviewStatus), "AuditLevel": chance.AuditLevel}); err != nil {
|
|
|
log.Error("更新机会审核状态失败 chance_id:", chance.Id, err)
|
|
|
return
|
|
|
{
|
|
|
mapChance["ReviewStatus"] = int8(request.ReviewStatus)
|
|
|
}
|
|
|
//发送审核结果消息给提交人
|
|
|
for i := range approveItemResponse.MessageData.ApplyUserMessage {
|
...
|
...
|
@@ -361,7 +382,13 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
rsp = &protocol.ChanceApproveResponse{}
|
|
|
|
|
|
if err = utils.UpdateTableByMapWithOrmer(orm, chance, mapChance); err != nil {
|
|
|
orm.Rollback()
|
|
|
log.Error("更新机会审核状态失败 chance_id:", chance.Id, err)
|
|
|
return
|
|
|
}
|
|
|
orm.Commit()
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
@@ -460,6 +487,10 @@ func ChanceApproveProcess(header *protocol.RequestHeader, chance *models.Chance) |
|
|
rsp.ApproveProcess = append(rsp.ApproveProcess, item)
|
|
|
continue
|
|
|
}
|
|
|
if p.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
rsp.ApproveProcess = append(rsp.ApproveProcess, item)
|
|
|
continue
|
|
|
}
|
|
|
//当前再审核的列表
|
|
|
if p.Level == chance.AuditLevel && item.ReviewStatus == protocol.ReviewStatusAuditging {
|
|
|
item = newProcessItem(p)
|
...
|
...
|
|