|
@@ -20,9 +20,10 @@ 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.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
+import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
|
-import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
+import com.fjhx.tenant.utils.DictUtils;
|
|
|
+import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -44,23 +46,19 @@ import java.util.stream.Collectors;
|
|
|
* 账户-管理表 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
- * @author
|
|
|
+ * @author -
|
|
|
* @since 2023-04-06
|
|
|
*/
|
|
|
@Service
|
|
|
public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementMapper, AccountManagement> implements AccountManagementService {
|
|
|
@Autowired
|
|
|
private AccountRemainderService accountRemainderService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private AccountRunningWaterService accountRunningWaterService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private DictTenantDataService dictTenantDataService;
|
|
|
@Autowired
|
|
|
+ @Resource
|
|
|
private CorporationService corporationService;
|
|
|
|
|
|
-
|
|
|
|
|
|
* 账户-管理表分页
|
|
|
*/
|
|
@@ -69,12 +67,10 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
IWrapper<AccountManagement> wrapper = getWrapper();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
- wrapper.and(wrapper1 -> {
|
|
|
- wrapper1.like(AccountManagement::getName, dto.getKeyword()).or()
|
|
|
- .like(AccountManagement::getAlias, dto.getKeyword()).or()
|
|
|
- .like(AccountManagement::getAccountOpening, dto.getKeyword()).or()
|
|
|
- .like(AccountManagement::getOpeningBank, dto.getKeyword());
|
|
|
- });
|
|
|
+ wrapper.and(wrapper1 -> wrapper1.like(AccountManagement::getName, dto.getKeyword()).or()
|
|
|
+ .like(AccountManagement::getAlias, dto.getKeyword()).or()
|
|
|
+ .like(AccountManagement::getAccountOpening, dto.getKeyword()).or()
|
|
|
+ .like(AccountManagement::getOpeningBank, dto.getKeyword()));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -88,9 +84,7 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
Page<AccountManagementVo> page = baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<AccountManagementVo> records = page.getRecords();
|
|
|
|
|
|
- corporationService.attributeAssign(records, AccountManagementVo::getCorporationId, (item, corporation) -> {
|
|
|
- item.setCorporationName(corporation.getName());
|
|
|
- });
|
|
|
+ corporationService.attributeAssign(records, AccountManagementVo::getCorporationId, (item, corporation) -> item.setCorporationName(corporation.getName()));
|
|
|
return page;
|
|
|
}
|
|
|
|
|
@@ -150,7 +144,7 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
}
|
|
|
|
|
|
List<AccountRemainder> accountRemainderList = accountManagementDto.getAccountRemainderList();
|
|
|
- List<Long> ids = accountRemainderList.stream().map(accountRemainder -> accountRemainder.getId()).collect(Collectors.toList());
|
|
|
+ List<Long> ids = accountRemainderList.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
accountRemainderService.remove(Wrappers.<AccountRemainder>lambdaQuery()
|
|
|
.eq(AccountRemainder::getAccountManagementId, accountManagementDto.getId())
|
|
|
.notIn(AccountRemainder::getId, ids)
|
|
@@ -195,7 +189,7 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
|
|
|
- List<DictTenantDataVo> dictTenantDataVos = getDict("customer_source");
|
|
|
+ List<DictTenantDataVo> dictTenantDataVos = DictUtils.getDictList("customer_source");
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
|
if (dictTenantDataVos.size() == 0) {
|
|
@@ -224,117 +218,13 @@ public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementM
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private List<DictTenantDataVo> getDict(String code) {
|
|
|
- DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
|
|
|
- dto.setDictCode(code);
|
|
|
- return dictTenantDataService.getList(dto);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
* 添加账户-余额表的信息
|
|
|
*/
|
|
|
private void saveAccountRemainder(AccountManagementDto accountManagementDto) {
|
|
|
List<AccountRemainder> accountRemainderList = accountManagementDto.getAccountRemainderList();
|
|
|
accountRemainderList.forEach(accountRemainder -> {
|
|
|
+ Assert.notEmpty(accountRemainder.getCurrency(), "币种不能为空!");
|
|
|
accountRemainder.setAccountManagementId(accountManagementDto.getId());
|
|
|
accountRemainderService.add(accountRemainder);
|
|
|
});
|