作者 陈志颖

合并分支 'dev' 到 'test'

Dev



查看合并请求 !32
@@ -1390,125 +1390,6 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC @@ -1390,125 +1390,6 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
1390 undertakerChange = undertakerChangeTmp1 + " 变更为 " + undertakerChangeTemp2 1390 undertakerChange = undertakerChangeTmp1 + " 变更为 " + undertakerChangeTemp2
1391 } 1391 }
1392 1392
1393 - //if cooperationContractFound.IncentivesType != cooperationContractSaved.IncentivesType && cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES && cooperationContractSaved.IncentivesType == domain.TYPE_MONEY_INCENTIVES { // 1.激励类型变更  
1394 - // // 业绩分红-->金额激励  
1395 - // incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))  
1396 - // //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】  
1397 - // // 原业绩分红激励规则  
1398 - // var dividendsIncentivesRuleOriginal string  
1399 - // for _, dividendsIncentivesRule := range cooperationContractFound.DividendsIncentivesRules {  
1400 - // dividendsIncentivesRuleOriginal = dividendsIncentivesRuleOriginal + dividendsIncentivesRule.DividendsIncentivesStageCN +  
1401 - // ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +  
1402 - // "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +  
1403 - // "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +  
1404 - // "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +  
1405 - // "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"  
1406 - // }  
1407 - // dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleOriginal + "】"  
1408 - //  
1409 - // // 变更后的金额激励规则  
1410 - // var moneyIncentivesRuleChanged string  
1411 - // for _, moneyIncentivesRule := range cooperationContractSaved.MoneyIncentivesRules {  
1412 - // moneyIncentivesRuleChanged = moneyIncentivesRuleChanged + moneyIncentivesRule.MoneyIncentivesStageCN +  
1413 - // ":" +  
1414 - // "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +  
1415 - // "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +  
1416 - // "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"  
1417 - // }  
1418 - // moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleChanged + "】"  
1419 - //  
1420 - // // 拼接规则变更  
1421 - // incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + moneyIncentivesRuleOriginalTmp  
1422 - //} else if cooperationContractFound.IncentivesType != cooperationContractSaved.IncentivesType && cooperationContractFound.IncentivesType == domain.TYPE_MONEY_INCENTIVES && cooperationContractSaved.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES {  
1423 - // // 金额激励-->业绩分红  
1424 - // incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))  
1425 - // //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】  
1426 - // // 原金额激励规则  
1427 - // var moneyIncentivesRuleOriginal string  
1428 - // for _, moneyIncentivesRule := range cooperationContractFound.MoneyIncentivesRules {  
1429 - // moneyIncentivesRuleOriginal = moneyIncentivesRuleOriginal + moneyIncentivesRule.MoneyIncentivesStageCN +  
1430 - // ":" +  
1431 - // "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +  
1432 - // "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +  
1433 - // "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"  
1434 - // }  
1435 - // moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleOriginal + "】"  
1436 - //  
1437 - // // 变更后的业绩分红激励规则  
1438 - // var dividendsIncentivesRuleChanged string  
1439 - // for _, dividendsIncentivesRule := range cooperationContractSaved.DividendsIncentivesRules {  
1440 - // dividendsIncentivesRuleChanged = dividendsIncentivesRuleChanged + dividendsIncentivesRule.DividendsIncentivesStageCN +  
1441 - // ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +  
1442 - // "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +  
1443 - // "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +  
1444 - // "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +  
1445 - // "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"  
1446 - // }  
1447 - // dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleChanged + "】"  
1448 - //  
1449 - // // 拼接规则变更  
1450 - // incentivesRuleChangeDetail = moneyIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleOriginalTmp  
1451 - //} else { // 2.激励规则内容变更  
1452 - // if cooperationContractFound.IncentivesType == domain.TYPE_DIVIDNEDS_INCENTIVES { // 业绩分红激励规则变更  
1453 - // if !cooperationContract.DividendsIncentivesRuleSliceEqualBCE(cooperationContractFound.DividendsIncentivesRules, cooperationContractSaved.DividendsIncentivesRules) {  
1454 - // // 业绩分红-->业绩分红  
1455 - // incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))  
1456 - // //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】  
1457 - // // 原业绩分红激励规则  
1458 - // var dividendsIncentivesRuleOriginal string  
1459 - // for _, dividendsIncentivesRule := range cooperationContractFound.DividendsIncentivesRules {  
1460 - // dividendsIncentivesRuleOriginal = dividendsIncentivesRuleOriginal + dividendsIncentivesRule.DividendsIncentivesStageCN +  
1461 - // ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +  
1462 - // "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +  
1463 - // "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +  
1464 - // "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +  
1465 - // "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"  
1466 - // }  
1467 - // dividendsIncentivesRuleOriginalTmp := "【" + dividendsIncentivesRuleOriginal + "】"  
1468 - // // 变更后的业绩分红激励规则  
1469 - // var dividendsIncentivesRuleChanged string  
1470 - // for _, dividendsIncentivesRule := range cooperationContractSaved.DividendsIncentivesRules {  
1471 - // dividendsIncentivesRuleChanged = dividendsIncentivesRuleChanged + dividendsIncentivesRule.DividendsIncentivesStageCN +  
1472 - // ":" + fmt.Sprint(dividendsIncentivesRule.DividendsIncentivesPercentage) +  
1473 - // "," + dividendsIncentivesRule.DividendsIncentivesStageStart.Format("2006-01-02") +  
1474 - // "~" + dividendsIncentivesRule.DividendsIncentivesStageEnd.Format("2006-01-02") +  
1475 - // "," + fmt.Sprint(dividendsIncentivesRule.ReferrerPercentage) +  
1476 - // "," + fmt.Sprint(dividendsIncentivesRule.SalesmanPercentage) + ";"  
1477 - // }  
1478 - // dividendsIncentivesRuleChangedTmp := "【" + dividendsIncentivesRuleChanged + "】"  
1479 - // // 拼接规则变更  
1480 - // incentivesRuleChangeDetail = dividendsIncentivesRuleOriginalTmp + " 变更为 " + dividendsIncentivesRuleChangedTmp  
1481 - // }  
1482 - // } else if cooperationContractFound.IncentivesType == domain.MONEY_INCENTIVES { // 金额激励规则变更  
1483 - // if !cooperationContract.MoneyIncentivesRuleSliceEqualBCE(cooperationContractFound.MoneyIncentivesRules, cooperationContractSaved.MoneyIncentivesRules) {  
1484 - // incentivesRuleChange = cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractFound.IncentivesType)) + "-->" + cooperationContract.ReturnIncentivesName(domain.IncentivesType(cooperationContractSaved.IncentivesType))  
1485 - // //【第一阶段:20,2021-01-01~2021-12-31,,,;第二阶段:20,2021-01-01~2021-12-31,30,10】变更为【第一阶段:20,2021-01-01~2021-12-31,,,;】  
1486 - // // 原金额激励规则  
1487 - // var moneyIncentivesRuleOriginal string  
1488 - // for _, moneyIncentivesRule := range cooperationContractFound.MoneyIncentivesRules {  
1489 - // moneyIncentivesRuleOriginal = moneyIncentivesRuleOriginal + moneyIncentivesRule.MoneyIncentivesStageCN +  
1490 - // ":" +  
1491 - // "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +  
1492 - // "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +  
1493 - // "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"  
1494 - // }  
1495 - // moneyIncentivesRuleOriginalTmp := "【" + moneyIncentivesRuleOriginal + "】"  
1496 - // // 变更后的激励规则  
1497 - // var moneyIncentivesRuleChanged string  
1498 - // for _, moneyIncentivesRule := range cooperationContractSaved.MoneyIncentivesRules {  
1499 - // moneyIncentivesRuleChanged = moneyIncentivesRuleChanged + moneyIncentivesRule.MoneyIncentivesStageCN +  
1500 - // ":" +  
1501 - // "," + moneyIncentivesRule.MoneyIncentivesStageStart.Format("2006-01-02") +  
1502 - // "," + fmt.Sprint(moneyIncentivesRule.ReferrerPercentage) +  
1503 - // "," + fmt.Sprint(moneyIncentivesRule.SalesmanPercentage) + ";"  
1504 - // }  
1505 - // moneyIncentivesRuleChangedTmp := "【" + moneyIncentivesRuleChanged + "】"  
1506 - // // 拼接规则变更  
1507 - // incentivesRuleChangeDetail = moneyIncentivesRuleOriginalTmp + " 变更为 " + moneyIncentivesRuleChangedTmp  
1508 - // }  
1509 - // }  
1510 - //}  
1511 -  
1512 // 新增共创合约变更记录 1393 // 新增共创合约变更记录
1513 newCooperationContractChangeLog := &domain.CooperationContractChangeLog{ 1394 newCooperationContractChangeLog := &domain.CooperationContractChangeLog{
1514 IncentivesRule: incentivesRuleChange, 1395 IncentivesRule: incentivesRuleChange,
@@ -54,5 +54,6 @@ func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[st @@ -54,5 +54,6 @@ func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[st
54 if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok { 54 if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
55 contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string) 55 contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string)
56 } 56 }
  57 + contractUndertakerFeedback.UpdatedAt = time.Now()
57 return nil 58 return nil
58 } 59 }
@@ -75,5 +75,6 @@ func (cooperationApplication *CooperationApplication) Update(data map[string]int @@ -75,5 +75,6 @@ func (cooperationApplication *CooperationApplication) Update(data map[string]int
75 if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok { 75 if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok {
76 cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time) 76 cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time)
77 } 77 }
  78 + cooperationApplication.UpdatedAt = time.Now()
