Merge remote-tracking branch 'origin/master'
| | |
| | | @TableField("direction") |
| | | private Integer direction; |
| | | |
| | | |
| | | @ApiModelProperty(value = "开关动作(open:开、close:关)") |
| | | @TableField(exist = false) |
| | | private String action; |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.integration.api.feignClient.SendMessageClient; |
| | | import com.ruoyi.integration.api.feignClient.SwitchwayGateClient; |
| | | import com.ruoyi.integration.api.model.PlatformStartCharging; |
| | | import com.ruoyi.integration.api.model.PlatformStopCharging; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 充电桩服务降级处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class SwitchwayGateFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<SwitchwayGateClient> { |
| | | private static final Logger log = LoggerFactory.getLogger(SwitchwayGateFallbackFactory.class); |
| | | |
| | | @Override |
| | | public SwitchwayGateClient create(Throwable throwable) { |
| | | log.error("调用道闸开关失败:{}", throwable.getMessage()); |
| | | return new SwitchwayGateClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<Boolean> gateService(SwitchwayGateReq req) { |
| | | return R.fail("道闸开关失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.integration.api.factory.SwitchwayGateFallbackFactory; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | 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/10 11:08 |
| | | */ |
| | | @FeignClient(contextId = "SwitchwayGateClient", value = ServiceNameConstants.INTEGRATION_SERVICE, fallbackFactory = SwitchwayGateFallbackFactory.class) |
| | | public interface SwitchwayGateClient { |
| | | |
| | | /** |
| | | * 道闸开关 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @PostMapping("/switchwayGate/gateService") |
| | | R<Boolean> gateService(@RequestBody SwitchwayGateReq req); |
| | | } |
| | |
| | | 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:门打开) |
| | | |
| | | private String createTime; // 格式化时间格式 |
| | | private BigDecimal electrovalence_all;// @ApiModelProperty("时段电价") |
| | | |
| | | private BigDecimal service_charge;//@ApiModelProperty("时段服务费单价") |
New file |
| | |
| | | package com.ruoyi.integration.api.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/10 10:48 |
| | | */ |
| | | @Data |
| | | public class SwitchwayGateReq { |
| | | /** |
| | | * 开关动作(open:开、close:关) |
| | | */ |
| | | private String action; |
| | | /** |
| | | * 通道编号 |
| | | */ |
| | | private String channel; |
| | | } |
| | |
| | | com.ruoyi.integration.api.factory.SendMessageFallbackFactory |
| | | com.ruoyi.integration.api.factory.PlatformStartChargingReplyFallbackFactory |
| | | com.ruoyi.integration.api.factory.PlatformStopChargingReplyFallbackFactory |
| | | com.ruoyi.integration.api.factory.SwitchwayGateFallbackFactory |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ExchangeDto; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.ChargingListQuery; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.AccountListVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | return R.fail("查询活动费用统计失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<AccountListVO> accountBillList(ChargingListQuery dto) { |
| | | return R.fail("账户结算账单导出失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | }; |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ExchangeDto; |
| | | import com.ruoyi.order.api.factory.OrderFallbackFactory; |
| | | import com.ruoyi.order.api.model.ChargingListQuery; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.AccountListVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @PostMapping(value = "/t-exchange-order/activityStatistics") |
| | | public R<TActivityVO> activityStatistics(@RequestBody TActivityStatisticsQuery dto); |
| | | @PostMapping(value = "/chargingBill/accountBillList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-账户结算账单"}) |
| | | R<AccountListVO> accountBillList(@RequestBody ChargingListQuery dto); |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "充电账单列表查询参数") |
| | | @ApiModel("充电时段统计DTO") |
| | | public class ChargingListQuery extends BasePage { |
| | | @ApiModelProperty("订单分类 1全站 2各个站点") |
| | | private String type; |
| | | @ApiModelProperty("账单周期2020-01-01 00:00:00 - 2020-01-01 23:59:59") |
| | | private String startTime; |
| | | @ApiModelProperty("1已出账 2未出账") |
| | | @ApiModelProperty("订单编号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty("状态(0=未知,1=等待中,2=启动中,3=充电中,4=停止中,5=已结束)") |
| | | private Integer status; |
| | | @ApiModelProperty("订单分类(1全站 2各个站点)") |
| | | private Integer type; |
| | | @ApiModelProperty("状态(1未出账 2已出账)") |
| | | private Integer state; |
| | | @ApiModelProperty("状态(1日结 2月结)") |
| | | private Integer orderState; |
| | | @ApiModelProperty("uid 前端忽略") |
| | | private String uid; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("车牌号") |
| | | private String licensePlate; |
| | | |
| | | @ApiModelProperty("订单类型(1=充电订单(小程序),2=充电订单(刷卡))") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty("开始时间 2020-01-01 12:00:00 - 2020-01-01 23:00:00") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("结束时间 2020-01-01 12:00:00 - 2020-01-01 23:00:00") |
| | | private String endTime; |
| | | @ApiModelProperty("用户ids 前端忽略") |
| | | private List<Long> userIds; |
| | | @ApiModelProperty("车辆ids 前端忽略") |
| | | private List<Long> carIds; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.model; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("充电时段统计DTO") |
| | | public class ExportUidDto { |
| | | |
| | | @ApiModelProperty("uid") |
| | | private String uid; |
| | | @ApiModelProperty("时间") |
| | | private String time; |
| | | |
| | | } |
| | |
| | | @TableField("refund_code") |
| | | private String refundCode; |
| | | @ApiModelProperty(value = "退款原因") |
| | | @TableField("refund_reason") |
| | | @TableField(exist = false) |
| | | private String refundReason; |
| | | |
| | | @ApiModelProperty(value = "退款金额") |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TChargingBill; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingBillListVO对象",description = "充电算帐单列表VO") |
| | | public class AccountListVO{ |
| | | @ApiModelProperty(value = "账单数量") |
| | | private Integer billCount; |
| | | @ApiModelProperty(value = "总入账金额") |
| | | private BigDecimal totalAmount; |
| | | @ApiModelProperty(value = "总支付结算金额") |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "总退款结算金额") |
| | | private BigDecimal refundAmount; |
| | | @ApiModelProperty(value = "平台手续费") |
| | | private BigDecimal commissionAmount; |
| | | @ApiModelProperty(value = "分佣") |
| | | private BigDecimal sharingAmount; |
| | | @ApiModelProperty(value = "列表数据") |
| | | private PageInfo<ChargingBillListVO> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingBillVO对象",description = "充电算帐单") |
| | | public class AccountVO { |
| | | @ApiModelProperty(value = "账单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "账户类型") |
| | | private String accountType; |
| | | @ApiModelProperty(value = "账单类型") |
| | | private String orderType; |
| | | @ApiModelProperty(value = "账单分类") |
| | | private String type; |
| | | // @ApiModelProperty(value = "账单周期") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "站点名称") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // @ApiModelProperty(value = "账户类型") |
| | | // private String accountType; |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // @ApiModelProperty(value = "订单总金额") |
| | | // private BigDecimal orderAmount; |
| | | // @ApiModelProperty(value = "累计电费") |
| | | // private BigDecimal electrovalence; |
| | | // @ApiModelProperty(value = "累计服务费") |
| | | // private BigDecimal serviceCharge; |
| | | // @ApiModelProperty(value = "订单数量") |
| | | // private Integer orderCount; |
| | | // @ApiModelProperty(value = "平台手续费") |
| | | // private BigDecimal commissionAmount; |
| | | // @ApiModelProperty(value = "三方平台分佣") |
| | | // private BigDecimal sharingAmount; |
| | | // @ApiModelProperty(value = "优惠抵扣") |
| | | // private BigDecimal discount; |
| | | // @ApiModelProperty(value = "账单分类 1全站 2各个站点 前端忽略") |
| | | // private String category; |
| | | // @ApiModelProperty(value = "账单类型 月结 前端忽略") |
| | | // private String type; |
| | | // @ApiModelProperty(value = "站点名称 前端忽略") |
| | | // private String siteName; |
| | | // @ApiModelProperty(value = "账单周期 前端忽略") |
| | | // private String billWeek; |
| | | // @ApiModelProperty(value = "账单生成日期 前端忽略") |
| | | // private String createTime; |
| | | // @ApiModelProperty(value = "账单编号 前端忽略") |
| | | // private String code; |
| | | // @ApiModelProperty(value = "充电时长 前端忽略") |
| | | // private String chargingTime; |
| | | |
| | | } |
| | |
| | | private Integer orderCount; |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "实收金额") |
| | | @ApiModelProperty(value = "实收金额(支付结算金额)") |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "退款结算金额") |
| | | private BigDecimal refundAmount; |
| | | @ApiModelProperty(value = "平台分佣") |
| | | private BigDecimal sharingAmount; |
| | | @ApiModelProperty(value = "总金额") |
| | | private BigDecimal orderAmount; |
| | | @ApiModelProperty(value = "累计电费") |
| | |
| | | private BigDecimal serviceCharge; |
| | | @ApiModelProperty(value = "平台手续费") |
| | | private BigDecimal commissionAmount; |
| | | @ApiModelProperty(value = "平台分佣") |
| | | private BigDecimal sharingAmount; |
| | | @ApiModelProperty(value = "充电电流 度") |
| | | private BigDecimal chargingCapacity; |
| | | } |
| | |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "订单总金额") |
| | | private BigDecimal orderAmount; |
| | | @ApiModelProperty(value = "总退款金额") |
| | | private BigDecimal refundAmount; |
| | | @ApiModelProperty(value = "累计电费") |
| | | private BigDecimal electrovalence; |
| | | @ApiModelProperty(value = "累计服务费") |
| | |
| | | public class ChargingOrderListVO { |
| | | @ApiModelProperty(value = "电站名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "充电桩id") |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class TCharingOrderMapVO { |
| | | @ApiModelProperty("上分饼图") |
| | | private List<Map<String,Object>> maps; |
| | | @ApiModelProperty("下方折线图") |
| | | private List<Map<String,Object>> maps1; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class TCharingOrderPowerMapVO { |
| | | @ApiModelProperty("上分折线图") |
| | | List<Map<String,Object>> maps; |
| | | @ApiModelProperty("下方饼图") |
| | | private Map<String,Object> maps1; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class TCharingUserEvaluateVO { |
| | | @ApiModelProperty("评价分") |
| | | Long aver; |
| | | @ApiModelProperty("各个评分数量") |
| | | List<Map<String,Object>> evaluate; |
| | | @ApiModelProperty("差评数量") |
| | | Long blackCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.naming.ldap.PagedResultsControl; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class TCharingUserMapVO { |
| | | @ApiModelProperty("上分折线图") |
| | | private List<Map<String,Object>> map; |
| | | @ApiModelProperty("用户标签") |
| | | private List<Map<String,Object>> userMaps; |
| | | @ApiModelProperty("单位消费") |
| | | private List<Map<String, Object>> untiMap; |
| | | @ApiModelProperty("会员标签") |
| | | private List<Map<String,Object>> vipMaps; |
| | | @ApiModelProperty("车辆用途") |
| | | private List<Map<String, Object>> carMap; |
| | | @ApiModelProperty("车辆品牌") |
| | | private List<Map<String, Object>> carBrandMap; |
| | | @ApiModelProperty("本地车数量") |
| | | private Map<String,Object> localCarMap; |
| | | } |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.account.api.dto.GiveVipDto; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R giveVip(GiveVipDto giveVipDto) { |
| | | return R.fail("赠送会员:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TVip> getInfo1(Integer id) { |
| | | return R.fail("根据会员id 获取会员信息:" + throwable.getMessage()); |
| | | } |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.account.api.dto.GiveVipDto; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/vip/getInfo") |
| | | R<TVip> getInfo(@RequestParam("id") Integer id); |
| | | |
| | | |
| | | @PostMapping(value = "/t-app-user/user/give/vip") |
| | | R giveVip(@RequestBody GiveVipDto giveVipDto); |
| | | } |
| | |
| | | /** |
| | | * 回调地址 |
| | | */ |
| | | private String notifyUrl ="/"; |
| | | private String notifyUrl ="http://192.168.110.80:9000/payment/wx/pay/notify"; |
| | | } |
| | |
| | | private Integer pageSize = 10; |
| | | |
| | | public Integer getPageCurr() { |
| | | if(null != pageCurr){ |
| | | pageCurr = (pageCurr - 1) * pageSize; |
| | | } |
| | | return pageCurr; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.common.core.utils.WebUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.ExportUidDto; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TSettlementConfirm; |
| | | import com.ruoyi.order.api.vo.AccountListVO; |
| | | import com.ruoyi.order.api.vo.ChargingBillListVO; |
| | | |
| | | |
| | |
| | | private final RedisService redisService; |
| | | @Resource |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/downloadBill") |
| | | public R downloadBill(String uid,HttpServletResponse response) |
| | | @PutMapping("/downloadBill") |
| | | public R downloadBill(@RequestBody ExportUidDto uid, HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "下载", tags = {"管理后台-账户结算账单"}) |
| | | @PutMapping("/downloadAccount") |
| | | public R downloadAccount(@RequestBody ChargingListQuery dto,HttpServletResponse response) |
| | | { dto.setPageCurr(1); |
| | | dto.setPageSize(99999999); |
| | | AccountListVO data = orderClient.accountBillList(dto).getData(); |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-disposition"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + |
| | | URLEncoder.encode("账户结算账单", CharEncoding.UTF_8) + ".xlsx"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | try { |
| | | // excel模板封装 |
| | | ExcelWriterBuilder excelWriterBuilder = EasyExcelFactory.write(response.getOutputStream()); |
| | | InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("template/" +"账户结算账单" + ".xlsx"); |
| | | // 自动释放资源 |
| | | try (ExcelWriter excelWriter = excelWriterBuilder.withTemplate(stream).build()) { |
| | | WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
| | | FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); |
| | | excelWriter.fill(new FillWrapper("data1", data.getList().getRecords()), fillConfig, writeSheet); |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | } catch (IOException e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出", tags = {"管理后台-结算汇总表"}) |
| | | @GetMapping("/downloadSettlementTotal") |
| | | public R downloadSettlementTotal(String time,HttpServletResponse response) |
| | | @PutMapping("/downloadSettlementTotal") |
| | | public R downloadSettlementTotal(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | SettlementTotalVO data = chargingOrderClient.settlementTotalR(time).getData(); |
| | | SettlementTotalVO data = chargingOrderClient.settlementTotalR(uid.getTime()).getData(); |
| | | |
| | | |
| | | try { |
| | |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "下载", tags = {"管理后台-结算表记录"}) |
| | | @GetMapping("/downloadSettlement") |
| | | public R downloadSettlement(String uid,HttpServletResponse response) |
| | | @PutMapping("/downloadSettlement") |
| | | public R downloadSettlement(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid).getData(); |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid.getUid()).getData(); |
| | | List<Site> data1 = siteClient.getSiteByIds(Arrays.asList(data.getSiteId())).getData(); |
| | | if (!data1.isEmpty()){ |
| | | data.setSiteName(data1.get(0).getName()); |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/download") |
| | | @PutMapping("/download") |
| | | public R download(String uid,HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordPageInfoVO; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordVO; |
| | | import com.ruoyi.chargingPile.dto.ParkingRecordPageQuery; |
| | | import com.ruoyi.chargingPile.export.TParkingRecordExport; |
| | | import com.ruoyi.chargingPile.service.TParkingLotService; |
| | | import com.ruoyi.chargingPile.service.TParkingRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | 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.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public R<TParkingRecordPageInfoVO> pageList(@RequestBody ParkingRecordQuery query) { |
| | | return R.ok(parkingRecordService.pageList(query)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "导出") |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ParkingRecordQuery query) |
| | | { |
| | | List<TParkingRecordVO> records = parkingRecordService.pageList(query).getParkingRecordVOS().getRecords(); |
| | | List<TParkingRecordExport> orderInvoiceExports = new ArrayList<>(); |
| | | for (TParkingRecordVO orderInvoiceVO : records) { |
| | | TParkingRecordExport orderInvoiceExport = new TParkingRecordExport(); |
| | | BeanUtils.copyProperties(orderInvoiceVO,orderInvoiceExport); |
| | | if (orderInvoiceVO.getFreeDuration()!=null){ |
| | | orderInvoiceExport.setParkingDuration(orderInvoiceVO.getParkingDuration()-orderInvoiceVO.getFreeDuration()); |
| | | }else{ |
| | | orderInvoiceExport.setParkingDuration(orderInvoiceVO.getParkingDuration()); |
| | | } |
| | | if (orderInvoiceVO.getTimeoutAmount()!=null){ |
| | | orderInvoiceExport.setAmount(orderInvoiceVO.getOrderAmount().subtract(orderInvoiceVO.getTimeoutAmount())); |
| | | }else{ |
| | | orderInvoiceExport.setAmount(orderInvoiceVO.getOrderAmount()); |
| | | } |
| | | orderInvoiceExports.add(orderInvoiceExport); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TParkingRecordExport.class, orderInvoiceExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("停车记录.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "详情") |
| | | @GetMapping(value = "/detail") |
| | | public R<TParkingRecord> detail(Long id) { |
| | | |
| | | return R.ok(parkingRecordService.getById(id)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "出场") |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.integration.api.feignClient.SwitchwayGateClient; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | |
| | | public class TVehicleRampController { |
| | | |
| | | private final TVehicleRampService vehicleRampService; |
| | | |
| | | @Resource |
| | | private SwitchwayGateClient switchwayGateClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | public TVehicleRampController(TVehicleRampService vehicleRampService) { |
| | |
| | | @ApiOperation(tags = {"后台-车道"},value = "开关闸车道") |
| | | @PostMapping(value = "/openOrDown") |
| | | public AjaxResult<String> openOrDown(@RequestBody TVehicleRamp dto) { |
| | | // TODO 硬件 开关闸车道 |
| | | return AjaxResult.success(); |
| | | SwitchwayGateReq req = new SwitchwayGateReq(); |
| | | req.setAction(dto.getAction()); |
| | | req.setChannel(dto.getCarportNum()); |
| | | Boolean data = switchwayGateClient.gateService(req).getData(); |
| | | return data ? AjaxResult.success() : AjaxResult.error("操作失败"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "导出充电算帐单-导出") |
| | | public class TParkingRecordExport implements Serializable { |
| | | |
| | | @Excel(name = "账单编号",width = 30) |
| | | private String code; |
| | | @Excel(name = "站点名称",width = 30) |
| | | private String siteName; |
| | | @Excel(name = "出场时间",width = 30) |
| | | private String outParkingTime; |
| | | @Excel(name = "进场时间",width = 30) |
| | | private String inParkingTime; |
| | | @Excel(name = "车牌号",width = 30) |
| | | private String licensePlate; |
| | | @Excel(name = "车辆颜色",width = 30) |
| | | private String vehicleColor; |
| | | @Excel(name = "总费用",width = 30) |
| | | private BigDecimal orderAmount; |
| | | @Excel(name = "超时占位费",width = 30) |
| | | private BigDecimal timeoutAmount; |
| | | @Excel(name = "停车费",width = 30) |
| | | private BigDecimal amount; |
| | | @Excel(name = "免费时长(分钟)",width = 30) |
| | | private Integer freeDuration; |
| | | @Excel(name = "停车总时长(分钟)",width = 30) |
| | | private Integer parkingDuration; |
| | | @Excel(name = "收费时长(分钟)",width = 30) |
| | | private Integer payDuration; |
| | | |
| | | } |
| | |
| | | // 查询站点的停车场id |
| | | if(Objects.nonNull(query.getSiteId())){ |
| | | Site site = siteMapper.selectById(query.getSiteId()); |
| | | if (site!=null){ |
| | | List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class) |
| | | .eq(TParkingLot::getSiteId, site.getId())); |
| | | List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList()); |
| | | query.setLotIds(lotIds); |
| | | } |
| | | |
| | | } |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | // 查询总数 |
| | | TParkingRecordPageInfoVO infoVO = this.baseMapper.getParkingRecordCount(query); |
| | | if (infoVO==null){ |
| | | infoVO = new TParkingRecordPageInfoVO(); |
| | | infoVO.setTimeoutAmountSum(new BigDecimal("0")); |
| | | infoVO.setOrderCount(0); |
| | | infoVO.setParkingDurationSum(0); |
| | | infoVO.setFeeDurationSum(0); |
| | | } |
| | | infoVO.setParkingRecordVOS(pageInfo); |
| | | return infoVO; |
| | | } |
| | |
| | | </if> |
| | | AND status = 3 |
| | | </where> |
| | | group by create_time |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | |
| | | package com.ruoyi.integration.barrierGate.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.integration.barrierGate.model.BaseResponse; |
| | | import com.ruoyi.integration.barrierGate.model.GetCouponReq; |
| | | import com.ruoyi.integration.barrierGate.model.GetCouponResp; |
| | | import com.ruoyi.integration.barrierGate.model.UsedCoupon; |
| | | import com.ruoyi.integration.barrierGate.server.CouponService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/5 11:10 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/coupon") |
| | | public class CouponController { |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getCoupon") |
| | | public BaseResponse<GetCouponResp> getCoupon(@RequestBody GetCouponReq req){ |
| | | log.info("停车获取优惠券请求参数:{}" + JSON.toJSONString(req)); |
| | | GetCouponResp coupon = couponService.getCoupon(req); |
| | | return BaseResponse.ok(coupon); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/usedCoupon") |
| | | public BaseResponse usedCoupon(@RequestBody UsedCoupon req){ |
| | | log.info("停车使用优惠券请求参数:{}" + JSON.toJSONString(req)); |
| | | couponService.usedCoupon(req); |
| | | return BaseResponse.ok(); |
| | | } |
| | |
| | | package com.ruoyi.integration.barrierGate.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.integration.barrierGate.model.*; |
| | | import com.ruoyi.integration.barrierGate.server.ParkingOrderService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/5 16:14 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/parkingOrder") |
| | | public class ParkingOrderController { |
| | |
| | | @ResponseBody |
| | | @PostMapping("/cloudParkingInOrder") |
| | | public BaseResponse cloudParkingInOrder(@RequestBody CloudParkingOrder order){ |
| | | log.info("云停车入场请求参数:{}" + JSON.toJSONString(order)); |
| | | parkingOrderService.cloudParkingInOrder(order); |
| | | return BaseResponse.ok(); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/cloudParkingOutOrder") |
| | | public BaseResponse cloudParkingOutOrder(@RequestBody CloudParkingOrder order){ |
| | | log.info("云停车出场请求参数:{}" + JSON.toJSONString(order)); |
| | | parkingOrderService.cloudParkingOutOrder(order); |
| | | return BaseResponse.ok(); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/cloudParkingSpace") |
| | | public BaseResponse cloudParkingSpace(@RequestBody CloudParkingSpace parkingSpace){ |
| | | log.info("云停车实时车位请求参数:{}" + JSON.toJSONString(parkingSpace)); |
| | | parkingOrderService.cloudParkingSpace(parkingSpace); |
| | | return BaseResponse.ok(); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/offlineParkingInOrder") |
| | | public BaseResponse offlineParkingInOrder(@RequestBody OfflineParkingOrder order){ |
| | | log.info("线下停车场入场请求参数:{}" + JSON.toJSONString(order)); |
| | | parkingOrderService.offlineParkingInOrder(order); |
| | | OfflineParkingResponse offlineParkingResponse = new OfflineParkingResponse(); |
| | | offlineParkingResponse.setCode(0); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/offlineParkingOutOrder") |
| | | public BaseResponse offlineParkingOutOrder(@RequestBody OfflineParkingOrder order){ |
| | | log.info("线下停车场出场请求参数:{}" + JSON.toJSONString(order)); |
| | | parkingOrderService.offlineParkingOutOrder(order); |
| | | OfflineParkingResponse offlineParkingResponse = new OfflineParkingResponse(); |
| | | offlineParkingResponse.setCode(0); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/offlineParkingSpace") |
| | | public BaseResponse offlineParkingSpace(@RequestBody OfflineParkingSpace parkingSpace){ |
| | | log.info("线下停车场实时车位请求参数:{}" + JSON.toJSONString(parkingSpace)); |
| | | parkingOrderService.offlineParkingSpace(parkingSpace); |
| | | return BaseResponse.ok(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.barrierGate.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | import com.ruoyi.integration.barrierGate.server.SwitchwayGateService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 开关道闸 |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/10 9:43 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/switchwayGate") |
| | | public class SwitchwayGateController { |
| | | |
| | | @Resource |
| | | private SwitchwayGateService switchwayGateService; |
| | | |
| | | |
| | | /** |
| | | * 开关道闸 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @PostMapping("/gateService") |
| | | public R<Boolean> gateService(@RequestBody SwitchwayGateReq req){ |
| | | Boolean aBoolean = switchwayGateService.gateService(req); |
| | | return R.ok(aBoolean); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.barrierGate.model; |
| | | |
| | | import com.ruoyi.common.core.utils.MD5Util; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/10 9:45 |
| | | */ |
| | | @Slf4j |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class SwitchwayGate { |
| | | /** |
| | | * 停车场appkey |
| | | */ |
| | | private String appkey; |
| | | /** |
| | | * 开关动作(open:开、close:关) |
| | | */ |
| | | private String action; |
| | | /** |
| | | * 通道编号 |
| | | */ |
| | | private String channel; |
| | | /** |
| | | * 当前时间戳 |
| | | */ |
| | | private String timestamp; |
| | | /** |
| | | * 签名信息:参数升序排序,&拼接所有参数,MD5(参数+&+参数值...+签名密钥)转大写 |
| | | */ |
| | | private String sign; |
| | | |
| | | |
| | | public SwitchwayGate build(String secretkey){ |
| | | String str = String.format("action=%s&appkey=%s&channel=%s×tamp=%s&key=%s", this.getAction(), this.getAppkey(), this.getChannel(), this.getTimestamp(), secretkey); |
| | | log.info("待签名串:{}", str); |
| | | //MD5加密 |
| | | String encoder = MD5Util.getMD5(str); |
| | | //将签名结果转大写 |
| | | encoder = encoder.toUpperCase(); |
| | | log.info("签名结果:{}", encoder); |
| | | this.setSign(encoder); |
| | | return this; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.barrierGate.server; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | import com.ruoyi.integration.barrierGate.model.SwitchwayGate; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/10 9:44 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SwitchwayGateService { |
| | | |
| | | private final String url = "http://8.137.103.127/universal"; |
| | | |
| | | private final String appkey = "886621e841fc44c1ad63a823d"; |
| | | |
| | | private final String secretkey = "7d87c2c36bea4749b30f38f4d"; |
| | | |
| | | |
| | | /** |
| | | * 开关道闸 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | public Boolean gateService(SwitchwayGateReq req){ |
| | | SwitchwayGate switchwayGate = new SwitchwayGate() |
| | | .setAppkey(appkey) |
| | | .setAction(req.getAction()) |
| | | .setChannel(req.getChannel()) |
| | | .setTimestamp(System.currentTimeMillis() + "") |
| | | .build(secretkey); |
| | | String body = JSON.toJSONString(switchwayGate); |
| | | String result = HttpUtil.post(url + "/gateService", body); |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | Boolean success = jsonObject.getBoolean("success"); |
| | | if(!success){ |
| | | log.error("调用开关道闸失败:\n请求参数:{}\n返回结果:{}", body, result); |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | |
| | | // public static void main(String[] args) { |
| | | // SwitchwayGateService switchwayGateService = new SwitchwayGateService(); |
| | | // SwitchwayGateReq req = new SwitchwayGateReq(); |
| | | // req.setAction("close"); |
| | | // req.setChannel("001"); |
| | | // Boolean success = switchwayGateService.gateService(req); |
| | | // if(success){ |
| | | // log.info("调用成功"); |
| | | // }else{ |
| | | // log.info("调用失败"); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | 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.order.api.model.ExportUidDto; |
| | | import com.ruoyi.order.api.model.TChargingBill; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.AccountListVO; |
| | | import com.ruoyi.order.api.vo.ChargingBillListVO; |
| | | import com.ruoyi.order.api.vo.ChargingBillVO; |
| | | import com.ruoyi.order.api.model.ChargingListQuery; |
| | |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | |
| | | @PostMapping(value = "/accountBillList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-账户结算账单"}) |
| | | public R<AccountListVO> accountBillList(@RequestBody ChargingListQuery dto) { |
| | | AccountListVO accountListVO = new AccountListVO(); |
| | | ChargingBillVO res = chargingBillService.chargingBillList(dto); |
| | | |
| | | ChargingBillVO res1 = chargingBillService.chargingBillList(dto); |
| | | List<ChargingBillListVO> records = res1.getList().getRecords(); |
| | | accountListVO.setBillCount(records.size()); |
| | | accountListVO.setTotalAmount(res1.getPaymentAmount().subtract(res1.getRefundAmount()).subtract(res1.getCommissionAmount()).subtract(res1.getSharingAmount())); |
| | | accountListVO.setPaymentAmount(res1.getPaymentAmount()); |
| | | accountListVO.setRefundAmount(res1.getRefundAmount()); |
| | | accountListVO.setCommissionAmount(res1.getCommissionAmount()); |
| | | accountListVO.setSharingAmount(res1.getSharingAmount()); |
| | | accountListVO.setList(res.getList()); |
| | | return R.ok(accountListVO); |
| | | } |
| | | @PostMapping(value = "/chargingBillList") |
| | | @ApiOperation(value = "充电算帐单列表查询", tags = {"管理后台-充电算账单"}) |
| | | public AjaxResult<ChargingBillVO> chargingBillList(@RequestBody ChargingListQuery dto) { |
| | |
| | | return R.ok(null); |
| | | } |
| | | @ApiOperation(value = "导出", tags = {"管理后台-充电算账单"}) |
| | | @PostMapping("/export") |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) |
| | | { |
| | | ChargingBillVO res = chargingBillService.chargingBillList(dto); |
| | |
| | | } |
| | | } |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/download") |
| | | public void download(String uid) |
| | | @PutMapping("/download") |
| | | public void download(@RequestBody ExportUidDto uid) |
| | | { |
| | | List<ChargingBillExport> chargingBillExports = new ArrayList<>(); |
| | | List<ChargingBillRefundExport> chargingBillRefundExports = new ArrayList<>(); |
| | | List<ChargingBillPayExport> chargingBillPayExports = new ArrayList<>(); |
| | | TChargingBill byId = chargingBillService.getById(uid); |
| | | TChargingBill byId = chargingBillService.getById(uid.getUid()); |
| | | ChargingBillExport chargingBillExport = new ChargingBillExport(); |
| | | chargingBillExport.setCode(byId.getCode()); |
| | | // todo 确认商户类型 |
| | |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.dto.SettlementConfirmAdd; |
| | | import com.ruoyi.order.api.model.ChargingListQuery; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TSettlementConfirm; |
| | | import com.ruoyi.order.api.query.SettlementListQuery; |
| | |
| | | import com.ruoyi.order.export.TChargingOrderExport; |
| | | import com.ruoyi.order.vo.ChargingOrderListInfoVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderTimeVO; |
| | | import com.ruoyi.order.api.model.ChargingListQuery; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | |
| | | return AjaxResult.success(res); |
| | | } |
| | | @ApiOperation(value = "充电时段统计-导出", tags = {"管理后台-财务结算"}) |
| | | @PostMapping("/export") |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) |
| | | { |
| | | ChargingOrderTimeVO res = chargingOrderService.chargingList(dto); |
| | |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.order.api.query.TChargingCountQuery; |
| | | import com.ruoyi.order.api.query.UploadRealTimeMonitoringDataQuery; |
| | | import com.ruoyi.order.api.vo.*; |
| | | import com.ruoyi.order.api.vo.ChargingOrderInfoVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.GetChargingOrderByLicensePlate; |
| | |
| | | return chargingOrderService.getRefundList(chargingRefundDto); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/total") |
| | | @ApiOperation(value = "底部数据分类", tags = {"后台-数据分析-平台收入分析"}) |
| | | public R<Map<String,BigDecimal>> total() { |
| | | public R<Map<String,Object>> total() { |
| | | //count近6个月的数据 |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | Map<String,BigDecimal> map = chargingOrderService.countAll(sixBefore); |
| | | Map<String,Object> map = chargingOrderService.countAll(sixBefore); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore).getData(); |
| | | map.put("parkingAmount",data); |
| | | BigDecimal data1 = shoppingOrderService.getSumAmount(sixBefore); |
| | |
| | | |
| | | |
| | | |
| | | // @ResponseBody |
| | | // @PostMapping(value = "/charging/statistics") |
| | | // @ApiOperation(value = "统计", tags = {"管理后台-数据分析-充电运营分析"}) |
| | | // public R<TCharingOrderVO> watchChargingOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){ |
| | | // List<Integer> siteIds =new ArrayList<>(); |
| | | // if (statisticsQueryDto.getSiteId()==null) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // //获取当前登录的siteIds |
| | | // List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData(); |
| | | // for (GetSiteListDTO datum : data) { |
| | | // siteIds.add(datum.getId()); |
| | | // } |
| | | // }else { |
| | | // siteIds.add(statisticsQueryDto.getSiteId()); |
| | | // } |
| | | // |
| | | // |
| | | // LocalDate start = null; |
| | | // LocalDate end = null; |
| | | // if (statisticsQueryDto.getDayType()==1){ |
| | | // start = LocalDate.now(); |
| | | // |
| | | // }else if (statisticsQueryDto.getDayType()==2){ |
| | | // LocalDate today = LocalDate.now(); |
| | | // |
| | | // // 获取本周一的日期 |
| | | // LocalDate mondayThisWeek = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)); |
| | | // |
| | | // System.out.println("本周一是: " + mondayThisWeek); |
| | | // } |
| | | // else if (statisticsQueryDto.getDayType()==3){ |
| | | // // 获取当前日期 |
| | | // LocalDate today = LocalDate.now(); |
| | | // |
| | | // // 获取本月1号的日期 |
| | | // YearMonth yearMonth = YearMonth.from(today); |
| | | // start = yearMonth.atDay(1); |
| | | // |
| | | // System.out.println("本月1号是: " + start); |
| | | // }else if (statisticsQueryDto.getDayType()==4){ |
| | | // LocalDate today = LocalDate.now(); |
| | | // // 获取当前年份 |
| | | // int currentYear = today.getYear(); |
| | | // // 获取今年1月1日的日期 |
| | | // start = LocalDate.of(currentYear, 1, 1); |
| | | // System.out.println("今年1月1日是: " + start); |
| | | // }else if (statisticsQueryDto.getDayType()==5){ |
| | | // |
| | | // // 获取今年1月1日的日期 |
| | | // start = statisticsQueryDto.getStartTime(); |
| | | // end = statisticsQueryDto.getEndTime(); |
| | | // } |
| | | // List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list(); |
| | | // List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | // //上方饼图 |
| | | // List<Map<String,BigDecimal>> maps = chargingOrderService.getSumByType(chargingOrderIds); |
| | | // |
| | | // if (statisticsQueryDto.getDayType()==1){ |
| | | // List<Map<String,BigDecimal>> maps1 = chargingOrderService.getDateData(chargingOrderIds); |
| | | // |
| | | // }else if (statisticsQueryDto.getDayType()==2){ |
| | | // List<Map<String,BigDecimal>> maps1 = chargingOrderService.getWeekData(chargingOrderIds); |
| | | // }else if (statisticsQueryDto.getDayType()==3){ |
| | | // List<Map<String,BigDecimal>> maps1 = chargingOrderService.getMonthData(chargingOrderIds); |
| | | // }else if (statisticsQueryDto.getDayType()==4){ |
| | | // List<Map<String,BigDecimal>> maps1 = chargingOrderService.getYearData(chargingOrderIds); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/statistics") |
| | | @ApiOperation(value = "统计,充电订单分析", tags = {"管理后台-数据分析-充电运营分析"}) |
| | | public R<TCharingOrderMapVO> watchChargingOrder(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){ |
| | | List<Integer> siteIds =new ArrayList<>(); |
| | | if (statisticsQueryDto.getSiteId()==null) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | //获取当前登录的siteIds |
| | | List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData(); |
| | | for (GetSiteListDTO datum : data) { |
| | | siteIds.add(datum.getId()); |
| | | } |
| | | }else { |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | TCharingOrderMapVO tCharingOrderMapVO = new TCharingOrderMapVO(); |
| | | |
| | | |
| | | LocalDate start = null; |
| | | LocalDate end = null; |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | start = LocalDate.now(); |
| | | |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | // 获取本周一的日期 |
| | | LocalDate mondayThisWeek = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)); |
| | | |
| | | System.out.println("本周一是: " + mondayThisWeek); |
| | | } |
| | | else if (statisticsQueryDto.getDayType()==3){ |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | // 获取本月1号的日期 |
| | | YearMonth yearMonth = YearMonth.from(today); |
| | | start = yearMonth.atDay(1); |
| | | |
| | | System.out.println("本月1号是: " + start); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取当前年份 |
| | | int currentYear = today.getYear(); |
| | | // 获取今年1月1日的日期 |
| | | start = LocalDate.of(currentYear, 1, 1); |
| | | System.out.println("今年1月1日是: " + start); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | |
| | | // 获取今年1月1日的日期 |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | } |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list(); |
| | | List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | //上方饼图 |
| | | List<Map<String,Object>> maps = chargingOrderService.getSumByType(chargingOrderIds); |
| | | |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getDateData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | }else if (statisticsQueryDto.getDayType()==3){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | } |
| | | |
| | | |
| | | tCharingOrderMapVO.setMaps(maps); |
| | | |
| | | |
| | | return R.ok(tCharingOrderMapVO); |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/power") |
| | | @ApiOperation(value = "功率", tags = {"管理后台-数据分析-充电运营分析"}) |
| | | public R<TCharingOrderPowerMapVO> power(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto) { |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | if (statisticsQueryDto.getSiteId() == null) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | //获取当前登录的siteIds |
| | | List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData(); |
| | | for (GetSiteListDTO datum : data) { |
| | | siteIds.add(datum.getId()); |
| | | } |
| | | } else { |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | List<Map<String,Object>> maps1 = chargingOrderService.queryPower(siteIds); |
| | | |
| | | |
| | | Map<String,Object> map = chargingOrderService.qureryPowerLevel(siteIds,statisticsQueryDto); |
| | | |
| | | TCharingOrderPowerMapVO tCharingOrderPowerMapVO = new TCharingOrderPowerMapVO(); |
| | | tCharingOrderPowerMapVO.setMaps1(map); |
| | | tCharingOrderPowerMapVO.setMaps(maps1); |
| | | return R.ok(tCharingOrderPowerMapVO); |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/users") |
| | | @ApiOperation(value = "除电站流量外", tags = {"管理后台-数据分析-充电用户分析"}) |
| | | public R<TCharingUserMapVO> users(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){ |
| | | |
| | | TCharingUserMapVO tCharingUserMapVO = new TCharingUserMapVO(); |
| | | //上方折现 |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | List<Map<String,Object>> map = chargingOrderService.usersDay(); |
| | | tCharingUserMapVO.setMap(map); |
| | | }else { |
| | | List<Map<String,Object>> map = chargingOrderService.usersByQuery(statisticsQueryDto); |
| | | tCharingUserMapVO.setMap(map); |
| | | } |
| | | |
| | | //用户标签 |
| | | List<Map<String,Object>> maps = chargingOrderService.getUserTagCount(); |
| | | //会员标签 |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getVipCount(); |
| | | |
| | | //单位消费 |
| | | List<Map<String, Object>> untiMap = chargingOrderService.unitConsumption(statisticsQueryDto); |
| | | |
| | | //车辆用途 |
| | | List<Map<String, Object>> carMap = chargingOrderService.carUserMethod(); |
| | | //车辆品牌 |
| | | List<Map<String, Object>> carBrandMap = chargingOrderService.carUserBrand(); |
| | | //本地车数量 |
| | | Map<String,Object> localCarMap = chargingOrderService.countLocalCar(); |
| | | |
| | | |
| | | tCharingUserMapVO.setUserMaps(maps); |
| | | tCharingUserMapVO.setVipMaps(maps1); |
| | | tCharingUserMapVO.setUntiMap(untiMap); |
| | | tCharingUserMapVO.setCarMap(carMap); |
| | | tCharingUserMapVO.setCarBrandMap(carBrandMap); |
| | | tCharingUserMapVO.setLocalCarMap(localCarMap); |
| | | return R.ok(tCharingUserMapVO); |
| | | |
| | | } |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/sites") |
| | | @ApiOperation(value = "电站评价", tags = {"管理后台-数据分析-充电用户分析"}) |
| | | public R<TCharingUserEvaluateVO> sites(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){ |
| | | List<Integer> siteIds =new ArrayList<>(); |
| | | if (statisticsQueryDto.getSiteId()==null) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | //获取当前登录的siteIds |
| | | List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData(); |
| | | for (GetSiteListDTO datum : data) { |
| | | siteIds.add(datum.getId()); |
| | | } |
| | | }else { |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | //查询评价分 |
| | | Long aver = chargingOrderService.getAver(siteIds); |
| | | //查询各个分数 |
| | | List<Map<String,Object>> evaluate = chargingOrderService.getLevelEvaluate(siteIds); |
| | | //查询差评回复数 |
| | | Long count = orderEvaluateService.lambdaQuery().isNotNull(TOrderEvaluate::getResponseTime).count(); |
| | | TCharingUserEvaluateVO tCharingUserEvaluateVO = new TCharingUserEvaluateVO(); |
| | | tCharingUserEvaluateVO.setAver(aver); |
| | | tCharingUserEvaluateVO.setEvaluate(evaluate); |
| | | tCharingUserEvaluateVO.setBlackCount(count); |
| | | |
| | | |
| | | |
| | | //标签 |
| | | //查出好评ids |
| | | // orderEvaluateService.goodTop(); |
| | | |
| | | |
| | | |
| | | |
| | | //流量 |
| | | return R.ok(tCharingUserEvaluateVO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // 示例数据 |
| | |
| | | |
| | | List<SixCircleDto> circle(@Param("siteIds")List<Integer> siteIds,@Param("sixBefore")LocalDate sixBefore); |
| | | |
| | | Map<String, BigDecimal> countAll(@Param("sixBefore")LocalDate sixBefore); |
| | | Map<String, Object> countAll(@Param("sixBefore")LocalDate sixBefore); |
| | | |
| | | List<Map<String, BigDecimal>> getSumByType(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getSumByType(@Param("chargingOrderIds")List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getDateData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getDateData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getWeekData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getWeekData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getMonthData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getMonthData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getYearData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getYearData(List<Long> chargingOrderIds); |
| | | |
| | | List<ChargingOrderListVO> chargingList(@Param("pageInfo")PageInfo<ChargingOrderListVO> pageInfo, @Param("req") ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | List<ChargingOrderListVO> chargingList1( @Param("req")ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | List<ChargingOrderListVO> chargingListNoPage( @Param("req")ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | |
| | | List<Map<String, Object>> getByDate(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, Object>> queryPower(List<Integer> siteIds); |
| | | |
| | | Map<String, Object> queryPowerLevel(@Param("siteIds") List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> usersDay(); |
| | | |
| | | List<Map<String, Object>> usersByQuery(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> getUserTagCount(); |
| | | |
| | | List<Map<String, Object>> getVipCount(); |
| | | |
| | | List<Map<String, Object>> unitConsumption(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> carUserMethod(); |
| | | |
| | | List<Map<String, Object>> carUserBrand(); |
| | | |
| | | Map<String, Object> countLocalCar(); |
| | | |
| | | Long getAver(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getLevelEvaluate(List<Integer> siteIds); |
| | | } |
| | |
| | | |
| | | List<SixCircleDto> circle(List<Integer> siteIds,LocalDate sixBefore); |
| | | |
| | | Map<String, BigDecimal> countAll(LocalDate sixBefore); |
| | | Map<String, Object> countAll(LocalDate sixBefore); |
| | | |
| | | List<Map<String, BigDecimal>> getSumByType(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getSumByType(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getDateData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getDateData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getWeekData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getWeekData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getMonthData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getMonthData(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, BigDecimal>> getYearData(List<Long> chargingOrderIds); |
| | | List<Map<String, Object>> getYearData(List<Long> chargingOrderIds); |
| | | |
| | | ChargingOrderTimeVO chargingList(ChargingListQuery dto); |
| | | |
| | |
| | | */ |
| | | void excelEndCharge(String orderCode); |
| | | |
| | | List<Map<String, Object>> getByDate(List<Long> chargingOrderIds); |
| | | |
| | | List<Map<String, Object>> queryPower(List<Integer> siteIds); |
| | | |
| | | Map<String, Object> qureryPowerLevel(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> usersDay(); |
| | | |
| | | List<Map<String, Object>> usersByQuery(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | |
| | | List<Map<String, Object>> getUserTagCount(); |
| | | |
| | | List<Map<String, Object>> getVipCount(); |
| | | |
| | | List<Map<String, Object>> unitConsumption(ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | List<Map<String, Object>> carUserMethod(); |
| | | |
| | | List<Map<String, Object>> carUserBrand(); |
| | | |
| | | Map<String, Object> countLocalCar(); |
| | | |
| | | Long getAver(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getLevelEvaluate(List<Integer> siteIds); |
| | | |
| | | |
| | | /** |
| | | * 根据车牌号和开始时间查询充电数据 |
| | |
| | | BigDecimal sharingAmountTotal = new BigDecimal("0"); |
| | | BigDecimal chargingCapacityTotal = new BigDecimal("0"); |
| | | BigDecimal discountTotal = new BigDecimal("0"); |
| | | BigDecimal refundAmount = new BigDecimal("0"); |
| | | int orderCount = 0; |
| | | for (ChargingBillListVO chargingBillListVO : list) { |
| | | String temp = ""; |
| | |
| | | electrovalence = electrovalence.add(tChargingOrder.getElectrovalence()); |
| | | electrovalenceTotal = electrovalenceTotal.add(tChargingOrder.getElectrovalence()); |
| | | } |
| | | if (tChargingOrder.getRefundAmount()!=null && tChargingOrder.getRefundStatus() == 2){ |
| | | refundAmount = refundAmount.add(tChargingOrder.getRefundAmount()); |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | | serviceCharge = serviceCharge.add(tChargingOrder.getServiceCharge()); |
| | |
| | | model.setOut_trade_no(chargingOrder.getCode()); |
| | | model.setOut_refund_no(chargingOrderRefund.getRefundCode()); |
| | | model.setReason("充电失败,取消充电订单"); |
| | | model.setNotify_url("http://127.0.0.1:9000/order/t-charging-order/chargingOrderStartupFailureWxRefund"); |
| | | model.setNotify_url("http://221.182.45.100:9000/order/t-charging-order/chargingOrderStartupFailureWxRefund"); |
| | | WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount(); |
| | | amount.setRefund(rechargeAmount.multiply(new BigDecimal(100)).intValue()); |
| | | amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue()); |
| | |
| | | model.setOut_trade_no(chargingOrder.getCode()); |
| | | model.setOut_refund_no(chargingOrderRefund.getRefundCode()); |
| | | model.setReason("充电完成退款"); |
| | | model.setNotify_url("http://127.0.0.1:9000/order/t-charging-order/chargingOrderStartupFailureWxRefund"); |
| | | model.setNotify_url("http://221.182.45.100:9000/order/t-charging-order/chargingOrderStartupFailureWxRefund"); |
| | | WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount(); |
| | | amount.setRefund(refundAmount.multiply(new BigDecimal(100)).intValue()); |
| | | amount.setTotal(rechargeAmount.multiply(new BigDecimal(100)).intValue()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, BigDecimal> countAll(LocalDate sixBefore) { |
| | | public Map<String, Object> countAll(LocalDate sixBefore) { |
| | | return this.baseMapper.countAll(sixBefore); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, BigDecimal>> getSumByType(List<Long> chargingOrderIds) { |
| | | public List<Map<String, Object>> getSumByType(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getSumByType(chargingOrderIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, BigDecimal>> getDateData(List<Long> chargingOrderIds) { |
| | | public List<Map<String, Object>> getDateData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getDateData(chargingOrderIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, BigDecimal>> getWeekData(List<Long> chargingOrderIds) { |
| | | public List<Map<String, Object>> getWeekData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getWeekData(chargingOrderIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, BigDecimal>> getMonthData(List<Long> chargingOrderIds) { |
| | | public List<Map<String, Object>> getMonthData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getMonthData(chargingOrderIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, BigDecimal>> getYearData(List<Long> chargingOrderIds) { |
| | | public List<Map<String, Object>> getYearData(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getYearData(chargingOrderIds); |
| | | } |
| | | @Resource |
| | |
| | | if (!data.isEmpty()) { |
| | | chargingOrderListVO.setSiteName(data.get(0).getName()); |
| | | } |
| | | if (chargingOrderListVO.getChargingGunId()!=null && chargingOrderListVO.getChargingPileId()!=null){ |
| | | TChargingGun data1 = chargingGunClient.getChargingGunById(chargingOrderListVO.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderListVO.getChargingPileId()).getData(); |
| | | if (data2 != null && data1 != null) { |
| | | chargingOrderListVO.setTerminalName(data2.getName() + "-" + data1.getName()); |
| | | } |
| | | } |
| | | // 获取充电时间 |
| | | UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrderListVO.getCode()).getData(); |
| | |
| | | } |
| | | } |
| | | // 获取开始SOC 结束soc |
| | | if (chargingOrderListVO.getCode()!=null){ |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrderListVO.getCode()).getData(); |
| | | if (!data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | } |
| | | } |
| | | |
| | | if (chargingOrderListVO.getAppUserId()!=null){ |
| | | TAppUser data3 = appUserClient.getUserById(chargingOrderListVO.getAppUserId()).getData(); |
| | | List<Long> carId = new ArrayList<>(); |
| | | if (data3!=null){ |
| | | if (chargingOrderListVO.getAppUserCarId() != null) { |
| | | carId.add(chargingOrderListVO.getAppUserCarId()); |
| | | if (!carId.isEmpty()){ |
| | | List<TAppUserCar> data4 = appUserCarClient.getCarByIds(carId).getData(); |
| | | if (!data4.isEmpty()) chargingOrderListVO.setLicensePlate(data4.get(0).getLicensePlate()); |
| | | if (data4!=null && !data4.isEmpty()) chargingOrderListVO.setLicensePlate(data4.get(0).getLicensePlate()); |
| | | } |
| | | } |
| | | if (data3 != null) chargingOrderListVO.setPhone(data3.getPhone()); |
| | | |
| | | } |
| | | } |
| | | List<TChargingOrderAccountingStrategy> list2 = chargingOrderAccountingStrategyService.lambdaQuery() |
| | | .eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrderListVO.getId()).list(); |
| | | // 尖峰平谷充电量 度数 |
| | |
| | | } |
| | | } |
| | | total = total.add(jian).add(feng).add(ping).add(gu); |
| | | if (total.compareTo(new BigDecimal("0")) != 0){ |
| | | chargingOrderListVO.setElectronicProportion( |
| | | jian.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(尖)/" |
| | | +feng.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(峰)/" |
| | | +ping.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(平)/" |
| | | +gu.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(谷)"); |
| | | }else{ |
| | | chargingOrderListVO.setElectronicProportion( |
| | | "0"+"%(尖)/"+ |
| | | "0"+"%(峰)/"+ |
| | | "0"+"%(平)/"+ |
| | | "0"+"%(谷)"); |
| | | } |
| | | |
| | | } |
| | | // 不分页 |
| | | List<ChargingOrderListVO> list1 = this.baseMapper.chargingList1(dto,startTime1,startTime2,endTime1,endTime2); |
| | | PageInfo<ChargingOrderListVO> pageInfo1 = new PageInfo<>(1,999999999); |
| | | List<ChargingOrderListVO> list1 = this.baseMapper.chargingList(pageInfo1,dto,startTime1,startTime2,endTime1,endTime2); |
| | | chargingOrderTimeVO.setExportList(list1); |
| | | chargingOrderTimeVO.setOrderCount(list1.size()); |
| | | // 计算充电总度数 |
| | |
| | | BigDecimal ping = new BigDecimal("0"); |
| | | BigDecimal gu = new BigDecimal("0"); |
| | | for (ChargingOrderListVO chargingOrderListVO : list1) { |
| | | electronic = electronic.add(chargingOrderListVO.getChargingCapacity()); |
| | | paymentAmount = paymentAmount.add(chargingOrderListVO.getPaymentAmount()); |
| | | electrovalence = electrovalence.add(chargingOrderListVO.getElectrovalence()); |
| | | serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge()); |
| | | if (chargingOrderListVO.getChargingCapacity()!=null)electronic = electronic.add(chargingOrderListVO.getChargingCapacity()); |
| | | |
| | | if (chargingOrderListVO.getPaymentAmount()!=null)paymentAmount = paymentAmount.add(chargingOrderListVO.getPaymentAmount()); |
| | | if (chargingOrderListVO.getElectrovalence()!=null)electrovalence = electrovalence.add(chargingOrderListVO.getElectrovalence()); |
| | | if (chargingOrderListVO.getServiceCharge()!=null)serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge()); |
| | | List<TChargingOrderAccountingStrategy> list2 = chargingOrderAccountingStrategyService.lambdaQuery() |
| | | .eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrderListVO.getId()).list(); |
| | | for (TChargingOrderAccountingStrategy temp : list2) { |
| | | switch (temp.getType()){ |
| | | case 1: |
| | | jian = jian.add(temp.getChargingCapacity()); |
| | | jianElectronic = jianElectronic.add(temp.getChargingCapacity()); |
| | | jianService = jianService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)jian = jian.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)jianService = jianService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 2: |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | fengElectronic = fengElectronic.add(temp.getChargingCapacity()); |
| | | fengService = fengService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)feng = feng.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)fengService = fengService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 3: |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | pingElectronic = pingElectronic.add(temp.getChargingCapacity()); |
| | | pingService = pingService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)ping = ping.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)pingService = pingService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 4: |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | guElectronic = guElectronic.add(temp.getChargingCapacity()); |
| | | guService = guService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)gu = gu.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)guService = guService.add(temp.getServiceCharge()); |
| | | break; |
| | | } |
| | | } |
| | |
| | | BigDecimal add1 = jianService.add(fengService).add(pingService).add(guService); |
| | | // 计算尖峰平谷充电到账占比 |
| | | BigDecimal add2 = jian.add(feng).add(ping).add(gu); |
| | | if (add.compareTo(new BigDecimal("0"))!=0){ |
| | | chargingOrderTimeVO.setCapacityProportion(jianElectronic+"度/"+fengElectronic+"度/"+pingElectronic+"度/"+guElectronic+"度-" |
| | | +jianElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +fengElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | |
| | | +feng.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +ping.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +gu.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%"); |
| | | }else{ |
| | | chargingOrderTimeVO.setCapacityProportion(jianElectronic+"度/"+fengElectronic+"度/"+pingElectronic+"度/"+guElectronic+"度-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | chargingOrderTimeVO.setServiceProportion(jianService+"元/"+fengService+"元/"+pingService+"元/"+guService+"元-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | chargingOrderTimeVO.setElectronicProportion(jian+"元/"+feng+"元/"+ping+"元/"+gu+"元-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | chargingOrderTimeVO.setList(pageInfo); |
| | | return chargingOrderTimeVO; |
| | | } |
| | |
| | | chargingOrderListInfoVO.setSiteName(data.get(0).getName()); |
| | | chargingOrderListInfoVO.setSiteAddress(data.get(0).getAddress()); |
| | | } |
| | | if (chargingOrder.getChargingGunId()!=null){ |
| | | TChargingGun data1 = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(data1.getChargingPileId()).getData(); |
| | | |
| | | if (data1!=null){ |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(data1.getChargingPileId()).getData(); |
| | | if (data2!=null){ |
| | | chargingOrderListInfoVO.setGunCode(data1.getCode()); |
| | | chargingOrderListInfoVO.setTerminalName(data2.getName()+data1.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | chargingOrderListInfoVO.setEndMode(chargingOrder.getEndMode()); |
| | | |
| | | // 获取开始SOC 结束soc |
| | | if (chargingOrder.getCode()!=null){ |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrder.getCode()).getData(); |
| | | if (data6!=null){ |
| | | if (!data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListInfoVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListInfoVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | chargingOrderListInfoVO.setChargingCapacity(data6.get(data6.size()-1).getCharging_degree()); |
| | | chargingOrderListInfoVO.setChargingSecond(data6.get(data6.size()-1).getCumulative_charging_time()*60+""); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) { |
| | | uploadRealTimeMonitoringData.setCreateTime(simpleDateFormat.format(uploadRealTimeMonitoringData.getCreate_time())); |
| | | } |
| | | } |
| | | } |
| | | chargingOrderListInfoVO.setList(data6); |
| | | } |
| | | |
| | | |
| | | if (chargingOrder.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(chargingOrder.getAppUserCarId())).getData(); |
| | | if (!data3.isEmpty())chargingOrderListInfoVO.setLicensePlate(data3.get(0).getLicensePlate()); |
| | | if (data3!=null && !data3.isEmpty())chargingOrderListInfoVO.setLicensePlate(data3.get(0).getLicensePlate()); |
| | | } |
| | | chargingOrderListInfoVO.setStartTime(chargingOrder.getStartTime()); |
| | | chargingOrderListInfoVO.setEndTime(chargingOrder.getEndTime()); |
| | | chargingOrderListInfoVO.setId(chargingOrder.getId()); |
| | | chargingOrderListInfoVO.setUid(chargingOrder.getId().toString()); |
| | | chargingOrderListInfoVO.setList(data6); |
| | | chargingOrderListInfoVO.setCouponDiscountAmount(chargingOrder.getCouponDiscountAmount()); |
| | | chargingOrderListInfoVO.setVipDiscountAmount(chargingOrder.getVipDiscountAmount()); |
| | | chargingOrderListInfoVO.setSharingAmount(chargingOrder.getSharingAmount()); |
| | |
| | | endCharge(orderCode, 0); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getByDate(List<Long> chargingOrderIds) { |
| | | return this.baseMapper.getByDate(chargingOrderIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryPower(List<Integer> siteIds) { |
| | | return this.baseMapper.queryPower(siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> qureryPowerLevel(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto) { |
| | | return this.baseMapper.queryPowerLevel(siteIds,statisticsQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryOrderCountAndMoneyBySiteIdDate(List<Integer> siteIds) { |
| | | return this.baseMapper.queryOrderCountAndMoneyBySiteIdDate(siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> usersDay() { |
| | | return this.baseMapper.usersDay(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> usersByQuery(ChargingStatisticsQueryDto statisticsQueryDto) { |
| | | return this.baseMapper.usersByQuery(statisticsQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserTagCount() { |
| | | return this.baseMapper.getUserTagCount(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getVipCount() { |
| | | return this.baseMapper.getVipCount(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> unitConsumption(ChargingStatisticsQueryDto statisticsQueryDto) { |
| | | return this.baseMapper.unitConsumption(statisticsQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> carUserMethod() { |
| | | return this.baseMapper.carUserMethod(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> carUserBrand() { |
| | | return this.baseMapper.carUserBrand(); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> countLocalCar() { |
| | | return this.baseMapper.countLocalCar(); |
| | | } |
| | | |
| | | @Override |
| | | public Long getAver(List<Integer> siteIds) { |
| | | return this.baseMapper.getAver(siteIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getLevelEvaluate(List<Integer> siteIds) { |
| | | return this.baseMapper.getLevelEvaluate(siteIds); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | model.setOut_refund_no(chargingOrderRefund.getRefundCode()); |
| | | model.setTransaction_id(tChargingOrder.getRechargeSerialNumber()); |
| | | model.setReason("取消订单"); |
| | | model.setNotify_url("http://127.0.0.1:9000/order/t-shopping-order/cancelShoppingOrderWxRefund"); |
| | | model.setNotify_url("http://221.182.45.100:9000/order/t-shopping-order/cancelShoppingOrderWxRefund"); |
| | | WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount(); |
| | | amount.setRefund(payOrderQueryDto.getRefundAmount().multiply(new BigDecimal(100)).intValue()); |
| | | amount.setTotal(tChargingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue()); |
| | |
| | | model.setTransaction_id(shoppingOrder.getSerialNumber()); |
| | | model.setOut_refund_no(shoppingOrderRefund.getRefundCode()); |
| | | model.setReason("取消订单"); |
| | | model.setNotify_url("http://127.0.0.1:9000/order/t-shopping-order/cancelShoppingOrderWxRefund"); |
| | | model.setNotify_url("http://221.182.45.100:9000/order/t-shopping-order/cancelShoppingOrderWxRefund"); |
| | | WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount(); |
| | | amount.setRefund(refundAmount.multiply(new BigDecimal(100)).intValue()); |
| | | amount.setTotal(shoppingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue()); |
| | |
| | | giveVipDto.setUserIds(tVipOrder.getAppUserId().toString()); |
| | | giveVipDto.setVipId(tVipOrder.getVipId()); |
| | | giveVipDto.setType(tVipOrder.getVipType()); |
| | | // vipClient.giveVip(giveVipDto); |
| | | vipClient.giveVip(giveVipDto); |
| | | } |
| | | } |
| | |
| | | private String terminalName; |
| | | @ApiModelProperty(value = "结束原因 (0=异常终止,1=主动终止,2=满电终止,3=费用不足终止)") |
| | | private Integer endMode; |
| | | @ApiModelProperty(value = "状态(-1=启动失败,取消订单,0=未知,1=等待中,2=启动中,3=充电中,4=停止中,5=已结束)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "开始soc") |
| | | private String startSoc; |
| | | @ApiModelProperty(value = "结束soc") |
| | |
| | | and t1.status = #{req.state} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.bill_time between #{startTime1} and #{startTime2} |
| | | and (t1.bill_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="req.uid != null and req.uid!=''"> |
| | | and t1.id = #{req.uid} |
| | |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | <where> |
| | |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | <where> |
| | |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | <where> |
| | |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | <where> |
| | |
| | | ORDER BY |
| | | time |
| | | |
| | | |
| | | </select> |
| | | <select id="getByDate" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(electrovalence) as electrovalence, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | | <where> |
| | | del_flag = 0 and recharge_payment_status = 2 and ISNULL(refund_status) |
| | | <if test="chargingOrderIds != null and chargingOrderIds.size() > 0"> |
| | | AND id IN |
| | | <foreach collection="chargingOrderIds" item="chargingOrderId" open="(" separator="," close=")"> |
| | | #{chargingOrderId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | time |
| | | ORDER BY |
| | | time |
| | | |
| | | </select> |
| | | <select id="queryPower" resultType="java.util.Map"> |
| | | SELECT |
| | | 'today' AS data_type, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d %H') AS TIME, |
| | | SUM(power) AS power |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL(refund_status) |
| | | AND DATE(create_time) = CURDATE() |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | TIME |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | 'yesterday' AS data_type, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d %H') AS TIME, |
| | | SUM(power) AS power |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL(refund_status) |
| | | AND DATE(create_time) = CURDATE() - INTERVAL 1 DAY |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | TIME |
| | | |
| | | ORDER BY |
| | | TIME; |
| | | |
| | | |
| | | </select> |
| | | <select id="queryPowerLevel" resultType="java.util.Map"> |
| | | SELECT |
| | | count(CASE WHEN power BETWEEN 0 AND 30 THEN 1 ELSE 0 END) AS count_0_30, |
| | | count(CASE WHEN power BETWEEN 31 AND 60 THEN 1 ELSE 0 END) AS count_31_60, |
| | | count(CASE WHEN power BETWEEN 61 AND 120 THEN 1 ELSE 0 END) AS count_61_120, |
| | | count(CASE WHEN power BETWEEN 121 AND 300 THEN 1 ELSE 0 END) AS count_121_300, |
| | | count(CASE WHEN power > 300 THEN 1 ELSE 0 END) AS count_above_300 |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL(refund_status) |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =1"> |
| | | AND DATE(create_time) = CURDATE() |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =2"> |
| | | AND WEEKOFYEAR(create_time) = WEEKOFYEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =3"> |
| | | AND MONTH(create_time) = MONTH(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =4"> |
| | | AND YEAR(create_time) = YEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | |
| | | </select> |
| | | <select id="usersDay" resultType="java.util.Map"> |
| | | SELECT |
| | | 'today' AS data_type, |
| | | '1' as type, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) AS TIME, |
| | | count(DISTINCT app_user_id) AS counts |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL( refund_status ) |
| | | AND DATE ( create_time ) = CURDATE() |
| | | GROUP BY |
| | | TIME |
| | | UNION all |
| | | SELECT |
| | | 'today' AS data_type, |
| | | '2' as type, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) AS TIME, |
| | | count(1) AS counts |
| | | FROM |
| | | charging_pile_account.t_app_user |
| | | WHERE |
| | | del_flag = 0 |
| | | AND DATE ( create_time ) = CURDATE() |
| | | GROUP BY |
| | | TIME |
| | | </select> |
| | | <select id="usersByQuery" resultType="java.util.Map"> |
| | | SELECT |
| | | 'today' AS data_type, |
| | | '1' as type, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) AS TIME, |
| | | count(DISTINCT app_user_id) AS counts |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL( refund_status ) |
| | | <if test="statisticsQueryDto.dayType =1 "> |
| | | AND DATE(create_time) = CURDATE() |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =2 "> |
| | | AND WEEKOFYEAR(create_time) = WEEKOFYEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =3 "> |
| | | AND MONTH(create_time) = MONTH(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =4"> |
| | | AND YEAR(create_time) = YEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY |
| | | TIME |
| | | UNION all |
| | | SELECT |
| | | 'today' AS data_type, |
| | | '2' as type, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) AS TIME, |
| | | count(1) AS counts |
| | | FROM |
| | | charging_pile_account.t_app_user |
| | | WHERE |
| | | del_flag = 0 |
| | | <if test="statisticsQueryDto.dayType =1 "> |
| | | AND DATE(create_time) = CURDATE() |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =2 "> |
| | | AND WEEKOFYEAR(create_time) = WEEKOFYEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =3 "> |
| | | AND MONTH(create_time) = MONTH(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =4"> |
| | | AND YEAR(create_time) = YEAR(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType =5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY |
| | | TIME |
| | | |
| | | |
| | | </select> |
| | | <select id="getUserTagCount" resultType="java.util.Map"> |
| | | SELECT user_tag_id,COUNT(1) as count from ( |
| | | SELECT |
| | | a.app_user_id, |
| | | a.user_tag_id, |
| | | a.create_time |
| | | FROM |
| | | charging_pile_account.t_app_user_tag a |
| | | JOIN ( |
| | | SELECT |
| | | app_user_id, |
| | | MAX(create_time) AS max_create_time |
| | | FROM |
| | | charging_pile_account.t_app_user_tag |
| | | GROUP BY |
| | | app_user_id |
| | | ) b ON a.app_user_id = b.app_user_id AND a.create_time = b.max_create_time |
| | | ) o |
| | | GROUP BY o.user_tag_id |
| | | </select> |
| | | <select id="getVipCount" resultType="java.util.Map"> |
| | | SELECT vip_id,count(1) as Counts |
| | | FROM charging_pile_account.t_app_user |
| | | WHERE del_flag = 0 |
| | | GROUP BY vip_id |
| | | </select> |
| | | <select id="unitConsumption" resultType="java.util.Map"> |
| | | SELECT |
| | | au.company_id as companyId, |
| | | SUM( co.charging_capacity ) as chargingCapacity |
| | | FROM |
| | | charging_pile_order.t_charging_order co |
| | | LEFT JOIN charging_pile_account.t_app_user au ON co.app_user_id = au.id |
| | | <where> |
| | | co.del_flag = 0 |
| | | <if test="statisticsQueryDto.dayType == 1"> |
| | | AND DATE( co.create_time ) = CURDATE() |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 2"> |
| | | AND WEEKOFYEAR( co.create_time ) = WEEKOFYEAR( CURDATE() ) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 3"> |
| | | AND MONTH( co.create_time ) = MONTH(CURDATE()) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 4"> |
| | | AND YEAR( co.create_time ) = YEAR(CURDATE() ) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | au.company_id |
| | | </select> |
| | | <select id="carUserMethod" resultType="java.util.Map"> |
| | | SELECT |
| | | count(1) as counts,vehicle_use |
| | | from charging_pile_account.t_app_user_car |
| | | GROUP BY vehicle_use |
| | | </select> |
| | | <select id="carUserBrand" resultType="java.util.Map"> |
| | | |
| | | SELECT |
| | | count(1) as counts,vehicle_brand |
| | | from charging_pile_account.t_app_user_car |
| | | GROUP BY vehicle_brand |
| | | </select> |
| | | <select id="countLocalCar" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(CASE WHEN license_plate LIKE '%川J%' THEN 1 ELSE 0 END) AS localCar, |
| | | SUM(CASE WHEN license_plate NOT LIKE '%川J%' THEN 1 ELSE 0 END) AS notLocalCar |
| | | FROM |
| | | `charging_pile_account`.`t_app_user_car` |
| | | WHERE |
| | | del_flag = 0 |
| | | </select> |
| | | <select id="getAver" resultType="java.lang.Long"> |
| | | SELECT |
| | | ROUND(AVG(te.mark), 2) AS average_mark |
| | | FROM |
| | | `t_order_evaluate` te |
| | | LEFT JOIN t_charging_order co on te.order_id = co.id |
| | | WHERE |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | te.del_flag = 0 |
| | | |
| | | </select> |
| | | <select id="getLevelEvaluate" resultType="java.util.Map"> |
| | | SELECT |
| | | CASE |
| | | WHEN te.mark BETWEEN 1 AND 2 THEN '1-2' |
| | | WHEN te.mark = 3 THEN '3' |
| | | WHEN te.mark BETWEEN 4 AND 5 THEN '4-5' |
| | | ELSE 'Other' |
| | | END AS score_range, |
| | | COUNT(*) AS count |
| | | FROM |
| | | `t_order_evaluate` te |
| | | LEFT JOIN t_charging_order co on te.order_id = co.id |
| | | WHERE |
| | | te.del_flag = 0 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | AND co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | score_range |
| | | |
| | | </select> |
| | | <select id="chargingList" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | <select id="chargingList1" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | <select id="chargingListNoPage" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | select t1.* from t_charging_order t1 |
| | | where 1=1 |
| | | <if test="null != req.code and req.code!=''"> |
| | |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | payPrice = orderPrice.subtract(coupon.getDiscountAmount()); |
| | | discountPrice = coupon.getDiscountAmount(); |
| | | } |
| | | exchangeDto.setPayPrice(payPrice); |
| | | exchangeDto.setPayPrice(orderPrice); |
| | | exchangeDto.setDiscountPrice(discountPrice); |
| | | exchangeDto.setVipDiscount(vipDiscount); |
| | | exchangeDto.setUserId(userId); |
| | |
| | | //调起支付 |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setCode(shopOrder.getCode()); |
| | | paymentOrder.setAmount(shopOrder.getPaymentAmount()); |
| | | paymentOrder.setAmount(exchangeDto.getOrderPrice()); |
| | | paymentOrder.setOpenId(user.getWxOpenid()); |
| | | paymentOrder.setDescription("购买商品"); |
| | | return wxPaymentClient.orderPay(paymentOrder); |
| | | R<Map<String, Object>> mapR = wxPaymentClient.orderPay(paymentOrder); |
| | | return mapR; |
| | | }else { |
| | | //todo 罗 支付宝支付 |
| | | return R.ok(); |
| | |
| | | switch (substring){ |
| | | //购物订单 |
| | | case "GW": |
| | | |
| | | System.err.println("----收到购物回调"); |
| | | break; |
| | | case "HY": |
| | | break; |
| | |
| | | */ |
| | | protected String buildBaseParam(WxPaymentInfoModel requestBody, String notifyUrl) { |
| | | // 封装基础数据 |
| | | requestBody.setNotify_url(notifyUrl); |
| | | // requestBody.setNotify_url(notifyUrl); |
| | | String reqBody = WxJsonUtils.toJsonString(requestBody); |
| | | return reqBody; |
| | | } |
| | |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | username: nacos |
| | | password: nacos |
| | | ip: 192.168.110.85 |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.110.169:8848 |
New file |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIEKzCCAxOgAwIBAgIUIsATxGnBh2MW3lonXTp5a2bosAMwDQYJKoZIhvcNAQEL |
| | | BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT |
| | | FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg |
| | | Q0EwHhcNMjQwOTAzMDYzNDQxWhcNMjkwOTAyMDYzNDQxWjCBhDETMBEGA1UEAwwK |
| | | MTY4NDU4NDUxNDEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTAwLgYDVQQL |
| | | DCflm5vlt53mmI7mmJ/mlrDog73mupDnp5HmioDmnInpmZDlhazlj7gxCzAJBgNV |
| | | BAYTAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEP |
| | | ADCCAQoCggEBAOyWeURxCZuskSTY7r6dbxTfu1gRdTd2K2PwZnkFy6LBvYTC3Mrw |
| | | NK76azRC+QcQAcXRMmZPyeIMNDiD0JUeB4IegjFWxusLSgjvTlCMFL1W62B78cBa |
| | | 87y7ld8t+P0FIHAUdhe5B5K3VYS7QT89vJ0yiHyAkIZv5QEsH9Tv935MESdD4xVe |
| | | YNQ+2wN4MZgCxfh8B5zPi++TA94lmf0ZZWqLEVhFd2ov2C1XToxtfxdhct0o0OG3 |
| | | PJYDpaVyYFDNZpzcz9e2WrSfRJHPB81qWY95LWJslszOfGjV4iYdk4kodIW7xPsD |
| | | 2/HIJl6/VJPHT6McT1b5wWig8N0vcmkTdMsCAwEAAaOBuTCBtjAJBgNVHRMEAjAA |
| | | MAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2 |
| | | Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJD |
| | | MDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJC |
| | | MjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQCR |
| | | URHWNrcvXLHvo+o/+qNPT/DNGuHiwL+zMRUGVjlTYNG7KQuB6jrByuRa99VW4H/f |
| | | 6EHvUCn1j85NfyWD3uFD0uhWtnS/kpULVfKDPq27buhozmLndqVK/BgmYk6AW3gP |
| | | m4FV1wIy9p3Rmm6WQWWanoXPYIG0TAk5/iTNH/oE1EAzFFITGZxlk2tgv2cTCQam |
| | | IJpfrhIILHiXyTtCShYd0Y9Ip5oLm0keHQ6YyNOV2M9DO0fXpZT33VykpVr8oTqJ |
| | | zDISrxyDGXV+1dkgoZ1ZqTmojhRt8VYw5LyVC9PLAo2nUnt8XeFcitXa/5wzJA1r |
| | | tEymp0l3CDmY3XwQL9py |
| | | -----END CERTIFICATE----- |
New file |
| | |
| | | -----BEGIN PRIVATE KEY----- |
| | | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDslnlEcQmbrJEk |
| | | 2O6+nW8U37tYEXU3ditj8GZ5Bcuiwb2EwtzK8DSu+ms0QvkHEAHF0TJmT8niDDQ4 |
| | | g9CVHgeCHoIxVsbrC0oI705QjBS9Vutge/HAWvO8u5XfLfj9BSBwFHYXuQeSt1WE |
| | | u0E/PbydMoh8gJCGb+UBLB/U7/d+TBEnQ+MVXmDUPtsDeDGYAsX4fAecz4vvkwPe |
| | | JZn9GWVqixFYRXdqL9gtV06MbX8XYXLdKNDhtzyWA6WlcmBQzWac3M/Xtlq0n0SR |
| | | zwfNalmPeS1ibJbMznxo1eImHZOJKHSFu8T7A9vxyCZev1STx0+jHE9W+cFooPDd |
| | | L3JpE3TLAgMBAAECggEAC80RrXVJ+mboMoNTnVRzBwKF8MWmKCcP0QNbySud1bd+ |
| | | QZIKu2Cx8Axzrn6st0p4HCrsLahLNKhRLoR8sgN2cmodKmLetziv77QoHuJt4mfk |
| | | g8KK84JV6BMfTauYYN6RmKWcomBLXWkhreY9Qe9NajXsEvHCw8HvFVjjGZcCrFz8 |
| | | bG3ULntgqu0UOK/Vue75uzo/6K1ltp7Zjo20OwwYkUef51X+lPtRdoYsny3hw/NR |
| | | KzqGr5wjCd+bA2B3oUDpwxotyDuk2JCbdKtqsmabzbLyl+04MkAx3O7XCN+RGeeK |
| | | G1H1/YMl+Ddim/1dyBOo4eVAosPEj4sP4Tfzqv8xcQKBgQD44hyEBc71yHDnwmLA |
| | | CVgmKmvMa2IR1TmvCo2k+6Dc/KvygaNKZVbcWMeYylAKJmCgLvX8HLFMyNoKGeCf |
| | | UTNotx+zQVjizf7S++dSkKEYTwbybZXqSmvWnNDFGzeHHxUjVHcGU2Dki/Uzt9Dh |
| | | w7wE0HC+5iGBeFS89OfSwBX9wwKBgQDzWls+dXpXNaSDDWTRqd0pTcpx8D+iWoUr |
| | | /qT5QQi8Aclp8TBlU6L+CQ70YTRT/EYKeUivy8WXnzi7BxtswdmASOK1z3/DOFkt |
| | | vwdRK3SVkay0vZC7bhJypkwQ7T/ztZiGJFeD4lv6gGwPcPoOdgedZeKTVkP7FB2T |
| | | CKK1b0kUWQKBgDenYFcJcXk2pEC/EBP/Qu3t6IMitCBmvOpugrQU7Kjd+5lT8e7N |
| | | 8Hl/hMqe2v0aDdtkBO+mfuM7ur4tgTQ/FS7iXD1abITzKXuGhvjIjK2B5nzJko98 |
| | | qtan5GtfJbCae8CVv7PzayRQQ7mX7ia9/UpaTgvyLCXmgZRrc3eGKqS/AoGBALfw |
| | | FAehxFcmtLJZ7VqMih4uLlbwwSh2QzJ9xzSfc3qn3xW0uF/eV9SsBCGzV1oj1M0V |
| | | 31sBKtjwAHFdbd1GqJ/Od430yR1F+iIZwe4YaoajFWeH4V3KVSdTiytAKJaNLDw4 |
| | | O+3zqpItf4AsZNWJYTgXSqsTCU8+ZRw96r4434QBAoGAODEiTnmiMwwiZR12h61o |
| | | HMeUi+w7loQkmN6SEmEg0zppvYWOV2LXK9lg/OkGDoSLokUdod/dA60JIG8LEfLM |
| | | sGFK/5K+qkTqOPQKlhE7nerqhF4S95lsXy3r2OKv4Cc7mvN8pTZTOIYbEXGrNOvZ |
| | | MO5cc2vaWSI6Xm4HoqBe12o= |
| | | -----END PRIVATE KEY----- |
New file |
| | |
| | | 欢迎使用微信支付! |
| | | 附件中的三份文件(证书pkcs12格式、证书pem格式、证书密钥pem格式),为接口中强制要求时需携带的证书文件。 |
| | | 证书属于敏感信息,请妥善保管不要泄露和被他人复制。 |
| | | 不同开发语言下的证书格式不同,以下为说明指引: |
| | | 证书pkcs12格式(apiclient_cert.p12) |
| | | 包含了私钥信息的证书文件,为p12(pfx)格式,由微信支付签发给您用来标识和界定您的身份 |
| | | 部分安全性要求较高的API需要使用该证书来确认您的调用身份 |
| | | windows上可以直接双击导入系统,导入过程中会提示输入证书密码,证书密码默认为您的商户号(如:1900006031) |
| | | 证书pem格式(apiclient_cert.pem) |
| | | 从apiclient_cert.p12中导出证书部分的文件,为pem格式,请妥善保管不要泄漏和被他人复制 |
| | | 部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供 |
| | | 您也可以使用openssl命令来自己导出:openssl pkcs12 -clcerts -nokeys -in apiclient_cert.p12 -out apiclient_cert.pem |
| | | 证书密钥pem格式(apiclient_key.pem) |
| | | 从apiclient_cert.p12中导出密钥部分的文件,为pem格式 |
| | | 部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供 |
| | | 您也可以使用openssl命令来自己导出:openssl pkcs12 -nocerts -in apiclient_cert.p12 -out apiclient_key.pem |
| | | 备注说明: |
| | | 由于绝大部分操作系统已内置了微信支付服务器证书的根CA证书, 2018年3月6日后, 不再提供CA证书文件(rootca.pem)下载 |