作者 yangfu

消息修改

@@ -77,7 +77,7 @@ func SendApproveMsgByFormat(receiverId int64, name string, companyId int64, chan @@ -77,7 +77,7 @@ func SendApproveMsgByFormat(receiverId int64, name string, companyId int64, chan
77 Id: idgen.Next(), 77 Id: idgen.Next(),
78 CompanyId: companyId, 78 CompanyId: companyId,
79 ReceiveUserId: receiverId, 79 ReceiveUserId: receiverId,
80 - MsgType: protocol.MsgTypeAudit, 80 + MsgType: protocol.MsgTypeAuditBy,
81 Message: fmt.Sprintf(format, chanceType.Name), 81 Message: fmt.Sprintf(format, chanceType.Name),
82 SourceId: chanceId, 82 SourceId: chanceId,
83 SourceType: protocol.SourceTypeChance, 83 SourceType: protocol.SourceTypeChance,
@@ -424,7 +424,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit @@ -424,7 +424,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit
424 } else { 424 } else {
425 //更新已经审核过 425 //更新已经审核过
426 if auditConfig.NoApprover == protocol.NoApproverPass { 426 if auditConfig.NoApprover == protocol.NoApproverPass {
427 - if err = setChanceAutoPass(header, chance, orm); err != nil { 427 + if err = setChanceAutoPass(header, chance, orm, chanceType); err != nil {
428 log.Error(err) 428 log.Error(err)
429 orm.Rollback() 429 orm.Rollback()
430 return 430 return
@@ -461,7 +461,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit @@ -461,7 +461,7 @@ func ChanceSubmit(header *protocol.RequestHeader, request *protocol.ChanceSubmit
461 } 461 }
462 462
463 //设置机会自动通过 463 //设置机会自动通过
464 -func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, orm orm.Ormer) (err error) { 464 +func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, orm orm.Ormer, chanceType *models.ChanceType) (err error) {
465 var ( 465 var (
466 approveData protocol.ApproveData 466 approveData protocol.ApproveData
467 ) 467 )
@@ -474,10 +474,9 @@ func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, or @@ -474,10 +474,9 @@ func setChanceAutoPass(header *protocol.RequestHeader, chance *models.Chance, or
474 chance.ApproveTime = time.Now() 474 chance.ApproveTime = time.Now()
475 chance.ReviewStatus = protocol.ReviewStatusPass 475 chance.ReviewStatus = protocol.ReviewStatusPass
476 476
477 - if err = agg.SendApproveMsg(chance.UserId, "",  
478 - header.CompanyId, chance.Id, chance.ChanceTypeId, protocol.ReviewStatusAutoPass); err != nil { 477 + if err = agg.SendApproveMsgByFormat(chance.UserId, "",
  478 + header.CompanyId, chance.Id, chance.ChanceTypeId, fmt.Sprintf(agg.MessageApproveAutoPass, chanceType.Name)); err != nil {
479 log.Error(err) 479 log.Error(err)
480 -  
481 return 480 return
482 } 481 }
483 if err = agg.SaveApproveLog(orm, 6, chance.UserId, chance.Id, approveData.Score.BasicScore, approveData.Score.ExtraScore, approveData.Score.ValueScore); err != nil { 482 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 @@ -636,7 +635,7 @@ func ChanceUpdate(header *protocol.RequestHeader, request *protocol.ChanceUpdate
636 } 635 }
637 //更新已经审核过 636 //更新已经审核过
638 if auditConfig.NoApprover == protocol.NoApproverPass { 637 if auditConfig.NoApprover == protocol.NoApproverPass {
639 - if err = setChanceAutoPass(header, chance, orm); err != nil { 638 + if err = setChanceAutoPass(header, chance, orm, chanceType); err != nil {
640 log.Error(err) 639 log.Error(err)
641 orm.Rollback() 640 orm.Rollback()
642 return 641 return