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..e38fbfaa9 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", "广西平台", ""), ; private String typeCode; 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/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/service/OrderBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java index 5b199ecfe..1f1a4b859 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.response.PaymentReverseResponse; import com.jsowell.adapay.vo.OrderSplitResult; @@ -476,6 +477,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/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index dcda77983..9d2f371d2 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,6 +2,7 @@ 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; @@ -2592,7 +2593,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; } /** @@ -4096,6 +4108,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/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index 08309130d..d1f0d7e45 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 @@ -1224,7 +1224,6 @@ 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 (PileDetailInfoVO pileDetailInfoVO : list) { @@ -1245,19 +1244,6 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { 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(pileDetailInfoVO.getPileStatus())); equipmentInfo.setEquipmentPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); equipmentInfo.setNewNationalStandard(1); 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/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-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 index 12ab17ed3..a51df5203 100644 --- 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 @@ -1,8 +1,63 @@ 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 * @@ -11,9 +66,609 @@ import org.springframework.stereotype.Service; */ @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() + ":00-" + billingPriceVO.getEndTime() + ":00", billingPriceVO.getElectricityPrice()); + serviceFee.put(billingPriceVO.getStartTime() + ":00-" + billingPriceVO.getEndTime() + ":00", 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