diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyOperatorIdEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyOperatorIdEnum.java index 7a58f8bd4..1e3ebb194 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyOperatorIdEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyOperatorIdEnum.java @@ -3,7 +3,7 @@ package com.jsowell.common.enums.thirdparty; import com.jsowell.common.util.StringUtils; /** - * TODO + * 第三方平台 type operatorId 对应枚举 * * @author Lemon * @Date 2023/11/8 9:11:55 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java index b4ba858d4..dc1d84d8e 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java @@ -255,8 +255,8 @@ public class LianLianServiceImpl implements LianLianService { String dataSecret = "KnGhAb88GtUEPb0j"; // SPBNJ1Z5EQNmpK08 VTAEKDPVN9CUS7WO String dataSecretIV = "XZ4wURhuo2y8s4ZS"; // peRoTcb2C7zqKeII 83UZFFRRZDYNF5CR String signSecret = "sRjCDeokckFGpYpA"; // sRjCDeokckFGpYpA - String dataString = "pZLkdIJdqGhgVcTEhSQXv7VBj9jRQ+Cjy49RPHeuFkFZreXmtD20J/yVyOKw2GtC5rt7NT20dANzPKIw4GVYrqsBsSaGKZuFTbn7KKf//Jdj5CgBNtGgS5H6wD6F41zHnGegmo\n" + - "hhWPW7WcVBow3CL87rGOaqnOWyLXLh9FlOs9WLtZdIbC47n8agmp7Pcx99Bu7n8e5+lUz1s7NZCsJoknrUl4EhONzGgKu8Hos2W34n7AOM3IzTR/oHBVJtg0cjvnj0zKbweGmTWbIWrY3sJQ=="; + String dataString = "pZLkdIJdqGhgVcTEhSQXv7VBj9jRQ+Cjy49RPHeuFkHPOx+D8XLNGFhB/6ZdNDx3D3NEjNx3ua0sTLGv3bC5PkRw2FMiAEA8uM4N6RzDLvoU4C7DnH+gAvpfTocaU1FudrWo2AYme\n" + + "16T37pVsoN5Ztq5RflzYR2utOY2lwFKAHcTqS6Mk1wMW3FZiIB2SbBL+ANRANfmqwVXN8qdJ0MwifuEZZHhZlcdQf7KoQnuMYf4MS1fjGvg3l6R7a8DxvE7WC0WskINuIyq0m9sBPPww4BidRzJdCBSaamiFlzuKzY18p1eFfyjU9mZoe5R3sQze9gBCs1Uj0/dPDXeQOOscmEWs8Fd2mIxaoatUNbhrxekISxpIVhf3bC/nSGWU+F5Qo4x9alm1UcTr6xGZOHr2PejOLxYJKYgt2rNpbQUh+c="; // 解密data byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes()); @@ -675,7 +675,11 @@ public class LianLianServiceImpl implements LianLianService { .failReason(0) .build(); - + String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId()); + if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) { + // 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中 + vo.setStartChargeSeqStat(3); + } // 异步推送启动充电结果 CompletableFuture.runAsync(() -> { try { @@ -766,8 +770,8 @@ public class LianLianServiceImpl implements LianLianService { .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间 .endTime(DateUtils.getDateTime()) // 本次采样时间 .totalPower(new BigDecimal(data.getChargingDegree()).setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计充电量 - .elecMoney(totalElectricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计电费 - .seviceMoney(totalServiceAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计服务费 + .elecMoney(totalElectricityAmount.setScale(4, BigDecimal.ROUND_HALF_UP)) // 累计电费 + .seviceMoney(totalServiceAmount.setScale(4, BigDecimal.ROUND_HALF_UP)) // 累计服务费 .totalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额 .build(); @@ -822,6 +826,12 @@ public class LianLianServiceImpl implements LianLianService { } vo.setSuccStat(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 resultMap = Maps.newLinkedHashMap(); // 加密数据 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java index cf1d4ba0b..40907a631 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java @@ -192,18 +192,23 @@ public class ZDLServiceImpl implements ZDLService { } public static void main(String[] args) { - String areaCode = "330000,330200,330213"; - // 根据逗号分组 - String[] split = StringUtils.split(areaCode, ","); - // 只取最后一部分 - String subAreaCode = split[split.length - 1]; + String startTime = "00:00:00"; // 00:00:00 格式 + // 需要将中间的冒号去掉 + String replace = StringUtils.replace(startTime, ":", ""); + System.out.println(replace); - System.out.println(subAreaCode); - - - String organizationCode = "91310120MAC13L2Q9P"; - String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); - System.out.println(equipmentOwnerId); // MAC13L2Q9 + // String areaCode = "330000,330200,330213"; + // // 根据逗号分组 + // String[] split = StringUtils.split(areaCode, ","); + // // 只取最后一部分 + // String subAreaCode = split[split.length - 1]; + // + // 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) { // 将时段开始时间、电费、服务费信息进行封装 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.setServicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));