|
|
package service
|
|
|
|
|
|
import (
|
|
|
"crypto/md5"
|
|
|
"encoding/hex"
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
"time"
|
...
|
...
|
@@ -1266,8 +1268,19 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
}
|
|
|
} else if cooperationContractFound.IncentivesType == cooperationContract.IncentivesType { // 2.激励规则内容变更
|
|
|
if cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES { // 业绩分红规则内容变更
|
|
|
if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContract.DividendsIncentivesRules) {
|
|
|
// 计算原合约哈希值
|
|
|
cooperationContractFoundByte := utils.AnyToHex(cooperationContractFound.MoneyIncentivesRules)
|
|
|
cooperationContractFoundHashValue := md5.Sum(cooperationContractFoundByte)
|
|
|
cooperationContractFoundHashString := hex.EncodeToString(cooperationContractFoundHashValue[:])
|
|
|
|
|
|
// 计算更新后的合约哈希值
|
|
|
cooperationContractByte := utils.AnyToHex(cooperationContract.MoneyIncentivesRules)
|
|
|
cooperationContractHashValue := md5.Sum(cooperationContractByte)
|
|
|
cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:])
|
|
|
//if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContract.DividendsIncentivesRules) {
|
|
|
if cooperationContractFoundHashString != cooperationContractHashString {
|
|
|
// 业绩分红-->业绩分红
|
|
|
|
|
|
incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContract.IncentivesType))
|
|
|
//【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
|
|
|
// 原业绩分红激励规则
|
...
|
...
|
@@ -1296,7 +1309,18 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleChangedTmp
|
|
|
}
|
|
|
} else if cooperationContractFound.IncentivesType == domain.MONEY_INCENTIVES { // 金额激励规则内容变更
|
|
|
if !cooperationContract.MoneyIncentivesRuleSliceEqualBCE(cooperationContractFound.MoneyIncentivesRules, cooperationContract.MoneyIncentivesRules) {
|
|
|
// 计算原合约哈希值
|
|
|
cooperationContractFoundByte := utils.AnyToHex(cooperationContractFound.MoneyIncentivesRules)
|
|
|
cooperationContractFoundHashValue := md5.Sum(cooperationContractFoundByte)
|
|
|
cooperationContractFoundHashString := hex.EncodeToString(cooperationContractFoundHashValue[:])
|
|
|
|
|
|
// 计算更新后的合约哈希值
|
|
|
cooperationContractByte := utils.AnyToHex(cooperationContract.MoneyIncentivesRules)
|
|
|
cooperationContractHashValue := md5.Sum(cooperationContractByte)
|
|
|
cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:])
|
|
|
|
|
|
//if !cooperationContract.MoneyIncentivesRuleSliceEqualBCE(cooperationContractFound.MoneyIncentivesRules, cooperationContract.MoneyIncentivesRules) {
|
|
|
if cooperationContractFoundHashString != cooperationContractHashString {
|
|
|
incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContract.IncentivesType))
|
|
|
//【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
|
|
|
// 原金额激励规则
|
...
|
...
|
@@ -1326,7 +1350,18 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
}
|
|
|
|
|
|
// 承接人变更
|
|
|
if !cooperationContract.UndertakerSliceEqualBCE(cooperationContractFound.Undertakers, cooperationContract.Undertakers) { // 【1(张三,李四,王五)2(买买买,,)】变更为【1(张三,,)】
|
|
|
// 计算原合约哈希值
|
|
|
cooperationContractFoundByte := utils.AnyToHex(cooperationContractFound.Undertakers)
|
|
|
cooperationContractFoundHashValue := md5.Sum(cooperationContractFoundByte)
|
|
|
cooperationContractFoundHashString := hex.EncodeToString(cooperationContractFoundHashValue[:])
|
|
|
|
|
|
// 计算更新后的合约哈希值
|
|
|
cooperationContractByte := utils.AnyToHex(cooperationContract.Undertakers)
|
|
|
cooperationContractHashValue := md5.Sum(cooperationContractByte)
|
|
|
cooperationContractHashString := hex.EncodeToString(cooperationContractHashValue[:])
|
|
|
|
|
|
//if !cooperationContract.UndertakerSliceEqualBCE(cooperationContractFound.Undertakers, cooperationContract.Undertakers) { // 【1(张三,李四,王五)2(买买买,,)】变更为【1(张三,,)】
|
|
|
if cooperationContractFoundHashString != cooperationContractHashString {
|
|
|
// 原承接人
|
|
|
var undertakersOriginal string
|
|
|
for i, undertaker := range cooperationContractFound.Undertakers {
|
...
|
...
|
|