作者 陈志颖

fix:共创合约变更记录

... ... @@ -43,7 +43,7 @@ type UpdateCooperationContractCommand struct {
func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) {
// 激励规则自定义校验
if len(updateCooperationContractCommand.DividendsIncentivesRules) <= 0 && len(updateCooperationContractCommand.MoneyIncentivesRules) <= 0 {
if len(updateCooperationContractCommand.DividendsIncentivesRules) < 1 && len(updateCooperationContractCommand.MoneyIncentivesRules) < 1 {
validation.Error("激励规则不能为空")
} else {
for i, _ := range updateCooperationContractCommand.DividendsIncentivesRules {
... ... @@ -58,7 +58,7 @@ func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(
}
}
// 承接人列表校验
if len(updateCooperationContractCommand.Undertakers) <= 0 {
if len(updateCooperationContractCommand.Undertakers) < 1 {
validation.Error("承接人不能为空")
} else {
for i, _ := range updateCooperationContractCommand.Undertakers {
... ...
... ... @@ -746,7 +746,7 @@ func (cooperationContractService *CooperationContractService) BatchOperateCooper
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
for _, cooperationContractOperated := range cooperationContractsOperated {
for _, cooperationContractOperated := range cooperationContracts {
// 新增共创合约变更记录
var operationType int32
if batchOperateCooperationContractCommand.Action == 1 {
... ... @@ -764,6 +764,7 @@ func (cooperationContractService *CooperationContractService) BatchOperateCooper
Org: cooperationContractOperated.Org,
Operator: operator,
CreatedAt: time.Now(),
OperatorTime: time.Now(),
}
// 保存共创合约变更记录
... ... @@ -1255,7 +1256,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
// 拼接规则变更
incentivesRuleChangeDetail = moneyIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleOriginalTmp
}
} else if cooperationContractFound.IncentivesType == cooperationContractSaved.IncentivesType { // 2.激励规则内容变更
} else if cooperationContractFound.IncentivesType == cooperationContract.IncentivesType { // 2.激励规则内容变更
if cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES { // 业绩分红规则内容变更
if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContract.DividendsIncentivesRules) {
// 业绩分红-->业绩分红
... ... @@ -1357,7 +1358,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
// 变更承接人
var undertakersChanged string
for i, undertaker := range cooperationContractSaved.Undertakers {
for i, undertaker := range cooperationContract.Undertakers {
if undertaker.Referrer == nil {
undertaker.Referrer = &domain.Referrer{
UserId: 0,
... ...