作者 陈志颖

test:分红预算

... ... @@ -728,12 +728,14 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
cooperationContractNumbers = append(cooperationContractNumbers, orderGood.CooperationContractNumber)
}
newCooperationContractNumbers := utils.RemoveDuplicationString(cooperationContractNumbers)
startFindContracts := time.Now()
// 查询共创合约
cooperationContractsMap := make(map[string]*domain.CooperationContract, 0)
if count, cooperationContractsFound, err := cooperationContractRepository.Find(map[string]interface{}{
"cooperationContractNumbers": cooperationContractNumbers,
"cooperationContractNumbers": newCooperationContractNumbers,
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
"orgId": confirmDividendsIncentivesEstimateCommand.OrgId,
"offsetLimit": false,
... ...
... ... @@ -164,6 +164,21 @@ func RemoveDuplicationInt64(arr []int64) []int64 {
return arr[:j]
}
func RemoveDuplicationString(arr []string) []string {
set := make(map[string]struct{}, len(arr))
j := 0
for _, v := range arr {
_, ok := set[v]
if ok {
continue
}
set[v] = struct{}{}
arr[j] = v
j++
}
return arr[:j]
}
func RemoveDuplicationInt32(arr []int32) []int32 {
set := make(map[int32]struct{}, len(arr))
j := 0
... ...
... ... @@ -13,7 +13,7 @@ func init() {
Logger = NewBeegoLog(LoggerConfig{
Filename: constant.LOG_FILE,
Level: 7,
MaxSize: 1024 * 1024 * 10,
MaxSize: 1024 * 1024 * 6,
})
} else if constant.LOG_FRAMEWORK == "logrus" {
Logger = logrus.NewLogrusLogger()
... ...