mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
新增 运营端小程序通过订单编号查询订单详情接口
This commit is contained in:
@@ -463,6 +463,13 @@ public interface OrderBasicInfoService{
|
||||
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 创建预约启动充电订单
|
||||
* @param chargingStartupResult
|
||||
*/
|
||||
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
|
||||
|
||||
|
||||
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
/**
|
||||
* 通过站点idList,创建时间查询订单数据详情
|
||||
@@ -472,11 +479,6 @@ public interface OrderBasicInfoService{
|
||||
*/
|
||||
List<BusinessOrderDetailInfoVO> getOrderDetailByStationIds(List<String> stationIds, String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 创建预约启动充电订单
|
||||
* @param chargingStartupResult
|
||||
*/
|
||||
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
|
||||
|
||||
|
||||
void getBusinessOrderDetail(String orderCode);
|
||||
}
|
||||
|
||||
@@ -157,4 +157,12 @@ public interface PileConnectorInfoService {
|
||||
* @return
|
||||
*/
|
||||
public PileConnectorInfoVO BusinessSearchConnectorInfo(QueryConnectorInfoDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 通过枪口编号查询枪口信息详情
|
||||
* @param pileConnectorCode
|
||||
* @return
|
||||
*/
|
||||
public BusinessConnectorInfoVO getBusinessPileConnectorDetail(String pileConnectorCode);
|
||||
}
|
||||
|
||||
@@ -3879,5 +3879,20 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderPayRecordService.batchInsert(Lists.newArrayList(principalPayRecord));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过订单编号查询订单详情
|
||||
* @param orderCode
|
||||
*/
|
||||
@Override
|
||||
public void getBusinessOrderDetail(String orderCode) {
|
||||
OrderVO orderVO = getChargeOrderInfoByOrderCode(orderCode);
|
||||
if (orderVO == null) {
|
||||
return;
|
||||
}
|
||||
String createTime = orderVO.getCreateTime();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
@@ -27,6 +29,7 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileConnectorInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessConnectorDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||
@@ -923,4 +926,54 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过枪口编号查询枪口信息详情
|
||||
* @param pileConnectorCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BusinessConnectorInfoVO getBusinessPileConnectorDetail(String pileConnectorCode) {
|
||||
BusinessConnectorInfoVO vo = new BusinessConnectorInfoVO();
|
||||
BusinessConnectorDetailVO detailVO = new BusinessConnectorDetailVO();
|
||||
PileConnectorInfoVO pileConnectorInfoVO = getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
||||
String status = String.valueOf(pileConnectorInfoVO.getStatus());
|
||||
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), status)) {
|
||||
// 充电中
|
||||
// 查询正在充电的订单
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(pileConnectorCode);
|
||||
if (orderBasicInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
// 查询实时数据
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
||||
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||
String startSoc = orderBasicInfo.getStartSoc();
|
||||
String endSoc = realTimeMonitorData.getSOC();
|
||||
|
||||
|
||||
detailVO.setStartSOC(startSoc);
|
||||
detailVO.setEndSOC(endSoc);
|
||||
detailVO.setChargeDegree(realTimeMonitorData.getChargingDegree());
|
||||
detailVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining());
|
||||
} else if (StringUtils.equals(PileConnectorDataBaseStatusEnum.FAULT.getValue(), status)) {
|
||||
// 故障
|
||||
// 查询故障原因
|
||||
String redisKey = CacheConstants.PILE_HARDWARE_FAULT + pileConnectorInfoVO.getPileConnectorCode();
|
||||
String faultReason = redisCache.getCacheObject(redisKey);
|
||||
// 如果不为空,set 数据
|
||||
if (StringUtils.isNotBlank(faultReason)) {
|
||||
detailVO.setFaultReason(faultReason);
|
||||
}
|
||||
}
|
||||
detailVO.setPileConnectorCode(pileConnectorCode);
|
||||
detailVO.setStatus(status);
|
||||
|
||||
vo.setBusinessConnectorDetail(detailVO);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.jsowell.pile.vo.uniapp.business;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 运营端小程序枪口详情信息
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2024/9/4 8:49:09
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class BusinessConnectorDetailVO {
|
||||
|
||||
/**
|
||||
* 枪口编号
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
|
||||
/**
|
||||
* 枪口状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 起始soc
|
||||
*/
|
||||
private String startSOC;
|
||||
|
||||
/**
|
||||
* 终止soc
|
||||
*/
|
||||
private String endSOC;
|
||||
|
||||
/**
|
||||
* 充电度数
|
||||
*/
|
||||
private String chargeDegree;
|
||||
|
||||
/**
|
||||
* 剩余时长
|
||||
*/
|
||||
private String timeRemaining;
|
||||
|
||||
/**
|
||||
* 故障原因
|
||||
*/
|
||||
private String faultReason;
|
||||
}
|
||||
@@ -65,4 +65,9 @@ public class BusinessConnectorInfoVO {
|
||||
private Integer faultConnectorNum;
|
||||
|
||||
private List<PileConnectorInfoVO> pileConnectorInfoVOList;
|
||||
|
||||
/**
|
||||
* 运营端小程序枪口详情信息
|
||||
*/
|
||||
private BusinessConnectorDetailVO businessConnectorDetail;
|
||||
}
|
||||
|
||||
@@ -136,4 +136,9 @@ public class OrderVO {
|
||||
private BigDecimal totalElectricityAmount;
|
||||
|
||||
private BigDecimal totalServiceAmount;
|
||||
|
||||
/**
|
||||
* 订单创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user