作者 陈志颖

fix:修复承接人创建时间错误

@@ -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,
@@ -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 {