fix:修改充值订单导出(未退款但是退款金额显示有金额)

feature/mall_product
tangqian 2023-06-14 18:17:21 +08:00
parent 1389bb9b91
commit 72beac0b3a
4 changed files with 72 additions and 9 deletions

View File

@ -20,10 +20,10 @@ public class PageParam implements Serializable {
@Min(value = 1, message = "页码最小值为 1")
private Integer pageNo = PAGE_NO;
@Schema(description = "每页条数,最大值为 100", required = true, example = "10")
@Schema(description = "每页条数,最大值为 1000", required = true, example = "10")
@NotNull(message = "每页条数不能为空")
@Min(value = 1, message = "每页条数最小值为 1")
@Max(value = 100, message = "每页条数最大值为 100")
@Max(value = 100, message = "每页条数最大值为 1000")
private Integer pageSize = PAGE_SIZE;
}

View File

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* Excel VO
*
* @author
*/
@Data
public class StatisticsExcelVO {
@ExcelProperty("租户id")
private Long tenantId;
@ExcelProperty("租户名称")
private String tenantName;
@ExcelProperty("总销售金额")
private BigDecimal totalMoney;
@ExcelProperty("总订单数量")
private Integer totalNum;
@ExcelProperty("总退款金额")
private BigDecimal totalWithdrawMoney;
@ExcelProperty("240档订单数量")
private Integer threeTotalNum;
@ExcelProperty("400档订单数量")
private Integer twoTotalNum;
@ExcelProperty("640档订单数量")
private Integer oneTotalNum;
}

View File

@ -2,26 +2,38 @@ package cn.iocoder.yudao.module.shop.controller.admin.statement;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
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.StatementAllReqVo;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatisticsPageVo;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrderStatus;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO;
import cn.iocoder.yudao.module.shop.request.order.StatementAllRequest;
import cn.iocoder.yudao.module.shop.request.order.StatementPageRequest;
import cn.iocoder.yudao.module.shop.service.order.StoreOrderService;
import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
/**
* @Title:StatementController
* @Description:
@ -54,4 +66,23 @@ public class StatementController {
}
@GetMapping("/statement-excel")
@Operation(summary = "导出数据统计(根据租户统计) Excel")
@OperateLog(type = EXPORT)
@TenantIgnore
public void exportRechargeGearExcel(@Valid StatementPageRequest request,
HttpServletResponse response) throws IOException {
PageInfo<StatisticsPageVo> statistics = storeOrderService.statistics(request);
List<StatisticsExcelVO> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(statistics.getList())) {
statistics.getList().forEach(e -> {
StatisticsExcelVO vo = new StatisticsExcelVO();
BeanUtils.copyProperties(e,vo);
list.add(vo);
});
}
// 导出 Excel
ExcelUtils.write(response, "导出数据统计(根据租户统计).xls", "数据", StatisticsExcelVO.class, list);
}
}

View File

@ -106,8 +106,8 @@
e.name as tenantName,
a.out_trade_no,
a.pay_time,
a.real_name as nickname,
a.real_name,
b.nickname,
b.nickname as realName,
a.uid,
a.user_phone,
a.confirm_phone,
@ -249,9 +249,9 @@
<if test="data.nickname !=null and data.nickname!=''">
and b.nickname like CONCAT('%',#{data.nickname},'%')
</if>
<if test="data.realName !=null and data.realName!=''">
<!--<if test="data.realName !=null and data.realName!=''">
and a.real_name like CONCAT('%',#{data.realName},'%')
</if>
</if>-->
<if test="data.userPhone !=null and data.userPhone!=''">
and a.user_phone like CONCAT('%',#{data.userPhone},'%')
</if>