mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-24 00:59:43 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -3,7 +3,7 @@ package com.jsowell.common.enums.thirdparty;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* 第三方平台 type operatorId 对应枚举
|
||||||
*
|
*
|
||||||
* @author Lemon
|
* @author Lemon
|
||||||
* @Date 2023/11/8 9:11:55
|
* @Date 2023/11/8 9:11:55
|
||||||
|
|||||||
@@ -255,8 +255,8 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
String dataSecret = "KnGhAb88GtUEPb0j"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO
|
String dataSecret = "KnGhAb88GtUEPb0j"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO
|
||||||
String dataSecretIV = "XZ4wURhuo2y8s4ZS"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR
|
String dataSecretIV = "XZ4wURhuo2y8s4ZS"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR
|
||||||
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
|
String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA
|
||||||
String dataString = "pZLkdIJdqGhgVcTEhSQXv7VBj9jRQ+Cjy49RPHeuFkFZreXmtD20J/yVyOKw2GtC5rt7NT20dANzPKIw4GVYrqsBsSaGKZuFTbn7KKf//Jdj5CgBNtGgS5H6wD6F41zHnGegmo\n" +
|
String dataString = "pZLkdIJdqGhgVcTEhSQXv7VBj9jRQ+Cjy49RPHeuFkHPOx+D8XLNGFhB/6ZdNDx3D3NEjNx3ua0sTLGv3bC5PkRw2FMiAEA8uM4N6RzDLvoU4C7DnH+gAvpfTocaU1FudrWo2AYme\n" +
|
||||||
"hhWPW7WcVBow3CL87rGOaqnOWyLXLh9FlOs9WLtZdIbC47n8agmp7Pcx99Bu7n8e5+lUz1s7NZCsJoknrUl4EhONzGgKu8Hos2W34n7AOM3IzTR/oHBVJtg0cjvnj0zKbweGmTWbIWrY3sJQ==";
|
"16T37pVsoN5Ztq5RflzYR2utOY2lwFKAHcTqS6Mk1wMW3FZiIB2SbBL+ANRANfmqwVXN8qdJ0MwifuEZZHhZlcdQf7KoQnuMYf4MS1fjGvg3l6R7a8DxvE7WC0WskINuIyq0m9sBPPww4BidRzJdCBSaamiFlzuKzY18p1eFfyjU9mZoe5R3sQze9gBCs1Uj0/dPDXeQOOscmEWs8Fd2mIxaoatUNbhrxekISxpIVhf3bC/nSGWU+F5Qo4x9alm1UcTr6xGZOHr2PejOLxYJKYgt2rNpbQUh+c=";
|
||||||
|
|
||||||
// 解密data
|
// 解密data
|
||||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
@@ -675,7 +675,11 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
.failReason(0)
|
.failReason(0)
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
|
||||||
|
// 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中
|
||||||
|
vo.setStartChargeSeqStat(3);
|
||||||
|
}
|
||||||
// 异步推送启动充电结果
|
// 异步推送启动充电结果
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -766,8 +770,8 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
|
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
|
||||||
.endTime(DateUtils.getDateTime()) // 本次采样时间
|
.endTime(DateUtils.getDateTime()) // 本次采样时间
|
||||||
.totalPower(new BigDecimal(data.getChargingDegree()).setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计充电量
|
.totalPower(new BigDecimal(data.getChargingDegree()).setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计充电量
|
||||||
.elecMoney(totalElectricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计电费
|
.elecMoney(totalElectricityAmount.setScale(4, BigDecimal.ROUND_HALF_UP)) // 累计电费
|
||||||
.seviceMoney(totalServiceAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计服务费
|
.seviceMoney(totalServiceAmount.setScale(4, BigDecimal.ROUND_HALF_UP)) // 累计服务费
|
||||||
.totalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额
|
.totalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
@@ -822,6 +826,12 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
}
|
}
|
||||||
vo.setSuccStat(0);
|
vo.setSuccStat(0);
|
||||||
vo.setFailReason(0);
|
vo.setFailReason(0);
|
||||||
|
|
||||||
|
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
|
||||||
|
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
|
||||||
|
// 如果是新电途平台,则将 startChargeSeqStat 改为 1-启动中
|
||||||
|
vo.setStartChargeSeqStat(1);
|
||||||
|
}
|
||||||
// 加密
|
// 加密
|
||||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||||
// 加密数据
|
// 加密数据
|
||||||
|
|||||||
@@ -192,18 +192,23 @@ public class ZDLServiceImpl implements ZDLService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String areaCode = "330000,330200,330213";
|
String startTime = "00:00:00"; // 00:00:00 格式
|
||||||
// 根据逗号分组
|
// 需要将中间的冒号去掉
|
||||||
String[] split = StringUtils.split(areaCode, ",");
|
String replace = StringUtils.replace(startTime, ":", "");
|
||||||
// 只取最后一部分
|
System.out.println(replace);
|
||||||
String subAreaCode = split[split.length - 1];
|
|
||||||
|
|
||||||
System.out.println(subAreaCode);
|
// String areaCode = "330000,330200,330213";
|
||||||
|
// // 根据逗号分组
|
||||||
|
// String[] split = StringUtils.split(areaCode, ",");
|
||||||
String organizationCode = "91310120MAC13L2Q9P";
|
// // 只取最后一部分
|
||||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
// String subAreaCode = split[split.length - 1];
|
||||||
System.out.println(equipmentOwnerId); // MAC13L2Q9
|
//
|
||||||
|
// System.out.println(subAreaCode);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// String organizationCode = "91310120MAC13L2Q9P";
|
||||||
|
// String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||||
|
// System.out.println(equipmentOwnerId); // MAC13L2Q9
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -384,7 +389,10 @@ public class ZDLServiceImpl implements ZDLService {
|
|||||||
for (BillingPriceVO billingPriceVO : billingPriceVOList) {
|
for (BillingPriceVO billingPriceVO : billingPriceVOList) {
|
||||||
// 将时段开始时间、电费、服务费信息进行封装
|
// 将时段开始时间、电费、服务费信息进行封装
|
||||||
policyInfo = new EquipBusinessPolicyVO.PolicyInfo();
|
policyInfo = new EquipBusinessPolicyVO.PolicyInfo();
|
||||||
policyInfo.setStartTime(billingPriceVO.getStartTime() + ":00");
|
String startTime = billingPriceVO.getStartTime() + ":00"; // 00:00:00 格式
|
||||||
|
// 需要将中间的冒号去掉,改为 000000 格式
|
||||||
|
String replace = StringUtils.replace(startTime, ":", "");
|
||||||
|
policyInfo.setStartTime(replace);
|
||||||
policyInfo.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
policyInfo.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||||
policyInfo.setServicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
policyInfo.setServicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user