From 896cbe067484143f7b23e28ac7c2a2e395f1cb95 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 7 Nov 2024 14:14:11 +0800 Subject: [PATCH 01/33] =?UTF-8?q?redisCache=20=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=E4=B8=AD=E6=96=B0=E5=A2=9E=20=20=E6=89=B9=E9=87=8F=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0list=E9=9B=86=E5=90=88=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/common/core/redis/RedisCache.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/jsowell-common/src/main/java/com/jsowell/common/core/redis/RedisCache.java b/jsowell-common/src/main/java/com/jsowell/common/core/redis/RedisCache.java index b2987c5d7..2af1cd5d0 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/core/redis/RedisCache.java +++ b/jsowell-common/src/main/java/com/jsowell/common/core/redis/RedisCache.java @@ -1,6 +1,7 @@ package com.jsowell.common.core.redis; import com.jsowell.common.util.StringUtils; +import org.apache.poi.ss.formula.functions.T; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -209,6 +210,33 @@ public class RedisCache { return count == null ? 0 : count; } + /** + * 批量存储 List 集合到 Redis,并设置缓存超时时间 + * + * @param map 其中 map 的 key 为缓存键值,value 为 List 集合 + * @param timeout 缓存超时时间 + * @param unit 超时时间的单位(如 TimeUnit.SECONDS、TimeUnit.MINUTES) + * @return 存储成功的元素总数 + */ + public long batchSetCacheList(final Map> map, long timeout, TimeUnit unit) { + long totalCount = 0; + + for (Map.Entry> entry : map.entrySet()) { + String key = entry.getKey(); + List dataList = entry.getValue(); + + if (dataList != null && !dataList.isEmpty()) { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + totalCount += (count != null ? count : 0); + + // 设置缓存超时时间 + redisTemplate.expire(key, timeout, unit); + } + } + + return totalCount; + } + /** * 获得缓存的list对象 * From ea428352c8f312b8fe731642c839e36ed0831a9b Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 7 Nov 2024 14:14:46 +0800 Subject: [PATCH 02/33] =?UTF-8?q?update=20=20=E9=80=9A=E8=BF=87stationIds?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9F=A5=E8=AF=A2=E6=9E=AA=E5=8F=A3=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PileConnectorInfoServiceImpl.java | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index 7e39e7826..691fc0e6f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -494,20 +494,28 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { @Override public List batchSelectConnectorList(List stationIds){ List resultList = new ArrayList<>(); - Map> map = new LinkedHashMap<>(); + Map> map; String baseRedisKey = CacheConstants.GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID; - // 先查询缓存数据 - for (String stationId : stationIds) { - String redisKey = baseRedisKey + stationId; - List list = redisCache.getCacheList(redisKey); - if (CollectionUtils.isNotEmpty(list)) { - map.put(stationId, list); - // 重新设置缓存 - redisCache.deleteObject(redisKey); - redisCache.setCacheList(redisKey, list); - redisCache.expire(redisKey, CacheConstants.cache_expire_time_1h); + // 先批量查缓存 + List redisKeys = new ArrayList<>(); + stationIds.forEach(stationId -> + redisKeys.add(CacheConstants.GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID + stationId)); + List redisObjects = redisCache.multiGet(redisKeys); + List list = new ArrayList<>(); + for (Object redisObject : redisObjects) { + if (redisObject == null) { + continue; + } + JSONArray array = JSONArray.parseArray(JSON.toJSONString(redisObject)); + for (Object o : array) { + ConnectorInfoVO connectorInfoVO = JSONObject.parseObject(JSON.toJSONString(o), ConnectorInfoVO.class); + list.add(connectorInfoVO); } } + // 按照stationId分组 + map = list.stream() + .collect(Collectors.groupingBy(ConnectorInfoVO::getStationId)); + // 先将已经有数据的stationId进行收集 List hasDataStationIds = new ArrayList<>(map.keySet()); List> values = new ArrayList<>(map.values()); @@ -528,15 +536,19 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { // 先将list根据站点id分组 Map> collect = newConnectorInfoList.stream() .collect(Collectors.groupingBy(ConnectorInfoVO::getStationId)); - // 循环map并设置缓存 + // 循环map并设置缓存key值 + Map> redisMap = new LinkedHashMap<>(); for (Map.Entry> entry : collect.entrySet()) { String stationId = entry.getKey(); + String redisKey = baseRedisKey + stationId; + List voList = entry.getValue(); - String redisKey = baseRedisKey + stationId; - redisCache.setCacheList(redisKey, voList); - redisCache.expire(redisKey, CacheConstants.cache_expire_time_1h); + redisMap.put(redisKey, voList); } + // 批量设置缓存 + redisCache.batchSetCacheList(redisMap, CacheConstants.cache_expire_time_1h, TimeUnit.SECONDS); + // redisCache.multiSave(redisMap, CacheConstants.cache_expire_time_1h); } // 最终将 values 中的所有 ConnectorInfoVO 元素收集到 resultList From 23ae7ecab39ffa8cf048a1975b797a01af4b8288 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 15:02:52 +0800 Subject: [PATCH 03/33] =?UTF-8?q?=E5=B9=B6=E5=85=85=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=80=97=E7=94=B5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/uniapp/customer/TempController.java | 19 +++++++++++++++ .../java/com/jsowell/service/TempService.java | 23 +++++++++++++++++++ .../com/jsowell/pile/dto/QueryOrderDTO.java | 18 ++++++++++++--- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java index f71768001..4b23373d0 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java @@ -583,4 +583,23 @@ public class TempController extends BaseController { } return response; } + + /** + * 计算订单耗电量 + * dto.setStationId("657"); + * dto.setStartTime("2024-10-23 00:00:00"); + * dto.setEndTime("2024-11-07 23:59:59"); + */ + @PostMapping("/calculateOrderElectricity") + public RestApiResponse calculateOrderElectricity(@RequestBody QueryOrderDTO dto) { + RestApiResponse response; + try { + tempService.calculateOrderElectricity(dto); + response = new RestApiResponse<>(); + } catch (Exception e) { + logger.error("计算订单耗电量error", e); + response = new RestApiResponse<>(); + } + return response; + } } diff --git a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java index 326aad132..8eea09f28 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java @@ -22,6 +22,7 @@ import com.jsowell.pile.dto.ApplyRefundDTO; import com.jsowell.pile.dto.QueryOrderDTO; import com.jsowell.pile.dto.SettleOrderReportDTO; import com.jsowell.pile.mapper.OrderBasicInfoMapper; +import com.jsowell.pile.mapper.PileMsgRecordMapper; import com.jsowell.pile.service.*; import com.jsowell.pile.vo.web.ClearingBillVO; import com.jsowell.pile.vo.web.OrderListVO; @@ -77,6 +78,28 @@ public class TempService { @Autowired private MemberAdapayRecordService memberAdapayRecordService; + @Autowired + private PileMsgRecordMapper pileMsgRecordMapper; + + /** + * 计算订单耗电量 + * 内蒙古站点 + */ + public void calculateOrderElectricity(QueryOrderDTO dto) { + // 根据站点id查询充电桩列表 + // List pileSnList = Lists.newArrayList("88240000006708", "88240000006709", "88240000006713", "88240000006714"); + // 查询充电桩的订单列表 + List orderListVOS = orderBasicInfoService.selectOrderBasicInfoList(dto); + logger.info("查询订单列表:{}", JSON.toJSONString(orderListVOS)); + // 根据充电桩编号,查询报文 + for (OrderListVO orderVO : orderListVOS) { + String pileSn = orderVO.getPileSn(); + List pileFeedList = pileMsgRecordMapper.getPileFeedList(pileSn); + } + + // + } + /** * 手动接口执行订单分账逻辑 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryOrderDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryOrderDTO.java index 46358592d..3b5097fc1 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryOrderDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryOrderDTO.java @@ -38,7 +38,9 @@ public class QueryOrderDTO extends BaseEntity { */ private String orderCode; - // 交易流水号 + /** + * 交易流水号 + */ private String transactionCode; /** @@ -51,6 +53,9 @@ public class QueryOrderDTO extends BaseEntity { */ private String stationId; + /** + * 站点Id列表 + */ private List stationIdList; /** @@ -68,6 +73,9 @@ public class QueryOrderDTO extends BaseEntity { */ private String endTime; + /** + * 订单编号列表 + */ private List orderCodeList; /** @@ -80,9 +88,13 @@ public class QueryOrderDTO extends BaseEntity { */ private String endSettleTime; - // 会员组编号 + /** + * 会员组编号 + */ private String groupCode; - // 车辆vin编号 + /** + * 车辆vin编号 + */ private String vinCode; } From 53a07aae78b8df7187e266707f146d47b183b81e Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 15:44:43 +0800 Subject: [PATCH 04/33] =?UTF-8?q?=E5=B9=B6=E5=85=85=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=80=97=E7=94=B5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/mapper/PileMsgRecordMapper.java | 3 +++ .../mapper/pile/PileMsgRecordMapper.xml | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMsgRecordMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMsgRecordMapper.java index 9a68802d0..9b07a765d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMsgRecordMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMsgRecordMapper.java @@ -16,4 +16,7 @@ public interface PileMsgRecordMapper { * @return */ List getPileFeedList(@Param("pileSn") String pileSn); + + List getPileFeedListV2(@Param("pileSn") String pileSn, @Param("frameType") String frameType, + @Param("startTime") String startTime, @Param("endTime") String endTime); } diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileMsgRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileMsgRecordMapper.xml index bf174de4b..35a29192a 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileMsgRecordMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileMsgRecordMapper.xml @@ -128,4 +128,21 @@ where pile_sn = #{pileSn,jdbcType=VARCHAR} order by create_time desc + + \ No newline at end of file From 345d60c227be57bcf9987f59a56bb7f25ee99f6b Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 7 Nov 2024 16:09:04 +0800 Subject: [PATCH 05/33] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=94=98=E8=82=83?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9B=B8=E5=85=B3Service=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GanSuPlatformServiceImpl.java | 150 +++++++++++++++++- 1 file changed, 142 insertions(+), 8 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java index 82a38d115..223a7a0bd 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java @@ -1,40 +1,47 @@ package com.jsowell.thirdparty.platform.service.impl; import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageInfo; import com.jsowell.common.constant.Constants; import com.jsowell.common.core.redis.RedisCache; +import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.common.enums.ykc.OrderStatusEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; +import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.JWTUtils; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; +import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.service.*; import com.jsowell.pile.thirdparty.CommonParamsDTO; import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.pile.vo.base.ConnectorInfoVO; +import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; +import com.jsowell.pile.vo.web.PileConnectorInfoVO; import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo; import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo; import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO; +import com.jsowell.thirdparty.platform.domain.SupEquipChargeStatusInfo; import com.jsowell.thirdparty.platform.domain.SupStationInfo; import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.util.Cryptos; +import com.jsowell.thirdparty.platform.util.HttpRequestUtil; import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * 甘肃省平台 @@ -213,21 +220,148 @@ public class GanSuPlatformServiceImpl implements ThirdPartyPlatformService { @Override public Map queryStationStatus(QueryStationInfoDTO dto) { List stationIds = dto.getStationIds(); - List StationStatusInfos = new ArrayList<>(); + List stationStatusInfos = new ArrayList<>(); List connectorStatusInfos = new ArrayList<>(); // 查询密钥信息 ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGanSuSecretInfo(); - ConnectorStatusInfo connectorStatusInfo; - // 根据站点idList查询 + // 根据站点idList查询枪口列表 List list = pileConnectorInfoService.batchSelectConnectorList(stationIds); + // 根据站点id分组 + Map> collect = list.stream() + .collect(Collectors.groupingBy(ConnectorInfoVO::getStationId)); + // 封装参数 + for (Map.Entry> entry : collect.entrySet()) { + String stationId = entry.getKey(); + List voList = entry.getValue(); + StationStatusInfo stationStatusInfo = new StationStatusInfo(); + stationStatusInfo.setStationId(stationId); + ConnectorStatusInfo connectorStatusInfo; + for (ConnectorInfoVO connectorInfoVO : voList) { + connectorStatusInfo = ConnectorStatusInfo.builder() + .connectorID(connectorInfoVO.getPileConnectorCode()) + .status(Integer.parseInt(connectorInfoVO.getConnectorStatus())) + .build(); + connectorStatusInfos.add(connectorStatusInfo); + } + stationStatusInfo.setConnectorStatusInfos(connectorStatusInfos); + stationStatusInfos.add(stationStatusInfo); + } + Map map = new LinkedHashMap<>(); + map.put("StationStatusInfos", stationStatusInfos); - return null; + Map resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO); + return resultMap; } + /** + * 设备状态变化推送 notification_stationStatus + * @param stationId 站点id + * @param pileConnectorCode 充电桩枪口编号 + * @param status + * @param secretInfoVO + * @return + */ + @Override + public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) { + // 查询相关配置信息 + ThirdPartySecretInfoVO ganSuSecretInfo = getGanSuSecretInfo(); + + String operatorId = ganSuSecretInfo.getOurOperatorId(); + String operatorSecret = ganSuSecretInfo.getTheirOperatorSecret(); + String signSecret = ganSuSecretInfo.getTheirSigSecret(); + String dataSecret = ganSuSecretInfo.getTheirDataSecret(); + String dataSecretIv = ganSuSecretInfo.getTheirDataSecretIv(); + String urlAddress = ganSuSecretInfo.getTheirUrlPrefix(); + + String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_STATION_STATUS.getValue(); + ConnectorStatusInfo info = ConnectorStatusInfo.builder() + .connectorID(pileConnectorCode) + .status(Integer.parseInt(status)) + .build(); + // 调用联联平台接口 + JSONObject json = new JSONObject(); + json.put("ConnectorStatusInfo", info); + String jsonString = JSON.toJSONString(json); + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; + } + + /** + * 推送设备充电信息 notification_equip_charge_status + * @param orderCode 订单编号 + * @return + */ + @Override + public String notificationEquipChargeStatus(String orderCode) { + // 根据订单号查询订单信息 + OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); + ThirdPartySecretInfoVO ganSuSecretInfo = getGanSuSecretInfo(); + + String operatorId = ganSuSecretInfo.getOurOperatorId(); + String operatorSecret = ganSuSecretInfo.getTheirOperatorSecret(); + String signSecret = ganSuSecretInfo.getTheirSigSecret(); + String dataSecret = ganSuSecretInfo.getTheirDataSecret(); + String dataSecretIv = ganSuSecretInfo.getTheirDataSecretIv(); + String urlAddress = ganSuSecretInfo.getTheirUrlPrefix(); + + // 查询充电枪口状态 + PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode()); + if (Objects.isNull(connectorInfo)) { + throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR); + } + + String merchantId = connectorInfo.getMerchantId(); + MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId); + if (Objects.isNull(merchantInfoVO)) { + throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR); + } + String orderStatus = orderInfo.getOrderStatus(); + if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderStatus)) { + // 充电中 + orderStatus = "2"; + }else if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) { + // 充电完成 + orderStatus = "4"; + } + String dateTimeNow = DateUtils.getDateTime(); + + SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder() + .startChargeSeq(orderCode) + .startChargeSeqStat(Integer.parseInt(orderStatus)) + .connectorID(orderInfo.getPileConnectorCode()) + .connectorStatus(connectorInfo.getStatus()) + .currentA(connectorInfo.getCurrent()) + .voltageA(connectorInfo.getVoltage()) + .soc(new BigDecimal(Constants.ZERO)) + .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) + .endTime(dateTimeNow) + .totalPower(connectorInfo.getInstantPower()) + .chargeDetails(new ArrayList<>()) + + .build(); + if (StringUtils.isNotBlank(connectorInfo.getSOC())) { + supEquipChargeStatusInfo.setSoc(new BigDecimal(connectorInfo.getSOC())); + } + + + String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_EQUIP_CHARGE_STATUS.getValue(); + // 调用联联平台接口 + String jsonString = JSON.toJSONString(supEquipChargeStatusInfo); + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; + + } + + /** * 获取甘肃平台密钥 * @return From 4fe8981a07c1299b4f97961586321d8ecf73a542 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 16:46:39 +0800 Subject: [PATCH 06/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/SpringBootTestController.java | 10 +-- .../platform/common/StationInfo.java | 21 ++++++ .../platform/domain/SupStationInfo.java | 59 +++++++++++++++++ .../impl/NeiMengGuPlatformServiceImpl.java | 66 +++++++++++++++++-- 4 files changed, 147 insertions(+), 9 deletions(-) diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index cce3f4b3d..76e30fd89 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -469,15 +469,15 @@ public class SpringBootTestController { @Test public void queryBillingPriceTest() { - String stationId = "19"; + String stationId = "1"; // List billingPriceVOS = pileBillingTemplateService.queryBillingPriceOld(stationId); // System.out.println("老版:" + JSON.toJSONString(billingPriceVOS)); // - // List billingPriceVOS1 = pileBillingTemplateService.queryBillingPrice(stationId); - // System.out.println("新版:" + JSON.toJSONString(billingPriceVOS1)); + List billingPriceVOS1 = pileBillingTemplateService.queryBillingPrice(stationId); + System.out.println("新版:" + JSON.toJSONString(billingPriceVOS1)); - CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(stationId); - System.out.println("currentTimePriceDetails:" + JSON.toJSONString(currentTimePriceDetails)); + // CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(stationId); + // System.out.println("currentTimePriceDetails:" + JSON.toJSONString(currentTimePriceDetails)); } @Test diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/StationInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/StationInfo.java index 41218789b..e47cb030d 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/StationInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/StationInfo.java @@ -142,6 +142,13 @@ public class StationInfo extends BaseStationInfo { @JSONField(name = "SiteGuide") private String siteGuide; + /** + * 站点额定总功率 + * 单位 kW,保留 1 位小数 + */ + @JSONField(name = "RatedPower") + private BigDecimal ratedPower; + /** * 建设场所 Y * 1:居民区 @@ -268,6 +275,20 @@ public class StationInfo extends BaseStationInfo { @JSONField(name = "Capacity") private BigDecimal capacity; + /** + * 峰谷分时 + * 0:否 1:是 + */ + @JSONField(name = "PeriodFee") + private Integer periodFee; + + /** + * 视频监控配套情况 + * 0:无 1:有 + */ + @JSONField(name = "VideoMonitor") + private Integer videoMonitor; + /** * 是否是公共停车场库 (0-否;1-是) Y * 如果是公共停车场库需要填写场库编号 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/SupStationInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/SupStationInfo.java index 64ac3da49..b42624455 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/SupStationInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/SupStationInfo.java @@ -32,5 +32,64 @@ public class SupStationInfo extends StationInfo { @JSONField(name = "AreaCodeCountryside") private String areaCodeCountryside; + /** + * 站点分类 + * 1:充电站 + * 2:换电站 + * 3:充换电一体站 + */ + @JSONField(name = "StationClassification") + private int stationClassification; + + /** + * 7*24小时营业 + * 0:否 + * 1:是 + */ + @JSONField(name = "RoundTheClock") + private String roundTheClock; + + /** + * 停车费类型 + * 0:免费 + * 1:不免费 + * 2:限时免费停车 + * 3:充电限时减免 + * 255:参考场地实际收费标准 + */ + @JSONField(name = "ParkType") + private String parkType; + + /** + * 电费类型 + * 1:商业用电 + * 2:普通工业用电 + * 3:大工业用电 + * 4:其它用电 + */ + @JSONField(name = "ElectricityType") + private Integer electricityType; + + /** + * 报装类型 + * 是否独立报装: + * 0:否 + * 1:是 + */ + @JSONField(name = "BusinessExpandType") + private Integer businessExpandType; + + /** + * 正式投运时间 + */ + @JSONField(name = "OfficialRunTime") + private String officialRunTime; + + /** + * 建站时间 + */ + @JSONField(name = "BuildTime") + private String BuildTime; + private List PolicyInfos; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index 71f1ee511..18a331a63 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -50,11 +50,14 @@ import com.jsowell.thirdparty.platform.util.Encodes; import com.jsowell.thirdparty.platform.util.HttpRequestUtil; import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; +import com.yi.business.geo.GeoCodeInfo; +import com.yi.business.geo.TermRelationTreeCoordinate; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.charset.StandardCharsets; import java.util.*; import java.util.stream.Collectors; @@ -241,20 +244,45 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())); stationInfo.setCountryCode(pileStationInfo.getCountryCode()); stationInfo.setAreaCode(pileStationInfo.getAreaCode()); + // areaCodeCountryside + GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); + if (geoCode != null) { + String areaCodeCountryside = geoCode.getCounty_code(); + stationInfo.setAreaCodeCountryside(areaCodeCountryside); + } stationInfo.setAddress(pileStationInfo.getAddress()); stationInfo.setServiceTel(pileStationInfo.getStationTel()); stationInfo.setStationType(Integer.valueOf(pileStationInfo.getStationType())); + stationInfo.setStationClassification(1); + stationInfo.setStationStatus(Integer.parseInt(pileStationInfo.getStationStatus())); stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums())); stationInfo.setStationLng(new BigDecimal(pileStationInfo.getStationLng())); stationInfo.setStationLat(new BigDecimal(pileStationInfo.getStationLat())); stationInfo.setConstruction(Integer.valueOf(pileStationInfo.getConstruction())); stationInfo.setOpenAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay())); - // stationInfo.setMinElectricityPrice(pileStationInfo); // 最低充电电费率 - // stationInfo.setElectricityFee(); // 电费 xx元/度 - // stationInfo.setServiceFee(); // 服务费 xx元/度 + List pictures = Lists.newArrayList(); + if (StringUtils.isNotBlank(pileStationInfo.getPictures())) { + pictures = Lists.newArrayList(pileStationInfo.getPictures().split(",")); + } + stationInfo.setPictures(pictures); + stationInfo.setMatchCars(pileStationInfo.getMatchCars()); + stationInfo.setBusineHours(getBusineHours()); + stationInfo.setRoundTheClock(Constants.ONE); + // stationInfo.setMinElectricityPrice(""); // 最低充电电费率 + Map feeMap = getFeeMap(stationId); + stationInfo.setElectricityFee(feeMap.get("electricityFee")); // 电费 xx元/度 + stationInfo.setServiceFee(feeMap.get("serviceFee")); // 服务费 xx元/度 + stationInfo.setParkType("255"); stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree())); + stationInfo.setElectricityType(1); + stationInfo.setBusinessExpandType(Integer.parseInt(pileStationInfo.getAloneApply())); + stationInfo.setCapacity(pileStationInfo.getCapacity().setScale(4, RoundingMode.HALF_UP)); stationInfo.setPayment(pileStationInfo.getPayment()); - stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())); + stationInfo.setPeriodFee(1); + stationInfo.setOfficialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime())); + stationInfo.setBuildTime(DateUtils.dateTime(pileStationInfo.getCreateTime())); + stationInfo.setVideoMonitor(0); + stationInfo.setSupportOrder(Integer.parseInt(pileStationInfo.getSupportOrder())); // stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型 stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())); stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag())); @@ -279,6 +307,36 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { return resultMap; } + private String getBusineHours() { + Map map = new LinkedHashMap<>(); + map.put("1", "[\"00:00-24:00\"]"); + map.put("2", "[\"00:00-24:00\"]"); + map.put("3", "[\"00:00-24:00\"]"); + map.put("4", "[\"00:00-24:00\"]"); + map.put("5", "[\"00:00-24:00\"]"); + map.put("6", "[\"00:00-24:00\"]"); + map.put("7", "[\"00:00-24:00\"]"); + + return map.toString(); + } + + private Map getFeeMap(String stationId) { + Map resultMap = Maps.newHashMap(); + JSONObject electricityFeeJson = new JSONObject(); + JSONObject serviceFeeJson = new JSONObject(); + + // 查询站点计费模板列表 + List billingList = pileBillingTemplateService.queryBillingPrice(stationId); + for (BillingPriceVO billingPriceVO : billingList) { + String key = billingPriceVO.getStartTime() + "-" + billingPriceVO.getEndTime(); + electricityFeeJson.put(key, billingPriceVO.getElectricityPrice()); + serviceFeeJson.put(key, billingPriceVO.getServicePrice()); + } + resultMap.put("electricityFee", electricityFeeJson.toJSONString()); + resultMap.put("serviceFee", serviceFeeJson.toJSONString()); + return resultMap; + } + /** * 设备接口状态查询 query_station_status * From d5d471692ba42698b14aad291134984e1c14440b Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 16:47:39 +0800 Subject: [PATCH 07/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/impl/NeiMengGuPlatformServiceImpl.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index 18a331a63..a88a71f58 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -215,17 +215,14 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { .collect(Collectors.toList()); dto.setStationIds(stationIdList); } - int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize(); - PageUtils.startPage(pageNo, pageSize); List stationInfos = pileStationInfoService.getStationInfosByThirdParty(dto); if (CollectionUtils.isEmpty(stationInfos)) { // 未查到数据 return null; } - // ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); if (thirdPartySecretInfoVO == null) { return null; @@ -236,7 +233,6 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { SupStationInfo stationInfo = new SupStationInfo(); String stationId = String.valueOf(pileStationInfo.getId()); stationInfo.setStationID(stationId); - // MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); stationInfo.setStationName(pileStationInfo.getStationName()); @@ -244,7 +240,6 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())); stationInfo.setCountryCode(pileStationInfo.getCountryCode()); stationInfo.setAreaCode(pileStationInfo.getAreaCode()); - // areaCodeCountryside GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); if (geoCode != null) { String areaCodeCountryside = geoCode.getCounty_code(); @@ -268,7 +263,6 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { stationInfo.setMatchCars(pileStationInfo.getMatchCars()); stationInfo.setBusineHours(getBusineHours()); stationInfo.setRoundTheClock(Constants.ONE); - // stationInfo.setMinElectricityPrice(""); // 最低充电电费率 Map feeMap = getFeeMap(stationId); stationInfo.setElectricityFee(feeMap.get("electricityFee")); // 电费 xx元/度 stationInfo.setServiceFee(feeMap.get("serviceFee")); // 服务费 xx元/度 From 3e08072920fd58166624b074ca2ddaf5f1781121 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 16:56:04 +0800 Subject: [PATCH 08/33] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AEredis=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/service/impl/PileBasicInfoServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index a28d6ebc6..ed185e640 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -651,9 +651,9 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { // 设置过期时间 try { - if (redisCache.getExpire(redisKey) < 0) { - redisCache.expire(redisKey, CacheConstants.cache_expire_time_10d); - } + redisCache.expire(redisKey, CacheConstants.cache_expire_time_30d); + // if (redisCache.getExpire(redisKey) < 0) { + // } } catch (Exception e) { log.info("设置过期时间error", e); } From 8aa72a096906dcb65762a6cfd7a5cb337de1db1c Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 7 Nov 2024 17:11:11 +0800 Subject: [PATCH 09/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/api/thirdparty/NeiMengGuController.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/NeiMengGuController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/NeiMengGuController.java index c38855a14..7cb6e314b 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/NeiMengGuController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/NeiMengGuController.java @@ -97,7 +97,7 @@ public class NeiMengGuController extends ThirdPartyBaseController { */ @PostMapping("/v1/supervise_query_stations_info") public CommonResult queryStationsInfo(HttpServletRequest request, @RequestBody CommonParamsDTO dto) { - logger.info("{}-查询运营商信息 params:{}", platformName, JSON.toJSONString(dto)); + logger.info("{}-查询充换电站信息 params:{}", platformName, JSON.toJSONString(dto)); try { // 校验令牌 boolean verifyToken = verifyToken(request.getHeader("Authorization")); @@ -105,7 +105,6 @@ public class NeiMengGuController extends ThirdPartyBaseController { // 校验失败 return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR); } - // 校验签名 if (!verifySignature(dto)) { // 签名错误 @@ -113,11 +112,11 @@ public class NeiMengGuController extends ThirdPartyBaseController { } QueryStationInfoDTO paramDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); Map map = platformLogic.queryStationsInfo(paramDTO); - logger.info("{}-查询运营商信息 result:{}", platformName, JSON.toJSONString(map)); - return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig")); + logger.info("{}-查询充换电站信息 result:{}", platformName, JSON.toJSONString(map)); + return CommonResult.success(0, "成功!", map.get("Data"), map.get("Sig")); } catch (Exception e) { - logger.error("{}-查询运营商信息 异常", platformName, e); - return CommonResult.failed("查询运营商信息发生异常"); + logger.error("{}-查询充换电站信息 异常", platformName, e); + return CommonResult.failed("查询充换电站信息发生异常"); } } From d636c46d57a2922338fd49397c32c5c3b5add301 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 15:19:05 +0800 Subject: [PATCH 10/33] =?UTF-8?q?equipment=5Fowner=5Fid=20=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E6=98=AF9=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/impl/NeiMengGuPlatformServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index a88a71f58..81b6d13c3 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -234,7 +234,9 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { String stationId = String.valueOf(pileStationInfo.getId()); stationInfo.setStationID(stationId); stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 - stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); + String organizationCode = pileStationInfo.getOrganizationCode(); + String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); + stationInfo.setEquipmentOwnerID(equipmentOwnerId); stationInfo.setStationName(pileStationInfo.getStationName()); stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())); stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())); From 54b40e6e56b260ec2236aab4c82fe9aeb17e4e98 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 16:47:34 +0800 Subject: [PATCH 11/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/NeiMengGuPlatformServiceImpl.java | 59 ++++++++++++++++++- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index 81b6d13c3..c2ee1c796 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -35,6 +35,7 @@ import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO; import com.jsowell.pile.vo.web.PileConnectorInfoVO; +import com.jsowell.pile.vo.web.PileMerchantInfoVO; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.thirdparty.lianlian.domain.ConnectorChargeStatusInfo; import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo; @@ -339,12 +340,11 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { * @param dto 查询站点信息dto * @throws UnsupportedOperationException 未实现异常 */ - @Override - public Map queryStationStatus(QueryStationInfoDTO dto) { + + public Map queryStationStatusOld(QueryStationInfoDTO dto) { List stationIds = dto.getStationIds(); List StationStatusInfos = new ArrayList<>(); List connectorStatusInfos = new ArrayList<>(); - // ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); if (thirdPartySecretInfoVO == null) { return null; @@ -412,6 +412,59 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { return resultMap; } + @Override + public Map queryStationStatus(QueryStationInfoDTO dto) { + List stationIds = dto.getStationIds(); + List stationStatusInfos = Lists.newArrayList(); + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); + if (thirdPartySecretInfoVO == null) { + return null; + } + for (String stationId : stationIds) { + // 查询站点的运营商信息 + PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId); + if (pileMerchantInfoVO == null) { + continue; + } + String operatorID = Constants.OPERATORID_JIANG_SU; + String organizationCode = pileMerchantInfoVO.getOrganizationCode(); + String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); + SupStationStatusInfo stationStatusInfo = new SupStationStatusInfo(); + stationStatusInfo.setStationID(stationId); + stationStatusInfo.setEquipmentOwnerID(equipmentOwnerId); + stationStatusInfo.setOperatorID(operatorID); + // 根据站点id查询充电桩列表 + List connectorInfoVOList = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId)); + List connectorStatusInfos = Lists.newArrayList(); + // 遍历充电桩列表 + for (ConnectorInfoVO connectorInfoVO : connectorInfoVOList) { + SupConnectorStatusInfo connectorStatusInfo = new SupConnectorStatusInfo(); + connectorStatusInfo.setOperatorID(operatorID); + connectorStatusInfo.setEquipmentOwnerID(equipmentOwnerId); + connectorStatusInfo.setStationID(stationId); + connectorStatusInfo.setEquipmentID(connectorInfoVO.getPileSn()); + connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode()); + connectorStatusInfo.setEquipmentClassification(Constants.ONE); + String connectorStatus = connectorInfoVO.getConnectorStatus(); + connectorStatusInfo.setStatus(Integer.parseInt(connectorStatus)); + connectorStatusInfo.setStatusDesc(PileConnectorDataBaseStatusEnum.getStatusDescription(connectorStatus)); + // connectorStatusInfo.setParkStatus(); + // connectorStatusInfo.setLockStatus(); + connectorStatusInfo.setBatteryStatus(Constants.ZERO); + connectorStatusInfo.setBatteryPackID(""); + connectorStatusInfo.setLastChangeTime(DateUtils.getDateTime()); + connectorStatusInfos.add(connectorStatusInfo); + } + stationStatusInfo.setConnectorStatusInfos(connectorStatusInfos); + stationStatusInfos.add(stationStatusInfo); + } + // 结果集 + Map map = Maps.newHashMap(); + map.put("StationStatusInfos", stationStatusInfos); + Map resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO); + return resultMap; + } + /** * 设备状态变化推送 notification_stationStatus * 推送充电设备接口状态信息 supervise_notification_station_status From c2d96808dea65be97af1c463bece9e506631881f Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 17:36:24 +0800 Subject: [PATCH 12/33] =?UTF-8?q?=E6=8F=90=E4=BA=A4PaymentTestController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/PaymentTestController.java | 270 ++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 jsowell-admin/src/test/java/PaymentTestController.java diff --git a/jsowell-admin/src/test/java/PaymentTestController.java b/jsowell-admin/src/test/java/PaymentTestController.java new file mode 100644 index 000000000..1cd9fd0c5 --- /dev/null +++ b/jsowell-admin/src/test/java/PaymentTestController.java @@ -0,0 +1,270 @@ +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.huifu.adapay.core.exception.BaseAdaPayException; +import com.huifu.adapay.model.PaymentReverse; +import com.huifu.adapay.model.Refund; +import com.jsowell.JsowellApplication; +import com.jsowell.adapay.dto.QueryConfirmReverseDTO; +import com.jsowell.adapay.dto.QueryPaymentConfirmDTO; +import com.jsowell.adapay.operation.PaymentReverseOperation; +import com.jsowell.adapay.response.ConfirmReverseResponse; +import com.jsowell.adapay.response.PaymentReverseResponse; +import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse; +import com.jsowell.adapay.service.AdapayService; +import com.jsowell.common.enums.ykc.ScenarioEnum; +import com.jsowell.common.util.StringUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@ActiveProfiles("pre") +@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@RunWith(SpringRunner.class) +public class PaymentTestController { + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + + String wechatAppId1 = "wxbb3e0d474569481d"; // 万车充 + + String wechatAppId2 = "wx20abc5210391649c"; // 嘉佳充电 + + @Autowired + private AdapayService adapayService; + + public List getPaymentIdList() { + List resultList = Lists.newArrayList(); + // List paymentIdList1 = getPaymentIdList1(); + List paymentIdListForFile = getPaymentIdListForFile(); + resultList.addAll(paymentIdListForFile); + return resultList; + } + + /** + * 从文件中读取paymentId + * @return + * @throws IOException + */ + public List getPaymentIdListForFile() { + List list =new ArrayList(); + try { + String path = "src/test/resources/payment_ids"; + FileReader fileReader =new FileReader(path); + BufferedReader bufferedReader =new BufferedReader(fileReader); + String str=null; + while((str=bufferedReader.readLine())!=null) { + if(str.trim().length()>2) { + list.add(str); + } + } + } catch (Exception e) { + + } + // System.out.println(list); + return list; + } + + /** + * 查询分账信息 + * @throws BaseAdaPayException + */ + @Test + public void queryCreateConfirmReverse() throws BaseAdaPayException { + List paymentIdList = getPaymentIdList(); // 查询分账信息 + + List unSplitList = Lists.newArrayList(); // 未分帐 + List splitList = Lists.newArrayList(); // 已分帐 + + BigDecimal total = BigDecimal.ZERO; + List selfList = Lists.newArrayList(); + + Map map = Maps.newHashMap(); + for (String paymentId : paymentIdList) { + if (StringUtils.isBlank(paymentId)) { + continue; + } + // 查询支付确认id + QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO(); + dto.setPaymentId(paymentId); + dto.setWechatAppId(wechatAppId1); + // 查询分账信息 + QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); + if (response != null) { + List confirms = response.getPaymentConfirms(); + if (CollectionUtils.isEmpty(confirms)) { + unSplitList.add(paymentId); + } else { + splitList.add(paymentId); + for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + if (queryConfirmReverseStatus(confirm)) { + System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。"); + continue; + } + JSONObject jsonObject = JSON.parseObject(confirm.getDescription()); + String adapayMemberId = jsonObject.getString("adapayMemberId"); + BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt()); + + total = total.add(confirmedAmt); + + // 放map + map.merge(adapayMemberId, confirmedAmt, BigDecimal::add); + + if (StringUtils.equals(adapayMemberId, "0")) { + selfList.add(paymentId); + } + } + } + } else { + unSplitList.add(paymentId); + } + } + System.out.println("=================未分账:" + JSON.toJSONString(unSplitList) + ", 数量:" + unSplitList.size()); + System.out.println("=================已分账:" + JSON.toJSONString(map) + ", 总分账:" + total + ", 数量:" + splitList.size()); + System.out.println("=================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size()); + } + + /** + * 查询支付撤销状态 + * @param confirm + * @return + * @throws BaseAdaPayException + */ + private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException { + boolean result = false; + QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder() + .paymentConfirmId(confirm.getId()) + .wechatAppId(wechatAppId1) + .build(); + ConfirmReverseResponse confirmReverseResponse = adapayService.queryConfirmReverse(dto); + if (confirmReverseResponse.isSuccess()) { + result = true; + } + + return result; + } + + /** + * 批量支付确认撤销 + * @throws BaseAdaPayException + */ + @Test + public void testCreateConfirmReverse() throws BaseAdaPayException { + List list = getPaymentIdList(); // 批量支付确认撤销 + for (String paymentId : list) { + // 查询支付确认id + QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO(); + dto.setPaymentId(paymentId); + dto.setWechatAppId(wechatAppId1); + QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); + if (response != null) { + List confirms = response.getPaymentConfirms(); + System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms)); + if (CollectionUtils.isNotEmpty(confirms)) { + for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + adapayService.createConfirmReverse(confirm.getId(), wechatAppId1); + } + } + } + } + } + + /** + * 查询退款信息 + */ + @Test + public void queryRefundTest() { + List list = getPaymentIdList(); // 查询退款信息 + for (String paymentId : list) { + Map refundParams = Maps.newHashMap(); + refundParams.put("payment_id", paymentId); + try { + Map refund = Refund.query(refundParams, wechatAppId2); + System.out.println("支付id:" + paymentId + ", 退款信息:" + JSON.toJSONString(refund)); + System.out.println(); + } catch (BaseAdaPayException e) { + throw new RuntimeException(e); + } + } + } + + /** + * 查询支付撤销信息 + */ + @Test + public void queryPaymentReverseTest() { + List list = getPaymentIdList(); // 查询支付撤销信息 + for (String paymentId : list) { + try { + Map reverse = Maps.newHashMap(); + reverse.put("payment_id", paymentId); + reverse.put("app_id", wechatAppId2); + Map response = PaymentReverse.queryList(reverse, wechatAppId2); + System.out.printf("支付id: %s, 支付撤销信息: %s%n", paymentId, JSON.toJSONString(response)); + System.out.println(); + } catch (BaseAdaPayException e) { + throw new RuntimeException(e); + } + } + } + + /** + * 延迟分账未确认调撤销调撤销接口退款/部分退 + */ + @Test + public void createPaymentReverseRequestTest() { + String paymentId = "002212024102215301510694702317666226176"; + BigDecimal refundAmount = new BigDecimal("15.42"); + String memberId = "42833137"; + String orderCode = "C21960272918"; + + // 延迟分账未确认调撤销调撤销接口退款 + PaymentReverseOperation operation = new PaymentReverseOperation(); + operation.setPaymentId(paymentId); + operation.setReverseAmt(refundAmount); + operation.setMerchantKey(wechatAppId1); + operation.setMemberId(memberId); + operation.setScenarioType(ScenarioEnum.ORDER.getValue()); + operation.setOrderCode(orderCode); + PaymentReverseResponse response = adapayService.createPaymentReverseRequest(operation); + System.out.println(JSON.toJSONString(response)); + } + + @Test + public void createBalancePaymentRequestTest() { + String outMemberId = "ACM42875164"; // 出账memberId + String inMemberId = "0"; // 入账memberId + String transAmt = "798.20"; // 金额 + String title = "提取余额到自己账户"; // 标题 + String desc = "2024年7月31日08点55分,售后需求:客户重新添加结算账户, 原账户余额无法提取, 由现下打款给客户"; // 描述 + String wechatAppId = wechatAppId1; // 万车充id + adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId); + } + + /** + * + */ + @Test + public void createBalancePaymentRequestTest2() { + String outMemberId = "0"; // 出账memberId + String inMemberId = "ACM25158725"; // 入账memberId + String transAmt = "42.7"; // 金额 + String title = "订单金额补分账"; // 标题 + String desc = "补C69401257710,C86364369573结算金额"; // 描述 + String wechatAppId = wechatAppId1; // 万车充id + adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId); + } +} From fc16d5edfd02b6e52b71dfede10699746fd42f8b Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 17:36:51 +0800 Subject: [PATCH 13/33] =?UTF-8?q?=E6=8F=90=E4=BA=A4PaymentTestController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsowell-admin/src/test/java/PaymentTestController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jsowell-admin/src/test/java/PaymentTestController.java b/jsowell-admin/src/test/java/PaymentTestController.java index 1cd9fd0c5..18ef182dd 100644 --- a/jsowell-admin/src/test/java/PaymentTestController.java +++ b/jsowell-admin/src/test/java/PaymentTestController.java @@ -33,6 +33,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +/** + * 专用处理汇付支付相关 + */ @ActiveProfiles("pre") @SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @RunWith(SpringRunner.class) From b74aeb7c4d01a76a2d850f475cf70e6d0b65730f Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 18:35:55 +0800 Subject: [PATCH 14/33] =?UTF-8?q?=E6=8F=90=E4=BA=A4PaymentTestController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/PaymentTestController.java | 164 +++ jsowell-admin/src/test/resources/payment_ids | 1121 ++--------------- 2 files changed, 241 insertions(+), 1044 deletions(-) diff --git a/jsowell-admin/src/test/java/PaymentTestController.java b/jsowell-admin/src/test/java/PaymentTestController.java index 18ef182dd..c63029ab1 100644 --- a/jsowell-admin/src/test/java/PaymentTestController.java +++ b/jsowell-admin/src/test/java/PaymentTestController.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import com.huifu.adapay.core.exception.BaseAdaPayException; import com.huifu.adapay.model.PaymentReverse; import com.huifu.adapay.model.Refund; @@ -81,6 +82,169 @@ public class PaymentTestController { return list; } + public static void main(String[] args) { + List list1 = Lists.newArrayList( + "C84866578627", + "C69407733440", + "C46698893183", + "C23481086913", + "C46631353044", + "C82315862441", + "C48515444163", + "C88894523461", + "C63539142496", + "C88227376749", + "C69808468000", + "C29756635462", + "C48171513017", + "C82929694510", + "C42286214889", + "C40531240168", + "C42818195903", + "C44772182853", + "C63995701102", + "C84653836282", + "C82929004110", + "C42248888826", + "C42871512014", + "C61630741271", + "C44120948533", + "C86510728306", + "C23698728789", + "C40725164803", + "C46426468297", + "C80876734677", + "C65208404269", + "C48131292456", + "C27264263390", + "C42620874381", + "C27264478506", + "C82758563554", + "C44588350706", + "C86153980315", + "C86782182478", + "C42077527679", + "C80606430852", + "C21377880382", + "C63590496985", + "C25745398205", + "C63136978056", + "C21983806615", + "C42016184953", + "C27458903931", + "C40590975531", + "C44987731257", + "C63554143992", + "C46468609277", + "C23483139052", + "C67759764676", + "C65286550984", + "C44772583755", + "C65037735356", + "C23065540340", + "C82330428460", + "C40136408323", + "C65896968515", + "C80093965053", + "C23029064125", + "C46291260090", + "C40915419435", + "C69234709266", + "C61064626771", + "C84216893653", + "C69869670458", + "C44755242724", + "C63706872923", + "C61047783388", + "C80663278468", + "C46232390797", + "C44561702210", + "C61404525849", + "C80813608253" + ); + List list2 = Lists.newArrayList( + "C69407733440", + "C84866578627", + "C46698893183", + "C46631353044", + "C23481086913", + "C88894523461", + "C48515444163", + "C82315862441", + "C48171513017", + "C29756635462", + "C69808468000", + "C88227376749", + "C63539142496", + "C42818195903", + "C40531240168", + "C42286214889", + "C82929694510", + "C63995701102", + "C44772182853", + "C84653836282", + "C42871512014", + "C42248888826", + "C82929004110", + "C44120948533", + "C61630741271", + "C23698728789", + "C86510728306", + "C80876734677", + "C46426468297", + "C40725164803", + "C48131292456", + "C65208404269", + "C82758563554", + "C27264263390", + "C27264478506", + "C42620874381", + "C25745398205", + "C86153980315", + "C63590496985", + "C21377880382", + "C80606430852", + "C44588350706", + "C42077527679", + "C86782182478", + "C40590975531", + "C27458903931", + "C42016184953", + "C21983806615", + "C63136978056", + "C44772583755", + "C46468609277", + "C65286550984", + "C63554143992", + "C67759764676", + "C44987731257", + "C23483139052", + "C23065540340", + "C65037735356", + "C80093965053", + "C65896968515", + "C82330428460", + "C40136408323", + "C23029064125", + "C63706872923", + "C40915419435", + "C44755242724", + "C69869670458", + "C84216893653", + "C61064626771", + "C69234709266", + "C46291260090", + "C80813608253", + "C61404525849", + "C61047783388", + "C44561702210", + "C46232390797", + "C80663278468"); + Sets.SetView difference = Sets.intersection(Sets.newHashSet(list1), Sets.newHashSet(list2)); + System.out.println(difference); + + } + /** * 查询分账信息 * @throws BaseAdaPayException diff --git a/jsowell-admin/src/test/resources/payment_ids b/jsowell-admin/src/test/resources/payment_ids index 830968d23..343d39fa0 100644 --- a/jsowell-admin/src/test/resources/payment_ids +++ b/jsowell-admin/src/test/resources/payment_ids @@ -1,1044 +1,77 @@ -002212024080104094610664815265025318912 -002212024080105103710664830576223019008 -002212024080108001210664873255346294784 -002212024080108412010664883605782069248 -002212024080109525010664901597116350464 -002212024080110275510664910426482388992 -002212024080111083110664920645352226816 -002212024080111235510664924521971265536 -002212024080112000910664933640326447104 -002212024080112013810664934014549938176 -002212024080112143010664937250031849472 -002212024080112150810664937409924030464 -002212024080112301710664941222257934336 -002212024080112455010664945135876505600 -002212024080113542210664962383167336448 -002212024080114212610664969194190352384 -002212024080114343110664972488951562240 -002212024080114505410664976609326358528 -002212024080114560610664977917021642752 -002212024080115161610664982992343715840 -002212024080115352410664987809193373696 -002212024080115443810664990132963819520 -002212024080115460810664990511769780224 -002212024080115502210664991574988107776 -002212024080115551310664992795539759104 -002212024080116170310664998291486662656 -002212024080116263510665000688016941056 -002212024080116340510665002577152114688 -002212024080116521410665007142716227584 -002212024080116555310665008063851102208 -002212024080117021810665009678799724544 -002212024080117542410665022790376800256 -002212024080118112610665027074774646784 -002212024080118114410665027150580506624 -002212024080118193810665029138942640128 -002212024080118390810665034045501202432 -002212024080118473310665036165738332160 -002212024080119061010665040848014925824 -002212024080119151510665043137811931136 -002212024080120433910665065380672110592 -002212024080120590410665069262617935872 -002212024080121443110665080698558414848 -002212024080121473910665081489074274304 -002212024080123253010665106112446324736 -002212024080200253310665121224583512064 -002212024080202251410665151344785674240 -002212024080203385610665169893484838912 -002212024080209293710665258143690620928 -002212024080209585410665265515150540800 -002212024080210143810665269471420989440 -002212024080210211210665271124075139072 -002212024080210233610665271731604127744 -002212024080210345810665274589423579136 -002212024080211333210665289328886554624 -002212024080212193410665300914728271872 -002212024080212372010665305386619699200 -002212024080213004610665311281768816640 -002212024080213220210665316634561327104 -002212024080214022710665326804091977728 -002212024080214050010665327445220704256 -002212024080214114610665329150380466176 -002212024080214151510665330026138558464 -002212024080214223110665331854134456320 -002212024080214283010665333361139892224 -002212024080214350610665335020519403520 -002212024080214512110665339113114664960 -002212024080215034410665342228779352064 -002212024080215093910665343715997868032 -002212024080215203110665346449251418112 -002212024080215341110665349888488620032 -002212024080215390810665351134304501760 -002212024080216102710665359016776105984 -002212024080216155910665360410954555392 -002212024080216201310665361475100934144 -002212024080216321310665364496530735104 -002212024080216454410665367898734931968 -002212024080216492010665368802691506176 -002212024080217063510665373144279515136 -002212024080217155110665375477394800640 -002212024080217433010665382435747999744 -002212024080217484410665383750525509632 -002212024080218032710665387454144643072 -002212024080218115610665389589846679552 -002212024080218141110665390154025123840 -002212024080218142310665390207798005760 -002212024080218392510665396504942182400 -002212024080218535710665400161620713472 -002212024080218571810665401007111888896 -002212024080219060910665403231725412352 -002212024080219495310665414241440620544 -002212024080220015110665417250660626432 -002212024080220135810665420301967785984 -002212024080220403710665427005615878144 -002212024080220441510665427920991772672 -002212024080221294010665439350487449600 -002212024080221581110665446529006485504 -002212024080222064310665448676009566208 -002212024080303041710665523558944550912 -002212024080308162710665602119980527616 -002212024080309092510665615448547901440 -002212024080309125710665616336617680896 -002212024080309314610665621074962292736 -002212024080309524710665626361571672064 -002212024080310180810665632743369220096 -002212024080310331610665636552024899584 -002212024080310422210665638841287114752 -002212024080311412910665653716406099968 -002212024080312043510665659529736433664 -002212024080312090510665660664467632128 -002212024080312105210665661111254614016 -002212024080312540410665671981626941440 -002212024080313212910665678885270970368 -002212024080313445410665684776936914944 -002212024080313580610665688098869530624 -002212024080314020010665689080487960576 -002212024080314035010665689542944063488 -002212024080314161910665692684595167232 -002212024080314215410665694089347170304 -002212024080314274510665695559727546368 -002212024080314341610665697201267867648 -002212024080314542410665702267058569216 -002212024080315521610665716828467486720 -002212024080315540210665717274259410944 -002212024080316553910665732779360903168 -002212024080317055910665735379597578240 -002212024080317185310665738628437835776 -002212024080317190510665738676627824640 -002212024080317315910665741922796404736 -002212024080317395910665743938544152576 -002212024080318075610665750969054625792 -002212024080318163110665753131443675136 -002212024080318322610665757138359910400 -002212024080318531910665762393684410368 -002212024080319115810665767083973533696 -002212024080319454610665775589695664128 -002212024080320440510665790267765477376 -002212024080320470710665791029984878592 -002212024080321452510665805703280443392 -002212024080321560210665808372814237696 -002212024080400562810665853780193828864 -002212024080401033610665855576057847808 -002212024080401282610665861825640976384 -002212024080401365510665863961000984576 -002212024080402241810665875886119329792 -002212024080405202110665920190800904192 -002212024080406172310665934542809194496 -002212024080408054310665961806835986432 -002212024080408224910665966108853133312 -002212024080408565410665974688557498368 -002212024080409131910665978819158409216 -002212024080410071210665992379048329216 -002212024080410214610665996042642862080 -002212024080411165110666009905000726528 -002212024080411333610666014120597749760 -002212024080411351010666014513695154176 -002212024080411492710666018109418471424 -002212024080411535710666019244328812544 -002212024080412042810666021889539579904 -002212024080412065410666022503438868480 -002212024080412312210666028657940836352 -002212024080412422810666031451671896064 -002212024080412543910666034517279965184 -002212024080414385910666060772805148672 -002212024080415292810666073477954600960 -002212024080416023210666081799051096064 -002212024080416214210666086623131140096 -002212024080416564310666095435551789056 -002212024080417261710666102875463548928 -002212024080417283010666103435180834816 -002212024080417312710666104175659241472 -002212024080417322410666104416193675264 -002212024080417355710666105308291383296 -002212024080417523310666109488152805376 -002212024080417553510666110251735826432 -002212024080417595710666111350671343616 -002212024080418094310666113805454901248 -002212024080418375110666120887968387072 -002212024080419043310666127608176623616 -002212024080419045310666127690422730752 -002212024080419203010666131618770108416 -002212024080422071110666173567684235264 -002212024080422564010666186019733950464 -002212024080423021510666187427632578560 -002212024080423501610666199510433640448 -002212024080501521810666230221972885504 -002212024080502031310666232967372144640 -002212024080504283910666269567132291072 -002212024080506023210666293192582201344 -002212024080508185010666327494886621184 -002212024080509495110666350401487732736 -002212024080509590310666352716702015488 -002212024080510165910666357227676741632 -002212024080510353910666361925253685248 -002212024080511000510666368075780771840 -002212024080511042310666369155222953984 -002212024080511442110666379213052690432 -002212024080512190810666387966120542208 -002212024080512483610666395384411258880 -002212024080512581110666397796035907584 -002212024080513161810666402354884763648 -002212024080513415510666408802698604544 -002212024080513495310666410807329751040 -002212024080514051110666414658317418496 -002212024080514254810666419844345085952 -002212024080514354710666422356600356864 -002212024080514410810666423704668844032 -002212024080514520110666426444328304640 -002212024080515063310666430098074730496 -002212024080515171310666432784269246464 -002212024080515272410666435347695280128 -002212024080515443210666439657584275456 -002212024080516030410666444322064154624 -002212024080516311810666451427728740352 -002212024080516452310666454973769179136 -002212024080518111710666476591483043840 -002212024080518315310666481772834009088 -002212024080519393010666498792096538624 -002212024080519432210666499763158761472 -002212024080520112810666506833171263488 -002212024080520285610666511231835537408 -002212024080601094010666581877453086720 -002212024080602203810666599740264636416 -002212024080604170410666629038563590144 -002212024080604230710666630561827094528 -002212024080605020810666640383466254336 -002212024080605374310666649337389744128 -002212024080609305010666708001655980032 -002212024080610080210666717361663574016 -002212024080610361410666724462076633088 -002212024080611430110666741265966772224 -002212024080611494310666742953381396480 -002212024080611502910666743147056185344 -002212024080613130210666763919736418304 -002212024080613222510666766280198832128 -002212024080613403210666770839141449728 -002212024080613482910666772841372155904 -002212024080614243010666781907290341376 -002212024080614501310666788376784363520 -002212024080614552310666789677732454400 -002212024080614595110666790801674461184 -002212024080615055810666792341081653248 -002212024080615061810666792426223288320 -002212024080615260310666797393876856832 -002212024080615474210666802844591116288 -002212024080615514010666803839777820672 -002212024080616045310666807167221940224 -002212024080616501310666818575674490880 -002212024080616550610666819803656159232 -002212024080617201910666826151189204992 -002212024080617234810666827028332535808 -002212024080617361710666830171178229760 -002212024080618352710666845060948230144 -002212024080619192110666856105608839168 -002212024080619395710666861291127971840 -002212024080621254010666887897211416576 -002212024080621335810666889982712139776 -002212024080621401110666891550591401984 -002212024080622534110666910044120395776 -002212024080623570210666925989803442176 -002212024080702201810666962041185697792 -002212024080705102610667004858573111296 -002212024080708482810667059727228710912 -002212024080709163110667066785783570432 -002212024080712271810667114799679852544 -002212024080712291110667115274827386880 -002212024080713013110667123411014918144 -002212024080713165710667127294088642560 -002212024080713261610667129636883451904 -002212024080713303510667130724762370048 -002212024080713393510667132989553704960 -002212024080713451510667134417240772608 -002212024080714032810667139000873353216 -002212024080714261910667144749458710528 -002212024080715182910667157878802071552 -002212024080715340410667161801787498496 -002212024080715434010667164217245532160 -002212024080715523810667166471036428288 -002212024080716304310667176058931437568 -002212024080717040410667184450251874304 -002212024080718210610667203837482881024 -002212024080720250510667235036944498688 -002212024080720322910667236898726047744 -002212024080723012010667274358363840512 -002212024080802491010667331693869387776 -002212024080808025410667410649889955840 -002212024080808313010667417845853294592 -002212024080808552810667423875851563008 -002212024080809015510667425500338515968 -002212024080809502910667437722733961216 -002212024080810262410667446763367489536 -002212024080811365810667464519517155328 -002212024080811412810667465654613368832 -002212024080811502310667467898144014336 -002212024080811563810667469470052999168 -002212024080812231010667476146765791232 -002212024080812275910667477358762876928 -002212024080812421810667480963001974784 -002212024080812565010667484619310989312 -002212024080813095010667487889055383553 -002212024080813263710667492115130281984 -002212024080813440310667496501861101568 -002212024080813565110667499721584472064 -002212024080814212110667505888473559040 -002212024080814253410667506951025258496 -002212024080814310610667508343907201024 -002212024080814420210667511094261551104 -002212024080814422710667511200335499264 -002212024080814553710667514510159310848 -002212024080815174210667520070443917312 -002212024080815215210667521118453686272 -002212024080815575310667530182065242112 -002212024080816361110667539818737401856 -002212024080816392610667540640173481984 -002212024080816402010667540866507444224 -002212024080817232510667551708565417984 -002212024080818022410667561519670743040 -002212024080818304110667568634427662336 -002212024080818570010667575258180939776 -002212024080819401210667586128558919680 -002212024080819452510667587442633781248 -002212024080820043710667592275754024960 -002212024080820163610667595289149239296 -002212024080820545110667604915368607744 -002212024080823193110667641324547137536 -002212024080902265810667688495754608640 -002212024080902545510667695527764221952 -002212024080904433010667722854777577472 -002212024080906582610667756810848907264 -002212024080909350010667796213585264640 -002212024080909533210667800876103827456 -002212024080910491710667814906090459136 -002212024080911162910667821755296964608 -002212024080911325910667825907358851072 -002212024080911490910667829975219933184 -002212024080911492310667830031538630656 -002212024080911541410667831255008997376 -002212024080911541910667831272344358912 -002212024080911575810667832190995361792 -002212024080912191810667837562428182528 -002212024080912403310667842909818531840 -002212024080912483110667844915238862848 -002212024080913041710667848881661919232 -002212024080913193810667852743959310336 -002212024080913194610667852778505338880 -002212024080913233310667853731039076352 -002212024080913252610667854203618709504 -002212024080913293010667855228746952704 -002212024080913303510667855499504332800 -002212024080913330410667856124862476288 -002212024080913455510667859361428115456 -002212024080914041110667863954462027776 -002212024080914120310667865935332343808 -002212024080914265810667869688310587392 -002212024080915011110667878299966828544 -002212024080915020610667878529691353088 -002212024080915110910667880810630729728 -002212024080915231910667883870716223488 -002212024080915374810667887515553468416 -002212024080916065410667894840477585408 -002212024080916243610667899294173818880 -002212024080917021310667908759541485568 -002212024080917280410667915266046656512 -002212024080917283610667915401071017984 -002212024080917385710667918006131720192 -002212024080917470410667920045979938816 -002212024080918222110667928925300948992 -002212024080918551010667937183354175488 -002212024080918571410667937704577425408 -002212024080919052510667939763110641664 -002212024080919320910667946492542816256 -002212024080919380410667947979253055488 -002212024080919571110667952790359359488 -002212024080920243610667959692482433024 -002212024080920365310667962781373755392 -002212024080920492810667965947836694528 -002212024080921011610667968920285057024 -002212024080921340810667977190263140352 -002212024080921480910667980716171522048 -002212024080921594510667983637971963904 -002212024081003250910668065525961035776 -002212024081004284310668081521272745984 -002212024081007255010668126096408772608 -002212024081007421110668130209682800640 -002212024081009242710668155945002586112 -002212024081009535910668163379845230592 -002212024081009562610668163995149627392 -002212024081010294210668172367766401024 -002212024081010302410668172545372782592 -002212024081011061310668181558174273536 -002212024081011531010668193374540759040 -002212024081012004310668195271155879936 -002212024081012221210668200678343688192 -002212024081012382710668204769365819392 -002212024081012442210668206257195286528 -002212024081012585610668209922465161216 -002212024081013022810668210811524972544 -002212024081013043610668211348372258816 -002212024081013180610668214745624281088 -002212024081013490810668222557000945664 -002212024081013522610668223387001257984 -002212024081014051710668226620649472000 -002212024081014401010668235398563090432 -002212024081014445310668236585786880000 -002212024081015205710668245665027809280 -002212024081015262210668247026286145536 -002212024081015343410668249088980770816 -002212024081016092910668257876277051392 -002212024081016352010668264380398759936 -002212024081016355310668264522415837184 -002212024081017045110668271812546367488 -002212024081018200010668290720659501056 -002212024081018351810668294573772038144 -002212024081019000410668300807672520704 -002212024081019045810668302037707624448 -002212024081019132210668304154714529792 -002212024081019201110668305868646723584 -002212024081019204710668306020817670144 -002212024081019361510668309912280481792 -002212024081021330710668339322446741504 -002212024081022193210668351004296056832 -002212024081022351210668354947799175168 -002212024081101193910668396332717015040 -002212024081102412710668416914698129408 -002212024081106130810668470186784559104 -002212024081106203910668472078862450688 -002212024081106301110668474481311801344 -002212024081106363810668476102712287232 -002212024081106401610668477014926921728 -002212024081106423110668477583490232320 -002212024081106442310668478052458737664 -002212024081107164910668486215759532032 -002212024081108500110668509670922878976 -002212024081109212610668517576490848256 -002212024081109292110668519566018437120 -002212024081109412910668522622886260736 -002212024081109443310668523394556727296 -002212024081111274510668549365485891584 -002212024081111334610668550878459658240 -002212024081112033710668558388659838976 -002212024081113052110668573925315239936 -002212024081113071410668574398197501952 -002212024081113222610668578225461514240 -002212024081113443610668583802839855104 -002212024081113560710668586703196356608 -002212024081114190810668592493691334656 -002212024081115003510668602926779916288 -002212024081115050310668604048988532736 -002212024081115402010668612929247043584 -002212024081115421310668613402110525440 -002212024081115575010668617333729103872 -002212024081116212310668623257915211776 -002212024081116491910668630287262388224 -002212024081117085710668635232123019264 -002212024081117125010668636208560254976 -002212024081117321710668641102336331776 -002212024081117380010668642541875351552 -002212024081117473410668644946984013824 -002212024081118131810668651426396594176 -002212024081118363010668657263781728256 -002212024081118394810668658095298359296 -002212024081118452810668659520506023936 -002212024081119082110668665276622090240 -002212024081119200710668668237850988544 -002212024081119243310668669356159909888 -002212024081119392410668673093475094528 -002212024081120191210668683108023894016 -002212024081120333310668686720689156096 -002212024081120405310668688565791424512 -002212024081120470810668690136223801344 -002212024081121050110668694639610257408 -002212024081122010410668708745313226752 -002212024081122305010668716232835510272 -002212024081201200010668758805243990016 -002212024081202215310668774382098280448 -002212024081208110710668862266700558336 -002212024081208150810668863277108269056 -002212024081209482710668886761105874944 -002212024081209593210668889552820727808 -002212024081210522110668902844377042944 -002212024081211380510668914353231159296 -002212024081211592510668919720750583808 -002212024081212053810668921285809127424 -002212024081212284910668927120206299136 -002212024081213215310668940474241875968 -002212024081213271410668941820800184320 -002212024081213400210668945043156484096 -002212024081213420810668945571223011328 -002212024081213484510668947234078560256 -002212024081213495710668947539752484864 -002212024081213511610668947870276620288 -002212024081214304110668957787465302016 -002212024081214412510668960490947174400 -002212024081214560110668964164608651264 -002212024081215152710668969053223452672 -002212024081215422010668975821578362880 -002212024081216003010668980392123666432 -002212024081216232610668986164098035712 -002212024081217154710668999339711328256 -002212024081217155310668999364178984960 -002212024081217172110668999729857097728 -002212024081217182510669000000175796224 -002212024081217231110669001200040882176 -002212024081217414810669005885425758208 -002212024081218031310669011274895028224 -002212024081218225310669016223554588672 -002212024081218532410669023904177946624 -002212024081219004410669025749778104320 -002212024081219162910669029714316288000 -002212024081219202210669030689491619840 -002212024081219465610669037376271118336 -002212024081219590510669040433235062784 -002212024081220173510669045087873622016 -002212024081220245510669046933137043456 -002212024081220315510669048697127088128 -002212024081222471510669082755191070720 -002212024081223021510669086529090314240 -002212024081223194310669090924252422144 -002212024081300011110669101358962618368 -002212024081300283310669108246639210496 -002212024081304494410669173974388150272 -002212024081309045810669238209035751424 -002212024081309231910669242825882324992 -002212024081310512610669265002396504064 -002212024081310543010669265772634935296 -002212024081311145110669270895572258816 -002212024081311210710669272468786442240 -002212024081311412410669277575118962688 -002212024081312035610669283245977210880 -002212024081312500710669294867963011072 -002212024081312532010669295679427547136 -002212024081313251910669303726297677824 -002212024081313280310669304414745755648 -002212024081313484410669309621279457280 -002212024081314301910669320082529017856 -002212024081314365710669321754465243136 -002212024081314394010669322435989311488 -002212024081315140110669331082623934464 -002212024081315250510669333866354139136 -002212024081315350610669336386869723136 -002212024081316310110669350461496569856 -002212024081316340510669351230767198208 -002212024081316520710669355769381613568 -002212024081316592910669357625566134272 -002212024081317073710669359668385873920 -002212024081317563010669371972120571904 -002212024081317590810669372634905796608 -002212024081318000910669372890114785280 -002212024081318060610669374387898667008 -002212024081318072110669374702887038976 -002212024081318283910669380064224833536 -002212024081318303210669380538628018176 -002212024081318384210669382593199681536 -002212024081318500710669385465488834560 -002212024081318544810669386643735937024 -002212024081319015610669388439426117632 -002212024081319254510669394431360077824 -002212024081320030010669403805627920384 -002212024081320121610669406138784477184 -002212024081320402010669413203991183360 -002212024081320453610669414529683107840 -002212024081321035310669419129812385792 -002212024081321385510669427945539342336 -002212024081323114910669451323022946304 -002212024081401193510669483477956886528 -002212024081406324710669562298277916672 -002212024081408104510669586950488297472 -002212024081408161110669588320069562368 -002212024081409371010669608699237597184 -002212024081410311610669622313806528512 -002212024081410424110669625188332834816 -002212024081411330510669637870372433920 -002212024081411422710669640228558962688 -002212024081411582410669644241326923776 -002212024081412113210669647545528659968 -002212024081412573910669659150237511680 -002212024081413190010669664526980464640 -002212024081413332410669668147474530304 -002212024081414030410669675614206222336 -002212024081414312410669682745420255232 -002212024081416311710669712916524740608 -002212024081416361310669714155138805760 -002212024081417473010669732096660062208 -002212024081417482010669732306207469568 -002212024081418035210669736212799012864 -002212024081418222210669740870588751872 -002212024081419303210669758023860576256 -002212024081419385510669760132881149952 -002212024081419475810669762412710256640 -002212024081420435110669776476881670144 -002212024081508223210669952304580325376 -002212024081508411710669957024677801984 -002212024081508595610669961717060415488 -002212024081509512210669974661518946304 -002212024081510000510669976855456108544 -002212024081511442010670003090716856320 -002212024081511453310670003395982098432 -002212024081511485610670004245062676480 -002212024081511495310670004487397629952 -002212024081511561010670006065033469952 -002212024081512421610670017668468015104 -002212024081513082210670024236038287360 -002212024081514194610670042206877372416 -002212024081515010410670052600021368832 -002212024081515130010670055603639595008 -002212024081515135110670055816771518464 -002212024081515181110670056908062523392 -002212024081516102610670070055734435840 -002212024081516190110670072213811466240 -002212024081516375310670076962279493632 -002212024081517123210670085683821469696 -002212024081517204410670087747150905344 -002212024081517343010670091209521037312 -002212024081517424410670093281946861568 -002212024081517512410670095464969601024 -002212024081518201710670102732796424192 -002212024081518230910670103453287510016 -002212024081519083810670114902681006080 -002212024081519191510670117571079892992 -002212024081519222410670118365992497152 -002212024081519533010670126191930699776 -002212024081520005810670128072351383552 -002212024081521024910670143634692751360 -002212024081521232210670148806412189696 -002212024081606421610670289458420629504 -002212024081607233610670299860747747328 -002212024081607284610670301162578063360 -002212024081611145210670358059802755072 -002212024081612151510670373258689343488 -002212024081612163710670373602760683520 -002212024081612444310670380674516631552 -002212024081613114710670387483918303232 -002212024081613224010670390222652768256 -002212024081613232710670390422058135552 -002212024081613265410670391286923100160 -002212024081614030810670400408841039872 -002212024081614171810670403974289260544 -002212024081614451410670411002042331136 -002212024081614541310670413263479857152 -002212024081615091810670417059379793920 -002212024081615504810670427503509209088 -002212024081616000310670429830685749248 -002212024081616254310670436287820431360 -002212024081616331810670438198463225856 -002212024081617054210670446353451757568 -002212024081617362810670454096099192832 -002212024081618175910670464541565333504 -002212024081618224810670465753762729984 -002212024081619363110670484304710307840 -002212024081619374810670484629554376704 -002212024081619491710670487520081969152 -002212024081621312510670513220540116992 -002212024081622391810670530306019516416 -002212024081623080410670537544067362816 -002212024081623204910670540751059386368 -002212024081623294810670543014356156416 -002212024081623345110670544283342045184 -002212024081623410110670545835678818304 -002212024081700004110670550786296610816 -002212024081700193210670555530503225344 -002212024081701154210670569664637136896 -002212024081701452210670577131407900672 -002212024081705245210670632370572455936 -002212024081707022410670656915062304768 -002212024081707232810670662216224575488 -002212024081708134610670674875522842624 -002212024081708454210670682908471037952 -002212024081708524810670684696098582528 -002212024081708574410670685939688206336 -002212024081709573710670701010011525120 -002212024081710020610670702137511440384 -002212024081710043710670702771950792704 -002212024081710111110670704424149176320 -002212024081710193810670706547442909184 -002212024081710354410670710600123461632 -002212024081711430010670727528745099264 -002212024081712043010670732937986666496 -002212024081712062310670733413971451904 -002212024081712163110670735962120073216 -002212024081712292510670739212199903232 -002212024081712313910670739773035089920 -002212024081712431710670742700643942400 -002212024081712543110670745526908981248 -002212024081712553910670745813882077184 -002212024081713051510670748226926501889 -002212024081713133010670750304825217024 -002212024081713162910670751054592040960 -002212024081713182610670751547673346048 -002212024081713252110670753286818336768 -002212024081713341010670755505180889088 -002212024081713341510670755528136372224 -002212024081713452110670758318427287552 -002212024081714124410670765208906596352 -002212024081714142410670765629614182400 -002212024081714353210670770950699597824 -002212024081714412810670772442311520256 -002212024081714530610670775367974432768 -002212024081715082010670779202615443456 -002212024081715104310670779803706707968 -002212024081715181110670781679974715392 -002212024081715243510670783291413147648 -002212024081715275510670784132059086848 -002212024081715295210670784623635922944 -002212024081715384710670786865738121216 -002212024081715533610670790594973499392 -002212024081716255610670798730817789952 -002212024081716292210670799597804306432 -002212024081717131010670810619147026432 -002212024081717175010670811792625602561 -002212024081718065210670824131347931136 -002212024081718151210670826229141659648 -002212024081718294410670829887559421952 -002212024081718505710670835224647741440 -002212024081719100510670840042880208896 -002212024081719243910670843708845162496 -002212024081720084110670854788960337920 -002212024081720340910670861199140286464 -002212024081721322610670875863739887616 -002212024081723012710670898266643222528 -002212024081801513510670941080610115584 -002212024081801564510670942383308603392 -002212024081802063610670944862099570688 -002212024081802480110670955285536927744 -002212024081804102510670976019943227392 -002212024081808081910671035889879711744 -002212024081808420910671044403943538688 -002212024081809114110671051836242358272 -002212024081810060310671065517019222016 -002212024081810383410671073703166447616 -002212024081812063210671095841585819648 -002212024081812233110671100113163743232 -002212024081812444810671105469440823296 -002212024081812493710671106680195502080 -002212024081812590810671109078119677952 -002212024081813320210671117354777509888 -002212024081813441910671120447598325760 -002212024081813492810671121744806211584 -002212024081813544610671123077190443008 -002212024081814052210671125746774294528 -002212024081814233910671130345882615808 -002212024081814261410671130997240160256 -002212024081814343010671133075381010432 -002212024081814393610671134360525778944 -002212024081814451610671135784379559936 -002212024081814481910671136552465436672 -002212024081814580110671138996187942912 -002212024081815111610671142328609595392 -002212024081815251610671145854508658688 -002212024081816461410671166226547458048 -002212024081816472310671166519652069376 -002212024081817101810671172284259303424 -002212024081817183210671174357431713792 -002212024081817270610671176513073283072 -002212024081817335610671178231838904320 -002212024081818020210671185305787813888 -002212024081818123410671187953762271232 -002212024081818152510671188672878931968 -002212024081818294510671192279494135808 -002212024081819070910671201692962902016 -002212024081819333010671208320330203136 -002212024081819374810671209405623537664 -002212024081820030510671215768414121984 -002212024081821244510671236317307383808 -002212024081821245110671236343876665344 -002212024081822243410671251374234071040 -002212024081823443010671271488453197824 -002212024081900300110671282944504090624 -002212024081900322510671283547138785280 -002212024081900353510671284342715695104 -002212024081908071610671398014695862272 -002212024081910351710671435264874196992 -002212024081910435810671437447325216768 -002212024081911134710671444952040456192 -002212024081911234610671447465929969664 -002212024081911422910671452173836312576 -002212024081912283210671463762054709248 -002212024081912341810671465214669840384 -002212024081912401810671466723921199104 -002212024081913101210671474250156957696 -002212024081913143310671475343957110784 -002212024081913382210671481339695427584 -002212024081913430610671482528406011904 -002212024081913535310671485243749629952 -002212024081914084010671488962858418176 -002212024081914284110671494000782462976 -002212024081914333610671495236560715776 -002212024081914491110671499159554084864 -002212024081915052110671503229866070016 -002212024081915190910671506701626585088 -002212024081915432710671512816254922752 -002212024081915535310671515443889909760 -002212024081915561110671516020583284736 -002212024081915582010671516560687464448 -002212024081915585010671516689658871808 -002212024081916095810671519487463620608 -002212024081916110210671519757666185216 -002212024081916242910671523141173350400 -002212024081916253210671523405305806848 -002212024081916321210671525085665267712 -002212024081916544010671530738913497088 -002212024081916544910671530776842924032 -002212024081917052010671533421342871552 -002212024081917071510671533905566588928 -002212024081917101310671534650161573888 -002212024081917174010671536526824927232 -002212024081918051610671548504739590144 -002212024081918124110671550371453263872 -002212024081918233410671553111992156160 -002212024081918531810671560592468795392 -002212024081919070910671564077964431360 -002212024081919363010671571465918189568 -002212024081919580510671576895895228416 -002212024081920204010671582579936653312 -002212024081921355510671601515843481600 -002212024081921492210671604903077593088 -002212024082000155510671641784572391424 -002212024082002042910671669103782625280 -002212024082005095010671715749411278848 -002212024082005125310671716517647024128 -002212024082007122810671746609782808576 -002212024082009145410671777421578567680 -002212024082009350610671782504368631808 -002212024082010105110671791500769984512 -002212024082011204410671809090011627520 -002212024082011513710671816860424941568 -002212024082012274110671825936938500096 -002212024082012305610671826753827995648 -002212024082013034510671835014838063104 -002212024082013080010671836083545538560 -002212024082013185810671838844615458816 -002212024082013250410671840379576897536 -002212024082013372610671843490339581952 -002212024082013472210671845988735479808 -002212024082014134310671852622924857344 -002212024082014213610671854606627581952 -002212024082014220810671854739446132736 -002212024082014302010671856804941180928 -002212024082015110810671867073230655488 -002212024082015361410671873389891215360 -002212024082016160510671883418297761792 -002212024082016564010671893629760368640 -002212024082017241110671900553977122816 -002212024082018112910671912456319991808 -002212024082018491410671921959431426048 -002212024082019420910671935276813180928 -002212024082020204710671944996808146944 -002212024082020453810671951253023461376 -002212024082021402910671965056562167808 -002212024082101552110672029192848789504 -002212024082108503810672133702554841088 -002212024082110424010672161897670701056 -002212024082110581810672165830275600384 -002212024082111252910672172670472392704 -002212024082111513010672179219942838272 -002212024082111534110672179768360669184 -002212024082112182410672185990444310528 -002212024082113011010672196750814072832 -002212024082113064210672198142855315456 -002212024082114463010672223261089652736 -002212024082115543210672240383268028416 -002212024082116230610672247568475684864 -002212024082116265710672248537489575936 -002212024082116403910672251986384465920 -002212024082118420910672282565320085504 -002212024082118455210672283500100423680 -002212024082119092210672289412814966784 -002212024082119162310672291178815512576 -002212024082120552410672316096606732288 -002212024082122500510672344958887321600 -002212024082200585710672377389260042240 -002212024082202510710672405615587459072 -002212024082205351910672446936411246592 -002212024082208533510672496834867458048 -002212024082210172510672517929806159872 -002212024082211272710672535553908244480 -002212024082211312810672536566183849984 -002212024082211442510672539826464141312 -002212024082211470610672540498856861696 -002212024082214095410672576437038002176 -002212024082214370510672583276149288960 -002212024082214484610672586218227466240 -002212024082215202110672594164802748416 -002212024082215272210672595933436641280 -002212024082215451110672600417142669312 -002212024082216280410672611206149758976 -002212024082216364910672613410956029952 -002212024082217035210672620216928231424 -002212024082217140410672622786121273344 -002212024082217384110672628979766226944 -002212024082218140710672637894658736128 -002212024082218172010672638706703069184 -002212024082218185410672639101888479232 -002212024082219000610672649467777835008 -002212024082219092310672651804319625216 -002212024082219500610672662051264106496 -002212024082219542010672663117900476416 -002212024082220200210672669582861623296 -002212024082221083110672681787368058880 -002212024082221491410672692032247402496 -002212024082221491810672692048205242368 -002212024082222014410672695179089600512 -002212024082222221210672700328977989632 -002212024082302061010672756690242592768 -002212024082306523410672828764729208832 -002212024082307400110672840706617573376 -002212024082308141410672849317102714880 -002212024082310002410672876034359148544 -002212024082310552010672889860714725376 -002212024082311011910672891365742403584 -002212024082311291710672898406521044992 -002212024082312140910672909693823279104 -002212024082312235910672912171441684480 -002212024082312392510672916054826123264 -002212024082312560210672920235689496576 -002212024082312564810672920427732496384 -002212024082313182410672925865470164992 -002212024082313280910672928317283708928 -002212024082313345810672930032807694336 -002212024082313524310672934502337179648 -002212024082313574010672935747361566720 -002212024082314272610672943237681926144 -002212024082314302510672943986406293504 -002212024082314400110672946403230912512 -002212024082314565010672950636291325952 -002212024082315004010672951602831183872 -002212024082315095810672953941008613376 -002212024082315431310672962309234581504 -002212024082315524710672964718359044096 -002212024082316030110672967293662433280 -002212024082316264110672973249648877568 -002212024082316343610672975240594628608 -002212024082316432010672977436093485056 -002212024082317442710672992816477413376 -002212024082318134310673000181658460160 -002212024082318413010673007174334128128 -002212024082319052610673013198796447744 -002212024082319055010673013300145442816 -002212024082320581010673041569572753408 -002212024082321202710673047175370285056 -002212024082321382710673051705302958080 -002212024082322111110673059943912607744 -002212024082322264010673063841947017216 -002212024082323320710673080310533017600 -002212024082400353310673096275145089024 -002212024082400503810673100071304785920 -002212024082401401710673112567752982528 -002212024082401511010673115303009865728 -002212024082413515310673296679484608512 -002212024082414155110673302708300042240 -002212024082416040410673329942928683008 -002212024082416114410673331874325983232 -002212024082416380710673338513939283968 -002212024082419015110673374686272724992 -002212024082419122910673377362454638592 -002212024082419333210673382657427894272 -002212024082419504510673386989792894976 -002212024082419554210673388234616307712 -002212024082419562710673388426954383360 -002212024082420005810673389559933214720 -002212024082420400710673399413550739456 -002212024082420590510673404187180625920 -002212024082420590610673404193299980288 -002212024082421342210673413067494739968 -002212024082421473210673416378948079616 -002212024082421530810673417788495532032 -002212024082422580210673434120149753856 -002212024082423402010673444766392119296 -002212024082423432010673445520792313856 -002212024082500073910673451641854316544 -002212024082502064410673481610618073088 -002212024082508242410673576653049843712 -002212024082510272710673607618244165632 -002212024082510405010673610987399979008 -002212024082511242610673621957903351808 -002212024082511363210673625003889086464 -002212024082512263610673637606588174336 -002212024082512584710673645705491402752 -002212024082513084310673648203606282240 -002212024082514002710673661222501347328 -002212024082514102110673663712101486592 -002212024082514370510673670443307401216 -002212024082515352910673685140192751616 -002212024082515595810673691300906516480 -002212024082516264710673698050618392576 -002212024082516324010673699530720710656 -002212024082516365510673700598930702336 -002212024082517113910673709339983069185 -002212024082517233110673712325576269824 -002212024082517392810673716341527932928 -002212024082518170910673725825269415936 -002212024082518551810673735423010889728 -002212024082600153310673816018736926720 -002212024082605381910673897244331900928 -002212024082605415510673898149860573184 -002212024082606102310673905314032476160 -002212024082607510610673930660142759936 -002212024082608481710673945051812904960 -002212024082608534710673946436701364224 -002212024082609452910673959444868059136 -002212024082609595210673963063890243584 -002212024082610463510673974821784559616 -002212024082611112210673981060432130048 -002212024082611404110673988436719788032 -002212024082612405510674003596039454720 -002212024082612551710674007210526019584 -002212024082613032510674009259126050816 -002212024082614230710674029313849925632 -002212024082614534310674037015166107648 -002212024082615140710674042149753622528 -002212024082616372310674063105348894720 -002212024082617023510674069447236616192 -002212024082617251910674075167328477184 -002212024082617494710674081326091563008 -002212024082617504410674081561622700032 -002212024082619191810674103853341696000 -002212024082619212010674104361557123072 -002212024082620351410674122962621988865 -002212024082620481210674126222785073152 -002212024082621051610674130518827122688 -002212024082621290610674136515282489344 -002212024082622492810674156743246835712 -002212024082707184110674284890709516288 -002212024082709270610674317207794384896 -002212024082710150310674329274870157312 -002212024082712593810674370692674244608 -002212024082713584810674385582413537280 -002212024082715511210674413871156817920 -002212024082716444310674427339473506304 -002212024082717031910674432019516190720 -002212024082717340610674439763553964032 -002212024082717493810674443676340224000 -002212024082718101210674448850159964160 -002212024082719560710674475505674186752 -002212024082721441610674502721719586816 -002212024082807361910674651715794391040 -002212024082814415510674758822426083328 -002212024082815403010674773565165707264 -002212024082820220410674844423546826752 -002212024082820373810674848342790750208 -002212024082821222510674859611067080704 -002212024082822163210674873228287123456 -002212024082900035210674900239143178240 -002212024082900352410674908175986638848 -002212024082911563910675079619899662336 -002212024082913390310675105388980727808 \ No newline at end of file +002212024090914192210679101803152797696 +002212024090914333310679105371582320640 +002212024091009514410679396837268226048 +002212024091115233610679842742632013824 +002212024091117122610679870130970525696 +002212024091209591810680123515480293376 +002212024091210151610680127534423285760 +002212024091212065710680155642674528256 +002212024091309354310680479969644072960 +002212024091311125410680504425742057472 +002212024091313394910680541399592423424 +002212024091313560510680545493976383488 +002212024091316232410680582568617385984 +002212024091412373610680888129932328960 +002212024091414505710680921688965812224 +002212024091415461310680935597961334784 +002212024091421432810681025500458135552 +002212024091509541710681209418854203392 +002212024091515502310681299034555170816 +002212024091609063010681559781566349312 +002212024091710295110681943146169663488 +002212024091714040610681997062227054592 +002212024091714342710682004701600428032 +002212024091810350210682306834994466816 +002212024091814443010682369616134971392 +002212024091911104110682678197676363776 +002212024091915323410682744102824857600 +002212024092009535710683021275046903808 +002212024092013044210683069278250184704 +002212024092013404310683078340267429888 +002212024092115555810683474764473192448 +002212024092116071310683477595072380928 +002212024092212562210683791954410979328 +002212024092216530010683851507236323328 +002212024092218314510683876359749668864 +002212024092218322310683876516924137472 +002212024092306572310684064001316204544 +002212024092310471510684121850121662464 +002212024092311022310684125658272116736 +002212024092312371410684149526990827520 +002212024092313041410684156325092540416 +002212024092313133110684158659137589248 +002212024092314532410684183796668342272 +002212024092316270810684207386386440192 +002212024092408453310684453612216483840 +002212024092412541810684516213190705152 +002212024092413084710684519858243252224 +002212024092416002510684563050650763264 +002212024092417193310684582964149587968 +002212024092500102310684686355347783680 +002212024092509585810684834476088717312 +002212024092513241810684886147877879808 +002212024092514363210684904328798638080 +002212024092516071710684927166924124160 +002212024092518523710684968773814677504 +002212024092519544910684984424548884480 +002212024092614013110685257902825074688 +002212024092616390710685297564188864512 +002212024092711304110685582333862608896 +002212024092713260410685611368844570624 +002212024092713511410685617704500146176 +002212024092716153510685654031453437952 +002212024092820034810686073851451183104 +002212024092907005910686239234404093952 +002212024092909590010686284033765195776 +002212024092911200510686304441224900608 +002212024092911440610686310484299726848 +002212024092913003610686329734903009280 +002212024092914011910686345016510754816 +002212024092914013110686345065220521984 +002212024092916191010686379707636027392 +002212024093006552810686600233475682304 +002212024093012394910686686893417926656 +002212024093013551710686705887160655872 +002212024093016184710686742000076718080 +002212024093016193010686742178873982976 +002212024093020113510686800585400750080 \ No newline at end of file From 970a46b3b4a676ac51f4fc78c2ac7af2292b1c86 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 8 Nov 2024 19:11:33 +0800 Subject: [PATCH 15/33] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/SpringBootTestController.java | 69 ------------------- .../service/impl/MemberGroupServiceImpl.java | 2 + 2 files changed, 2 insertions(+), 69 deletions(-) diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 76e30fd89..e1f1015fb 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -529,75 +529,6 @@ public class SpringBootTestController { } - @Test - public void testDiscount() { - OrderBasicInfo orderBasicInfo = new OrderBasicInfo(); - orderBasicInfo.setMemberId("12345678"); - orderBasicInfo.setMerchantId("1"); - orderBasicInfo.setStationId("19"); - orderBasicInfo.setPayAmount(new BigDecimal("200")); - - OrderDetail orderDetail = new OrderDetail(); - orderDetail.setTotalElectricityAmount(new BigDecimal("3")); - orderDetail.setTotalServiceAmount(new BigDecimal("0.18")); - - - String memberId = orderBasicInfo.getMemberId(); // 会员id - String merchantId = orderBasicInfo.getMerchantId(); // 运营商id - String stationId = orderBasicInfo.getStationId(); // 站点id - - // 电费折扣金额 - BigDecimal discountElectricityAmount = BigDecimal.ZERO; - // 服务费折扣金额 - BigDecimal discountServiceAmount = BigDecimal.ZERO; - - BigDecimal afterServiceAmountDiscount = BigDecimal.ZERO; - BigDecimal afterElectricityAmountDiscount = BigDecimal.ZERO; - - // 查询会员在此站点会员折扣 - MemberDiscountVO memberDiscountVO = memberGroupService.queryMemberDiscount(merchantId, stationId, memberId); - if (memberDiscountVO != null) { - BigDecimal discount = memberDiscountVO.getDiscount(); // 折扣率 - String groupType = memberDiscountVO.getGroupType(); // 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣) - BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount(); // 电费 - BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount(); // 服务费 - - afterServiceAmountDiscount = totalServiceAmount; - afterElectricityAmountDiscount = totalElectricityAmount; - if (Constants.ONE.equals(groupType)) { - afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN); - discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount); - } else if (Constants.TWO.equals(groupType)) { - afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN); - discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount); - } else { - // BigDecimal afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(2, RoundingMode.DOWN); - // discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount); - // BigDecimal afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(2, RoundingMode.DOWN); - // discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount); - afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN); - afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN); - - discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount); - discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount); - } - } - // 订单折扣金额 - BigDecimal discountAmount = discountServiceAmount.add(discountElectricityAmount); - orderBasicInfo.setDiscountAmount(discountAmount); - // 更新退款金额 = 退款金额 - 折扣金额 - // BigDecimal refundAmount = orderBasicInfo.getRefundAmount().subtract(discountAmount); - - // 总消费金额 = 折扣后电费 + 折扣后服务费 - BigDecimal totalConsumeAmount = afterServiceAmountDiscount.add(afterElectricityAmountDiscount); - // 更新退款金额 - BigDecimal refundAmount = orderBasicInfo.getPayAmount().subtract(totalConsumeAmount).setScale(2, RoundingMode.DOWN); - orderBasicInfo.setRefundAmount(refundAmount); - - orderDetail.setDiscountElectricityAmount(discountElectricityAmount); - orderDetail.setDiscountServiceAmount(discountServiceAmount); - } - @Test public void queryPaymentByOrderNoTest() { String orderNo = "C88850447008_20240415083226"; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberGroupServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberGroupServiceImpl.java index d1f2aa20a..4960bb139 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberGroupServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberGroupServiceImpl.java @@ -189,6 +189,7 @@ public class MemberGroupServiceImpl implements MemberGroupService { return MemberDiscountVO; } + @Override public MemberDiscountVO queryMemberDiscountV2(String merchantId, String stationId, String memberId) { String groupCode = memberGroupMapper.queryMemberGroupCode(merchantId, stationId, memberId); if (StringUtils.isBlank(groupCode)) { @@ -205,6 +206,7 @@ public class MemberGroupServiceImpl implements MemberGroupService { .groupCode(groupCode) .billingTemplateVO(billingTemplate) .build(); + log.info("查询会员:{}, 在运营商:{}, 下面站点:{}, 折扣信息:{}", memberId, merchantId, stationId, memberDiscountVOBuilder); return memberDiscountVOBuilder; } From a9fa8dc01aecc17d1a425e99b26de8892de33ee6 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 11 Nov 2024 10:41:33 +0800 Subject: [PATCH 16/33] =?UTF-8?q?update=20=20=E7=94=98=E8=82=83=E7=9C=81?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/thirdparty/GanSuController.java | 117 ++++++++++++++++ .../platform/common/ChargeOrderInfo.java | 25 ++++ .../impl/GanSuPlatformServiceImpl.java | 125 ++++++++++++++++++ .../platform/util/HttpRequestUtil.java | 2 +- 4 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GanSuController.java diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GanSuController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GanSuController.java new file mode 100644 index 000000000..bfeb7cc38 --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GanSuController.java @@ -0,0 +1,117 @@ +package com.jsowell.api.thirdparty; + +import com.alibaba.fastjson2.JSON; +import com.jsowell.common.annotation.Anonymous; +import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum; +import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.thirdparty.CommonParamsDTO; +import com.jsowell.thirdparty.lianlian.common.CommonResult; +import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * 甘肃省平台Controller + * + * @author Lemon + * @Date 2024/11/9 13:22:05 + */ +@Anonymous +@RestController +@RequestMapping("/gansu") +public class GanSuController extends ThirdPartyBaseController{ + private final String platformName = "甘肃省平台"; + + @Autowired + @Qualifier("ganSuPlatformServiceImpl") + private ThirdPartyPlatformService platformLogic; + + /** + * getToken + */ + @PostMapping("/v1/query_token") + public CommonResult queryToken(@RequestBody CommonParamsDTO dto) { + // logger.info("{}-请求令牌 params:{}", platformName, JSON.toJSONString(dto)); + try { + Map map = platformLogic.queryToken(dto); + logger.info("{}-请求令牌, params:{}, result:{}", platformName, JSON.toJSONString(dto), JSON.toJSONString(map)); + return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("{}-获取token接口, 异常, params:{}", platformName, JSON.toJSONString(dto), e); + return CommonResult.failed("获取token发生异常"); + } + } + + /** + * 查询充电站信息 + * query_stations_info + */ + @PostMapping("/v1/query_stations_info") + public CommonResult query_stations_info(HttpServletRequest request, @RequestBody CommonParamsDTO dto) { + logger.info("{}-查询充电站信息 params:{}", platformName, JSON.toJSONString(dto)); + try { + // 校验令牌 + if (!verifyToken(request.getHeader("Authorization"))) { + // 校验失败 + return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR); + } + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryStationsInfo(queryStationInfoDTO); + + return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.info("{}-查询充电站信息 error:", platformName, e); + } + return CommonResult.failed("查询充电站信息发生异常"); + } + + /** + * 查询充电站状态信息 + * query_station_status + */ + @PostMapping("/v1/query_station_status") + public CommonResult queryStationStatus(HttpServletRequest request, @RequestBody CommonParamsDTO dto) { + logger.info("{}-查询充电站状态信息 params:{}", platformName, JSON.toJSONString(dto)); + try { + // 校验令牌 + if (!verifyToken(request.getHeader("Authorization"))) { + // 校验失败 + return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR); + } + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryStationStatus(queryStationInfoDTO); + + return CommonResult.success(0, "查询充电站状态信息成功!", map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("{}-查询充电站状态信息 error:", platformName, e); + } + return CommonResult.failed("查询充电站状态信息发生异常"); + } +} diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/ChargeOrderInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/ChargeOrderInfo.java index dd9fbca92..9d7dcd74c 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/ChargeOrderInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/common/ChargeOrderInfo.java @@ -1,12 +1,14 @@ package com.jsowell.thirdparty.platform.common; import com.alibaba.fastjson2.annotation.JSONField; +import com.jsowell.thirdparty.platform.domain.SupChargeDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; +import java.util.List; /** * 充电订单明细 @@ -188,4 +190,27 @@ public class ChargeOrderInfo { @JSONField(name = "EndMeterNum") private BigDecimal endMeterNum; + + /** + * 电表起值 + */ + @JSONField(name = "MeterNumStart") + private BigDecimal meterNumStart; + + /** + * 电表停止值 + */ + @JSONField(name = "MeterNumEnd") + private BigDecimal meterNumEnd; + + /** + * 充电明细信息列表 + * ChargeDetails + * 详见充电明细信息(SupChargeDetails) + * 否 + * SupChargeDetails数组 + */ + @JSONField(name = "ChargeDetails") + private List chargeDetails; + } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java index 223a7a0bd..409f5ed05 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GanSuPlatformServiceImpl.java @@ -3,10 +3,12 @@ package com.jsowell.thirdparty.platform.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageInfo; +import com.google.common.collect.Lists; import com.jsowell.common.constant.Constants; import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.common.enums.ykc.BillingTimeTypeEnum; import com.jsowell.common.enums.ykc.OrderStatusEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; @@ -15,6 +17,7 @@ import com.jsowell.common.util.JWTUtils; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.OrderBasicInfo; +import com.jsowell.pile.domain.OrderDetail; import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.service.*; import com.jsowell.pile.thirdparty.CommonParamsDTO; @@ -23,10 +26,13 @@ import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.pile.vo.base.ConnectorInfoVO; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; +import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO; import com.jsowell.pile.vo.web.PileConnectorInfoVO; import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo; import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo; import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO; +import com.jsowell.thirdparty.platform.common.ChargeOrderInfo; +import com.jsowell.thirdparty.platform.domain.SupChargeDetails; import com.jsowell.thirdparty.platform.domain.SupEquipChargeStatusInfo; import com.jsowell.thirdparty.platform.domain.SupStationInfo; import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; @@ -37,6 +43,7 @@ import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.*; @@ -49,6 +56,7 @@ import java.util.stream.Collectors; * @author Lemon * @Date 2024/11/5 13:31:06 */ +@Service public class GanSuPlatformServiceImpl implements ThirdPartyPlatformService { @Autowired @@ -69,6 +77,9 @@ public class GanSuPlatformServiceImpl implements ThirdPartyPlatformService { @Autowired private PileStationInfoService pileStationInfoService; + @Autowired + private PileBillingTemplateService pileBillingTemplateService; + @Autowired private RedisCache redisCache; @@ -361,6 +372,120 @@ public class GanSuPlatformServiceImpl implements ThirdPartyPlatformService { } + /** + * 推送充电订单数据 + * @param orderCode + * @param secretInfoVO + * @return + */ + @Override + public String notificationChargeOrderInfo(String orderCode, ThirdPartySecretInfoVO secretInfoVO) { + // 根据订单号查询出信息 + OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); + if (orderBasicInfo == null) { + return null; + } + + String operatorId = Constants.OPERATORID_JIANG_SU; + String operatorSecret = secretInfoVO.getTheirOperatorSecret(); + String signSecret = secretInfoVO.getTheirSigSecret(); + String dataSecret = secretInfoVO.getTheirDataSecret(); + String dataSecretIv = secretInfoVO.getTheirDataSecretIv(); + String urlAddress = secretInfoVO.getTheirUrlPrefix(); + + // 推送地址 + String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_CHARGE_ORDER_INFO.getValue(); + + // 根据订单号查询订单详情 + OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode); + if (orderDetail == null) { + return null; + } + + ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder() + .startChargeSeq(orderCode) + .connectorId(orderBasicInfo.getPileConnectorCode()) + .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime())) + .endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime())) + .totalPower(orderDetail.getTotalUsedElectricity()) + .totalElecMoney(orderDetail.getTotalElectricityAmount()) + .totalSeviceMoney(orderDetail.getTotalServiceAmount()) + .totalMoney(orderDetail.getTotalOrderAmount()) + .stopReason(2) + .meterNumStart(BigDecimal.ZERO) + .meterNumEnd(BigDecimal.ZERO) + + .build(); + List billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); + // 先将list按照 尖、峰、平、谷 时段排序 + // List collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList()); + // 再循环该list,拼装对应的充电价格、费率 + List chargeDetails = transformSupChargeDetails(orderDetail, billingList); + chargeOrderInfo.setChargeDetails(chargeDetails); + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + if (StringUtils.isBlank(token)) { + return null; + } + // 调用联联平台接口 + String jsonString = JSON.toJSONString(chargeOrderInfo); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; + } + + /** + * 转换时段充电明细 + * @param orderDetail + * @param billingList + * @return + */ + private List transformSupChargeDetails(OrderDetail orderDetail, List billingList) { + List resultList = Lists.newArrayList(); + SupChargeDetails detail; + for (BillingPriceVO billingPriceVO : billingList) { + detail = new SupChargeDetails(); + if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.SHARP.getValue())) { + // 尖时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getSharpUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getSharpElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.PEAK.getValue())) { + // 峰时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getPeakUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getPeakElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.FLAT.getValue())) { + // 平时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getFlatUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getFlatElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.VALLEY.getValue())) { + // 谷时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getValleyUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getValleyElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getValleyServicePrice()); + } + resultList.add(detail); + } + return resultList; + } /** * 获取甘肃平台密钥 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/HttpRequestUtil.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/HttpRequestUtil.java index 77e82d23c..72e684331 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/HttpRequestUtil.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/HttpRequestUtil.java @@ -156,7 +156,7 @@ public class HttpRequestUtil { String hutoolRequest = HttpRequest.post(url).header("Authorization", "Bearer " + token).body(postData).execute().body(); - log.info("发送请求 接收到返回数据:{}", hutoolRequest); + log.info(label + "发送请求 接收到返回数据:{}", hutoolRequest); if (StringUtils.isBlank(hutoolRequest)) { return "返回数据为空"; From 312f05ed3b742fd612245676e7a48c3fdfc6c668 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 11 Nov 2024 10:42:41 +0800 Subject: [PATCH 17/33] =?UTF-8?q?bugfix=20=20=E5=AE=81=E6=B3=A2=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0query=5Fstation=5Fstatus=E5=88=86=E9=A1=B5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/SpringBootTestController.java | 14 ++++++++++++++ .../impl/ZhongDianLianPlatformServiceImpl.java | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index e1f1015fb..eea75b1d7 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -76,6 +76,7 @@ import com.jsowell.thirdparty.common.NotificationService; import com.jsowell.thirdparty.huawei.HuaWeiService; import com.jsowell.thirdparty.lianlian.service.LianLianService; import com.jsowell.thirdparty.lutongyunting.service.LTYTService; +import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.util.Cryptos; import com.jsowell.thirdparty.platform.util.Encodes; import com.jsowell.thirdparty.platform.util.GBSignUtils; @@ -91,6 +92,7 @@ import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @@ -268,6 +270,18 @@ public class SpringBootTestController { @Autowired private CarCouponRecordService carCouponRecordService; + @Autowired + @Qualifier("zhongDianLianPlatformServiceImpl") + private ThirdPartyPlatformService platformLogic; + + @Test + public void queryStationStatus() { + QueryStationInfoDTO dto = new QueryStationInfoDTO(); + dto.setStationIds(Lists.newArrayList("19")); + Map map = platformLogic.queryStationStatus(dto); + System.out.println(map); + } + @Test public void batchSelectConnectorList() { ArrayList stationIds = Lists.newArrayList("19", "2", "14"); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java index 888f7b47b..9aa2cc150 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java @@ -449,19 +449,19 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi StationStatusInfos.add(stationStatusInfo); } // 将 StationStatusInfos 分页 - int pageNum = 1; - int pageSize = 10; - List collect = StationStatusInfos.stream() - .skip((pageNum - 1) * pageSize) - .limit(pageSize) - .collect(Collectors.toList()); + // int pageNum = 1; + // int pageSize = 10; + // List collect = StationStatusInfos.stream() + // .skip((pageNum - 1) * pageSize) + // .limit(pageSize) + // .collect(Collectors.toList()); int total = StationStatusInfos.size(); - int pages = PageUtil.totalPage(total, pageSize); + // int pages = PageUtil.totalPage(total, pageSize); Map map = new LinkedHashMap<>(); map.put("Total", total); - map.put("StationStatusInfos", collect); + map.put("StationStatusInfos", StationStatusInfos); return ThirdPartyPlatformUtils.generateResultMap(map, ningBoSecretInfoVO); } From ffeac149a27c272c0f476248b796e5716eec46af Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Mon, 11 Nov 2024 11:23:21 +0800 Subject: [PATCH 18/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/impl/NeiMengGuPlatformServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index c2ee1c796..f1048c005 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -234,7 +234,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { SupStationInfo stationInfo = new SupStationInfo(); String stationId = String.valueOf(pileStationInfo.getId()); stationInfo.setStationID(stationId); - stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 + stationInfo.setOperatorID(Constants.JSOWELL_OPERATORID); // 组织机构代码 String organizationCode = pileStationInfo.getOrganizationCode(); String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); stationInfo.setEquipmentOwnerID(equipmentOwnerId); @@ -426,7 +426,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { if (pileMerchantInfoVO == null) { continue; } - String operatorID = Constants.OPERATORID_JIANG_SU; + String operatorID = Constants.JSOWELL_OPERATORID; String organizationCode = pileMerchantInfoVO.getOrganizationCode(); String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); SupStationStatusInfo stationStatusInfo = new SupStationStatusInfo(); From a1f7b51aedb476f8239c651c3720cc70f997f51c Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 12 Nov 2024 10:07:24 +0800 Subject: [PATCH 19/33] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jsowell/common/constant/Constants.java | 1 + .../platform/service/ThirdPartyPlatformService.java | 12 ++++++++++++ .../service/impl/NeiMengGuPlatformServiceImpl.java | 1 + 3 files changed, 14 insertions(+) diff --git a/jsowell-common/src/main/java/com/jsowell/common/constant/Constants.java b/jsowell-common/src/main/java/com/jsowell/common/constant/Constants.java index e0236ff4a..60936558a 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/constant/Constants.java +++ b/jsowell-common/src/main/java/com/jsowell/common/constant/Constants.java @@ -91,6 +91,7 @@ public class Constants { // 对接第三方平台,我方OPERATORID public static final String JSOWELL_OPERATORID = "MA1JLFUU8"; + public static final String JSOWELL_OPERATORUSCID = "91310118MA1JLFUU81"; public static final String OPERATORID_LIANLIAN = "MA1JLFUU8"; public static final String OPERATORID_JIANG_SU = "MA1X78KH5"; diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java index 3bb383ec7..9e1eb30f9 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java @@ -4,6 +4,7 @@ import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson2.JSON; import com.google.common.collect.Maps; +import com.jsowell.common.constant.Constants; import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.JWTUtils; import com.jsowell.common.util.StringUtils; @@ -14,6 +15,7 @@ import com.jsowell.pile.thirdparty.CommonParamsDTO; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO; import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO; +import com.jsowell.thirdparty.platform.domain.SupOperatorInfo; import com.jsowell.thirdparty.platform.dto.QueryOrderDTO; import com.jsowell.thirdparty.platform.util.Cryptos; import com.jsowell.thirdparty.platform.util.Encodes; @@ -37,6 +39,16 @@ public interface ThirdPartyPlatformService extends InitializingBean { throw new UnsupportedOperationException("This method is not yet implemented"); } + default SupOperatorInfo getJsowellOperatorInfo() { + SupOperatorInfo operatorInfo = new SupOperatorInfo(); + operatorInfo.setOperatorID(Constants.JSOWELL_OPERATORID); + operatorInfo.setOperatorUSCID(Constants.JSOWELL_OPERATORUSCID); + operatorInfo.setOperatorName("万车充运营管理平台"); + operatorInfo.setOperatorTel1("4001602660"); + operatorInfo.setOperatorRegAddress("上海市青浦区华新镇华隆路1777号6幢D座2层205室"); + return operatorInfo; + } + /** * query_token 获取token,提供给第三方平台使用 * @param dto diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java index f1048c005..e87b74af9 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/NeiMengGuPlatformServiceImpl.java @@ -174,6 +174,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { List merchantList = thirdPartyStationRelationService.selectMerchantList(thirdPlatformType); PageInfo pageInfo = new PageInfo<>(merchantList); List operatorInfos = Lists.newArrayList(); + operatorInfos.add(getJsowellOperatorInfo()); if (CollectionUtils.isNotEmpty(pageInfo.getList())) { SupOperatorInfo supOperatorInfo; for (MerchantInfoVO merchantInfoVO : pageInfo.getList()) { From 93077b174e147c8cc5120fe749c01a1ed2ace972 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 12 Nov 2024 11:07:05 +0800 Subject: [PATCH 20/33] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=93=E7=AE=97=E9=87=91=E9=A2=9D=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/domain/SettleOrderReport.java | 5 ++ .../impl/SettleOrderReportServiceImpl.java | 2 +- .../pile/vo/web/SettleOrderReportVO.java | 6 ++- .../mapper/pile/SettleOrderReportMapper.xml | 50 +++++++++++++++++-- 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/SettleOrderReport.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/SettleOrderReport.java index ad601c80f..9c6a281b1 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/SettleOrderReport.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/SettleOrderReport.java @@ -75,6 +75,11 @@ public class SettleOrderReport { */ private BigDecimal virtualAmount; + /** + * 结算金额 + */ + private BigDecimal settleAmount; + /** * 交易日期 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/SettleOrderReportServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/SettleOrderReportServiceImpl.java index 1c93918e6..5140db1f3 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/SettleOrderReportServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/SettleOrderReportServiceImpl.java @@ -1,6 +1,5 @@ package com.jsowell.pile.service.impl; -import com.alibaba.fastjson2.JSON; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.base.Joiner; @@ -693,6 +692,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService { settleOrderReport.setServiceAmount(totalServiceAmount); settleOrderReport.setTotalAmount(totalOrderAmount); settleOrderReport.setVirtualAmount(totalVirtualAmount); + settleOrderReport.setSettleAmount(totalSettleAmount); settleOrderReport.setTradeDate(tradeDate); settleOrderReport.setOrderCodes(Joiner.on(",").join(orderCodeList)); // 计算手续费 = 结算金额 * 0.55% diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/SettleOrderReportVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/SettleOrderReportVO.java index 2bcc4184f..7c4ad7d04 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/SettleOrderReportVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/SettleOrderReportVO.java @@ -1,6 +1,5 @@ package com.jsowell.pile.vo.web; -import com.jsowell.common.annotation.Excel; import lombok.Data; import java.math.BigDecimal; @@ -68,6 +67,11 @@ public class SettleOrderReportVO { */ private BigDecimal virtualAmount; + /** + * 结算金额 + */ + private BigDecimal settleAmount; + /** * 交易日期 */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/SettleOrderReportMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/SettleOrderReportMapper.xml index 5d2f3ca8a..f9b1505bc 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/SettleOrderReportMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/SettleOrderReportMapper.xml @@ -16,6 +16,7 @@ + @@ -26,7 +27,7 @@ id, settle_code, merchant_id, station_id, order_codes, use_electricity, charge_num, - charge_time, electricity_amount, service_amount, total_amount, virtual_amount, trade_date, + charge_time, electricity_amount, service_amount, total_amount, virtual_amount, settle_amount, trade_date, trade_amount, trade_fee, create_time, update_time, del_flag