mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-04 01:50:17 +08:00
新增 宁夏平台 推送充换电站实时功率接口
This commit is contained in:
@@ -5,6 +5,7 @@ import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||
import com.jsowell.pile.vo.nanrui.NROrderInfoVO;
|
||||
@@ -358,4 +359,11 @@ public interface OrderBasicInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
OrderVO getChargeOrderInfoByOrderCode(String orderCode);
|
||||
|
||||
/**
|
||||
* 通过站点id查询订单信息
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||
@@ -445,4 +446,11 @@ public interface OrderBasicInfoService{
|
||||
* @return
|
||||
*/
|
||||
OrderVO getChargeOrderInfoByOrderCode(String orderCode);
|
||||
|
||||
/**
|
||||
* 通过站点id查询订单信息
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.jsowell.pile.transaction.dto.ClearingBillTransactionDTO;
|
||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.base.*;
|
||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||
@@ -3697,5 +3698,20 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return orderBasicInfoMapper.queryXDTOrderList(merchantId, stationId, startDate, endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过站点id查询订单信息
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
public List<SupStationStatsVO> queryOrderListByStationId(String stationId) {
|
||||
List<SupStationStatsVO> orderVOS = orderBasicInfoMapper.queryOrderListByStationId(stationId);
|
||||
for (SupStationStatsVO orderVO : orderVOS) {
|
||||
// 计算每笔订单充电时长(分钟)
|
||||
long intervalTime = DateUtils.intervalTime(orderVO.getStartTime(), orderVO.getEndTime());
|
||||
orderVO.setChargingTime(Integer.parseInt(String.valueOf(intervalTime)));
|
||||
}
|
||||
return orderVOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jsowell.pile.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2024/6/15 15:41:41
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class SupStationStatsVO {
|
||||
private String orderCode;
|
||||
private String organizationCode;
|
||||
private String stationId;
|
||||
private String pileSn;
|
||||
private String pileConnectorCode;
|
||||
private String StartTime;
|
||||
private String EndTime;
|
||||
private BigDecimal totalPower;
|
||||
private Integer chargingTime;
|
||||
}
|
||||
@@ -2882,4 +2882,25 @@
|
||||
and order_status = '0'
|
||||
and order_basic_info.reserved_start_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
|
||||
</select>
|
||||
|
||||
<select id="queryOrderListByStationId" resultType="com.jsowell.pile.vo.SupStationStatsVO">
|
||||
SELECT
|
||||
t1.order_code as orderCode,
|
||||
t3.organization_code as organizationCode,
|
||||
t1.station_id AS stationId,
|
||||
t1.pile_sn AS pileSn,
|
||||
t1.pile_connector_code AS pileConnectorCode,
|
||||
t1.charge_start_time AS StartTime,
|
||||
t1.charge_end_time AS EndTime,
|
||||
t2.total_used_electricity AS totalPower
|
||||
FROM
|
||||
order_basic_info t1
|
||||
JOIN order_detail t2 ON t1.order_code = t2.order_code
|
||||
AND t1.del_flag = '0'
|
||||
JOIN pile_merchant_info t3 on t1.merchant_id = t3.id
|
||||
WHERE
|
||||
t1.station_id = #{stationId,jdbcType=VARCHAR}
|
||||
AND t1.charge_start_time <![CDATA[ >= ]]> DATE_SUB( CURDATE(), INTERVAL 1 DAY )
|
||||
AND t1.charge_start_time <![CDATA[ < ]]> CURDATE()
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user