diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GuangXiPlatformController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GuangXiPlatformController.java new file mode 100644 index 000000000..1ee992f9e --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/GuangXiPlatformController.java @@ -0,0 +1,193 @@ +package com.jsowell.api.thirdparty; + +import com.alibaba.fastjson2.JSON; +import com.jsowell.common.annotation.Anonymous; +import com.jsowell.common.core.controller.BaseController; +import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum; +import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.pile.dto.QueryStartChargeDTO; +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/12/26 9:06:33 + */ +@Anonymous +@RestController +@RequestMapping("/guangxi") +public class GuangXiPlatformController extends ThirdPartyBaseController { + private final String platformName = "广西平台"; + + private final String platformType = ThirdPlatformTypeEnum.GUANG_XI_PLATFORM.getTypeCode(); + + @Autowired + @Qualifier("guangXiPlatformServiceImpl") + 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(Integer.parseInt(map.get("Ret")), map.get("Msg"), 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); + } + dto.setPlatformType(platformType); + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryStationsInfo(queryStationInfoDTO); + + return CommonResult.success(Integer.parseInt(map.get("Ret")), map.get("Msg"), 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); + } + dto.setPlatformType(platformType); + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryStationStatus(queryStationInfoDTO); + + return CommonResult.success(Integer.parseInt(map.get("Ret")), map.get("Msg"), map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("{}-查询充电站状态信息 error:", platformName, e); + } + return CommonResult.failed("查询充电站状态信息发生异常"); + } + + /** + * 查询充电站统计信息 + * query_station_stats + */ + @PostMapping("/v1/query_station_stats") + public CommonResult queryStationStats(HttpServletRequest request, @RequestBody CommonParamsDTO dto) { + logger.info("{}-查询充电站统计信息 params:{}", platformName, JSON.toJSONString(dto)); + try { + // 校验令牌 + if (!verifyToken(request.getHeader("Authorization"))) { + // 校验失败 + return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR); + } + dto.setPlatformType(platformType); + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryStationStats(queryStationInfoDTO); + + return CommonResult.success(Integer.parseInt(map.get("Ret")), map.get("Msg"), map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("{}-查询充电站统计信息 error:", platformName, e); + } + return CommonResult.failed("查询充电站统计信息发生异常"); + } + + /** + * 查询已完成订单列表信息接口 + * query_finish_orders + */ + @PostMapping("/v1/query_finish_orders") + public CommonResult queryFinishOrders(HttpServletRequest request, @RequestBody CommonParamsDTO dto) { + logger.info("{}-查询已完成订单列表信息接口 params:{}", platformName, JSON.toJSONString(dto)); + try { + // 校验令牌 + if (!verifyToken(request.getHeader("Authorization"))) { + // 校验失败 + return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR); + } + dto.setPlatformType(platformType); + + // 校验签名 + if (!verifySignature(dto)) { + // 签名错误 + return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR); + } + + // 解析入参 + QueryStartChargeDTO queryStartChargeDTO = parseParamsDTO(dto, QueryStartChargeDTO.class); + + // 执行逻辑 + Map map = platformLogic.queryFinishOrders(queryStartChargeDTO); + + return CommonResult.success(Integer.parseInt(map.get("Ret")), map.get("Msg"), map.get("Data"), map.get("Sig")); + } catch (Exception e) { + logger.error("{}-查询已完成订单列表信息接口 error:", platformName, e); + } + return CommonResult.failed("查询已完成订单列表信息接口 error"); + } + +} 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 58fa26b5c..9a1b4099a 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java @@ -8,6 +8,7 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.huifu.adapay.core.exception.BaseAdaPayException; import com.jsowell.adapay.common.AdaPayment; +import com.jsowell.adapay.common.PaymentConfirmInfo; import com.jsowell.adapay.dto.QueryPaymentConfirmDTO; import com.jsowell.adapay.response.PaymentConfirmResponse; import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse; @@ -373,7 +374,7 @@ public class TempService { dto.setPaymentId(record.getPaymentId()); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null && CollectionUtils.isNotEmpty(response.getPaymentConfirms())) { - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) { + for (PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) { JSONObject jsonObject = JSON.parseObject(paymentConfirm.getDescription()); if (StringUtils.equals(jsonObject.getString("orderCode"), orderCode)) { // 订单号对的上,累计分账金额 @@ -414,7 +415,7 @@ public class TempService { .paymentId(paymentId) .build(); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(build); - List paymentConfirms = response.getPaymentConfirms(); + List paymentConfirms = response.getPaymentConfirms(); if (CollectionUtils.isEmpty(paymentConfirms)) { unClearingList.add(clearingBillVO); } else { @@ -476,10 +477,10 @@ public class TempService { if (response == null) { continue; } - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); if (CollectionUtils.isNotEmpty(confirms)) { // 已经分过账 - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { JSONObject jsonObject = JSON.parseObject(confirm.getDescription()); // 找到orderCode的分账记录 @@ -521,7 +522,7 @@ public class TempService { queryPaymentConfirmDTO.setPaymentId(paymentId); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(queryPaymentConfirmDTO); logger.info("校验未分账的支付单-支付id:{}, 查询到的分账信息:{}", paymentId, JSON.toJSONString(response)); - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); if (CollectionUtils.isEmpty(confirms)) { logger.info("校验未分账的支付单-支付id:{}没有进行过分账", paymentId); // 没有配置结算账户的,默认分到本商户 @@ -649,7 +650,7 @@ public class TempService { return Lists.newArrayList(); } - BigDecimal multiple = new BigDecimal("2"); + BigDecimal multiple = new BigDecimal("0.5"); // 查询订单主表数据 List orderBasicInfos = orderBasicInfoService.queryOrderList(orderCodeList); for (OrderBasicInfo orderBasicInfo : orderBasicInfos) { diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java index 437ea31b8..17ac1d700 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java @@ -54,9 +54,10 @@ public class OrderPileOccupyController extends BaseController { @PreAuthorize("@ss.hasPermi('pile:occupy:export')") @Log(title = "占桩订单", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, OrderPileOccupy orderPileOccupy) { - List list = orderPileOccupyService.selectOrderPileOccupyList(orderPileOccupy); - ExcelUtil util = new ExcelUtil(OrderPileOccupy.class); + public void export(HttpServletResponse response, OrderPileOccupyDTO dto) { + // List list = orderPileOccupyService.selectOrderPileOccupyList(orderPileOccupy); + List list = orderPileOccupyService.getOrderPileOccupyListWithAuth(dto); + ExcelUtil util = new ExcelUtil<>(OccupyOrderVO.class); util.exportExcel(response, list, "占桩订单数据"); } diff --git a/jsowell-admin/src/test/java/PaymentTestController.java b/jsowell-admin/src/test/java/PaymentTestController.java index 73eba5cae..d845f11ae 100644 --- a/jsowell-admin/src/test/java/PaymentTestController.java +++ b/jsowell-admin/src/test/java/PaymentTestController.java @@ -8,6 +8,7 @@ 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.common.PaymentConfirmInfo; import com.jsowell.adapay.dto.QueryConfirmReverseDTO; import com.jsowell.adapay.dto.QueryPaymentConfirmDTO; import com.jsowell.adapay.operation.PaymentReverseOperation; @@ -16,9 +17,11 @@ import com.jsowell.adapay.response.PaymentConfirmResponse; import com.jsowell.adapay.response.PaymentReverseResponse; import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse; import com.jsowell.adapay.service.AdapayService; +import com.jsowell.adapay.vo.OrderSplitResult; import com.jsowell.common.enums.ykc.ScenarioEnum; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.AdapayMemberAccount; +import com.jsowell.pile.service.OrderBasicInfoService; import org.apache.commons.collections4.CollectionUtils; import org.junit.Test; import org.junit.runner.RunWith; @@ -53,6 +56,9 @@ public class PaymentTestController { @Autowired private AdapayService adapayService; + @Autowired + private OrderBasicInfoService orderBasicInfoService; + public List getPaymentIdList() { List resultList = Lists.newArrayList(); // List paymentIdList1 = getPaymentIdList1(); @@ -305,12 +311,12 @@ public class PaymentTestController { // 查询分账信息 QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null) { - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); if (CollectionUtils.isEmpty(confirms)) { unSplitList.add(paymentId); } else { splitList.add(paymentId); - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { if (queryConfirmReverseStatus(confirm)) { System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。"); continue; @@ -344,7 +350,7 @@ public class PaymentTestController { * @return * @throws BaseAdaPayException */ - private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException { + private boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException { boolean result = false; QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder() .paymentConfirmId(confirm.getId()) @@ -372,10 +378,10 @@ public class PaymentTestController { dto.setWechatAppId(wechatAppId1); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null) { - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms)); if (CollectionUtils.isNotEmpty(confirms)) { - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { adapayService.createConfirmReverse(confirm.getId(), wechatAppId1); } } @@ -468,4 +474,29 @@ public class PaymentTestController { String wechatAppId = wechatAppId1; // 万车充id adapayService.createBalancePaymentRequest(outMemberId, inMemberId, transAmt, title, desc, wechatAppId); } + + /** + * 校验订单分账金额 + */ + @Test + public void verifyOrderConfirmAmountTest() throws BaseAdaPayException { + String orderCode = "C21960272918"; + List paymentIds = Lists.newArrayList("002212024121307453510713429549121368064"); + BigDecimal settleAmount = new BigDecimal("19.37"); + String wechatAppId = wechatAppId1; + OrderSplitResult orderSplitResult = orderBasicInfoService.verifyOrderConfirmAmount(paymentIds, orderCode, settleAmount, wechatAppId); + System.out.println(JSON.toJSONString(orderSplitResult)); + } + + @Test + public void queryPaymentConfirmDetailTest() throws BaseAdaPayException { + + // 查询支付确认id + QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO(); + dto.setPaymentId("002212024121307453510713429549121368064"); + dto.setWechatAppId(wechatAppId1); + // 查询分账信息 + QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); + System.out.println(JSON.toJSONString(response)); + } } diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 1e8dc93f5..507b53e47 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -18,6 +18,7 @@ import com.huifu.adapay.model.PaymentReverse; import com.huifu.adapay.model.Refund; import com.jsowell.JsowellApplication; import com.jsowell.adapay.common.DivMember; +import com.jsowell.adapay.common.PaymentConfirmInfo; import com.jsowell.adapay.config.AbstractAdapayConfig; import com.jsowell.adapay.dto.*; import com.jsowell.adapay.factory.AdapayConfigFactory; @@ -935,7 +936,7 @@ public class SpringBootTestController { dto.setWechatAppId(wechatAppId1); dto.setPaymentId("002212023122208033310584061601344237568"); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); - List paymentConfirms = response.getPaymentConfirms(); + List paymentConfirms = response.getPaymentConfirms(); // 如果没有分账信息,说明没有清分 String clearingStatus = null; if (org.springframework.util.CollectionUtils.isEmpty(paymentConfirms)) { @@ -1106,12 +1107,12 @@ public class SpringBootTestController { // 查询分账信息 QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null) { - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); if (CollectionUtils.isEmpty(confirms)) { unSplitList.add(paymentId); } else { splitList.add(paymentId); - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { if (queryConfirmReverseStatus(confirm)) { System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。"); continue; @@ -1139,7 +1140,7 @@ public class SpringBootTestController { System.out.println("=================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size()); } - private boolean queryConfirmReverseStatus(QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm) throws BaseAdaPayException { + private boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException { boolean result = false; QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder() @@ -1205,10 +1206,10 @@ public class SpringBootTestController { dto.setWechatAppId(wechatAppId1); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null) { - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); System.out.println("支付id:" + paymentId + ", 确认信息:" + JSON.toJSONString(confirms)); if (CollectionUtils.isNotEmpty(confirms)) { - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { adapayService.createConfirmReverse(confirm.getId(), wechatAppId1); } } 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 3981a9934..f90e4bb99 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 @@ -95,7 +95,7 @@ public class Constants { public static final String OPERATORID_LIANLIAN = "MA1JLFUU8"; public static final String OPERATORID_JIANG_SU = "MA1X78KH5"; - public static final String OPERATORID_GUI_ZHOU = "MAC9K4RRX"; + // public static final String OPERATORID_GUI_ZHOU = "MAC9K4RRX"; public static final String MANUFACTURER_NAME = "举视(江苏)新能源设备制造有限公司"; diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java index 52a330269..6766f7aa9 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPlatformTypeEnum.java @@ -28,6 +28,8 @@ public enum ThirdPlatformTypeEnum { GAN_SU_PLATFORM("17", "甘肃省平台", "MA01H3BQ9"), GUI_ZHOU_PLATFORM("18", "贵州省平台", "009390404"), NAN_RUI_PLATFORM("19", "南瑞平台", ""), + + GUANG_XI_PLATFORM("20", "广西平台", "450000000"), ; private String typeCode; diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/YKCChargingStopReasonEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/YKCChargingStopReasonEnum.java index 6a12ff8d8..5b06e9dfb 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/YKCChargingStopReasonEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/YKCChargingStopReasonEnum.java @@ -112,6 +112,24 @@ public enum YKCChargingStopReasonEnum { */ UNKNOWN_REASON_STOP_CHARGING(0x90, "未知原因停止"), + + /** + * 功率板故障 + */ + OUTPUT_UNDER_VOLTAGE(0x92, "功率板告警,输出欠压"), + OUTPUT_OVER_VOLTAGE(0x93, "功率板告警,输出过压故障"), + INPUT_OVER_VOLTAGE(0x94, "功率板告警,输入过压"), + INPUT_UNDER_VOLTAGE(0x95, "功率板告警,输入欠压"), + TRANSFORMER_OVER_TEMPERATURE(0x96, "功率板告警,变压器过温"), + A_OVER_CURRENT(0x97, "功率板告警,谐振A过流"), + B_OVER_CURRENT(0x98, "功率板告警,谐振B过流"), + OUTPUT_OVER_CURRENT(0x99, "功率板告警,输出过流"), + HARDWARE_OUTPUT_OVER_CURRENT(0x9A, "功率板告警,硬件输出过流"), + AB_OUTPUT_UNBALANCE(0x9B, "功率板告警,AB输出不平衡"), + LLC_PFC_COMMUNICATION_FAULT(0x9C, "功率板告警,LLC和PFC通信故障"), + LLC_MAIN_CONTROLLER_COMMUNICATION_FAULT(0x9D, "功率板告警,LLC和主控通信故障"), + OTHER_EIGHTY_G(0x9E, "预留"), + ; diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YkcProtocolDecoder.java b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YkcProtocolDecoder.java index b34136d2f..15dc980f0 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YkcProtocolDecoder.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YkcProtocolDecoder.java @@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import java.util.List; +@Deprecated @Slf4j public class YkcProtocolDecoder extends ByteToMessageDecoder { diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YouDianProtocolDecoder.java b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YouDianProtocolDecoder.java index c38ebef1f..c0e1f7422 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YouDianProtocolDecoder.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YouDianProtocolDecoder.java @@ -4,6 +4,7 @@ import com.jsowell.common.constant.Constants; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; import java.nio.charset.StandardCharsets; @@ -37,7 +38,7 @@ public class YouDianProtocolDecoder extends ByteToMessageDecoder { buffer.markReaderIndex(); // 判断是否为DNY包头或68包头 - if (isStartOfDnyHeader(buffer, beginReader) || isStartOf68Header(buffer, beginReader)) { + if (isStartOfDnyHeader(buffer, beginReader)) { break; // 读到了协议的开始标志,结束while循环 } @@ -60,13 +61,13 @@ public class YouDianProtocolDecoder extends ByteToMessageDecoder { } // 检查包头是否是 68 协议 - if (buffer.readableBytes() >= HEADER_LENGTH_68) { - if (buffer.getUnsignedByte(beginReader) == 0x68) { - // 处理 68 协议 - decode68Message(buffer, out, beginReader); - return; - } - } + // if (buffer.readableBytes() >= HEADER_LENGTH_68) { + // if (buffer.getUnsignedByte(beginReader) == 0x68) { + // // 处理 68 协议 + // decode68Message(buffer, out, beginReader); + // return; + // } + // } // 未知协议,还原读指针 buffer.resetReaderIndex(); @@ -84,58 +85,61 @@ public class YouDianProtocolDecoder extends ByteToMessageDecoder { } // 判断是否为68包头 - private boolean isStartOf68Header(ByteBuf buffer, int beginReader) { - if (buffer.readableBytes() >= HEADER_LENGTH_68) { - return buffer.getUnsignedByte(beginReader) == 0x68; - } - return false; - } + // private boolean isStartOf68Header(ByteBuf buffer, int beginReader) { + // if (buffer.readableBytes() >= HEADER_LENGTH_68) { + // return buffer.getUnsignedByte(beginReader) == 0x68; + // } + // return false; + // } // 处理68协议消息 - private void decode68Message(ByteBuf buffer, List out, int beginReader) { - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + 2) { - buffer.readerIndex(beginReader); - return; - } - - // 获取消息长度 - int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_68); - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + length + 2) { - buffer.readerIndex(beginReader); - return; - } - - // 读取 data 数据 最后+2是帧校验域长度 - ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_68 + 1 + length + 2); - buffer.readerIndex(beginReader + HEADER_LENGTH_68 + 1 + length + 2); - out.add(frame); - } + // private void decode68Message(ByteBuf buffer, List out, int beginReader) { + // // 检查剩余数据是否足够 + // if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + 2) { + // buffer.readerIndex(beginReader); + // return; + // } + // + // // 获取消息长度 + // int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_68); + // // 检查剩余数据是否足够 + // if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + length + 2) { + // buffer.readerIndex(beginReader); + // return; + // } + // + // // 读取 data 数据 最后+2是帧校验域长度 + // ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_68 + 1 + length + 2); + // buffer.readerIndex(beginReader + HEADER_LENGTH_68 + 1 + length + 2); + // out.add(frame); + // } // 处理DNY协议消息 private void decodeDnyMessage(ByteBuf buffer, List out, int beginReader) { - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1) { - buffer.readerIndex(beginReader); - return; + ByteBuf frame = null; + try { + // 检查剩余数据是否足够 + if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1) { + buffer.readerIndex(beginReader); + return; + } + // 获取消息长度 + int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_DNY); + // log.info("获取消息长度, length:{}", length); + // 检查剩余数据是否足够 + if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1 + length) { + buffer.readerIndex(beginReader); + return; + } + // 读取 data 数据 + frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_DNY + length + 2); + buffer.readerIndex(beginReader + HEADER_LENGTH_DNY + length + 2); + out.add(frame); + } finally { + if (frame != null) { + ReferenceCountUtil.release(frame); + } } - - // 获取消息长度 - int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_DNY); - // log.info("获取消息长度, length:{}", length); - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1 + length) { - buffer.readerIndex(beginReader); - return; - } - - // 读取 data 数据 - ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_DNY + length + 2); - buffer.readerIndex(beginReader + HEADER_LENGTH_DNY + length + 2); - - - out.add(frame); } } diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YunKuaiChongDecoder.java b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YunKuaiChongDecoder.java index 8841b1dd0..4d85dbc60 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YunKuaiChongDecoder.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/decoder/YunKuaiChongDecoder.java @@ -1,13 +1,12 @@ package com.jsowell.netty.decoder; -import com.jsowell.common.constant.Constants; import com.jsowell.common.core.domain.ykc.YKCDataProtocol; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; -import java.nio.charset.StandardCharsets; import java.util.List; @Slf4j @@ -35,7 +34,7 @@ public class YunKuaiChongDecoder extends ByteToMessageDecoder { buffer.markReaderIndex(); // 判断是否为DNY包头或68包头 - if (isStartOfDnyHeader(buffer, beginReader) || isStartOf68Header(buffer, beginReader)) { + if (isStartOf68Header(buffer, beginReader)) { break; // 读到了协议的开始标志,结束while循环 } @@ -45,17 +44,17 @@ public class YunKuaiChongDecoder extends ByteToMessageDecoder { } // 检查包头是否是 "DNY" - if (buffer.readableBytes() >= HEADER_LENGTH_DNY) { - byte[] headerBytes = new byte[HEADER_LENGTH_DNY]; - buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY); - String header = new String(headerBytes, StandardCharsets.UTF_8); - // log.info("检查包头是否是DNY, header:{}", header); - if (Constants.EBIKE_HEADER.equals(header)) { - // 处理 DNY 协议 - decodeDnyMessage(buffer, out, beginReader); - return; - } - } + // if (buffer.readableBytes() >= HEADER_LENGTH_DNY) { + // byte[] headerBytes = new byte[HEADER_LENGTH_DNY]; + // buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY); + // String header = new String(headerBytes, StandardCharsets.UTF_8); + // // log.info("检查包头是否是DNY, header:{}", header); + // if (Constants.EBIKE_HEADER.equals(header)) { + // // 处理 DNY 协议 + // decodeDnyMessage(buffer, out, beginReader); + // return; + // } + // } // 检查包头是否是 68 协议 if (buffer.readableBytes() >= HEADER_LENGTH_68) { @@ -71,15 +70,15 @@ public class YunKuaiChongDecoder extends ByteToMessageDecoder { } // 判断是否为DNY包头 - private boolean isStartOfDnyHeader(ByteBuf buffer, int beginReader) { - if (buffer.readableBytes() >= HEADER_LENGTH_DNY) { - byte[] headerBytes = new byte[HEADER_LENGTH_DNY]; - buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY); - String header = new String(headerBytes, StandardCharsets.UTF_8); - return Constants.EBIKE_HEADER.equals(header); - } - return false; - } + // private boolean isStartOfDnyHeader(ByteBuf buffer, int beginReader) { + // if (buffer.readableBytes() >= HEADER_LENGTH_DNY) { + // byte[] headerBytes = new byte[HEADER_LENGTH_DNY]; + // buffer.getBytes(beginReader, headerBytes, 0, HEADER_LENGTH_DNY); + // String header = new String(headerBytes, StandardCharsets.UTF_8); + // return Constants.EBIKE_HEADER.equals(header); + // } + // return false; + // } // 判断是否为68包头 private boolean isStartOf68Header(ByteBuf buffer, int beginReader) { @@ -91,54 +90,59 @@ public class YunKuaiChongDecoder extends ByteToMessageDecoder { // 处理68协议消息 private void decode68Message(ByteBuf buffer, List out, int beginReader) { - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + 2) { - buffer.readerIndex(beginReader); - return; + ByteBuf frame = null; + try { + // 检查剩余数据是否足够 + if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + 2) { + buffer.readerIndex(beginReader); + return; + } + + // 获取消息长度 + int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_68); + // 检查剩余数据是否足够 + if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + length + 2) { + buffer.readerIndex(beginReader); + return; + } + + // 读取 data 数据 最后+2是帧校验域长度 + frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_68 + 1 + length + 2); + buffer.readerIndex(beginReader + HEADER_LENGTH_68 + 1 + length + 2); + + // 转为YKCDataProtocol对象 + byte[] bytes = new byte[HEADER_LENGTH_68 + 1 + length + 2]; + frame.readBytes(bytes); + YKCDataProtocol ykcDataProtocol = new YKCDataProtocol(bytes); + out.add(ykcDataProtocol); + } finally { + if (frame != null) { + ReferenceCountUtil.release(frame); + } } - - // 获取消息长度 - int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_68); - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_68 + 1 + length + 2) { - buffer.readerIndex(beginReader); - return; - } - - // 读取 data 数据 最后+2是帧校验域长度 - ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_68 + 1 + length + 2); - buffer.readerIndex(beginReader + HEADER_LENGTH_68 + 1 + length + 2); - - // 转为YKCDataProtocol对象 - byte[] bytes = new byte[HEADER_LENGTH_68 + 1 + length + 2]; - frame.readBytes(bytes); - YKCDataProtocol ykcDataProtocol = new YKCDataProtocol(bytes); - out.add(ykcDataProtocol); } // 处理DNY协议消息 - private void decodeDnyMessage(ByteBuf buffer, List out, int beginReader) { - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1) { - buffer.readerIndex(beginReader); - return; - } - - // 获取消息长度 - int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_DNY); - // log.info("获取消息长度, length:{}", length); - // 检查剩余数据是否足够 - if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1 + length) { - buffer.readerIndex(beginReader); - return; - } - - // 读取 data 数据 - ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_DNY + length + 2); - buffer.readerIndex(beginReader + HEADER_LENGTH_DNY + length + 2); - - - out.add(frame); - } + // private void decodeDnyMessage(ByteBuf buffer, List out, int beginReader) { + // // 检查剩余数据是否足够 + // if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1) { + // buffer.readerIndex(beginReader); + // return; + // } + // + // // 获取消息长度 + // int length = buffer.getUnsignedByte(beginReader + HEADER_LENGTH_DNY); + // // log.info("获取消息长度, length:{}", length); + // // 检查剩余数据是否足够 + // if (buffer.readableBytes() < HEADER_LENGTH_DNY + 1 + length) { + // buffer.readerIndex(beginReader); + // return; + // } + // + // // 读取 data 数据 + // ByteBuf frame = buffer.retainedSlice(beginReader, HEADER_LENGTH_DNY + length + 2); + // buffer.readerIndex(beginReader + HEADER_LENGTH_DNY + length + 2); + // out.add(frame); + // } } diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java index 88cf9c33b..9bb5e0955 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java @@ -611,6 +611,7 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler { String pileSn = data.getPileSn(); // 充电桩编号 PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn); if (StringUtils.equals(pileBasicInfo.getBusinessType(), Constants.TWO)) { + // 个人桩处理逻辑 personalChargingRecordService.processPersonalChargingRecord(data); // return; } @@ -620,7 +621,7 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler { OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode); if (orderBasicInfo != null) { // 平台存在订单 - orderBasicInfo.setReason(data.getStopReasonMsg()); + // 如果订单状态为 异常,则改为 待结算 if (StringUtils.equals(OrderStatusEnum.ABNORMAL.getValue(), orderBasicInfo.getOrderStatus())) { orderBasicInfo.setOrderStatus(OrderStatusEnum.STAY_SETTLEMENT.getValue()); @@ -640,6 +641,10 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler { // 将停止原因码存库 orderBasicInfo.setStopReasonCode("0x" + data.getStopReasonCode()); + // 停止原因 + if (StringUtils.isNotBlank(data.getStopReasonMsg())) { + orderBasicInfo.setReason(data.getStopReasonMsg()); + } orderBasicInfoService.updateOrderBasicInfo(orderBasicInfo); diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/UploadRealTimeMonitorHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/UploadRealTimeMonitorHandler.java index b2d535597..1e041cd9c 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/UploadRealTimeMonitorHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/UploadRealTimeMonitorHandler.java @@ -320,27 +320,27 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler { if (updateFlag) { orderBasicInfoService.updateOrderBasicInfo(orderInfo); } + + // 判断该订单是否需要下发优惠券 + String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode(); + Object cacheObject = redisCache.getCacheObject(redisKey); + if (cacheObject == null && sumChargingTime >= 10) { + // 异步绑定优惠券并设置缓存 + CompletableFuture.runAsync(() -> { + try { + commonService.bindCoupon(orderInfo); + redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS); + } catch (Exception e) { + log.error("异步绑定车辆优惠券 error,", e); + } + }, executor); + } } // 充电时保存实时数据到redis if (saveRedisFlag) { pileBasicInfoService.saveRealTimeMonitorData2Redis(realTimeMonitorData); } - // 判断该订单是否需要下发优惠券 - String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode(); - Object cacheObject = redisCache.getCacheObject(redisKey); - if (cacheObject == null && sumChargingTime >= 10) { - // 异步绑定优惠券并设置缓存 - CompletableFuture.runAsync(() -> { - try { - commonService.bindCoupon(orderInfo); - redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS); - } catch (Exception e) { - log.error("异步绑定车辆优惠券 error,", e); - } - }, executor); - } - } // 异步推送第三方平台实时数据 diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java index 60ec3d11d..c7c7e4f5e 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java @@ -8,6 +8,7 @@ import com.jsowell.netty.service.electricbicycles.EBikeBusinessService; import io.netty.buffer.ByteBuf; import io.netty.channel.*; import io.netty.handler.timeout.ReadTimeoutException; +import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -60,25 +61,30 @@ public class ElectricBicyclesServerHandler extends ChannelInboundHandlerAdapter */ @Override public void channelRead(ChannelHandlerContext ctx, Object message) throws Exception { - byte[] msg = (byte[]) message; - // 处理数据 - byte[] response = eBikeService.process(msg, ctx); - if (Objects.nonNull(response)) { - log.info("[电单车===>响应数据]:{}", BytesUtil.binary(response, 16)); - // 响应客户端 - ByteBuf buffer = ctx.alloc().buffer().writeBytes(response); - // this.channelWrite(channel.id(), buffer); - ctx.writeAndFlush(buffer); - // if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) { - // // 应答帧类型 - // byte[] responseFrameTypeBytes = YKCFrameTypeCode.PlatformAnswersRelation.getResponseFrameTypeBytes(frameTypeBytes); - // String responseFrameType = YKCUtils.frameType2Str(responseFrameTypeBytes); - // log.info("【>>>>>平台响应消息>>>>>】channel:{}, 响应帧类型:{}, 响应帧名称:{}, 原帧类型:{}, 原帧名称:{}, 序列号域:{}, response:{}", - // channel.id(), responseFrameType, YKCFrameTypeCode.getFrameTypeStr(responseFrameType), - // frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, - // BytesUtil.binary(response, 16)); - // } + try { + byte[] msg = (byte[]) message; + // 处理数据 + byte[] response = eBikeService.process(msg, ctx); + if (Objects.nonNull(response)) { + log.info("[电单车===>响应数据]:{}", BytesUtil.binary(response, 16)); + // 响应客户端 + ByteBuf buffer = ctx.alloc().buffer().writeBytes(response); + // this.channelWrite(channel.id(), buffer); + ctx.writeAndFlush(buffer); + // if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) { + // // 应答帧类型 + // byte[] responseFrameTypeBytes = YKCFrameTypeCode.PlatformAnswersRelation.getResponseFrameTypeBytes(frameTypeBytes); + // String responseFrameType = YKCUtils.frameType2Str(responseFrameTypeBytes); + // log.info("【>>>>>平台响应消息>>>>>】channel:{}, 响应帧类型:{}, 响应帧名称:{}, 原帧类型:{}, 原帧名称:{}, 序列号域:{}, response:{}", + // channel.id(), responseFrameType, YKCFrameTypeCode.getFrameTypeStr(responseFrameType), + // frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, + // BytesUtil.binary(response, 16)); + // } + } + } finally { + ReferenceCountUtil.release(message); } + } /** diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java index 61b296e55..a049504ee 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerHandler.java @@ -13,6 +13,7 @@ import io.netty.channel.*; import io.netty.handler.timeout.IdleState; import io.netty.handler.timeout.IdleStateEvent; import io.netty.handler.timeout.ReadTimeoutException; +import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -39,7 +40,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { */ private static final ConcurrentHashMap CHANNEL_MAP = new ConcurrentHashMap<>(); - private final List notPrintFrameTypeList = Lists.newArrayList(); // "0x03" + private final List notPrintFrameTypeList = Lists.newArrayList("0x03"); // "0x03" /** * 有客户端连接服务器会触发此函数 @@ -127,57 +128,39 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object message) throws Exception { - YKCDataProtocol ykcDataProtocol = (YKCDataProtocol) message; - - // 获取帧类型 - byte[] frameTypeBytes = ykcDataProtocol.getFrameType(); - String frameType = YKCUtils.frameType2Str(frameTypeBytes); - - // 判断该帧类型是否为某请求帧的应答帧 - // String requestFrameType = YKCFrameTypeCode.PileAnswersRelation.getRequestFrameType(frameType); - // log.info("同步获取响应数据-判断该帧类型是否为某请求帧的应答帧, frameType:{}, requestFrameType:{}", frameType, requestFrameType); - // if (StringUtils.isNotBlank(requestFrameType)) { - // // 根据请求id,在集合中找到与外部线程通信的SyncPromise对象 - // String msgId = ctx.channel().id().toString() + "_" + requestFrameType; - // // log.info("同步获取响应数据-收到消息, msgId:{}", msgId); - // SyncPromise syncPromise = RpcUtil.getSyncPromiseMap().get(msgId); - // if(syncPromise != null) { - // // 设置响应结果 - // syncPromise.setRpcResult(ykcDataProtocol.getBytes()); - // // 唤醒外部线程 - // // log.info("同步获取响应数据-唤醒外部线程, SyncPromise:{}", JSON.toJSONString(syncPromise)); - // syncPromise.wake(); - // } - // } - - // 获取序列号域 - int serialNumber = BytesUtil.bytesToIntLittle(ykcDataProtocol.getSerialNumber()); - - // 获取channel - Channel channel = ctx.channel(); - - // 心跳包0x03日志太多,造成日志文件过大,改为不打印 - if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) { - log.info("【<<<<<平台收到消息<<<<<】channel:{}, 帧类型:{}, 帧名称:{}, 序列号域:{}, 报文:{}", - channel.id(), frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, - BytesUtil.binary(ykcDataProtocol.getBytes(), 16)); - } - - // 处理数据 - byte[] response = ykcService.process(ykcDataProtocol, ctx); - if (Objects.nonNull(response)) { - // 响应客户端 - ByteBuf buffer = ctx.alloc().buffer().writeBytes(response); - this.channelWrite(channel.id(), buffer); + try { + YKCDataProtocol ykcDataProtocol = (YKCDataProtocol) message; + // 获取帧类型 + byte[] frameTypeBytes = ykcDataProtocol.getFrameType(); + String frameType = YKCUtils.frameType2Str(frameTypeBytes); + // 获取序列号域 + int serialNumber = BytesUtil.bytesToIntLittle(ykcDataProtocol.getSerialNumber()); + // 获取channel + Channel channel = ctx.channel(); + // 心跳包0x03日志太多,造成日志文件过大,改为不打印 if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) { - // 应答帧类型 - byte[] responseFrameTypeBytes = YKCFrameTypeCode.PlatformAnswersRelation.getResponseFrameTypeBytes(frameTypeBytes); - String responseFrameType = YKCUtils.frameType2Str(responseFrameTypeBytes); - log.info("【>>>>>平台响应消息>>>>>】channel:{}, 响应帧类型:{}, 响应帧名称:{}, 原帧类型:{}, 原帧名称:{}, 序列号域:{}, response:{}", - channel.id(), responseFrameType, YKCFrameTypeCode.getFrameTypeStr(responseFrameType), - frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, - BytesUtil.binary(response, 16)); + log.info("【<<<<<平台收到消息<<<<<】channel:{}, 帧类型:{}, 帧名称:{}, 序列号域:{}, 报文:{}", + channel.id(), frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, + BytesUtil.binary(ykcDataProtocol.getBytes(), 16)); } + // 处理数据 + byte[] response = ykcService.process(ykcDataProtocol, ctx); + if (Objects.nonNull(response)) { + // 响应客户端 + ByteBuf buffer = ctx.alloc().buffer().writeBytes(response); + this.channelWrite(channel.id(), buffer); + if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) { + // 应答帧类型 + byte[] responseFrameTypeBytes = YKCFrameTypeCode.PlatformAnswersRelation.getResponseFrameTypeBytes(frameTypeBytes); + String responseFrameType = YKCUtils.frameType2Str(responseFrameTypeBytes); + log.info("【>>>>>平台响应消息>>>>>】channel:{}, 响应帧类型:{}, 响应帧名称:{}, 原帧类型:{}, 原帧名称:{}, 序列号域:{}, response:{}", + channel.id(), responseFrameType, YKCFrameTypeCode.getFrameTypeStr(responseFrameType), + frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber, + BytesUtil.binary(response, 16)); + } + } + } finally { + ReferenceCountUtil.release(message); } } @@ -248,25 +231,31 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - String socketString = ctx.channel().remoteAddress().toString(); - ChannelId channelId = ctx.channel().id(); - String pileSn = PileChannelEntity.getPileSnByChannelId(channelId.asLongText()); - if (evt instanceof IdleStateEvent) { // 超时事件 - IdleStateEvent event = (IdleStateEvent) evt; - boolean flag = false; - if (event.state() == IdleState.READER_IDLE) { // 读 - flag = true; - // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, READER_IDLE 读超时", socketString, channelId, pileSn); - } else if (event.state() == IdleState.WRITER_IDLE) { // 写 - flag = true; - // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, WRITER_IDLE 写超时", socketString, channelId, pileSn); - } else if (event.state() == IdleState.ALL_IDLE) { // 全部 - flag = true; - // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, ALL_IDLE 总超时", socketString, channelId, pileSn); + try { + String socketString = ctx.channel().remoteAddress().toString(); + ChannelId channelId = ctx.channel().id(); + String pileSn = PileChannelEntity.getPileSnByChannelId(channelId.asLongText()); + if (evt instanceof IdleStateEvent) { // 超时事件 + IdleStateEvent event = (IdleStateEvent) evt; + boolean flag = false; + if (event.state() == IdleState.READER_IDLE) { // 读 + flag = true; + // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, READER_IDLE 读超时", socketString, channelId, pileSn); + } else if (event.state() == IdleState.WRITER_IDLE) { // 写 + flag = true; + // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, WRITER_IDLE 写超时", socketString, channelId, pileSn); + } else if (event.state() == IdleState.ALL_IDLE) { // 全部 + flag = true; + // log.error("Client-IP:【{}】, channelId:【{}】, pileSn:【{}】, ALL_IDLE 总超时", socketString, channelId, pileSn); + } + if (flag) { + ctx.channel().close(); + // close(channelId, pileSn); + } } - if (flag) { - ctx.channel().close(); - // close(channelId, pileSn); + } finally { + if (evt instanceof ByteBuf) { + ReferenceCountUtil.release(evt); } } } @@ -276,20 +265,26 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - ChannelId channelId = ctx.channel().id(); - String channelIdShortText = channelId.asShortText(); - String pileSn = PileChannelEntity.getPileSnByChannelId(channelIdShortText); - log.error("发生异常 channelId:{}, pileSn:{}", channelIdShortText, pileSn, cause); - cause.printStackTrace(); - // 如果桩连到平台,在1分钟内没有发送数据过来,会报ReadTimeoutException异常 - if (cause instanceof ReadTimeoutException) { - if (log.isTraceEnabled()) { - log.trace("Connection timeout 【{}】", ctx.channel().remoteAddress()); + try { + + ChannelId channelId = ctx.channel().id(); + String channelIdShortText = channelId.asShortText(); + String pileSn = PileChannelEntity.getPileSnByChannelId(channelIdShortText); + log.error("发生异常 channelId:{}, pileSn:{}", channelIdShortText, pileSn, cause); + cause.printStackTrace(); + // 如果桩连到平台,在1分钟内没有发送数据过来,会报ReadTimeoutException异常 + if (cause instanceof ReadTimeoutException) { + if (log.isTraceEnabled()) { + log.trace("Connection timeout 【{}】", ctx.channel().remoteAddress()); + } + log.error("【{}】发生了错误, pileSn:【{}】此连接被关闭, 此时连通数量: {}", channelId, pileSn, CHANNEL_MAP.size()); + ctx.channel().close(); + } + } finally { + if (ctx.channel().isActive()) { + ctx.close(); } - log.error("【{}】发生了错误, pileSn:【{}】此连接被关闭, 此时连通数量: {}", channelId, pileSn, CHANNEL_MAP.size()); - ctx.channel().close(); } - // close(channelId, pileSn); } diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/common/PaymentConfirmInfo.java b/jsowell-pile/src/main/java/com/jsowell/adapay/common/PaymentConfirmInfo.java new file mode 100644 index 000000000..481be3d51 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/common/PaymentConfirmInfo.java @@ -0,0 +1,70 @@ +package com.jsowell.adapay.common; + +import com.alibaba.fastjson.annotation.JSONField; +import com.jsowell.adapay.response.AdapayBaseResponse; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 支付确认对象 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class PaymentConfirmInfo extends AdapayBaseResponse { + /** + * 返参,必填,由AdaPay生成的支付对象 ID + */ + @JSONField(name = "id") + private String id; + + /** + * 返参,必填,支付创建时的时间戳 + */ + @JSONField(name = "created_time") + private String createdTime; + + /** + * 必填,订单号 + */ + @JSONField(name = "order_no") + private String orderNo; + + /** + * 商户发起支付的应用id,不同的前端应用将无法使用该 Payment 对象完成支付 + */ + @JSONField(name = "app_id") + private String appId; + + @JSONField(name = "confirm_amt") + private String confirmAmt; + + @JSONField(name = "confirmed_amt") + private String confirmedAmt; + + @JSONField(name = "fee_mode") + private String feeMode; + + private String description; + + @JSONField(name = "reserved_amt") + private String reservedAmt; + + @JSONField(name = "refunded_amt") + private String refundedAmt; + + @JSONField(name = "fee_amt") + private String feeAmt; + + @JSONField(name = "error_msg") + private String errorMsg; + + @JSONField(name = "div_members") + private List divMembers; + +} \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/response/QueryPaymentConfirmDetailResponse.java b/jsowell-pile/src/main/java/com/jsowell/adapay/response/QueryPaymentConfirmDetailResponse.java index 6ac632caf..1ea5a2fe5 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/response/QueryPaymentConfirmDetailResponse.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/response/QueryPaymentConfirmDetailResponse.java @@ -1,9 +1,8 @@ package com.jsowell.adapay.response; import com.alibaba.fastjson.annotation.JSONField; +import com.jsowell.adapay.common.PaymentConfirmInfo; import lombok.Data; -import lombok.Getter; -import lombok.Setter; import java.util.List; @@ -11,12 +10,12 @@ import java.util.List; * 查询支付确认对象详情反参 */ @Data -public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse{ +public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse { @JSONField(name = "payment_id") private String paymentId; - @JSONField(name = "prod_mode") - private String prodMode; + // @JSONField(name = "prod_mode") + // private String prodMode; @JSONField(name = "payment_confirms") private List paymentConfirms; @@ -29,53 +28,4 @@ public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse{ @JSONField(name = "object") private String object; - - @Getter - @Setter - public static class PaymentConfirmInfo{ - /** - * 返参,必填,由AdaPay生成的支付对象 ID - */ - @JSONField(name = "id") - private String id; - - /** - * 返参,必填,支付创建时的时间戳 - */ - @JSONField(name = "created_time") - private String createdTime; - - /** - * 必填,订单号 - */ - @JSONField(name = "order_no") - private String orderNo; - - /** - * 商户发起支付的应用id,不同的前端应用将无法使用该 Payment 对象完成支付 - */ - @JSONField(name = "app_id") - private String appId; - - @JSONField(name = "confirm_amt") - private String confirmAmt; - - @JSONField(name = "confirmed_amt") - private String confirmedAmt; - - @JSONField(name = "fee_mode") - private String feeMode; - - private String description; - - @JSONField(name = "reserved_amt") - private String reservedAmt; - - @JSONField(name = "refunded_amt") - private String refundedAmt; - - @JSONField(name = "fee_amt") - private String feeAmt; - - } } diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index 54d245350..60b345106 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -8,11 +8,10 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.huifu.adapay.core.exception.BaseAdaPayException; +import com.huifu.adapay.model.CorpMember; +import com.huifu.adapay.model.SettleAccount; import com.huifu.adapay.model.*; -import com.jsowell.adapay.common.AdaPayment; -import com.jsowell.adapay.common.CreateAdaPaymentParam; -import com.jsowell.adapay.common.DivMember; -import com.jsowell.adapay.common.RefundInfo; +import com.jsowell.adapay.common.*; import com.jsowell.adapay.config.AbstractAdapayConfig; import com.jsowell.adapay.dto.*; import com.jsowell.adapay.factory.AdapayConfigFactory; @@ -51,7 +50,10 @@ import org.springframework.transaction.annotation.Transactional; import java.io.File; import java.math.BigDecimal; -import java.util.*; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -1236,11 +1238,11 @@ public class AdapayService { QueryPaymentConfirmDetailResponse response = null; // 查缓存 String redisKey = CacheConstants.PAYMENT_CONFIRM_LIST + dto.getPaymentId(); - String redisResult = redisCache.getCacheObject(redisKey); - if (StringUtils.isNotBlank(redisResult)) { - response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class); - return response; - } + // String redisResult = redisCache.getCacheObject(redisKey); + // if (StringUtils.isNotBlank(redisResult)) { + // response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class); + // return response; + // } AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId()); if (config == null) { @@ -1254,7 +1256,7 @@ public class AdapayService { Map map = PaymentConfirm.queryList(param, config.getWechatAppId()); response = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class); // log.info("queryPaymentConfirmDetailResponse:{}", JSON.toJSONString(queryPaymentConfirmDetailResponse)); - redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_12h); + redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_10m); } catch (BaseAdaPayException e) { log.error("查询支付确认对象列表error", e); } @@ -1264,7 +1266,7 @@ public class AdapayService { /** * 查询支付确认对象详情 */ - public QueryPaymentConfirmDetailResponse.PaymentConfirmInfo queryPaymentConfirmDetail(QueryPaymentConfirmDTO dto) { + public PaymentConfirmInfo queryPaymentConfirmDetail(QueryPaymentConfirmDTO dto) { AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId()); if (config == null) { throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR); @@ -1272,10 +1274,11 @@ public class AdapayService { Map confirmParams = Maps.newHashMap(); confirmParams.put("payment_confirm_id", dto.getPaymentConfirmId()); - QueryPaymentConfirmDetailResponse.PaymentConfirmInfo result = null; + PaymentConfirmInfo result = null; try { Map paymentConfirm = PaymentConfirm.query(confirmParams, config.getWechatAppId()); - result = JSON.parseObject(JSON.toJSONString(paymentConfirm), QueryPaymentConfirmDetailResponse.PaymentConfirmInfo.class); + log.info("查询支付确认对象详情:{}", JSON.toJSONString(paymentConfirm)); + result = JSON.parseObject(JSON.toJSONString(paymentConfirm), PaymentConfirmInfo.class); } catch (BaseAdaPayException e) { throw new RuntimeException(e); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/AreaCodeInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/AreaCodeInfo.java new file mode 100644 index 000000000..dbd548721 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/AreaCodeInfo.java @@ -0,0 +1,203 @@ +package com.jsowell.pile.domain; + +import java.math.BigDecimal; + +import com.jsowell.common.annotation.Excel; +import com.jsowell.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 中国行政地区对象 area_code_info + * + * @author jsowell + * @date 2024-12-20 + */ +public class AreaCodeInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Integer id; + + /** + * 层级 + */ + @Excel(name = "层级") + private Integer level; + + /** + * 父级行政代码 + */ + @Excel(name = "父级行政代码") + private Long parentCode; + + /** + * 行政代码 + */ + @Excel(name = "行政代码") + private Long areaCode; + + /** + * 邮政编码 + */ + @Excel(name = "邮政编码") + private Integer zipCode; + + /** + * 区号 + */ + @Excel(name = "区号") + private String cityCode; + + /** + * 名称 + */ + @Excel(name = "名称") + private String name; + + /** + * 简称 + */ + @Excel(name = "简称") + private String shortName; + + /** + * 组合名 + */ + @Excel(name = "组合名") + private String mergerName; + + /** + * 拼音 + */ + @Excel(name = "拼音") + private String pinyin; + + /** + * 经度 + */ + @Excel(name = "经度") + private BigDecimal lng; + + /** + * 纬度 + */ + @Excel(name = "纬度") + private BigDecimal lat; + + public void setId(Integer id) { + this.id = id; + } + + public Integer getId() { + return id; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Integer getLevel() { + return level; + } + + public void setParentCode(Long parentCode) { + this.parentCode = parentCode; + } + + public Long getParentCode() { + return parentCode; + } + + public void setAreaCode(Long areaCode) { + this.areaCode = areaCode; + } + + public Long getAreaCode() { + return areaCode; + } + + public void setZipCode(Integer zipCode) { + this.zipCode = zipCode; + } + + public Integer getZipCode() { + return zipCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode; + } + + public String getCityCode() { + return cityCode; + } + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + public String getShortName() { + return shortName; + } + + public void setMergerName(String mergerName) { + this.mergerName = mergerName; + } + + public String getMergerName() { + return mergerName; + } + + public void setPinyin(String pinyin) { + this.pinyin = pinyin; + } + + public String getPinyin() { + return pinyin; + } + + public void setLng(BigDecimal lng) { + this.lng = lng; + } + + public BigDecimal getLng() { + return lng; + } + + public void setLat(BigDecimal lat) { + this.lat = lat; + } + + public BigDecimal getLat() { + return lat; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) + .append("id", getId()) + .append("level", getLevel()) + .append("parentCode", getParentCode()) + .append("areaCode", getAreaCode()) + .append("zipCode", getZipCode()) + .append("cityCode", getCityCode()) + .append("name", getName()) + .append("shortName", getShortName()) + .append("mergerName", getMergerName()) + .append("pinyin", getPinyin()) + .append("lng", getLng()) + .append("lat", getLat()) + .toString(); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java index 34d09e1ac..8e8a2307a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java @@ -11,7 +11,7 @@ import java.util.Date; import java.util.List; /** - * TODO + * 占桩订单DTO * * @author Lemon * @Date 2024/7/15 13:37:04 @@ -47,6 +47,11 @@ public class OrderPileOccupyDTO extends BaseEntity { */ private String stationId; + /** + * 站点名称 + */ + private String stationName; + /** * 车牌号码 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStartChargeDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStartChargeDTO.java index c4210798f..e883fed3a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStartChargeDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStartChargeDTO.java @@ -75,4 +75,28 @@ public class QueryStartChargeDTO { * 支付方式(1-余额支付;3-白名单支付;4-微信支付;5-支付宝支付) */ private String payMode; + + /** + * 查询页码 + */ + @JsonProperty(value = "PageNo") + private Integer pageNo; + + /** + * 每页数量 + */ + @JsonProperty(value = "PageSize") + private Integer pageSize; + + /** + * 上次查询时间 + */ + @JsonProperty(value = "LastQueryTime") + private String lastQueryTime; + + /** + * 上次查询结束时间 + */ + @JsonProperty(value = "LastQueryEndTime") + private String lastQueryEndTime; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java index 3f2819529..9f99ce776 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java @@ -70,6 +70,12 @@ public class QueryStationInfoDTO { @JsonProperty(value = "StationIDs") private List stationIds; + /** + * 更多标志 + */ + @JsonProperty(value = "MoreFlag") + private Integer moreFlag; + private String address; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AreaCodeInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AreaCodeInfoMapper.java new file mode 100644 index 000000000..c6ebdb1cf --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/AreaCodeInfoMapper.java @@ -0,0 +1,63 @@ +package com.jsowell.pile.mapper; + +import java.util.List; + +import com.jsowell.pile.domain.AreaCodeInfo; +import org.springframework.stereotype.Repository; + +/** + * 中国行政地区Mapper接口 + * + * @author jsowell + * @date 2024-12-20 + */ +@Repository +public interface AreaCodeInfoMapper { + /** + * 查询中国行政地区 + * + * @param id 中国行政地区主键 + * @return 中国行政地区 + */ + public AreaCodeInfo selectAreaCodeInfoById(Integer id); + + /** + * 查询中国行政地区列表 + * + * @param areaCodeInfo 中国行政地区 + * @return 中国行政地区集合 + */ + public List selectAreaCodeInfoList(AreaCodeInfo areaCodeInfo); + + /** + * 新增中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + public int insertAreaCodeInfo(AreaCodeInfo areaCodeInfo); + + /** + * 修改中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + public int updateAreaCodeInfo(AreaCodeInfo areaCodeInfo); + + /** + * 删除中国行政地区 + * + * @param id 中国行政地区主键 + * @return 结果 + */ + public int deleteAreaCodeInfoById(Integer id); + + /** + * 批量删除中国行政地区 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAreaCodeInfoByIds(Integer[] ids); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java index f093b9ac8..05dd2eabc 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java @@ -1,5 +1,6 @@ package com.jsowell.pile.mapper; +import com.alipay.api.domain.ChargeOrderInfo; import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderDetail; import com.jsowell.pile.dto.*; @@ -394,4 +395,11 @@ public interface OrderBasicInfoMapper { List tempGetOrderCodes(QueryOrderDTO dto); + + /** + * 查询第三方平台订单列表 + * @param dto + * @return + */ + List selectThirdPartyOrderList(@Param("dto") QueryStartChargeDTO dto); } \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java index 34cef148b..e258931a6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java @@ -4,6 +4,7 @@ import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.ReplaceMerchantStationDTO; +import com.jsowell.pile.thirdparty.PileDetailInfoVO; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO; @@ -169,4 +170,11 @@ public interface PileBasicInfoMapper { * @return */ PileBasicInfo getMaxNumPileInfo(); + + /** + * 获取桩信息详情列表 + * @param stationId + * @return + */ + List getPileDetailInfoList(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IAreaCodeInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IAreaCodeInfoService.java new file mode 100644 index 000000000..303eb8144 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IAreaCodeInfoService.java @@ -0,0 +1,61 @@ +package com.jsowell.pile.service; + +import java.util.List; + +import com.jsowell.pile.domain.AreaCodeInfo; + +/** + * 中国行政地区Service接口 + * + * @author jsowell + * @date 2024-12-20 + */ +public interface IAreaCodeInfoService { + /** + * 查询中国行政地区 + * + * @param id 中国行政地区主键 + * @return 中国行政地区 + */ + public AreaCodeInfo selectAreaCodeInfoById(Integer id); + + /** + * 查询中国行政地区列表 + * + * @param areaCodeInfo 中国行政地区 + * @return 中国行政地区集合 + */ + public List selectAreaCodeInfoList(AreaCodeInfo areaCodeInfo); + + /** + * 新增中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + public int insertAreaCodeInfo(AreaCodeInfo areaCodeInfo); + + /** + * 修改中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + public int updateAreaCodeInfo(AreaCodeInfo areaCodeInfo); + + /** + * 批量删除中国行政地区 + * + * @param ids 需要删除的中国行政地区主键集合 + * @return 结果 + */ + public int deleteAreaCodeInfoByIds(Integer[] ids); + + /** + * 删除中国行政地区信息 + * + * @param id 中国行政地区主键 + * @return 结果 + */ + public int deleteAreaCodeInfoById(Integer id); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java index 0366a3de2..362f8da2a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java @@ -1,5 +1,6 @@ package com.jsowell.pile.service; +import com.alipay.api.domain.ChargeOrderInfo; import com.huifu.adapay.core.exception.BaseAdaPayException; import com.jsowell.adapay.common.DivMember; import com.jsowell.adapay.response.PaymentReverseResponse; @@ -208,6 +209,8 @@ public interface OrderBasicInfoService{ List calculationOfSplitAmount(List stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO, List paymentInfos); + OrderSplitResult verifyOrderConfirmAmount(List paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException; + /** * 批量查询订单 * @param orderCodeList @@ -479,6 +482,12 @@ public interface OrderBasicInfoService{ */ void createReservationOrder(ReservationChargingStartupResult chargingStartupResult); + /** + * 查询第三方平台订单列表 + * @param dto + */ + List selectThirdPartyOrderList(QueryStartChargeDTO dto); + //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ /** diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java index c88eaf772..15395db93 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java @@ -6,10 +6,7 @@ import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.ebike.deviceupload.EBikeMessageCmd20; import com.jsowell.pile.dto.*; -import com.jsowell.pile.thirdparty.ConnectorInfo; -import com.jsowell.pile.thirdparty.EquipmentInfo; -import com.jsowell.pile.thirdparty.ZDLConnectorInfo; -import com.jsowell.pile.thirdparty.ZDLEquipmentInfo; +import com.jsowell.pile.thirdparty.*; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; @@ -252,4 +249,6 @@ public interface PileBasicInfoService { * @param message */ void registrationEBikePile(EBikeMessageCmd20 message); + + List getPileDetailInfoList(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AreaCodeInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AreaCodeInfoServiceImpl.java new file mode 100644 index 000000000..2ba87cbf1 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AreaCodeInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.jsowell.pile.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.jsowell.pile.mapper.AreaCodeInfoMapper; +import com.jsowell.pile.domain.AreaCodeInfo; +import com.jsowell.pile.service.IAreaCodeInfoService; + +/** + * 中国行政地区Service业务层处理 + * + * @author jsowell + * @date 2024-12-20 + */ +@Service +public class AreaCodeInfoServiceImpl implements IAreaCodeInfoService { + @Autowired + private AreaCodeInfoMapper areaCodeInfoMapper; + + /** + * 查询中国行政地区 + * + * @param id 中国行政地区主键 + * @return 中国行政地区 + */ + @Override + public AreaCodeInfo selectAreaCodeInfoById(Integer id) { + return areaCodeInfoMapper.selectAreaCodeInfoById(id); + } + + /** + * 查询中国行政地区列表 + * + * @param areaCodeInfo 中国行政地区 + * @return 中国行政地区 + */ + @Override + public List selectAreaCodeInfoList(AreaCodeInfo areaCodeInfo) { + return areaCodeInfoMapper.selectAreaCodeInfoList(areaCodeInfo); + } + + /** + * 新增中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + @Override + public int insertAreaCodeInfo(AreaCodeInfo areaCodeInfo) { + return areaCodeInfoMapper.insertAreaCodeInfo(areaCodeInfo); + } + + /** + * 修改中国行政地区 + * + * @param areaCodeInfo 中国行政地区 + * @return 结果 + */ + @Override + public int updateAreaCodeInfo(AreaCodeInfo areaCodeInfo) { + return areaCodeInfoMapper.updateAreaCodeInfo(areaCodeInfo); + } + + /** + * 批量删除中国行政地区 + * + * @param ids 需要删除的中国行政地区主键 + * @return 结果 + */ + @Override + public int deleteAreaCodeInfoByIds(Integer[] ids) { + return areaCodeInfoMapper.deleteAreaCodeInfoByIds(ids); + } + + /** + * 删除中国行政地区信息 + * + * @param id 中国行政地区主键 + * @return 结果 + */ + @Override + public int deleteAreaCodeInfoById(Integer id) { + return areaCodeInfoMapper.deleteAreaCodeInfoById(id); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index 175e41e3f..6a0e13b22 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -2,12 +2,14 @@ package com.jsowell.pile.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; +import com.alipay.api.domain.ChargeOrderInfo; 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.jsowell.adapay.common.DivMember; import com.jsowell.adapay.dto.PaymentConfirmParam; +import com.jsowell.adapay.common.PaymentConfirmInfo; import com.jsowell.adapay.dto.QueryConfirmReverseDTO; import com.jsowell.adapay.dto.QueryPaymentConfirmDTO; import com.jsowell.adapay.operation.PaymentReverseOperation; @@ -312,6 +314,20 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(thirdPartyType); orderListVO.setThirdPartyType(label + "启动"); } + + // 设置soc + if (StringUtils.isNotBlank(orderListVO.getStartSoc()) || StringUtils.isNotBlank(orderListVO.getEndSoc())) { + // 取redis中的soc数据 + Map socMap = YKCUtils.getSOCMap(orderListVO.getTransactionCode()); + if (Objects.nonNull(socMap)) { + if (StringUtils.isBlank(orderListVO.getStartSoc())) { + orderListVO.setStartSoc(socMap.get("startSoc")); + } + if (StringUtils.isBlank(orderListVO.getEndSoc())) { + orderListVO.setEndSoc(socMap.get("endSoc")); + } + } + } } batchQueryFeeAmt(orderListVOS); @@ -1871,7 +1887,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { * @param orderCode 订单编号 * @param settleAmount 结算金额 */ - private OrderSplitResult verifyOrderConfirmAmount(List paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException { + @Override + public OrderSplitResult verifyOrderConfirmAmount(List paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) throws BaseAdaPayException { // 分账金额 BigDecimal totalConfirmAmt = BigDecimal.ZERO; // 手续费 @@ -1883,9 +1900,9 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { dto.setWechatAppId(wechatAppId); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); if (response != null) { - List confirms = response.getPaymentConfirms(); + List confirms = response.getPaymentConfirms(); if (CollectionUtils.isNotEmpty(confirms)) { - for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) { + for (PaymentConfirmInfo confirm : confirms) { // 校验分账是否撤销 if (queryConfirmReverseStatus(confirm.getId(), wechatAppId)) { logger.info("支付确认id:" + confirm.getId() + "撤销了。。。"); @@ -2204,6 +2221,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { orderBasicInfo.setChargeStartTime(DateUtils.parseDate(data.getStartTime())); // 充电结束时间 orderBasicInfo.setChargeEndTime(DateUtils.parseDate(data.getEndTime())); + // 停止原因码 + orderBasicInfo.setStopReasonCode("0x" + data.getStopReasonCode()); // 停止原因 orderBasicInfo.setReason(data.getStopReasonMsg()); // 结算时间 @@ -2890,7 +2909,18 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { */ @Override public List getAccumulativeInfoForLianLian(QueryStationInfoDTO dto) { - return orderBasicInfoMapper.getAccumulativeInfoForLianLian(dto); + List accumulativeInfoList = orderBasicInfoMapper.getAccumulativeInfoForLianLian(dto); + for (AccumulativeInfoVO accumulativeInfoVO : accumulativeInfoList) { + String startTime = accumulativeInfoVO.getStartTime(); + String endTime = accumulativeInfoVO.getEndTime(); + if (startTime == null || endTime == null) { + continue; + } + // 计算充电时长 + int chargingTime = Integer.parseInt(String.valueOf(DateUtils.intervalTime(startTime, endTime))) * 60; + accumulativeInfoVO.setChargingTime(String.valueOf(chargingTime)); + } + return accumulativeInfoList; } /** @@ -3669,7 +3699,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { // dto.setPaymentId(record.getPaymentId()); // QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto); // if (response != null && CollectionUtils.isNotEmpty(response.getPaymentConfirms())) { - // for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) { + // for (PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) { // JSONObject jsonObject = JSON.parseObject(paymentConfirm.getDescription()); // if (StringUtils.equals(jsonObject.getString("orderCode"), orderCode)) { // // 订单号对的上,累计分账金额 @@ -4393,6 +4423,15 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { orderPayRecordService.batchInsert(Lists.newArrayList(principalPayRecord)); } + /** + * 查询第三方平订单列表 + * @param dto + * @return + */ + @Override + public List selectThirdPartyOrderList(QueryStartChargeDTO dto) { + return orderBasicInfoMapper.selectThirdPartyOrderList(dto); + } /** diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PersonalChargingRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PersonalChargingRecordServiceImpl.java index 9dafd5ca9..b5fb771f0 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PersonalChargingRecordServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PersonalChargingRecordServiceImpl.java @@ -3,6 +3,7 @@ package com.jsowell.pile.service.impl; import com.jsowell.common.constant.Constants; import com.jsowell.common.core.domain.ykc.TransactionRecordsData; import com.jsowell.common.util.DateUtils; +import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.PersonalChargingRecord; import com.jsowell.pile.domain.PileBasicInfo; @@ -130,7 +131,10 @@ public class PersonalChargingRecordServiceImpl implements PersonalChargingRecord chargingRecord.setValleyUsedElectricity(valleyUsedElectricity); BigDecimal totalUsedElectricity = sharpUsedElectricity.add(peakUsedElectricity).add(flatUsedElectricity).add(valleyUsedElectricity); chargingRecord.setTotalUsedElectricity(totalUsedElectricity); - chargingRecord.setReason(data.getStopReasonMsg()); + chargingRecord.setStopReasonCode("0x" + data.getStopReasonCode()); + if (StringUtils.isNotBlank(data.getStopReasonMsg())) { + chargingRecord.setReason(data.getStopReasonMsg()); + } // 创建或更新 this.insertOrUpdateSelective(chargingRecord); } 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 438e8f2a6..ff53a992a 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 @@ -10,7 +10,6 @@ import com.jsowell.common.core.domain.vo.AuthorizedDeptVO; import com.jsowell.common.core.domain.ykc.*; import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.enums.DelFlagEnum; -import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorStatusEnum; import com.jsowell.common.enums.ykc.PileStatusEnum; @@ -24,10 +23,7 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.service.*; import com.jsowell.pile.service.programlogic.AbstractProgramLogic; import com.jsowell.pile.service.programlogic.ProgramLogicFactory; -import com.jsowell.pile.thirdparty.ConnectorInfo; -import com.jsowell.pile.thirdparty.EquipmentInfo; -import com.jsowell.pile.thirdparty.ZDLConnectorInfo; -import com.jsowell.pile.thirdparty.ZDLEquipmentInfo; +import com.jsowell.pile.thirdparty.*; import com.jsowell.pile.transaction.dto.PileTransactionDTO; import com.jsowell.pile.transaction.service.TransactionService; import com.jsowell.pile.util.UserUtils; @@ -138,8 +134,6 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { redisCache.setCacheObject(redisKey, pileBasicInfo, 15, TimeUnit.MINUTES); } } - - // PileBasicInfo pileBasicInfo = pileBasicInfoMapper.selectPileBasicInfoBySn(pileSn); return pileBasicInfo; } @@ -1226,48 +1220,35 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { public List getPileListForLianLian(String stationId) { List resultList = new ArrayList<>(); // 通过站点id查询桩基本信息 - List list = this.getPileListByStationId(stationId); + List list = getPileDetailInfoList(stationId); // 封装成联联平台对象 - for (PileBasicInfo pileBasicInfo : list) { + for (PileDetailInfoVO pileDetailInfoVO : list) { EquipmentInfo equipmentInfo = new EquipmentInfo(); - String pileSn = pileBasicInfo.getSn(); + String pileSn = pileDetailInfoVO.getPileSn(); equipmentInfo.setEquipmentID(pileSn); equipmentInfo.setEquipmentClassification(1); equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN); equipmentInfo.setManufacturerName(Constants.MANUFACTURER_NAME); - equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); - equipmentInfo.setProductionDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); + equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileDetailInfoVO.getCreateTime())); + equipmentInfo.setProductionDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileDetailInfoVO.getCreateTime())); - PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); - if (StringUtils.isBlank(modelInfo.getSpeedType())) { + // PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + if (StringUtils.isBlank(pileDetailInfoVO.getSpeedType())) { continue; } - equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType())); - equipmentInfo.setEquipmentModel(modelInfo.getModelName()); + equipmentInfo.setEquipmentType(Integer.valueOf(pileDetailInfoVO.getSpeedType())); + equipmentInfo.setEquipmentModel(pileDetailInfoVO.getModelName()); - // Map pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn())); - Map pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn)); - String pileStatus = pileStatusMap.get(pileSn); - if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) { - // 1-在线 - pileStatus = LianLianPileStatusEnum.NORMAL.getCode(); - } else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) { - // 2-离线 - pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode(); - } else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) { - // 3-故障 - pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode(); - } - equipmentInfo.setEquipmentStatus(Integer.valueOf(pileStatus)); - equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + equipmentInfo.setEquipmentStatus(Integer.valueOf(pileDetailInfoVO.getPileStatus())); + equipmentInfo.setEquipmentPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); equipmentInfo.setNewNationalStandard(1); equipmentInfo.setVinFlag(1); equipmentInfo.setEquipmentName(pileSn); - equipmentInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + equipmentInfo.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); // 枪口列表 - List connectorList = getConnectorListForLianLian(pileSn); + List connectorList = getConnectorListForLianLian(pileDetailInfoVO); equipmentInfo.setConnectorInfos(connectorList); resultList.add(equipmentInfo); @@ -1276,6 +1257,25 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { return resultList; } + @Override + public List getPileDetailInfoList(String stationId) { + List pileDetailInfoList = pileBasicInfoMapper.getPileDetailInfoList(stationId); + if (CollectionUtils.isEmpty(pileDetailInfoList)) { + return new ArrayList<>(); + } + List pileSnList = pileDetailInfoList.stream() + .map(PileDetailInfoVO::getPileSn) + .collect(Collectors.toList()); + Map pileStatusV2 = pileConnectorInfoService.getPileStatus(pileSnList); + pileDetailInfoList.forEach(pileDetailInfoVO -> { + String pileSn = pileDetailInfoVO.getPileSn(); + if (pileStatusV2.containsKey(pileSn)) { + pileDetailInfoVO.setPileStatus(pileStatusV2.get(pileSn)); + } + }); + return pileDetailInfoList; + } + /** * 获取枪口列表 * @@ -1357,6 +1357,43 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { return resultList; } + + public List getConnectorListForLianLian(PileDetailInfoVO pileDetailInfoVO) { + List resultList = new ArrayList<>(); + + List list = pileConnectorInfoService.selectPileConnectorInfoList(pileDetailInfoVO.getPileSn()); + for (PileConnectorInfo pileConnectorInfo : list) { + ConnectorInfo connectorInfo = new ConnectorInfo(); + connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode()); + int connectorType = StringUtils.equals("1", pileDetailInfoVO.getSpeedType()) ? 4 : 3; + connectorInfo.setConnectorType(connectorType); + // 车位号 + if (StringUtils.isNotBlank(pileConnectorInfo.getParkNo())) { + connectorInfo.setParkNo(pileConnectorInfo.getParkNo()); + } + connectorInfo.setVoltageUpperLimits(Integer.valueOf(pileDetailInfoVO.getRatedVoltage())); + connectorInfo.setEquipmentClassification(1); + connectorInfo.setVoltageLowerLimits(Integer.valueOf(pileDetailInfoVO.getRatedVoltage())); + connectorInfo.setCurrent(Integer.valueOf(pileDetailInfoVO.getRatedCurrent())); + connectorInfo.setConnectorName(pileConnectorInfo.getPileConnectorCode()); + connectorInfo.setOperateStatus(50); // 50-正常使用 + connectorInfo.setOpreateStatus(50); // 50-正常使用 + connectorInfo.setNationalStandard(2); // 2-2015 + connectorInfo.setAuxPower(3); // 3-兼容12V和24V + + if (!StringUtils.equals(pileDetailInfoVO.getConnectorNum(), "1")) { + // 如果不是单枪,则枪口功率需要除以枪口数量 + String ratedPowerStr = pileDetailInfoVO.getRatedPower(); + BigDecimal ratedPower = new BigDecimal(ratedPowerStr); + connectorInfo.setPower(ratedPower.divide(new BigDecimal(pileDetailInfoVO.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP)); + }else { + connectorInfo.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + } + resultList.add(connectorInfo); + } + return resultList; + } + @Override public List getPileListForZDL(String stationId) { List resultList = new ArrayList<>(); 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 b46b31d4d..8ba365888 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 @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.jsowell.adapay.common.PaymentConfirmInfo; import com.jsowell.adapay.dto.QueryPaymentConfirmDTO; import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse; import com.jsowell.adapay.service.AdapayService; @@ -126,7 +127,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService { .paymentId(paymentId) .build(); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(build); - List paymentConfirms = response.getPaymentConfirms(); + List paymentConfirms = response.getPaymentConfirms(); // 如果没有分账信息,说明没有清分 String clearingStatus = null; if (CollectionUtils.isEmpty(paymentConfirms)) { @@ -548,7 +549,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService { .paymentId(paymentId) .build(); QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(build); - List paymentConfirms = response.getPaymentConfirms(); + List paymentConfirms = response.getPaymentConfirms(); if (!CollectionUtils.isEmpty(paymentConfirms)) { clearingBillVO.setConfirmInfo(paymentConfirms.get(0)); clearingList.add(clearingBillVO); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java new file mode 100644 index 000000000..bf9b0f840 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java @@ -0,0 +1,33 @@ +package com.jsowell.pile.thirdparty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 第三方平台桩信息VO + * + * @author Lemon + * @Date 2024/12/19 14:41:52 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class PileDetailInfoVO { + + private String pileSn; + + private Date createTime; + + private String speedType; + private String modelName; + private String ratedPower; + private String ratedVoltage; + private String ratedCurrent; + private String connectorNum; + private String pileStatus; +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/lianlian/AccumulativeInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/lianlian/AccumulativeInfoVO.java index 526491d93..cf2713e27 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/lianlian/AccumulativeInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/lianlian/AccumulativeInfoVO.java @@ -41,6 +41,11 @@ public class AccumulativeInfoVO { */ private String endTime; + /** + * 充电时长 + */ + private String chargingTime; + /** * 枪口充电量 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/ClearingBillVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/ClearingBillVO.java index 874cb4f24..d0b1a29db 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/ClearingBillVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/ClearingBillVO.java @@ -1,6 +1,6 @@ package com.jsowell.pile.vo.web; -import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse; +import com.jsowell.adapay.common.PaymentConfirmInfo; import lombok.Data; import java.math.BigDecimal; @@ -37,5 +37,5 @@ public class ClearingBillVO { */ private String withdrawStatus; - private QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirmInfo; + private PaymentConfirmInfo confirmInfo; } diff --git a/jsowell-pile/src/main/resources/mapper/pile/AreaCodeInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/AreaCodeInfoMapper.xml new file mode 100644 index 000000000..5ea625fe0 --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/AreaCodeInfoMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + select id, level, parent_code, area_code, zip_code, city_code, name, short_name, merger_name, pinyin, lng, lat from area_code_info + + + + + + + + insert into area_code_info + + level, + parent_code, + area_code, + zip_code, + city_code, + name, + short_name, + merger_name, + pinyin, + lng, + lat, + + + #{level}, + #{parentCode}, + #{areaCode}, + #{zipCode}, + #{cityCode}, + #{name}, + #{shortName}, + #{mergerName}, + #{pinyin}, + #{lng}, + #{lat}, + + + + + update area_code_info + + level = #{level}, + parent_code = #{parentCode}, + area_code = #{areaCode}, + zip_code = #{zipCode}, + city_code = #{cityCode}, + name = #{name}, + short_name = #{shortName}, + merger_name = #{mergerName}, + pinyin = #{pinyin}, + lng = #{lng}, + lat = #{lat}, + + where id = #{id} + + + + delete from area_code_info where id = #{id} + + + + delete from area_code_info where id in + + #{id} + + + \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index fce21a633..53e4cfc8c 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -1,1654 +1,1670 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, order_code, transaction_code, order_status, member_id, station_id, merchant_id, - pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type, - pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, virtual_amount, - group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time, - start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason, settlement_time, refund_amount, - refund_status, create_by, create_time, update_by, update_time, del_flag - - - - - delete from order_basic_info - where id = #{id,jdbcType=INTEGER} - - - - insert into order_basic_info (order_code, transaction_code, order_status, - member_id, station_id, merchant_id, - pile_sn, connector_code, pile_connector_code, - logic_card, vin_code, start_mode, - third_party_type, pay_mode, pay_status, - pay_amount, pay_time, plate_number, - order_amount, virtual_amount, group_code, - discount_amount, settle_amount, remedial_amount, - charge_start_time, charge_end_time, start_type, - reserved_start_time, reserved_end_time, - start_soc, end_soc, stop_reason_code, - reason, settlement_time, refund_amount, - refund_status, create_by, create_time, - update_by, update_time, del_flag - ) - values (#{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR}, - #{memberId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, - #{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR}, - #{logicCard,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR}, - #{thirdPartyType,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payStatus,jdbcType=VARCHAR}, - #{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR}, - #{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR}, - #{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL}, - #{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR}, - #{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP}, - #{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{stopReasonCode,jdbcType=VARCHAR}, - #{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL}, - #{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR} - ) - - - - insert into order_basic_info - - - order_code, - - - transaction_code, - - - order_status, - - - member_id, - - - station_id, - - - merchant_id, - - - pile_sn, - - - connector_code, - - - pile_connector_code, - - - logic_card, - - - vin_code, - - - start_mode, - - - third_party_type, - - - pay_mode, - - - pay_status, - - - pay_amount, - - - pay_time, - - - plate_number, - - - order_amount, - - - virtual_amount, - - - group_code, - - - discount_amount, - - - settle_amount, - - - remedial_amount, - - - charge_start_time, - - - charge_end_time, - - - start_type, - - - reserved_start_time, - - - reserved_end_time, - - - start_soc, - - - end_soc, - - - stop_reason_code,, - - - reason, - - - settlement_time, - - - refund_amount, - - - refund_status, - - - create_by, - - - create_time, - - - update_by, - - - update_time, - - - del_flag, - - - - - #{orderCode,jdbcType=VARCHAR}, - - - #{transactionCode,jdbcType=VARCHAR}, - - - #{orderStatus,jdbcType=VARCHAR}, - - - #{memberId,jdbcType=VARCHAR}, - - - #{stationId,jdbcType=VARCHAR}, - - - #{merchantId,jdbcType=VARCHAR}, - - - #{pileSn,jdbcType=VARCHAR}, - - - #{connectorCode,jdbcType=VARCHAR}, - - - #{pileConnectorCode,jdbcType=VARCHAR}, - - - #{logicCard,jdbcType=VARCHAR}, - - - #{vinCode,jdbcType=VARCHAR}, - - - #{startMode,jdbcType=VARCHAR}, - - - #{thirdPartyType,jdbcType=VARCHAR}, - - - #{payMode,jdbcType=VARCHAR}, - - - #{payStatus,jdbcType=VARCHAR}, - - - #{payAmount,jdbcType=DECIMAL}, - - - #{payTime,jdbcType=TIMESTAMP}, - - - #{plateNumber,jdbcType=VARCHAR}, - - - #{orderAmount,jdbcType=DECIMAL}, - - - #{virtualAmount,jdbcType=DECIMAL}, - - - #{groupCode,jdbcType=VARCHAR}, - - - #{discountAmount,jdbcType=DECIMAL}, - - - #{settleAmount,jdbcType=DECIMAL}, - - - #{remedialAmount,jdbcType=DECIMAL}, - - - #{chargeStartTime,jdbcType=TIMESTAMP}, - - - #{chargeEndTime,jdbcType=TIMESTAMP}, - - - #{startType,jdbcType=VARCHAR}, - - - #{reservedStartTime}, - - - #{reservedEndTime}, - - - #{startSoc,jdbcType=VARCHAR}, - - - #{endSoc,jdbcType=VARCHAR}, - - - #{stopReasonCode,jdbcType=VARCHAR}, - - - #{reason,jdbcType=VARCHAR}, - - - #{settlementTime,jdbcType=TIMESTAMP}, - - - #{refundAmount,jdbcType=DECIMAL}, - - - #{refundStatus,jdbcType=VARCHAR}, - - - #{createBy,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateBy,jdbcType=VARCHAR}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{delFlag,jdbcType=CHAR}, - - - - - - update order_basic_info - - - order_code = #{orderCode,jdbcType=VARCHAR}, - - - transaction_code = #{transactionCode,jdbcType=VARCHAR}, - - - order_status = #{orderStatus,jdbcType=VARCHAR}, - - - member_id = #{memberId,jdbcType=VARCHAR}, - - - station_id = #{stationId,jdbcType=VARCHAR}, - - - merchant_id = #{merchantId,jdbcType=VARCHAR}, - - - pile_sn = #{pileSn,jdbcType=VARCHAR}, - - - connector_code = #{connectorCode,jdbcType=VARCHAR}, - - - pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, - - - logic_card = #{logicCard,jdbcType=VARCHAR}, - - - vin_code = #{vinCode,jdbcType=VARCHAR}, - - - start_mode = #{startMode,jdbcType=VARCHAR}, - - - third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, - - - pay_mode = #{payMode,jdbcType=VARCHAR}, - - - pay_status = #{payStatus,jdbcType=VARCHAR}, - - - pay_amount = #{payAmount,jdbcType=DECIMAL}, - - - pay_time = #{payTime,jdbcType=TIMESTAMP}, - - - plate_number = #{plateNumber,jdbcType=VARCHAR}, - - - order_amount = #{orderAmount,jdbcType=DECIMAL}, - - - virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, - - - group_code = #{groupCode,jdbcType=VARCHAR}, - - - discount_amount = #{discountAmount,jdbcType=DECIMAL}, - - - settle_amount = #{settleAmount,jdbcType=DECIMAL}, - - - remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, - - - charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, - - - charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, - - - start_type = #{startType,jdbcType=VARCHAR}, - - - reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, - - - reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, - - - start_soc = #{startSoc,jdbcType=VARCHAR}, - - - end_soc = #{endSoc,jdbcType=VARCHAR}, - - - stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR}, - - - reason = #{reason,jdbcType=VARCHAR}, - - - settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, - - - refund_amount = #{refundAmount,jdbcType=DECIMAL}, - - - refund_status = #{refundStatus,jdbcType=VARCHAR}, - - - create_by = #{createBy,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_by = #{updateBy,jdbcType=VARCHAR}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - del_flag = #{delFlag,jdbcType=CHAR}, - - - where id = #{id,jdbcType=INTEGER} - - - - update order_basic_info - set order_code = #{orderCode,jdbcType=VARCHAR}, - transaction_code = #{transactionCode,jdbcType=VARCHAR}, - order_status = #{orderStatus,jdbcType=VARCHAR}, - member_id = #{memberId,jdbcType=VARCHAR}, - station_id = #{stationId,jdbcType=VARCHAR}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - pile_sn = #{pileSn,jdbcType=VARCHAR}, - connector_code = #{connectorCode,jdbcType=VARCHAR}, - pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, - logic_card = #{logicCard,jdbcType=VARCHAR}, - vin_code = #{vinCode,jdbcType=VARCHAR}, - start_mode = #{startMode,jdbcType=VARCHAR}, - third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, - pay_mode = #{payMode,jdbcType=VARCHAR}, - pay_status = #{payStatus,jdbcType=VARCHAR}, - pay_amount = #{payAmount,jdbcType=DECIMAL}, - pay_time = #{payTime,jdbcType=TIMESTAMP}, - plate_number = #{plateNumber,jdbcType=VARCHAR}, - order_amount = #{orderAmount,jdbcType=DECIMAL}, - virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, - group_code = #{groupCode,jdbcType=VARCHAR}, - discount_amount = #{discountAmount,jdbcType=DECIMAL}, - settle_amount = #{settleAmount,jdbcType=DECIMAL}, - remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, - charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, - charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, - start_type = #{startType,jdbcType=VARCHAR}, - reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, - reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, - start_soc = #{startSoc,jdbcType=VARCHAR}, - end_soc = #{endSoc,jdbcType=VARCHAR}, - stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR}, - reason = #{reason,jdbcType=VARCHAR}, - settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, - refund_amount = #{refundAmount,jdbcType=DECIMAL}, - refund_status = #{refundStatus,jdbcType=VARCHAR}, - create_by = #{createBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_by = #{updateBy,jdbcType=VARCHAR}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - del_flag = #{delFlag,jdbcType=CHAR} - where id = #{id,jdbcType=INTEGER} - - - - update order_basic_info - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} - - - - where id in - - #{item.id,jdbcType=INTEGER} - - - - - update order_basic_info - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} - - - - - - - when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} - - - - - where id in - - #{item.id,jdbcType=INTEGER} - - - - - insert into order_basic_info - (order_code, transaction_code, order_status, member_id, station_id, merchant_id, - pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, - third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, - virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, - charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason, settlement_time, - refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag - ) - values - - (#{item.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR}, #{item.orderStatus,jdbcType=VARCHAR}, - #{item.memberId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, - #{item.pileSn,jdbcType=VARCHAR}, #{item.connectorCode,jdbcType=VARCHAR}, #{item.pileConnectorCode,jdbcType=VARCHAR}, - #{item.logicCard,jdbcType=VARCHAR}, #{item.vinCode,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR}, - #{item.thirdPartyType,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR}, #{item.payStatus,jdbcType=VARCHAR}, - #{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP}, #{item.plateNumber,jdbcType=VARCHAR}, - #{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, #{item.groupCode,jdbcType=VARCHAR}, - #{item.discountAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL}, - #{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP}, - #{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservedStartTime,jdbcType=TIMESTAMP}, - #{item.reservedEndTime,jdbcType=TIMESTAMP}, - #{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.stopReasonCode,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR}, - #{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL}, - #{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, - #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, order_code, transaction_code, order_status, member_id, station_id, merchant_id, + pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type, + pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, virtual_amount, + group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time, + start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason, + settlement_time, refund_amount, + refund_status, create_by, create_time, update_by, update_time, del_flag + + + + + delete from order_basic_info + where id = #{id,jdbcType=INTEGER} + + + + insert into order_basic_info (order_code, transaction_code, order_status, + member_id, station_id, merchant_id, + pile_sn, connector_code, pile_connector_code, + logic_card, vin_code, start_mode, + third_party_type, pay_mode, pay_status, + pay_amount, pay_time, plate_number, + order_amount, virtual_amount, group_code, + discount_amount, settle_amount, remedial_amount, + charge_start_time, charge_end_time, start_type, + reserved_start_time, reserved_end_time, + start_soc, end_soc, stop_reason_code, + reason, settlement_time, refund_amount, + refund_status, create_by, create_time, + update_by, update_time, del_flag ) - - - - - insert into order_basic_info - - - id, - - order_code, - transaction_code, - order_status, - member_id, - station_id, - merchant_id, - pile_sn, - connector_code, - pile_connector_code, - logic_card, - vin_code, - start_mode, - third_party_type, - pay_mode, - pay_status, - pay_amount, - pay_time, - plate_number, - order_amount, - virtual_amount, - group_code, - discount_amount, - settle_amount, - remedial_amount, - charge_start_time, - charge_end_time, - start_type, - reserved_start_time, - reserved_end_time, - start_soc, - end_soc, - stop_reason_code, - reason, - settlement_time, - refund_amount, - refund_status, - create_by, - create_time, - update_by, - update_time, - del_flag, - - values - - - #{id,jdbcType=INTEGER}, - - #{orderCode,jdbcType=VARCHAR}, - #{transactionCode,jdbcType=VARCHAR}, - #{orderStatus,jdbcType=VARCHAR}, - #{memberId,jdbcType=VARCHAR}, - #{stationId,jdbcType=VARCHAR}, - #{merchantId,jdbcType=VARCHAR}, - #{pileSn,jdbcType=VARCHAR}, - #{connectorCode,jdbcType=VARCHAR}, - #{pileConnectorCode,jdbcType=VARCHAR}, - #{logicCard,jdbcType=VARCHAR}, - #{vinCode,jdbcType=VARCHAR}, - #{startMode,jdbcType=VARCHAR}, - #{thirdPartyType,jdbcType=VARCHAR}, - #{payMode,jdbcType=VARCHAR}, - #{payStatus,jdbcType=VARCHAR}, - #{payAmount,jdbcType=DECIMAL}, - #{payTime,jdbcType=TIMESTAMP}, - #{plateNumber,jdbcType=VARCHAR}, - #{orderAmount,jdbcType=DECIMAL}, - #{virtualAmount,jdbcType=DECIMAL}, - #{groupCode,jdbcType=VARCHAR}, - #{discountAmount,jdbcType=DECIMAL}, - #{settleAmount,jdbcType=DECIMAL}, - #{remedialAmount,jdbcType=DECIMAL}, - #{chargeStartTime,jdbcType=TIMESTAMP}, - #{chargeEndTime,jdbcType=TIMESTAMP}, - #{startType,jdbcType=VARCHAR}, - #{reservedStartTime,jdbcType=TIMESTAMP}, - #{reservedEndTime,jdbcType=TIMESTAMP}, - #{startSoc,jdbcType=VARCHAR}, - #{endSoc,jdbcType=VARCHAR}, - #{stopReasonCode,jdbcType=VARCHAR}, - #{reason,jdbcType=VARCHAR}, - #{settlementTime,jdbcType=TIMESTAMP}, - #{refundAmount,jdbcType=DECIMAL}, - #{refundStatus,jdbcType=VARCHAR}, - #{createBy,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, - #{updateBy,jdbcType=VARCHAR}, - #{updateTime,jdbcType=TIMESTAMP}, - #{delFlag,jdbcType=CHAR}, - - on duplicate key update - - - id = #{id,jdbcType=INTEGER}, - - order_code = #{orderCode,jdbcType=VARCHAR}, - transaction_code = #{transactionCode,jdbcType=VARCHAR}, - order_status = #{orderStatus,jdbcType=VARCHAR}, - member_id = #{memberId,jdbcType=VARCHAR}, - station_id = #{stationId,jdbcType=VARCHAR}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - pile_sn = #{pileSn,jdbcType=VARCHAR}, - connector_code = #{connectorCode,jdbcType=VARCHAR}, - pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, - logic_card = #{logicCard,jdbcType=VARCHAR}, - vin_code = #{vinCode,jdbcType=VARCHAR}, - start_mode = #{startMode,jdbcType=VARCHAR}, - third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, - pay_mode = #{payMode,jdbcType=VARCHAR}, - pay_status = #{payStatus,jdbcType=VARCHAR}, - pay_amount = #{payAmount,jdbcType=DECIMAL}, - pay_time = #{payTime,jdbcType=TIMESTAMP}, - plate_number = #{plateNumber,jdbcType=VARCHAR}, - order_amount = #{orderAmount,jdbcType=DECIMAL}, - virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, - group_code = #{groupCode,jdbcType=VARCHAR}, - discount_amount = #{discountAmount,jdbcType=DECIMAL}, - settle_amount = #{settleAmount,jdbcType=DECIMAL}, - remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, - charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, - charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, - start_type = #{startType,jdbcType=VARCHAR}, - reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, - reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, - start_soc = #{startSoc,jdbcType=VARCHAR}, - end_soc = #{endSoc,jdbcType=VARCHAR}, - stop_reason_code = {stopReasonCode,jdbcType=VARCHAR}, - reason = #{reason,jdbcType=VARCHAR}, - settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, - refund_amount = #{refundAmount,jdbcType=DECIMAL}, - refund_status = #{refundStatus,jdbcType=VARCHAR}, - create_by = #{createBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_by = #{updateBy,jdbcType=VARCHAR}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - del_flag = #{delFlag,jdbcType=CHAR}, - - - - - insert into order_basic_info - - - id, - - - order_code, - - - transaction_code, - - - order_status, - - - member_id, - - - station_id, - - - merchant_id, - - - pile_sn, - - - connector_code, - - - pile_connector_code, - - - logic_card, - - - vin_code, - - - start_mode, - - - third_party_type, - - - pay_mode, - - - pay_status, - - - pay_amount, - - - pay_time, - - - plate_number, - - - order_amount, - - - virtual_amount, - - - group_code, - - - discount_amount, - - - settle_amount, - - - remedial_amount, - - - charge_start_time, - - - charge_end_time, - - - start_type, - - - reserved_start_time, - - - reserved_end_time, - - - start_soc, - - - end_soc, - - - stop_reason_code, - - - reason, - - - settlement_time, - - - refund_amount, - - - refund_status, - - - create_by, - - - create_time, - - - update_by, - - - update_time, - - - del_flag, - - - values - - - #{id,jdbcType=INTEGER}, - - - #{orderCode,jdbcType=VARCHAR}, - - - #{transactionCode,jdbcType=VARCHAR}, - - - #{orderStatus,jdbcType=VARCHAR}, - - - #{memberId,jdbcType=VARCHAR}, - - - #{stationId,jdbcType=VARCHAR}, - - - #{merchantId,jdbcType=VARCHAR}, - - - #{pileSn,jdbcType=VARCHAR}, - - - #{connectorCode,jdbcType=VARCHAR}, - - - #{pileConnectorCode,jdbcType=VARCHAR}, - - - #{logicCard,jdbcType=VARCHAR}, - - - #{vinCode,jdbcType=VARCHAR}, - - - #{startMode,jdbcType=VARCHAR}, - - - #{thirdPartyType,jdbcType=VARCHAR}, - - - #{payMode,jdbcType=VARCHAR}, - - - #{payStatus,jdbcType=VARCHAR}, - - - #{payAmount,jdbcType=DECIMAL}, - - - #{payTime,jdbcType=TIMESTAMP}, - - - #{plateNumber,jdbcType=VARCHAR}, - - - #{orderAmount,jdbcType=DECIMAL}, - - - #{virtualAmount,jdbcType=DECIMAL}, - - - #{groupCode,jdbcType=VARCHAR}, - - - #{discountAmount,jdbcType=DECIMAL}, - - - #{settleAmount,jdbcType=DECIMAL}, - - - #{remedialAmount,jdbcType=DECIMAL}, - - - #{chargeStartTime,jdbcType=TIMESTAMP}, - - - #{chargeEndTime,jdbcType=TIMESTAMP}, - - - #{startType,jdbcType=VARCHAR}, - - - #{reservedStartTime,jdbcType=TIMESTAMP}, - - - #{reservedEndTime,jdbcType=TIMESTAMP}, - - - #{startSoc,jdbcType=VARCHAR}, - - - #{endSoc,jdbcType=VARCHAR}, - - - #{stopReasonCode,jdbcType=VARCHAR}, - - - #{reason,jdbcType=VARCHAR}, - - - #{settlementTime,jdbcType=TIMESTAMP}, - - - #{refundAmount,jdbcType=DECIMAL}, - - - #{refundStatus,jdbcType=VARCHAR}, - - - #{createBy,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateBy,jdbcType=VARCHAR}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{delFlag,jdbcType=CHAR}, - - - on duplicate key update - - - id = #{id,jdbcType=INTEGER}, - - - order_code = #{orderCode,jdbcType=VARCHAR}, - - + values (#{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR}, + #{memberId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, + #{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR}, + #{logicCard,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR}, + #{thirdPartyType,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payStatus,jdbcType=VARCHAR}, + #{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR}, + #{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR}, + #{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL}, + #{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR}, + #{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP}, + #{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{stopReasonCode,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL}, + #{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR} + ) + + + + insert into order_basic_info + + + order_code, + + + transaction_code, + + + order_status, + + + member_id, + + + station_id, + + + merchant_id, + + + pile_sn, + + + connector_code, + + + pile_connector_code, + + + logic_card, + + + vin_code, + + + start_mode, + + + third_party_type, + + + pay_mode, + + + pay_status, + + + pay_amount, + + + pay_time, + + + plate_number, + + + order_amount, + + + virtual_amount, + + + group_code, + + + discount_amount, + + + settle_amount, + + + remedial_amount, + + + charge_start_time, + + + charge_end_time, + + + start_type, + + + reserved_start_time, + + + reserved_end_time, + + + start_soc, + + + end_soc, + + + stop_reason_code,, + + + reason, + + + settlement_time, + + + refund_amount, + + + refund_status, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + + + #{orderCode,jdbcType=VARCHAR}, + + + #{transactionCode,jdbcType=VARCHAR}, + + + #{orderStatus,jdbcType=VARCHAR}, + + + #{memberId,jdbcType=VARCHAR}, + + + #{stationId,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{pileSn,jdbcType=VARCHAR}, + + + #{connectorCode,jdbcType=VARCHAR}, + + + #{pileConnectorCode,jdbcType=VARCHAR}, + + + #{logicCard,jdbcType=VARCHAR}, + + + #{vinCode,jdbcType=VARCHAR}, + + + #{startMode,jdbcType=VARCHAR}, + + + #{thirdPartyType,jdbcType=VARCHAR}, + + + #{payMode,jdbcType=VARCHAR}, + + + #{payStatus,jdbcType=VARCHAR}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{payTime,jdbcType=TIMESTAMP}, + + + #{plateNumber,jdbcType=VARCHAR}, + + + #{orderAmount,jdbcType=DECIMAL}, + + + #{virtualAmount,jdbcType=DECIMAL}, + + + #{groupCode,jdbcType=VARCHAR}, + + + #{discountAmount,jdbcType=DECIMAL}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{remedialAmount,jdbcType=DECIMAL}, + + + #{chargeStartTime,jdbcType=TIMESTAMP}, + + + #{chargeEndTime,jdbcType=TIMESTAMP}, + + + #{startType,jdbcType=VARCHAR}, + + + #{reservedStartTime}, + + + #{reservedEndTime}, + + + #{startSoc,jdbcType=VARCHAR}, + + + #{endSoc,jdbcType=VARCHAR}, + + + #{stopReasonCode,jdbcType=VARCHAR}, + + + #{reason,jdbcType=VARCHAR}, + + + #{settlementTime,jdbcType=TIMESTAMP}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{refundStatus,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=CHAR}, + + + + + + update order_basic_info + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + transaction_code = #{transactionCode,jdbcType=VARCHAR}, + + + order_status = #{orderStatus,jdbcType=VARCHAR}, + + + member_id = #{memberId,jdbcType=VARCHAR}, + + + station_id = #{stationId,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + pile_sn = #{pileSn,jdbcType=VARCHAR}, + + + connector_code = #{connectorCode,jdbcType=VARCHAR}, + + + pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, + + + logic_card = #{logicCard,jdbcType=VARCHAR}, + + + vin_code = #{vinCode,jdbcType=VARCHAR}, + + + start_mode = #{startMode,jdbcType=VARCHAR}, + + + third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, + + + pay_mode = #{payMode,jdbcType=VARCHAR}, + + + pay_status = #{payStatus,jdbcType=VARCHAR}, + + + pay_amount = #{payAmount,jdbcType=DECIMAL}, + + + pay_time = #{payTime,jdbcType=TIMESTAMP}, + + + plate_number = #{plateNumber,jdbcType=VARCHAR}, + + + order_amount = #{orderAmount,jdbcType=DECIMAL}, + + + virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, + + + group_code = #{groupCode,jdbcType=VARCHAR}, + + + discount_amount = #{discountAmount,jdbcType=DECIMAL}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, + + + charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, + + + charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, + + + start_type = #{startType,jdbcType=VARCHAR}, + + + reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, + + + reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, + + + start_soc = #{startSoc,jdbcType=VARCHAR}, + + + end_soc = #{endSoc,jdbcType=VARCHAR}, + + + stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, + + + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + + + refund_status = #{refundStatus,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{delFlag,jdbcType=CHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + update order_basic_info + set order_code = #{orderCode,jdbcType=VARCHAR}, transaction_code = #{transactionCode,jdbcType=VARCHAR}, - - order_status = #{orderStatus,jdbcType=VARCHAR}, - - member_id = #{memberId,jdbcType=VARCHAR}, - - station_id = #{stationId,jdbcType=VARCHAR}, - - merchant_id = #{merchantId,jdbcType=VARCHAR}, - - pile_sn = #{pileSn,jdbcType=VARCHAR}, - - connector_code = #{connectorCode,jdbcType=VARCHAR}, - - pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, - - logic_card = #{logicCard,jdbcType=VARCHAR}, - - vin_code = #{vinCode,jdbcType=VARCHAR}, - - start_mode = #{startMode,jdbcType=VARCHAR}, - - third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, - - pay_mode = #{payMode,jdbcType=VARCHAR}, - - pay_status = #{payStatus,jdbcType=VARCHAR}, - - pay_amount = #{payAmount,jdbcType=DECIMAL}, - - pay_time = #{payTime,jdbcType=TIMESTAMP}, - - plate_number = #{plateNumber,jdbcType=VARCHAR}, - - order_amount = #{orderAmount,jdbcType=DECIMAL}, - - virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, - - group_code = #{groupCode,jdbcType=VARCHAR}, - - discount_amount = #{discountAmount,jdbcType=DECIMAL}, - - settle_amount = #{settleAmount,jdbcType=DECIMAL}, - - remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, - - charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, - - charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, - - start_type = #{startType,jdbcType=VARCHAR}, - - reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, - - reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, - - start_soc = #{startSoc,jdbcType=VARCHAR}, - - end_soc = #{endSoc,jdbcType=VARCHAR}, - - stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR}, - - reason = #{reason,jdbcType=VARCHAR}, - - settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, - - refund_amount = #{refundAmount,jdbcType=DECIMAL}, - - refund_status = #{refundStatus,jdbcType=VARCHAR}, - - create_by = #{createBy,jdbcType=VARCHAR}, - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - update_by = #{updateBy,jdbcType=VARCHAR}, - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - del_flag = #{delFlag,jdbcType=CHAR}, - - - + del_flag = #{delFlag,jdbcType=CHAR} + where id = #{id,jdbcType=INTEGER} + + + + update order_basic_info + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + update order_basic_info + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP} + + + + + + + when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR} + + + + + where id in + + #{item.id,jdbcType=INTEGER} + + + + + insert into order_basic_info + (order_code, transaction_code, order_status, member_id, station_id, merchant_id, + pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, + third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, + virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, + charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, + reason, settlement_time, + refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag + ) + values + + (#{item.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR}, + #{item.orderStatus,jdbcType=VARCHAR}, + #{item.memberId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, + #{item.pileSn,jdbcType=VARCHAR}, #{item.connectorCode,jdbcType=VARCHAR}, + #{item.pileConnectorCode,jdbcType=VARCHAR}, + #{item.logicCard,jdbcType=VARCHAR}, #{item.vinCode,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR}, + #{item.thirdPartyType,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR}, + #{item.payStatus,jdbcType=VARCHAR}, + #{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP}, + #{item.plateNumber,jdbcType=VARCHAR}, + #{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, + #{item.groupCode,jdbcType=VARCHAR}, + #{item.discountAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL}, + #{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP}, + #{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, + #{item.reservedStartTime,jdbcType=TIMESTAMP}, + #{item.reservedEndTime,jdbcType=TIMESTAMP}, + #{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.stopReasonCode,jdbcType=VARCHAR}, + #{item.reason,jdbcType=VARCHAR}, + #{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL}, + #{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR} + ) + + + + + insert into order_basic_info + + + id, + + order_code, + transaction_code, + order_status, + member_id, + station_id, + merchant_id, + pile_sn, + connector_code, + pile_connector_code, + logic_card, + vin_code, + start_mode, + third_party_type, + pay_mode, + pay_status, + pay_amount, + pay_time, + plate_number, + order_amount, + virtual_amount, + group_code, + discount_amount, + settle_amount, + remedial_amount, + charge_start_time, + charge_end_time, + start_type, + reserved_start_time, + reserved_end_time, + start_soc, + end_soc, + stop_reason_code, + reason, + settlement_time, + refund_amount, + refund_status, + create_by, + create_time, + update_by, + update_time, + del_flag, + + values + + + #{id,jdbcType=INTEGER}, + + #{orderCode,jdbcType=VARCHAR}, + #{transactionCode,jdbcType=VARCHAR}, + #{orderStatus,jdbcType=VARCHAR}, + #{memberId,jdbcType=VARCHAR}, + #{stationId,jdbcType=VARCHAR}, + #{merchantId,jdbcType=VARCHAR}, + #{pileSn,jdbcType=VARCHAR}, + #{connectorCode,jdbcType=VARCHAR}, + #{pileConnectorCode,jdbcType=VARCHAR}, + #{logicCard,jdbcType=VARCHAR}, + #{vinCode,jdbcType=VARCHAR}, + #{startMode,jdbcType=VARCHAR}, + #{thirdPartyType,jdbcType=VARCHAR}, + #{payMode,jdbcType=VARCHAR}, + #{payStatus,jdbcType=VARCHAR}, + #{payAmount,jdbcType=DECIMAL}, + #{payTime,jdbcType=TIMESTAMP}, + #{plateNumber,jdbcType=VARCHAR}, + #{orderAmount,jdbcType=DECIMAL}, + #{virtualAmount,jdbcType=DECIMAL}, + #{groupCode,jdbcType=VARCHAR}, + #{discountAmount,jdbcType=DECIMAL}, + #{settleAmount,jdbcType=DECIMAL}, + #{remedialAmount,jdbcType=DECIMAL}, + #{chargeStartTime,jdbcType=TIMESTAMP}, + #{chargeEndTime,jdbcType=TIMESTAMP}, + #{startType,jdbcType=VARCHAR}, + #{reservedStartTime,jdbcType=TIMESTAMP}, + #{reservedEndTime,jdbcType=TIMESTAMP}, + #{startSoc,jdbcType=VARCHAR}, + #{endSoc,jdbcType=VARCHAR}, + #{stopReasonCode,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{settlementTime,jdbcType=TIMESTAMP}, + #{refundAmount,jdbcType=DECIMAL}, + #{refundStatus,jdbcType=VARCHAR}, + #{createBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, + #{updateBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=CHAR}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + order_code = #{orderCode,jdbcType=VARCHAR}, + transaction_code = #{transactionCode,jdbcType=VARCHAR}, + order_status = #{orderStatus,jdbcType=VARCHAR}, + member_id = #{memberId,jdbcType=VARCHAR}, + station_id = #{stationId,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + pile_sn = #{pileSn,jdbcType=VARCHAR}, + connector_code = #{connectorCode,jdbcType=VARCHAR}, + pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, + logic_card = #{logicCard,jdbcType=VARCHAR}, + vin_code = #{vinCode,jdbcType=VARCHAR}, + start_mode = #{startMode,jdbcType=VARCHAR}, + third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, + pay_mode = #{payMode,jdbcType=VARCHAR}, + pay_status = #{payStatus,jdbcType=VARCHAR}, + pay_amount = #{payAmount,jdbcType=DECIMAL}, + pay_time = #{payTime,jdbcType=TIMESTAMP}, + plate_number = #{plateNumber,jdbcType=VARCHAR}, + order_amount = #{orderAmount,jdbcType=DECIMAL}, + virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, + group_code = #{groupCode,jdbcType=VARCHAR}, + discount_amount = #{discountAmount,jdbcType=DECIMAL}, + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, + charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, + charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, + start_type = #{startType,jdbcType=VARCHAR}, + reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, + reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, + start_soc = #{startSoc,jdbcType=VARCHAR}, + end_soc = #{endSoc,jdbcType=VARCHAR}, + stop_reason_code = {stopReasonCode,jdbcType=VARCHAR}, + reason = #{reason,jdbcType=VARCHAR}, + settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + refund_status = #{refundStatus,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + del_flag = #{delFlag,jdbcType=CHAR}, + + + + + insert into order_basic_info + + + id, + + + order_code, + + + transaction_code, + + + order_status, + + + member_id, + + + station_id, + + + merchant_id, + + + pile_sn, + + + connector_code, + + + pile_connector_code, + + + logic_card, + + + vin_code, + + + start_mode, + + + third_party_type, + + + pay_mode, + + + pay_status, + + + pay_amount, + + + pay_time, + + + plate_number, + + + order_amount, + + + virtual_amount, + + + group_code, + + + discount_amount, + + + settle_amount, + + + remedial_amount, + + + charge_start_time, + + + charge_end_time, + + + start_type, + + + reserved_start_time, + + + reserved_end_time, + + + start_soc, + + + end_soc, + + + stop_reason_code, + + + reason, + + + settlement_time, + + + refund_amount, + + + refund_status, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{orderCode,jdbcType=VARCHAR}, + + + #{transactionCode,jdbcType=VARCHAR}, + + + #{orderStatus,jdbcType=VARCHAR}, + + + #{memberId,jdbcType=VARCHAR}, + + + #{stationId,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{pileSn,jdbcType=VARCHAR}, + + + #{connectorCode,jdbcType=VARCHAR}, + + + #{pileConnectorCode,jdbcType=VARCHAR}, + + + #{logicCard,jdbcType=VARCHAR}, + + + #{vinCode,jdbcType=VARCHAR}, + + + #{startMode,jdbcType=VARCHAR}, + + + #{thirdPartyType,jdbcType=VARCHAR}, + + + #{payMode,jdbcType=VARCHAR}, + + + #{payStatus,jdbcType=VARCHAR}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{payTime,jdbcType=TIMESTAMP}, + + + #{plateNumber,jdbcType=VARCHAR}, + + + #{orderAmount,jdbcType=DECIMAL}, + + + #{virtualAmount,jdbcType=DECIMAL}, + + + #{groupCode,jdbcType=VARCHAR}, + + + #{discountAmount,jdbcType=DECIMAL}, + + + #{settleAmount,jdbcType=DECIMAL}, + + + #{remedialAmount,jdbcType=DECIMAL}, + + + #{chargeStartTime,jdbcType=TIMESTAMP}, + + + #{chargeEndTime,jdbcType=TIMESTAMP}, + + + #{startType,jdbcType=VARCHAR}, + + + #{reservedStartTime,jdbcType=TIMESTAMP}, + + + #{reservedEndTime,jdbcType=TIMESTAMP}, + + + #{startSoc,jdbcType=VARCHAR}, + + + #{endSoc,jdbcType=VARCHAR}, + + + #{stopReasonCode,jdbcType=VARCHAR}, + + + #{reason,jdbcType=VARCHAR}, + + + #{settlementTime,jdbcType=TIMESTAMP}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{refundStatus,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=CHAR}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + order_code = #{orderCode,jdbcType=VARCHAR}, + + + transaction_code = #{transactionCode,jdbcType=VARCHAR}, + + + order_status = #{orderStatus,jdbcType=VARCHAR}, + + + member_id = #{memberId,jdbcType=VARCHAR}, + + + station_id = #{stationId,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + pile_sn = #{pileSn,jdbcType=VARCHAR}, + + + connector_code = #{connectorCode,jdbcType=VARCHAR}, + + + pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}, + + + logic_card = #{logicCard,jdbcType=VARCHAR}, + + + vin_code = #{vinCode,jdbcType=VARCHAR}, + + + start_mode = #{startMode,jdbcType=VARCHAR}, + + + third_party_type = #{thirdPartyType,jdbcType=VARCHAR}, + + + pay_mode = #{payMode,jdbcType=VARCHAR}, + + + pay_status = #{payStatus,jdbcType=VARCHAR}, + + + pay_amount = #{payAmount,jdbcType=DECIMAL}, + + + pay_time = #{payTime,jdbcType=TIMESTAMP}, + + + plate_number = #{plateNumber,jdbcType=VARCHAR}, + + + order_amount = #{orderAmount,jdbcType=DECIMAL}, + + + virtual_amount = #{virtualAmount,jdbcType=DECIMAL}, + + + group_code = #{groupCode,jdbcType=VARCHAR}, + + + discount_amount = #{discountAmount,jdbcType=DECIMAL}, + + + settle_amount = #{settleAmount,jdbcType=DECIMAL}, + + + remedial_amount = #{remedialAmount,jdbcType=DECIMAL}, + + + charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP}, + + + charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP}, + + + start_type = #{startType,jdbcType=VARCHAR}, + + + reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP}, + + + reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP}, + + + start_soc = #{startSoc,jdbcType=VARCHAR}, + + + end_soc = #{endSoc,jdbcType=VARCHAR}, + + + stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + settlement_time = #{settlementTime,jdbcType=TIMESTAMP}, + + + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + + + refund_status = #{refundStatus,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{delFlag,jdbcType=CHAR}, + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select - + from order_basic_info @@ -1686,114 +1702,115 @@ del_flag - + - select IFNULL(sum(t1.order_amount),0) as sumOrderAmount, IFNULL(sum(t4.total_used_electricity),0) as sumUsedElectricity, IFNULL(sum(t1.settle_amount),0) as sumSettleAmount from order_basic_info t1 - left join member_basic_info t2 on t1.member_id = t2.member_id and t2.del_flag = '0' - join pile_station_info t3 on t1.station_id = t3.id and t3.del_flag = '0' - join order_detail t4 on t4.order_code = t1.order_code and t4.del_flag = '0' + left join member_basic_info t2 on t1.member_id = t2.member_id and t2.del_flag = '0' + join pile_station_info t3 on t1.station_id = t3.id and t3.del_flag = '0' + join order_detail t4 on t4.order_code = t1.order_code and t4.del_flag = '0' where t1.del_flag = '0' and t1.pile_sn = #{pileSn,jdbcType=VARCHAR} @@ -1834,12 +1851,12 @@ and t1.merchant_id = #{merchantId,jdbcType=VARCHAR} - - and t1.station_id in - - #{stationId} - - + + and t1.station_id in + + #{stationId} + + and t3.dept_id in @@ -1897,7 +1914,8 @@ where a.id = #{id} - + insert into order_basic_info @@ -1984,9 +2002,9 @@ end_soc, - - stop_reason_code, - + + stop_reason_code, + reason, @@ -2050,7 +2068,7 @@ #{startMode}, - #{thirdPartyType}, + #{thirdPartyType}, #{payMode}, @@ -2092,14 +2110,14 @@ #{reservedEndTime}, - #{startSoc}, + #{startSoc}, - #{endSoc}, + #{endSoc}, + + + #{stopReasonCode}, - - #{stopReasonCode}, - #{reason}, @@ -2163,9 +2181,9 @@ start_mode = #{startMode}, - - third_party_type = #{thirdPartyType}, - + + third_party_type = #{thirdPartyType}, + pay_mode = #{payMode}, @@ -2187,12 +2205,12 @@ virtual_amount = #{virtualAmount}, - - group_code = #{groupCode}, - - - discount_amount = #{discountAmount}, - + + group_code = #{groupCode}, + + + discount_amount = #{discountAmount}, + settle_amount = #{settleAmount}, @@ -2206,14 +2224,14 @@ start_type = #{startType}, - start_soc = #{startSoc}, + start_soc = #{startSoc}, - end_soc = #{endSoc}, + end_soc = #{endSoc}, + + + stop_reason_code = #{stopReasonCode}, - - stop_reason_code = #{stopReasonCode}, - reason = #{reason}, @@ -2266,29 +2284,29 @@ insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount, - total_service_amount, - sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price, - sharp_amount, - peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, - peak_amount, - flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, - flat_amount, - valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, - valley_amount, - create_by, update_by) + total_service_amount, + sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price, + sharp_amount, + peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, + peak_amount, + flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, + flat_amount, + valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, + valley_amount, + create_by, update_by) values (#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, - #{item.totalElectricityAmount}, #{item.totalServiceAmount}, - #{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice}, - #{item.sharpAmount}, - #{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice}, - #{item.peakAmount}, - #{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice}, - #{item.flatAmount}, - #{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice}, - #{item.valleyServicePrice}, #{item.valleyAmount}, - #{item.createBy}, #{item.updateBy}) + #{item.totalElectricityAmount}, #{item.totalServiceAmount}, + #{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice}, + #{item.sharpAmount}, + #{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice}, + #{item.peakAmount}, + #{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice}, + #{item.flatAmount}, + #{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice}, + #{item.valleyServicePrice}, #{item.valleyAmount}, + #{item.createBy}, #{item.updateBy}) @@ -2307,15 +2325,15 @@ total_electricity_amount = #{totalElectricityAmount}, - - discount_electricity_amount = #{discountElectricityAmount}, - + + discount_electricity_amount = #{discountElectricityAmount}, + total_service_amount = #{totalServiceAmount}, - - discount_service_amount = #{discountServiceAmount}, - + + discount_service_amount = #{discountServiceAmount}, + sharp_price = #{sharpPrice}, @@ -2392,7 +2410,7 @@ select - + from order_basic_info where del_flag = '0' - and transaction_code = #{transactionCode,jdbcType=VARCHAR} + and transaction_code = #{transactionCode,jdbcType=VARCHAR} SELECT DATE_FORMAT(t1.create_time, '%Y-%m-%d') as date, - sum(t2.total_used_electricity) AS totalElectricity, - sum(t2.total_order_amount) AS totalOrderAmount, - sum(t2.sharp_used_electricity) AS totalSharpUsedElectricity, - sum(t2.peak_used_electricity) AS totalPeakUsedElectricity, - sum(t2.flat_used_electricity) AS totalFlatUsedElectricity, - sum(t2.valley_used_electricity) AS totalValleyUsedElectricity + sum(t2.total_used_electricity) AS totalElectricity, + sum(t2.total_order_amount) AS totalOrderAmount, + sum(t2.sharp_used_electricity) AS totalSharpUsedElectricity, + sum(t2.peak_used_electricity) AS totalPeakUsedElectricity, + sum(t2.flat_used_electricity) AS totalFlatUsedElectricity, + sum(t2.valley_used_electricity) AS totalValleyUsedElectricity FROM order_basic_info t1 - JOIN order_detail t2 ON t1.order_code = t2.order_code - AND t1.del_flag = '0' + JOIN order_detail t2 ON t1.order_code = t2.order_code + AND t1.del_flag = '0' WHERE date(t1.create_time) >= DATE_SUB(CURDATE(), INTERVAL 30 day) - and t1.order_status = '6' + and t1.order_status = '6' and t1.station_id = #{dto.stationId,jdbcType=VARCHAR} @@ -2504,28 +2522,29 @@ select - + from order_detail where del_flag = '0' - and total_order_amount is not null - AND total_order_amount > '0.00' - and total_electricity_amount is null + and total_order_amount is not null + AND total_order_amount > '0.00' + and total_electricity_amount is null @@ -2692,36 +2713,36 @@ select - + from order_basic_info where del_flag = '0' - and order_code in + and order_code in #{item,jdbcType=VARCHAR} select - sum(sharp_used_electricity) AS totalSharpUsedElectricity, - sum(peak_used_electricity) AS totalPeakUsedElectricity, - sum(flat_used_electricity) AS totalFlatUsedElectricity, - sum(valley_used_electricity) AS totalValleyUsedElectricity + sum(sharp_used_electricity) AS totalSharpUsedElectricity, + sum(peak_used_electricity) AS totalPeakUsedElectricity, + sum(flat_used_electricity) AS totalFlatUsedElectricity, + sum(valley_used_electricity) AS totalValleyUsedElectricity from order_detail where order_code in @@ -2796,56 +2817,54 @@ update order_basic_info - set - merchant_id = #{newMerchantId,jdbcType=VARCHAR} - where - station_id = #{stationId,jdbcType=BIGINT} + set merchant_id = #{newMerchantId,jdbcType=VARCHAR} + where station_id = #{stationId,jdbcType=BIGINT} SELECT - t1.charge_start_time AS startTime, - t1.station_id AS stationId, - t2.station_name AS stationName, - t1.plate_number as licensePlateNumber, - t1.order_amount AS orderAmount - FROM - order_basic_info t1 - JOIN pile_station_info t2 ON t1.station_id = t2.id - WHERE t1.del_flag = '0' - - AND t1.plate_number = #{licensePlateNumber,jdbcType=VARCHAR} - - - AND t1.create_time = ]]> #{startTime,jdbcType=VARCHAR} - - - AND t1.create_time #{endTime,jdbcType=VARCHAR} - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + select + + from order_basic_info + where del_flag = '0' + and pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR} + and order_status != '7' + + and order_status = #{orderStatus,jdbcType=VARCHAR} + + + and pay_status = #{payStatus,jdbcType=VARCHAR} + + order by create_time DESC + limit 20 - + - + select t1.order_code as orderCode, + t1.start_mode as startMode, + t1.pile_connector_code as pileConnectorCode, + t1.charge_start_time as startTime, + t1.charge_end_time as endTime, + t2.total_used_electricity as totalPower, + t2.total_electricity_amount as totalElectricityAmount, + t2.total_service_amount as totalServiceAmount, + t1.order_amount as orderAmount + from order_basic_info t1 + join order_detail t2 on t1.order_code = t2.order_code + and t1.del_flag = '0' + + + and t1.create_time = ]]> #{dto.lastQueryTime,jdbcType=VARCHAR} + + + and t1.create_time #{dto.lastQueryEndTime,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderPayRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderPayRecordMapper.xml index 1e91c15e6..2f7e2da5c 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderPayRecordMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderPayRecordMapper.xml @@ -446,6 +446,7 @@ t2.out_trans_id as outTransId from order_pay_record t1 left join adapay_callback_record t2 on t2.payment_id = t1.payment_id - where t1.order_code = #{orderCode,jdbcType=VARCHAR} + where t1.del_flag = '0' + and t1.order_code = #{orderCode,jdbcType=VARCHAR} \ No newline at end of file diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml index a73b8aa74..ec607a87a 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml @@ -1015,6 +1015,7 @@ and t1.occupy_code = #{dto.occupyCode} and t1.member_id = #{dto.memberId} and t1.station_id = #{dto.stationId} + and t2.station_name = #{dto.stationName} and t1.plate_number = #{dto.plateNumber} and t1.status = #{dto.status} and t1.pay_status = #{dto.payStatus} diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml index 0f06b0786..357de38fc 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml @@ -456,4 +456,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.del_flag = '0' and t1.sn = #{pileSn,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java index 77e73da57..4bb3ab917 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java @@ -25,7 +25,6 @@ import com.jsowell.pile.dto.PushStationInfoDTO; import com.jsowell.pile.dto.ThirdPartyCommonStartChargeDTO; import com.jsowell.pile.dto.ThirdPartyCommonStopChargeDTO; import com.jsowell.pile.dto.lutongyunting.BindCouponDTO; -import com.jsowell.pile.dto.nanrui.PushAlarmInfoDTO; import com.jsowell.pile.dto.ruanjie.UseCouponDTO; import com.jsowell.pile.service.*; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; @@ -41,7 +40,6 @@ import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl; import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl; import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl; import com.jsowell.thirdparty.platform.util.HttpRequestUtil; -import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils; import com.jsowell.thirdparty.ruanjie.service.RJService; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import com.jsowell.thirdparty.xindiantu.service.XDTService; @@ -227,6 +225,10 @@ public class CommonService { RealTimeMonitorData realTimeMonitorData, String transactionCode) throws UnsupportedEncodingException { // 推送第三方平台,先通过桩编号查出站点信息 pushToThirdPartyPlatforms PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn); + if (pileBasicInfo == null) { + log.error("推送实时数据失败,未查询到桩编号:{} 对应的站点信息", pileSn); + return; + } // 查询该站点是否推送第三方平台 List list = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(pileBasicInfo.getStationId())); @@ -392,6 +394,10 @@ public class CommonService { RealTimeMonitorData realTimeMonitorData, String transactionCode) throws UnsupportedEncodingException { // 推送第三方平台,先通过桩编号查出站点信息 pushToThirdPartyPlatforms PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn); + if (pileBasicInfo == null) { + log.error("推送实时数据失败,未查询到桩编号:{} 对应的站点信息", pileSn); + return; + } String pileConnectorCode = pileSn + connectorCode; // 将枪口状态转换成对接平台的状态 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java index 258829dd1..2cc819833 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java @@ -29,4 +29,16 @@ public class ConnectorStatsInfo { */ @JSONField(name = "ConnectorElectricity") private BigDecimal connectorElectricity; + + /** + * 充电时长(单位:s) + */ + @JSONField(name = "ConnectorDuration") + private Integer connectorDuration; + + /** + * 充电次数 + */ + @JSONField(name = "ConnectorNum") + private Integer connectorNum; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java index 02dcd39de..c690aa723 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java @@ -31,6 +31,18 @@ public class EquipmentStatsInfo { @JSONField(name = "EquipmentElectricity") private BigDecimal equipmentElectricity; + /** + * 充电时长(单位:s) + */ + @JSONField(name = "ConnectorDuration") + private Integer connectorDuration; + + /** + * 充电次数 + */ + @JSONField(name = "ConnectorNum") + private Integer connectorNum; + /** * 充电设备接口统计信息列表 Y * 充设备的所有充电设备接口统计对象集合 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java index b10b7b3f1..26b0e54e9 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java @@ -44,6 +44,18 @@ public class StationStatsInfo { @JSONField(name = "StationElectricity") private BigDecimal stationElectricity; + /** + * 充电时长(单位:s) + */ + @JSONField(name = "ConnectorDuration") + private Integer connectorDuration; + + /** + * 充电次数 + */ + @JSONField(name = "ConnectorNum") + private Integer connectorNum; + /** * 充电设备统计信息列表 */ 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 9d7dcd74c..edefc1f34 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 @@ -51,6 +51,12 @@ public class ChargeOrderInfo { @JSONField(name = "ConnectorID") private String connectorId; + /** + * 用户发起充电类型 + */ + @JSONField(name = "StartChargeType") + private Integer startChargeType; + /** * 充电订单号 */ @@ -110,6 +116,19 @@ public class ChargeOrderInfo { @JSONField(name = "TotalElecMoney") private BigDecimal totalElecMoney; + /** + * 累计电费 + */ + @JSONField(name = "ElecMoney") + private BigDecimal elecMoney; + + + /** + * 累计服务费 + */ + @JSONField(name = "SeviceMoney") + private BigDecimal seviceMoney; + /** * 本次充电服务费金额 * 保留小数点后 2 位 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 e47cb030d..b2c92b55f 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 @@ -68,6 +68,12 @@ public class StationInfo extends BaseStationInfo { @JSONField(name = "AreaCode") private String areaCode; + /** + * 街道编码 + */ + @JSONField(name = "StreetCode") + private String streetCode; + /** * 详细地址 Y * <=50字符 @@ -254,6 +260,20 @@ public class StationInfo extends BaseStationInfo { @JSONField(name = "EquipmentInfos") private List equipmentInfos; + /** + * 投建日期 + * + */ + @JSONField(name = "RunDate") + private String runDate; + + /** + * 投建日期 + * + */ + @JSONField(name = "BuildDate") + private String buildDate; + /** * 是否独立报桩 (0-否;1-是) Y * 如果是独立报桩需要填写户号以及容量 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 07c749298..b48e43f18 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 @@ -205,6 +205,16 @@ public interface ThirdPartyPlatformService extends InitializingBean { throw new UnsupportedOperationException("This method is not yet implemented"); } + /** + * 查询已完成订单列表信息接口 + * query_finish_orders + * @param dto + * @return + */ + default Map queryFinishOrders(QueryStartChargeDTO dto) { + throw new UnsupportedOperationException("This method is not yet implemented"); + } + /** * VIN码充电 insert_start_charge * 华为平台 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuangXiPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuangXiPlatformServiceImpl.java new file mode 100644 index 000000000..ace9edba0 --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuangXiPlatformServiceImpl.java @@ -0,0 +1,674 @@ +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.domain.ykc.RealTimeMonitorData; +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.enums.ykc.StartModeEnum; +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.AreaCodeInfo; +import com.jsowell.pile.domain.OrderBasicInfo; +import com.jsowell.pile.domain.OrderDetail; +import com.jsowell.pile.dto.QueryStartChargeDTO; +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.lianlian.AccumulativeInfoVO; +import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO; +import com.jsowell.pile.vo.uniapp.customer.OrderVO; +import com.jsowell.pile.vo.web.PileConnectorInfoVO; +import com.jsowell.pile.vo.web.PileStationVO; +import com.jsowell.thirdparty.lianlian.domain.*; +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; +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 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.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * 广西省平台Service + * + * @author Lemon + * @Date 2024/12/23 14:44:32 + */ +@Service +public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService { + // 平台类型 + private final String thirdPlatformType = ThirdPlatformTypeEnum.GUANG_XI_PLATFORM.getTypeCode(); + + @Autowired + private RedisCache redisCache; + + @Autowired + private ThirdpartySecretInfoService thirdpartySecretInfoService; + + @Autowired + private PileStationInfoService pileStationInfoService; + + @Autowired + private PileBasicInfoService pileBasicInfoService; + + @Autowired + private PileBillingTemplateService pileBillingTemplateService; + + @Autowired + private PileConnectorInfoService pileConnectorInfoService; + + @Autowired + private OrderBasicInfoService orderBasicInfoService; + + @Autowired + private IAreaCodeInfoService areaCodeInfoService; + + @Override + public void afterPropertiesSet() throws Exception { + ThirdPartyPlatformFactory.register(thirdPlatformType, this); + } + + /** + * 查询令牌 query_token + * + * @param dto + * @return + */ + @Override + public Map queryToken(CommonParamsDTO dto) { + AccessTokenVO vo = new AccessTokenVO(); + // 0:成功;1:失败 + int succStat = 0; + // 0:无;1:无此对接平台;2:密钥错误; 3~99:自定义 + int failReason = 0; + + String operatorId = dto.getOperatorID(); + // token缓存key值 + String redisKey = operatorId + "_token:"; + // 通过operatorId 查出 operatorSecret + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + if (thirdPartySecretInfoVO == null) { + failReason = 1; + succStat = 1; + } else { + String ourOperatorSecret = thirdPartySecretInfoVO.getOurOperatorSecret(); + String dataSecret = thirdPartySecretInfoVO.getOurDataSecret(); + String dataSecretIv = thirdPartySecretInfoVO.getOurDataSecretIv(); + // 解密data 获取参数中的OperatorSecret + String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv); + String inputOperatorSecret = null; + if (StringUtils.isNotBlank(decrypt)) { + inputOperatorSecret = JSON.parseObject(decrypt).getString("OperatorSecret"); + } + // 对比密钥 + if (!StringUtils.equals(ourOperatorSecret, inputOperatorSecret)) { + failReason = 1; + succStat = 1; + } else { + // 先查缓存中是否有已生成的token + String token = redisCache.getCacheObject(redisKey); + int expiredTime = (int) redisCache.getExpire(redisKey); + if (StringUtils.isBlank(token)) { + // 生成token + token = JWTUtils.createToken(operatorId, ourOperatorSecret, JWTUtils.ttlMillis); + expiredTime = (int) (JWTUtils.ttlMillis / 1000); + } + vo.setAccessToken(token); + vo.setTokenAvailableTime(expiredTime); + // 设置缓存 + redisCache.setCacheObject(redisKey, token, expiredTime, TimeUnit.SECONDS); + } + } + // 组装返回参数 + vo.setOperatorID(operatorId); + vo.setFailReason(failReason); + vo.setSuccStat(succStat); + + Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(vo, thirdPartySecretInfoVO.getOurDataSecret() + , thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getOurSigSecret()); + return resultMap; + } + + /** + * 查询充电站信息 query_stations_info + * + * @param dto 查询站点信息dto + * @return + */ + @Override + public Map queryStationsInfo(QueryStationInfoDTO dto) { + int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); + int pageSize = dto.getPageSize() == null ? 50 : dto.getPageSize(); + dto.setThirdPlatformType(thirdPlatformType); + + PageUtils.startPage(pageNo, pageSize); + List stationInfos = pileStationInfoService.selectStationInfosByThirdParty(dto); + if (CollectionUtils.isEmpty(stationInfos)) { + // 未查到数据 + return null; + } + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + + PageInfo pageInfo = new PageInfo<>(stationInfos); + List resultList = new ArrayList<>(); + for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) { + SupStationInfo info = SupStationInfo.builder() + .stationID(String.valueOf(pileStationInfo.getId())) + .operatorID(Constants.OPERATORID_JIANG_SU) + .equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileStationInfo.getOrganizationCode())) + .stationName(pileStationInfo.getStationName()) + .countryCode(pileStationInfo.getCountryCode()) + // .areaCode() + // .streetCode() + .address(pileStationInfo.getAddress()) + .serviceTel(pileStationInfo.getServiceTel()) + .stationType(Integer.parseInt(pileStationInfo.getStationType())) + .stationStatus(Integer.parseInt(pileStationInfo.getStationStatus())) + .parkNums(Integer.parseInt(pileStationInfo.getParkNums())) + .stationLng(new BigDecimal(pileStationInfo.getStationLng())) + .stationLat(new BigDecimal(pileStationInfo.getStationLat())) + .construction(Integer.parseInt(pileStationInfo.getConstruction())) + // .electricityFee() + // .serviceFee() + // .equipmentInfos() + .runDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileStationInfo.getCreateTime())) + .buildDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileStationInfo.getCreateTime())) + + .build(); + + JSONObject electricityFee = new JSONObject(); + JSONObject serviceFee = new JSONObject(); + // 查询计费模板 + List priceList = pileBillingTemplateService.queryBillingPrice(String.valueOf(pileStationInfo.getId())); + for (BillingPriceVO billingPriceVO : priceList) { + electricityFee.put(billingPriceVO.getStartTime() + "-" + billingPriceVO.getEndTime(), billingPriceVO.getElectricityPrice()); + serviceFee.put(billingPriceVO.getStartTime() + "-" + billingPriceVO.getEndTime(), billingPriceVO.getServicePrice()); + } + info.setElectricityFee(electricityFee.toJSONString()); + info.setServiceFee(serviceFee.toJSONString()); + + // AreaCode + String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213 + // 根据逗号分组 + String[] split = StringUtils.split(areaCode, ","); + // 只取最后一部分 330213 + String subAreaCode = split[split.length - 1]; + info.setAreaCode(subAreaCode); + + List pileList = pileBasicInfoService.getPileListForLianLian(String.valueOf(pileStationInfo.getId())); + if (CollectionUtils.isNotEmpty(pileList)) { + info.setEquipmentInfos(pileList); // 充电设备信息列表 + } + + // areaCodeCountryside + GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); + if (geoCode == null) { + // String areaCodeCountryside = geoCode.getCounty_code(); + info.setStreetCode("123456789101"); + } else { + AreaCodeInfo areaCodeInfo = new AreaCodeInfo(); + if (StringUtils.isNotBlank(geoCode.getTownName())) { + String townName = geoCode.getTownName(); + areaCodeInfo.setName(townName); + } else { + String countyName = geoCode.getCountyName(); + areaCodeInfo.setName(countyName); + } + List areaCodeInfoList = areaCodeInfoService.selectAreaCodeInfoList(areaCodeInfo); + info.setStreetCode(String.valueOf(areaCodeInfoList.get(0).getAreaCode())); + } + resultList.add(info); + } + + Map map = new LinkedHashMap<>(); + map.put("PageNo", pageInfo.getPageNum()); + map.put("PageCount", pageInfo.getPages()); + map.put("ItemSize", pageInfo.getTotal()); + map.put("StationInfos", resultList); + Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), + thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); + return resultMap; + } + + /** + * 设备接口状态查询接口 query_station_status + * @param dto 查询站点信息dto + * @return + */ + @Override + public Map queryStationStatus(QueryStationInfoDTO dto) { + List stationIds = dto.getStationIds(); + List stationStatusInfos = new ArrayList<>(); + List connectorStatusInfos = new ArrayList<>(); + // 查询密钥信息 + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + + // 根据站点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); + stationStatusInfo.setStationStatus(50); // 50-正常使用 + 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); + + Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), + thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); + 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 = getGuangXiSecretInfo(); + + String operatorId = Constants.OPERATORID_JIANG_SU; + 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("DataType", Constants.ZERO); + 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; + } + + /** + * 查询统计信息接口 query_station_stats + * @param dto 查询站点信息dto + * @return + */ + @Override + public Map queryStationStats(QueryStationInfoDTO dto) { + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + // 根据站点id 查出这段时间的充电量 + List list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto); + if (CollectionUtils.isEmpty(list)) { + return null; + } + + // 根据充电桩编号分组 key=充电桩编号 + Map> pileMap = list.stream() + .collect(Collectors.groupingBy(AccumulativeInfoVO::getPileSn)); + + // 存放所有充电桩设备 + List equipmentStatsInfoList = Lists.newArrayList(); + // 站点用电量 + BigDecimal stationElectricity = BigDecimal.ZERO; + int stationChargingTime = Constants.zero; + // 用于记录桩充电量 在循环每个枪口的时候初始化 + BigDecimal pileElec; + // 桩充电次数 + int pileChargingNum; + // 桩充电时长 + int pileChargingTime; + for (String pileSn : pileMap.keySet()) { + // 该充电桩下 所有枪口的用电数据 + List accumulativeInfoVOS = pileMap.get(pileSn); + if (CollectionUtils.isEmpty(accumulativeInfoVOS)) { + continue; + } + // 存放充电桩用电量 + pileElec = BigDecimal.ZERO; + // 充电桩充电次数 + pileChargingNum = Constants.zero; + // 充电桩充电时长 + pileChargingTime = Constants.zero; + + // key=枪口编号 value 该枪口的用电数据 + Map> collect = accumulativeInfoVOS.stream() + .collect(Collectors.groupingBy(AccumulativeInfoVO::getPileConnectorCode)); + + List connectorStatsInfos = Lists.newArrayList(); + for (Map.Entry> entry : collect.entrySet()) { + String pileConnectorCode = entry.getKey(); + List value = entry.getValue(); + // 枪口用电量求和 + BigDecimal connectorElec = value.stream() + .map(AccumulativeInfoVO::getConnectorElectricity) + .map(BigDecimal::new) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 充电时长求和 + BigDecimal chargingTime = value.stream() + .map(AccumulativeInfoVO::getChargingTime) + .map(BigDecimal::new) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + // 充电次数 + long chargingNumLong = accumulativeInfoVOS.stream() + .map(x -> x.getPileConnectorCode().equals(pileConnectorCode)) + .count(); + int chargingNum = Integer.parseInt(String.valueOf(chargingNumLong)); + + connectorStatsInfos.add( + ConnectorStatsInfo.builder() + .connectorID(pileConnectorCode) + .connectorElectricity(connectorElec) + .connectorDuration(chargingTime.intValue()) + .connectorNum(chargingNum) + .build() + ); + // 充电桩电量为枪口用电量累计 + pileElec = pileElec.add(connectorElec); + // 充电桩充电次数为枪口充电次数累计 + pileChargingNum += chargingNum; + // 充电时长 + pileChargingTime += chargingTime.intValue(); + } + + EquipmentStatsInfo build = EquipmentStatsInfo.builder() + .equipmentID(pileSn) + .equipmentElectricity(pileElec) + .connectorDuration(pileChargingTime) + .connectorNum(pileChargingNum) + .connectorStatsInfos(connectorStatsInfos) + .build(); + equipmentStatsInfoList.add(build); + + // 所有充电桩用电量之和 + stationElectricity = stationElectricity.add(pileElec); + // 充电时长 + stationChargingTime += pileChargingTime; + } + + StationStatsInfo stationStatsInfo = StationStatsInfo.builder() + .stationID(dto.getStationID()) + .startTime(dto.getStartTime()) + .endTime(dto.getEndTime()) + .stationElectricity(stationElectricity) + .connectorDuration(stationChargingTime) + .connectorNum(list.size()) + .equipmentStatsInfos(equipmentStatsInfoList) // 设备列表 + .build(); + + Map map = new LinkedHashMap<>(); + map.put("StationStats", stationStatsInfo); + + Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), + thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); + + return resultMap; + } + + /** + * 推送已完成订单信息接口 notification_charge_order_info + * @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) + // .startChargeType() + .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()) + .elecMoney(orderDetail.getTotalElectricityAmount()) + .seviceMoney(orderDetail.getTotalServiceAmount()) + .totalMoney(orderDetail.getTotalOrderAmount()) + + .build(); + // startChargeType + String startMode = orderBasicInfo.getStartMode(); + if (StringUtils.equals(StartModeEnum.AUTH_CARD.getValue(), startMode) + || StringUtils.equals(StartModeEnum.OFFLINE_CARD.getValue(), startMode)) { + chargeOrderInfo.setStartChargeType(3); // 3-卡启动 + }else { + chargeOrderInfo.setStartChargeType(Constants.one); + } + + // 获取令牌 + 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; + } + + /** + * 查询已完成订单列表信息接口 query_finish_orders + * @param dto + * @return + */ + @Override + public Map queryFinishOrders(QueryStartChargeDTO dto) { + int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); + int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize(); + List orderInfos = new ArrayList<>(); + + PageUtils.startPage(pageNo, pageSize); + List orderVOS = orderBasicInfoService.selectThirdPartyOrderList(dto); + + PageInfo pageInfo = new PageInfo<>(orderVOS); + + for (OrderVO orderVO : pageInfo.getList()) { + ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder() + .startChargeSeq(orderVO.getOrderCode()) + // .startChargeType() + .connectorId(orderVO.getPileConnectorCode()) + .startTime(orderVO.getStartTime()) + .endTime(orderVO.getStartTime()) + .totalPower(new BigDecimal(orderVO.getTotalPower())) + .elecMoney(orderVO.getTotalElectricityAmount()) + .seviceMoney(orderVO.getTotalServiceAmount()) + .totalMoney(orderVO.getOrderAmount()) + + .build(); + + // startChargeType + String startMode = orderVO.getStartMode(); + if (StringUtils.equals(StartModeEnum.AUTH_CARD.getValue(), startMode) + || StringUtils.equals(StartModeEnum.OFFLINE_CARD.getValue(), startMode)) { + chargeOrderInfo.setStartChargeType(3); // 3-卡启动 + }else { + chargeOrderInfo.setStartChargeType(Constants.one); + } + + orderInfos.add(chargeOrderInfo); + } + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + + Map map = new LinkedHashMap<>(); + map.put("PageNo", pageInfo.getPageNum()); + map.put("PageCount", pageInfo.getPages()); + map.put("ItemSize", pageInfo.getTotal()); + map.put("ChargeOrders", orderInfos); + map.put("LastQueryTime", dto.getLastQueryTime()); + map.put("LastQueryEndTime", dto.getLastQueryEndTime()); + + Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), + thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); + + return resultMap; + + } + + /** + * 推送充电状态接口 notification_equip_charge_status + * @param orderCode 订单编号 + * @return + */ + @Override + public String notificationEquipChargeStatus(String orderCode) { + // 根据订单号查询订单信息 + OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); + // 查询相关配置信息 + ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuangXiSecretInfo(); + + String operatorId = Constants.OPERATORID_JIANG_SU; + String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret(); + String signSecret = thirdPartySecretInfoVO.getTheirSigSecret(); + String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret(); + String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv(); + String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix(); + + // 查询枪口实时状态 + List chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode()); + RealTimeMonitorData realTimeMonitorData; + if (CollectionUtils.isEmpty(chargingRealTimeData)) { + realTimeMonitorData = RealTimeMonitorData.builder() + .chargingDegree(Constants.ZERO) + .connectorStatus("3") + .build(); + chargingRealTimeData.add(realTimeMonitorData); + } else { + realTimeMonitorData = chargingRealTimeData.get(0); + } + + // 查询枪口状态 + PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode()); + if (Objects.isNull(info)) { + 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"; + } + BigDecimal current = realTimeMonitorData.getOutputCurrent() == null ? BigDecimal.ZERO : info.getCurrent(); + BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : info.getVoltage(); + String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : info.getSOC(); + + String dateTime = DateUtils.getDateTime(); + SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder() + .startChargeSeq(orderInfo.getOrderCode()) + .startChargeSeqStat(Integer.parseInt(orderStatus)) + .connectorID(orderInfo.getPileConnectorCode()) + .connectorStatus(Integer.parseInt(realTimeMonitorData.getConnectorStatus())) // 3-充电中 + .currentA(current.setScale(1, RoundingMode.HALF_UP)) + .voltageA(voltage.setScale(1, RoundingMode.HALF_UP)) + .soc(new BigDecimal(soc)) + .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) + .endTime(dateTime) + .totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())) + + .build(); + + 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 + */ + private ThirdPartySecretInfoVO getGuangXiSecretInfo() { + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); + if (thirdPartySecretInfoVO == null) { + throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); + } + thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU); + return thirdPartySecretInfoVO; + } +} \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java index e47250562..fc22b3128 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java @@ -95,6 +95,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { @Autowired private PileBillingTemplateService pileBillingTemplateService; + @Autowired + private IAreaCodeInfoService areaCodeInfoService; + @Autowired private RedisCache redisCache; @@ -165,10 +168,12 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { } public static void main(String[] args) { - String msg = "880B24831B56238914534606391D2902"; - String signSecret = "iz54GKP9oOeCCYSp"; + // String address = "贵州省黔西南州安龙县社保局后侧"; + // String address = "贵州省遵义市习水县习水伟业汽修"; + String address = "贵州省赤水市元厚镇五柱峰村三组"; + GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(address); + String countyName = geoCode.getCountyName(); // 习水县 - String result = Cryptos.aesDecrypt(msg, signSecret); } /** @@ -222,9 +227,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { public Map queryStationsInfo(QueryStationInfoDTO dto) { int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); int pageSize = dto.getPageSize() == null ? 50 : dto.getPageSize(); + dto.setThirdPlatformType(thirdPlatformType); PageUtils.startPage(pageNo, pageSize); - List stationInfos = pileStationInfoService.getStationInfosByThirdParty(dto); + List stationInfos = pileStationInfoService.selectStationInfosByThirdParty(dto); if (CollectionUtils.isEmpty(stationInfos)) { // 未查到数据 return null; @@ -237,7 +243,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { SupStationInfo info = SupStationInfo.builder() .stationID(String.valueOf(pileStationInfo.getId())) .operatorID(Constants.OPERATORID_JIANG_SU) - // .equipmentOwnerID() + .equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileStationInfo.getOrganizationCode())) .stationName(pileStationInfo.getStationName()) .countryCode(pileStationInfo.getCountryCode()) // .areaCode() @@ -269,8 +275,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { String subAreaCode = split[split.length - 1]; info.setAreaCode(subAreaCode); - info.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); - // 容量 if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) { info.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP)); @@ -286,10 +290,20 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { info.setRatedPower(stationRatedPower); // areaCodeCountryside GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); - if (geoCode != null) { + if (geoCode == null) { // String areaCodeCountryside = geoCode.getCounty_code(); - String areaCodeCountryside = "123456789101"; - info.setAreaCodeCountryside(areaCodeCountryside); + info.setAreaCodeCountryside("123456789101"); + }else { + AreaCodeInfo areaCodeInfo = new AreaCodeInfo(); + if (StringUtils.isNotBlank(geoCode.getTownName())) { + String townName = geoCode.getTownName(); + areaCodeInfo.setName(townName); + }else { + String countyName = geoCode.getCountyName(); + areaCodeInfo.setName(countyName); + } + List areaCodeInfoList = areaCodeInfoService.selectAreaCodeInfoList(areaCodeInfo); + info.setAreaCodeCountryside(String.valueOf(areaCodeInfoList.get(0).getAreaCode())); } resultList.add(info); } @@ -299,6 +313,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { map.put("PageCount", pageInfo.getPages()); map.put("ItemSize", pageInfo.getTotal()); map.put("StationInfos", resultList); + // logger.info("贵州省平台查询站点信息 resultData:{}", JSON.toJSONString(map)); Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); return resultMap; @@ -312,6 +327,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { public String notificationStationInfo(String stationId) { // 通过id查询站点相关信息 PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId)); + PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(String.valueOf(pileStationInfo.getId())); // 查询第三方平台配置信息 ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuiZhouPlatformSecretInfo(); @@ -327,7 +343,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { SupStationInfo info = SupStationInfo.builder() .stationID(stationId) .operatorID(operatorId) - // .equipmentOwnerID() + .equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode())) .stationName(pileStationInfo.getStationName()) .countryCode(pileStationInfo.getCountryCode()) // .areaCode() @@ -359,8 +375,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { String subAreaCode = split[split.length - 1]; info.setAreaCode(subAreaCode); - info.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); - // 容量 if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) { info.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP)); @@ -376,10 +390,20 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { info.setRatedPower(stationRatedPower); // areaCodeCountryside GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); - if (geoCode != null) { - String areaCodeCountryside = geoCode.getCounty_code(); - areaCodeCountryside = "123456789101"; - info.setAreaCodeCountryside(areaCodeCountryside); + if (geoCode == null) { + // String areaCodeCountryside = geoCode.getCounty_code(); + info.setAreaCodeCountryside("123456789101"); + }else { + AreaCodeInfo areaCodeInfo = new AreaCodeInfo(); + if (StringUtils.isNotBlank(geoCode.getTownName())) { + String townName = geoCode.getTownName(); + areaCodeInfo.setName(townName); + }else { + String countyName = geoCode.getCountyName(); + areaCodeInfo.setName(countyName); + } + List areaCodeInfoList = areaCodeInfoService.selectAreaCodeInfoList(areaCodeInfo); + info.setAreaCodeCountryside(String.valueOf(areaCodeInfoList.get(0).getAreaCode())); } // 调用平台接口 @@ -421,14 +445,16 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { List voList = entry.getValue(); StationStatusInfo stationStatusInfo = new StationStatusInfo(); + PileStationVO stationInfo = pileStationInfoService.getStationInfo(stationId); + stationStatusInfo.setOperatorId(Constants.OPERATORID_JIANG_SU); - stationStatusInfo.setEquipmentOwnerId(Constants.OPERATORID_GUI_ZHOU); + stationStatusInfo.setEquipmentOwnerId(ThirdPartyPlatformUtils.extractEquipmentOwnerID(stationInfo.getOrganizationCode())); stationStatusInfo.setStationId(stationId); ConnectorStatusInfo connectorStatusInfo; for (ConnectorInfoVO connectorInfoVO : voList) { connectorStatusInfo = ConnectorStatusInfo.builder() .operatorId(Constants.OPERATORID_JIANG_SU) - .equipmentOwnerId(Constants.OPERATORID_GUI_ZHOU) // todo 测试 + .equipmentOwnerId(ThirdPartyPlatformUtils.extractEquipmentOwnerID(stationInfo.getOrganizationCode())) .stationId(connectorInfoVO.getStationId()) .equipmentId(connectorInfoVO.getPileSn()) .connectorID(connectorInfoVO.getPileConnectorCode()) @@ -576,7 +602,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { .build(); - supEquipChargeStatusInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // TODO 临时测试使用贵州测试数据 + supEquipChargeStatusInfo.setEquipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(stationInfo.getOrganizationCode())); String url = urlAddress + "supervise_notification_equip_charge_status"; // 调用平台接口 @@ -618,9 +644,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { // 拼装成平台所需格式对象 ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail); - orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // TODO 临时测试 - List billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); + // List billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); // 先将list按照 尖、峰、平、谷 时段排序 // List collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList()); // 再循环该list,拼装对应的充电价格、费率 @@ -663,7 +688,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { String url = urlAddress + "supervise_notification_charge_order_info_history"; ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail); - orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // todo 临时测试 List billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); // 先将list按照 尖、峰、平、谷 时段排序 @@ -807,7 +831,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { .stationTotalWarningNum(0) .equipmentStatsInfos(equipmentStatsInfoList) .build(); - supStationStatsInfo.setEquipmentOwnerId(Constants.OPERATORID_GUI_ZHOU); JSONObject json = new JSONObject(); List supStationStatsInfoList = new ArrayList<>(); @@ -862,7 +885,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) { supStationPowerInfo.setEquipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(organizationCode)); } - supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // todo 临时测试 // 根据站点id查询桩信息 List pileList = pileBasicInfoService.getPileListByStationId(stationId); diff --git a/jsowell-ui/src/views/member/merchantVIP/index.vue b/jsowell-ui/src/views/member/merchantVIP/index.vue index 80f95feee..03f919bcf 100644 --- a/jsowell-ui/src/views/member/merchantVIP/index.vue +++ b/jsowell-ui/src/views/member/merchantVIP/index.vue @@ -109,7 +109,7 @@ - diff --git a/jsowell-ui/src/views/order/order/index.vue b/jsowell-ui/src/views/order/order/index.vue index a13192454..bb13a52c3 100644 --- a/jsowell-ui/src/views/order/order/index.vue +++ b/jsowell-ui/src/views/order/order/index.vue @@ -149,7 +149,7 @@ {{ item.startSoc }} - {{ item.endSoc }} + {{ item.endSoc }} {{ item.chargeEndTime }} diff --git a/jsowell-ui/src/views/order/order/orderDetail.vue b/jsowell-ui/src/views/order/order/orderDetail.vue index 0465f4be6..64e71925c 100644 --- a/jsowell-ui/src/views/order/order/orderDetail.vue +++ b/jsowell-ui/src/views/order/order/orderDetail.vue @@ -239,6 +239,7 @@ + diff --git a/jsowell-ui/src/views/pile/occupy/index.vue b/jsowell-ui/src/views/pile/occupy/index.vue index 8dea5df0e..f43b6f038 100644 --- a/jsowell-ui/src/views/pile/occupy/index.vue +++ b/jsowell-ui/src/views/pile/occupy/index.vue @@ -14,6 +14,14 @@ :value="item.value"/> + + + @@ -228,6 +236,7 @@ export default { status: null, memberId: null, stationId: null, + stationName: null, orderCode: null, transactionCode: null, startTime: null,