...
|
...
|
@@ -276,6 +276,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
mapProcess = make(map[string]interface{})
|
|
|
mapChance = make(map[string]interface{})
|
|
|
result *protocol.ChanceCalculateScoreResponse
|
|
|
difChecks protocol.SelfChecks
|
|
|
)
|
|
|
rsp = &protocol.ChanceApproveResponse{}
|
|
|
//TODO:测试注入
|
...
|
...
|
@@ -308,6 +309,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
err = protocol.NewErrWithMessage(5202)
|
|
|
return
|
|
|
}
|
|
|
difChecks, _ = request.SelfChecks.Compare(chance.SelfChecks)
|
|
|
{
|
|
|
if request.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
//计算发现分
|
...
|
...
|
@@ -325,6 +327,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
mapProcess["ApproveTime"] = time.Now()
|
|
|
mapProcess["IsActive"] = int8(0)
|
|
|
mapProcess["UpdateAt"] = time.Now()
|
|
|
mapProcess["SelfChecks"] = common.AssertJson(difChecks)
|
|
|
|
|
|
mapChance["ApproveTime"] = time.Now()
|
|
|
mapChance["BasicScore"] = request.ApproveData.Score.BasicScore
|
...
|
...
|
@@ -341,13 +344,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
mapProcess["DiscoveryScore"] = request.ApproveData.Score.DiscoveryScore
|
|
|
mapProcess["ApproveData"] = common.AssertJson(request.ApproveData)
|
|
|
mapProcess["EnableStatus"] = int8(1)
|
|
|
|
|
|
//mapChance["BasicScore"] = request.ApproveData.Score.BasicScore
|
|
|
//mapChance["ExtraScore"] = request.ApproveData.Score.ExtraScore
|
|
|
//mapChance["ValueScore"] = request.ApproveData.Score.ValueScore
|
|
|
//mapChance["DiscoveryScore"] = request.ApproveData.Score.DiscoveryScore
|
|
|
//mapChance["ApproveData"] = common.AssertJson(request.ApproveData)
|
|
|
//mapChance["PublishStatus"] = request.ApproveData.PublicData.PublishStatus
|
|
|
mapChance["SelfChecks"] = common.AssertJson(request.SelfChecks)
|
|
|
}
|
|
|
}
|
|
|
log.Info(fmt.Sprintf("用户:%v 提交审核 机会编号:%v 审批流编号:%v 审批状态:%v", header.UserId, chance.Id, process.Id, request.ReviewStatus))
|
...
|
...
|
@@ -384,16 +381,6 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
{
|
|
|
mapChance["ReviewStatus"] = int8(request.ReviewStatus)
|
|
|
}
|
|
|
//发送审核结果消息给提交人
|
|
|
//for i := range approveItemResponse.MessageData.ApplyUserMessage {
|
|
|
// message := approveItemResponse.MessageData.ApplyUserMessage[i]
|
|
|
// nextApprovers = append(nextApprovers, message.ReceiverInfo.ReceiverUid)
|
|
|
// if err = agg.SendApprovedMsg(message.ReceiverInfo.ReceiverUid, message.ReceiverInfo.ReceiverName,
|
|
|
// header.CompanyId, chance.Id, chance.ChanceTypeId, request.ReviewStatus, protocol.MsgTypeAuditBy); err != nil {
|
|
|
// log.Error(err)
|
|
|
// return
|
|
|
// }
|
|
|
//}
|
|
|
} else {
|
|
|
//发送下一个消息给下一流程的审核人
|
|
|
for i := range approveItemResponse.MessageData.ApproveMessage {
|
...
|
...
|
@@ -423,7 +410,7 @@ func ChanceApprove(header *protocol.RequestHeader, request *protocol.ChanceAppro |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if err = saveApproveMsgByApproveData(header, orm, request.ReviewStatus, chance, request.ApproveData); err != nil {
|
|
|
if err = saveApproveMsgByApproveData(header, orm, request.ReviewStatus, chance, request.ApproveData, difChecks); err != nil {
|
|
|
orm.Rollback()
|
|
|
log.Error("发送审核日志失败", err)
|
|
|
return
|
...
|
...
|
@@ -486,7 +473,7 @@ func ProcessIntegrate(header *protocol.RequestHeader, request *ProcessIntegrateR |
|
|
}
|
|
|
|
|
|
//发送审核日志
|
|
|
func saveApproveMsgByApproveData(header *protocol.RequestHeader, orm orm.Ormer, reviewStatus int, chance *models.Chance, approveData protocol.ApproveData) (err error) {
|
|
|
func saveApproveMsgByApproveData(header *protocol.RequestHeader, orm orm.Ormer, reviewStatus int, chance *models.Chance, approveData protocol.ApproveData, selfChecks protocol.SelfChecks) (err error) {
|
|
|
var (
|
|
|
parames = make([]interface{}, 0)
|
|
|
code = 0
|
...
|
...
|
@@ -494,11 +481,12 @@ func saveApproveMsgByApproveData(header *protocol.RequestHeader, orm orm.Ormer, |
|
|
if reviewStatus == protocol.ReviewStatusReturn {
|
|
|
//发送退回日志
|
|
|
code = 3
|
|
|
parames = append(parames, selfChecks.String())
|
|
|
}
|
|
|
if reviewStatus == protocol.ReviewStatusPass {
|
|
|
//发送通过日志
|
|
|
score := approveData.Score
|
|
|
parames = append(parames, []interface{}{score.BasicScore, score.ExtraScore, score.ValueScore}...)
|
|
|
parames = append(parames, []interface{}{selfChecks.String(), score.BasicScore, score.ExtraScore, score.ValueScore}...)
|
|
|
if approveData.PublicData.PublishStatus == protocol.PublicToCompany {
|
|
|
code = 4
|
|
|
}
|
...
|
...
|
@@ -561,6 +549,7 @@ func ChanceApproveProcess(header *protocol.RequestHeader, chance *models.Chance) |
|
|
Uid: process.Uid,
|
|
|
Name: process.UserName,
|
|
|
}
|
|
|
utils.JsonUnmarshal(process.SelfChecks, &item.SelfChecks)
|
|
|
if item.ApproveType == protocol.AuditBySpecailUser {
|
|
|
item.ApproveType = protocol.AuditByUser
|
|
|
}
|
...
|
...
|
|