|
|
@@ -1,7 +1,6 @@
|
|
|
package com.kym.service.admin.impl;
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
@@ -13,7 +12,10 @@ import com.kym.entity.admin.queryParams.StatementsQueryParam;
|
|
|
import com.kym.entity.admin.vo.StatementsVo;
|
|
|
import com.kym.entity.common.PageBean;
|
|
|
import com.kym.mapper.admin.StatementsMapper;
|
|
|
-import com.kym.service.admin.*;
|
|
|
+import com.kym.service.admin.AdminUserRoleService;
|
|
|
+import com.kym.service.admin.InvestorInfoService;
|
|
|
+import com.kym.service.admin.StatementsService;
|
|
|
+import com.kym.service.admin.StationStatMonthService;
|
|
|
import com.kym.service.cache.KymCache;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -99,6 +101,13 @@ public class StatementsServiceImpl extends MPJBaseServiceImpl<StatementsMapper,
|
|
|
.setVatAmount((int) (splittingAmount / (1 + investorInfo.getVatRate()) * investorInfo.getVatRate() * 1.12)) // 增值税额(分)
|
|
|
.setActualSplittingAmount(splittingAmount - (int) (splittingAmount / (1 + investorInfo.getVatRate()) * investorInfo.getVatRate() * 1.12)); // 实际分成金额(分)
|
|
|
}).toList();
|
|
|
+ // 删除之前生成的对账单(投资者/物业 - 站点 - 月份)
|
|
|
+ var oldData = lambdaQuery()
|
|
|
+ .eq(Statements::getStatMonth, statMonthInfo.getStatMonth())
|
|
|
+ .eq(Statements::getStationId, statMonthInfo.getStationId())
|
|
|
+ .in(Statements::getAdminUserId, investorInfoList.stream().map(InvestorInfo::getAdminUserId).toList())
|
|
|
+ .list().stream().map(Statements::getId).toList();
|
|
|
+ removeBatchByIds(oldData);
|
|
|
saveBatch(res);
|
|
|
}
|
|
|
|
|
|
@@ -109,7 +118,7 @@ public class StatementsServiceImpl extends MPJBaseServiceImpl<StatementsMapper,
|
|
|
.eq(!CommUtil.isEmptyOrNull(params.getStationId()), Statements::getStationId, params.getStationId())
|
|
|
.eq(!CommUtil.isEmptyOrNull(params.getStatMonth()), Statements::getStatMonth, params.getStatMonth())
|
|
|
.like(!CommUtil.isEmptyOrNull(params.getAdminUserName()), Statements::getAdminUserName, params.getAdminUserName())
|
|
|
- .orderByDesc(Statements::getStatMonth)
|
|
|
+ .orderByDesc(Statements::getCreateTime)
|
|
|
.list();
|
|
|
return new PageBean<>(res);
|
|
|
}
|
|
|
@@ -117,16 +126,17 @@ public class StatementsServiceImpl extends MPJBaseServiceImpl<StatementsMapper,
|
|
|
@Override
|
|
|
public StatementsVo preview(String statId) {
|
|
|
var statements = getById(statId);
|
|
|
- var investorInfo = investorInfoService.lambdaQuery().eq(InvestorInfo::getAdminUserId, statements.getAdminUserId()).one();
|
|
|
+ var investorInfo = investorInfoService.lambdaQuery()
|
|
|
+ .eq(InvestorInfo::getAdminUserId, statements.getAdminUserId())
|
|
|
+ .eq(InvestorInfo::getStationId, statements.getStationId())
|
|
|
+ .list();
|
|
|
// 查询角色
|
|
|
MPJLambdaWrapper<AdminUserRole> wrapper = JoinWrappers.lambda(AdminUserRole.class)
|
|
|
- .select(Role::getRoleName,Role::getRoleDesc)
|
|
|
- .leftJoin(Role.class,Role::getId,AdminUserRole::getRoleId)
|
|
|
- .eq(AdminUserRole::getAdminUserId,statements.getAdminUserId());
|
|
|
+ .select(Role::getRoleName, Role::getRoleDesc)
|
|
|
+ .leftJoin(Role.class, Role::getId, AdminUserRole::getRoleId)
|
|
|
+ .eq(AdminUserRole::getAdminUserId, statements.getAdminUserId());
|
|
|
var res = adminUserRoleService.selectJoinMap(wrapper);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
var statementsVo = new StatementsVo();
|
|
|
statementsVo.setRoleName(res.get("role_name").toString());
|
|
|
statementsVo.setRoleDesc(res.get("role_desc").toString());
|