Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile into dev
# Conflicts:
# ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java
# ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
New file |
| | |
| | | package com.ruoyi.account.api.factory; |
| | | |
| | | import com.ruoyi.account.api.feignClient.InviteUserClient; |
| | | import com.ruoyi.account.api.feignClient.JianGuanAccountClient; |
| | | import com.ruoyi.account.api.model.TInviteUser; |
| | | import com.ruoyi.account.api.vo.GetInviteUser; |
| | | import com.ruoyi.account.api.vo.GovernmentCloudAccountVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JianGuanAccountFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<JianGuanAccountClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(JianGuanAccountFallbackFactory.class); |
| | | |
| | | @Override |
| | | public JianGuanAccountClient create(Throwable throwable) { |
| | | log.error("政务云查询数据接口:{}", throwable.getMessage()); |
| | | return new JianGuanAccountClient() { |
| | | @Override |
| | | public R<GovernmentCloudAccountVO> listAll() { |
| | | return R.fail("政务云查询数据接口Account:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.feignClient; |
| | | |
| | | import com.ruoyi.account.api.factory.InviteUserFallbackFactory; |
| | | import com.ruoyi.account.api.model.TInviteUser; |
| | | import com.ruoyi.account.api.vo.GetInviteUser; |
| | | import com.ruoyi.account.api.vo.GovernmentCloudAccountVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/4 17:54 |
| | | */ |
| | | @FeignClient(contextId = "JianGuanAccountClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = InviteUserFallbackFactory.class) |
| | | public interface JianGuanAccountClient { |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/governmentCloudAccount/listAll") |
| | | R<GovernmentCloudAccountVO> listAll(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.vo; |
| | | |
| | | import com.ruoyi.account.api.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GovernmentCloudAccountVO对象",description = "Account政务云上传数据VO") |
| | | public class GovernmentCloudAccountVO { |
| | | |
| | | @ApiModelProperty(value = "优惠券") |
| | | private List<TAppCoupon> appCoupons; |
| | | @ApiModelProperty(value = "用户") |
| | | private List<TAppUser> appUsers; |
| | | @ApiModelProperty(value = "用户地址") |
| | | private List<TAppUserAddress> appUserAddresses; |
| | | @ApiModelProperty(value = "用户车辆") |
| | | private List<TAppUserCar> appUserCars; |
| | | @ApiModelProperty(value = "用户积分明细") |
| | | private List<TAppUserIntegralChange> appUserIntegralChanges; |
| | | @ApiModelProperty(value = "用户签到") |
| | | private List<TAppUserSign> appUserSigns; |
| | | @ApiModelProperty(value = "用户标签") |
| | | private List<TAppUserTag> appUserTags; |
| | | @ApiModelProperty(value = "用户会员明细") |
| | | private List<TAppUserVipDetail> appUserVipDetails; |
| | | @ApiModelProperty(value = "邀请用户") |
| | | private List<TInviteUser> inviteUsers; |
| | | @ApiModelProperty(value = "发票") |
| | | private List<TInvoiceInformation> invoiceInformations; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | com.ruoyi.account.api.factory.AppUserVipDetailFallbackFactory |
| | | com.ruoyi.account.api.factory.InviteUserFallbackFactory |
| | | com.ruoyi.account.api.factory.AppUserTagFallbackFactory |
| | | com.ruoyi.account.api.factory.JianGuanAccountFallbackFactory |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.factory; |
| | | |
| | | import com.ruoyi.chargingPile.api.feignClient.JianGuanChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.vo.GovernmentCloudChargingPileVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JianGuanChargingPileFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<JianGuanChargingPileClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(JianGuanChargingPileFallbackFactory.class); |
| | | |
| | | @Override |
| | | public JianGuanChargingPileClient create(Throwable throwable) { |
| | | log.error("政务云查询数据接口:{}", throwable.getMessage()); |
| | | return new JianGuanChargingPileClient() { |
| | | @Override |
| | | public R<GovernmentCloudChargingPileVO> listAll() { |
| | | return R.fail("政务云查询数据接口ChargingPile:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingGunFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.GetChargingGunByCode; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @PostMapping("/t-charging-gun/getChargingGunByFullNumber") |
| | | R<TChargingGun> getChargingGunByFullNumber(@RequestParam("fullNumber") String fullNumber); |
| | | |
| | | /** |
| | | * 大屏 根据站点ids和充电模式集合查询充电枪集合 |
| | | */ |
| | | @GetMapping("/t-charging-gun/getGunIdsBySiteIdsAndChargeModels") |
| | | R<List<Integer>> getGunIdsBySiteIdsAndChargeModels(@RequestParam("siteIds") List<Integer> siteIds ,@RequestParam("chargeModels") List<Integer> chargeModels); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.feignClient; |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.JianGuanChargingPileFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.vo.GovernmentCloudChargingPileVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/4 17:54 |
| | | */ |
| | | @FeignClient(contextId = "JianGuanChargingPileClient", value = ServiceNameConstants.CHARGINGPILE_SERVICE, fallbackFactory = JianGuanChargingPileFallbackFactory.class) |
| | | public interface JianGuanChargingPileClient { |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/governmentCloudChargingPile/listAll") |
| | | R<GovernmentCloudChargingPileVO> listAll(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_accounting_strategy_detail") |
| | | @ApiModel(value="TAccountingStrategyDetail对象", description="计费策略明细") |
| | | public class TAccountingStrategyDetail implements Serializable { |
| | | public class TAccountingStrategyDetail extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.vo; |
| | | |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GovernmentCloudChargingPileVO对象",description = "ChargingPile政务云上传数据VO") |
| | | public class GovernmentCloudChargingPileVO { |
| | | |
| | | @ApiModelProperty(value = "合作商") |
| | | private List<Partner> partners; |
| | | @ApiModelProperty(value = "站点") |
| | | private List<Site> sites; |
| | | @ApiModelProperty(value = "计费策略") |
| | | private List<TAccountingStrategy> accountingStrategies; |
| | | @ApiModelProperty(value = "计费策略明细") |
| | | private List<TAccountingStrategyDetail> accountingStrategyDetails; |
| | | @ApiModelProperty(value = "申请充电桩") |
| | | private List<TApplyChargingPile> applyChargingPiles; |
| | | @ApiModelProperty(value = "车库") |
| | | private List<TCarport> carports; |
| | | @ApiModelProperty(value = "枪") |
| | | private List<TChargingGun> chargingGuns; |
| | | @ApiModelProperty(value = "桩") |
| | | private List<TChargingPile> chargingPiles; |
| | | @ApiModelProperty(value = "站点通知") |
| | | private List<TChargingPileNotification> chargingPileNotifications; |
| | | @ApiModelProperty(value = "故障内容") |
| | | private List<TFaultMessage> faultMessages; |
| | | @ApiModelProperty(value = "监控") |
| | | private List<TMonitoringEquipment> monitoringEquipments; |
| | | @ApiModelProperty(value = "停车场") |
| | | private List<TParkingLot> parkingLots; |
| | | @ApiModelProperty(value = "停车记录") |
| | | private List<TParkingRecord> parkingRecords; |
| | | @ApiModelProperty(value = "合作商站点") |
| | | private List<TPartnerSite> partnerSites; |
| | | @ApiModelProperty(value = "保修") |
| | | private List<TRepair> repairs; |
| | | @ApiModelProperty(value = "站点菜单那") |
| | | private List<TSiteMenu> siteMenus; |
| | | @ApiModelProperty(value = "车道") |
| | | private List<TVehicleRamp> vehicleRamps; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.vo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "大屏对外开放区车位使用情况Vo") |
| | | public class LargeScreenGunVo { |
| | | @ApiModelProperty(value = "超级快充") |
| | | private Integer superFast=0; |
| | | @ApiModelProperty(value = "快充") |
| | | private Integer fast=0; |
| | | @ApiModelProperty(value = "快充") |
| | | private Integer v2g=0; |
| | | |
| | | @ApiModelProperty(value = "超级快充 使用") |
| | | private Integer useSuperFast=0; |
| | | @ApiModelProperty(value = "快充") |
| | | private Integer useFast=0; |
| | | @ApiModelProperty(value = "快充") |
| | | private Integer useV2g=0; |
| | | } |
| | |
| | | com.ruoyi.chargingPile.api.factory.ParkingRecordFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.FaultMessageFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.PartnerFallbackFactory |
| | | com.ruoyi.chargingPile.api.factory.JianGuanChargingPileFallbackFactory |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.feignClient.JianGuanOrderClient; |
| | | import com.ruoyi.order.api.vo.GovernmentCloudOrderVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JianGuanOrderFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<JianGuanOrderClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(JianGuanOrderClient.class); |
| | | |
| | | @Override |
| | | public JianGuanOrderClient create(Throwable throwable) { |
| | | log.error("政务云查询数据接口:{}", throwable.getMessage()); |
| | | return new JianGuanOrderClient() { |
| | | @Override |
| | | public R<GovernmentCloudOrderVO> listAll() { |
| | | return R.fail("政务云查询数据接口Order:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.factory.JianGuanOrderFallbackFactory; |
| | | import com.ruoyi.order.api.vo.GovernmentCloudOrderVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/4 17:54 |
| | | */ |
| | | @FeignClient(contextId = "JianGuanOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = JianGuanOrderFallbackFactory.class) |
| | | public interface JianGuanOrderClient { |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/governmentCloudOrder/listAll") |
| | | R<GovernmentCloudOrderVO> listAll(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Base64; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @Data |
| | | @TableName("t_accounting_strategy_detail_order") |
| | | public class AccountingStrategyDetailOrder { |
| | | public class AccountingStrategyDetailOrder extends BasePojo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_charging_order_refund") |
| | | @ApiModel(value="TChargingOrderRefund对象1", description="") |
| | | public class TChargingOrderRefund implements Serializable { |
| | | public class TChargingOrderRefund extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_evaluate_tag") |
| | | @ApiModel(value="TOrderEvaluateTag对象", description="") |
| | | public class TOrderEvaluateTag implements Serializable { |
| | | public class TOrderEvaluateTag extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_invoice_detail") |
| | | @ApiModel(value="TOrderInvoiceDetail对象", description="") |
| | | public class TOrderInvoiceDetail implements Serializable { |
| | | public class TOrderInvoiceDetail extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_shopping_order_refund") |
| | | @ApiModel(value="TShoppingOrderRefund对象", description="") |
| | | public class TShoppingOrderRefund implements Serializable { |
| | | public class TShoppingOrderRefund extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_vip_order_refund") |
| | | @ApiModel(value="TVipOrderRefund对象", description="") |
| | | public class TVipOrderRefund implements Serializable { |
| | | public class TVipOrderRefund extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.order.api.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GovernmentCloudOrderVO对象",description = "Order政务云上传数据VO") |
| | | public class GovernmentCloudOrderVO { |
| | | |
| | | @ApiModelProperty(value = "计费策略明细") |
| | | private List<AccountingStrategyDetailOrder> accountingStrategyDetailOrders; |
| | | @ApiModelProperty(value = "策略申请") |
| | | private List<AccountingStrategyOrder> accountingStrategyOrders; |
| | | @ApiModelProperty(value = "账单") |
| | | private List<TChargingBill> chargingBills; |
| | | @ApiModelProperty(value = "充电订单") |
| | | private List<TChargingOrder> chargingOrders; |
| | | @ApiModelProperty(value = "充电明细") |
| | | private List<TChargingOrderAccountingStrategy> chargingOrderAccountingStrategies; |
| | | @ApiModelProperty(value = "充电订单退款") |
| | | private List<TChargingOrderRefund> chargingOrderRefunds; |
| | | @ApiModelProperty(value = "积分订单") |
| | | private List<TExchangeOrder> exchangeOrders; |
| | | @ApiModelProperty(value = "赠送会员") |
| | | private List<TGrantVip> grantVips; |
| | | @ApiModelProperty(value = "订单申诉") |
| | | private List<TOrderAppeal> orderAppeals; |
| | | @ApiModelProperty(value = "订单评价") |
| | | private List<TOrderEvaluate> orderEvaluates; |
| | | @ApiModelProperty(value = "订单评价标签") |
| | | private List<TOrderEvaluateTag> orderEvaluateTags; |
| | | @ApiModelProperty(value = "订单开票") |
| | | private List<TOrderInvoice> orderInvoices; |
| | | @ApiModelProperty(value = "订单开票明细") |
| | | private List<TOrderInvoiceDetail> orderInvoiceDetails; |
| | | @ApiModelProperty(value = "结算确认") |
| | | private List<TSettlementConfirm> settlementConfirms; |
| | | @ApiModelProperty(value = "购物订单") |
| | | private List<TShoppingOrder> shoppingOrders; |
| | | @ApiModelProperty(value = "购物订单退款") |
| | | private List<TShoppingOrderRefund> shoppingOrderRefunds; |
| | | @ApiModelProperty(value = "会员订单") |
| | | private List<TVipOrder> vipOrders; |
| | | @ApiModelProperty(value = "会员退款") |
| | | private List<TVipOrderRefund> vipOrderRefunds; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | com.ruoyi.order.api.factory.AccountingStrategyDetailOrderFallbackFactory |
| | | com.ruoyi.order.api.factory.AccountingStrategyOrderFallbackFactory |
| | | com.ruoyi.order.api.factory.ShoppingOrderFallbackFactory |
| | | com.ruoyi.order.api.factory.JianGuanOrderFallbackFactory |
New file |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.feignClient.JianGuanOtherClient; |
| | | import com.ruoyi.other.api.vo.GovernmentCloudOtherVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JianGuanOtherFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<JianGuanOtherClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(JianGuanOtherClient.class); |
| | | |
| | | @Override |
| | | public JianGuanOtherClient create(Throwable throwable) { |
| | | log.error("政务云查询数据接口:{}", throwable.getMessage()); |
| | | return new JianGuanOtherClient() { |
| | | @Override |
| | | public R<GovernmentCloudOtherVO> listAll() { |
| | | return R.fail("政务云查询数据接口Other:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.factory.JianGuanOtherFallbackFactory; |
| | | import com.ruoyi.other.api.vo.GovernmentCloudOtherVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/4 17:54 |
| | | */ |
| | | @FeignClient(contextId = "JianGuanOtherClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = JianGuanOtherFallbackFactory.class) |
| | | public interface JianGuanOtherClient { |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/governmentCloudOther/listAll") |
| | | R<GovernmentCloudOtherVO> listAll(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.vo; |
| | | |
| | | import com.ruoyi.other.api.domain.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GovernmentCloudOtherVO对象",description = "Other政务云上传数据VO") |
| | | public class GovernmentCloudOtherVO { |
| | | |
| | | @ApiModelProperty(value = "合作商") |
| | | private List<Operator> operators; |
| | | @ApiModelProperty(value = "活动") |
| | | private List<TActivity> activities; |
| | | @ApiModelProperty(value = "广告") |
| | | private List<TAdvertising> advertisings; |
| | | @ApiModelProperty(value = "公司") |
| | | private List<TCompany> companies; |
| | | @ApiModelProperty(value = "优惠券") |
| | | private List<TCoupon> coupons; |
| | | @ApiModelProperty(value = "用户信息") |
| | | private List<TEnterpriseUserApplication> enterpriseUserApplications; |
| | | @ApiModelProperty(value = "评价标签") |
| | | private List<TEvaluationTag> evaluationTags; |
| | | @ApiModelProperty(value = "商品") |
| | | private List<TGoods> goods; |
| | | @ApiModelProperty(value = "协议") |
| | | private List<THtml> htmls; |
| | | @ApiModelProperty(value = "积分规则") |
| | | private List<TIntegralRule> integralRules; |
| | | @ApiModelProperty(value = "开票类型") |
| | | private List<TInvoiceType> invoiceTypes; |
| | | @ApiModelProperty(value = "消息") |
| | | private List<TNotice> notices; |
| | | @ApiModelProperty(value = "系统配置") |
| | | private List<TSystemConfiguration> systemConfigurations; |
| | | @ApiModelProperty(value = "用户标签") |
| | | private List<TUserTag> userTags; |
| | | @ApiModelProperty(value = "会员") |
| | | private List<TVip> vips; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | com.ruoyi.other.api.factory.UserTagFallbackFactory |
| | | com.ruoyi.other.api.factory.OperatorFallbackFactory |
| | | com.ruoyi.other.api.factory.SystemConfigurationClientFallbackFactory |
| | | com.ruoyi.other.api.factory.JianGuanOtherFallbackFactory |
New file |
| | |
| | | package com.ruoyi.system.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.feignClient.JianGuanSystemClient; |
| | | import com.ruoyi.system.api.vo.GovernmentCloudSystemVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JianGuanSystemFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<JianGuanSystemClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(JianGuanSystemClient.class); |
| | | |
| | | @Override |
| | | public JianGuanSystemClient create(Throwable throwable) { |
| | | log.error("政务云查询数据接口:{}", throwable.getMessage()); |
| | | return new JianGuanSystemClient() { |
| | | @Override |
| | | public R<GovernmentCloudSystemVO> listAll() { |
| | | return R.fail("政务云查询数据接口System:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.factory.JianGuanSystemFallbackFactory; |
| | | import com.ruoyi.system.api.vo.GovernmentCloudSystemVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/4 17:54 |
| | | */ |
| | | @FeignClient(contextId = "JianGuanSystemClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = JianGuanSystemFallbackFactory.class) |
| | | public interface JianGuanSystemClient { |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/governmentCloudSystem/listAll") |
| | | R<GovernmentCloudSystemVO> listAll(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.vo; |
| | | |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.api.domain.SysOperLog; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.expression.spel.ast.Operator; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GovernmentCloudSystemVO对象",description = "System政务云上传数据VO") |
| | | public class GovernmentCloudSystemVO { |
| | | |
| | | @ApiModelProperty(value = "登录日志") |
| | | private List<SysLoginLog> loginLogs; |
| | | @ApiModelProperty(value = "操作日志") |
| | | private List<SysOperLog> sysOperLogs; |
| | | @ApiModelProperty(value = "角色") |
| | | private List<SysRole> sysRoles; |
| | | @ApiModelProperty(value = "系统用户") |
| | | private List<SysUser> sysUsers; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | com.ruoyi.system.api.factory.SysRoleFallbackFactory |
| | | com.ruoyi.system.api.factory.SysLoginLogFallbackFactory |
| | | com.ruoyi.system.api.factory.SysUserRoleFallbackFactory |
| | | com.ruoyi.system.api.factory.JianGuanSystemFallbackFactory |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.api.domain.SysOperLog; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.vo.GovernmentCloudSystemVO; |
| | | import com.ruoyi.system.service.ISysLoginLogService; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/governmentCloudSystem") |
| | | public class GovernmentCloudSystemController { |
| | | |
| | | @Autowired |
| | | private ISysLoginLogService sysLoginLogService; |
| | | @Autowired |
| | | private ISysOperLogService sysOperLogService; |
| | | @Autowired |
| | | private ISysRoleService sysRoleService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/listAll") |
| | | R<GovernmentCloudSystemVO> listAll() { |
| | | LocalDateTime end = LocalDateTime.now(); |
| | | LocalDateTime start = LocalDateTime.now().minusDays(1); |
| | | GovernmentCloudSystemVO governmentCloudAccountVO = new GovernmentCloudSystemVO(); |
| | | List<SysLoginLog> list1 = sysLoginLogService.lambdaQuery().between(SysLoginLog::getCreateTime, start, end).list(); |
| | | List<SysOperLog> list2 = sysOperLogService.lambdaQuery().between(SysOperLog::getOperTime, start, end).list(); |
| | | List<SysRole> list3 = sysRoleService.lambdaQuery().between(SysRole::getCreateTime, start, end).list(); |
| | | List<SysUser> list4 = sysUserService.lambdaQuery().between(SysUser::getCreateTime, start, end).list(); |
| | | governmentCloudAccountVO.setLoginLogs(list1); |
| | | governmentCloudAccountVO.setSysOperLogs(list2); |
| | | governmentCloudAccountVO.setSysRoles(list3); |
| | | governmentCloudAccountVO.setSysUsers(list4); |
| | | return R.ok(governmentCloudAccountVO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.account.api.vo.GovernmentCloudAccountVO; |
| | | import com.ruoyi.account.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/governmentCloudAccount") |
| | | public class GovernmentCloudAccountController { |
| | | @Autowired |
| | | private TAppCouponService tAppCouponService; |
| | | @Autowired |
| | | private TAppUserCarService appUserCarService; |
| | | @Autowired |
| | | private TAppUserTagService appUserTagService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @Autowired |
| | | private TAppUserAddressService appUserAddressService; |
| | | @Autowired |
| | | private TAppUserIntegralChangeService appUserIntegralChangeService; |
| | | @Autowired |
| | | private TAppUserSignService appUserSignService; |
| | | @Autowired |
| | | private TAppUserVipDetailService appUserVipDetailService; |
| | | @Autowired |
| | | private TInviteUserService inviteUserService; |
| | | @Autowired |
| | | private TInvoiceInformationService invoiceInformationService; |
| | | |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/listAll") |
| | | R<GovernmentCloudAccountVO> listAll() { |
| | | LocalDateTime end = LocalDateTime.now(); |
| | | LocalDateTime start = LocalDateTime.now().minusDays(1); |
| | | GovernmentCloudAccountVO governmentCloudAccountVO = new GovernmentCloudAccountVO(); |
| | | List<TAppCoupon> list1 = tAppCouponService.lambdaQuery().between(TAppCoupon::getCreateTime, start, end).list(); |
| | | List<TAppUser> list2 = appUserService.lambdaQuery().between(TAppUser::getCreateTime, start, end).list(); |
| | | List<TAppUserAddress> list3 = appUserAddressService.lambdaQuery().between(TAppUserAddress::getCreateTime, start, end).list(); |
| | | List<TAppUserCar> list4 = appUserCarService.lambdaQuery().between(TAppUserCar::getCreateTime, start, end).list(); |
| | | List<TAppUserIntegralChange> list5 = appUserIntegralChangeService.lambdaQuery().between(TAppUserIntegralChange::getCreateTime, start, end).list(); |
| | | List<TAppUserSign> list6 = appUserSignService.lambdaQuery().between(TAppUserSign::getCreateTime, start, end).list(); |
| | | List<TAppUserTag> list7 = appUserTagService.lambdaQuery().between(TAppUserTag::getCreateTime, start, end).list(); |
| | | List<TAppUserVipDetail> list8 = appUserVipDetailService.lambdaQuery().between(TAppUserVipDetail::getCreateTime, start, end).list(); |
| | | List<TInviteUser> list9 = inviteUserService.lambdaQuery().between(TInviteUser::getCreateTime, start, end).list(); |
| | | List<TInvoiceInformation> list10 = invoiceInformationService.lambdaQuery().between(TInvoiceInformation::getCreateTime, start, end).list(); |
| | | governmentCloudAccountVO.setAppCoupons(list1); |
| | | governmentCloudAccountVO.setAppUsers(list2); |
| | | governmentCloudAccountVO.setAppUserAddresses(list3); |
| | | governmentCloudAccountVO.setAppUserCars(list4); |
| | | governmentCloudAccountVO.setAppUserIntegralChanges(list5); |
| | | governmentCloudAccountVO.setAppUserSigns(list6); |
| | | governmentCloudAccountVO.setAppUserTags(list7); |
| | | governmentCloudAccountVO.setAppUserVipDetails(list8); |
| | | governmentCloudAccountVO.setInviteUsers(list9); |
| | | governmentCloudAccountVO.setInvoiceInformations(list10); |
| | | return R.ok(governmentCloudAccountVO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.account.api.vo.GovernmentCloudAccountVO; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.vo.GovernmentCloudChargingPileVO; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/governmentCloudChargingPile") |
| | | public class GovernmentCloudChargingPileController { |
| | | @Autowired |
| | | private IPartnerService partnerService; |
| | | @Autowired |
| | | private ISiteService siteService; |
| | | @Autowired |
| | | private TAccountingStrategyDetailService accountingStrategyDetailService; |
| | | @Autowired |
| | | private TAccountingStrategyService accountingStrategyService; |
| | | @Autowired |
| | | private TApplyChargingPileService applyChargingPileService; |
| | | @Autowired |
| | | private TCarportService carportService; |
| | | @Autowired |
| | | private TChargingGunService chargingGunService; |
| | | @Autowired |
| | | private TChargingPileNotificationService chargingPileNotificationService; |
| | | @Autowired |
| | | private TChargingPileService chargingPileService; |
| | | @Autowired |
| | | private TFaultMessageService faultMessageService; |
| | | @Autowired |
| | | private TMonitoringEquipmentService monitoringEquipmentService; |
| | | @Autowired |
| | | private TParkingLotService parkingLotService; |
| | | @Autowired |
| | | private TParkingRecordService parkingRecordService; |
| | | @Autowired |
| | | private TPartnerSiteService partnerSiteService; |
| | | @Autowired |
| | | private TRepairService repairService; |
| | | @Autowired |
| | | private TSiteMenuService siteMenuService; |
| | | @Autowired |
| | | private TVehicleRampService vehicleRampService; |
| | | |
| | | |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/listAll") |
| | | R<GovernmentCloudChargingPileVO> listAll() { |
| | | LocalDateTime end = LocalDateTime.now(); |
| | | LocalDateTime start = LocalDateTime.now().minusDays(1); |
| | | GovernmentCloudChargingPileVO governmentCloudAccountVO = new GovernmentCloudChargingPileVO(); |
| | | List<Partner> list1 = partnerService.lambdaQuery().between(Partner::getCreateTime, start, end).list(); |
| | | List<Site> list2 = siteService.lambdaQuery().between(Site::getCreateTime, start, end).list(); |
| | | List<TAccountingStrategyDetail> list3 = accountingStrategyDetailService.lambdaQuery().between(TAccountingStrategyDetail::getCreateTime, start, end).list(); |
| | | List<TAccountingStrategy> list4 = accountingStrategyService.lambdaQuery().between(TAccountingStrategy::getCreateTime, start, end).list(); |
| | | List<TApplyChargingPile> list5 = applyChargingPileService.lambdaQuery().between(TApplyChargingPile::getCreateTime, start, end).list(); |
| | | List<TCarport> list6 = carportService.lambdaQuery().between(TCarport::getCreateTime, start, end).list(); |
| | | List<TChargingGun> list7 = chargingGunService.lambdaQuery().between(TChargingGun::getCreateTime, start, end).list(); |
| | | List<TChargingPile> list8 = chargingPileService.lambdaQuery().between(TChargingPile::getCreateTime, start, end).list(); |
| | | List<TChargingPileNotification> list9 = chargingPileNotificationService.lambdaQuery().between(TChargingPileNotification::getCreateTime, start, end).list(); |
| | | List<TFaultMessage> list10 = faultMessageService.lambdaQuery().between(TFaultMessage::getCreateTime, start, end).list(); |
| | | List<TMonitoringEquipment> list11 = monitoringEquipmentService.lambdaQuery().between(TMonitoringEquipment::getCreateTime, start, end).list(); |
| | | List<TParkingLot> list12 = parkingLotService.lambdaQuery().between(TParkingLot::getCreateTime, start, end).list(); |
| | | List<TParkingRecord> list13 = parkingRecordService.lambdaQuery().between(TParkingRecord::getCreateTime, start, end).list(); |
| | | // List<TPartnerSite> list14 = invoiceInformationService.lambdaQuery().between(TPartnerSite::getCreateTime, start, end).list(); |
| | | List<TRepair> list15 = repairService.lambdaQuery().between(TRepair::getCreateTime, start, end).list(); |
| | | List<TVehicleRamp> list16 = vehicleRampService.lambdaQuery().between(TVehicleRamp::getCreateTime, start, end).list(); |
| | | // List<TSiteMenu> list17 = siteMenuService.lambdaQuery().between(TSiteMenu::getCreateTime, start, end).list(); |
| | | |
| | | governmentCloudAccountVO.setPartners(list1); |
| | | governmentCloudAccountVO.setSites(list2); |
| | | governmentCloudAccountVO.setAccountingStrategies(list4); |
| | | governmentCloudAccountVO.setAccountingStrategyDetails(list3); |
| | | governmentCloudAccountVO.setApplyChargingPiles(list5); |
| | | governmentCloudAccountVO.setCarports(list6); |
| | | governmentCloudAccountVO.setChargingGuns(list7); |
| | | governmentCloudAccountVO.setChargingPiles(list8); |
| | | governmentCloudAccountVO.setChargingPileNotifications(list9); |
| | | governmentCloudAccountVO.setFaultMessages(list10); |
| | | governmentCloudAccountVO.setMonitoringEquipments(list11); |
| | | governmentCloudAccountVO.setParkingLots(list12); |
| | | governmentCloudAccountVO.setParkingRecords(list13); |
| | | // governmentCloudAccountVO.setPartnerSites(list14); |
| | | governmentCloudAccountVO.setRepairs(list15); |
| | | governmentCloudAccountVO.setVehicleRamps(list16); |
| | | // governmentCloudAccountVO.setSiteMenus(list17); |
| | | return R.ok(governmentCloudAccountVO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.GetChargingGunByCode; |
| | | import com.ruoyi.chargingPile.api.vo.GunStatusStatisticsVO; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.api.vo.*; |
| | | import com.ruoyi.chargingPile.config.FileUploadConfig; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | |
| | | return R.ok(chargingGun); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据枪唯一码查询信息 |
| | | * @return |
| | | */ |
| | | @ApiOperation(tags = {"大屏-对外开放区车位使用情况"},value = "对外开放区车位使用情况") |
| | | @GetMapping("/getLargeScreenGun") |
| | | public R<LargeScreenGunVo> getLargeScreenGun(){ |
| | | LargeScreenGunVo largeScreenGunVo = new LargeScreenGunVo(); |
| | | List<TChargingGun> tChargingGuns = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getDelFlag, 0).in(TChargingGun::getSiteId,25,26).in(TChargingGun::getChargeMode, 1,2,4)); |
| | | if(tChargingGuns.isEmpty()){ |
| | | return R.ok(largeScreenGunVo); |
| | | } |
| | | List<TChargingGun> supperFast = tChargingGuns.stream().filter(e -> e.getChargeMode() == 1).collect(Collectors.toList()); |
| | | largeScreenGunVo.setSuperFast(supperFast.size()); |
| | | int supperFastSize = supperFast.stream().filter(e -> e.getStatus() != 2).collect(Collectors.toList()).size(); |
| | | largeScreenGunVo.setUseSuperFast(supperFastSize); |
| | | List<TChargingGun> fast = tChargingGuns.stream().filter(e -> e.getChargeMode() == 2).collect(Collectors.toList()); |
| | | largeScreenGunVo.setFast(fast.size()); |
| | | int fastSize = fast.stream().filter(e -> e.getStatus() != 2).collect(Collectors.toList()).size(); |
| | | largeScreenGunVo.setUseFast(fastSize); |
| | | List<TChargingGun> v2g = tChargingGuns.stream().filter(e -> e.getChargeMode() == 4).collect(Collectors.toList()); |
| | | largeScreenGunVo.setV2g(v2g.size()); |
| | | int v2gSize = v2g.stream().filter(e -> e.getStatus() != 2).collect(Collectors.toList()).size(); |
| | | largeScreenGunVo.setUseV2g(v2gSize); |
| | | |
| | | return R.ok(largeScreenGunVo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 大屏 根据站点ids和充电模式集合查询充电枪集合 没有过滤del_flag |
| | | */ |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-chargingPile</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mqtt --> |
| | | <dependency> |
| | | <groupId>org.springframework.integration</groupId> |
| | | <artifactId>spring-integration-stream</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.integration</groupId> |
| | | <artifactId>spring-integration-mqtt</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-integration</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
New file |
| | |
| | | package com.ruoyi.jianguan.constant; |
| | | |
| | | public class IotConstant { |
| | | public static final int SUCCESS = 1; |
| | | public static final int FAIL = 0; |
| | | /** |
| | | * 华为云iot token |
| | | */ |
| | | public static final String IOT_TOKEN = "iot_token"; |
| | | /** |
| | | * 模式 |
| | | */ |
| | | public static final String PASSWORD = "password"; |
| | | /** |
| | | * URL |
| | | */ |
| | | public static final String URL = "https://94cb3eb5f9.st1.iotda-app.cn-south-1.myhuaweicloud.com"; |
| | | /** |
| | | * 创建产品 |
| | | */ |
| | | public static final String CREATE_PRODUCT = URL+"/v5/iot/{project_id}/products"; |
| | | /** |
| | | * 创建产品 |
| | | */ |
| | | public static final String DELETE_PRODUCT = URL+"/v5/iot/{project_id}/products/{product_id}"; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.controller; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.ruoyi.chargingPile.api.vo.LargeScreenGunVo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.jianguan.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.jianguan.vo.LargeChargingPowerVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api(tags = "大屏") |
| | | @RestController |
| | | @RequestMapping("/large-screen") |
| | | public class LargeScreenController { |
| | | |
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private final UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService; |
| | | |
| | | public LargeScreenController(UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService) { |
| | | this.uploadRealTimeMonitoringDataService = uploadRealTimeMonitoringDataService; |
| | | } |
| | | |
| | | |
| | | @SneakyThrows |
| | | @ApiOperation(tags = {"大屏-停车场充电功率曲线图"},value = "停车场充电功率曲线图") |
| | | @GetMapping("/getChargingPower") |
| | | public R<List<LargeChargingPowerVo>> getChargingPower(){ |
| | | String sevenDayAgo = LocalDate.now().minusDays(7) + " 00:00:00"; |
| | | String oneDayAgo = LocalDate.now().minusDays(1) + " 23:59:59"; |
| | | Date oneDayAgoTime = format.parse(oneDayAgo); |
| | | Date sevenDayAgoTime = format.parse(sevenDayAgo); |
| | | ArrayList<LargeChargingPowerVo> largeChargingPowerVos = new ArrayList<>(); |
| | | List<UploadRealTimeMonitoringData> rangeTimeData = uploadRealTimeMonitoringDataService.getRangeTimeData(oneDayAgoTime, sevenDayAgoTime); |
| | | for (int count = 7; count > 0; count--) { |
| | | LargeChargingPowerVo largeChargingPowerVo = new LargeChargingPowerVo(); |
| | | String time = LocalDate.now().minusDays(count).toString(); |
| | | List<UploadRealTimeMonitoringData> list = rangeTimeData.stream().filter(e -> e.getCreateTime().contains(time)).collect(Collectors.toList()); |
| | | if(!list.isEmpty()){ |
| | | BigDecimal powerAverage = list.stream().map(UploadRealTimeMonitoringData::getPower).reduce(BigDecimal.ZERO, BigDecimal::add).divide(BigDecimal.valueOf(list.size()), 0, RoundingMode.HALF_UP); |
| | | largeChargingPowerVo.setPower(powerAverage); |
| | | } |
| | | largeChargingPowerVo.setTime(time); |
| | | largeChargingPowerVos.add(largeChargingPowerVo); |
| | | } |
| | | |
| | | return R.ok(largeChargingPowerVos); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.governmentCloud; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.jianguan.mongodb.service.*; |
| | | import com.ruoyi.jianguan.mqtt.config.TopicConstants; |
| | | import com.ruoyi.jianguan.mqtt.util.MqttPushUtil; |
| | | import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage; |
| | | import io.netty.util.concurrent.DefaultThreadFactory; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.*; |
| | | |
| | | /** |
| | | * 定时上传政务云数据 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class UploadDataTaskUtil { |
| | | |
| | | @Autowired |
| | | private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService; |
| | | @Autowired |
| | | private MqttPushUtil mqttPushUtil; |
| | | |
| | | /** |
| | | * 每天的9点执行的任务 |
| | | */ |
| | | // @Scheduled(cron = "0 0 9 * * *") |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskDay(){ |
| | | try { |
| | | // 传输mongodb的硬件数据 |
| | | createCustomThreadPool(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建自定义线程池 |
| | | * 特点: |
| | | * 1. 支持定时及周期性任务 |
| | | * 2. 核心线程数固定,但可以不断创建新线程执行后续任务 |
| | | * 3. 适用于需要定时执行或周期性执行的场景 |
| | | */ |
| | | @SneakyThrows |
| | | public void createCustomThreadPool() { |
| | | /* |
| | | 创建自定义线程池 |
| | | 字段: |
| | | 1. corePoolSize:核心线程池数量 |
| | | 2. maximumPoolSize: 最大线程池数量 |
| | | 3. keepAliveTime: 线程空闲时间 |
| | | 4. unit: 时间单位 |
| | | 5. workQueue: 阻塞队列 |
| | | 5. threadFactory: 线程工厂 |
| | | 5. handler: 拒绝策略 |
| | | */ |
| | | ThreadPoolExecutor customthreadPoolExecutor = new ThreadPoolExecutor( |
| | | 5, // 根据CPU核心数设置 |
| | | 10, // 最大应急线程数 |
| | | 30, TimeUnit.SECONDS, // 空闲线程存活时间 |
| | | new ArrayBlockingQueue<>(100), // 有界队列防止内存溢出 |
| | | new DefaultThreadFactory("custom-thread-pool"), // 自定义线程命名 |
| | | new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略 |
| | | ); |
| | | |
| | | try { |
| | | LocalDate localDate = LocalDate.now().minusDays(1); |
| | | String start = localDate + " 00:00:00"; |
| | | String end = localDate + " 23:59:59"; |
| | | Date startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(start); |
| | | Date endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end); |
| | | // 查询所有的mango数据 |
| | | List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringDataList = uploadRealTimeMonitoringDataService.getRangeTimeData(startTime, endTime); |
| | | customthreadPoolExecutor.execute(() -> { |
| | | if (uploadRealTimeMonitoringDataList != null && uploadRealTimeMonitoringDataList.size() > 0) { |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : uploadRealTimeMonitoringDataList) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("device_code", uploadRealTimeMonitoringData.getCharging_pile_code()); |
| | | jsonObject.put("report_time", System.currentTimeMillis()); |
| | | jsonObject.put("properties", uploadRealTimeMonitoringData); |
| | | mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", uploadRealTimeMonitoringData.getCharging_pile_code()), jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | TimeUnit.MILLISECONDS.sleep(1); |
| | | |
| | | // Future<String> future = customthreadPoolExecutor.submit(() -> { |
| | | // log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | // return "业务办理完成"; |
| | | // }); |
| | | // log.info(future.get()); |
| | | } finally { |
| | | gracefulShutdown(customthreadPoolExecutor); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 优雅关闭线程池通用方法 |
| | | * |
| | | * @param pool 需要关闭的线程池 |
| | | */ |
| | | private static void gracefulShutdown(ExecutorService pool) { |
| | | pool.shutdown(); // 拒绝新任务提交 |
| | | try { |
| | | // 等待现有任务完成 |
| | | if (!pool.awaitTermination(60, TimeUnit.SECONDS)) { |
| | | pool.shutdownNow(); // 取消等待中的任务 只等待运行中的任务 |
| | | // 再次等待任务响应中断 |
| | | if (!pool.awaitTermination(60, TimeUnit.SECONDS)) { |
| | | log.error("线程池未完全关闭"); |
| | | } |
| | | } |
| | | } catch (InterruptedException e) { |
| | | // 重新尝试关闭 |
| | | pool.shutdownNow(); |
| | | Thread.currentThread().interrupt(); |
| | | } finally { |
| | | log.info("线程池是否执行完成:{}", pool.isTerminated()); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.err.println(System.currentTimeMillis()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.base; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BaseService<T> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param t 实体类 |
| | | * @return 添加结果 1=成功 0=失败 |
| | | */ |
| | | int create(T t); |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | * @param id 实体id |
| | | * @return 实体对象 |
| | | */ |
| | | T findById(String id); |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * @return 实体列表 |
| | | */ |
| | | List<T> findAll(); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingModeReply; |
| | | import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface AcquisitionBillingModeReplyService extends BaseService<AcquisitionBillingModeReply> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<AcquisitionBillingModeReply> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingModeReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface AcquisitionBillingModeService extends BaseService<AcquisitionBillingMode> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<AcquisitionBillingMode> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BillingModeVerifyReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BillingModeVerifyReplyService extends BaseService<BillingModeVerifyReply> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<BillingModeVerifyReply> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BillingModeVerify; |
| | | import com.ruoyi.integration.api.model.BillingModeVerifyReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BillingModeVerifyService extends BaseService<BillingModeVerify> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<BillingModeVerify> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BillingModeVerify; |
| | | import com.ruoyi.integration.api.model.BmsAbort; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BmsAbortService extends BaseService<BmsAbort> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<BmsAbort> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BmsAbort; |
| | | import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BmsDemandAndChargerExportationService extends BaseService<BmsDemandAndChargerExportation> { |
| | | |
| | | |
| | | /** |
| | | * 获取bms数据 |
| | | * @param orderCode |
| | | * @return |
| | | */ |
| | | List<BmsDemandAndChargerExportation> getBmsDemandAndChargerExportation(String orderCode); |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<BmsDemandAndChargerExportation> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BmsAbort; |
| | | import com.ruoyi.integration.api.model.BmsInformation; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BmsInformationService extends BaseService<BmsInformation> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<BmsInformation> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.BmsInformation; |
| | | import com.ruoyi.integration.api.model.ChargingHandshake; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ChargingHandshakeService extends BaseService<ChargingHandshake> { |
| | | |
| | | |
| | | ChargingHandshake getDataByOrderCode(String code); |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ChargingHandshake> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ChargingHandshake; |
| | | import com.ruoyi.integration.api.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ChargingPileReturnsGroundLockDataService extends BaseService<ChargingPileReturnsGroundLockData> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ChargingPileReturnsGroundLockData> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.integration.api.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ChargingPileStartsChargingService extends BaseService<ChargingPileStartsCharging> { |
| | | |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ChargingPileStartsCharging> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ClearOfflineCardReplyService extends BaseService<ClearOfflineCardReply> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ClearOfflineCardReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ClearOfflineCard; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface ClearOfflineCardService extends BaseService<ClearOfflineCard> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ClearOfflineCard> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ClearOfflineCard; |
| | | import com.ruoyi.integration.api.model.ConfirmTransactionRecord; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface ConfirmTransactionRecordService extends BaseService<ConfirmTransactionRecord> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ConfirmTransactionRecord> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ConfirmTransactionRecord; |
| | | import com.ruoyi.integration.api.model.EndCharge; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface EndChargeService extends BaseService<EndCharge> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<EndCharge> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.EndCharge; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface ErrorMessageMessageService extends BaseService<ErrorMessageMessage> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ErrorMessageMessage> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.GroundLockRealTimeData; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface GroundLockRealTimeDataService extends BaseService<GroundLockRealTimeData> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<GroundLockRealTimeData> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.GroundLockRealTimeData; |
| | | import com.ruoyi.integration.api.model.MotorAbort; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface MotorAbortService extends BaseService<MotorAbort> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<MotorAbort> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.MotorAbort; |
| | | import com.ruoyi.integration.api.model.OnlineReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | /** |
| | | * 登录认证应答接口 |
| | | */ |
| | | public interface OnlineReplyService extends BaseService<OnlineReply> { |
| | | |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<OnlineReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.Online; |
| | | import com.ruoyi.integration.api.model.OnlineReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | /** |
| | | * 充电桩登录认证接口 |
| | | */ |
| | | public interface OnlineService extends BaseService<Online> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<Online> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.Online; |
| | | import com.ruoyi.integration.api.model.OpenOrCloseGroundLock; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface OpenOrCloseGroundLockService extends BaseService<OpenOrCloseGroundLock> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<OpenOrCloseGroundLock> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.OpenOrCloseGroundLock; |
| | | import com.ruoyi.integration.api.model.ParameterSetting; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface ParameterSettingService extends BaseService<ParameterSetting> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ParameterSetting> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.Ping; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | public interface PingService extends BaseService<Ping> { |
| | | |
| | | /** |
| | | * 定时删除数据 |
| | | */ |
| | | void delPing(); |
| | | |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * @param ping |
| | | */ |
| | | void save(Ping ping); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.OnlineReply; |
| | | import com.ruoyi.integration.api.model.PlatformConfirmationCharging; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformConfirmationChargingService extends BaseService<PlatformConfirmationCharging> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformConfirmationCharging> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformConfirmationCharging; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformRemoteUpdateReplyService extends BaseService<PlatformRemoteUpdateReply> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformRemoteUpdateReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdate; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformRemoteUpdateService extends BaseService<PlatformRemoteUpdate> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformRemoteUpdate> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdate; |
| | | import com.ruoyi.integration.api.model.PlatformRestartReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformRestartReplyService extends BaseService<PlatformRestartReply> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformRestartReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformRestart; |
| | | import com.ruoyi.integration.api.model.PlatformRestartReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformRestartService extends BaseService<PlatformRestart> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformRestart> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformRestart; |
| | | import com.ruoyi.integration.api.model.PlatformStartChargingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformStartChargingReplyService extends BaseService<PlatformStartChargingReply> { |
| | | |
| | | /** |
| | | * 根据订单编号查询远程启机应答数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<PlatformStartChargingReply> getPlatformStartChargingReply(String code); |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformStartChargingReply> getRangeTimeData(Date startTime, Date endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformStartCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStartChargingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformStartChargingService extends BaseService<PlatformStartCharging> { |
| | | |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformStartCharging> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformStartCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStopChargingReply; |
| | | import com.ruoyi.integration.api.vo.GetPlatformStopChargingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformStopChargingReplyService extends BaseService<PlatformStopChargingReply> { |
| | | |
| | | /** |
| | | * 根据枪编号获取停机应答 |
| | | * @return |
| | | */ |
| | | PlatformStopChargingReply getPlatformStopChargingReply(GetPlatformStopChargingReply query); |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformStopChargingReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStopChargingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface PlatformStopChargingService extends BaseService<PlatformStopCharging> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<PlatformStopCharging> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.Pong; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | /** |
| | | * 心跳包应答接口 |
| | | */ |
| | | public interface PongService extends BaseService<Pong> { |
| | | |
| | | void delPong(); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.api.model.QrCodeDeliveryReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | /** |
| | | */ |
| | | public interface QrCodeDeliveryReplyService extends BaseService<QrCodeDeliveryReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<QrCodeDeliveryReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.QrCodeDeliveryReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | /** |
| | | */ |
| | | public interface QrCodeDeliveryService extends BaseService<QrCodeDelivery> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<QrCodeDelivery> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface QueryOfflineCardReplyService extends BaseService<QueryOfflineCardReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<QueryOfflineCardReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.QueryOfflineCard; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface QueryOfflineCardService extends BaseService<QueryOfflineCard> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<QueryOfflineCard> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.QueryOfflineCard; |
| | | import com.ruoyi.integration.api.model.ReadRealTimeMonitoringData; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface ReadRealTimeMonitoringDataService extends BaseService<ReadRealTimeMonitoringData> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<ReadRealTimeMonitoringData> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.ReadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.SecurityDetection; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | /** |
| | | */ |
| | | public interface SecurityDetectionService extends BaseService<SecurityDetection> { |
| | | |
| | | |
| | | /** |
| | | * 根据业务流水号查询数据 |
| | | * @param transactionSerialNumber |
| | | * @return |
| | | */ |
| | | SecurityDetection getSecurityDetection(String transactionSerialNumber); |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<SecurityDetection> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.SecurityDetection; |
| | | import com.ruoyi.integration.api.model.SetupBillingModelReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface SetupBillingModelReplyService extends BaseService<SetupBillingModelReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<SetupBillingModelReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.SetupBillingModel; |
| | | import com.ruoyi.integration.api.model.SetupBillingModelReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface SetupBillingModelService extends BaseService<SetupBillingModel> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<SetupBillingModel> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.SetupBillingModel; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface SynchronizeOfflineCardReplyService extends BaseService<SynchronizeOfflineCardReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<SynchronizeOfflineCardReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCard; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface SynchronizeOfflineCardService extends BaseService<SynchronizeOfflineCard> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<SynchronizeOfflineCard> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCard; |
| | | import com.ruoyi.integration.api.model.TimingSettingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface TimingSettingReplyService extends BaseService<TimingSettingReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<TimingSettingReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.TimingSetting; |
| | | import com.ruoyi.integration.api.model.TimingSettingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface TimingSettingService extends BaseService<TimingSetting> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<TimingSetting> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.TimingSetting; |
| | | import com.ruoyi.integration.api.model.TransactionRecord; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface TransactionRecordService extends BaseService<TransactionRecord> { |
| | | |
| | | /** |
| | | * 根据订单流水号查询数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | TransactionRecord findOne(String code); |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<TransactionRecord> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.TransactionRecord; |
| | | import com.ruoyi.integration.api.model.UpdateBalanceReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface UpdateBalanceReplyService extends BaseService<UpdateBalanceReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<UpdateBalanceReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.UpdateBalance; |
| | | import com.ruoyi.integration.api.model.UpdateBalanceReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface UpdateBalanceService extends BaseService<UpdateBalance> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<UpdateBalance> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | import com.ruoyi.integration.api.model.UpdateBalance; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface UploadRealTimeMonitoringDataService extends BaseService<UploadRealTimeMonitoringData> { |
| | | |
| | | /** |
| | | * 根据订单号查询监控数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<UploadRealTimeMonitoringData> getDataByOrderCode(String code); |
| | | UploadRealTimeMonitoringPageData getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException; |
| | | |
| | | /** |
| | | * 查询订单最新一条数据 |
| | | * @param transaction_serial_number |
| | | * @return |
| | | */ |
| | | UploadRealTimeMonitoringData getLastDataById(String transaction_serial_number); |
| | | |
| | | void delete(String id); |
| | | |
| | | void updateById(String id); |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<UploadRealTimeMonitoringData> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface WorkingParameterSettingReplyService extends BaseService<WorkingParameterSettingReply> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<WorkingParameterSettingReply> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.WorkingParameterSetting; |
| | | import com.ruoyi.integration.api.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.jianguan.mongodb.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | public interface WorkingParameterSettingService extends BaseService<WorkingParameterSetting> { |
| | | /** |
| | | * 获取前一日的所有数据数据 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<WorkingParameterSetting> getRangeTimeData(Date startTime, Date endTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingModeReply; |
| | | import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.AcquisitionBillingModeReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List;import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class AcquisitionBillingModeReplyServiceImpl implements AcquisitionBillingModeReplyService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(AcquisitionBillingModeReply acquisitionBillingModeReply) { |
| | | mongoTemplate.save(acquisitionBillingModeReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public AcquisitionBillingModeReply findById(String id) { |
| | | return mongoTemplate.findById(id, AcquisitionBillingModeReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<AcquisitionBillingModeReply> findAll() { |
| | | return mongoTemplate.findAll(AcquisitionBillingModeReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<AcquisitionBillingModeReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<AcquisitionBillingModeReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , AcquisitionBillingModeReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingModeReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.AcquisitionBillingModeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class AcquisitionBillingModeServiceImpl implements AcquisitionBillingModeService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(AcquisitionBillingMode acquisitionBillingMode) { |
| | | mongoTemplate.save(acquisitionBillingMode); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public AcquisitionBillingMode findById(String id) { |
| | | return mongoTemplate.findById(id, AcquisitionBillingMode.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<AcquisitionBillingMode> findAll() { |
| | | return mongoTemplate.findAll(AcquisitionBillingMode.class); |
| | | } |
| | | @Override |
| | | public List<AcquisitionBillingMode> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<AcquisitionBillingMode> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , AcquisitionBillingMode.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.api.model.BillingModeVerifyReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.BillingModeVerifyReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class BillingModeVerifyReplyServiceImpl implements BillingModeVerifyReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(BillingModeVerifyReply billingModeVerifyReply) { |
| | | mongoTemplate.save(billingModeVerifyReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BillingModeVerifyReply findById(String id) { |
| | | return mongoTemplate.findById(id, BillingModeVerifyReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingModeVerifyReply> findAll() { |
| | | return mongoTemplate.findAll(BillingModeVerifyReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingModeVerifyReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<BillingModeVerifyReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BillingModeVerifyReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.BillingModeVerify; |
| | | import com.ruoyi.integration.api.model.BillingModeVerifyReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.BillingModeVerifyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class BillingModeVerifyServiceImpl implements BillingModeVerifyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BillingModeVerify billingModeVerify) { |
| | | mongoTemplate.save(billingModeVerify); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BillingModeVerify findById(String id) { |
| | | return mongoTemplate.findById(id, BillingModeVerify.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingModeVerify> findAll() { |
| | | return mongoTemplate.findAll(BillingModeVerify.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingModeVerify> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<BillingModeVerify> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BillingModeVerify.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.BillingModeVerify; |
| | | import com.ruoyi.integration.api.model.BmsAbort; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.BmsAbortService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class BmsAbortServiceImpl implements BmsAbortService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsAbort bmsAbort) { |
| | | mongoTemplate.save(bmsAbort); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsAbort findById(String id) { |
| | | return mongoTemplate.findById(id, BmsAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsAbort> findAll() { |
| | | return mongoTemplate.findAll(BmsAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsAbort> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<BmsAbort> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BmsAbort.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.BmsAbort; |
| | | import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.BmsDemandAndChargerExportationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class BmsDemandAndChargerExportationServiceImpl implements BmsDemandAndChargerExportationService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsDemandAndChargerExportation bmsDemandAndChargerExportation) { |
| | | mongoTemplate.save(bmsDemandAndChargerExportation); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsDemandAndChargerExportation findById(String id) { |
| | | return mongoTemplate.findById(id, BmsDemandAndChargerExportation.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsDemandAndChargerExportation> findAll() { |
| | | return mongoTemplate.findAll(BmsDemandAndChargerExportation.class); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<BmsDemandAndChargerExportation> getBmsDemandAndChargerExportation(String orderCode) { |
| | | Query query = new Query(); |
| | | if(StringUtils.isNotEmpty(orderCode)){ |
| | | query.addCriteria(Criteria.where("transaction_serial_number").is(orderCode)); |
| | | } |
| | | List<BmsDemandAndChargerExportation> uploadRealTimeMonitoringData = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BmsDemandAndChargerExportation.class); |
| | | return uploadRealTimeMonitoringData; |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsDemandAndChargerExportation> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<BmsDemandAndChargerExportation> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BmsDemandAndChargerExportation.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.integration.api.model.BmsInformation; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.BmsInformationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class BmsInformationServiceImpl implements BmsInformationService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsInformation bmsInformation) { |
| | | mongoTemplate.save(bmsInformation); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsInformation findById(String id) { |
| | | return mongoTemplate.findById(id, BmsInformation.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsInformation> findAll() { |
| | | return mongoTemplate.findAll(BmsInformation.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsInformation> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<BmsInformation> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , BmsInformation.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.BmsInformation; |
| | | import com.ruoyi.integration.api.model.ChargingHandshake; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ChargingHandshakeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ChargingHandshakeServiceImpl implements ChargingHandshakeService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingHandshake chargingHandshake) { |
| | | mongoTemplate.save(chargingHandshake); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingHandshake findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingHandshake.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingHandshake> findAll() { |
| | | return mongoTemplate.findAll(ChargingHandshake.class); |
| | | } |
| | | |
| | | @Override |
| | | public ChargingHandshake getDataByOrderCode(String code) { |
| | | List<ChargingHandshake> charging_gun_code = mongoTemplate.find(new Query().addCriteria(Criteria.where("transaction_serial_number").is(code)), ChargingHandshake.class); |
| | | return charging_gun_code.size() > 0 ? charging_gun_code.get(0) : null; |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingHandshake> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ChargingHandshake> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ChargingHandshake.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ChargingHandshake; |
| | | import com.ruoyi.integration.api.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ChargingPileReturnsGroundLockDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ChargingPileReturnsGroundLockDataServiceImpl implements ChargingPileReturnsGroundLockDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingPileReturnsGroundLockData chargingPileReturnsGroundLockData) { |
| | | mongoTemplate.save(chargingPileReturnsGroundLockData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingPileReturnsGroundLockData findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingPileReturnsGroundLockData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileReturnsGroundLockData> findAll() { |
| | | return mongoTemplate.findAll(ChargingPileReturnsGroundLockData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileReturnsGroundLockData> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ChargingPileReturnsGroundLockData> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ChargingPileReturnsGroundLockData.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.integration.api.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ChargingPileStartsChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ChargingPileStartsChargingServiceImpl implements ChargingPileStartsChargingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingPileStartsCharging chargingPileStartsCharging) { |
| | | mongoTemplate.save(chargingPileStartsCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingPileStartsCharging findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingPileStartsCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileStartsCharging> findAll() { |
| | | return mongoTemplate.findAll(ChargingPileStartsCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileStartsCharging> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ChargingPileStartsCharging> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ChargingPileStartsCharging.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ClearOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ClearOfflineCardReplyServiceImpl implements ClearOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ClearOfflineCardReply clearOfflineCardReply) { |
| | | mongoTemplate.save(clearOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ClearOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, ClearOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(ClearOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCardReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ClearOfflineCardReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ClearOfflineCardReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCard; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ClearOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ClearOfflineCardServiceImpl implements ClearOfflineCardService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ClearOfflineCard clearOfflineCard) { |
| | | mongoTemplate.save(clearOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ClearOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, ClearOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(ClearOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCard> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ClearOfflineCard> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ClearOfflineCard.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ClearOfflineCard; |
| | | import com.ruoyi.integration.api.model.ConfirmTransactionRecord; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ConfirmTransactionRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ConfirmTransactionRecordServiceImpl implements ConfirmTransactionRecordService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(ConfirmTransactionRecord confirmTransactionRecord) { |
| | | mongoTemplate.save(confirmTransactionRecord); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ConfirmTransactionRecord findById(String id) { |
| | | return mongoTemplate.findById(id, ConfirmTransactionRecord.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ConfirmTransactionRecord> findAll() { |
| | | return mongoTemplate.findAll(ConfirmTransactionRecord.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ConfirmTransactionRecord> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ConfirmTransactionRecord> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ConfirmTransactionRecord.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ConfirmTransactionRecord; |
| | | import com.ruoyi.integration.api.model.EndCharge; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.EndChargeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | @Service |
| | | public class EndChargeServiceImpl implements EndChargeService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(EndCharge endCharge) { |
| | | mongoTemplate.save(endCharge); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public EndCharge findById(String id) { |
| | | return mongoTemplate.findById(id, EndCharge.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<EndCharge> findAll() { |
| | | return mongoTemplate.findAll(EndCharge.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<EndCharge> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<EndCharge> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , EndCharge.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.EndCharge; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ErrorMessageMessageService; |
| | | import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | @Service |
| | | public class ErrorMessageMessageServiceImpl implements ErrorMessageMessageService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(ErrorMessageMessage errorMessageMessage) { |
| | | mongoTemplate.save(errorMessageMessage); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ErrorMessageMessage findById(String id) { |
| | | return mongoTemplate.findById(id, ErrorMessageMessage.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ErrorMessageMessage> findAll() { |
| | | return mongoTemplate.findAll(ErrorMessageMessage.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ErrorMessageMessage> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ErrorMessageMessage> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ErrorMessageMessage.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.GroundLockRealTimeData; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.GroundLockRealTimeDataService; |
| | | import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class GroundLockRealTimeDataServiceImpl implements GroundLockRealTimeDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(GroundLockRealTimeData groundLockRealTimeData) { |
| | | mongoTemplate.save(groundLockRealTimeData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public GroundLockRealTimeData findById(String id) { |
| | | return mongoTemplate.findById(id, GroundLockRealTimeData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<GroundLockRealTimeData> findAll() { |
| | | return mongoTemplate.findAll(GroundLockRealTimeData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<GroundLockRealTimeData> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<GroundLockRealTimeData> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , GroundLockRealTimeData.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.GroundLockRealTimeData; |
| | | import com.ruoyi.integration.api.model.MotorAbort; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.MotorAbortService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class MotorAbortServiceImpl implements MotorAbortService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(MotorAbort motorAbort) { |
| | | mongoTemplate.save(motorAbort); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public MotorAbort findById(String id) { |
| | | return mongoTemplate.findById(id, MotorAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<MotorAbort> findAll() { |
| | | return mongoTemplate.findAll(MotorAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<MotorAbort> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<MotorAbort> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , MotorAbort.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.MotorAbort; |
| | | import com.ruoyi.integration.api.model.OnlineReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.OnlineReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 登录认证应答实现类 |
| | | **/ |
| | | @Service |
| | | public class OnlineReplyServiceImpl implements OnlineReplyService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(OnlineReply onlineReply) { |
| | | mongoTemplate.save(onlineReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public OnlineReply findById(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<OnlineReply> findAll() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<OnlineReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<OnlineReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , OnlineReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.Online; |
| | | import com.ruoyi.integration.api.model.OnlineReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.OnlineService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 充电桩登录认证实现类 |
| | | **/ |
| | | @Service |
| | | public class OnlineServiceImpl implements OnlineService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(Online online) { |
| | | mongoTemplate.save(online); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public Online findById(String id) { |
| | | return mongoTemplate.findById(id, Online.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Online> findAll() { |
| | | return mongoTemplate.findAll(Online.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Online> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<Online> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , Online.class); |
| | | return list; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.Online; |
| | | import com.ruoyi.integration.api.model.OpenOrCloseGroundLock; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.OpenOrCloseGroundLockService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class OpenOrCloseGroundLockServiceImpl implements OpenOrCloseGroundLockService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(OpenOrCloseGroundLock openOrCloseGroundLock) { |
| | | mongoTemplate.save(openOrCloseGroundLock); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public OpenOrCloseGroundLock findById(String id) { |
| | | return mongoTemplate.findById(id, OpenOrCloseGroundLock.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<OpenOrCloseGroundLock> findAll() { |
| | | return mongoTemplate.findAll(OpenOrCloseGroundLock.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<OpenOrCloseGroundLock> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<OpenOrCloseGroundLock> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , OpenOrCloseGroundLock.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.OpenOrCloseGroundLock; |
| | | import com.ruoyi.integration.api.model.ParameterSetting; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ParameterSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ParameterSettingServiceImpl implements ParameterSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ParameterSetting parameterSetting) { |
| | | mongoTemplate.save(parameterSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ParameterSetting findById(String id) { |
| | | return mongoTemplate.findById(id, ParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ParameterSetting> findAll() { |
| | | return mongoTemplate.findAll(ParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ParameterSetting> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ParameterSetting> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ParameterSetting.class); |
| | | return list; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.Ping; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PingServiceImpl implements PingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(Ping ping) { |
| | | mongoTemplate.save(ping); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public Ping findById(String id) { |
| | | return mongoTemplate.findById(id, Ping.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Ping> findAll() { |
| | | return mongoTemplate.findAll(Ping.class); |
| | | } |
| | | |
| | | @Override |
| | | public void delPing() { |
| | | mongoTemplate.remove(new Query().addCriteria(Criteria.where("create_time").lt(LocalDateTime.now().minusDays(1))), Ping.class); |
| | | } |
| | | |
| | | @Override |
| | | public void save(Ping ping) { |
| | | Query query = new Query(); |
| | | if (StringUtils.isNotEmpty(ping.getCharging_pile_code())) { |
| | | query.addCriteria(Criteria.where("charging_pile_code").is(ping.getCharging_pile_code())); |
| | | } |
| | | if (StringUtils.isNotEmpty(ping.getCharging_gun_code())){ |
| | | query.addCriteria(Criteria.where("charging_gun_code").is(ping.getCharging_gun_code())); |
| | | } |
| | | List<Ping> pings = mongoTemplate.find(query, Ping.class); |
| | | if(pings.size() > 0){ |
| | | Ping ping1 = pings.get(0); |
| | | ping1.setLast_time(new Date()); |
| | | ping1.setCharging_gun_status(ping.getCharging_gun_status()); |
| | | mongoTemplate.save(ping1); |
| | | }else{ |
| | | mongoTemplate.save(ping); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ParameterSetting; |
| | | import com.ruoyi.integration.api.model.PlatformConfirmationCharging; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformConfirmationChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformConfirmationChargingServiceImpl implements PlatformConfirmationChargingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformConfirmationCharging platformConfirmationCharging) { |
| | | mongoTemplate.save(platformConfirmationCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformConfirmationCharging findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformConfirmationCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformConfirmationCharging> findAll() { |
| | | return mongoTemplate.findAll(PlatformConfirmationCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformConfirmationCharging> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformConfirmationCharging> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformConfirmationCharging.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformConfirmationCharging; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformRemoteUpdateReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformRemoteUpdateReplyServiceImpl implements PlatformRemoteUpdateReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRemoteUpdateReply platformRemoteUpdateReply) { |
| | | mongoTemplate.save(platformRemoteUpdateReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRemoteUpdateReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRemoteUpdateReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdateReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformRemoteUpdateReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdateReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformRemoteUpdateReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformRemoteUpdateReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdate; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformRemoteUpdateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformRemoteUpdateServiceImpl implements PlatformRemoteUpdateService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRemoteUpdate platformRemoteUpdate) { |
| | | mongoTemplate.save(platformRemoteUpdate); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRemoteUpdate findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRemoteUpdate.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdate> findAll() { |
| | | return mongoTemplate.findAll(PlatformRemoteUpdate.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdate> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformRemoteUpdate> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformRemoteUpdate.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformRemoteUpdate; |
| | | import com.ruoyi.integration.api.model.PlatformRestartReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformRestartReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformRestartReplyServiceImpl implements PlatformRestartReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformRestartReply platformRestartReply) { |
| | | mongoTemplate.save(platformRestartReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRestartReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRestartReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestartReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformRestartReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestartReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformRestartReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformRestartReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformRestart; |
| | | import com.ruoyi.integration.api.model.PlatformRestartReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformRestartService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformRestartServiceImpl implements PlatformRestartService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRestart platformRestart) { |
| | | mongoTemplate.save(platformRestart); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRestart findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRestart.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestart> findAll() { |
| | | return mongoTemplate.findAll(PlatformRestart.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestart> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformRestart> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformRestart.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformRestart; |
| | | import com.ruoyi.integration.api.model.PlatformStartChargingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformStartChargingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformStartChargingReplyServiceImpl implements PlatformStartChargingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformStartChargingReply platformStartChargingReply) { |
| | | mongoTemplate.save(platformStartChargingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStartChargingReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStartChargingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStartChargingReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformStartChargingReply.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据订单编号查询远程启机应答数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PlatformStartChargingReply> getPlatformStartChargingReply(String code) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("transaction_serial_number").is(code)); |
| | | List<PlatformStartChargingReply> platformStartChargingReplies = mongoTemplate.find(query, PlatformStartChargingReply.class); |
| | | return platformStartChargingReplies; |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStartChargingReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformStartChargingReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformStartChargingReply.class); |
| | | return list; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformStartCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStartChargingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformStartChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformStartChargingServiceImpl implements PlatformStartChargingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformStartCharging platformStartCharging) { |
| | | mongoTemplate.save(platformStartCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStartCharging findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStartCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStartCharging> findAll() { |
| | | return mongoTemplate.findAll(PlatformStartCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStartCharging> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformStartCharging> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformStartCharging.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformStartCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStopChargingReply; |
| | | import com.ruoyi.integration.api.vo.GetPlatformStopChargingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformStopChargingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformStopChargingReplyServiceImpl implements PlatformStopChargingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformStopChargingReply platformStopChargingReply) { |
| | | mongoTemplate.save(platformStopChargingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStopChargingReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStopChargingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopChargingReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformStopChargingReply.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据枪编号获取 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PlatformStopChargingReply getPlatformStopChargingReply(GetPlatformStopChargingReply query) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<PlatformStopChargingReply> platformStopChargingReplies = mongoTemplate.find(new Query().addCriteria(Criteria.where("charging_pile_code").is(query.getCharging_pile_code()) |
| | | .and("charging_gun_code").is(query.getCharging_gun_code()).and("create_time").lte(sdf.format(new Date())).gte(query.getEnd_time())), PlatformStopChargingReply.class); |
| | | return platformStopChargingReplies.size() > 0 ? platformStopChargingReplies.get(0) : null; |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopChargingReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformStopChargingReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformStopChargingReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStopChargingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PlatformStopChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class PlatformStopChargingServiceImpl implements PlatformStopChargingService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformStopCharging platformStopCharging) { |
| | | mongoTemplate.save(platformStopCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStopCharging findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStopCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopCharging> findAll() { |
| | | return mongoTemplate.findAll(PlatformStopCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopCharging> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<PlatformStopCharging> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , PlatformStopCharging.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.api.model.Pong; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.PongService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 心跳包应答实现类 |
| | | **/ |
| | | @Service |
| | | public class PongServiceImpl implements PongService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(Pong pong) { |
| | | mongoTemplate.save(pong); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public Pong findById(String id) { |
| | | return mongoTemplate.findById(id, Pong.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Pong> findAll() { |
| | | return mongoTemplate.findAll(Pong.class); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void delPong() { |
| | | mongoTemplate.remove(new Query().addCriteria(Criteria.where("create_time").lt(LocalDateTime.now().minusDays(1)))); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.api.model.QrCodeDeliveryReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.QrCodeDeliveryReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 心跳包应答实现类 |
| | | **/ |
| | | @Service |
| | | public class QrCodeDeliveryReplyServiceImpl implements QrCodeDeliveryReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(QrCodeDeliveryReply qrCodeDeliveryReply) { |
| | | mongoTemplate.save(qrCodeDeliveryReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QrCodeDeliveryReply findById(String id) { |
| | | return mongoTemplate.findById(id, QrCodeDeliveryReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QrCodeDeliveryReply> findAll() { |
| | | return mongoTemplate.findAll(QrCodeDeliveryReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QrCodeDeliveryReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<QrCodeDeliveryReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , QrCodeDeliveryReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.QrCodeDeliveryReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.QrCodeDeliveryService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 心跳包应答实现类 |
| | | **/ |
| | | @Service |
| | | public class QrCodeDeliveryServiceImpl implements QrCodeDeliveryService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(QrCodeDelivery qrCodeDelivery) { |
| | | mongoTemplate.save(qrCodeDelivery); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QrCodeDelivery findById(String id) { |
| | | return mongoTemplate.findById(id, QrCodeDelivery.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QrCodeDelivery> findAll() { |
| | | return mongoTemplate.findAll(QrCodeDelivery.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QrCodeDelivery> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<QrCodeDelivery> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , QrCodeDelivery.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.QueryOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class QueryOfflineCardReplyServiceImpl implements QueryOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(QueryOfflineCardReply queryOfflineCardReply) { |
| | | mongoTemplate.save(queryOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QueryOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, QueryOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(QueryOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCardReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<QueryOfflineCardReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , QueryOfflineCardReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCard; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.QueryOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class QueryOfflineCardServiceImpl implements QueryOfflineCardService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(QueryOfflineCard queryOfflineCard) { |
| | | mongoTemplate.save(queryOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QueryOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, QueryOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(QueryOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCard> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<QueryOfflineCard> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , QueryOfflineCard.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.QueryOfflineCard; |
| | | import com.ruoyi.integration.api.model.ReadRealTimeMonitoringData; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.ReadRealTimeMonitoringDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class ReadRealTimeMonitoringDataServiceImpl implements ReadRealTimeMonitoringDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ReadRealTimeMonitoringData readRealTimeMonitoringData) { |
| | | mongoTemplate.save(readRealTimeMonitoringData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ReadRealTimeMonitoringData findById(String id) { |
| | | return mongoTemplate.findById(id, ReadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ReadRealTimeMonitoringData> findAll() { |
| | | return mongoTemplate.findAll(ReadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ReadRealTimeMonitoringData> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<ReadRealTimeMonitoringData> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , ReadRealTimeMonitoringData.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.ReadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.SecurityDetection; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.SecurityDetectionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * 心跳包应答实现类 |
| | | **/ |
| | | @Service |
| | | public class SecurityDetectionServiceImpl implements SecurityDetectionService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(SecurityDetection securityDetection) { |
| | | mongoTemplate.save(securityDetection); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SecurityDetection findById(String id) { |
| | | return mongoTemplate.findById(id, SecurityDetection.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SecurityDetection> findAll() { |
| | | return mongoTemplate.findAll(SecurityDetection.class); |
| | | } |
| | | |
| | | /** |
| | | * 根据业务流水号查询数据 |
| | | * @param transactionSerialNumber |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SecurityDetection getSecurityDetection(String transactionSerialNumber) { |
| | | List<SecurityDetection> securityDetectionList = mongoTemplate.find(new Query().addCriteria(Criteria.where("transaction_serial_number") |
| | | .is(transactionSerialNumber)), SecurityDetection.class); |
| | | return securityDetectionList.size() > 0 ? securityDetectionList.get(0) : null; |
| | | } |
| | | |
| | | @Override |
| | | public List<SecurityDetection> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<SecurityDetection> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , SecurityDetection.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.SecurityDetection; |
| | | import com.ruoyi.integration.api.model.SetupBillingModelReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.SetupBillingModelReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class SetupBillingModelReplyServiceImpl implements SetupBillingModelReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SetupBillingModelReply setupBillingModelReply) { |
| | | mongoTemplate.save(setupBillingModelReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SetupBillingModelReply findById(String id) { |
| | | return mongoTemplate.findById(id, SetupBillingModelReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModelReply> findAll() { |
| | | return mongoTemplate.findAll(SetupBillingModelReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModelReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<SetupBillingModelReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , SetupBillingModelReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.SetupBillingModel; |
| | | import com.ruoyi.integration.api.model.SetupBillingModelReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.SetupBillingModelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class SetupBillingModelServiceImpl implements SetupBillingModelService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SetupBillingModel setupBillingModel) { |
| | | mongoTemplate.save(setupBillingModel); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SetupBillingModel findById(String id) { |
| | | return mongoTemplate.findById(id, SetupBillingModel.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModel> findAll() { |
| | | return mongoTemplate.findAll(SetupBillingModel.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModel> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<SetupBillingModel> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , SetupBillingModel.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.SetupBillingModel; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.SynchronizeOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class SynchronizeOfflineCardReplyServiceImpl implements SynchronizeOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SynchronizeOfflineCardReply synchronizeOfflineCardReply) { |
| | | mongoTemplate.save(synchronizeOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SynchronizeOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, SynchronizeOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(SynchronizeOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCardReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<SynchronizeOfflineCardReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , SynchronizeOfflineCardReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCard; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.SynchronizeOfflineCardService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class SynchronizeOfflineCardServiceImpl implements SynchronizeOfflineCardService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(SynchronizeOfflineCard synchronizeOfflineCard) { |
| | | mongoTemplate.save(synchronizeOfflineCard); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SynchronizeOfflineCard findById(String id) { |
| | | return mongoTemplate.findById(id, SynchronizeOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCard> findAll() { |
| | | return mongoTemplate.findAll(SynchronizeOfflineCard.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCard> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<SynchronizeOfflineCard> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , SynchronizeOfflineCard.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.SynchronizeOfflineCard; |
| | | import com.ruoyi.integration.api.model.TimingSettingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.TimingSettingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class TimingSettingReplyServiceImpl implements TimingSettingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(TimingSettingReply timingSettingReply) { |
| | | mongoTemplate.save(timingSettingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TimingSettingReply findById(String id) { |
| | | return mongoTemplate.findById(id, TimingSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSettingReply> findAll() { |
| | | return mongoTemplate.findAll(TimingSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSettingReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<TimingSettingReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , TimingSettingReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.TimingSetting; |
| | | import com.ruoyi.integration.api.model.TimingSettingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.TimingSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class TimingSettingServiceImpl implements TimingSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(TimingSetting timingSetting) { |
| | | mongoTemplate.save(timingSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TimingSetting findById(String id) { |
| | | return mongoTemplate.findById(id, TimingSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSetting> findAll() { |
| | | return mongoTemplate.findAll(TimingSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSetting> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<TimingSetting> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , TimingSetting.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.TimingSetting; |
| | | import com.ruoyi.integration.api.model.TransactionRecord; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.TransactionRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class TransactionRecordServiceImpl implements TransactionRecordService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(TransactionRecord transactionRecord) { |
| | | mongoTemplate.save(transactionRecord); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TransactionRecord findById(String id) { |
| | | return mongoTemplate.findById(id, TransactionRecord.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionRecord> findAll() { |
| | | return mongoTemplate.findAll(TransactionRecord.class); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单流水号查询数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TransactionRecord findOne(String code) { |
| | | Query query = new Query(); |
| | | if(StringUtils.isNotEmpty(code)){ |
| | | query.addCriteria(Criteria.where("transaction_serial_number").is(code)); |
| | | } |
| | | List<TransactionRecord> transactionRecords = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , TransactionRecord.class); |
| | | return transactionRecords.size() > 0 ? transactionRecords.get(0) : null; |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionRecord> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<TransactionRecord> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , TransactionRecord.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.TransactionRecord; |
| | | import com.ruoyi.integration.api.model.UpdateBalanceReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.UpdateBalanceReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class UpdateBalanceReplyServiceImpl implements UpdateBalanceReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(UpdateBalanceReply updateBalanceReply) { |
| | | mongoTemplate.save(updateBalanceReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UpdateBalanceReply findById(String id) { |
| | | return mongoTemplate.findById(id, UpdateBalanceReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalanceReply> findAll() { |
| | | return mongoTemplate.findAll(UpdateBalanceReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalanceReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<UpdateBalanceReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , UpdateBalanceReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.UpdateBalance; |
| | | import com.ruoyi.integration.api.model.UpdateBalanceReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.UpdateBalanceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class UpdateBalanceServiceImpl implements UpdateBalanceService { |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(UpdateBalance updateBalance) { |
| | | mongoTemplate.save(updateBalance); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UpdateBalance findById(String id) { |
| | | return mongoTemplate.findById(id, UpdateBalance.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalance> findAll() { |
| | | return mongoTemplate.findAll(UpdateBalance.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalance> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<UpdateBalance> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , UpdateBalance.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.UpdateBalance; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class UploadRealTimeMonitoringDataServiceImpl implements UploadRealTimeMonitoringDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(UploadRealTimeMonitoringData uploadRealTimeMonitoringData) { |
| | | mongoTemplate.save(uploadRealTimeMonitoringData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UploadRealTimeMonitoringData findById(String id) { |
| | | return mongoTemplate.findById(id, UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<UploadRealTimeMonitoringData> findAll() { |
| | | return mongoTemplate.findAll(UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据订单号查询监控数据 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UploadRealTimeMonitoringData> getDataByOrderCode(String code) { |
| | | Query query = new Query(); |
| | | if(StringUtils.isNotEmpty(code)){ |
| | | query.addCriteria(Criteria.where("transaction_serial_number").is(code)); |
| | | } |
| | | List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringData = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , UploadRealTimeMonitoringData.class); |
| | | return uploadRealTimeMonitoringData; |
| | | } |
| | | |
| | | @Override |
| | | public UploadRealTimeMonitoringPageData getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException { |
| | | Query query = new Query(); |
| | | // if (!values.isEmpty()){ |
| | | // query.addCriteria(Criteria.where("transaction_serial_number").in(values)); |
| | | // } |
| | | if (mongoChargingOrderQuery.getCode() != null && !mongoChargingOrderQuery.getCode().isEmpty()) { |
| | | query.addCriteria(Criteria.where("transaction_serial_number").regex(mongoChargingOrderQuery.getCode(),"i")); // "i" 表示不区分大小写 |
| | | } |
| | | if (mongoChargingOrderQuery.getOrderType() !=null){ |
| | | query.addCriteria(Criteria.where("orderType").is(mongoChargingOrderQuery.getOrderType())); |
| | | } |
| | | if (mongoChargingOrderQuery.getSiteId() != null){ |
| | | query.addCriteria(Criteria.where("siteId").is(mongoChargingOrderQuery.getSiteId())); |
| | | } |
| | | if (!mongoChargingOrderQuery.getSiteIds().isEmpty()){ |
| | | query.addCriteria(Criteria.where("siteId").in(mongoChargingOrderQuery.getSiteIds())); |
| | | } |
| | | if (mongoChargingOrderQuery.getChargingPileCode() != null && !mongoChargingOrderQuery.getChargingPileCode().isEmpty()) { |
| | | query.addCriteria(Criteria.where("charging_pile_code").is(mongoChargingOrderQuery.getChargingPileCode())); |
| | | } |
| | | if (mongoChargingOrderQuery.getChargingGunCode() != null && !mongoChargingOrderQuery.getChargingGunCode().isEmpty()){ |
| | | query.addCriteria(Criteria.where("charging_gun_code").is(mongoChargingOrderQuery.getChargingGunCode())); |
| | | } |
| | | if (mongoChargingOrderQuery.getStatus() != null){ |
| | | query.addCriteria(Criteria.where("status").is(mongoChargingOrderQuery.getStatus())); |
| | | } |
| | | |
| | | if (mongoChargingOrderQuery.getCreateTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getCreateTime().split(" - "); |
| | | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date start = dateFormat.parse(split[0]); |
| | | Date end = dateFormat.parse(split[1]); |
| | | query.addCriteria(Criteria.where("create_time").gte(start).lt(end)); |
| | | } |
| | | |
| | | if (mongoChargingOrderQuery.getLastTime() != null && mongoChargingOrderQuery.getLastTime() != null) { |
| | | String[] split = mongoChargingOrderQuery.getLastTime().split(" - "); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date start = dateFormat.parse(split[0]); |
| | | Date end = dateFormat.parse(split[1]); |
| | | query.addCriteria(Criteria.where("last_time").gte(start).lt(end)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | long totalElements = mongoTemplate.count(query, UploadRealTimeMonitoringData.class); |
| | | |
| | | // 创建带有排序的 Pageable 对象 |
| | | Pageable pageable = PageRequest.of( |
| | | mongoChargingOrderQuery.getPageCurr()-1, |
| | | mongoChargingOrderQuery.getPageSize(), |
| | | Sort.by(Sort.Direction.DESC, "create_time") |
| | | ); |
| | | |
| | | // 设置分页和排序 |
| | | query.with(pageable); |
| | | |
| | | // 执行查询并获取 Page 对象 |
| | | List<UploadRealTimeMonitoringData> page = mongoTemplate.find(query, UploadRealTimeMonitoringData.class,"upload_real_time_monitoring_data"); |
| | | |
| | | // 设置分页 |
| | | // Pageable pageable = PageRequest.of(mongoChargingOrderQuery.getPageSize()*(mongoChargingOrderQuery.getPageCurr()-1), mongoChargingOrderQuery.getPageSize()); |
| | | // query.with(pageable); |
| | | // query.with(Sort.by(Sort.Direction.DESC,"create_time")); |
| | | List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringData = mongoTemplate.find( |
| | | query |
| | | , UploadRealTimeMonitoringData.class); |
| | | |
| | | UploadRealTimeMonitoringPageData uploadRealTimeMonitoringPageData = new UploadRealTimeMonitoringPageData(); |
| | | uploadRealTimeMonitoringPageData.setCount(totalElements); |
| | | uploadRealTimeMonitoringPageData.setRecords(page); |
| | | return uploadRealTimeMonitoringPageData; |
| | | } |
| | | |
| | | @Override |
| | | public UploadRealTimeMonitoringData getLastDataById(String transaction_serial_number) { |
| | | Query query = new Query(); |
| | | if (StringUtils.isNotEmpty(transaction_serial_number)){ |
| | | query.addCriteria(Criteria.where("transaction_serial_number").is(transaction_serial_number)); |
| | | } |
| | | // 按照 createdAt 字段降序排序 |
| | | query.with(Sort.by(Sort.Direction.DESC, "create_time")); |
| | | // 限制结果只返回一条记录 |
| | | query.limit(1); |
| | | return mongoTemplate.findOne(query, UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | UploadRealTimeMonitoringData byId = findById(id.toString()); |
| | | mongoTemplate.remove(byId); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(String id) { |
| | | // 创建查询条件 |
| | | Query query = new Query(Criteria.where("_id").is(id)); |
| | | // 创建更新对象 |
| | | Update update = new Update().set("last_time", new Date()); |
| | | // 执行更新操作 |
| | | mongoTemplate.updateFirst(query, update, UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UploadRealTimeMonitoringData> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<UploadRealTimeMonitoringData> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , UploadRealTimeMonitoringData.class); |
| | | return list; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.WorkingParameterSettingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class WorkingParameterSettingReplyServiceImpl implements WorkingParameterSettingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(WorkingParameterSettingReply workingParameterSettingReply) { |
| | | mongoTemplate.save(workingParameterSettingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public WorkingParameterSettingReply findById(String id) { |
| | | return mongoTemplate.findById(id, WorkingParameterSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSettingReply> findAll() { |
| | | return mongoTemplate.findAll(WorkingParameterSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSettingReply> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<WorkingParameterSettingReply> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , WorkingParameterSettingReply.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.WorkingParameterSetting; |
| | | import com.ruoyi.integration.api.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.jianguan.constant.IotConstant; |
| | | import com.ruoyi.jianguan.mongodb.service.WorkingParameterSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | public class WorkingParameterSettingServiceImpl implements WorkingParameterSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(WorkingParameterSetting workingParameterSetting) { |
| | | mongoTemplate.save(workingParameterSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public WorkingParameterSetting findById(String id) { |
| | | return mongoTemplate.findById(id, WorkingParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSetting> findAll() { |
| | | return mongoTemplate.findAll(WorkingParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSetting> getRangeTimeData(Date startTime, Date endTime) { |
| | | Query query = new Query(); |
| | | // 根据时间范围查询 |
| | | if (Objects.nonNull(startTime) && Objects.nonNull(endTime)) { |
| | | query.addCriteria(Criteria.where("create_time").gte(startTime).lte(endTime)); |
| | | } |
| | | List<WorkingParameterSetting> list = mongoTemplate.find( |
| | | query.with(Sort.by(Sort.Order.desc("create_time"))) |
| | | , WorkingParameterSetting.class); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mqtt.callback; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.jianguan.mqtt.config.TopicConstants; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.eclipse.paho.client.mqttv3.*; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.UUID; |
| | | import java.util.concurrent.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 消费监听 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class PushCallback implements MqttCallback { |
| | | private static MqttConnectOptions options; |
| | | private static MqttClient client; |
| | | private static final double EARTH_RADIUS = 6378137.0; |
| | | |
| | | |
| | | @Override |
| | | public void connectionLost(Throwable throwable) { |
| | | if (client == null || !client.isConnected()) { |
| | | System.out.println("连接断开,正在重连...."); |
| | | int[] Qos = {0}; |
| | | String[] topic1 = {TopicConstants.CHARGE_PILE_CODE}; |
| | | try { |
| | | client.connect(options); |
| | | client.subscribe(topic1, Qos); |
| | | log.info("连接失败重连成功"); |
| | | } catch (MqttException e) { |
| | | log.info("连接失败重连失败"); |
| | | log.info("connectionLost e:{}", e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void messageArrived(String topic, MqttMessage message) throws Exception { |
| | | System.err.println("接收消息主题 : " + topic); |
| | | System.err.println("接收消息Qos : " + message.getQos()); |
| | | System.err.println("接收消息内容 : " + new String(message.getPayload())); |
| | | |
| | | String silentMessage = new String(message.getPayload()); |
| | | JSONObject jsonObject = JSONObject.parseObject(silentMessage); |
| | | String messageType = jsonObject.getString("type"); |
| | | if(StringUtils.isEmpty(messageType)){ |
| | | log.warn("接收消息类型为空"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mqtt.client; |
| | | |
| | | |
| | | import com.ruoyi.jianguan.mqtt.callback.PushCallback; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.eclipse.paho.client.mqttv3.IMqttToken; |
| | | import org.eclipse.paho.client.mqttv3.MqttClient; |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ClientMQTT { |
| | | private final static String HOST = "tcp://127.0.0.1:9882"; |
| | | private final static String USER_NAME = "admin"; |
| | | private final static String PASS_WORD = "mingxingdianli123"; |
| | | private static final String CLIENT_ID = String.valueOf(System.currentTimeMillis()); |
| | | private static final Integer TIME_OUT = 30000; |
| | | private static final Integer KEEP_ALIVE = 30000; |
| | | private MqttClient client; |
| | | private MqttConnectOptions options; |
| | | private void start() { |
| | | try { |
| | | // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | client = new MqttClient(HOST, CLIENT_ID, new MemoryPersistence()); |
| | | // MQTT的连接设置 |
| | | options = new MqttConnectOptions(); |
| | | // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接 |
| | | options.setCleanSession(false); |
| | | // 设置连接的用户名 |
| | | options.setUserName(USER_NAME); |
| | | // 设置连接的密码 |
| | | options.setPassword(PASS_WORD.toCharArray()); |
| | | // 设置超时时间 单位为秒 |
| | | options.setConnectionTimeout(TIME_OUT); |
| | | // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 |
| | | options.setKeepAliveInterval(KEEP_ALIVE); |
| | | // automaticReconnect 为 true 表示断线自动重连,但仅仅只是重新连接,并不订阅主题;在 connectComplete 回调函数重新订阅 |
| | | options.setAutomaticReconnect(true); |
| | | // 设置回调 |
| | | // 设置回调 |
| | | client.setCallback(new PushCallback()); |
| | | |
| | | IMqttToken iMqttToken = client.connectWithResult(options); |
| | | boolean complete = iMqttToken.isComplete(); |
| | | System.err.println("MQTT连接" + (complete ? "成功" : "失败")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 连接至mqtt服务器,获取mqtt连接 |
| | | * |
| | | * @return |
| | | */ |
| | | // @Bean |
| | | // public ClientMQTT getMqttPushClient() { |
| | | // //连接至mqtt服务器,获取mqtt连接 |
| | | // this.start(); |
| | | // return this; |
| | | // } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.mqtt.config; |
| | | |
| | | public class TopicConstants { |
| | | |
| | | /** |
| | | * topic 政务云上传数据 |
| | | */ |
| | | public static String CHARGE_PILE_CODE = "/devices/v1/MTM1OTkwNjEzMjc5NzE2MTQ3Mg==/CHARGE_PILE_CODE/sys/properties/report"; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.mqtt.util; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.jianguan.mqtt.callback.PushCallback; |
| | | import com.ruoyi.jianguan.mqtt.client.ClientMQTT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.eclipse.paho.client.mqttv3.*; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class MqttPushUtil { |
| | | |
| | | // private final static String HOST = "tcp://127.0.0.1:9882"; |
| | | // private final static String CLIENT_ID = "mqttx_3267186711111fdsasdsa"; |
| | | // private final static String USER_NAME = "admin"; |
| | | // private final static String PASS_WORD = "mingxingdianli123"; |
| | | private final static String HOST = "tcp://183.220.129.95:1883"; |
| | | private final static String CLIENT_ID = "mqttx_3267186711111mxcdszyun"; |
| | | private final static String USER_NAME = "mxEmqx"; |
| | | private final static String PASS_WORD = "admin"; |
| | | private final static Integer TIME_OUT = 30000; |
| | | private final static Integer KEEP_ALIVE = 60000; |
| | | private MqttClient mqttClient; |
| | | |
| | | /** |
| | | * 推送充电桩数据 |
| | | * @param topic |
| | | * @param message |
| | | * @return |
| | | */ |
| | | public R<String> pushChargePileData(String topic, String message){ |
| | | try { |
| | | //发布消息 |
| | | this.publish(topic,message); |
| | | return R.ok("["+topic+"]-推送成功;内容为:["+message+"]"); |
| | | } catch (MqttException e) { |
| | | return R.fail("推送失败:["+e.getMessage()+"]"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 测试订阅消息 |
| | | */ |
| | | // public static void main(String[] args) throws Exception { |
| | | // MqttPushUtil mqttConnect = new MqttPushUtil(); |
| | | // mqttConnect.start(); |
| | | // //订阅消息 |
| | | // mqttConnect.publish("/cmt/IoT/pub/8/6700/status/silent","message11消息"); |
| | | // } |
| | | |
| | | @Bean |
| | | public MqttPushUtil getMqttPushClient() { |
| | | //连接至mqtt服务器,获取mqtt连接 |
| | | this.start(); |
| | | return this; |
| | | } |
| | | /** |
| | | * 初始化mqtt链接 |
| | | * @throws MqttException |
| | | */ |
| | | public void start(){ |
| | | try { |
| | | // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | mqttClient = new MqttClient(HOST, CLIENT_ID + System.currentTimeMillis(), new MemoryPersistence()); |
| | | // MQTT的连接设置 |
| | | MqttConnectOptions options = new MqttConnectOptions(); |
| | | options.setUserName(USER_NAME); |
| | | options.setPassword(PASS_WORD.toCharArray()); |
| | | // 设置超时时间 单位为秒 |
| | | options.setConnectionTimeout(TIME_OUT);///默认:30 |
| | | // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,设置为true表示每次连接到服务器都以新的身份连接 |
| | | options.setCleanSession(false);//默认:true |
| | | // 设置断开后重新连接(设置为true时将启用自动重新连接) |
| | | options.setAutomaticReconnect(true);//默认:false |
| | | // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 |
| | | options.setKeepAliveInterval(KEEP_ALIVE);//默认:60 |
| | | // 设置回调 |
| | | mqttClient.setCallback(new PushCallback()); |
| | | mqttClient.connect(options); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 自定义mqtt连接 |
| | | * @param host |
| | | * @param clientId |
| | | * @param userName |
| | | * @param passWord |
| | | * @param connectionTimeout |
| | | * @param cleanSession |
| | | * @param automaticReconnect |
| | | * @param keepAliveInterval |
| | | * @param mqttCallback |
| | | * @throws MqttException |
| | | */ |
| | | public void start(String host,String clientId, String userName, String passWord, |
| | | int connectionTimeout, boolean cleanSession,boolean automaticReconnect, |
| | | int keepAliveInterval,MqttCallback mqttCallback) throws MqttException { |
| | | // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | mqttClient = new MqttClient(host, clientId + System.currentTimeMillis(), new MemoryPersistence()); |
| | | // MQTT的连接设置 |
| | | MqttConnectOptions options = new MqttConnectOptions(); |
| | | options.setUserName(userName); |
| | | options.setPassword(passWord.toCharArray()); |
| | | // 设置超时时间 单位为秒 |
| | | options.setConnectionTimeout(connectionTimeout);///默认:30 |
| | | // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,设置为true表示每次连接到服务器都以新的身份连接 |
| | | options.setCleanSession(cleanSession);//默认:true |
| | | // 设置断开后重新连接(设置为true时将启用自动重新连接) |
| | | options.setAutomaticReconnect(automaticReconnect);//默认:false |
| | | // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 |
| | | options.setKeepAliveInterval(keepAliveInterval);//默认:60 |
| | | // 设置回调 |
| | | mqttClient.setCallback(mqttCallback); |
| | | mqttClient.connect(options); |
| | | } |
| | | |
| | | /** |
| | | * 发布,默认qos为0,非持久化 |
| | | */ |
| | | public void publish(String topic, String message1) throws MqttException { |
| | | publish(0, false, topic, message1); |
| | | } |
| | | |
| | | /** |
| | | * 发布 |
| | | */ |
| | | public void publish(int qos, boolean retained, String topic, String message1) throws MqttException { |
| | | MqttMessage message = new MqttMessage(); |
| | | message.setQos(qos); |
| | | message.setRetained(retained); |
| | | message.setPayload(message1.getBytes()); |
| | | MqttTopic mTopic = mqttClient.getTopic(topic); |
| | | if (null == mTopic) { |
| | | System.err.println("topic not exist"); |
| | | log.error("topic not exist"); |
| | | } |
| | | MqttDeliveryToken token; |
| | | token = mTopic.publish(message); |
| | | token.waitForCompletion(); |
| | | } |
| | | |
| | | /** |
| | | * 订阅某个主题,qos默认为0 |
| | | */ |
| | | public void subscribe(String topic) { |
| | | subscribe(topic, 0); |
| | | } |
| | | |
| | | /** |
| | | * 订阅某个主题 |
| | | */ |
| | | public void subscribe(String topic, int qos) { |
| | | try { |
| | | mqttClient.subscribe(topic, qos); |
| | | } catch (MqttException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.pool; |
| | | |
| | | import io.netty.util.concurrent.DefaultThreadFactory; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.concurrent.*; |
| | | |
| | | /** |
| | | * 线程池使用示例及实践 |
| | | * execute:适用于无返回值的任务执行,如果需要返回值需要自己传入FutureTask,在子线程中抛出异常,在主线程捕捉不到 |
| | | * submit:适用于有返回值的任务执行,不会直接抛出异常,会将异常捕获到FutureTask中,需要通过future.get()获取 |
| | | * |
| | | * @author Devil |
| | | * @version 1.0 |
| | | * @date 2025/4/12 21:42 |
| | | */ |
| | | @Slf4j |
| | | public class ThreadPoolDemo { |
| | | |
| | | /** |
| | | * 创建并演示使用单个线程的线程池 |
| | | * 特点: |
| | | * 1. 保证所有任务顺序执行 |
| | | * 2. 使用无界队列(LinkedBlockingQueue),需注意可能的内存溢出问题 |
| | | * 3. 适用于需要保证任务顺序执行的场景 |
| | | */ |
| | | @SneakyThrows |
| | | public static void createSingleThreadPool() { |
| | | // 创建单线程线程池(实际开发建议使用自定义ThreadPoolExecutor) |
| | | ExecutorService executorService = Executors.newSingleThreadExecutor(); |
| | | |
| | | try { |
| | | log.info("\n================ 普通任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | executorService.execute(() -> log.info("线程:{},办理业务", Thread.currentThread().getName())); |
| | | } |
| | | |
| | | TimeUnit.MILLISECONDS.sleep(2); |
| | | |
| | | log.info("\n================ 带返回值的任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | Future<String> future = executorService.submit(() -> { |
| | | log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | return "业务办理完成"; |
| | | }); |
| | | log.info(future.get()); |
| | | } |
| | | } finally { |
| | | // 优雅关闭线程池 |
| | | gracefulShutdown(executorService); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建固定大小的线程池 |
| | | * 特点: |
| | | * 1. 固定核心线程数(=最大线程数) |
| | | * 2. 使用无界队列(LinkedBlockingQueue),需注意系统资源消耗 |
| | | * 3. 适用于已知并发需求的稳定负载场景 |
| | | */ |
| | | @SneakyThrows |
| | | public static void createFixedThreadPool() { |
| | | // 创建固定大小线程池(建议根据CPU核心数设置) |
| | | ExecutorService executorService = Executors.newFixedThreadPool(5); |
| | | |
| | | try { |
| | | log.info("\n================ 普通任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | executorService.execute(() -> log.info("线程:{},办理业务", Thread.currentThread().getName())); |
| | | } |
| | | |
| | | TimeUnit.MILLISECONDS.sleep(1); |
| | | |
| | | log.info("\n================ 带返回值的任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | Future<String> future = executorService.submit(() -> { |
| | | log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | return "业务办理完成"; |
| | | }); |
| | | log.info(future.get()); |
| | | } |
| | | } finally { |
| | | gracefulShutdown(executorService); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建可缓存线程池 |
| | | * 特点: |
| | | * 1. 自动回收空闲线程(60秒) |
| | | * 2. 理论上可以创建Integer.MAX_VALUE个线程,需注意线程爆炸问题 |
| | | * 3. 适用于短期异步任务或低负载场景 |
| | | */ |
| | | @SneakyThrows |
| | | public static void createCachedThreadPool() { |
| | | // 创建弹性线程池(慎用,可能产生大量线程) |
| | | ExecutorService executorService = Executors.newCachedThreadPool(); |
| | | |
| | | try { |
| | | log.info("\n================ 普通任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | executorService.execute(() -> log.info("线程:{},办理业务", Thread.currentThread().getName())); |
| | | } |
| | | |
| | | TimeUnit.MILLISECONDS.sleep(1); |
| | | |
| | | log.info("\n================ 带返回值的任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | Future<String> future = executorService.submit(() -> { |
| | | log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | return "业务办理完成"; |
| | | }); |
| | | log.info(future.get()); |
| | | } |
| | | } finally { |
| | | gracefulShutdown(executorService); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建定时任务线程池 |
| | | * 特点: |
| | | * 1. 支持定时及周期性任务 |
| | | * 2. 核心线程数固定,但可以不断创建新线程执行后续任务 |
| | | * 3. 适用于需要定时执行或周期性执行的场景 |
| | | */ |
| | | @SneakyThrows |
| | | public static void createScheduledThreadPool() { |
| | | // 创建定时任务线程池 |
| | | ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5); |
| | | |
| | | try { |
| | | log.info("\n================ 延迟任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | scheduledExecutorService.schedule(() -> |
| | | log.info("线程:{},办理延迟业务", Thread.currentThread().getName()), |
| | | 1, TimeUnit.SECONDS); |
| | | } |
| | | |
| | | TimeUnit.SECONDS.sleep(2); |
| | | |
| | | log.info("\n================ 带返回值的延迟任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | ScheduledFuture<String> future = scheduledExecutorService.schedule(() -> { |
| | | log.info("线程:{},办理延迟业务", Thread.currentThread().getName()); |
| | | return "延迟业务办理完成"; |
| | | }, 1, TimeUnit.SECONDS); |
| | | log.info(future.get()); |
| | | } |
| | | } finally { |
| | | gracefulShutdown(scheduledExecutorService); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建自定义线程池 |
| | | * 特点: |
| | | * 1. 支持定时及周期性任务 |
| | | * 2. 核心线程数固定,但可以不断创建新线程执行后续任务 |
| | | * 3. 适用于需要定时执行或周期性执行的场景 |
| | | */ |
| | | @SneakyThrows |
| | | public static void createCustomThreadPool() { |
| | | /* |
| | | 创建自定义线程池 |
| | | 字段: |
| | | 1. corePoolSize:核心线程池数量 |
| | | 2. maximumPoolSize: 最大线程池数量 |
| | | 3. keepAliveTime: 线程空闲时间 |
| | | 4. unit: 时间单位 |
| | | 5. workQueue: 阻塞队列 |
| | | 5. threadFactory: 线程工厂 |
| | | 5. handler: 拒绝策略 |
| | | */ |
| | | ThreadPoolExecutor customthreadPoolExecutor = new ThreadPoolExecutor( |
| | | 5, // 根据CPU核心数设置 |
| | | 10, // 最大应急线程数 |
| | | 30, TimeUnit.SECONDS, // 空闲线程存活时间 |
| | | new ArrayBlockingQueue<>(100), // 有界队列防止内存溢出 |
| | | new DefaultThreadFactory("custom-thread-pool"), // 自定义线程命名 |
| | | new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略 |
| | | ); |
| | | |
| | | try { |
| | | log.info("\n================ 普通任务执行 ================"); |
| | | for (int i = 0; i < 20; i++) { |
| | | customthreadPoolExecutor.execute(() -> log.info("线程:{},办理业务", Thread.currentThread().getName())); |
| | | } |
| | | |
| | | TimeUnit.MILLISECONDS.sleep(1); |
| | | |
| | | log.info("\n================ 带返回值的任务执行 ================"); |
| | | for (int i = 0; i < 10; i++) { |
| | | Future<String> future = customthreadPoolExecutor.submit(() -> { |
| | | log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | return "业务办理完成"; |
| | | }); |
| | | log.info(future.get()); |
| | | } |
| | | } finally { |
| | | gracefulShutdown(customthreadPoolExecutor); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 优雅关闭线程池通用方法 |
| | | * |
| | | * @param pool 需要关闭的线程池 |
| | | */ |
| | | private static void gracefulShutdown(ExecutorService pool) { |
| | | pool.shutdown(); // 拒绝新任务提交 |
| | | try { |
| | | // 等待现有任务完成 |
| | | if (!pool.awaitTermination(60, TimeUnit.SECONDS)) { |
| | | pool.shutdownNow(); // 取消等待中的任务 只等待运行中的任务 |
| | | // 再次等待任务响应中断 |
| | | if (!pool.awaitTermination(60, TimeUnit.SECONDS)) { |
| | | log.error("线程池未完全关闭"); |
| | | } |
| | | } |
| | | } catch (InterruptedException e) { |
| | | // 重新尝试关闭 |
| | | pool.shutdownNow(); |
| | | Thread.currentThread().interrupt(); |
| | | } finally { |
| | | log.info("线程池是否执行完成:{}", pool.isTerminated()); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // 测试不同线程池(选择其中一个执行) |
| | | // createSingleThreadPool(); |
| | | // createFixedThreadPool(); |
| | | // createCachedThreadPool(); |
| | | // createScheduledThreadPool(); |
| | | createCustomThreadPool(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class AcquisitionBillingModeMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 计费模型验证请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BillingModeVerifyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | private String billing_model_code;// "计费模型编号,首次连接到平台时置零 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电阶段BMS中止 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsAbortMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer bms_stop_charging_reason; // BMS 中止充电原因(1-2 位——所需求的 SOC 目标值,3-4 位——达到总电压的设定值,5-6 位——达到单体电压设定值,7-8 位——充电机主动中止) |
| | | private Integer bms_aborted_charging_fault_cause; // BMS 中止充电故障原因(1-2 位——绝缘故障,3-4 位——输出连接器过温故障,5-6 位——BMS 元件、输出连接器过温,7-8 位——充电连接器故障,9-10 位——电池组温度过高故障,11-12 位——高压继电器故障,13 位-14 位——检测点 2 电压检测故障,15-16 位——其他故障) |
| | | private Integer bms_aborted_charging_error_cause; // BMS 中止充电错误原因(1-2 位——电流过大,3-4 位——电压异常,5-8 位——预留位) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充电过程BMS需求、充电机输出 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsDemandAndChargerExportationMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private BigDecimal bms_voltage_requirements; // BMS 电压需求 |
| | | private BigDecimal bms_current_requirements; // BMS 电流需求 |
| | | private Integer bms_charging_mode; // BMS 充电模式(1:恒压充电;2:恒流充电) |
| | | private BigDecimal bms_voltage_measurement_value; // BMS 充电电压测量值 |
| | | private BigDecimal bms_current_measurement_value; // BMS 充电电流测量值 |
| | | private BigDecimal bms_battery_voltage; // 最高电压 BMS 最高单体动力蓄电池电压及组号(1-12 位:最高单体动力蓄电池电压,数据分辨率:0.01 V/位,0 V 偏移量;数据范围:0~24 V;13-16 位:最高单体动力蓄电池电压所在组号,数据分辨率:1/位,0 偏移量;数据范围:0~15) |
| | | private Integer bms_group_number; // 所在组号 BMS 最高单体动力蓄电池电压及组号(1-12 位:最高单体动力蓄电池电压,数据分辨率:0.01 V/位,0 V 偏移量;数据范围:0~24 V;13-16 位:最高单体动力蓄电池电压所在组号,数据分辨率:1/位,0 偏移量;数据范围:0~15) |
| | | private BigDecimal bms_charged_status; // BMS 当前荷电状态 SOC( %) |
| | | private BigDecimal bms_remaining_charging_time; // BMS 估算剩余充电时间 |
| | | private BigDecimal voltage_output_value; // 电桩电压输出值 |
| | | private BigDecimal current_output_value; // 电桩电流输出值 |
| | | private BigDecimal cumulative_charging_time; // 累计充电时间 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电过程BMS信息 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsInformationMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer bms_highest_voltage_number; // BMS 最高单体动力蓄电池电压所在编号 |
| | | private String bms_maximum_battery_temperature; // BMS 最高动力蓄电池温度 |
| | | private String maximum_temperature_detection_point_number; // 最高温度检测点编号 |
| | | private String minimum_cell_temperature; // 最低动力蓄电池温度 |
| | | private String lowest_temperature_detection_pointt_number; // 最低动力蓄电池温度检测点编号 |
| | | private Integer bms_battery_voltage; // BMS 单体动力蓄电池电压过高 /过低(0:正常,1:过高,10:过低) |
| | | private Integer bms_battery_charging_status; // BMS 整车动力蓄电池荷电状态SOC 过高/过低(0:正常,1:过高,10:过低) |
| | | private Integer bms_charging_overcurrent; // BMS 动力蓄电池充电过电流(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_high_battery_temperature; // BMS 动力蓄电池温度过高(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_battery_insulation_status; // BMS 动力蓄电池绝缘状态(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_output_connector_connection_status; // BMS 动力蓄电池组输出连接器连接状态(0:正常,1:过流,10:不可信状态) |
| | | private Integer charge_prohibition; // 充电禁止(0:禁止,1:允许) |
| | | private Integer reserve; // 预留位 |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充电握手 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingHandshakeMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number;// 交易流水号 |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private String bms_protocol_version;// BMS 通信协议版本号 |
| | | private Integer bms_battery_type;// BMS 电池类型(1:铅酸电池;2:氢:电池;3:磷酸铁锂电池;4:锰酸锂电池;5:钴酸锂电池;6:三元材料电池;7:聚合物锂离子电池;8:钛酸锂电池;FFH:其他) |
| | | private BigDecimal bms_battery_capacity;// BMS 整车动力蓄电池系统额定容量 |
| | | private BigDecimal bms_total_battery_voltage;// BMS 整车动力蓄电池系统额定总电压 |
| | | private String bms_battery_manufacturer;// BMS 电池生产厂商名称 |
| | | private String bms_battery_serial_number;// BMS 电池组序号 |
| | | private Integer bms_battery_production_year;// BMS 电池组生产日期年 |
| | | private Integer bms_battery_production_month;// BMS 电池组生产日期月 |
| | | private Integer bms_battery_production_day;// BMS 电池组生产日期日 |
| | | private Integer bms_battery_charging_times;// BMS 电池组充电次数 |
| | | private Integer bms_battery_property_rights;// BMS 电池组产权标识 |
| | | private Integer reserved;// 预留位 |
| | | private String vim;// BMS 车辆识别码 |
| | | private Integer bms_software_version;// BMS 软件版本号 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ChargingMessage extends BaseMessage { |
| | | // 充电设备状态message |
| | | private GunStatusMessage gunStatusMessage; |
| | | // 推送充电订单状态/充电订单信息message |
| | | private ChargingOrderMessage orderMessage; |
| | | private AcquisitionBillingModeMessage acquisitionBillingModeMessage; |
| | | private BillingModeVerifyMessage billingModeVerifyMessage; |
| | | private BmsAbortMessage bmsAbortMessage; |
| | | private BmsDemandAndChargerExportationMessage bmsDemandAndChargerExportationMessage; |
| | | private BmsInformationMessage bmsInformationMessage; |
| | | private ChargingHandshakeMessage chargingHandshakeMessage; |
| | | private ChargingMessage chargingMessage; |
| | | private ChargingPileReturnsGroundLockDataMessage chargingPileReturnsGroundLockDataMessage; |
| | | private ChargingPileStartsChargingMessage chargingPileStartsChargingMessage; |
| | | private ClearOfflineCardReplyMessage clearOfflineCardReplyMessage; |
| | | private EndChargeMessage endChargeMessage; |
| | | private ErrorMessageMessage errorMessageMessage; |
| | | private GroundLockRealTimeDataMessage groundLockRealTimeDataMessage; |
| | | private MotorAbortMessage motorAbortMessage; |
| | | private OnlineMessage onlineMessage; |
| | | private ParameterSettingMessage parameterSettingMessage; |
| | | private PingMessage pingMessage; |
| | | private PlatformRemoteUpdateReplyMessage platformRemoteUpdateReplyMessage; |
| | | private PlatformRestartReplyMessage platformRestartReplyMessage; |
| | | private PlatformStartChargingReplyMessage platformStartChargingReplyMessage; |
| | | private PlatformStopChargingReplyMessage platformStopChargingReplyMessage; |
| | | private QrCodeDeliveryMessage qrCodeDeliveryMessage; |
| | | private QrCodeDeliveryReplyMessage qrCodeDeliveryReplyMessage; |
| | | private QueryOfflineCardReplyMessage queryOfflineCardReplyMessage; |
| | | private SecurityDetectionMessage securityDetectionMessage; |
| | | private SetupBillingModelReplyMessage setupBillingModelReplyMessage; |
| | | private SynchronizeOfflineCardReplyMessage synchronizeOfflineCardReplyMessage; |
| | | private TimingSettingMessage timingSettingMessage; |
| | | private TimingSettingReplyMessage timingSettingReplyMessage; |
| | | private TransactionRecordMessage transactionRecordMessage; |
| | | private UpdateBalanceReplyMessage updateBalanceReplyMessage; |
| | | private UploadRealTimeMonitoringDataMessage uploadRealTimeMonitoringDataMessage; |
| | | private WorkingParameterSettingReplyMessage workingParameterSettingReplyMessage; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingOrderMessage extends BaseMessage { |
| | | |
| | | private String orderNumber;// 订单编号 |
| | | private String soc;// soc |
| | | |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩返回数据(上行) |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingPileReturnsGroundLockDataMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer control_state; // 地锁控制返回标志(1:鉴权成功,0:鉴权失败) |
| | | private String reserve; // 预留位 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩主动申请启动充电 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingPileStartsChargingMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer start_method; // 启动方式(1:表示通过刷卡启动充电,2:表示通过帐号启动充电(暂不支持),3:表示vin码启动充电) |
| | | private Integer need_password; // 是否需要密码(0:不需要,1:需要) |
| | | private String account; // 账号或者物理卡号 |
| | | private String password; // 输入密码 |
| | | private String vin; // "VIN 码,启动方式为vin码启动充电时上送,其他方式置零( ASCII码),VIN码需要反序上送 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 离线卡数据清除应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ClearOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card1; // 第 1 个卡物理卡号,离线卡物理卡号 |
| | | private String physical_card2; |
| | | private String physical_card3; |
| | | private String physical_card4; |
| | | private String physical_card5; |
| | | private String physical_card6; |
| | | private String physical_card7; |
| | | private String physical_card8; |
| | | private String physical_card9; |
| | | private String physical_card10; |
| | | private String physical_card11; |
| | | private String physical_card12; |
| | | private String physical_card13; |
| | | private String physical_card14; |
| | | private String physical_card15; |
| | | private String physical_card16; |
| | | private String physical_card17; |
| | | private String physical_card18; |
| | | private String physical_card19; |
| | | private String physical_card20; |
| | | private String physical_card21; |
| | | private String physical_card22; |
| | | private String physical_card23; |
| | | private String physical_card24; |
| | | private Integer clear_result1; // 清除标记(0:清除失败,1:清除成功) |
| | | private Integer clear_result2; |
| | | private Integer clear_result3; |
| | | private Integer clear_result4; |
| | | private Integer clear_result5; |
| | | private Integer clear_result6; |
| | | private Integer clear_result7; |
| | | private Integer clear_result8; |
| | | private Integer clear_result9; |
| | | private Integer clear_result10; |
| | | private Integer clear_result11; |
| | | private Integer clear_result12; |
| | | private Integer clear_result13; |
| | | private Integer clear_result14; |
| | | private Integer clear_result15; |
| | | private Integer clear_result16; |
| | | private Integer clear_result17; |
| | | private Integer clear_result18; |
| | | private Integer clear_result19; |
| | | private Integer clear_result20; |
| | | private Integer clear_result21; |
| | | private Integer clear_result22; |
| | | private Integer clear_result23; |
| | | private Integer clear_result24; |
| | | private Integer failure_cause1; // 失败原因(1:卡号格式错误,2:清除成功) |
| | | private Integer failure_cause2; |
| | | private Integer failure_cause3; |
| | | private Integer failure_cause4; |
| | | private Integer failure_cause5; |
| | | private Integer failure_cause6; |
| | | private Integer failure_cause7; |
| | | private Integer failure_cause8; |
| | | private Integer failure_cause9; |
| | | private Integer failure_cause10; |
| | | private Integer failure_cause11; |
| | | private Integer failure_cause12; |
| | | private Integer failure_cause13; |
| | | private Integer failure_cause14; |
| | | private Integer failure_cause15; |
| | | private Integer failure_cause16; |
| | | private Integer failure_cause17; |
| | | private Integer failure_cause18; |
| | | private Integer failure_cause19; |
| | | private Integer failure_cause20; |
| | | private Integer failure_cause21; |
| | | private Integer failure_cause22; |
| | | private Integer failure_cause23; |
| | | private Integer failure_cause24; |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充电结束 |
| | | **/ |
| | | |
| | | @Data |
| | | public class EndChargeMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private BigDecimal bms_battery_charging_status; // BMS 中止荷电状态 SOC |
| | | private BigDecimal bms_minimum_battery_voltage; // BMS 动力蓄电池单体最低电压 |
| | | private BigDecimal bms_maximum_battery_voltage; // BMS 动力蓄电池单体最高电压 |
| | | private BigDecimal bms_minimum_battery_temperature; // BMS 动力蓄电池最低温度 |
| | | private BigDecimal bms_maximum_battery_temperature; // BMS 动力蓄电池最高温度 |
| | | private BigDecimal cumulative_charging_time; // 电桩累计充电时间 |
| | | private BigDecimal output_energy; // 电桩输出能量 |
| | | private String charger_code; // 电桩充电机编号 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 错误报文 |
| | | */ |
| | | @Data |
| | | public class ErrorMessageMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer charger_identification_0; // 接收 SPN2560=0x00 的充电机辨识报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer charger_identification_170; // 接收 SPN2560=0xAA 的充电机辨识报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String charger_identification_reserve; // 预留位 |
| | | private Integer time_synchronization_and_maximum_output_charger; // 接收充电机的时间同步和充电机最大输出能力报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer charge_preparation; // 接收充电机完成充电准备报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String charge_preparation_reserve; // 预留位 |
| | | private Integer charging_status; // 接收充电机充电状态报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer stop_charging; // 接收充电机中止充电报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String charge_reserve; // 预留位 |
| | | private Integer charging_statistics; // 接收充电机充电统计报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String bms_other; // BMS 其他 |
| | | private Integer bms_and_vehicle_identification; // 接收 BMS 和车辆的辨识报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String bms_and_vehicle_identification_reserve; // 预留位 |
| | | private Integer battery_charging_parameter; // 接收电池充电参数报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer bms_completes_charging_preparation; // 接收 BMS 完成充电准备报文超时(0=正常,1=超时,10=不可信状态) |
| | | private String bms_completes_charging_preparation_reserve; // 预留位 |
| | | private Integer total_battery_charging_status; // 接收电池充电总状态报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer battery_charging_requirements; // 接收电池充电要求报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer bms_stop_charging; // 接收 BMS 中止充电报文超时(0=正常,1=超时,10=不可信状态) |
| | | private Integer bms_reserve; // 预留位 |
| | | private Integer bms_charging_statistics; // 接收 BMS 充电统计报文超时0=正常,1=超时,10=不可信状态) |
| | | private String charger_other; // 充电机其他 |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 地锁数据上送(充电桩上送) |
| | | **/ |
| | | |
| | | @Data |
| | | public class GroundLockRealTimeDataMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer parking_lock_status; // 车位锁状态(0:未到位状态,1:升锁到位状态,2:降锁到位状态) |
| | | private Integer parking_status; // 车位状态(0:无车辆,1:停放车辆) |
| | | private Integer ground_locking_capacity; // 地锁电量状态 |
| | | private Integer alarm_status; // 报警状态(0:正常无报警,1:待机状态摇臂破坏,2:摇臂升降异常(未到位)) |
| | | private String reserve; // 预留位 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class GunStatusMessage extends BaseMessage { |
| | | |
| | | private String fullNumber;// 枪完整编码 |
| | | |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电阶段充电机中止 |
| | | **/ |
| | | |
| | | @Data |
| | | public class MotorAbortMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer charger_stops_charging_reason; // 充电机中止充电原因(1-2 位——达到充电机设定的条件中止,3-4 位——人工中止,5-6 位——异常中止) |
| | | private Integer charging_failure_cause; // 充电机中止充电故障原因(1-2 位——充电机过温故障,3-4 位——充电连接器故障,5-6 位——充电机内部过温故障,7-8 位——所需电量不能传送,9-10 位——充电机急停故障,11-12 位——其他故障,13-16 位——预留位) |
| | | private Integer charging_machine_stopped_charging_error_cause; // 充电机中止充电错误原因(1-2 位——电流不匹配,3-4 位——电压异常,5-8 位——预留位) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩登录认证 |
| | | **/ |
| | | |
| | | @Data |
| | | public class OnlineMessage extends BaseMessage { |
| | | private String charging_pile_code;// 充电桩编号 |
| | | private Integer charging_pile_type;// 充电桩类型(0 表示直流桩,1 表示交流桩) |
| | | private Integer charging_gun_number;// 充电枪数量 |
| | | private String protocol_version;// 通信协议版本 |
| | | private String program_version;// 程序版本 |
| | | private Integer network_link_type;// 网络链接类型(0:SIM 卡,1:LAN,2:WAN,3:其他) |
| | | private String sim;// Sim 卡 |
| | | private Integer operator;// 运营商(0: 移动,2:电信,3:联通,4:其他) |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 参数配置 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ParameterSettingMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private BigDecimal bms_maximum_charging_voltage; // BMS 单体动力蓄电池最高允许充电电压 |
| | | private BigDecimal bms_maximum_charging_current; // BMS 最高允许充电电流 |
| | | private BigDecimal bms_battery_total_energy; // BMS 动力蓄电池标称总能量 |
| | | private BigDecimal bms_total_charging_voltage; // BMS 最高允许充电总电压 |
| | | private BigDecimal bms_maximum_temperature; // BMS 最高允许温度 |
| | | private BigDecimal bms_battery_charging_status; // BMS 整车动力蓄电池荷电状态 (soc) |
| | | private BigDecimal bms_battery_voltage; // BMS 整车动力蓄电池当前电池 电压 |
| | | private BigDecimal maximum_output_voltage; // 电桩最高输出电压 |
| | | private BigDecimal minimum_output_voltage; // 电桩最低输出电压 |
| | | private BigDecimal maximum_output_current; // 电桩最大输出电流 |
| | | private BigDecimal minimum_output_current; // 电桩最小输出电流 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩心跳包 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PingMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private Integer charging_gun_status;// 抢状态(0:正常,1:故障) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 远程更新应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformRemoteUpdateReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer escalation_state; // 升级状态(0:成功,1:编码错误,2:程序与桩型号不符,3:下载更新文件超时) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 远程重启应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformRestartReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer set_result; // 设置结果(0:失败,1:成功) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 远程启机命令回复 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformStartChargingReplyMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer startup_result; // 启动结果(0:失败,1:成功) |
| | | private Integer failure_cause; // "失败原因(0:无,1:设备编号不匹配,2:枪已在充电,3:设备故障,4:设备离线,5:未插枪桩在收到启充命令后,检测到未插枪则发送 0x33 报文回复充电失败。若在 60 秒(以收到 0x34 时间开始计算)内检测到枪重新连接,则补送 0x33 成功报文;超时或者离线等其他异常,桩不启充、不补发 0x33 报文)" |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 远程停机命令回复 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformStopChargingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer stop_result; // 停止结果(0:失败,1:成功) |
| | | private Integer failure_cause; // 失败原因(0:无,1:设备编号不匹配,2:枪未处于充电状态,3:其他) |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | **/ |
| | | |
| | | @Data |
| | | public class QrCodeDeliveryMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 枪编码 |
| | | private Integer code_format; // "0:第一种前缀+桩编号 1:第二种前缀+桩编号+枪编号" |
| | | private Integer prefix_length; // 二维码前缀长度长度最大不超过200 字节 |
| | | private String code_prefix; // 如:“www.baidu.com?No=” |
| | | private String qr_code; // 二维码内容,如:“www.baidu.com?No=3422000100023301” |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | **/ |
| | | |
| | | @Data |
| | | public class QrCodeDeliveryReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private Integer delivery_result; // 设置结果(0:成功,1:失败) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 离线卡数据查询应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class QueryOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card1; // 第 1 个卡物理卡号,离线卡物理卡号 |
| | | private String physical_card2; |
| | | private String physical_card3; |
| | | private String physical_card4; |
| | | private String physical_card5; |
| | | private String physical_card6; |
| | | private String physical_card7; |
| | | private String physical_card8; |
| | | private String physical_card9; |
| | | private String physical_card10; |
| | | private String physical_card11; |
| | | private String physical_card12; |
| | | private String physical_card13; |
| | | private String physical_card14; |
| | | private String physical_card15; |
| | | private String physical_card16; |
| | | private String physical_card17; |
| | | private String physical_card18; |
| | | private String physical_card19; |
| | | private String physical_card20; |
| | | private String physical_card21; |
| | | private String physical_card22; |
| | | private String physical_card23; |
| | | private String physical_card24; |
| | | private Integer query_result1; // 查询结果(0:不存在,1:存在) |
| | | private Integer query_result2; |
| | | private Integer query_result3; |
| | | private Integer query_result4; |
| | | private Integer query_result5; |
| | | private Integer query_result6; |
| | | private Integer query_result7; |
| | | private Integer query_result8; |
| | | private Integer query_result9; |
| | | private Integer query_result10; |
| | | private Integer query_result11; |
| | | private Integer query_result12; |
| | | private Integer query_result13; |
| | | private Integer query_result14; |
| | | private Integer query_result15; |
| | | private Integer query_result16; |
| | | private Integer query_result17; |
| | | private Integer query_result18; |
| | | private Integer query_result19; |
| | | private Integer query_result20; |
| | | private Integer query_result21; |
| | | private Integer query_result22; |
| | | private Integer query_result23; |
| | | private Integer query_result24; |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | **/ |
| | | |
| | | @Data |
| | | public class SecurityDetectionMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer secure_connection; // 车枪连接(0=未连接,1=连接) |
| | | private Integer nsulation_detection; // 绝缘检测(0=安全,1=不安全) |
| | | private Integer electronic_lock_lock; // 电磁锁状态(0=未锁,1=已锁) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 计费模型应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class SetupBillingModelReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String set_result; //设置结果(0:失败,1:成功) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 卡数据同步应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class SynchronizeOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer save_result; // 保存结果(0:失败,1:成功) |
| | | private Integer failure_cause; // 失败原因(1:卡号格式错误,2:储存空间不足) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 对时设置 |
| | | **/ |
| | | |
| | | @Data |
| | | public class TimingSettingMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String current_time; //当前时间 |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 对时设置应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class TimingSettingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String current_time; //当前时间 |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 交易记录 |
| | | **/ |
| | | |
| | | @Data |
| | | public class TransactionRecordMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number;// 交易流水号 |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private String start_time;// 开始时间 |
| | | private String end_time;// 结束时间 |
| | | private BigDecimal total_electricity;// 总电量 |
| | | private BigDecimal loss_total_electricity;// 计损总电量 |
| | | private BigDecimal payment_amount;// 消费金额 |
| | | private Integer method;// 交易标识(1:app 启动,2:卡启动,4:离线卡启动,5: vin 码启动充电) |
| | | private String trade_date;// 交易日期、时间 |
| | | private Integer stop_reason;// 停止原因 |
| | | private String physical_card_number;// 物理卡号 |
| | | private String billing_model_code1;// 计费模型编号 |
| | | private BigDecimal spike_charge1;// 尖电量 |
| | | private BigDecimal loss_spike_charge1;// 计损尖电量 |
| | | private BigDecimal spike_amount1;// 尖金额 |
| | | private BigDecimal flat_charge1;// 平电量 |
| | | private BigDecimal loss_flat_charge1;// 计损平电量 |
| | | private BigDecimal flat_amount1;// 平金额 |
| | | private BigDecimal peak_charge1;// 峰电量 |
| | | private BigDecimal loss_peak_charge1;// 计损峰电量 |
| | | private BigDecimal peak_amount1;// 峰金额 |
| | | private BigDecimal valley_charge1;// 谷电量 |
| | | private BigDecimal loss_valley_charge1;// 计损谷电量 |
| | | private BigDecimal valley_amount1;// 谷金额 |
| | | private String billing_model_code2;// 计费模型编号 |
| | | private BigDecimal spike_charge2;// 尖电量 |
| | | private BigDecimal loss_spike_charge2;// 计损尖电量 |
| | | private BigDecimal spike_amount2;// 尖金额 |
| | | private BigDecimal flat_charge2;// 平电量 |
| | | private BigDecimal loss_flat_charge2;// 计损平电量 |
| | | private BigDecimal flat_amount2;// 平金额 |
| | | private BigDecimal peak_charge2;// 峰电量 |
| | | private BigDecimal loss_peak_charge2;// 计损峰电量 |
| | | private BigDecimal peak_amount2;// 峰金额 |
| | | private BigDecimal valley_charge2;// 谷电量 |
| | | private BigDecimal loss_valley_charge2;// 计损谷电量 |
| | | private BigDecimal valley_amount2;// 谷金额 |
| | | private String billing_model_code3;// 计费模型编号 |
| | | private BigDecimal spike_charge3;// 尖电量 |
| | | private BigDecimal loss_spike_charge3;// 计损尖电量 |
| | | private BigDecimal spike_amount3;// 尖金额 |
| | | private BigDecimal flat_charge3;// 平电量 |
| | | private BigDecimal loss_flat_charge3;// 计损平电量 |
| | | private BigDecimal flat_amount3;// 平金额 |
| | | private BigDecimal peak_charge3;// 峰电量 |
| | | private BigDecimal loss_peak_charge3;// 计损峰电量 |
| | | private BigDecimal peak_amount3;// 峰金额 |
| | | private BigDecimal valley_charge3;// 谷电量 |
| | | private BigDecimal loss_valley_charge3;// 计损谷电量 |
| | | private BigDecimal valley_amount3;// 谷金额 |
| | | private String billing_model_code4;// 计费模型编号 |
| | | private BigDecimal spike_charge4;// 尖电量 |
| | | private BigDecimal loss_spike_charge4;// 计损尖电量 |
| | | private BigDecimal spike_amount4;// 尖金额 |
| | | private BigDecimal flat_charge4;// 平电量 |
| | | private BigDecimal loss_flat_charge4;// 计损平电量 |
| | | private BigDecimal flat_amount4;// 平金额 |
| | | private BigDecimal peak_charge4;// 峰电量 |
| | | private BigDecimal loss_peak_charge4;// 计损峰电量 |
| | | private BigDecimal peak_amount4;// 峰金额 |
| | | private BigDecimal valley_charge4;// 谷电量 |
| | | private BigDecimal loss_valley_charge4;// 计损谷电量 |
| | | private BigDecimal valley_amount4;// 谷金额 |
| | | private String billing_model_code5;// 计费模型编号 |
| | | private BigDecimal spike_charge5;// 尖电量 |
| | | private BigDecimal loss_spike_charge5;// 计损尖电量 |
| | | private BigDecimal spike_amount5;// 尖金额 |
| | | private BigDecimal flat_charge5;// 平电量 |
| | | private BigDecimal loss_flat_charge5;// 计损平电量 |
| | | private BigDecimal flat_amount5;// 平金额 |
| | | private BigDecimal peak_charge5;// 峰电量 |
| | | private BigDecimal loss_peak_charge5;// 计损峰电量 |
| | | private BigDecimal peak_amount5;// 峰金额 |
| | | private BigDecimal valley_charge5;// 谷电量 |
| | | private BigDecimal loss_valley_charge5;// 计损谷电量 |
| | | private BigDecimal valley_amount5;// 谷金额 |
| | | private String billing_model_code6;// 计费模型编号 |
| | | private BigDecimal spike_charge6;// 尖电量 |
| | | private BigDecimal loss_spike_charge6;// 计损尖电量 |
| | | private BigDecimal spike_amount6;// 尖金额 |
| | | private BigDecimal flat_charge6;// 平电量 |
| | | private BigDecimal loss_flat_charge6;// 计损平电量 |
| | | private BigDecimal flat_amount6;// 平金额 |
| | | private BigDecimal peak_charge6;// 峰电量 |
| | | private BigDecimal loss_peak_charge6;// 计损峰电量 |
| | | private BigDecimal peak_amount6;// 峰金额 |
| | | private BigDecimal valley_charge6;// 谷电量 |
| | | private BigDecimal loss_valley_charge6;// 计损谷电量 |
| | | private BigDecimal valley_amount6;// 谷金额 |
| | | private String billing_model_code7;// 计费模型编号 |
| | | private BigDecimal spike_charge7;// 尖电量 |
| | | private BigDecimal loss_spike_charge7;// 计损尖电量 |
| | | private BigDecimal spike_amount7;// 尖金额 |
| | | private BigDecimal flat_charge7;// 平电量 |
| | | private BigDecimal loss_flat_charge7;// 计损平电量 |
| | | private BigDecimal flat_amount7;// 平金额 |
| | | private BigDecimal peak_charge7;// 峰电量 |
| | | private BigDecimal loss_peak_charge7;// 计损峰电量 |
| | | private BigDecimal peak_amount7;// 峰金额 |
| | | private BigDecimal valley_charge7;// 谷电量 |
| | | private BigDecimal loss_valley_charge7;// 计损谷电量 |
| | | private BigDecimal valley_amount7;// 谷金额 |
| | | private String billing_model_code8;// 计费模型编号 |
| | | private BigDecimal spike_charge8;// 尖电量 |
| | | private BigDecimal loss_spike_charge8;// 计损尖电量 |
| | | private BigDecimal spike_amount8;// 尖金额 |
| | | private BigDecimal flat_charge8;// 平电量 |
| | | private BigDecimal loss_flat_charge8;// 计损平电量 |
| | | private BigDecimal flat_amount8;// 平金额 |
| | | private BigDecimal peak_charge8;// 峰电量 |
| | | private BigDecimal loss_peak_charge8;// 计损峰电量 |
| | | private BigDecimal peak_amount8;// 峰金额 |
| | | private BigDecimal valley_charge8;// 谷电量 |
| | | private BigDecimal loss_valley_charge8;// 计损谷电量 |
| | | private BigDecimal valley_amount8;// 谷金额 |
| | | private String billing_model_code9;// 计费模型编号 |
| | | private BigDecimal spike_charge9;// 尖电量 |
| | | private BigDecimal loss_spike_charge9;// 计损尖电量 |
| | | private BigDecimal spike_amount9;// 尖金额 |
| | | private BigDecimal flat_charge9;// 平电量 |
| | | private BigDecimal loss_flat_charge9;// 计损平电量 |
| | | private BigDecimal flat_amount9;// 平金额 |
| | | private BigDecimal peak_charge9;// 峰电量 |
| | | private BigDecimal loss_peak_charge9;// 计损峰电量 |
| | | private BigDecimal peak_amount9;// 峰金额 |
| | | private BigDecimal valley_charge9;// 谷电量 |
| | | private BigDecimal loss_valley_charge9;// 计损谷电量 |
| | | private BigDecimal valley_amount9;// 谷金额 |
| | | private String billing_model_code10;// 计费模型编号 |
| | | private BigDecimal spike_charge10;// 尖电量 |
| | | private BigDecimal loss_spike_charge10;// 计损尖电量 |
| | | private BigDecimal spike_amount10;// 尖金额 |
| | | private BigDecimal flat_charge10;// 平电量 |
| | | private BigDecimal loss_flat_charge10;// 计损平电量 |
| | | private BigDecimal flat_amount10;// 平金额 |
| | | private BigDecimal peak_charge10;// 峰电量 |
| | | private BigDecimal loss_peak_charge10;// 计损峰电量 |
| | | private BigDecimal peak_amount10;// 峰金额 |
| | | private BigDecimal valley_charge10;// 谷电量 |
| | | private BigDecimal loss_valley_charge10;// 计损谷电量 |
| | | private BigDecimal valley_amount10;// 谷金额 |
| | | private String billing_model_code11;// 计费模型编号 |
| | | private BigDecimal spike_charge11;// 尖电量 |
| | | private BigDecimal loss_spike_charge11;// 计损尖电量 |
| | | private BigDecimal spike_amount11;// 尖金额 |
| | | private BigDecimal flat_charge11;// 平电量 |
| | | private BigDecimal loss_flat_charge11;// 计损平电量 |
| | | private BigDecimal flat_amount11;// 平金额 |
| | | private BigDecimal peak_charge11;// 峰电量 |
| | | private BigDecimal loss_peak_charge11;// 计损峰电量 |
| | | private BigDecimal peak_amount11;// 峰金额 |
| | | private BigDecimal valley_charge11;// 谷电量 |
| | | private BigDecimal loss_valley_charge11;// 计损谷电量 |
| | | private BigDecimal valley_amount11;// 谷金额 |
| | | private String billing_model_code12;// 计费模型编号 |
| | | private BigDecimal spike_charge12;// 尖电量 |
| | | private BigDecimal loss_spike_charge12;// 计损尖电量 |
| | | private BigDecimal spike_amount12;// 尖金额 |
| | | private BigDecimal flat_charge12;// 平电量 |
| | | private BigDecimal loss_flat_charge12;// 计损平电量 |
| | | private BigDecimal flat_amount12;// 平金额 |
| | | private BigDecimal peak_charge12;// 峰电量 |
| | | private BigDecimal loss_peak_charge12;// 计损峰电量 |
| | | private BigDecimal peak_amount12;// 峰金额 |
| | | private BigDecimal valley_charge12;// 谷电量 |
| | | private BigDecimal loss_valley_charge12;// 计损谷电量 |
| | | private BigDecimal valley_amount12;// 谷金额 |
| | | private String result;//原始字符串 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 余额更新应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class UpdateBalanceReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card_number; //物理卡号 |
| | | private BigDecimal account_balance; //修改结果(:0:修改成功,1:设备编号错误,2:卡号错误) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | **/ |
| | | |
| | | @Data |
| | | public class UploadRealTimeMonitoringDataMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer charging_gun_status; // 状态(0:离线,1:故障,2:空闲,3:充电) |
| | | private Integer homing_status; // 枪是否归位(0:否,1:是,2:未知) |
| | | private Integer insertion_status; // 是否插枪(0:否,1:是) |
| | | private BigDecimal output_voltage; // 输出电压,精确到小数点后一位;待机置零 |
| | | private BigDecimal output_current; // 输出电流,精确到小数点后一位;待机置零 |
| | | private BigDecimal gun_line_temperature; // 枪线温度,整形,偏移量-50;待机置零 |
| | | private String gun_line_code; // 枪线编码,没有置零 |
| | | private Integer soc; // SOC待机置零;交流桩置零 |
| | | private BigDecimal battery_temperature; // 电池组最高温度,整形,偏移量-50 ºC;待机置零;交流桩置零 |
| | | private Integer cumulative_charging_time; // 累计充电时间,单位:min;待机置零 |
| | | private Integer time_remaining; // 剩余时间,单位:min;待机置零、交流桩置零 |
| | | private BigDecimal charging_degree; // 充电度数,精确到小数点后四位;待机置零 |
| | | private BigDecimal loss_of_charging_degree; // 计损充电度数,精确到小数点后四位;待机置零,未设置计损比例时等于充电度数 |
| | | private BigDecimal paid_amount; // 已充金额,精确到小数点后四位;待机置零(电费+服务费)*计损充电度数 |
| | | private Integer hardware_fault; // 硬件故障(1:急停按钮动作故障;2:无可用整流模块;3:出风口温度过高;4:交流防雷故障;5:交直流模块 DC20 通信中断;6:绝缘检测模块 FC08 通信中断;7:电度表通信中断;8:读卡器通信中断;9:RC10 通信中断;10:风扇调速板故障;11:直流熔断器故障;12:高压接触器故障;13:门打开) |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.jianguan.rocket.model; |
| | | |
| | | import com.ruoyi.jianguan.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 充电桩工作参数设置应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class WorkingParameterSettingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer set_result; //设置结果(0:失败,1:成功) |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.jianguan.util; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.api.domain.SysOperLog; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | |
| | | import com.ruoyi.other.api.domain.TEnterpriseUserApplication; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TSystemConfiguration; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.domain.Operator; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.domain.TActivity; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | |
| | | import com.ruoyi.order.api.model.AccountingStrategyDetailOrder; |
| | | import com.ruoyi.order.api.model.TOrderInvoice; |
| | | import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.model.TSettlementConfirm; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.order.api.model.TVipOrderRefund; |
| | | import com.ruoyi.order.api.model.AccountingStrategyOrder; |
| | | import com.ruoyi.order.api.model.TOrderInvoiceDetail; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TChargingOrderRefund; |
| | | import com.ruoyi.order.api.model.TGrantVip; |
| | | import com.ruoyi.order.api.model.TOrderEvaluateTag; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrderRefund; |
| | | import com.ruoyi.order.api.model.TChargingBill; |
| | | |
| | | import com.ruoyi.chargingPile.api.model.TVehicleRamp; |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | | import com.ruoyi.chargingPile.api.model.TSiteMenu; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | | import com.ruoyi.chargingPile.api.model.TPartnerSite; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPileNotification; |
| | | import com.ruoyi.chargingPile.api.model.TMonitoringEquipment; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.model.TCarport; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.account.api.model.TAppUserSign; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.api.model.TInvoiceInformation; |
| | | import com.ruoyi.account.api.model.TAppCoupon; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TInviteUser; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.account.api.model.TAppUserIntegralChange; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | |
| | | import com.ruoyi.account.api.feignClient.JianGuanAccountClient; |
| | | import com.ruoyi.account.api.vo.GovernmentCloudAccountVO; |
| | | import com.ruoyi.chargingPile.api.feignClient.JianGuanChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.vo.GovernmentCloudChargingPileVO; |
| | | import com.ruoyi.jianguan.service.*; |
| | | import com.ruoyi.order.api.feignClient.JianGuanOrderClient; |
| | | import com.ruoyi.order.api.vo.GovernmentCloudOrderVO; |
| | | import com.ruoyi.other.api.feignClient.JianGuanOtherClient; |
| | | import com.ruoyi.other.api.vo.GovernmentCloudOtherVO; |
| | | import com.ruoyi.system.api.feignClient.JianGuanSystemClient; |
| | | import com.ruoyi.system.api.vo.GovernmentCloudSystemVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | private AccountingStrategyDetailOrderService accountingStrategyDetailOrderService; |
| | | @Resource |
| | | private AccountingStrategyOrderService accountingStrategyOrderService; |
| | | |
| | | @Resource |
| | | private GenTableColumnService genTableColumnService; |
| | | @Resource |
| | |
| | | private TVipService vipService; |
| | | |
| | | |
| | | @Resource |
| | | private JianGuanAccountClient jianGuanAccountClient; |
| | | @Resource |
| | | private JianGuanChargingPileClient jianGuanChargingPileClient; |
| | | @Resource |
| | | private JianGuanOrderClient jianGuanOrderClient; |
| | | @Resource |
| | | private JianGuanOtherClient jianGuanOtherClient; |
| | | @Resource |
| | | private JianGuanSystemClient jianGuanSystemClient; |
| | | |
| | | // 每天早上9点执行的定时任务 |
| | | @Scheduled(cron = "0 0 9 * * ?") |
| | | public void taskMonth() { |
| | | LocalDateTime start = LocalDateTime.now(); |
| | | LocalDateTime end = LocalDateTime.now().minusDays(1); |
| | | // accountingStrategyDetailOrderService |
| | | // accountingStrategyOrderService |
| | | // genTableColumnService |
| | | // genTableService |
| | | // partnerService |
| | | // regionService |
| | | // siteService |
| | | // sysConfigService |
| | | // deptService |
| | | // sysDictDataService |
| | | // sysDictTypeService |
| | | // sysLoginLogService |
| | | // sysMenuService |
| | | // sysNoticeService |
| | | // sysOperLogService |
| | | // sysPermissionService |
| | | // sysPostService |
| | | // sysRoleService |
| | | // sysUserOnlineService |
| | | // sysUserRoleService |
| | | // sysUserService |
| | | // operatorService |
| | | // accountingStrategyDetailService |
| | | // accountingStrategyService |
| | | // activityService |
| | | // advertisingService |
| | | // appCouponService |
| | | // applyChargingPileService |
| | | // appUserAddressService |
| | | // appUserCarService |
| | | // appUserIntegralChangeService |
| | | // appUserService |
| | | // appUserSignService |
| | | // appUserTagService |
| | | // appUserVipDetailService |
| | | // carportService |
| | | // chargingBillService |
| | | // chargingGunService |
| | | // chargingOrderAccountingStrategyService |
| | | // chargingOrderRefundService |
| | | // chargingOrderService |
| | | // chargingPileNotificationService |
| | | // chargingPileService |
| | | // companyService |
| | | // couponService |
| | | // enterpriseUserApplicationService |
| | | // evaluationTagService |
| | | // exchangeOrderService |
| | | // faultMessageService |
| | | // goodsService |
| | | // grantVipService |
| | | // htmlService |
| | | // integralRuleService |
| | | // inviteUserService |
| | | // tInvoiceInformationService |
| | | // invoiceTypeService |
| | | // monitoringEquipmentService |
| | | // noticeService |
| | | // orderAppealService |
| | | // orderEvaluateService |
| | | // orderEvaluateTagService |
| | | // orderInvoiceDetailService |
| | | // orderInvoiceService |
| | | // parkingLotService |
| | | // parkingRecordService |
| | | // partnerSiteService |
| | | // repairService |
| | | // roleSiteService |
| | | // settlementConfirmService |
| | | // shoppingOrderRefundService |
| | | // shoppingOrderService |
| | | // siteMenuService |
| | | // systemConfigurationService |
| | | // userSiteService |
| | | // userTagService |
| | | // vehicleRampService |
| | | // vipOrderRefundService |
| | | // vipOrderService |
| | | // vipService |
| | | |
| | | // account服务 |
| | | GovernmentCloudAccountVO data = jianGuanAccountClient.listAll().getData(); |
| | | if (data != null) { |
| | | List<TAppCoupon> appCoupons = data.getAppCoupons(); |
| | | if (!appCoupons.isEmpty()) { |
| | | appCouponService.saveBatch(appCoupons); |
| | | } |
| | | List<TAppUser> appUsers = data.getAppUsers(); |
| | | if (!appUsers.isEmpty()) { |
| | | appUserService.saveBatch(appUsers); |
| | | } |
| | | List<TAppUserAddress> appUserAddresses = data.getAppUserAddresses(); |
| | | if (!appUserAddresses.isEmpty()) { |
| | | appUserAddressService.saveBatch(appUserAddresses); |
| | | } |
| | | List<TAppUserCar> appUserCars = data.getAppUserCars(); |
| | | if (!appUserCars.isEmpty()) { |
| | | appUserCarService.saveBatch(appUserCars); |
| | | } |
| | | List<TAppUserIntegralChange> appUserIntegralChanges = data.getAppUserIntegralChanges(); |
| | | if (!appUserIntegralChanges.isEmpty()) { |
| | | appUserIntegralChangeService.saveBatch(appUserIntegralChanges); |
| | | } |
| | | List<TAppUserSign> appUserSigns = data.getAppUserSigns(); |
| | | if (!appUserSigns.isEmpty()) { |
| | | appUserSignService.saveBatch(appUserSigns); |
| | | } |
| | | List<TAppUserTag> appUserTags = data.getAppUserTags(); |
| | | if (!appUserTags.isEmpty()) { |
| | | appUserTagService.saveBatch(appUserTags); |
| | | } |
| | | List<TAppUserVipDetail> appUserVipDetails = data.getAppUserVipDetails(); |
| | | if (!appUserVipDetails.isEmpty()) { |
| | | appUserVipDetailService.saveBatch(appUserVipDetails); |
| | | } |
| | | List<TInviteUser> inviteUsers = data.getInviteUsers(); |
| | | if (!inviteUsers.isEmpty()) { |
| | | inviteUserService.saveBatch(inviteUsers); |
| | | } |
| | | List<TInvoiceInformation> invoiceInformations = data.getInvoiceInformations(); |
| | | if (!invoiceInformations.isEmpty()) { |
| | | tInvoiceInformationService.saveBatch(invoiceInformations); |
| | | } |
| | | } |
| | | // chargingPile服务 |
| | | GovernmentCloudChargingPileVO data1 = jianGuanChargingPileClient.listAll().getData(); |
| | | if (data1 != null) { |
| | | List<Partner> partners = data1.getPartners(); |
| | | if (!partners.isEmpty()) { |
| | | partnerService.saveBatch(partners); |
| | | } |
| | | List<Site> sites = data1.getSites(); |
| | | if (!sites.isEmpty()) { |
| | | siteService.saveBatch(sites); |
| | | } |
| | | List<TAccountingStrategy> accountingStrategies = data1.getAccountingStrategies(); |
| | | if (!accountingStrategies.isEmpty()) { |
| | | accountingStrategyService.saveBatch(accountingStrategies); |
| | | } |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = data1.getAccountingStrategyDetails(); |
| | | if (!accountingStrategyDetails.isEmpty()) { |
| | | accountingStrategyDetailService.saveBatch(accountingStrategyDetails); |
| | | } |
| | | List<TApplyChargingPile> applyChargingPiles = data1.getApplyChargingPiles(); |
| | | if (!applyChargingPiles.isEmpty()) { |
| | | applyChargingPileService.saveBatch(applyChargingPiles); |
| | | } |
| | | List<TCarport> carports = data1.getCarports(); |
| | | if (!carports.isEmpty()) { |
| | | carportService.saveBatch(carports); |
| | | } |
| | | List<TChargingGun> chargingGuns = data1.getChargingGuns(); |
| | | if (!chargingGuns.isEmpty()) { |
| | | chargingGunService.saveBatch(chargingGuns); |
| | | } |
| | | List<TChargingPile> chargingPiles = data1.getChargingPiles(); |
| | | if (!chargingPiles.isEmpty()) { |
| | | chargingPileService.saveBatch(chargingPiles); |
| | | } |
| | | List<TChargingPileNotification> chargingPileNotifications = data1.getChargingPileNotifications(); |
| | | if (!chargingPileNotifications.isEmpty()) { |
| | | chargingPileNotificationService.saveBatch(chargingPileNotifications); |
| | | } |
| | | List<TFaultMessage> faultMessages = data1.getFaultMessages(); |
| | | if (!faultMessages.isEmpty()) { |
| | | faultMessageService.saveBatch(faultMessages); |
| | | } |
| | | List<TMonitoringEquipment> monitoringEquipments = data1.getMonitoringEquipments(); |
| | | if (!monitoringEquipments.isEmpty()) { |
| | | monitoringEquipmentService.saveBatch(monitoringEquipments); |
| | | } |
| | | List<TParkingLot> parkingLots = data1.getParkingLots(); |
| | | if (!parkingLots.isEmpty()) { |
| | | parkingLotService.saveBatch(parkingLots); |
| | | } |
| | | List<TParkingRecord> parkingRecords = data1.getParkingRecords(); |
| | | if (!parkingRecords.isEmpty()) { |
| | | parkingRecordService.saveBatch(parkingRecords); |
| | | } |
| | | // List<TPartnerSite> partnerSites = data1.getPartnerSites(); |
| | | // if (!partnerSites.isEmpty()) { |
| | | // partnerSiteService.saveBatch(partnerSites); |
| | | // } |
| | | List<TRepair> repairs = data1.getRepairs(); |
| | | if (!repairs.isEmpty()) { |
| | | repairService.saveBatch(repairs); |
| | | } |
| | | // List<TSiteMenu> siteMenus = data1.getSiteMenus(); |
| | | // if (!siteMenus.isEmpty()) { |
| | | // siteMenuService.saveBatch(siteMenus); |
| | | // } |
| | | List<TVehicleRamp> vehicleRamps = data1.getVehicleRamps(); |
| | | if (!vehicleRamps.isEmpty()) { |
| | | vehicleRampService.saveBatch(vehicleRamps); |
| | | } |
| | | } |
| | | //order服务 |
| | | GovernmentCloudOrderVO data2 = jianGuanOrderClient.listAll().getData(); |
| | | |
| | | |
| | | |
| | | if (data2 != null) { |
| | | List<AccountingStrategyDetailOrder> accountingStrategyDetailOrders = data2.getAccountingStrategyDetailOrders(); |
| | | if (!accountingStrategyDetailOrders.isEmpty()) { |
| | | accountingStrategyDetailOrderService.saveBatch(accountingStrategyDetailOrders); |
| | | } |
| | | List<AccountingStrategyOrder> accountingStrategyOrders = data2.getAccountingStrategyOrders(); |
| | | if (!accountingStrategyOrders.isEmpty()) { |
| | | accountingStrategyOrderService.saveBatch(accountingStrategyOrders); |
| | | } |
| | | List<TChargingBill> chargingBills = data2.getChargingBills(); |
| | | if (!chargingBills.isEmpty()) { |
| | | chargingBillService.saveBatch(chargingBills); |
| | | } |
| | | List<TChargingOrder> chargingOrders = data2.getChargingOrders(); |
| | | if (!chargingOrders.isEmpty()) { |
| | | chargingOrderService.saveBatch(chargingOrders); |
| | | } |
| | | List<TChargingOrderAccountingStrategy> chargingOrderAccountingStrategies = data2.getChargingOrderAccountingStrategies(); |
| | | if (!chargingOrderAccountingStrategies.isEmpty()) { |
| | | chargingOrderAccountingStrategyService.saveBatch(chargingOrderAccountingStrategies); |
| | | } |
| | | List<TChargingOrderRefund> chargingOrderRefunds = data2.getChargingOrderRefunds(); |
| | | if (!chargingOrderRefunds.isEmpty()) { |
| | | chargingOrderRefundService.saveBatch(chargingOrderRefunds); |
| | | } |
| | | List<TExchangeOrder> exchangeOrders = data2.getExchangeOrders(); |
| | | if (!exchangeOrders.isEmpty()) { |
| | | exchangeOrderService.saveBatch(exchangeOrders); |
| | | } |
| | | List<TGrantVip> grantVips = data2.getGrantVips(); |
| | | if (!grantVips.isEmpty()) { |
| | | grantVipService.saveBatch(grantVips); |
| | | } |
| | | List<TOrderAppeal> orderAppeals = data2.getOrderAppeals(); |
| | | if (!orderAppeals.isEmpty()) { |
| | | orderAppealService.saveBatch(orderAppeals); |
| | | } |
| | | List<TOrderEvaluate> orderEvaluates = data2.getOrderEvaluates(); |
| | | if (!orderEvaluates.isEmpty()) { |
| | | orderEvaluateService.saveBatch(orderEvaluates); |
| | | } |
| | | List<TOrderEvaluateTag> orderEvaluateTags = data2.getOrderEvaluateTags(); |
| | | if (!orderEvaluateTags.isEmpty()) { |
| | | orderEvaluateTagService.saveBatch(orderEvaluateTags); |
| | | } |
| | | List<TOrderInvoice> orderInvoices = data2.getOrderInvoices(); |
| | | if (!orderInvoices.isEmpty()) { |
| | | orderInvoiceService.saveBatch(orderInvoices); |
| | | } |
| | | List<TOrderInvoiceDetail> orderInvoiceDetails = data2.getOrderInvoiceDetails(); |
| | | if (!orderInvoiceDetails.isEmpty()) { |
| | | orderInvoiceDetailService.saveBatch(orderInvoiceDetails); |
| | | } |
| | | List<TSettlementConfirm> settlementConfirms = data2.getSettlementConfirms(); |
| | | if (!settlementConfirms.isEmpty()) { |
| | | settlementConfirmService.saveBatch(settlementConfirms); |
| | | } |
| | | List<TShoppingOrder> shoppingOrders = data2.getShoppingOrders(); |
| | | if (!shoppingOrders.isEmpty()) { |
| | | shoppingOrderService.saveBatch(shoppingOrders); |
| | | } |
| | | List<TShoppingOrderRefund> shoppingOrderRefunds = data2.getShoppingOrderRefunds(); |
| | | if (!shoppingOrderRefunds.isEmpty()) { |
| | | shoppingOrderRefundService.saveBatch(shoppingOrderRefunds); |
| | | } |
| | | List<TVipOrder> vipOrders = data2.getVipOrders(); |
| | | if (!vipOrders.isEmpty()) { |
| | | vipOrderService.saveBatch(vipOrders); |
| | | } |
| | | List<TVipOrderRefund> vipOrderRefunds = data2.getVipOrderRefunds(); |
| | | if (!vipOrderRefunds.isEmpty()) { |
| | | vipOrderRefundService.saveBatch(vipOrderRefunds); |
| | | } |
| | | } |
| | | // other服务 |
| | | GovernmentCloudOtherVO data3 = jianGuanOtherClient.listAll().getData(); |
| | | if (data3 != null) { |
| | | List<Operator> operators = data3.getOperators(); |
| | | if (!operators.isEmpty()) { |
| | | operatorService.saveOrUpdateBatch(operators); |
| | | } |
| | | List<TActivity> activities = data3.getActivities(); |
| | | if (!activities.isEmpty()) { |
| | | activityService.saveBatch(activities); |
| | | } |
| | | List<TAdvertising> advertisings = data3.getAdvertisings(); |
| | | if (!advertisings.isEmpty()) { |
| | | advertisingService.saveBatch(advertisings); |
| | | } |
| | | List<TCompany> companies = data3.getCompanies(); |
| | | if (!companies.isEmpty()) { |
| | | companyService.saveBatch(companies); |
| | | } |
| | | List<TCoupon> coupons = data3.getCoupons(); |
| | | if (!coupons.isEmpty()) { |
| | | couponService.saveBatch(coupons); |
| | | } |
| | | List<TEnterpriseUserApplication> enterpriseUserApplications = data3.getEnterpriseUserApplications(); |
| | | if (!enterpriseUserApplications.isEmpty()) { |
| | | enterpriseUserApplicationService.saveBatch(enterpriseUserApplications); |
| | | } |
| | | List<TEvaluationTag> evaluationTags = data3.getEvaluationTags(); |
| | | if (!evaluationTags.isEmpty()) { |
| | | evaluationTagService.saveBatch(evaluationTags); |
| | | } |
| | | List<TGoods> goods = data3.getGoods(); |
| | | if (!goods.isEmpty()) { |
| | | goodsService.saveBatch(goods); |
| | | } |
| | | List<THtml> htmls = data3.getHtmls(); |
| | | if (!htmls.isEmpty()) { |
| | | htmlService.saveOrUpdateBatch(htmls); |
| | | } |
| | | List<TIntegralRule> integralRules = data3.getIntegralRules(); |
| | | if (!integralRules.isEmpty()) { |
| | | integralRuleService.saveBatch(integralRules); |
| | | } |
| | | List<TInvoiceType> invoiceTypes = data3.getInvoiceTypes(); |
| | | if (!invoiceTypes.isEmpty()) { |
| | | invoiceTypeService.saveBatch(invoiceTypes); |
| | | } |
| | | List<TNotice> notices = data3.getNotices(); |
| | | if (!notices.isEmpty()) { |
| | | noticeService.saveBatch(notices); |
| | | } |
| | | List<TSystemConfiguration> systemConfigurations = data3.getSystemConfigurations(); |
| | | if (!systemConfigurations.isEmpty()) { |
| | | systemConfigurationService.saveOrUpdateBatch(systemConfigurations); |
| | | } |
| | | List<TUserTag> userTags = data3.getUserTags(); |
| | | if (!userTags.isEmpty()) { |
| | | userTagService.saveBatch(userTags); |
| | | } |
| | | List<TVip> vips = data3.getVips(); |
| | | if (!vips.isEmpty()) { |
| | | vipService.saveBatch(vips); |
| | | } |
| | | } |
| | | GovernmentCloudSystemVO data4 = jianGuanSystemClient.listAll().getData(); |
| | | if (data4 != null) { |
| | | List<SysLoginLog> loginLogs = data4.getLoginLogs(); |
| | | if (!loginLogs.isEmpty()) { |
| | | sysLoginLogService.saveBatch(loginLogs); |
| | | } |
| | | List<SysOperLog> sysOperLogs = data4.getSysOperLogs(); |
| | | if (!sysOperLogs.isEmpty()) { |
| | | sysOperLogService.saveBatch(sysOperLogs); |
| | | } |
| | | List<SysRole> sysRoles = data4.getSysRoles(); |
| | | if (!sysRoles.isEmpty()) { |
| | | sysRoleService.saveBatch(sysRoles); |
| | | } |
| | | List<SysUser> sysUsers = data4.getSysUsers(); |
| | | if (!sysUsers.isEmpty()) { |
| | | sysUserService.saveBatch(sysUsers); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.jianguan.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("大屏 停车场充电功率曲线Vo") |
| | | public class LargeChargingPowerVo { |
| | | @ApiModelProperty("时间") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("平均功率") |
| | | private BigDecimal power=BigDecimal.ONE; |
| | | } |
| | |
| | | allow-circular-references: true |
| | | profiles: |
| | | # 环境配置 |
| | | # active: dev |
| | | active: prod |
| | | active: dev |
| | | # active: prod |
| | | |
| | | --- |
| | | spring: |
| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | |
| | | import com.ruoyi.common.core.utils.WebUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.order.api.dto.SettlementConfirmAdd; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.SettlementListQuery; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderListVO; |
| | | import com.ruoyi.order.api.vo.SettlementTotalVO; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | | import com.ruoyi.order.export.OrderInvoiceExport; |
| | | import com.ruoyi.order.export.TChargingOrderExport; |
| | | import com.ruoyi.order.vo.ChargingOrderListInfoVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderTimeVO; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.api.vo.SettlementTotalVO; |
| | | import com.ruoyi.order.export.TChargingOrderExport; |
| | | import com.ruoyi.order.service.AccountingStrategyOrderService; |
| | | import com.ruoyi.order.service.TChargingOrderAccountingStrategyService; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TSettlementConfirmService; |
| | | import com.ruoyi.order.vo.ChargingOrderListInfoVO; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.omg.CORBA.PRIVATE_MEMBER; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.vo.GovernmentCloudChargingPileVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.vo.GovernmentCloudOrderVO; |
| | | import com.ruoyi.order.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/governmentCloudOrder") |
| | | public class GovernmentCloudOrderController { |
| | | @Autowired |
| | | private AccountingStrategyDetailOrderService accountingStrategyDetailOrderService; |
| | | @Autowired |
| | | private AccountingStrategyOrderService accountingStrategyOrderService; |
| | | @Autowired |
| | | private TChargingBillService chargingBillService; |
| | | @Autowired |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | @Autowired |
| | | private TChargingOrderRefundService chargingOrderRefundService; |
| | | @Autowired |
| | | private TChargingOrderService chargingOrderService; |
| | | @Autowired |
| | | private TExchangeOrderService exchangeOrderService; |
| | | @Autowired |
| | | private TGrantVipService grantVipService; |
| | | @Autowired |
| | | private TOrderAppealService orderAppealService; |
| | | @Autowired |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | @Autowired |
| | | private TOrderEvaluateTagService orderEvaluateTagService; |
| | | @Autowired |
| | | private TOrderInvoiceDetailService orderInvoiceDetailService; |
| | | @Autowired |
| | | private TOrderInvoiceService orderInvoiceService; |
| | | @Autowired |
| | | private TSettlementConfirmService settlementConfirmService; |
| | | @Autowired |
| | | private TShoppingOrderRefundService shoppingOrderRefundService; |
| | | @Autowired |
| | | private TShoppingOrderService shoppingOrderService; |
| | | @Autowired |
| | | private TVipOrderRefundService vipOrderRefundService; |
| | | @Autowired |
| | | private TVipOrderService vipOrderService; |
| | | |
| | | |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/listAll") |
| | | R<GovernmentCloudOrderVO> listAll() { |
| | | LocalDateTime end = LocalDateTime.now(); |
| | | LocalDateTime start = LocalDateTime.now().minusDays(1); |
| | | GovernmentCloudOrderVO governmentCloudAccountVO = new GovernmentCloudOrderVO(); |
| | | List<AccountingStrategyDetailOrder> list1 = accountingStrategyDetailOrderService.lambdaQuery().between(AccountingStrategyDetailOrder::getCreateTime, start, end).list(); |
| | | List<AccountingStrategyOrder> list2 = accountingStrategyOrderService.lambdaQuery().between(AccountingStrategyOrder::getCreateTime, start, end).list(); |
| | | List<TChargingBill> list3 = chargingBillService.lambdaQuery().between(TChargingBill::getCreateTime, start, end).list(); |
| | | List<TChargingOrderAccountingStrategy> list4 = chargingOrderAccountingStrategyService.lambdaQuery().between(TChargingOrderAccountingStrategy::getCreateTime, start, end).list(); |
| | | List<TChargingOrderRefund> list5 = chargingOrderRefundService.lambdaQuery().between(TChargingOrderRefund::getCreateTime, start, end).list(); |
| | | List<TChargingOrder> list6 = chargingOrderService.lambdaQuery().between(TChargingOrder::getCreateTime, start, end).list(); |
| | | List<TExchangeOrder> list7 = exchangeOrderService.lambdaQuery().between(TExchangeOrder::getCreateTime, start, end).list(); |
| | | List<TGrantVip> list8 = grantVipService.lambdaQuery().between(TGrantVip::getCreateTime, start, end).list(); |
| | | List<TOrderAppeal> list9 = orderAppealService.lambdaQuery().between(TOrderAppeal::getCreateTime, start, end).list(); |
| | | List<TOrderEvaluate> list10 = orderEvaluateService.lambdaQuery().between(TOrderEvaluate::getCreateTime, start, end).list(); |
| | | List<TOrderEvaluateTag> list11 = orderEvaluateTagService.lambdaQuery().between(TOrderEvaluateTag::getCreateTime, start, end).list(); |
| | | List<TOrderInvoiceDetail> list12 = orderInvoiceDetailService.lambdaQuery().between(TOrderInvoiceDetail::getCreateTime, start, end).list(); |
| | | List<TOrderInvoice> list13 = orderInvoiceService.lambdaQuery().between(TOrderInvoice::getCreateTime, start, end).list(); |
| | | List<TSettlementConfirm> list14 = settlementConfirmService.lambdaQuery().between(TSettlementConfirm::getCreateTime, start, end).list(); |
| | | List<TShoppingOrderRefund> list15 = shoppingOrderRefundService.lambdaQuery().between(TShoppingOrderRefund::getCreateTime, start, end).list(); |
| | | List<TVipOrderRefund> list16 = vipOrderRefundService.lambdaQuery().between(TVipOrderRefund::getCreateTime, start, end).list(); |
| | | List<TVipOrder> list17 = vipOrderService.lambdaQuery().between(TVipOrder::getCreateTime, start, end).list(); |
| | | List<TShoppingOrder> list18 = shoppingOrderService.lambdaQuery().between(TShoppingOrder::getCreateTime, start, end).list(); |
| | | |
| | | governmentCloudAccountVO.setAccountingStrategyDetailOrders(list1); |
| | | governmentCloudAccountVO.setAccountingStrategyOrders(list2); |
| | | governmentCloudAccountVO.setChargingBills(list3); |
| | | governmentCloudAccountVO.setChargingOrderAccountingStrategies(list4); |
| | | governmentCloudAccountVO.setChargingOrderRefunds(list5); |
| | | governmentCloudAccountVO.setChargingOrders(list6); |
| | | governmentCloudAccountVO.setExchangeOrders(list7); |
| | | governmentCloudAccountVO.setGrantVips(list8); |
| | | governmentCloudAccountVO.setOrderAppeals(list9); |
| | | governmentCloudAccountVO.setOrderEvaluates(list10); |
| | | governmentCloudAccountVO.setOrderEvaluateTags(list11); |
| | | governmentCloudAccountVO.setOrderInvoiceDetails(list12); |
| | | governmentCloudAccountVO.setOrderInvoices(list13); |
| | | governmentCloudAccountVO.setSettlementConfirms(list14); |
| | | governmentCloudAccountVO.setShoppingOrderRefunds(list15); |
| | | governmentCloudAccountVO.setShoppingOrders(list18); |
| | | governmentCloudAccountVO.setVipOrders(list17); |
| | | governmentCloudAccountVO.setVipOrderRefunds(list16); |
| | | return R.ok(governmentCloudAccountVO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.vo.GovernmentCloudOrderVO; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.vo.GovernmentCloudOtherVO; |
| | | import com.ruoyi.other.service.*; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/governmentCloudOther") |
| | | public class GovernmentCloudOtherController { |
| | | @Autowired |
| | | private OperatorService operatorService; |
| | | @Autowired |
| | | private TActivityService activityService; |
| | | @Autowired |
| | | private TAdvertisingService advertisingService; |
| | | @Autowired |
| | | private TCompanyService companyService; |
| | | @Autowired |
| | | private TCouponService couponService; |
| | | @Autowired |
| | | private TEnterpriseUserApplicationService enterpriseUserApplicationService; |
| | | @Autowired |
| | | private TEvaluationTagService evaluationTagService; |
| | | @Autowired |
| | | private TGoodsService goodsService; |
| | | @Autowired |
| | | private THtmlService htmlService; |
| | | @Autowired |
| | | private TIntegralRuleService integralRuleService; |
| | | @Autowired |
| | | private TInvoiceTypeService invoiceTypeService; |
| | | @Autowired |
| | | private TNoticeService noticeService; |
| | | @Autowired |
| | | private TRoleSiteService roleSiteService; |
| | | @Autowired |
| | | private TSystemConfigurationService systemConfigurationService; |
| | | @Autowired |
| | | private TUserSiteService userSiteService; |
| | | @Autowired |
| | | private TUserTagService userTagService; |
| | | @Autowired |
| | | private TVipService vipService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 政务云查询数据接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/listAll") |
| | | R<GovernmentCloudOtherVO> listAll() { |
| | | LocalDateTime end = LocalDateTime.now(); |
| | | LocalDateTime start = LocalDateTime.now().minusDays(1); |
| | | GovernmentCloudOtherVO governmentCloudAccountVO = new GovernmentCloudOtherVO(); |
| | | |
| | | |
| | | List<Operator> list1 = operatorService.lambdaQuery().list(); |
| | | List<TActivity> list2 = activityService.lambdaQuery().between(TActivity::getCreateTime, start, end).list(); |
| | | List<TAdvertising> list3 = advertisingService.lambdaQuery().between(TAdvertising::getCreateTime, start, end).list(); |
| | | List<TCompany> list4 = companyService.lambdaQuery().between(TCompany::getCreateTime, start, end).list(); |
| | | List<TCoupon> list5 = couponService.lambdaQuery().between(TCoupon::getCreateTime, start, end).list(); |
| | | List<TEnterpriseUserApplication> list6 = enterpriseUserApplicationService.lambdaQuery().between(TEnterpriseUserApplication::getCreateTime, start, end).list(); |
| | | List<TEvaluationTag> list7 = evaluationTagService.lambdaQuery().between(TEvaluationTag::getCreateTime, start, end).list(); |
| | | List<TGoods> list8 = goodsService.lambdaQuery().between(TGoods::getCreateTime, start, end).list(); |
| | | List<THtml> list9 = htmlService.lambdaQuery().list(); |
| | | List<TIntegralRule> list10 = integralRuleService.lambdaQuery().list(); |
| | | List<TInvoiceType> list11 = invoiceTypeService.lambdaQuery().between(TInvoiceType::getCreateTime, start, end).list(); |
| | | List<TNotice> list12 = noticeService.lambdaQuery().between(TNotice::getCreateTime, start, end).list(); |
| | | // List<TRoleSite> list13 = roleSiteService.lambdaQuery().between(TRoleSite::getCreateTime, start, end).list(); |
| | | List<TSystemConfiguration> list14 = systemConfigurationService.lambdaQuery().list(); |
| | | // List<TUserSite> list15 = userSiteService.lambdaQuery().between(TUserSite::getCreateTime, start, end).list(); |
| | | List<TUserTag> list16 = userTagService.lambdaQuery().between(TUserTag::getCreateTime, start, end).list(); |
| | | List<TVip> list17 = vipService.lambdaQuery().between(TVip::getCreateTime, start, end).list(); |
| | | governmentCloudAccountVO.setOperators(list1); |
| | | governmentCloudAccountVO.setActivities(list2); |
| | | governmentCloudAccountVO.setAdvertisings(list3); |
| | | governmentCloudAccountVO.setCompanies(list4); |
| | | governmentCloudAccountVO.setCoupons(list5); |
| | | governmentCloudAccountVO.setEnterpriseUserApplications(list6); |
| | | governmentCloudAccountVO.setEvaluationTags(list7); |
| | | governmentCloudAccountVO.setGoods(list8); |
| | | governmentCloudAccountVO.setHtmls(list9); |
| | | governmentCloudAccountVO.setIntegralRules(list10); |
| | | governmentCloudAccountVO.setInvoiceTypes(list11); |
| | | governmentCloudAccountVO.setNotices(list12); |
| | | governmentCloudAccountVO.setSystemConfigurations(list14); |
| | | governmentCloudAccountVO.setUserTags(list16); |
| | | governmentCloudAccountVO.setVips(list17); |
| | | |
| | | return R.ok(governmentCloudAccountVO); |
| | | } |
| | | |
| | | |
| | | } |
| | | |