作者 陈志颖

test:分红预算

@@ -521,7 +521,6 @@ func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimat @@ -521,7 +521,6 @@ func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimat
521 521
522 // ConfirmDividendsIncentivesEstimate 确定业绩激励分红预算 522 // ConfirmDividendsIncentivesEstimate 确定业绩激励分红预算
523 func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncentivesEstimate(confirmDividendsIncentivesEstimateCommand *command.ConfirmDividendsIncentivesEstimateCommand) (interface{}, error) { 523 func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncentivesEstimate(confirmDividendsIncentivesEstimateCommand *command.ConfirmDividendsIncentivesEstimateCommand) (interface{}, error) {
524 - start := time.Now() // 获取当前时间  
525 if err := confirmDividendsIncentivesEstimateCommand.ValidateCommand(); err != nil { 524 if err := confirmDividendsIncentivesEstimateCommand.ValidateCommand(); err != nil {
526 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 525 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
527 } 526 }
@@ -699,13 +698,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -699,13 +698,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
699 // 统计预算失败的分红订单 698 // 统计预算失败的分红订单
700 estimateFailedDividendsOrders := make(map[string]string) 699 estimateFailedDividendsOrders := make(map[string]string)
701 700
702 - initRepo := time.Since(start)  
703 - log.Logger.Info("初始化耗时", map[string]interface{}{  
704 - "初始化耗时": initRepo.Seconds(),  
705 - })  
706 -  
707 - startFindOrderGood := time.Now() // 获取当前时间  
708 -  
709 // 获取订单产品 701 // 获取订单产品
710 if _, orderGoods, err := orderGoodRepository.Find(map[string]interface{}{ 702 if _, orderGoods, err := orderGoodRepository.Find(map[string]interface{}{
711 "orderGoodIds": orderGoodIds, 703 "orderGoodIds": orderGoodIds,
@@ -713,12 +705,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -713,12 +705,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
713 }); err != nil { 705 }); err != nil {
714 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 706 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
715 } else { 707 } else {
716 -  
717 - findOrderGood := time.Since(startFindOrderGood)  
718 - log.Logger.Info("查询预算产品耗时", map[string]interface{}{  
719 - "初始化耗时": findOrderGood.Seconds(),  
720 - })  
721 -  
722 dividendsEstimates := make([]*domain.DividendsEstimate, 0) 708 dividendsEstimates := make([]*domain.DividendsEstimate, 0)
723 709
724 var cooperationContractNumbers []string 710 var cooperationContractNumbers []string
@@ -730,8 +716,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -730,8 +716,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
730 716
731 newCooperationContractNumbers := utils.RemoveDuplicationString(cooperationContractNumbers) 717 newCooperationContractNumbers := utils.RemoveDuplicationString(cooperationContractNumbers)
732 718
733 - startFindContracts := time.Now()  
734 -  
735 // 查询共创合约 719 // 查询共创合约
736 cooperationContractsMap := make(map[string]*domain.CooperationContract, 0) 720 cooperationContractsMap := make(map[string]*domain.CooperationContract, 0)
737 if count, cooperationContractsFound, err := cooperationContractRepository.Find(map[string]interface{}{ 721 if count, cooperationContractsFound, err := cooperationContractRepository.Find(map[string]interface{}{
@@ -749,11 +733,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -749,11 +733,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
749 } 733 }
750 } 734 }
751 735
752 - endFindContracts := time.Since(startFindContracts)  
753 - log.Logger.Info("查询合约耗时", map[string]interface{}{  
754 - "查询合约耗时": endFindContracts.Seconds(),  
755 - })  
756 -  
757 log.Logger.Info("查询共创合约", map[string]interface{}{ 736 log.Logger.Info("查询共创合约", map[string]interface{}{
758 "cooperationContractsMap": cooperationContractsMap, 737 "cooperationContractsMap": cooperationContractsMap,
759 }) 738 })
@@ -768,8 +747,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -768,8 +747,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
768 747
769 var countDividendsEstimate int64 748 var countDividendsEstimate int64
770 749
771 - startConfirm := time.Now()  
772 -  
773 for _, orderGood := range orderGoods { 750 for _, orderGood := range orderGoods {
774 dividendsEstimate := &domain.DividendsEstimate{} 751 dividendsEstimate := &domain.DividendsEstimate{}
775 if orderGood.DividendsOrderNumber != "" { // 查询分红订单 752 if orderGood.DividendsOrderNumber != "" { // 查询分红订单
@@ -887,25 +864,13 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -887,25 +864,13 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
887 } 864 }
888 } 865 }
889 866
890 - endConfirm := time.Since(startConfirm)  
891 - log.Logger.Info("预算耗时", map[string]interface{}{  
892 - "预算耗时": endConfirm.Seconds(),  
893 - })  
894 -  
895 log.Logger.Info("新增的分红预算单", map[string]interface{}{ 867 log.Logger.Info("新增的分红预算单", map[string]interface{}{
896 "dividendsEstimates": dividendsEstimates, 868 "dividendsEstimates": dividendsEstimates,
897 }) 869 })
898 870
899 - startSave := time.Now()  
900 -  
901 if dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates); err != nil { 871 if dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates); err != nil {
902 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 872 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
903 } else { 873 } else {
904 - endSave := time.Since(startSave)  
905 - log.Logger.Info("保存预算单耗时", map[string]interface{}{  
906 - "保存预算单耗时": endSave.Seconds(),  
907 - })  
908 -  
909 // 获取产品ID 874 // 获取产品ID
910 orderGoodSavedIds := make([]int64, 0) 875 orderGoodSavedIds := make([]int64, 0)
911 for _, dividendsEstimate := range dividendsEstimates { 876 for _, dividendsEstimate := range dividendsEstimates {
@@ -15,7 +15,6 @@ type LoggerConfig struct { @@ -15,7 +15,6 @@ type LoggerConfig struct {
15 Level int `json:"level,omitempty"` 15 Level int `json:"level,omitempty"`
16 Filename string `json:"filename,omitempty"` 16 Filename string `json:"filename,omitempty"`
17 MaxSize int `json:"maxsize,omitempty"` 17 MaxSize int `json:"maxsize,omitempty"`
18 - Maxlines int `json:"maxlines,omitempty"`  
19 MaxBackups int `json:"max_backups,omitempty"` 18 MaxBackups int `json:"max_backups,omitempty"`
20 MaxAge int `json:"max_age,omitempty"` 19 MaxAge int `json:"max_age,omitempty"`
21 Compress bool `json:"compress,omitempty"` 20 Compress bool `json:"compress,omitempty"`
@@ -14,7 +14,6 @@ func init() { @@ -14,7 +14,6 @@ func init() {
14 Filename: constant.LOG_FILE, 14 Filename: constant.LOG_FILE,
15 Level: 7, 15 Level: 7,
16 MaxSize: 1024 * 1024 * 2, 16 MaxSize: 1024 * 1024 * 2,
17 - Maxlines: 10000000,  
18 }) 17 })
19 } else if constant.LOG_FRAMEWORK == "logrus" { 18 } else if constant.LOG_FRAMEWORK == "logrus" {
20 Logger = logrus.NewLogrusLogger() 19 Logger = logrus.NewLogrusLogger()