mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-20 23:29:48 +08:00
新增 后管引流抽成页面汇总数据接口
This commit is contained in:
@@ -6,15 +6,13 @@ import com.jsowell.common.core.page.PageResponse;
|
|||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.pile.dto.QueryOrderSplitRecordDTO;
|
import com.jsowell.pile.dto.QueryOrderSplitRecordDTO;
|
||||||
import com.jsowell.pile.service.OrderSplitRecordService;
|
import com.jsowell.pile.service.OrderSplitRecordService;
|
||||||
import com.jsowell.pile.vo.web.OrderSplitRecordVO;
|
import com.jsowell.pile.vo.web.OrderCommissionSummaryVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单分账记录Controller
|
* 订单分账记录Controller
|
||||||
*
|
*
|
||||||
@@ -45,4 +43,22 @@ public class OrderSplitRecordController extends BaseController {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某站点引流抽成总数据
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getOrderSummaryCommission")
|
||||||
|
public RestApiResponse<?> getOrderSummaryCommission(@RequestBody QueryOrderSplitRecordDTO dto) {
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
OrderCommissionSummaryVO vo = orderSplitRecordService.getOrderSummaryCommission(dto);
|
||||||
|
response = new RestApiResponse<>(ImmutableMap.of("OrderCommissionSummaryVO", vo));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("查询某站点引流抽成总数据 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,5 +107,12 @@ public interface OrderSplitRecordService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageResponse getStationCommissionList(QueryOrderSplitRecordDTO dto);
|
PageResponse getStationCommissionList(QueryOrderSplitRecordDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某站点引流抽成总数据
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OrderCommissionSummaryVO getOrderSummaryCommission(QueryOrderSplitRecordDTO dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -608,6 +608,42 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
|||||||
return pageResponse;
|
return pageResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某站点引流抽成总数据
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OrderCommissionSummaryVO getOrderSummaryCommission(QueryOrderSplitRecordDTO dto) {
|
||||||
|
OrderCommissionSummaryVO vo = null;
|
||||||
|
List<OrderSplitRecordVO> stationCommissionList = orderSplitRecordMapper.getStationCommissionList(dto);
|
||||||
|
if (CollectionUtils.isEmpty(stationCommissionList)) {
|
||||||
|
return new OrderCommissionSummaryVO();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化数据
|
||||||
|
BigDecimal totalCommissionElectricityAmount = BigDecimal.ZERO;
|
||||||
|
BigDecimal totalCommissionServiceAmount = BigDecimal.ZERO;
|
||||||
|
BigDecimal totalCommissionAmount = BigDecimal.ZERO;
|
||||||
|
for (OrderSplitRecordVO orderSplitRecordVO : stationCommissionList) {
|
||||||
|
// 总抽成电费
|
||||||
|
totalCommissionElectricityAmount = totalCommissionElectricityAmount.add(orderSplitRecordVO.getElectricitySplitAmount());
|
||||||
|
// 总抽成服务费
|
||||||
|
totalCommissionServiceAmount = totalCommissionServiceAmount.add(orderSplitRecordVO.getServiceSplitAmount());
|
||||||
|
}
|
||||||
|
// 总抽成金额
|
||||||
|
totalCommissionAmount = totalCommissionElectricityAmount.add(totalCommissionServiceAmount);
|
||||||
|
|
||||||
|
vo = OrderCommissionSummaryVO.builder()
|
||||||
|
.stationId(dto.getStationId())
|
||||||
|
.totalCommissionElectricityAmount(totalCommissionElectricityAmount)
|
||||||
|
.totalCommissionServiceAmount(totalCommissionServiceAmount)
|
||||||
|
.totalCommissionAmount(totalCommissionAmount)
|
||||||
|
|
||||||
|
.build();
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据汇付会员id查询分账汇总数据
|
* 根据汇付会员id查询分账汇总数据
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.jsowell.pile.vo.web;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单引流抽成数据汇总VO
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2025/8/8 14:11:06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class OrderCommissionSummaryVO {
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总抽成电费金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalCommissionElectricityAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总抽成服务费金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalCommissionServiceAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总抽成金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalCommissionAmount;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user