78 return nil 79 return nil
79 } 80 }
@@ -121,6 +121,7 @@ func (cooperationContract *CooperationContract) Update(data map[string]interface @@ -121,6 +121,7 @@ func (cooperationContract *CooperationContract) Update(data map[string]interface
121 if operateTime, ok := data["operateTime"]; ok { 121 if operateTime, ok := data["operateTime"]; ok {
122 cooperationContract.OperateTime = operateTime.(time.Time) 122 cooperationContract.OperateTime = operateTime.(time.Time)
123 } 123 }
  124 + cooperationContract.UpdatedAt = time.Now()
124 return nil 125 return nil
125 } 126 }
126 127
@@ -68,5 +68,6 @@ func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data ma @@ -68,5 +68,6 @@ func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data ma
68 if undertakers, ok := data["undertakers"]; ok { 68 if undertakers, ok := data["undertakers"]; ok {
69 cooperationContractChangeLog.Undertakers = undertakers.(string) 69 cooperationContractChangeLog.Undertakers = undertakers.(string)
70 } 70 }
  71 + cooperationContractChangeLog.UpdatedAt = time.Now()
71 return nil 72 return nil
72 } 73 }
@@ -81,5 +81,6 @@ func (cooperationContractRelevant *CooperationContractRelevant) Update(data map[ @@ -81,5 +81,6 @@ func (cooperationContractRelevant *CooperationContractRelevant) Update(data map[
81 if status, ok := data["status"]; ok { 81 if status, ok := data["status"]; ok {
82 cooperationContractRelevant.Relevant.Status = status.(int32) 82 cooperationContractRelevant.Relevant.Status = status.(int32)
83 } 83 }
  84 + cooperationContractRelevant.UpdatedAt = time.Now()
84 return nil 85 return nil
85 } 86 }
@@ -44,5 +44,6 @@ func (cooperationContractUndertaker *CooperationContractUndertaker) Update(data @@ -44,5 +44,6 @@ func (cooperationContractUndertaker *CooperationContractUndertaker) Update(data
44 if userBaseId, ok := data["userBaseId"]; ok { 44 if userBaseId, ok := data["userBaseId"]; ok {
45 cooperationContractUndertaker.Undertaker.UserBaseId = userBaseId.(int64) 45 cooperationContractUndertaker.Undertaker.UserBaseId = userBaseId.(int64)
46 } 46 }
  47 + cooperationContractUndertaker.UpdatedAt = time.Now()
47 return nil 48 return nil
48 } 49 }
@@ -55,5 +55,6 @@ func (cooperationMode *CooperationMode) Update(data map[string]interface{}) erro @@ -55,5 +55,6 @@ func (cooperationMode *CooperationMode) Update(data map[string]interface{}) erro
55 if remarks, ok := data["remarks"]; ok { 55 if remarks, ok := data["remarks"]; ok {
56 cooperationMode.Remarks = remarks.(string) 56 cooperationMode.Remarks = remarks.(string)
57 } 57 }
  58 + cooperationMode.UpdatedAt = time.Now()
58 return nil 59 return nil
59 } 60 }
@@ -86,5 +86,6 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{} @@ -86,5 +86,6 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{}
86 if attachment, ok := data["attachment"]; ok { 86 if attachment, ok := data["attachment"]; ok {
87 cooperationProject.Attachment = attachment.([]*Attachment) 87 cooperationProject.Attachment = attachment.([]*Attachment)
88 } 88 }
  89 + cooperationProject.UpdatedAt = time.Now()
