mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-11 13:30:15 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -106,8 +106,8 @@ weixin:
|
|||||||
appsecret: bbac689f4654b209de4d6944808ec80b
|
appsecret: bbac689f4654b209de4d6944808ec80b
|
||||||
redirectUrl: http://www.kuangstudy.com/login/api/wx/callback
|
redirectUrl: http://www.kuangstudy.com/login/api/wx/callback
|
||||||
sendMsg:
|
sendMsg:
|
||||||
startChargingTmpId: BGgZe98QHr0I1S1GrtGps5_rLX6n9cW1AsXhL4YkHHc
|
startChargingTmpId: BGgZe98QHr0I1S1GrtGps0y3uhvURtQNkbMAzI2D8g8
|
||||||
stopChargingTmpId: UyBPbADlZfsCj89rh_xvfZGlxTW5J5KURpZtt9CNFrY
|
stopChargingTmpId: UyBPbADlZfsCj89rh_xvfR2ZP1iwtmPcMFA0sUOJwog
|
||||||
|
|
||||||
#Sim卡信息
|
#Sim卡信息
|
||||||
xunzhong:
|
xunzhong:
|
||||||
|
|||||||
@@ -16,40 +16,60 @@ public class SendMessageVO {
|
|||||||
/**
|
/**
|
||||||
* 订单号
|
* 订单号
|
||||||
*/
|
*/
|
||||||
public String orderCode;
|
private String orderCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点名称
|
* 站点名称
|
||||||
*/
|
*/
|
||||||
public String stationName;
|
private String stationName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电开始时间
|
* 充电开始时间
|
||||||
*/
|
*/
|
||||||
public String chargeStartTime;
|
private String chargeStartTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点Id
|
* 站点Id
|
||||||
*/
|
*/
|
||||||
public String stationId;
|
private String stationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单金额
|
* 订单金额
|
||||||
*/
|
*/
|
||||||
public String orderAmount;
|
private String orderAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户openId
|
* 用户openId
|
||||||
*/
|
*/
|
||||||
public String openId;
|
private String openId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电结束时间
|
* 充电结束时间
|
||||||
*/
|
*/
|
||||||
public String chargeStopTime;
|
private String chargeStopTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电停止原因
|
* 充电停止原因
|
||||||
*/
|
*/
|
||||||
public String stopReason;
|
private String stopReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 枪口号
|
||||||
|
*/
|
||||||
|
private String pileConnectorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 桩编码
|
||||||
|
*/
|
||||||
|
private String pileSn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 枪口号
|
||||||
|
*/
|
||||||
|
private String connectorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电度数
|
||||||
|
*/
|
||||||
|
private String chargingDegree;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,24 @@ public class AppletTemplateMessageSendDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
* character_string11
|
||||||
|
*/
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费标准(每度单价)
|
||||||
|
* thing13
|
||||||
|
*/
|
||||||
|
private String totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 枪口编号
|
||||||
|
* thing7
|
||||||
|
*/
|
||||||
|
private String pileConnectorCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -66,5 +84,20 @@ public class AppletTemplateMessageSendDTO implements Serializable {
|
|||||||
* thing7
|
* thing7
|
||||||
*/
|
*/
|
||||||
private String endReason;
|
private String endReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电度数
|
||||||
|
*/
|
||||||
|
private String chargingDegree;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电时长
|
||||||
|
*/
|
||||||
|
private String chargingTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import com.jsowell.common.util.DateUtils;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.http.HttpUtils;
|
import com.jsowell.common.util.http.HttpUtils;
|
||||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileBillingTemplateService;
|
||||||
|
import com.jsowell.pile.vo.uniapp.CurrentTimePriceDetails;
|
||||||
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
||||||
import com.jsowell.wxpay.config.WeixinLoginProperties;
|
import com.jsowell.wxpay.config.WeixinLoginProperties;
|
||||||
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
|
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
|
||||||
@@ -24,6 +26,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -45,6 +49,9 @@ public class WxAppletRemoteService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOrderBasicInfoService orderBasicInfoService;
|
private IOrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileBillingTemplateService pileBillingTemplateService;
|
||||||
|
|
||||||
@Value("${weixin.login.appid}")
|
@Value("${weixin.login.appid}")
|
||||||
private String appid;
|
private String appid;
|
||||||
|
|
||||||
@@ -197,6 +204,15 @@ public class WxAppletRemoteService {
|
|||||||
startChargingMessage.setStartTime(sendMessageVO.getChargeStartTime()); // 开始时间
|
startChargingMessage.setStartTime(sendMessageVO.getChargeStartTime()); // 开始时间
|
||||||
}
|
}
|
||||||
startChargingMessage.setStationName(sendMessageVO.getStationName()); // 站点名称
|
startChargingMessage.setStationName(sendMessageVO.getStationName()); // 站点名称
|
||||||
|
|
||||||
|
// 订单编号
|
||||||
|
startChargingMessage.setOrderCode(sendMessageVO.getOrderCode());
|
||||||
|
// 收费标准
|
||||||
|
CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(sendMessageVO.getStationId());
|
||||||
|
startChargingMessage.setTotalPrice(currentTimePriceDetails.getTotalPrice() + " 元/度");
|
||||||
|
// 枪口编号
|
||||||
|
startChargingMessage.setPileConnectorCode(sendMessageVO.getPileSn() + "桩" + sendMessageVO.getConnectorCode() + "枪口");
|
||||||
|
|
||||||
return uniAppSendMsg(msgInfo);
|
return uniAppSendMsg(msgInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +222,7 @@ public class WxAppletRemoteService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String, String> stopChargingSendMsg(WechatSendMsgDTO dto) {
|
public Map<String, String> stopChargingSendMsg(WechatSendMsgDTO dto) throws ParseException {
|
||||||
// 通过订单号查询订单金额
|
// 通过订单号查询订单金额
|
||||||
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
|
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
|
||||||
SendMessageVO sendMessageVO = orderBasicInfoService.selectOrderInfoByOrderCode(dto.getOrderCode());
|
SendMessageVO sendMessageVO = orderBasicInfoService.selectOrderInfoByOrderCode(dto.getOrderCode());
|
||||||
@@ -217,13 +233,21 @@ public class WxAppletRemoteService {
|
|||||||
AppletTemplateMessageSendDTO.StopChargingMessage stopChargingMessage = new AppletTemplateMessageSendDTO.StopChargingMessage();
|
AppletTemplateMessageSendDTO.StopChargingMessage stopChargingMessage = new AppletTemplateMessageSendDTO.StopChargingMessage();
|
||||||
msgInfo.setStopChargingMessage(stopChargingMessage);
|
msgInfo.setStopChargingMessage(stopChargingMessage);
|
||||||
|
|
||||||
stopChargingMessage.setChargingAmount(sendMessageVO.getOrderAmount());
|
stopChargingMessage.setChargingAmount(sendMessageVO.getOrderAmount()); // 订单金额
|
||||||
stopChargingMessage.setEndReason(sendMessageVO.getStopReason());
|
stopChargingMessage.setEndReason(sendMessageVO.getStopReason()); // 结束原因
|
||||||
if (StringUtils.isBlank(sendMessageVO.getChargeStopTime())) {
|
stopChargingMessage.setOrderCode(sendMessageVO.getOrderCode()); // 订单号
|
||||||
stopChargingMessage.setEndTime(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm"));
|
stopChargingMessage.setChargingDegree(sendMessageVO.getChargingDegree()); // 充电度数
|
||||||
}else {
|
Date chargeStartTime = DateUtils.parseDate(sendMessageVO.getChargeStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||||
stopChargingMessage.setEndTime(sendMessageVO.getChargeStopTime());
|
Date chargeStopTime = DateUtils.parseDate(sendMessageVO.getChargeStopTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||||
}
|
String 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,6 +268,9 @@ public class WxAppletRemoteService {
|
|||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("thing5", ImmutableMap.of("value", dto.getStartChargingMessage().getStationName())); // 充电站名称
|
map.put("thing5", ImmutableMap.of("value", dto.getStartChargingMessage().getStationName())); // 充电站名称
|
||||||
map.put("time2", ImmutableMap.of("value", dto.getStartChargingMessage().getStartTime())); // 开始时间
|
map.put("time2", ImmutableMap.of("value", dto.getStartChargingMessage().getStartTime())); // 开始时间
|
||||||
|
map.put("character_string11", ImmutableMap.of("value", dto.getStartChargingMessage().getOrderCode())); // 订单编号
|
||||||
|
map.put("thing7", ImmutableMap.of("value", dto.getStartChargingMessage().getPileConnectorCode())); // 充电插座
|
||||||
|
map.put("thing13", ImmutableMap.of("value", dto.getStartChargingMessage().getTotalPrice())); // 收费标准
|
||||||
dto.setData(map);
|
dto.setData(map);
|
||||||
} else if (StringUtils.equals("2", type)) {
|
} else if (StringUtils.equals("2", type)) {
|
||||||
// 结束充电
|
// 结束充电
|
||||||
@@ -251,9 +278,12 @@ public class WxAppletRemoteService {
|
|||||||
dto.setTemplate_id(templateId);
|
dto.setTemplate_id(templateId);
|
||||||
// dto.setPage("跳转的页面");
|
// dto.setPage("跳转的页面");
|
||||||
Map<String, Object> map = new HashMap<>();
|
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("amount17", ImmutableMap.of("value", dto.getStopChargingMessage().getChargingAmount())); // 充电金额
|
||||||
map.put("time3", ImmutableMap.of("value", dto.getStopChargingMessage().getEndTime())); // 结束时间
|
// map.put("time3", ImmutableMap.of("value", dto.getStopChargingMessage().getEndTime())); // 结束时间
|
||||||
map.put("thing7", ImmutableMap.of("value", dto.getStopChargingMessage().getEndReason())); // 结束原因
|
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);
|
dto.setData(map);
|
||||||
}
|
}
|
||||||
// 调用下面的发送消息接口
|
// 调用下面的发送消息接口
|
||||||
|
|||||||
@@ -786,12 +786,15 @@
|
|||||||
<select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.SendMessageVO">
|
<select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.SendMessageVO">
|
||||||
SELECT
|
SELECT
|
||||||
t1.order_code as orderCode,
|
t1.order_code as orderCode,
|
||||||
|
t1.pile_sn as pileSn,
|
||||||
|
t1.connector_code as connectorCode,
|
||||||
t1.charge_start_time as chargeStartTime,
|
t1.charge_start_time as chargeStartTime,
|
||||||
t1.charge_end_time as chargeStopTime,
|
t1.charge_end_time as chargeStopTime,
|
||||||
t1.reason as stopReason,
|
t1.reason as stopReason,
|
||||||
t1.station_id as stationId,
|
t1.station_id as stationId,
|
||||||
t2.station_name as stationName,
|
t2.station_name as stationName,
|
||||||
t3.total_order_amount as orderAmount,
|
t3.total_order_amount as orderAmount,
|
||||||
|
t3.total_used_electricity as chargingDegree,
|
||||||
t4.open_id as openId
|
t4.open_id as openId
|
||||||
FROM
|
FROM
|
||||||
order_basic_info t1
|
order_basic_info t1
|
||||||
|
|||||||
Reference in New Issue
Block a user