作者 陈志颖

合并分支 'dev' 到 'test'

Dev



查看合并请求 !32
... ... @@ -1390,125 +1390,6 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
undertakerChange = undertakerChangeTmp1 + " 变更为 " + undertakerChangeTemp2
}
//if cooperationContractFound.IncentivesType != cooperationContractSaved.IncentivesType && cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES && cooperationContractSaved.IncentivesType == domain.TYPE_MONEY_INCENTIVES { // 1.激励类型变更
// // 业绩分红-->金额激励
// incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))
// //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
// // 原业绩分红激励规则
// var dividendsIncentivesRuleOriginal string
// for _, dividendsIncentivesRule := range cooperationContractFound.DividendsIncentivesRules {
// dividendsIncentivesRuleOriginal = dividendsIncentivesRuleOriginal + dividendsIncentivesRule.DividendsIncentivesStageCN +
// ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +
// "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +
// "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +
// "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"
// }
// dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleOriginal + "】"
//
// // 变更后的金额激励规则
// var moneyIncentivesRuleChanged string
// for _, moneyIncentivesRule := range cooperationContractSaved.MoneyIncentivesRules {
// moneyIncentivesRuleChanged = moneyIncentivesRuleChanged + moneyIncentivesRule.MoneyIncentivesStageCN +
// ":" +
// "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +
// "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"
// }
// moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleChanged + "】"
//
// // 拼接规则变更
// incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + moneyIncentivesRuleOriginalTmp
//} else if cooperationContractFound.IncentivesType != cooperationContractSaved.IncentivesType && cooperationContractFound.IncentivesType == domain.TYPE_MONEY_INCENTIVES && cooperationContractSaved.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES {
// // 金额激励-->业绩分红
// incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))
// //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
// // 原金额激励规则
// var moneyIncentivesRuleOriginal string
// for _, moneyIncentivesRule := range cooperationContractFound.MoneyIncentivesRules {
// moneyIncentivesRuleOriginal = moneyIncentivesRuleOriginal + moneyIncentivesRule.MoneyIncentivesStageCN +
// ":" +
// "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +
// "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"
// }
// moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleOriginal + "】"
//
// // 变更后的业绩分红激励规则
// var dividendsIncentivesRuleChanged string
// for _, dividendsIncentivesRule := range cooperationContractSaved.DividendsIncentivesRules {
// dividendsIncentivesRuleChanged = dividendsIncentivesRuleChanged + dividendsIncentivesRule.DividendsIncentivesStageCN +
// ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +
// "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +
// "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +
// "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"
// }
// dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleChanged + "】"
//
// // 拼接规则变更
// incentivesRuleChangeDetail = moneyIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleOriginalTmp
//} else { // 2.激励规则内容变更
// if cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES { // 业绩分红激励规则变更
// if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContractSaved.DividendsIncentivesRules) {
// // 业绩分红-->业绩分红
// incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))
// //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
// // 原业绩分红激励规则
// var dividendsIncentivesRuleOriginal string
// for _, dividendsIncentivesRule := range cooperationContractFound.DividendsIncentivesRules {
// dividendsIncentivesRuleOriginal = dividendsIncentivesRuleOriginal + dividendsIncentivesRule.DividendsIncentivesStageCN +
// ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +
// "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +
// "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +
// "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"
// }
// dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleOriginal + "】"
// // 变更后的业绩分红激励规则
// var dividendsIncentivesRuleChanged string
// for _, dividendsIncentivesRule := range cooperationContractSaved.DividendsIncentivesRules {
// dividendsIncentivesRuleChanged = dividendsIncentivesRuleChanged + dividendsIncentivesRule.DividendsIncentivesStageCN +
// ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +
// "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +
// "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +
// "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"
// }
// dividendsIncentivesRuleChangedTmp := "【" + dividendsIncentivesRuleChanged + "】"
// // 拼接规则变更
// incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleChangedTmp
// }
// } else if cooperationContractFound.IncentivesType == domain.MONEY_INCENTIVES { // 金额激励规则变更
// if !cooperationContract.MoneyIncentivesRuleSliceEqualBCE(cooperationContractFound.MoneyIncentivesRules, cooperationContractSaved.MoneyIncentivesRules) {
// incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))
// //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】
// // 原金额激励规则
// var moneyIncentivesRuleOriginal string
// for _, moneyIncentivesRule := range cooperationContractFound.MoneyIncentivesRules {
// moneyIncentivesRuleOriginal = moneyIncentivesRuleOriginal + moneyIncentivesRule.MoneyIncentivesStageCN +
// ":" +
// "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +
// "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"
// }
// moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleOriginal + "】"
// // 变更后的激励规则
// var moneyIncentivesRuleChanged string
// for _, moneyIncentivesRule := range cooperationContractSaved.MoneyIncentivesRules {
// moneyIncentivesRuleChanged = moneyIncentivesRuleChanged + moneyIncentivesRule.MoneyIncentivesStageCN +
// ":" +
// "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +
// "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +
// "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"
// }
// moneyIncentivesRuleChangedTmp := "【" + moneyIncentivesRuleChanged + "】"
// // 拼接规则变更
// incentivesRuleChangeDetail = moneyIncentivesRuleOriginalTmp + " 变更为 " + moneyIncentivesRuleChangedTmp
// }
// }
//}
// 新增共创合约变更记录
newCooperationContractChangeLog := &domain.CooperationContractChangeLog{
IncentivesRule: incentivesRuleChange,
... ...
... ... @@ -54,5 +54,6 @@ func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[st
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string)
}
contractUndertakerFeedback.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -75,5 +75,6 @@ func (cooperationApplication *CooperationApplication) Update(data map[string]int
if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok {
cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time)
}
cooperationApplication.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -121,6 +121,7 @@ func (cooperationContract *CooperationContract) Update(data map[string]interface
if operateTime, ok := data["operateTime"]; ok {
cooperationContract.OperateTime = operateTime.(time.Time)
}
cooperationContract.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -68,5 +68,6 @@ func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data ma
if undertakers, ok := data["undertakers"]; ok {
cooperationContractChangeLog.Undertakers = undertakers.(string)
}
cooperationContractChangeLog.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -81,5 +81,6 @@ func (cooperationContractRelevant *CooperationContractRelevant) Update(data map[
if status, ok := data["status"]; ok {
cooperationContractRelevant.Relevant.Status = status.(int32)
}
cooperationContractRelevant.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -44,5 +44,6 @@ func (cooperationContractUndertaker *CooperationContractUndertaker) Update(data
if userBaseId, ok := data["userBaseId"]; ok {
cooperationContractUndertaker.Undertaker.UserBaseId = userBaseId.(int64)
}
cooperationContractUndertaker.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -55,5 +55,6 @@ func (cooperationMode *CooperationMode) Update(data map[string]interface{}) erro
if remarks, ok := data["remarks"]; ok {
cooperationMode.Remarks = remarks.(string)
}
cooperationMode.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -86,5 +86,6 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{}
if attachment, ok := data["attachment"]; ok {
cooperationProject.Attachment = attachment.([]*Attachment)
}
cooperationProject.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -85,6 +85,7 @@ func (creditAccount *CreditAccount) Update(data map[string]interface{}) error {
if actuallyPaidAmount, ok := data["actuallyPaidAmount"]; ok {
creditAccount.ActuallyPaidAmount = actuallyPaidAmount.(float64)
}
creditAccount.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -113,5 +113,6 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{})
if isCanceled, ok := data["isCanceled"]; ok {
dividendsEstimate.IsCanceled = isCanceled.(bool)
}
dividendsEstimate.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -77,5 +77,6 @@ func (dividendsIncentivesRule *DividendsIncentivesRule) Update(data map[string]i
if dividendsIncentivesStageStart, ok := data["dividendsIncentivesStageStart"]; ok {
dividendsIncentivesRule.DividendsIncentivesStageStart = dividendsIncentivesStageStart.(time.Time)
}
dividendsIncentivesRule.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -106,5 +106,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error
if customerName, ok := data["customerName"]; ok {
dividendsOrder.CustomerName = customerName.(string)
}
dividendsOrder.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -97,5 +97,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int
if dividendTime, ok := data["dividendTime"]; ok {
dividendsReturnedOrder.DividendTime = dividendTime.(time.Time)
}
dividendsReturnedOrder.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -82,5 +82,6 @@ func (moneyIncentivesRule *MoneyIncentivesRule) Update(data map[string]interface
if salesmanPercentage, ok := data["salesmanPercentage"]; ok {
moneyIncentivesRule.SalesmanPercentage = salesmanPercentage.(float64)
}
moneyIncentivesRule.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -75,5 +75,6 @@ func (orderGood *OrderGood) Update(data map[string]interface{}) error {
if orderGoodExpense, ok := data["orderGoodExpense"]; ok {
orderGood.OrderGoodExpense = orderGoodExpense.(float64)
}
orderGood.UpdatedAt = time.Now()
return nil
}
... ...
... ... @@ -159,9 +159,9 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
Status: undertaker.Status,
Company: undertaker.Company,
ContractAttachment: undertaker.ContractAttachment,
CreatedAt: time.Time{},
CreatedAt: time.Now(),
UpdatedAt: time.Time{},
DeletedAt: time.Now(),
DeletedAt: time.Time{},
})
}
if len(undertakersModel) > 0 {
... ...