89 return nil 90 return nil
90 } 91 }
@@ -85,6 +85,7 @@ func (creditAccount *CreditAccount) Update(data map[string]interface{}) error { @@ -85,6 +85,7 @@ func (creditAccount *CreditAccount) Update(data map[string]interface{}) error {
85 if actuallyPaidAmount, ok := data["actuallyPaidAmount"]; ok { 85 if actuallyPaidAmount, ok := data["actuallyPaidAmount"]; ok {
86 creditAccount.ActuallyPaidAmount = actuallyPaidAmount.(float64) 86 creditAccount.ActuallyPaidAmount = actuallyPaidAmount.(float64)
87 } 87 }
  88 + creditAccount.UpdatedAt = time.Now()
88 return nil 89 return nil
89 } 90 }
90 91
@@ -113,5 +113,6 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) @@ -113,5 +113,6 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{})
113 if isCanceled, ok := data["isCanceled"]; ok { 113 if isCanceled, ok := data["isCanceled"]; ok {
114 dividendsEstimate.IsCanceled = isCanceled.(bool) 114 dividendsEstimate.IsCanceled = isCanceled.(bool)
115 } 115 }
  116 + dividendsEstimate.UpdatedAt = time.Now()
116 return nil 117 return nil
117 } 118 }
@@ -77,5 +77,6 @@ func (dividendsIncentivesRule *DividendsIncentivesRule) Update(data map[string]i @@ -77,5 +77,6 @@ func (dividendsIncentivesRule *DividendsIncentivesRule) Update(data map[string]i
77 if dividendsIncentivesStageStart, ok := data["dividendsIncentivesStageStart"]; ok { 77 if dividendsIncentivesStageStart, ok := data["dividendsIncentivesStageStart"]; ok {
78 dividendsIncentivesRule.DividendsIncentivesStageStart = dividendsIncentivesStageStart.(time.Time) 78 dividendsIncentivesRule.DividendsIncentivesStageStart = dividendsIncentivesStageStart.(time.Time)
79 } 79 }
  80 + dividendsIncentivesRule.UpdatedAt = time.Now()
80 return nil 81 return nil
81 } 82 }
@@ -106,5 +106,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error @@ -106,5 +106,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error
106 if customerName, ok := data["customerName"]; ok { 106 if customerName, ok := data["customerName"]; ok {
107 dividendsOrder.CustomerName = customerName.(string) 107 dividendsOrder.CustomerName = customerName.(string)
108 } 108 }
  109 + dividendsOrder.UpdatedAt = time.Now()
