Merge branch 'feature/mall_product' of http://117.33.142.185:3000/zenghuapei/cyywl_server into feature/mall_product
commit
49c9611182
|
@ -133,6 +133,7 @@ public class RechargeOrderController {
|
||||||
@PreAuthenticated
|
@PreAuthenticated
|
||||||
@Operation(summary = "退款")
|
@Operation(summary = "退款")
|
||||||
@RequestMapping(value = "/memberRefund", method = RequestMethod.POST)
|
@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 {
|
public CommonResult<Object> memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception {
|
||||||
log.info("memberRefund会员退款===>{}", request);
|
log.info("memberRefund会员退款===>{}", request);
|
||||||
Object obj=null;
|
Object obj=null;
|
||||||
|
|
|
@ -126,6 +126,10 @@ public class RechargeOrderPageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "第三方支付流水号")
|
@Schema(description = "第三方支付流水号")
|
||||||
private String paySerialNumber;
|
private String paySerialNumber;
|
||||||
|
/**
|
||||||
|
* 推广员id
|
||||||
|
*/
|
||||||
|
@Schema(description = "推广员id")
|
||||||
|
private Long promoterId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
package cn.iocoder.yudao.module.shop.controller.app.member;
|
package cn.iocoder.yudao.module.shop.controller.app.member;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
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.annotations.PreAuthenticated;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
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.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.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.convert.recharge.RechargeOrderConvert;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
||||||
|
@ -58,6 +62,22 @@ public class MemberController {
|
||||||
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() {
|
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() {
|
||||||
return CommonResult.success(rechargeOrderService.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 = "会员头部信息")
|
@Operation(summary = "会员头部信息")
|
||||||
@RequestMapping(value = "/memberHeadInfo", method = RequestMethod.GET)
|
@RequestMapping(value = "/memberHeadInfo", method = RequestMethod.GET)
|
||||||
@PreAuthenticated
|
@PreAuthenticated
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.shop.dal.mysql.recharge;
|
package cn.iocoder.yudao.module.shop.dal.mysql.recharge;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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 org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单 Mapper
|
* 订单 Mapper
|
||||||
|
@ -57,7 +60,7 @@ public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {
|
||||||
.orderByDesc(RechargeOrderDO::getId));
|
.orderByDesc(RechargeOrderDO::getId));
|
||||||
}
|
}
|
||||||
IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data);
|
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);
|
List<RechargeOrderExcelVO> findListExcel(@Param("data") RechargeOrderExportReqVO data);
|
||||||
default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) {
|
default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.service.recharge;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
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.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
||||||
|
@ -75,6 +76,10 @@ public interface RechargeOrderService {
|
||||||
|
|
||||||
List<RechargeOrderRespVO> memberOrderInfo();
|
List<RechargeOrderRespVO> memberOrderInfo();
|
||||||
|
|
||||||
|
PageResult<RechargeOrderRespVO> promoterOrderInfo(RechargeOrderPageReqVO pageRespVO);
|
||||||
|
|
||||||
|
PromoterMemberOrderVO promoterOrderCount(Integer type,Long promoterId);
|
||||||
|
|
||||||
MemberHeadResponse memberHeadInfo();
|
MemberHeadResponse memberHeadInfo();
|
||||||
|
|
||||||
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);
|
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
package cn.iocoder.yudao.module.shop.service.recharge;
|
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.LoginUser;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
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.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.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.dataobject.recharge.RechargeOrderInfoDO;
|
||||||
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
|
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.request.member.RefundRequest;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
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.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -20,7 +26,11 @@ import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.DayOfWeek;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -51,6 +61,11 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
private MemberUserApi userService;
|
private MemberUserApi userService;
|
||||||
@Resource
|
@Resource
|
||||||
private PhoneRecordService phoneRecordService;
|
private PhoneRecordService phoneRecordService;
|
||||||
|
@Resource
|
||||||
|
private MemberUserApi memberUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TenantApi tenantApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
|
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
|
||||||
|
@ -125,7 +140,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
Assert.notNull(loginUser, "登录失效,请重新登录!");
|
Assert.notNull(loginUser, "登录失效,请重新登录!");
|
||||||
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery()
|
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)) {
|
if (!CollectionUtils.isEmpty(orderDOS)) {
|
||||||
List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
|
List<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
|
||||||
List<String> collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
|
List<String> collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList());
|
||||||
|
@ -153,6 +168,64 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
return null;
|
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
|
@Override
|
||||||
public MemberHeadResponse memberHeadInfo() {
|
public MemberHeadResponse memberHeadInfo() {
|
||||||
MemberHeadResponse response = new MemberHeadResponse();
|
MemberHeadResponse response = new MemberHeadResponse();
|
||||||
|
|
|
@ -57,6 +57,19 @@
|
||||||
<include refid="baseWhere">
|
<include refid="baseWhere">
|
||||||
</include>
|
</include>
|
||||||
</select>
|
</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>=#{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate!=null">
|
||||||
|
and pay_time<=#{endDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
|
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
|
@ -113,6 +126,10 @@
|
||||||
<if test="data.payTime !=null ">
|
<if test="data.payTime !=null ">
|
||||||
and a.pay_time <=#{data.payTime[1]}
|
and a.pay_time <=#{data.payTime[1]}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="data.promoterId !=null ">
|
||||||
|
and a.promoter_id =#{data.promoterId}
|
||||||
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.member.api.user;
|
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.MemberUserBillDTO;
|
||||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
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.api.user.dto.PromoterDTO;
|
||||||
|
@ -83,4 +84,6 @@ public interface MemberUserApi {
|
||||||
void saveMemberUser(String phone,Long promoterId);
|
void saveMemberUser(String phone,Long promoterId);
|
||||||
|
|
||||||
PromoterDTO getPromoterDOByUserId(Long userId);
|
PromoterDTO getPromoterDOByUserId(Long userId);
|
||||||
|
|
||||||
|
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -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.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
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.MemberUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
|
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO;
|
import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO;
|
||||||
|
@ -147,4 +148,9 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long promoterOrderCount(AppUserInfoReqDTO reqDTO) {
|
||||||
|
return userService.promoterOrderCount(reqDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.hutool.core.date.DatePattern;
|
||||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||||
|
@ -24,8 +24,30 @@ public class AppUserInfoReqVO {
|
||||||
@Schema(description = "用户昵称", required = true, example = "芋艿")
|
@Schema(description = "用户昵称", required = true, example = "芋艿")
|
||||||
@NotEmpty(message = "用户昵称不能为空")
|
@NotEmpty(message = "用户昵称不能为空")
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
/**
|
||||||
|
* 真实姓名
|
||||||
|
*/
|
||||||
|
private String realName;
|
||||||
@Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952")
|
@Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952")
|
||||||
private String avatar;
|
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;
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package cn.iocoder.yudao.module.member.controller.app.user;
|
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.enums.UserTypeEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
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.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.AppUserInfoRespVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO;
|
||||||
|
|
|
@ -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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
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.controller.admin.user.dto.AdminUserQueryDTO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -33,4 +34,10 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
|
||||||
.eqIfPresent(MemberUserDO::getTenantId,reqVO.getTenantId())
|
.eqIfPresent(MemberUserDO::getTenantId,reqVO.getTenantId())
|
||||||
.orderByDesc(MemberUserDO::getId));
|
.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()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,5 @@ public interface PromoterService {
|
||||||
*/
|
*/
|
||||||
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
|
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
|
||||||
PromoterDO getPromoterDOByUserId(Long userId);
|
PromoterDO getPromoterDOByUserId(Long userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,6 +224,9 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
return respVO;
|
return respVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PromoterDO getPromoterDOByUserId(Long userId) {
|
public PromoterDO getPromoterDOByUserId(Long userId) {
|
||||||
return promoterMapper.selectOne(Wrappers.<PromoterDO>lambdaQuery().eq(PromoterDO::getUserId, userId).last("LIMIT 1"));
|
return promoterMapper.selectOne(Wrappers.<PromoterDO>lambdaQuery().eq(PromoterDO::getUserId, userId).last("LIMIT 1"));
|
||||||
|
|
|
@ -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.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
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.admin.user.dto.AdminUserQueryDTO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
|
@ -137,4 +138,5 @@ public interface MemberUserService {
|
||||||
void saveMemberUser(String phone);
|
void saveMemberUser(String phone);
|
||||||
|
|
||||||
|
|
||||||
|
Long promoterOrderCount(AppUserInfoReqDTO reqVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
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.admin.user.dto.AdminUserQueryDTO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
|
@ -255,5 +256,9 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public Long promoterOrderCount(AppUserInfoReqDTO reqVO) {
|
||||||
|
|
||||||
|
return memberUserMapper.promoterOrderCount(reqVO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.system.api.tenant;
|
package cn.iocoder.yudao.module.system.api.tenant;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,4 +25,6 @@ public interface TenantApi {
|
||||||
*/
|
*/
|
||||||
void validateTenant(Long id);
|
void validateTenant(Long id);
|
||||||
|
|
||||||
|
TenantDTO getTenant(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
package cn.iocoder.yudao.module.system.api.tenant;
|
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 cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -27,4 +30,11 @@ public class TenantApiImpl implements TenantApi {
|
||||||
tenantService.validTenant(id);
|
tenantService.validTenant(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TenantDTO getTenant(Long id) {
|
||||||
|
TenantDO tenantDO = tenantService.getTenant(id);
|
||||||
|
TenantDTO tenantDTO = TenantConvert.INSTANCE.convertDTO(tenantDO);
|
||||||
|
return tenantDTO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.system.convert.tenant;
|
package cn.iocoder.yudao.module.system.convert.tenant;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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.TenantCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO;
|
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantExcelVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
|
||||||
|
@ -28,6 +29,8 @@ public interface TenantConvert {
|
||||||
|
|
||||||
TenantRespVO convert(TenantDO bean);
|
TenantRespVO convert(TenantDO bean);
|
||||||
|
|
||||||
|
TenantDTO convertDTO(TenantDO bean);
|
||||||
|
|
||||||
List<TenantRespVO> convertList(List<TenantDO> list);
|
List<TenantRespVO> convertList(List<TenantDO> list);
|
||||||
|
|
||||||
PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page);
|
PageResult<TenantRespVO> convertPage(PageResult<TenantDO> page);
|
||||||
|
|
Loading…
Reference in New Issue