作者 陈志颖

test:分红预算

@@ -728,12 +728,14 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -728,12 +728,14 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
728 cooperationContractNumbers = append(cooperationContractNumbers, orderGood.CooperationContractNumber) 728 cooperationContractNumbers = append(cooperationContractNumbers, orderGood.CooperationContractNumber)
729 } 729 }
730 730
  731 + newCooperationContractNumbers := utils.RemoveDuplicationString(cooperationContractNumbers)
  732 +
731 startFindContracts := time.Now() 733 startFindContracts := time.Now()
732 734
733 // 查询共创合约 735 // 查询共创合约
734 cooperationContractsMap := make(map[string]*domain.CooperationContract, 0) 736 cooperationContractsMap := make(map[string]*domain.CooperationContract, 0)
735 if count, cooperationContractsFound, err := cooperationContractRepository.Find(map[string]interface{}{ 737 if count, cooperationContractsFound, err := cooperationContractRepository.Find(map[string]interface{}{
736 - "cooperationContractNumbers": cooperationContractNumbers, 738 + "cooperationContractNumbers": newCooperationContractNumbers,
737 "companyId": confirmDividendsIncentivesEstimateCommand.CompanyId, 739 "companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
738 "orgId": confirmDividendsIncentivesEstimateCommand.OrgId, 740 "orgId": confirmDividendsIncentivesEstimateCommand.OrgId,
739 "offsetLimit": false, 741 "offsetLimit": false,
@@ -164,6 +164,21 @@ func RemoveDuplicationInt64(arr []int64) []int64 { @@ -164,6 +164,21 @@ func RemoveDuplicationInt64(arr []int64) []int64 {
164 return arr[:j] 164 return arr[:j]
165 } 165 }
166 166
  167 +func RemoveDuplicationString(arr []string) []string {
  168 + set := make(map[string]struct{}, len(arr))
  169 + j := 0
  170 + for _, v := range arr {
  171 + _, ok := set[v]
  172 + if ok {
  173 + continue
  174 + }
  175 + set[v] = struct{}{}
  176 + arr[j] = v
  177 + j++
  178 + }
  179 + return arr[:j]
  180 +}
  181 +
167 func RemoveDuplicationInt32(arr []int32) []int32 { 182 func RemoveDuplicationInt32(arr []int32) []int32 {
168 set := make(map[int32]struct{}, len(arr)) 183 set := make(map[int32]struct{}, len(arr))
169 j := 0 184 j := 0
@@ -13,7 +13,7 @@ func init() { @@ -13,7 +13,7 @@ func init() {
13 Logger = NewBeegoLog(LoggerConfig{ 13 Logger = NewBeegoLog(LoggerConfig{
14 Filename: constant.LOG_FILE, 14 Filename: constant.LOG_FILE,
15 Level: 7, 15 Level: 7,
16 - MaxSize: 1024 * 1024 * 10, 16 + MaxSize: 1024 * 1024 * 6,
17 }) 17 })
18 } else if constant.LOG_FRAMEWORK == "logrus" { 18 } else if constant.LOG_FRAMEWORK == "logrus" {
19 Logger = logrus.NewLogrusLogger() 19 Logger = logrus.NewLogrusLogger()