109 return nil 110 return nil
110 } 111 }
@@ -97,5 +97,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int @@ -97,5 +97,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int
97 if dividendTime, ok := data["dividendTime"]; ok { 97 if dividendTime, ok := data["dividendTime"]; ok {
98 dividendsReturnedOrder.DividendTime = dividendTime.(time.Time) 98 dividendsReturnedOrder.DividendTime = dividendTime.(time.Time)
99 } 99 }
  100 + dividendsReturnedOrder.UpdatedAt = time.Now()
100 return nil 101 return nil
101 } 102 }
@@ -82,5 +82,6 @@ func (moneyIncentivesRule *MoneyIncentivesRule) Update(data map[string]interface @@ -82,5 +82,6 @@ func (moneyIncentivesRule *MoneyIncentivesRule) Update(data map[string]interface
82 if salesmanPercentage, ok := data["salesmanPercentage"]; ok { 82 if salesmanPercentage, ok := data["salesmanPercentage"]; ok {
83 moneyIncentivesRule.SalesmanPercentage = salesmanPercentage.(float64) 83 moneyIncentivesRule.SalesmanPercentage = salesmanPercentage.(float64)
84 } 84 }
  85 + moneyIncentivesRule.UpdatedAt = time.Now()
85 return nil 86 return nil
86 } 87 }
@@ -75,5 +75,6 @@ func (orderGood *OrderGood) Update(data map[string]interface{}) error { @@ -75,5 +75,6 @@ func (orderGood *OrderGood) Update(data map[string]interface{}) error {
75 if orderGoodExpense, ok := data["orderGoodExpense"]; ok { 75 if orderGoodExpense, ok := data["orderGoodExpense"]; ok {
76 orderGood.OrderGoodExpense = orderGoodExpense.(float64) 76 orderGood.OrderGoodExpense = orderGoodExpense.(float64)
77 } 77 }
  78 + orderGood.UpdatedAt = time.Now()
78 return nil 79 return nil
79 } 80 }
@@ -159,9 +159,9 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai @@ -159,9 +159,9 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
159 Status: undertaker.Status, 159 Status: undertaker.Status,
160 Company: undertaker.Company, 160 Company: undertaker.Company,
161 ContractAttachment: undertaker.ContractAttachment, 161 ContractAttachment: undertaker.ContractAttachment,
162 - CreatedAt: time.Time{}, 162 + CreatedAt: time.Now(),
163 UpdatedAt: time.Time{}, 163 UpdatedAt: time.Time{},
164 - DeletedAt: time.Now(), 164 + DeletedAt: time.Time{},
165 }) 165 })
166 } 166 }
167 if len(undertakersModel) > 0 { 167 if len(undertakersModel) > 0 {