|
|
@@ -1,11 +1,8 @@
|
|
|
package com.kym.service.miniapp.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
-import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.kym.common.constant.ResponseEnum;
|
|
|
-import com.kym.common.enums.EnPlusApi;
|
|
|
import com.kym.common.exception.BusinessException;
|
|
|
-import com.kym.common.utils.AESUtil;
|
|
|
import com.kym.common.utils.IDGenerator;
|
|
|
import com.kym.entity.miniapp.ChargeOrder;
|
|
|
import com.kym.service.admin.EquipmentInfoService;
|
|
|
@@ -42,9 +39,6 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
@Autowired
|
|
|
private AccountService accountService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private EquipmentInfoService equipmentInfoService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private EnPlusService enPlusService;
|
|
|
|
|
|
@@ -94,7 +88,7 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
if (equipAuth.containsKey("SuccStat") && equipAuth.getIntValue("SuccStat") == 0) {
|
|
|
// TODO 查询业务策略信息(计费信息),目前计费在EN+完成,后续自主计费需要开发
|
|
|
// 启动充电
|
|
|
- var startCharge = queryStartCharge(startChargeSeq, connectorId, qrCode, amount);
|
|
|
+ var startCharge = enPlusService.queryStartCharge(startChargeSeq, connectorId, qrCode, amount);
|
|
|
if (startCharge.containsKey("SuccStat") && startCharge.getIntValue("SuccStat") == 0) {
|
|
|
// 启动成功,生成充电订单
|
|
|
var order = new ChargeOrder();
|
|
|
@@ -136,29 +130,6 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 请求EN+启动充电
|
|
|
- *
|
|
|
- * @param startChargeSeq
|
|
|
- * @param connectorId
|
|
|
- * @param qrCode
|
|
|
- * @param amount
|
|
|
- * @return
|
|
|
- */
|
|
|
- public JSONObject queryStartCharge(String startChargeSeq, String connectorId, String qrCode, Integer amount) {
|
|
|
- var param = """
|
|
|
- {
|
|
|
- "StartChargeSeq":%s,
|
|
|
- "ConnectorID":%s,
|
|
|
- "QRCode":%s,
|
|
|
- "amount",%d
|
|
|
- }
|
|
|
- """.formatted(startChargeSeq, connectorId, qrCode, amount);
|
|
|
- var response = enPlusService.enPlusPost(EnPlusApi.EN_PLUS_QUERY_START_CHARGE.getApi(), enPlusService.buildParams(param));
|
|
|
- return JSONObject.parseObject(AESUtil.decrypt(response.getData()));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 请求EN+设备充电状态
|
|
|
*
|
|
|
@@ -214,4 +185,11 @@ public class ChargeServiceImpl implements ChargeService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ void queryEquipBusinessPolicy(){
|
|
|
+ var equipBizSeq = "";
|
|
|
+ var connectorId = "";
|
|
|
+ var data =enPlusService.queryEquipBusinessPolicy(equipBizSeq, connectorId);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|