作者 yangfu

消息修改

... ... @@ -77,7 +77,7 @@ func SendApproveMsgByFormat(receiverId int64, name string, companyId int64, chan
Id: idgen.Next(),
CompanyId: companyId,
ReceiveUserId: receiverId,
MsgType: protocol.MsgTypeAudit,
MsgType: protocol.MsgTypeAuditBy,
Message: fmt.Sprintf(format, chanceType.Name),
SourceId: chanceId,
SourceType: protocol.SourceTypeChance,
... ...
... ... @@ -424,7 +424,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit
} else {
//更新已经审核过
if auditConfig.NoApprover == protocol.NoApproverPass {
if err = setChanceAutoPass(header, chance, orm); err != nil {
if err = setChanceAutoPass(header, chance, orm, chanceType); err != nil {
log.Error(err)
orm.Rollback()
return
... ... @@ -461,7 +461,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit
}
//设置机会自动通过
func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, orm orm.Ormer) (err error) {
func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, orm orm.Ormer, chanceType *models.ChanceType) (err error) {
var (
approveData protocol.ApproveData
)
... ... @@ -474,10 +474,9 @@ func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, or
chance.ApproveTime = time.Now()
chance.ReviewStatus = protocol.ReviewStatusPass
if err = agg.SendApproveMsg(chance.UserId, "",
header.CompanyId, chance.Id, chance.ChanceTypeId, protocol.ReviewStatusAutoPass); err != nil {
if err = agg.SendApproveMsgByFormat(chance.UserId, "",
header.CompanyId, chance.Id, chance.ChanceTypeId, fmt.Sprintf(agg.MessageApproveAutoPass, chanceType.Name)); err != nil {
log.Error(err)
return
}
if err = agg.SaveApproveLog(orm, 6, chance.UserId, chance.Id, approveData.Score.BasicScore, approveData.Score.ExtraScore, approveData.Score.ValueScore); err != nil {
... ... @@ -636,7 +635,7 @@ func ChanceUpdate(header *protocol.RequestHeader, request *protocol.ChanceUpdate
}
//更新已经审核过
if auditConfig.NoApprover == protocol.NoApproverPass {
if err = setChanceAutoPass(header, chance, orm); err != nil {
if err = setChanceAutoPass(header, chance, orm, chanceType); err != nil {
log.Error(err)
orm.Rollback()
return
... ...