mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
运营商查询订单报表方法添加站点名称并分页
This commit is contained in:
@@ -90,6 +90,11 @@ public class SettleOrderReportController extends BaseController {
|
|||||||
return toAjax(settleOrderReportService.deleteSettleOrderReportByIds(ids));
|
return toAjax(settleOrderReportService.deleteSettleOrderReportByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运营商订单报表
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pile:report:query')")
|
@PreAuthorize("@ss.hasPermi('pile:report:query')")
|
||||||
@PostMapping("/getMerchantOrderReport")
|
@PostMapping("/getMerchantOrderReport")
|
||||||
public AjaxResult getMerchantOrderReport(@RequestBody MerchantOrderReportDTO dto) {
|
public AjaxResult getMerchantOrderReport(@RequestBody MerchantOrderReportDTO dto) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.mapper;
|
|||||||
import com.jsowell.pile.domain.SettleOrderReport;
|
import com.jsowell.pile.domain.SettleOrderReport;
|
||||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||||
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||||
|
import com.jsowell.pile.vo.web.SettleOrderReportVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@@ -69,5 +70,5 @@ public interface SettleOrderReportMapper {
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SettleOrderReport> getMerchantOrderReport(@Param("dto") MerchantOrderReportDTO dto);
|
List<SettleOrderReportVO> getMerchantOrderReport(@Param("dto") MerchantOrderReportDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
|
import com.jsowell.common.util.PageUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.SettleOrderReport;
|
import com.jsowell.pile.domain.SettleOrderReport;
|
||||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||||
import com.jsowell.pile.mapper.SettleOrderReportMapper;
|
import com.jsowell.pile.mapper.SettleOrderReportMapper;
|
||||||
import com.jsowell.pile.service.ISettleOrderReportService;
|
import com.jsowell.pile.service.ISettleOrderReportService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
|
||||||
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||||
|
import com.jsowell.pile.vo.web.SettleOrderReportVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -109,31 +113,33 @@ public class SettleOrderReportServiceImpl implements ISettleOrderReportService {
|
|||||||
}
|
}
|
||||||
MerchantOrderReportVO vo = new MerchantOrderReportVO();
|
MerchantOrderReportVO vo = new MerchantOrderReportVO();
|
||||||
MerchantOrderReportVO.MerchantOrderReport report = new MerchantOrderReportVO.MerchantOrderReport();
|
MerchantOrderReportVO.MerchantOrderReport report = new MerchantOrderReportVO.MerchantOrderReport();
|
||||||
List<SettleOrderReport> list = settleOrderReportMapper.getMerchantOrderReport(dto);
|
PageUtils.startPage(1, 10);
|
||||||
|
List<SettleOrderReportVO> list = settleOrderReportMapper.getMerchantOrderReport(dto);
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
PageInfo<SettleOrderReportVO> pageInfo = new PageInfo<>(list);
|
||||||
vo.setMerchantId(dto.getMerchantId());
|
vo.setMerchantId(dto.getMerchantId());
|
||||||
vo.setReportList(list);
|
vo.setReportList(pageInfo.getList());
|
||||||
// 进行数据汇总
|
// 进行数据汇总
|
||||||
// 用电度数
|
// 用电度数
|
||||||
report.setUseElectricity(list.stream().map(SettleOrderReport::getUseElectricity).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setUseElectricity(list.stream().map(SettleOrderReportVO::getUseElectricity).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 充电次数
|
// 充电次数
|
||||||
report.setChargeNum(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeNum())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setChargeNum(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeNum())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 充电时长
|
// 充电时长
|
||||||
report.setChargeTime(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeTime())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setChargeTime(list.stream().map(SettleOrderReport -> new BigDecimal(SettleOrderReport.getChargeTime())).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 电费金额
|
// 电费金额
|
||||||
report.setElectricityAmount(list.stream().map(SettleOrderReport::getElectricityAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setElectricityAmount(list.stream().map(SettleOrderReportVO::getElectricityAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 服务费金额
|
// 服务费金额
|
||||||
report.setServiceAmount(list.stream().map(SettleOrderReport::getServiceAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setServiceAmount(list.stream().map(SettleOrderReportVO::getServiceAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 收入金额
|
// 收入金额
|
||||||
report.setTotalAmount(list.stream().map(SettleOrderReport::getTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setTotalAmount(list.stream().map(SettleOrderReportVO::getTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 虚拟金额
|
// 虚拟金额
|
||||||
report.setVirtualAmount(list.stream().map(SettleOrderReport::getVirtualAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setVirtualAmount(list.stream().map(SettleOrderReportVO::getVirtualAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 交易金额
|
// 交易金额
|
||||||
report.setTradeAmount(list.stream().map(SettleOrderReport::getTradeAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setTradeAmount(list.stream().map(SettleOrderReportVO::getTradeAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
// 交易手续费
|
// 交易手续费
|
||||||
report.setTradeFee(list.stream().map(SettleOrderReport::getTradeFee).reduce(BigDecimal.ZERO, BigDecimal::add));
|
report.setTradeFee(list.stream().map(SettleOrderReportVO::getTradeFee).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
|
||||||
vo.setMerchantOrderReport(report);
|
vo.setMerchantOrderReport(report);
|
||||||
return vo;
|
return vo;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class MerchantOrderReportVO {
|
|||||||
|
|
||||||
private MerchantOrderReport merchantOrderReport;
|
private MerchantOrderReport merchantOrderReport;
|
||||||
|
|
||||||
private List<SettleOrderReport> reportList;
|
private List<SettleOrderReportVO> reportList;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class MerchantOrderReport{
|
public static class MerchantOrderReport{
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.jsowell.pile.vo.web;
|
||||||
|
|
||||||
|
import com.jsowell.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单报表vo(运营商详情页面用)
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2023/6/15 17:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SettleOrderReportVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商id
|
||||||
|
*/
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点id
|
||||||
|
*/
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用电度数
|
||||||
|
*/
|
||||||
|
private BigDecimal useElectricity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电次数
|
||||||
|
*/
|
||||||
|
private String chargeNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电时长
|
||||||
|
*/
|
||||||
|
private String chargeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电费金额
|
||||||
|
*/
|
||||||
|
private BigDecimal electricityAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务费金额
|
||||||
|
*/
|
||||||
|
private BigDecimal serviceAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收入金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 虚拟金额
|
||||||
|
*/
|
||||||
|
private BigDecimal virtualAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易日期
|
||||||
|
*/
|
||||||
|
private String tradeDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易金额
|
||||||
|
*/
|
||||||
|
private BigDecimal tradeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易手续费
|
||||||
|
*/
|
||||||
|
private BigDecimal tradeFee;
|
||||||
|
}
|
||||||
@@ -123,21 +123,34 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getMerchantOrderReport" resultMap="SettleOrderReportResult">
|
<select id="getMerchantOrderReport" resultType="com.jsowell.pile.vo.web.SettleOrderReportVO">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
t1.id,
|
||||||
|
t1.merchant_id as merchantId,
|
||||||
|
t1.station_id as stationId,
|
||||||
|
t2.station_name as stationName,
|
||||||
|
t1.use_electricity as useElectricity,
|
||||||
|
t1.charge_num as chargeNum,
|
||||||
|
t1.charge_time as chargeTime,
|
||||||
|
t1.electricity_amount as electricityAmount,
|
||||||
|
t1.service_amount as serviceAmount,
|
||||||
|
t1.total_amount as totalAmount,
|
||||||
|
t1.virtual_amount as virtualAmount,
|
||||||
|
t1.trade_date as tradeDate,
|
||||||
|
t1.trade_amount as tradeAmount,
|
||||||
|
t1.trade_fee as tradeFee
|
||||||
from
|
from
|
||||||
settle_order_report
|
settle_order_report t1 join pile_station_info t2 on t1.station_id = t2.id
|
||||||
where
|
where
|
||||||
del_flag = '0'
|
t1.del_flag = '0'
|
||||||
<if test="dto.merchantId != null and dto.merchantId != ''">
|
<if test="dto.merchantId != null and dto.merchantId != ''">
|
||||||
and merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
|
and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.startTime != null and dto.startTime != ''">
|
<if test="dto.startTime != null and dto.startTime != ''">
|
||||||
and trade_date <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
|
and t1.trade_date <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.endTime != null and dto.endTime != ''">
|
<if test="dto.endTime != null and dto.endTime != ''">
|
||||||
and trade_date <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
|
and t1.trade_date <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
<el-table @selection-change="handleSelectionChange" :data="reportList">
|
<el-table @selection-change="handleSelectionChange" :data="reportList">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="交易日期" align="center" prop="tradeDate" />
|
<el-table-column label="交易日期" align="center" prop="tradeDate" />
|
||||||
|
<el-table-column label="站点名称" align="center" prop="stationName" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="用电度数"
|
label="用电度数"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -119,6 +120,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
merchantId: null,
|
merchantId: null,
|
||||||
stationId: null,
|
stationId: null,
|
||||||
|
stationName: null,
|
||||||
useElectricity: null,
|
useElectricity: null,
|
||||||
chargeNum: null,
|
chargeNum: null,
|
||||||
chargeTime: null,
|
chargeTime: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user