Merge branch 'feature/mall_product' of http://117.33.142.185:3000/zenghuapei/cyywl_server into feature/mall_product
commit
fd8d47ae81
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
|
||||||
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -10,12 +9,6 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PromoterDrawExcelVO {
|
public class PromoterDrawExcelVO {
|
||||||
@ExcelProperty( "用户id")
|
|
||||||
private Long userId;
|
|
||||||
@ExcelProperty( "组织id")
|
|
||||||
private Long deptId;
|
|
||||||
@ExcelProperty( "商户id")
|
|
||||||
private Long tenantId;
|
|
||||||
@ExcelProperty( "组织名称")
|
@ExcelProperty( "组织名称")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
@ExcelProperty( "组织结构名称")
|
@ExcelProperty( "组织结构名称")
|
||||||
|
|
|
@ -6,7 +6,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
@ -29,7 +28,7 @@ public class PromoterDrawReqVO extends PageParam {
|
||||||
@Schema(description = "成为推广员时间")
|
@Schema(description = "成为推广员时间")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
@Schema(description = "排序1升序2降序")
|
||||||
|
private String sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
|
||||||
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
|
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.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -138,6 +139,9 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
@Override
|
@Override
|
||||||
public PageResult<PromoterDrawVO> findPromoterDrawPage(PromoterDrawReqVO pageReqVO) {
|
public PageResult<PromoterDrawVO> findPromoterDrawPage(PromoterDrawReqVO pageReqVO) {
|
||||||
Page<PromoterDrawVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
Page<PromoterDrawVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
|
if (Objects.nonNull(pageReqVO.getSort())&& StringUtils.equals("2",pageReqVO.getSort())) {
|
||||||
|
pageReqVO.setSort(null);
|
||||||
|
}
|
||||||
rechargeOrderMapper.findPromoterDrawPage(page, pageReqVO);
|
rechargeOrderMapper.findPromoterDrawPage(page, pageReqVO);
|
||||||
List<PromoterDrawVO> list = page.getRecords();
|
List<PromoterDrawVO> list = page.getRecords();
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<select id="findPromoterDrawPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
<select id="findPromoterDrawPage"
|
||||||
|
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||||
SELECT
|
SELECT
|
||||||
x1.*,
|
x1.*,
|
||||||
x2.order_count,
|
x2.order_count,
|
||||||
|
@ -65,30 +66,39 @@
|
||||||
cy_recharge_order b
|
cy_recharge_order b
|
||||||
GROUP BY
|
GROUP BY
|
||||||
b.promoter_id
|
b.promoter_id
|
||||||
) x2 ON x1.user_id = x2.user_id ORDER BY x2.total_amount DESC
|
) x2 ON x1.user_id = x2.user_id
|
||||||
|
<choose>
|
||||||
|
<when test="data.sort !=null and data.sort!=''">
|
||||||
|
ORDER BY x2.total_amount ASC
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ORDER BY x2.total_amount DESC
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
<select id="findPromoterDrawCount" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
<select id="findPromoterDrawCount"
|
||||||
|
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.PromoterDrawVO">
|
||||||
SELECT
|
SELECT
|
||||||
b.promoter_id AS user_id,
|
b.promoter_id AS user_id,
|
||||||
count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count,
|
count( CASE b.paid = 1 WHEN 1 THEN 0 END) AS order_count,
|
||||||
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
|
sum( CASE WHEN b.paid = 1 THEN b.pay_price ELSE 0 END ) AS deal_amount,
|
||||||
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
|
sum( CASE WHEN b.paid IN ( 1, 2 ) THEN b.pay_price ELSE 0 END ) AS total_amount
|
||||||
FROM
|
FROM
|
||||||
cy_recharge_order b
|
cy_recharge_order b
|
||||||
<where>
|
<where>
|
||||||
<if test="promoterIds!=null and promoterIds.size()>0">
|
<if test="promoterIds!=null and promoterIds.size()>0">
|
||||||
and b.promoter_id in
|
and b.promoter_id in
|
||||||
<foreach collection="promoterIds" separator="," open="(" close=")" item="id">
|
<foreach collection="promoterIds" separator="," open="(" close=")" item="id">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY b.promoter_id
|
GROUP BY b.promoter_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findListPage"
|
||||||
<select id="findListPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
|
resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
|
||||||
select
|
select
|
||||||
a.order_id,
|
a.order_id,
|
||||||
a.pay_serial_number,
|
a.pay_serial_number,
|
||||||
|
@ -127,7 +137,8 @@
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</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,
|
||||||
a.order_id,
|
a.order_id,
|
||||||
|
|
Loading…
Reference in New Issue