|
@@ -3,7 +3,6 @@ package com.fjhx.account.service.account.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
-import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -16,7 +15,6 @@ import com.fjhx.account.entity.account.vo.AccountPaymentRecordsVo;
|
|
|
import com.fjhx.account.entity.account.vo.AccountPaymentVo;
|
|
|
import com.fjhx.account.mapper.account.AccountPaymentMapper;
|
|
|
import com.fjhx.account.service.account.*;
|
|
|
-import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
@@ -32,7 +30,6 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -110,27 +107,22 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- corporationService.attributeAssign(records, AccountPaymentVo::getCorporationId, (item, corporation) -> {
|
|
|
- item.setCorporationName(corporation.getName());
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
UserUtil.assignmentNickName(records, AccountPayment::getDataUser, AccountPaymentVo::setUserName);
|
|
|
|
|
|
-
|
|
|
- DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
- List<Long> deptIdList = records.stream()
|
|
|
- .map(AccountPaymentVo::getDepartmentId)
|
|
|
- .filter(Objects::nonNull)
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (ObjectUtil.isNotEmpty(deptIdList)) {
|
|
|
- List<SysDept> sysDeptList = sysDeptService.listByIds(deptIdList);
|
|
|
- Map<Long, String> deptMap = sysDeptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
|
|
- records.forEach(item -> item.setDeptName(deptMap.get(item.getDepartmentId())));
|
|
|
+
|
|
|
+ List<SysDept> sysDeptList = sysDeptService.list();
|
|
|
+ Map<Long, String> deptMap = sysDeptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
|
|
+
|
|
|
+ for (AccountPaymentVo record : records) {
|
|
|
+ record.setCorporationName(deptMap.get(record.getCorporationId()));
|
|
|
+ record.setDeptName(deptMap.get(record.getDepartmentId()));
|
|
|
}
|
|
|
- DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
return page;
|
|
|
}
|