数据大屏增加运营商实收金额统计
This commit is contained in:
parent
8a623574fc
commit
c23b468a9a
@ -10,6 +10,7 @@ import com.xhpc.common.core.utils.bean.BeanUtils;
|
|||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -31,7 +32,7 @@ public class SyncHistoryOrderTask {
|
|||||||
/**
|
/**
|
||||||
* 每天六点自动同步一天之前所有未同步订单
|
* 每天六点自动同步一天之前所有未同步订单
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 6 * * ? ")
|
@Scheduled(cron = "0 0 0/1 * * ?")
|
||||||
@Transactional
|
@Transactional
|
||||||
void ExpiredTenantStatusTask(){
|
void ExpiredTenantStatusTask(){
|
||||||
System.out.println(" ============== 自动同步订单到清分 开始 ==========================");
|
System.out.println(" ============== 自动同步订单到清分 开始 ==========================");
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ -40,6 +41,12 @@ public class OrderTrend {
|
|||||||
@JsonProperty("orderNumber")
|
@JsonProperty("orderNumber")
|
||||||
private Long orderNumber;
|
private Long orderNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* orderNumber
|
||||||
|
*/
|
||||||
|
@JsonProperty("actPrice")
|
||||||
|
private BigDecimal actPrice;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import com.xhpc.card.service.XhpcDataBigScreenService;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -697,7 +698,8 @@ public class XhpcDataBigScreenServiceImpl implements XhpcDataBigScreenService {
|
|||||||
for (Map<String, Object> orderTrendMap : orderTrendList) {
|
for (Map<String, Object> orderTrendMap : orderTrendList) {
|
||||||
OrderTrend.DataDTO dataDTO = new OrderTrend.DataDTO();
|
OrderTrend.DataDTO dataDTO = new OrderTrend.DataDTO();
|
||||||
dataDTO.setTime((String) orderTrendMap.get("current_time"));
|
dataDTO.setTime((String) orderTrendMap.get("current_time"));
|
||||||
dataDTO.setOrderNumber((Long) orderTrendMap.get("sum"));
|
dataDTO.setOrderNumber((Long) orderTrendMap.get("number"));
|
||||||
|
dataDTO.setActPrice(new BigDecimal(orderTrendMap.get("actPrice").toString()));
|
||||||
orderTrend.getData().add(dataDTO);
|
orderTrend.getData().add(dataDTO);
|
||||||
}
|
}
|
||||||
orderTrend.setTotalItems((long) orderTrendList.size());
|
orderTrend.setTotalItems((long) orderTrendList.size());
|
||||||
|
|||||||
@ -166,7 +166,8 @@
|
|||||||
<select id="selectOrderTrendByTenantIdsAndChargingStationIds" resultType="java.util.Map">
|
<select id="selectOrderTrendByTenantIdsAndChargingStationIds" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
`current_time`,
|
`current_time`,
|
||||||
IFNULL( sum, 0 ) sum
|
IFNULL( number, 0 ) number,
|
||||||
|
IFNULL( actPrice, 0 ) actPrice
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@ -179,7 +180,8 @@
|
|||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
DATE_FORMAT( end_time, "%Y-%m-%d" ) end_time,
|
DATE_FORMAT( end_time, "%Y-%m-%d" ) end_time,
|
||||||
count( history_order_id ) sum
|
count( history_order_id ) number,
|
||||||
|
sum(act_power_price+act_service_price) actPrice
|
||||||
FROM
|
FROM
|
||||||
xhpc_history_order
|
xhpc_history_order
|
||||||
WHERE
|
WHERE
|
||||||
@ -193,7 +195,7 @@
|
|||||||
#{chargingStationId}
|
#{chargingStationId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
AND end_time <![CDATA[>=]]> DATE_ADD( now(), INTERVAL - 15 DAY )
|
AND end_time <![CDATA[>=]]> DATE_ADD( FROM_UNIXTIME(UNIX_TIMESTAMP(CAST(SYSDATE()AS DATE))) , INTERVAL - 15 DAY )
|
||||||
GROUP BY
|
GROUP BY
|
||||||
DATE_FORMAT( end_time, "%Y-%m-%d" )) b ON a.`current_time` = b.end_time
|
DATE_FORMAT( end_time, "%Y-%m-%d" )) b ON a.`current_time` = b.end_time
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user