Merge branch 'feature/mall_product' of http://117.33.142.185:3000/zenghuapei/cyywl_server into feature/mall_product

pull/2/head
TianYu 2023-05-29 09:54:24 +08:00
commit 49c9611182
22 changed files with 353 additions and 8 deletions

View File

@ -133,6 +133,7 @@ public class RechargeOrderController {
@PreAuthenticated
@Operation(summary = "退款")
@RequestMapping(value = "/memberRefund", method = RequestMethod.POST)
@PreAuthorize("@ss.hasPermission('shop:recharge-order:refund')")
public CommonResult<Object> memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception {
log.info("memberRefund会员退款===>{}", request);
Object obj=null;

View File

@ -126,6 +126,10 @@ public class RechargeOrderPageReqVO extends PageParam {
@Schema(description = "第三方支付流水号")
private String paySerialNumber;
/**
* 广id
*/
@Schema(description = "推广员id")
private Long promoterId;
}

View File

@ -1,10 +1,14 @@
package cn.iocoder.yudao.module.shop.controller.app.member;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderPageReqVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
@ -58,6 +62,22 @@ public class MemberController {
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() {
return CommonResult.success(rechargeOrderService.memberOrderInfo());
}
@Operation(summary = "获取当前登录账号的推广员推广会员记录")
@RequestMapping(value = "/promoterOrderInfo", method = RequestMethod.GET)
@PreAuthenticated
@TenantIgnore
public CommonResult<PageResult<RechargeOrderRespVO>> promoterOrderInfo(RechargeOrderPageReqVO pageRespVO) {
pageRespVO.setPromoterId(SecurityFrameworkUtils.getLoginUserId());
return CommonResult.success(rechargeOrderService.promoterOrderInfo(pageRespVO));
}
@Operation(summary = "获取当前登录发展会员数量统计")
@RequestMapping(value = "/promoterOrderCount", method = RequestMethod.GET)
@PreAuthenticated
@TenantIgnore
@Parameter(name = "type", description = "时间类型1、当日2、上周3、上月4、累计", required = true)
public CommonResult<PromoterMemberOrderVO> promoterOrderCount(@RequestParam Integer type) {
return CommonResult.success(rechargeOrderService.promoterOrderCount(type,SecurityFrameworkUtils.getLoginUserId()));
}
@Operation(summary = "会员头部信息")
@RequestMapping(value = "/memberHeadInfo", method = RequestMethod.GET)
@PreAuthenticated

View File

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.shop.controller.app.member.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Data
@Schema(description = "会员发展数量统计")
public class PromoterMemberOrderVO {
@Schema(description = "总金额")
private Long memberCount;
@Schema(description = "总金额")
private BigDecimal totalAmount;
@Schema(description = "会员提成")
private Integer memberCommission;
}

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.shop.dal.mysql.recharge;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -10,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* Mapper
@ -57,7 +60,7 @@ public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {
.orderByDesc(RechargeOrderDO::getId));
}
IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data);
BigDecimal promoterOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate")LocalDateTime endDate,@Param("promoterId") Long promoterId);
List<RechargeOrderExcelVO> findListExcel(@Param("data") RechargeOrderExportReqVO data);
default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) {

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.service.recharge;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
@ -75,6 +76,10 @@ public interface RechargeOrderService {
List<RechargeOrderRespVO> memberOrderInfo();
PageResult<RechargeOrderRespVO> promoterOrderInfo(RechargeOrderPageReqVO pageRespVO);
PromoterMemberOrderVO promoterOrderCount(Integer type,Long promoterId);
MemberHeadResponse memberHeadInfo();
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);

View File

@ -1,13 +1,19 @@
package cn.iocoder.yudao.module.shop.service.recharge;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,7 +26,11 @@ import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
@ -51,6 +61,11 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
private MemberUserApi userService;
@Resource
private PhoneRecordService phoneRecordService;
@Resource
private MemberUserApi memberUserApi;
@Resource
private TenantApi tenantApi;
@Override
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
@ -125,7 +140,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Assert.notNull(loginUser, "登录失效,请重新登录!");
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery()
.eq(RechargeOrderDO::getUid, loginUser.getId()).eq(RechargeOrderDO::getPaid, 1));
.eq(RechargeOrderDO::getUid, loginUser.getId()).ne(RechargeOrderDO::getPaid, 0));
if (!CollectionUtils.isEmpty(orderDOS)) {
List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
List<String> collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
@ -153,6 +168,64 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return null;
}
@Override
public PageResult<RechargeOrderRespVO> promoterOrderInfo(RechargeOrderPageReqVO pageReqVO) {
Page<RechargeOrderRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
rechargeOrderMapper.findListPage(page, pageReqVO);
if (!CollectionUtils.isEmpty(page.getRecords())) {
List<String> collect1 = page.getRecords().stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
List<RechargeOrderInfoDO> infoDOS = infoMapper.selectList(Wrappers.<RechargeOrderInfoDO>lambdaQuery().in(RechargeOrderInfoDO::getOrderNo, collect1));
Map<String, List<RechargeOrderInfoDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(RechargeOrderInfoDO::getOrderNo));
for (RechargeOrderRespVO orderDO : page.getRecords()) {
StringBuilder grade = new StringBuilder();
List<RechargeOrderInfoDO> infoDOS1 = collect.get(orderDO.getOrderId());
for (RechargeOrderInfoDO infoDO : infoDOS1) {
if (infoDO.getPrice().compareTo(new BigDecimal("240")) == 0) {
grade.append("套餐1,");
} else if (infoDO.getPrice().compareTo(new BigDecimal("400")) == 0) {
grade.append("套餐2,");
} else if (infoDO.getPrice().compareTo(new BigDecimal("640")) == 0) {
grade.append("套餐3");
}
}
orderDO.setGrade(grade.toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter));
}
return new PageResult<>(page.getRecords(), page.getTotal());
}
return null;
}
@Override
public PromoterMemberOrderVO promoterOrderCount(Integer type,Long promoterId) {
PromoterMemberOrderVO promoterMemberOrderVO = new PromoterMemberOrderVO();
AppUserInfoReqDTO appUserInfoReqDTO = new AppUserInfoReqDTO();
appUserInfoReqDTO.setPromoterId(promoterId);
if(type==1){
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(LocalDateTime.now()));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(LocalDateTime.now()));
}else if (type == 2){
LocalDateTime todayOfLastWeek = LocalDateTime.now();
LocalDateTime monday = todayOfLastWeek.with(TemporalAdjusters.previous(DayOfWeek.SUNDAY)).plusDays(1);
LocalDateTime sunday = todayOfLastWeek.with(TemporalAdjusters.next(DayOfWeek.MONDAY)).minusDays(1);
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(monday));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(sunday));
} else if (type == 3) {
LocalDateTime lastMonth = LocalDateTime.now().minusMonths(1); // 当前月份减1
LocalDateTime firstDay = lastMonth.with(TemporalAdjusters.firstDayOfMonth()); // 获取当前月的第一天
LocalDateTime lastDay = lastMonth.with(TemporalAdjusters.lastDayOfMonth()); // 获取当前月的最后一天
appUserInfoReqDTO.setStartTime(LocalDateTimeUtil.beginOfDay(firstDay));
appUserInfoReqDTO.setEndTime(LocalDateTimeUtil.endOfDay(lastDay));
}
promoterMemberOrderVO.setTotalAmount(rechargeOrderMapper.promoterOrderCount(appUserInfoReqDTO.getStartTime(),appUserInfoReqDTO.getEndTime(),promoterId));
promoterMemberOrderVO.setMemberCount(memberUserApi.promoterOrderCount(appUserInfoReqDTO));
TenantDTO tenantDTO = tenantApi.getTenant(TenantContextHolder.getTenantId());
promoterMemberOrderVO.setMemberCommission(tenantDTO.getMemberCommission());
return promoterMemberOrderVO;
}
@Override
public MemberHeadResponse memberHeadInfo() {
MemberHeadResponse response = new MemberHeadResponse();

View File

@ -57,6 +57,19 @@
<include refid="baseWhere">
</include>
</select>
<select id="promoterOrderCount" resultType="java.math.BigDecimal">
select sum(pay_price) from cy_recharge_order
<where>
paid=1 and promoter_id=#{promoterId}
<if test="startDate!=null">
and pay_time&gt;=#{startDate}
</if>
<if test="endDate!=null">
and pay_time&lt;=#{endDate}
</if>
</where>
</select>
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
select
a.id,
@ -113,6 +126,10 @@
<if test="data.payTime !=null ">
and a.pay_time &lt;=#{data.payTime[1]}
</if>
<if test="data.promoterId !=null ">
and a.promoter_id =#{data.promoterId}
</if>
</where>
</sql>
</mapper>

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.api.user;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserBillDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
@ -83,4 +84,6 @@ public interface MemberUserApi {
void saveMemberUser(String phone,Long promoterId);
PromoterDTO getPromoterDOByUserId(Long userId);
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.member.api.user.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppUserInfoReqDTO {
private Long promoterId;
private LocalDateTime startTime;
private LocalDateTime endTime;
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.api.user;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO;
@ -147,4 +148,9 @@ public class MemberUserApiImpl implements MemberUserApi {
}
return user;
}
@Override
public Long promoterOrderCount(AppUserInfoReqDTO reqDTO) {
return userService.promoterOrderCount(reqDTO);
}
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.user.vo;
package cn.iocoder.yudao.module.member.controller.admin.user.vo;
import cn.hutool.core.date.DatePattern;
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
@ -24,8 +24,30 @@ public class AppUserInfoReqVO {
@Schema(description = "用户昵称", required = true, example = "芋艿")
@NotEmpty(message = "用户昵称不能为空")
private String nickname;
/**
*
*/
private String realName;
@Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952")
private String avatar;
/**
*
* <p>
* {@link SexEnum}
*/
private Integer sex;
@Schema(description = "用户手机号", required = true, example = "15601691300")
private String mobile;
/**
*
*/
@NotEmpty(message = "用户昵称不能为空")
private String userAddress;
/**
*
*/
@JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
private Date userBirthday;
}

View File

@ -1,13 +1,11 @@
package cn.iocoder.yudao.module.member.controller.app.user;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoReqVO;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.AppUserInfoReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO;

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.dal.mysql.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import org.apache.ibatis.annotations.Mapper;
@ -33,4 +34,10 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
.eqIfPresent(MemberUserDO::getTenantId,reqVO.getTenantId())
.orderByDesc(MemberUserDO::getId));
}
default Long promoterOrderCount(AppUserInfoReqDTO reqVO){
return selectCount(new LambdaQueryWrapperX<MemberUserDO>()
.geIfPresent(MemberUserDO::getCreateTime,reqVO.getStartTime())
.leIfPresent(MemberUserDO::getCreateTime,reqVO.getEndTime())
.eqIfPresent(MemberUserDO::getPromoterId, reqVO.getPromoterId()));
}
}

