mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-03 13:38:02 +08:00
新增 运营端小程序收费明细接口
(cherry picked from commit d5eae744a28c1b29a7cbed0019239e05da3868f7)
This commit is contained in:
@@ -43,4 +43,14 @@ public class BusinessOrderController extends BaseController {
|
|||||||
logger.info("通过订单编号查询订单信息详情 orderCode:{}, result:{}", orderCode, response);
|
logger.info("通过订单编号查询订单信息详情 orderCode:{}, result:{}", orderCode, response);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过订单编号查询订单各时段计费明细
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getOrderBillingDetail/{orderCode}")
|
||||||
|
public RestApiResponse<?> getOrderBillingDetail(@PathVariable("orderCode") String orderCode) {
|
||||||
|
orderBasicInfoService.getOrderBillingDetail(orderCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -506,7 +506,8 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
|
|||||||
length = 1;
|
length = 1;
|
||||||
byte[] stopReasonByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] stopReasonByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String stopReason = BytesUtil.bin2HexStr(stopReasonByteArr);
|
String stopReason = BytesUtil.bin2HexStr(stopReasonByteArr);
|
||||||
String stopReasonMsg = YKCChargingStopReasonEnum.getMsgByCode(Integer.parseInt(stopReason, 16));
|
int i = Integer.parseInt(stopReason, 16);
|
||||||
|
String stopReasonMsg = YKCChargingStopReasonEnum.getMsgByCode(i);
|
||||||
|
|
||||||
// 物理卡号 不足 8 位补 0
|
// 物理卡号 不足 8 位补 0
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.jsowell.pile.domain.SettleOrderReport;
|
|||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||||
@@ -492,4 +493,10 @@ public interface OrderBasicInfoService{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus);
|
List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单计费详情
|
||||||
|
* @param orderCode
|
||||||
|
*/
|
||||||
|
List<BusinessOrderBillingInfoVO> getOrderBillingDetail(String orderCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.jsowell.pile.vo.base.*;
|
|||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||||
import com.jsowell.pile.vo.nanrui.JiangSuOrderInfoVO;
|
import com.jsowell.pile.vo.nanrui.JiangSuOrderInfoVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.customer.*;
|
import com.jsowell.pile.vo.uniapp.customer.*;
|
||||||
import com.jsowell.pile.vo.web.*;
|
import com.jsowell.pile.vo.web.*;
|
||||||
@@ -4108,5 +4109,81 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
public List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus) {
|
public List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(String pileConnectorCode, String orderStatus, String payStatus) {
|
||||||
return orderBasicInfoMapper.queryOrdersByPileConnectorCodeAndStatus(pileConnectorCode, orderStatus, payStatus);
|
return orderBasicInfoMapper.queryOrdersByPileConnectorCodeAndStatus(pileConnectorCode, orderStatus, payStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过订单编号查询订单各时段计费明细
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BusinessOrderBillingInfoVO> getOrderBillingDetail(String orderCode) {
|
||||||
|
List<BusinessOrderBillingInfoVO> resultList = new ArrayList<>();
|
||||||
|
OrderBasicInfo orderBasicInfo = getOrderInfoByOrderCode(orderCode);
|
||||||
|
OrderDetail orderDetail = getOrderDetailByOrderCode(orderCode);
|
||||||
|
String stationId = orderBasicInfo.getStationId();
|
||||||
|
// 查询该站点正在使用的计费模板
|
||||||
|
List<BillingPriceVO> billingPriceVOS = pileBillingTemplateService.queryBillingPrice(stationId);
|
||||||
|
if (CollectionUtils.isEmpty(billingPriceVOS)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
for (BillingPriceVO billingPriceVO : billingPriceVOS) {
|
||||||
|
BusinessOrderBillingInfoVO vo;
|
||||||
|
String timeType = billingPriceVO.getTimeType();
|
||||||
|
|
||||||
|
if (StringUtils.equals(BillingTimeTypeEnum.SHARP.getValue(), timeType)) {
|
||||||
|
// 尖时段
|
||||||
|
vo = BusinessOrderBillingInfoVO.builder()
|
||||||
|
.timeType(BillingTimeTypeEnum.SHARP.getValue())
|
||||||
|
.startTime(billingPriceVO.getStartTime())
|
||||||
|
.endTime(billingPriceVO.getEndTime())
|
||||||
|
.usedElectricity(orderDetail.getSharpUsedElectricity())
|
||||||
|
.timeAmount(orderDetail.getSharpAmount())
|
||||||
|
.timeElectricityPrice(new BigDecimal(billingPriceVO.getElectricityPrice()))
|
||||||
|
.timeServicePrice(new BigDecimal(billingPriceVO.getServicePrice()))
|
||||||
|
.build();
|
||||||
|
resultList.add(vo);
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(BillingTimeTypeEnum.PEAK.getValue(), timeType)) {
|
||||||
|
// 峰时段
|
||||||
|
vo = BusinessOrderBillingInfoVO.builder()
|
||||||
|
.timeType(BillingTimeTypeEnum.PEAK.getValue())
|
||||||
|
.startTime(billingPriceVO.getStartTime())
|
||||||
|
.endTime(billingPriceVO.getEndTime())
|
||||||
|
.usedElectricity(orderDetail.getPeakUsedElectricity())
|
||||||
|
.timeAmount(orderDetail.getPeakAmount())
|
||||||
|
.timeElectricityPrice(new BigDecimal(billingPriceVO.getElectricityPrice()))
|
||||||
|
.timeServicePrice(new BigDecimal(billingPriceVO.getServicePrice()))
|
||||||
|
.build();
|
||||||
|
resultList.add(vo);
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(BillingTimeTypeEnum.FLAT.getValue(), timeType)) {
|
||||||
|
// 平时段
|
||||||
|
vo = BusinessOrderBillingInfoVO.builder()
|
||||||
|
.timeType(BillingTimeTypeEnum.FLAT.getValue())
|
||||||
|
.startTime(billingPriceVO.getStartTime())
|
||||||
|
.endTime(billingPriceVO.getEndTime())
|
||||||
|
.usedElectricity(orderDetail.getFlatUsedElectricity())
|
||||||
|
.timeAmount(orderDetail.getFlatAmount())
|
||||||
|
.timeElectricityPrice(new BigDecimal(billingPriceVO.getElectricityPrice()))
|
||||||
|
.timeServicePrice(new BigDecimal(billingPriceVO.getServicePrice()))
|
||||||
|
.build();
|
||||||
|
resultList.add(vo);
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(BillingTimeTypeEnum.VALLEY.getValue(), timeType)) {
|
||||||
|
// 谷时段
|
||||||
|
vo = BusinessOrderBillingInfoVO.builder()
|
||||||
|
.timeType(BillingTimeTypeEnum.VALLEY.getValue())
|
||||||
|
.startTime(billingPriceVO.getStartTime())
|
||||||
|
.endTime(billingPriceVO.getEndTime())
|
||||||
|
.usedElectricity(orderDetail.getValleyUsedElectricity())
|
||||||
|
.timeAmount(orderDetail.getValleyAmount())
|
||||||
|
.timeElectricityPrice(new BigDecimal(billingPriceVO.getElectricityPrice()))
|
||||||
|
.timeServicePrice(new BigDecimal(billingPriceVO.getServicePrice()))
|
||||||
|
.build();
|
||||||
|
resultList.add(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.jsowell.pile.vo.uniapp.business;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营端小程序订单时段费用明细VO
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2024/10/23 15:20:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class BusinessOrderBillingInfoVO {
|
||||||
|
/**
|
||||||
|
* 时段类型(1-尖时;2-峰时;3-平时;4-谷时)
|
||||||
|
* @see com.jsowell.common.enums.ykc.BillingTimeTypeEnum
|
||||||
|
*/
|
||||||
|
private String timeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该时段用电量
|
||||||
|
*/
|
||||||
|
private BigDecimal usedElectricity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该时段消费金额
|
||||||
|
*/
|
||||||
|
private BigDecimal timeAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该时段电费
|
||||||
|
*/
|
||||||
|
private BigDecimal timeElectricityPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该时段服务费
|
||||||
|
*/
|
||||||
|
private BigDecimal timeServicePrice;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user