mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 18:59:51 +08:00
update 人工结算订单添加查询交易记录逻辑
This commit is contained in:
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
@@ -775,22 +776,32 @@ public class OrderService {
|
|||||||
// 充电度数
|
// 充电度数
|
||||||
String chargingDegree = dto.getChargingDegree();
|
String chargingDegree = dto.getChargingDegree();
|
||||||
|
|
||||||
// 先查交易记录
|
// 获取订单结算时间
|
||||||
LocalDateTime localDateTime = DateUtils.date2LocalDateTime(orderBasicInfo.getSettlementTime());
|
Date settlementTime = orderBasicInfo.getSettlementTime();
|
||||||
|
|
||||||
|
// 获取订单停止充电时间
|
||||||
|
Date chargeEndTime = orderBasicInfo.getChargeEndTime();
|
||||||
|
|
||||||
|
// 如果订单结算时间与订单停止充电时间都为空,则打印错误信息并返回
|
||||||
|
if (settlementTime == null && chargeEndTime == null) {
|
||||||
|
log.error("人工结算订单 error -订单结算时间与订单停止充电时间都为空");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDateTime localDateTime = DateUtils.date2LocalDateTime(settlementTime != null ? settlementTime : chargeEndTime);
|
||||||
// 开始时间为localDateTime减30秒
|
// 开始时间为localDateTime减30秒
|
||||||
LocalDateTime startTime = localDateTime.minusSeconds(30);
|
LocalDateTime startTime = localDateTime.minusSeconds(30);
|
||||||
// 结束时间为localDateTime加30秒
|
// 结束时间为localDateTime加30秒
|
||||||
LocalDateTime endTime = localDateTime.plusSeconds(30);
|
LocalDateTime endTime = localDateTime.plusSeconds(30);
|
||||||
// 查询这笔订单的交易记录原始数据
|
// 查询这笔订单的交易记录原始数据
|
||||||
List<PileMsgRecord> pileFeedListV2 = pileMsgRecordService.getPileFeedListV2(orderBasicInfo.getPileSn(), "0x3B", startTime, endTime);
|
List<PileMsgRecord> pileFeedListV2 = pileMsgRecordService.getPileFeedListV2(orderBasicInfo.getPileSn(), "0x3B", startTime, endTime);
|
||||||
if (CollectionUtils.isEmpty(pileFeedListV2)) {
|
// if (CollectionUtils.isEmpty(pileFeedListV2)) {
|
||||||
// 如果没有交易记录原始数据,则使用停止充电时间作为开始时间和结束时间再查一次
|
// // 如果没有交易记录原始数据,则使用停止充电时间作为开始时间和结束时间再查一次
|
||||||
localDateTime = DateUtils.date2LocalDateTime(orderBasicInfo.getChargeEndTime());
|
// localDateTime = DateUtils.date2LocalDateTime(chargeEndTime);
|
||||||
startTime = localDateTime.minusSeconds(30);
|
// startTime = localDateTime.minusSeconds(30);
|
||||||
endTime = localDateTime.plusSeconds(30);
|
// endTime = localDateTime.plusSeconds(30);
|
||||||
pileFeedListV2 = pileMsgRecordService.getPileFeedListV2(orderBasicInfo.getPileSn(), "0x3B", startTime, endTime);
|
// pileFeedListV2 = pileMsgRecordService.getPileFeedListV2(orderBasicInfo.getPileSn(), "0x3B", startTime, endTime);
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (PileMsgRecord pileMsgRecord : pileFeedListV2) {
|
for (PileMsgRecord pileMsgRecord : pileFeedListV2) {
|
||||||
TransactionRecordsData parse = JSONObject.parseObject(pileMsgRecord.getJsonMsg(), TransactionRecordsData.class);
|
TransactionRecordsData parse = JSONObject.parseObject(pileMsgRecord.getJsonMsg(), TransactionRecordsData.class);
|
||||||
if (StringUtils.equals(parse.getTransactionCode(), orderBasicInfo.getTransactionCode())) {
|
if (StringUtils.equals(parse.getTransactionCode(), orderBasicInfo.getTransactionCode())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user