View File

@ -88,4 +88,5 @@ public interface PromoterService {
*/
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
PromoterDO getPromoterDOByUserId(Long userId);
}

View File

@ -224,6 +224,9 @@ public class PromoterServiceImpl implements PromoterService {
return respVO;
}
@Override
public PromoterDO getPromoterDOByUserId(Long userId) {
return promoterMapper.selectOne(Wrappers.<PromoterDO>lambdaQuery().eq(PromoterDO::getUserId, userId).last("LIMIT 1"));

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.service.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
@ -137,4 +138,5 @@ public interface MemberUserService {
void saveMemberUser(String phone);
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
}

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO;
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
@ -255,5 +256,9 @@ public class MemberUserServiceImpl implements MemberUserService {
}
return user;
}
@Override
public Long promoterOrderCount(AppUserInfoReqDTO reqVO) {
return memberUserMapper.promoterOrderCount(reqVO);
}
}

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.system.api.tenant;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import java.util.List;
/**
@ -23,4 +25,6 @@ public interface TenantApi {
*/
void validateTenant(Long id);
TenantDTO getTenant(Long id);
}

View File

@ -0,0 +1,121 @@
package cn.iocoder.yudao.module.system.api.tenant.dto;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import lombok.*;
import java.time.LocalDateTime;
/**
* DO
*
* @author
*/
@Data
@ToString(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TenantDTO{
/**
* -
*/
public static final Long PACKAGE_ID_SYSTEM = 0L;
/**
*
*/
private Long id;
/**
*
*/
private String name;
/**
*
*
* {@link AdminUserDO#getId()}
*/
private Long contactUserId;
/**
*
*/
private String contactName;
/**
*
*/
private String contactMobile;
/**
*
*
* {@link CommonStatusEnum}
*/
private Integer status;
/**
*
*
* TODO
*/
private String domain;
/**
*
*
*
* 使使 {@link #PACKAGE_ID_SYSTEM}
*/
private Long packageId;
/**
*
*/
private LocalDateTime expireTime;
/**
*
*/
private Integer accountCount;
/**
*
*/
private String introduction;
/**
*
*/
private String serviceMobile;
/**
*
*/
private String serviceTime;
/**
*
*/
private String saleContactName;
/**
*
*/
private String saleContactMobile;
/**
*
*/
private String wxKfUrl;
/**
*
*/
private String notice;
/**
*
*/
private Integer goodsCommission;
/**
*
*/
private Integer memberCommission;
/**
* logo
*/
private String logo;
}

View File

@ -1,5 +1,8 @@
package cn.iocoder.yudao.module.system.api.tenant;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import org.springframework.stereotype.Service;
@ -27,4 +30,11 @@ public class TenantApiImpl implements TenantApi {
tenantService.validTenant(id);
}
@Override
public TenantDTO getTenant(Long id) {
TenantDO tenantDO = tenantService.getTenant(id);
TenantDTO tenantDTO = TenantConvert.INSTANCE.convertDTO(tenantDO);
return tenantDTO;
}
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.convert.tenant;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
@ -28,6 +29,8 @@ public interface TenantConvert {
TenantRespVO convert(TenantDO bean);
TenantDTO convertDTO(TenantDO bean);
List<TenantRespVO> convertList(List<TenantDO> list);
PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page);