|
@@ -2,8 +2,11 @@ package com.fjhx.account.service.account.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.fjhx.account.entity.account.dto.FundAccount;
|
|
|
import com.fjhx.account.entity.account.po.AccountManagement;
|
|
|
import com.fjhx.account.entity.account.po.AccountRemainder;
|
|
|
import com.fjhx.account.entity.account.po.AccountRunningWater;
|
|
@@ -12,8 +15,16 @@ import com.fjhx.account.service.account.AccountManagementService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.account.service.account.AccountRemainderService;
|
|
|
import com.fjhx.account.service.account.AccountRunningWaterService;
|
|
|
+import com.fjhx.common.constant.SourceConstant;
|
|
|
+import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
+import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.obs.services.internal.ServiceException;
|
|
|
+import com.ruoyi.common.annotation.TenantIgnore;
|
|
|
+import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.system.service.ISysUserService;
|
|
|
import org.apache.poi.util.StringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -25,6 +36,7 @@ import com.fjhx.account.entity.account.dto.AccountManagementDto;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -45,6 +57,12 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
@Autowired
|
|
|
private AccountRunningWaterService accountRunningWaterService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CorporationService corporationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 账户-管理表分页
|
|
|
*/
|
|
@@ -141,6 +159,102 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
.eq(AccountRemainder::getAccountManagementId,id));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 导入账户表的数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = {Exception.class})
|
|
|
+ @TenantIgnore
|
|
|
+ public void importsAmount(AccountManagementDto dto) {
|
|
|
+ //查询云帆账户表的数据
|
|
|
+// List<FundAccount> fundAccounts = baseMapper.importsAmount(dto);
|
|
|
+// for (FundAccount fundAccount : fundAccounts) {
|
|
|
+// //添加资金账户表的数据
|
|
|
+// AccountManagement accountManagement = new AccountManagement();
|
|
|
+// //查询多公司表
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getCompanyId())){
|
|
|
+// DynamicDataSourceContextHolder.push(SourceConstant.COMMON);
|
|
|
+//
|
|
|
+// Corporation corporation = corporationService.getOne(Wrappers.<Corporation>lambdaQuery().eq(Corporation::getYfId,fundAccount.getCompanyId()));
|
|
|
+// if(ObjectUtil.isNotEmpty(corporation)){
|
|
|
+// accountManagement.setCorporationId(corporation.getId());
|
|
|
+// }
|
|
|
+//
|
|
|
+// DynamicDataSourceContextHolder.poll();
|
|
|
+// }
|
|
|
+// accountManagement.setTenantId(fundAccount.getTenantId());
|
|
|
+// accountManagement.setYfId(fundAccount.getId());
|
|
|
+// accountManagement.setAlias(fundAccount.getName());
|
|
|
+// accountManagement.setAccountOpening(fundAccount.getAccountNumber());
|
|
|
+// accountManagement.setCreateTime(fundAccount.getCreateTime());
|
|
|
+// accountManagement.setUpdateTime(fundAccount.getUpdateTime());
|
|
|
+// accountManagement.setAccountOpening(fundAccount.getAccountNumber());
|
|
|
+// //查询用户
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getCreateUser())){
|
|
|
+// DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+// SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getCreateUser()));
|
|
|
+// accountManagement.setCreateUser(sysUser.getUserId());
|
|
|
+// DynamicDataSourceContextHolder.poll();
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getUpdateUser())){
|
|
|
+// DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+// SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getUpdateUser()));
|
|
|
+// accountManagement.setCreateUser(sysUser.getUserId());
|
|
|
+// DynamicDataSourceContextHolder.poll();
|
|
|
+// }
|
|
|
+// accountManagement.setCreateTime(fundAccount.getCreateTime());
|
|
|
+// accountManagement.setUpdateTime(fundAccount.getUpdateTime());
|
|
|
+// baseMapper.insert(accountManagement);
|
|
|
+//
|
|
|
+// //添加资金账户余额表的信息
|
|
|
+// AccountRemainder accountRemainder = new AccountRemainder();
|
|
|
+// accountRemainder.setTenantId(fundAccount.getTenantId());
|
|
|
+// accountRemainder.setAccountManagementId(accountManagement.getId());
|
|
|
+// //查询用户
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getCreateUser())){
|
|
|
+// DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+// SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getCreateUser()));
|
|
|
+// accountRemainder.setCreateUser(sysUser.getUserId());
|
|
|
+// DynamicDataSourceContextHolder.poll();
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getUpdateUser())){
|
|
|
+//
|
|
|
+// DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+// SysUser sysUser = sysUserService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getYfUserId, fundAccount.getUpdateUser()));
|
|
|
+// accountRemainder.setCreateUser(sysUser.getUserId());
|
|
|
+// DynamicDataSourceContextHolder.poll();
|
|
|
+// }
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getRmbAmount())){
|
|
|
+// accountRemainder.setId(IdWorker.getId());
|
|
|
+// accountRemainder.setRemainder(fundAccount.getRmbAmount());
|
|
|
+// accountRemainder.setCurrency("RMB");
|
|
|
+// accountRemainderService.save(accountRemainder);
|
|
|
+// }
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getDollarAmount())){
|
|
|
+// accountRemainder.setId(IdWorker.getId());
|
|
|
+// accountRemainder.setRemainder(fundAccount.getDollarAmount());
|
|
|
+// accountRemainder.setCurrency("USD");
|
|
|
+// accountRemainderService.save(accountRemainder);
|
|
|
+// }
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getEuroAmount())){
|
|
|
+// accountRemainder.setId(IdWorker.getId());
|
|
|
+// accountRemainder.setRemainder(fundAccount.getEuroAmount());
|
|
|
+// accountRemainder.setCurrency("EUR");
|
|
|
+// accountRemainderService.save(accountRemainder);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (ObjectUtil.isNotEmpty(fundAccount.getSterlingAmount())){
|
|
|
+// accountRemainder.setId(IdWorker.getId());
|
|
|
+// accountRemainder.setRemainder(fundAccount.getSterlingAmount());
|
|
|
+// accountRemainder.setCurrency("GBP");
|
|
|
+// accountRemainderService.save(accountRemainder);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 添加账户-余额表的信息
|