update 预约充电记录

This commit is contained in:
Guoqs
2024-08-05 15:46:59 +08:00
parent 828d756363
commit 58d7974d3c
11 changed files with 111 additions and 24 deletions

View File

@@ -234,7 +234,7 @@ public class WxAppletRemoteService {
// 枪口编号
startChargingMessage.setPileConnectorCode(sendMessageVO.getPileSn() + "" + sendMessageVO.getConnectorCode() + "枪口");
return uniAppSendMsg(msgInfo);
return uniAppSendMsg(msgInfo); // 开始充电
}
/**
@@ -269,23 +269,25 @@ public class WxAppletRemoteService {
Date chargeStopTime = DateUtils.parseDate(sendMessageVO.getChargeStopTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
chargingTime = DateUtils.getDatePoor(chargeStopTime, chargeStartTime);
}
stopChargingMessage.setChargingTime(chargingTime); // 充电时长
// if (StringUtils.isBlank(sendMessageVO.getChargeStopTime())) {
// stopChargingMessage.setEndTime(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm"));
// }else {
// stopChargingMessage.setEndTime(sendMessageVO.getChargeStopTime());
// }
return uniAppSendMsg(msgInfo);
return uniAppSendMsg(msgInfo); // 停止充电
}
/**
* 预约充电结果小程序服务通知
*/
public Map<String, String> reservationStartupResultSendMsg(ReservationChargingStartupResult chargingStartupResult) {
public Map<String, String> reservationStartupResultSendMsg(String openId, String startTime, String endTime, String startUpResult, String failReason) {
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
return uniAppSendMsg(msgInfo);
msgInfo.setType("2"); // 2-结束充电推送消息
msgInfo.setTouser(openId);
// 封装对象并调用发送消息的方法
AppletTemplateMessageSendDTO.StartUpResultMessage startUpResultMessage = new AppletTemplateMessageSendDTO.StartUpResultMessage();
startUpResultMessage.setStartTime(startTime);
startUpResultMessage.setEndTime(endTime);
startUpResultMessage.setStartUpResult(startUpResult);
startUpResultMessage.setFailReason(failReason);
msgInfo.setStartUpResultMessage(startUpResultMessage);
return uniAppSendMsg(msgInfo); // 预约充电结果
}
/**
@@ -301,7 +303,6 @@ public class WxAppletRemoteService {
// 开始充电
String templateId = startChargingTmpId;
dto.setTemplate_id(templateId);
// dto.setPage("跳转的页面");
Map<String, Object> map = new HashMap<>();
map.put("thing5", ImmutableMap.of("value", dto.getStartChargingMessage().getStationName())); // 充电站名称
map.put("time2", ImmutableMap.of("value", dto.getStartChargingMessage().getStartTime())); // 开始时间
@@ -313,15 +314,23 @@ public class WxAppletRemoteService {
// 结束充电
String templateId = stopChargingTmpId;
dto.setTemplate_id(templateId);
// dto.setPage("跳转的页面");
Map<String, Object> map = new HashMap<>();
map.put("character_string5", ImmutableMap.of("value", dto.getStopChargingMessage().getOrderCode())); // 充电金额
map.put("amount17", ImmutableMap.of("value", dto.getStopChargingMessage().getChargingAmount())); // 充电金额
// map.put("time3", ImmutableMap.of("value", dto.getStopChargingMessage().getEndTime())); // 结束时间
map.put("thing7", ImmutableMap.of("value", dto.getStopChargingMessage().getEndReason())); // 结束原因
map.put("thing22", ImmutableMap.of("value", dto.getStopChargingMessage().getChargingTime())); // 充电时长
map.put("number13", ImmutableMap.of("value", dto.getStopChargingMessage().getChargingDegree())); // 充电度数
dto.setData(map);
} else if (StringUtils.equals("3", type)) {
// 结束充电
String templateId = stopChargingTmpId;
dto.setTemplate_id(templateId);
Map<String, Object> map = new HashMap<>();
map.put("time2", ImmutableMap.of("value", dto.getStartUpResultMessage().getStartTime())); // 开始时间
map.put("time3", ImmutableMap.of("value", dto.getStartUpResultMessage().getEndTime())); // 结束时间
map.put("phrase20", ImmutableMap.of("value", dto.getStartUpResultMessage().getStartUpResult())); // 启动结果
map.put("thing21", ImmutableMap.of("value", dto.getStartUpResultMessage().getFailReason())); // 失败原因
}
// 调用下面的发送消息接口
return uniformMessageSend(dto);