|
|
@@ -3,18 +3,17 @@ 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;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.kym.common.exception.BusinessException;
|
|
|
import com.kym.common.utils.CommUtil;
|
|
|
-import com.kym.entity.admin.InvestorInfo;
|
|
|
-import com.kym.entity.admin.Statements;
|
|
|
-import com.kym.entity.admin.StationStatMonth;
|
|
|
+import com.kym.entity.admin.*;
|
|
|
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.InvestorInfoService;
|
|
|
-import com.kym.service.admin.StatementsService;
|
|
|
-import com.kym.service.admin.StationStatMonthService;
|
|
|
+import com.kym.service.admin.*;
|
|
|
import com.kym.service.cache.KymCache;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -30,15 +29,18 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
*/
|
|
|
@Service
|
|
|
@DS("db-admin")
|
|
|
-public class StatementsServiceImpl extends ServiceImpl<StatementsMapper, Statements> implements StatementsService {
|
|
|
+public class StatementsServiceImpl extends MPJBaseServiceImpl<StatementsMapper, Statements> implements StatementsService {
|
|
|
|
|
|
private final InvestorInfoService investorInfoService;
|
|
|
|
|
|
private final StationStatMonthService stationStatMonthService;
|
|
|
|
|
|
- public StatementsServiceImpl(InvestorInfoService investorInfoService, StationStatMonthService stationStatMonthService) {
|
|
|
+ private final AdminUserRoleService adminUserRoleService;
|
|
|
+
|
|
|
+ public StatementsServiceImpl(InvestorInfoService investorInfoService, StationStatMonthService stationStatMonthService, AdminUserRoleService adminUserRoleService) {
|
|
|
this.investorInfoService = investorInfoService;
|
|
|
this.stationStatMonthService = stationStatMonthService;
|
|
|
+ this.adminUserRoleService = adminUserRoleService;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -116,7 +118,18 @@ public class StatementsServiceImpl extends ServiceImpl<StatementsMapper, Stateme
|
|
|
public StatementsVo preview(String statId) {
|
|
|
var statements = getById(statId);
|
|
|
var investorInfo = investorInfoService.lambdaQuery().eq(InvestorInfo::getAdminUserId, statements.getAdminUserId()).one();
|
|
|
+ // 查询角色
|
|
|
+ MPJLambdaWrapper<AdminUserRole> wrapper = JoinWrappers.lambda(AdminUserRole.class)
|
|
|
+ .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());
|
|
|
BeanUtils.copyProperties(statements, statementsVo);
|
|
|
BeanUtils.copyProperties(investorInfo, statementsVo);
|
|
|
return statementsVo;
|