mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
add 新增运营端小程序查询订单详情接口
This commit is contained in:
@@ -9,6 +9,7 @@ import com.jsowell.pile.dto.business.QueryBusinessOrderDTO;
|
|||||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessConnectorInfoVO;
|
import com.jsowell.pile.vo.uniapp.business.BusinessConnectorInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderBillingInfoVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderQueryResultVO;
|
import com.jsowell.pile.vo.uniapp.business.BusinessOrderQueryResultVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -38,8 +39,8 @@ public class BusinessOrderController extends BaseController {
|
|||||||
public RestApiResponse<?> getBusinessOrderDetail(@PathVariable("orderCode") String orderCode) {
|
public RestApiResponse<?> getBusinessOrderDetail(@PathVariable("orderCode") String orderCode) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
orderBasicInfoService.getBusinessOrderDetail(orderCode);
|
BusinessOrderDetailInfoVO vo = orderBasicInfoService.getBusinessOrderDetail(orderCode);
|
||||||
// response = new RestApiResponse<>(ImmutableMap.of("BusinessConnectorInfoVO", businessPileConnectorDetail));
|
response = new RestApiResponse<>(ImmutableMap.of("BusinessConnectorInfo", vo));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("通过订单编号查询订单信息详情 error", e);
|
logger.error("通过订单编号查询订单信息详情 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ public class Constants {
|
|||||||
|
|
||||||
public static final String JSOWELL = "举视";
|
public static final String JSOWELL = "举视";
|
||||||
|
|
||||||
|
public static final String WAN_CHE_CHONG_MINI_PROGRAM = "万车充小程序";
|
||||||
|
|
||||||
// 希晓运营商的merchantId
|
// 希晓运营商的merchantId
|
||||||
public static final String XIXIAO_MERCHANT_ID_PRD = "35";
|
public static final String XIXIAO_MERCHANT_ID_PRD = "35";
|
||||||
|
|
||||||
|
|||||||
@@ -35,4 +35,14 @@ public enum StartModeEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过value获取label
|
||||||
|
public static String getLabelByValue(String value) {
|
||||||
|
for (StartModeEnum item : StartModeEnum.values()) {
|
||||||
|
if (item.getValue().equals(value)) {
|
||||||
|
return item.getLabel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -705,7 +705,7 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
|
|||||||
// }
|
// }
|
||||||
// }, thirdpartyTaskExecutor);
|
// }, thirdpartyTaskExecutor);
|
||||||
|
|
||||||
// TODO 异步推送充电订单算法平台
|
// 异步推送充电订单算法平台
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
// 1-web端
|
// 1-web端
|
||||||
|
|||||||
@@ -5724,22 +5724,76 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
if (orderVO == null) {
|
if (orderVO == null) {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
// 查询该站点正在使用的计费模板
|
||||||
|
List<BillingPriceVO> priceList = pileBillingTemplateService.queryBillingPrice(orderVO.getStationId());
|
||||||
|
if (CollectionUtils.isNotEmpty(priceList)) {
|
||||||
|
vo.setPriceList(priceList);
|
||||||
|
}
|
||||||
vo.setCreateTime(orderVO.getCreateTime());
|
vo.setCreateTime(orderVO.getCreateTime());
|
||||||
vo.setStartChargeTime(orderVO.getStartTime());
|
vo.setStartChargeTime(orderVO.getStartTime());
|
||||||
vo.setEndChargeTime(orderVO.getEndTime());
|
vo.setEndChargeTime(orderVO.getEndTime());
|
||||||
vo.setReason(orderVO.getReason());
|
|
||||||
vo.setSettleTime(orderVO.getSettlementTime());
|
|
||||||
vo.setPayTime(orderVO.getPayTime());
|
|
||||||
vo.setOrderCode(orderVO.getOrderCode());
|
vo.setOrderCode(orderVO.getOrderCode());
|
||||||
vo.setStartMode(orderVO.getStartMode());
|
vo.setStationName(orderVO.getStationName());
|
||||||
|
if (StringUtils.isNotBlank(orderVO.getThirdPartyType())) {
|
||||||
|
vo.setOrderSource(orderVO.getThirdPartyType());
|
||||||
|
} else {
|
||||||
|
vo.setOrderSource(Constants.WAN_CHE_CHONG_MINI_PROGRAM);
|
||||||
|
}
|
||||||
|
vo.setTransactionCode(orderVO.getTransactionCode());
|
||||||
|
String startMode = StartModeEnum.getLabelByValue(orderVO.getStartMode());
|
||||||
|
vo.setStartMode(startMode);
|
||||||
|
// vo.setChargeType(orderVO.getChargeType(), Constants.ONE) ? "直流" : "交流");
|
||||||
vo.setPileSn(orderVO.getPileSn());
|
vo.setPileSn(orderVO.getPileSn());
|
||||||
vo.setPileConnectorCode(orderVO.getPileConnectorCode());
|
vo.setPileConnectorCode(orderVO.getPileConnectorCode());
|
||||||
vo.setEndSOC(orderVO.getEndSoc());
|
vo.setEndSOC(orderVO.getEndSoc());
|
||||||
vo.setChargeTime(orderVO.getChargingTime());
|
vo.setChargeTime(orderVO.getChargingTime());
|
||||||
vo.setChargeDegree(orderVO.getChargingDegree());
|
vo.setChargeDegree(orderVO.getChargingDegree());
|
||||||
|
vo.setReason(orderVO.getReason());
|
||||||
|
|
||||||
|
vo.setOrderAmount(orderVO.getOrderAmount());
|
||||||
|
vo.setDiscountAmount(new BigDecimal(orderVO.getDiscountAmount()));
|
||||||
vo.setSettleAmount(orderVO.getSettleAmount());
|
vo.setSettleAmount(orderVO.getSettleAmount());
|
||||||
vo.setPayMode(orderVO.getPayMode());
|
|
||||||
|
vo.setSettleTime(orderVO.getSettlementTime());
|
||||||
|
vo.setPayTime(orderVO.getPayTime());
|
||||||
|
|
||||||
|
String payMode = OrderPayModeEnum.getPayModeDescription(orderVO.getPayMode());
|
||||||
|
vo.setPayMode(payMode);
|
||||||
|
|
||||||
|
|
||||||
vo.setMemberId(orderVO.getMemberId());
|
vo.setMemberId(orderVO.getMemberId());
|
||||||
|
vo.setPhoneNumber(orderVO.getPhoneNumber());
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(orderVO.getLicensePlateNumber())) {
|
||||||
|
vo.setPlateNumber(orderVO.getLicensePlateNumber());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(orderVO.getVinCode())) {
|
||||||
|
vo.setVinCode(orderVO.getVinCode());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(orderVO.getCardNumber())) {
|
||||||
|
vo.setCardNumber(orderVO.getCardNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 充电曲线
|
||||||
|
List<RealTimeMonitorData> chargingRealTimeDataList = getChargingRealTimeData(orderVO.getTransactionCode());
|
||||||
|
if (CollectionUtils.isNotEmpty(chargingRealTimeDataList)) {
|
||||||
|
List<OrderDetailInfoVO.PileMonitorData> infoList = Lists.newArrayList();
|
||||||
|
for (RealTimeMonitorData realTimeMonitorData : chargingRealTimeDataList) {
|
||||||
|
OrderDetailInfoVO.PileMonitorData info = new OrderDetailInfoVO.PileMonitorData();
|
||||||
|
info.setInstantCurrent(realTimeMonitorData.getOutputCurrent()); // 电流
|
||||||
|
info.setInstantVoltage(realTimeMonitorData.getOutputVoltage()); // 电压
|
||||||
|
info.setInstantPower(realTimeMonitorData.getOutputPower()); // 功率
|
||||||
|
info.setSOC(realTimeMonitorData.getSOC());
|
||||||
|
info.setTime(realTimeMonitorData.getDateTime()); // 时间
|
||||||
|
|
||||||
|
infoList.add(info);
|
||||||
|
}
|
||||||
|
// 根据时间进行正序排序
|
||||||
|
infoList = infoList.stream()
|
||||||
|
.sorted(Comparator.comparing(OrderDetailInfoVO.PileMonitorData::getTime))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
vo.setPileMonitorDataList(infoList);
|
||||||
|
}
|
||||||
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.jsowell.pile.vo.uniapp.business;
|
package com.jsowell.pile.vo.uniapp.business;
|
||||||
|
|
||||||
|
import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO;
|
||||||
|
import com.jsowell.pile.vo.web.OrderDetailInfoVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运营端小程序订单详情VO
|
* 运营端小程序订单详情VO
|
||||||
@@ -195,4 +198,50 @@ public class BusinessOrderDetailInfoVO {
|
|||||||
*/
|
*/
|
||||||
private String timeRemaining;
|
private String timeRemaining;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电开始时间
|
||||||
|
*/
|
||||||
|
private String chargeStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电结束时间
|
||||||
|
*/
|
||||||
|
private String chargeEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单来源
|
||||||
|
*/
|
||||||
|
private String orderSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部交易流水号
|
||||||
|
*/
|
||||||
|
private String outTransactionCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电类型
|
||||||
|
*/
|
||||||
|
private String chargeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String plateNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车架号
|
||||||
|
*/
|
||||||
|
private String vinCode;
|
||||||
|
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
private BigDecimal discountAmount;
|
||||||
|
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
private String cardNumber;
|
||||||
|
|
||||||
|
private List<BillingPriceVO> priceList;
|
||||||
|
|
||||||
|
private List<OrderDetailInfoVO.PileMonitorData> pileMonitorDataList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,4 +158,10 @@ public class OrderVO {
|
|||||||
private String memberId;
|
private String memberId;
|
||||||
|
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
|
private String thirdPartyType;
|
||||||
|
|
||||||
|
private String vinCode;
|
||||||
|
|
||||||
|
private String cardNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3252,12 +3252,15 @@
|
|||||||
t1.transaction_code AS transactionCode,
|
t1.transaction_code AS transactionCode,
|
||||||
t1.order_status AS orderStatus,
|
t1.order_status AS orderStatus,
|
||||||
t1.station_id AS stationId,
|
t1.station_id AS stationId,
|
||||||
|
t1.third_party_type as thirdPartyType,
|
||||||
|
t5.station_name as stationName,
|
||||||
t1.pile_sn AS pileSn,
|
t1.pile_sn AS pileSn,
|
||||||
t1.member_id as memberId,
|
t1.member_id as memberId,
|
||||||
t1.connector_code AS connectorCode,
|
t1.connector_code AS connectorCode,
|
||||||
t1.pile_connector_code AS pileConnectorCode,
|
t1.pile_connector_code AS pileConnectorCode,
|
||||||
t1.pay_mode AS payMode,
|
t1.pay_mode AS payMode,
|
||||||
t1.pay_amount AS payAmount,
|
t1.pay_amount AS payAmount,
|
||||||
|
t1.logic_card as cardNumber,
|
||||||
t1.pay_time AS payTime,
|
t1.pay_time AS payTime,
|
||||||
t1.order_amount AS orderAmount,
|
t1.order_amount AS orderAmount,
|
||||||
t1.plate_number AS licensePlateNumber,
|
t1.plate_number AS licensePlateNumber,
|
||||||
@@ -3269,7 +3272,8 @@
|
|||||||
t1.charge_end_time AS endTime,
|
t1.charge_end_time AS endTime,
|
||||||
t1.start_soc AS startSoc,
|
t1.start_soc AS startSoc,
|
||||||
t1.end_soc AS endSoc,
|
t1.end_soc AS endSoc,
|
||||||
t1.reason AS stopReason,
|
t1.reason AS reason,
|
||||||
|
t1.vin_code as vinCode,
|
||||||
t2.total_used_electricity AS totalPower,
|
t2.total_used_electricity AS totalPower,
|
||||||
t2.total_electricity_amount AS totalElectricityAmount,
|
t2.total_electricity_amount AS totalElectricityAmount,
|
||||||
t2.total_service_amount AS totalServiceAmount
|
t2.total_service_amount AS totalServiceAmount
|
||||||
@@ -3280,6 +3284,7 @@
|
|||||||
pile_merchant_info t3 on t1.merchant_id = t3.id
|
pile_merchant_info t3 on t1.merchant_id = t3.id
|
||||||
join
|
join
|
||||||
member_basic_info t4 on t1.member_id = t4.member_id
|
member_basic_info t4 on t1.member_id = t4.member_id
|
||||||
|
join pile_station_info t5 on t1.station_id = t5.id
|
||||||
WHERE t1.del_flag = '0'
|
WHERE t1.del_flag = '0'
|
||||||
AND t1.order_code = #{orderCode,jdbcType=VARCHAR}
|
AND t1.order_code = #{orderCode,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user