mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-21 23:59:50 +08:00
新增 查询占桩订单详情接口
This commit is contained in:
@@ -11,6 +11,7 @@ import com.jsowell.common.util.StringUtils;
|
|||||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||||
import com.jsowell.pile.service.OrderPileOccupyService;
|
import com.jsowell.pile.service.OrderPileOccupyService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.OccupyOrderDetailVO;
|
||||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||||
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.*;
|
||||||
@@ -88,7 +89,8 @@ public class OccupyOrderController extends BaseController {
|
|||||||
logger.info("查询占桩订单详情页 param:{}", occupyCode);
|
logger.info("查询占桩订单详情页 param:{}", occupyCode);
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
orderPileOccupyService.getOccupyOrderDetail(occupyCode);
|
OccupyOrderDetailVO vo = orderPileOccupyService.getOccupyOrderDetail(occupyCode);
|
||||||
|
response = new RestApiResponse<>(vo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("查询占桩订单详情页 error,", e);
|
logger.error("查询占桩订单详情页 error,", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.mapper;
|
|||||||
|
|
||||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.OccupyOrderDetailVO;
|
||||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -99,4 +100,10 @@ public interface OrderPileOccupyMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OrderPileOccupy> queryDraftOccupyOrder(@Param("pileSn") String pileSn, @Param("connectorCode") String connectorCode);
|
List<OrderPileOccupy> queryDraftOccupyOrder(@Param("pileSn") String pileSn, @Param("connectorCode") String connectorCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取占桩订单详情
|
||||||
|
* @param occupyCode
|
||||||
|
*/
|
||||||
|
OccupyOrderDetailVO getOccupyOrderDetail(String occupyCode);
|
||||||
}
|
}
|
||||||
@@ -372,9 +372,22 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取占桩订单详情
|
||||||
|
* @param occupyCode
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public OccupyOrderDetailVO getOccupyOrderDetail(String occupyCode) {
|
public OccupyOrderDetailVO getOccupyOrderDetail(String occupyCode) {
|
||||||
return null;
|
OccupyOrderDetailVO vo = orderPileOccupyMapper.getOccupyOrderDetail(occupyCode);
|
||||||
|
// 订单状态
|
||||||
|
vo.setOrderStatus(OccupyOrderStatusEnum.getValueByCode(vo.getOrderStatus()));
|
||||||
|
// 支付状态
|
||||||
|
vo.setPayStatus(OccupyOrderPayStatusEnum.getValueByCode(vo.getPayStatus()));
|
||||||
|
if (vo.getEndTime() != null && vo.getStartTime() != null) {
|
||||||
|
// 计算占桩时长
|
||||||
|
vo.setOccupyTime(DateUtils.getDatePoor(DateUtils.parseDate(vo.getEndTime()), DateUtils.parseDate(vo.getStartTime())));
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.jsowell.pile.vo.uniapp;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 占桩订单详情
|
* 占桩订单详情
|
||||||
*
|
*
|
||||||
@@ -10,15 +12,59 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class OccupyOrderDetailVO {
|
public class OccupyOrderDetailVO {
|
||||||
|
/**
|
||||||
|
* 占桩订单
|
||||||
|
*/
|
||||||
private String occupyCode;
|
private String occupyCode;
|
||||||
|
|
||||||
private String occupyStatus;
|
/**
|
||||||
|
* 订单状态
|
||||||
|
* (0-占桩中;1-订单完成; 2-订单挂起;9-草稿单)
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点id
|
||||||
|
*/
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商id
|
||||||
|
*/
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商名称
|
||||||
|
*/
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 占桩开始时间
|
||||||
|
*/
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 占桩结束时间
|
||||||
|
*/
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 占桩总时长(结束时间 - 开始时间)
|
||||||
|
*/
|
||||||
|
private String occupyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付状态
|
||||||
|
*/
|
||||||
private String payStatus;
|
private String payStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单金额
|
||||||
|
*/
|
||||||
|
private String orderAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -866,4 +866,24 @@
|
|||||||
and connector_code = #{connectorCode,jdbcType=VARCHAR}
|
and connector_code = #{connectorCode,jdbcType=VARCHAR}
|
||||||
order by create_time DESC
|
order by create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getOccupyOrderDetail" resultType="com.jsowell.pile.vo.uniapp.OccupyOrderDetailVO">
|
||||||
|
SELECT
|
||||||
|
t1.occupy_code AS occupyCode,
|
||||||
|
t1.STATUS AS orderStatus,
|
||||||
|
t1.station_id AS stationId,
|
||||||
|
t2.station_name AS stationName,
|
||||||
|
t2.merchant_id AS merchantId,
|
||||||
|
t3.merchant_name AS merchantName,
|
||||||
|
t1.start_time AS startTime,
|
||||||
|
t1.end_time AS endTime,
|
||||||
|
t1.pay_status AS payStatus,
|
||||||
|
t1.order_amount AS orderAmount
|
||||||
|
FROM
|
||||||
|
order_pile_occupy t1
|
||||||
|
LEFT JOIN pile_station_info t2 ON t1.station_id = t2.id
|
||||||
|
LEFT JOIN pile_merchant_info t3 ON t2.merchant_id = t3.id
|
||||||
|
WHERE
|
||||||
|
t1.occupy_code = #{occupyCode,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user