Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | private String id; |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | @TableField("name") |
| | | private String name; |
| | |
| | | @ApiModelProperty(value = "要赠送的优惠卷") |
| | | @TableField("coupon_ids") |
| | | private String couponIds; |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | @TableField("invoice_type") |
| | | private Integer invoiceType; |
| | | private String invoiceType; |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | @TableField("invoice_type_id") |
| | | private Integer invoiceTypeId; |
| | | |
| | | @ApiModelProperty(value = "抬头类型(1=个人,2=企业)") |
| | | @TableField("invoicing_object_type") |
New file |
| | |
| | | package com.ruoyi.account.api.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @Data |
| | | public class InvoiceInformationVo { |
| | | |
| | | |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | private String invoiceType; |
| | | |
| | | @ApiModelProperty(value = "发票类型id") |
| | | private Integer invoiceTypeId; |
| | | |
| | | @ApiModelProperty(value = "抬头类型(1=个人,2=企业)") |
| | | private Integer invoicingObjectType; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "纳税识别号") |
| | | private String taxIdentificationNumber; |
| | | |
| | | @ApiModelProperty(value = "公司地址") |
| | | private String companyAddress; |
| | | |
| | | @ApiModelProperty(value = "公司电话") |
| | | private String companyPhone; |
| | | |
| | | @ApiModelProperty(value = "开户银行") |
| | | private String depositBank; |
| | | |
| | | @ApiModelProperty(value = "银行账户") |
| | | private String bankAccount; |
| | | |
| | | @ApiModelProperty(value = "设置默认(0=否,1=是)") |
| | | private Integer isDefault; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | public R<TChargingGun> getChargingGunById(Integer id) { |
| | | return R.fail("根据id获取充电枪失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<SiteNameVO> getAllInfoById(Integer id) { |
| | | return R.fail("通过枪id获取站点、桩、枪的名称失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingGunFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | */ |
| | | @PostMapping("/t-charging-gun/getChargingGunById/{id}") |
| | | R<TChargingGun> getChargingGunById(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 通过枪id获取站点、桩、枪的名称VO |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-gun/getAllInfoById/{id}") |
| | | R<SiteNameVO> getAllInfoById(@PathVariable("id") Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "获取站点、桩、枪的名称VO") |
| | | public class SiteNameVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "桩名称") |
| | | private String pileName; |
| | | @ApiModelProperty(value = "桩号") |
| | | private Integer pileNumber; |
| | | @ApiModelProperty(value = "枪名称") |
| | | private String gunName; |
| | | @ApiModelProperty(value = "枪号") |
| | | private String gunNumber; |
| | | |
| | | } |
| | |
| | | com.ruoyi.integration.api.factory.IntegrationFallbackFactory |
| | | com.ruoyi.integration.api.factory.UploadRealTimeMonitoringDataFallbackFactory |
| | | com.ruoyi.integration.api.factory.ChargingHandshakeFallbackFactory |
| | | com.ruoyi.integration.api.factory.SendMessageFallbackFactory |
| | |
| | | * @param days |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend/{days}") |
| | | @PostMapping("/t-charging-order-accounting-strategy/getDailyChargingDegree/{days}") |
| | | R<List<Double>> getDailyChargingDegree(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds); |
| | | } |
| | |
| | | @TableField("charging_capacity") |
| | | private BigDecimal chargingCapacity; |
| | | |
| | | @ApiModelProperty(value = "时段电费") |
| | | @TableField("period_electric_price") |
| | | private BigDecimal periodElectricPrice; |
| | | |
| | | @ApiModelProperty(value = "时段服务费") |
| | | @TableField("period_service_price") |
| | | private BigDecimal periodServicePrice; |
| | | |
| | | @ApiModelProperty(value = "会员抵扣") |
| | | @TableField(exist = false) |
| | | private BigDecimal vipDiscount; |
| | | |
| | | @ApiModelProperty(value = "优惠券抵扣") |
| | | @TableField(exist = false) |
| | | private BigDecimal couponDiscount; |
| | | |
| | | @ApiModelProperty(value = "最终服务费") |
| | | @TableField(exist = false) |
| | | private BigDecimal finalService; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "取消人") |
| | | @TableField(exist = false) |
| | | private String cancellationName; |
| | | @ApiModelProperty(value = "商品名称") |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "下单手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "申诉反馈") |
| | | @TableField("feedback") |
| | | private String feedback; |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | |
| | | @ApiModelProperty(value = "反馈人id") |
| | | @TableField("feedback_user_id") |
| | |
| | | @TableField("pay_time") |
| | | private LocalDateTime payTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "下单手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | @ApiModelProperty(value = "商品/优惠券名称") |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "收货人") |
| | | @TableField(exist = false) |
| | | private String receivingName; |
| | |
| | | @ApiModelProperty(value = "取消人") |
| | | @TableField(exist = false) |
| | | private String cancellationName; |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "退款金额") |
| | | @TableField("refund_amount") |
| | | private BigDecimal refundAmount; |
| | | @ApiModelProperty(value = "会员类型名称") |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "uid") |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | @ApiModelProperty(value = "userUid") |
| | | @TableField(exist = false) |
| | | private String userUid; |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingOrderQuery对象",description = "管理后台充电订单查询对象") |
| | | @ApiModel(value = "ChargingOrderQuery充电桩订单查询对象",description = "管理后台充电桩订单查询对象") |
| | | public class ChargingOrderQuery extends BasePage { |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "充电桩订单列表查看详情",description = "充电桩订单列表查看详情") |
| | | public class ChargingOrderInfoVO { |
| | | @ApiModelProperty(value = "充电电流") |
| | | private String cdElectronic; |
| | | @ApiModelProperty(value = "充电电压") |
| | | private String cdVoltage; |
| | | @ApiModelProperty(value = "剩余电量") |
| | | private String surplus; |
| | | @ApiModelProperty(value = "实时总功率") |
| | | private String totalPower; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String licensePlate; |
| | | @ApiModelProperty(value = "车辆品牌") |
| | | private String vehicleBrand; |
| | | @ApiModelProperty(value = "车辆类型") |
| | | private String vehicleModel; |
| | | @ApiModelProperty(value = "用车类型") |
| | | private String vehicleUse; |
| | | |
| | | @ApiModelProperty(value = "充电明细列表") |
| | | private List<TChargingOrderAccountingStrategy> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingOrderListVO对象",description = "充电时段统计列表VO") |
| | | public class ChargingOrderListVO { |
| | | @ApiModelProperty(value = "电站名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "充电桩id") |
| | | private Integer chargingPileId; |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long appUserId; |
| | | @ApiModelProperty(value = "用户车辆id") |
| | | private Long appUserCarId; |
| | | @ApiModelProperty(value = "充电枪id") |
| | | private Integer chargingGunId; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "订单类型(1=充电订单(小程序),2=充电订单(刷卡))") |
| | | private String orderType; |
| | | @ApiModelProperty(value = "充电终端名称 桩+枪") |
| | | private String terminalName; |
| | | @ApiModelProperty(value = "充电时间 秒") |
| | | private Long chargingSecond; |
| | | @ApiModelProperty(value = "充电电流 度") |
| | | private BigDecimal chargingCapacity; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String licensePlate; |
| | | @ApiModelProperty(value = "客户手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "充电到账金额") |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "累计电费") |
| | | private BigDecimal electrovalence; |
| | | @ApiModelProperty(value = "累计服务费") |
| | | private BigDecimal serviceCharge; |
| | | @ApiModelProperty(value = "平台手续费") |
| | | private BigDecimal commissionAmount; |
| | | @ApiModelProperty(value = "引流平台") |
| | | private String sourceName; |
| | | @ApiModelProperty(value = "平台分佣") |
| | | private BigDecimal sharingAmount; |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty(value = "开始soc") |
| | | private String startSoc; |
| | | @ApiModelProperty(value = "结束soc") |
| | | private String endSoc; |
| | | @ApiModelProperty(value = "结束原因 (0=异常终止,1=主动终止,2=满电终止,3=费用不足终止)") |
| | | private Integer endMode; |
| | | @ApiModelProperty(value = "电流占比") |
| | | private String electronicProportion; |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "订单uid") |
| | | private String uid; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingOrderTimeVO对象",description = "充电时段统计VO") |
| | | public class ChargingOrderTimeVO { |
| | | @ApiModelProperty(value = "订单数量") |
| | | private Integer orderCount; |
| | | @ApiModelProperty(value = "充电总度数") |
| | | private BigDecimal chargingCapacity; |
| | | @ApiModelProperty(value = "充电到账金额") |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "累计电费") |
| | | private BigDecimal electrovalence; |
| | | @ApiModelProperty(value = "累计服务费") |
| | | private BigDecimal serviceCharge; |
| | | @ApiModelProperty(value = "尖峰平谷充电量") |
| | | private String capacityProportion; |
| | | @ApiModelProperty(value = "尖峰平谷服务费") |
| | | private String serviceProportion; |
| | | @ApiModelProperty(value = "尖峰平谷充电到账") |
| | | private String electronicProportion; |
| | | @ApiModelProperty(value = "列表数据") |
| | | private PageInfo<ChargingOrderListVO> list; |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SiteDetailEvaluateVO对象",description = "站点详情订单评价") |
| | | @ApiModel(value = "ChargingOrderVO对象",description = "充电订单列表VO") |
| | | public class ChargingOrderVO extends TChargingOrder { |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String siteName; |
| | |
| | | private Integer count; |
| | | @ApiModelProperty(value = "1明星充电 2快电 3新电途") |
| | | private Integer orderSource; |
| | | |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderAppealVO对象", description = "充电桩订单VO") |
| | | @ApiModel(value = "充电桩订单列表对象", description = "充电桩订单VO") |
| | | public class TCharingOrderVO { |
| | | @ApiModelProperty(value = "分页列表") |
| | | private PageInfo<ChargingOrderVO> list; |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderAppealVO对象", description = "订单申诉VO对象") |
| | | public class TOrderAppealVO extends TOrderAppeal { |
| | | |
| | | @ApiModelProperty(value = "uid") |
| | | private String uid; |
| | | |
| | | @ApiModelProperty(value = "充电订单") |
| | | private TChargingOrder chargingOrder; |
| | |
| | | @ApiModelProperty(value = "购物订单") |
| | | private TShoppingOrder shoppingOrder; |
| | | |
| | | @ApiModelProperty(value = "兑换订单") |
| | | private TExchangeOrder exchangeOrder; |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | @ApiModelProperty(value = "商品图片") |
| | | private String goodsPicture; |
| | | |
| | | @ApiModelProperty(value = "会员订单") |
| | | private TVipOrder vipOrder; |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "桩名称") |
| | | private String pileName; |
| | | @ApiModelProperty(value = "桩号") |
| | | private Integer pileNumber; |
| | | @ApiModelProperty(value = "枪名称") |
| | | private String gunName; |
| | | @ApiModelProperty(value = "枪号") |
| | | private String gunNumber; |
| | | |
| | | } |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos1.add(infoCouponDto); |
| | | |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos2.add(infoCouponDto); |
| | | } |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos2.add(infoCouponDto); |
| | | } |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "优惠卷详情(1可使用2不可用)", tags = {"小程序-个人中心"}) |
| | | @PostMapping(value = "/user/coupon/getById") |
| | | @GetMapping(value = "/user/coupon/getById") |
| | | public R<TAppCoupon> couponGetById(@RequestParam("id")Long id) { |
| | | TAppCoupon appCoupon = appCouponService.getById(id); |
| | | return R.ok(appCoupon); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "已赠送列表", tags = {"小程序-个人中心-邀请好友"}) |
| | | @PostMapping(value = "/user/invite/info") |
| | | @GetMapping(value = "/user/invite/info") |
| | | public R<InviteInfoDto> inviteInfo() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | |
| | | import com.ruoyi.account.service.TAppUserVipDetailService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return R.ok(one); |
| | | } |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | |
| | | @GetMapping("/getVipUseDetail") |
| | | @ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"}) |
| | | public R<List<TAppUserVipDetail>> getVipUseDetail(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list(); |
| | | |
| | | for (TAppUserVipDetail tAppUserVipDetail : list) { |
| | | TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData(); |
| | | tAppUserVipDetail.setVipName(data.getName()); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.TInvoiceInformation; |
| | | import com.ruoyi.account.api.vo.InvoiceInformationVo; |
| | | import com.ruoyi.account.service.TInvoiceInformationService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getInvoiceInformationList") |
| | | @ApiOperation(value = "获取开票抬头数据列表", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<List<TInvoiceInformation>> getInvoiceInformationList(){ |
| | | public AjaxResult<List<InvoiceInformationVo>> getInvoiceInformationList(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0)); |
| | | return AjaxResult.success(list); |
| | | List<InvoiceInformationVo> lists = new ArrayList<>(); |
| | | for (TInvoiceInformation tInvoiceInformation : list) { |
| | | InvoiceInformationVo vo = new InvoiceInformationVo(); |
| | | BeanUtils.copyProperties(tInvoiceInformation, vo); |
| | | vo.setId(tInvoiceInformation.getId().toString()); |
| | | lists.add(vo); |
| | | } |
| | | return AjaxResult.success(lists); |
| | | } |
| | | |
| | | |
| | |
| | | public AjaxResult addInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | //如果当前是默认抬头,则需要去除其他的默认配置 |
| | | if(1 == invoiceInformation.getIsDefault()){ |
| | | if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){ |
| | | TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0) |
| | | .eq(TInvoiceInformation::getIsDefault, 1).eq(TInvoiceInformation::getAppUserId, userId)); |
| | | if(null != one){ |
| | |
| | | import cn.hutool.core.img.ImgUtil; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.util.QRCodeUtils; |
| | |
| | | |
| | | @Resource |
| | | private TChargingPileService chargingPileService; |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | @Autowired |
| | | public TChargingGunController(TChargingGunService chargingGunService) { |
| | |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | return R.ok(chargingGun); |
| | | } |
| | | /** |
| | | * 根据id获取充电枪详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/getAllInfoById/{id}") |
| | | public R<SiteNameVO> getAllInfoById(@PathVariable Integer id){ |
| | | SiteNameVO siteNameVO = new SiteNameVO(); |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | siteNameVO.setGunName(chargingGun.getName()); |
| | | siteNameVO.setGunNumber(chargingGun.getCode()); |
| | | TChargingPile chargingPile = chargingPileService.getById(id); |
| | | siteNameVO.setPileName(chargingPile.getName()); |
| | | siteNameVO.setPileNumber(chargingPile.getNumber()); |
| | | Site site = siteService.getById(id); |
| | | siteNameVO.setSiteName(site.getName()); |
| | | return R.ok(siteNameVO); |
| | | } |
| | | } |
| | | |
| | |
| | | throw new ServiceException("未查询到计费策略"); |
| | | } |
| | | List<TAccountingStrategyDetailVO> list = this.queryAccountingStrategyDetailByStrategyId(accountingStrategy.getId()); |
| | | list.stream().filter(item -> "24:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | chargeMonitoring.setNotCharged(total.size() - charging.size()); |
| | | chargeMonitoring.setRatedPower(ratedPower.setScale(4, RoundingMode.HALF_EVEN)); |
| | | chargeMonitoring.setRealTimePower(realTimePower.setScale(4, RoundingMode.HALF_EVEN)); |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(realTimePower.divide(ratedPower).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN)); |
| | | if(ratedPower.equals(BigDecimal.ZERO)){ |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(BigDecimal.ZERO); |
| | | }else{ |
| | | chargeMonitoring.setDemandPowerSatisfactionRate(realTimePower.divide(ratedPower, new MathContext(2, RoundingMode.HALF_EVEN)) |
| | | .multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | |
| | | List<String> dates = new ArrayList<>(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MMM-dd"); |
| | |
| | | List<Double> data = chargingOrderAccountingStrategyClient.getDailyChargingDegree(6, siteIds).getData(); |
| | | List<Double> value2 = new ArrayList<>(); |
| | | for (Double datum : data) { |
| | | if(list.size() == 0){ |
| | | value2.add(0D); |
| | | }else{ |
| | | Double datum1 = new BigDecimal(datum).divide(new BigDecimal(list.size()).multiply(v).multiply(new BigDecimal(24))).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | value2.add(datum1); |
| | | } |
| | | } |
| | | Map<String, Object> utilizationTrend = new HashMap<>(); |
| | | utilizationTrend.put("date", dates); |
| | | utilizationTrend.put("value", value2); |
| | |
| | | </if> |
| | | AND ts.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.status.SiteStatusEnum@NORMAL_USE.getCode()} |
| | | AND ts.accounting_strategy_id IS NOT NULL |
| | | </where> |
| | | <if test="query.sortType != null"> |
| | | <choose> |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.order.api.query.VipShoppingOrderQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderTimeVO; |
| | | import com.ruoyi.order.dto.ChargingListQuery; |
| | | import com.ruoyi.order.dto.PayOrderDto; |
| | | import com.ruoyi.order.dto.PayOrderQueryDto; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Api(tags = "财务结算") |
| | | @RestController |
| | | @RequestMapping("/financial/settlement") |
| | | public class FinancialSettlementController { |
| | | |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | @Resource |
| | | private TShoppingOrderService shoppingOrderService; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private TVipOrderService vipOrderService; |
| | | @Resource |
| | | private ParkingLotClient parkingLotClient; |
| | | @Resource |
| | | private TChargingOrderRefundService chargingOrderRefundService; |
| | | |
| | | @Resource |
| | | private TShoppingOrderRefundService shoppingOrderRefundService; |
| | | @Resource |
| | | private TVipOrderRefundService vipOrderRefundService; |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | @Resource |
| | | private ChargingPileClient chargingPileClient; |
| | | @Resource |
| | | private ChargingGunClient chargingGunClient; |
| | | @Resource |
| | | private AppUserCarClient appUserCarClient; |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | @ResponseBody |
| | | @PostMapping(value = "/chargingList") |
| | | @ApiOperation(value = "充电时段统计列表", tags = {"管理后台-财务结算"}) |
| | | public AjaxResult<ChargingOrderTimeVO> chargingList(@RequestBody ChargingListQuery dto) { |
| | | ChargingOrderTimeVO res = chargingOrderService.chargingList(dto); |
| | | return AjaxResult.success(res); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.controller; |
| | | import com.google.common.collect.Lists; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.order.api.query.TChargingCountQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderInfoVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.TCharingOrderVO; |
| | | import com.ruoyi.order.dto.GetMyChargingOrderList; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | payOrderChargingInfo.setChargingName(data1.getName()); |
| | | TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData(); |
| | | payOrderChargingInfo.setGunName(data2.getName()); |
| | | if (byId.getAppUserCarId()!=null) { |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping(value = "/chargingOrderInfo") |
| | | @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"}) |
| | | public AjaxResult<TCharingOrderVO> chargingOrderInfo(String orderId) { |
| | | |
| | | return AjaxResult.success(); |
| | | public AjaxResult<ChargingOrderInfoVO> chargingOrderInfo(String orderId) { |
| | | ChargingOrderInfoVO chargingOrderInfoVO = new ChargingOrderInfoVO(); |
| | | chargingOrderInfoVO.setCdElectronic(""); |
| | | chargingOrderInfoVO.setCdVoltage(""); |
| | | chargingOrderInfoVO.setSurplus(""); |
| | | chargingOrderInfoVO.setTotalPower(""); |
| | | chargingOrderInfoVO.setLicensePlate(""); |
| | | chargingOrderInfoVO.setVehicleBrand(""); |
| | | chargingOrderInfoVO.setVehicleModel(""); |
| | | chargingOrderInfoVO.setVehicleUse(""); |
| | | List<TChargingOrderAccountingStrategy> tChargingOrderAccountingStrategies = new ArrayList<>(); |
| | | chargingOrderInfoVO.setList(tChargingOrderAccountingStrategies); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @PostMapping("/getShoppingOrderInfoById") |
| | | @GetMapping("/getShoppingOrderInfoById") |
| | | @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult<TExchangeOrder> getShoppingOrderList(String id) { |
| | | TExchangeOrder byId = exchangeOrderService.getById(id); |
| | |
| | | } |
| | | @GetMapping("/consignerShoppingOrder") |
| | | @ApiOperation(value = "发货", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult consignerShoppingOrder(String id) { |
| | | public AjaxResult consignerShoppingOrder(String id,String companyName,String code) { |
| | | TExchangeOrder byId = exchangeOrderService.getById(id); |
| | | byId.setExpressCompany(companyName); |
| | | byId.setExpressNumber(code); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | byId.setConsignerId(userid); |
| | | byId.setConsignerTime(LocalDateTime.now()); |
| | |
| | | tExchangeOrder.setPoints(exchangeDto.getPoint()); |
| | | tExchangeOrder.setRemark(""); |
| | | if (exchangeDto.getGoodType()==1){ |
| | | tExchangeOrder.setStatus(0); |
| | | tExchangeOrder.setStatus(1); |
| | | }else { |
| | | tExchangeOrder.setStatus(3); |
| | | } |
| | |
| | | |
| | | @GetMapping("/getMyExchangeOrder") |
| | | @ApiOperation(value = "获取兑换记录列表", tags = {"小程序-兑换记录"}) |
| | | public AjaxResult<List<MyExchangeOrderList>> getMyExchangeOrder(GetMyExchangeOrder query){ |
| | | List<MyExchangeOrderList> list = exchangeOrderService.getMyExchangeOrder(query); |
| | | public AjaxResult<Map<String, Object>> getMyExchangeOrder(GetMyExchangeOrder query){ |
| | | Map<String, Object> list = exchangeOrderService.getMyExchangeOrder(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import com.ruoyi.order.dto.ManageFeedbackDto; |
| | | import com.ruoyi.order.dto.ManageOrderAppealQuery; |
| | | import com.ruoyi.order.service.TOrderAppealService; |
| | | import com.ruoyi.order.service.*; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | @Resource |
| | | private TShoppingOrderService shoppingOrderService; |
| | | @Resource |
| | | private TExchangeOrderService exchangeOrderService; |
| | | |
| | | @Resource |
| | | private TVipOrderService vipOrderService; |
| | | |
| | | |
| | | @Autowired |
| | | public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) { |
| | |
| | | .like(manageOrderAppealQuery.getPhone() != null, TOrderAppeal::getPhone, manageOrderAppealQuery.getPhone()) |
| | | .eq(manageOrderAppealQuery.getOrderType() != null, TOrderAppeal::getOrderType, manageOrderAppealQuery.getOrderType()) |
| | | .in(TOrderAppeal::getOrderType, 1, 2).page(Page.of(manageOrderAppealQuery.getPageCurr(), manageOrderAppealQuery.getPageSize())); |
| | | |
| | | for (TOrderAppeal record : page.getRecords()) { |
| | | record.setUid(record.getId().toString()); |
| | | } |
| | | return R.ok(page); |
| | | |
| | | |
| | | } |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "删除") |
| | | @DeleteMapping (value = "/manage/delete") |
| | | public R<Page<TOrderAppeal>> delete(String ids) { |
| | | orderAppealService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "后台-订单管理-订单申诉") |
| | |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TOrderAppealVO>> pageList(@RequestBody TOrderAppealQuery query) { |
| | | // TODO 用户id 获取小程序当前登录用户id |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setAppUserId(userId); |
| | | return AjaxResult.ok(orderAppealService.pageList(query)); |
| | | } |
| | |
| | | */ |
| | | @GetMapping(value = "/getDetailById") |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") |
| | | public AjaxResult<TOrderAppealVO> getDetailById(Integer id) { |
| | | public AjaxResult<TOrderAppealVO> getDetailById(String id) { |
| | | return AjaxResult.ok(orderAppealService.getDetailById(id)); |
| | | } |
| | | |
| | |
| | | orderAppeal.setAppUserId(appUserId); |
| | | orderAppeal.setStatus(1); |
| | | orderAppeal.setPhone(data.getPhone()); |
| | | |
| | | if (orderAppeal.getOrderType()==1){ |
| | | TChargingOrder byId = chargingOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==2){ |
| | | TShoppingOrder byId = shoppingOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==3){ |
| | | TExchangeOrder byId = exchangeOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | }else if(orderAppeal.getOrderType()==4){ |
| | | TVipOrder byId = vipOrderService.getById(orderAppeal.getOrderId()); |
| | | orderAppeal.setCode(byId.getCode()); |
| | | } |
| | | orderAppealService.save(orderAppeal); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | @GetMapping(value = "/getPageList") |
| | | @PostMapping(value = "/getPageList") |
| | | @ApiOperation(value = "获取充电评价列表", tags = {"管理后台-充电评价"}) |
| | | public AjaxResult<PageInfo<GetOrderEvaluatePageListDTO>> getPageList(@RequestBody GetOrderEvaluatePageList pageList){ |
| | | PageInfo<GetOrderEvaluatePageListDTO> list = orderEvaluateService.getPageList(pageList); |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @PostMapping("/getShoppingOrderInfoById") |
| | | @GetMapping("/getShoppingOrderInfoById") |
| | | @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult<TShoppingOrder> getShoppingOrderList(String id) { |
| | | TShoppingOrder byId = shoppingOrderService.getById(id); |
| | |
| | | // todo 部署到线上之后写回调地址 |
| | | // wxPaymentRefundModel.setNotify_url(""); |
| | | String string = byId.getPaymentAmount().multiply(new BigDecimal("100")).toString(); |
| | | if (string.contains(".")){ |
| | | string = string.substring(0,string.indexOf(".")); |
| | | } |
| | | int i = Integer.parseInt(string); |
| | | WxPaymentRefundModel.RefundAmount refundAmount = new WxPaymentRefundModel.RefundAmount(); |
| | | refundAmount.setTotal(i); |
| | |
| | | } |
| | | @GetMapping("/consignerShoppingOrder") |
| | | @ApiOperation(value = "发货", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult consignerShoppingOrder(String id) { |
| | | public AjaxResult consignerShoppingOrder(String id,String companyName,String code) { |
| | | TShoppingOrder byId = shoppingOrderService.getById(id); |
| | | byId.setExpressCompany(companyName); |
| | | byId.setExpressNumber(code); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | byId.setConsignerId(userid); |
| | | byId.setConsignerTime(LocalDateTime.now()); |
| | |
| | | } |
| | | @GetMapping("/getMyShoppingOrderList") |
| | | @ApiOperation(value = "获取购买订单列表", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult<List<MyShoppingOrderList>> getMyShoppingOrderList(GetMyShoppingOrderList query){ |
| | | List<MyShoppingOrderList> list = shoppingOrderService.getMyShoppingOrderList(query); |
| | | public AjaxResult<Map<String, Object>> getMyShoppingOrderList(GetMyShoppingOrderList query){ |
| | | Map<String, Object> list = shoppingOrderService.getMyShoppingOrderList(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/getMyShoppingOrderListNum") |
| | | @ApiOperation(value = "获取购买订单列表数量", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult<Map<String, Object>> getMyShoppingOrderListNum(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | long dfh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 1).eq(TShoppingOrder::getAppUserId, userId)); |
| | | long dsh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 2).eq(TShoppingOrder::getAppUserId, userId)); |
| | | long ywc = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 3).eq(TShoppingOrder::getAppUserId, userId)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("dfh", dfh); |
| | | map.put("dsh", dsh); |
| | | map.put("ywc", ywc); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getMyShoppingOrderInfo/{id}") |
| | |
| | | @PostMapping("/addVipOrder") |
| | | @ApiOperation(value = "添加会员订单", tags = {"管理后台-会员订单"}) |
| | | public AjaxResult addVipOrder(@RequestBody TVipOrder dto) { |
| | | vipOrderService.save(dto); |
| | | vipOrderService.saveOrUpdate(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/deleteVipOrder") |
New file |
| | |
| | | package com.ruoyi.order.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ChargingListQuery extends BasePage { |
| | | @ApiModelProperty("订单编号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty("状态(0=未知,1=等待中,2=启动中,3=充电中,4=停止中,5=已结束)") |
| | | private Integer status; |
| | | |
| | | @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; |
| | | |
| | | } |
| | |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty("支付时间") |
| | | private LocalDateTime payTime; |
| | | private Integer refundStatus; |
| | | private Double finalAmount; |
| | | |
| | | } |
| | |
| | | return; |
| | | } |
| | | } |
| | | filterChain.doFilter(request, response); |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TChargingOrderRefund; |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderListVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.dto.ChargingRefundDto; |
| | | import com.ruoyi.order.dto.GetNoInvoicedOrder; |
| | | import com.ruoyi.order.dto.PayOrderDto; |
| | | import com.ruoyi.order.dto.PayOrderQueryDto; |
| | | import com.ruoyi.order.dto.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | List<PayOrderDto> payOrderQuery(@Param("pageInfo")PageInfo<PayOrderDto> pageInfo,@Param("data") PayOrderQueryDto payOrderQueryDto); |
| | | |
| | | List<TChargingOrderRefund> getRefundList(@Param("pageInfo")PageInfo<TChargingOrderRefund> pageInfo,@Param("data") ChargingRefundDto chargingRefundDto); |
| | | |
| | | 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); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TChargingOrderRefund; |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderTimeVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.TCharingOrderVO; |
| | | import com.ruoyi.order.dto.*; |
| | |
| | | R<PageInfo<PayOrderDto>> payOrderQuery(PayOrderQueryDto payOrderQueryDto); |
| | | |
| | | R<PageInfo<TChargingOrderRefund>> getRefundList(ChargingRefundDto chargingRefundDto); |
| | | |
| | | ChargingOrderTimeVO chargingList(ChargingListQuery dto); |
| | | } |
| | |
| | | import com.ruoyi.order.dto.MyExchangeOrderList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query); |
| | | Map<String, Object> getMyExchangeOrder(GetMyExchangeOrder query); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | TOrderAppealVO getDetailById(Integer id); |
| | | TOrderAppealVO getDetailById(String id); |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<MyShoppingOrderList> getMyShoppingOrderList(GetMyShoppingOrderList query); |
| | | Map<String, Object> getMyShoppingOrderList(GetMyShoppingOrderList query); |
| | | |
| | | |
| | | /** |
| | |
| | | map2.put("name", "峰"); |
| | | BigDecimal value2 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 2) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value2.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map2.put("value", value2.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "平"); |
| | | BigDecimal value3 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 3) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value3.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map3.put("value", value3.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map3); |
| | | |
| | | Map<String, Object> map4 = new HashMap<>(); |
| | | map4.put("name", "谷"); |
| | | BigDecimal value4 = list1.stream().filter(s -> orderIds.contains(s.getChargingOrderId()) && s.getType() == 4) |
| | | .map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | map1.put("value", value4.setScale(2, RoundingMode.HALF_EVEN)); |
| | | map4.put("value", value4.setScale(2, RoundingMode.HALF_EVEN)); |
| | | datas.add(map4); |
| | | list2.add(datas); |
| | | } |
| | |
| | | import com.ruoyi.order.api.model.TChargingOrderRefund; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderListVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderTimeVO; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.TCharingOrderVO; |
| | | import com.ruoyi.order.dto.*; |
| | |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private ChargingPileClient chargingPileClient; |
| | | |
| | | |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | |
| | | @Resource |
| | | private ChargingPileClient chargingPileClient; |
| | | |
| | | |
| | | @Resource |
| | |
| | | BigDecimal electronicMoney = new BigDecimal("0"); |
| | | BigDecimal serviceMoney = new BigDecimal("0"); |
| | | for (ChargingOrderVO chargingOrderVO : list) { |
| | | TChargingGun data3 = chargingGunClient.getChargingGunById(chargingOrderVO.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderVO.getChargingPileId()).getData(); |
| | | if (data2!=null && data3!=null){ |
| | | chargingOrderVO.setTerminalName(data2.getName()+"-"+data3.getName()); |
| | | |
| | | } |
| | | if (chargingOrderVO.getChargingCapacity()!=null){ |
| | | total = total.add(chargingOrderVO.getChargingCapacity()); |
| | | } |
| | |
| | | BigDecimal electronicMoney1 = new BigDecimal("0"); |
| | | // 单个订单累计服务费 |
| | | BigDecimal serviceMoney1 = new BigDecimal("0"); |
| | | LocalDateTime startTime = chargingOrderVO.getStartTime(); |
| | | LocalDateTime endTime = chargingOrderVO.getEndTime(); |
| | | // 计算时间差 秒 充电时长 |
| | | if (startTime!=null && endTime!=null){ |
| | | long between = ChronoUnit.SECONDS.between(startTime, endTime); |
| | | chargingOrderVO.setChargingSecond(between); |
| | | time += between; |
| | | } |
| | | // todo 调用第三方获取充电时长 秒 |
| | | |
| | | // 总收入 |
| | | if (chargingOrderVO.getRefundStatus() !=null && chargingOrderVO.getRefundStatus() == 2){ |
| | | income = income.add(chargingOrderVO.getPaymentAmount().subtract(chargingOrderVO.getRefundAmount())); |
| | |
| | | |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @Override |
| | | public ChargingOrderTimeVO chargingList(ChargingListQuery dto) { |
| | | String startTime1 = null; |
| | | String startTime2 = null; |
| | | String endTime1 = null; |
| | | String endTime2 = null; |
| | | |
| | | if (StringUtils.hasLength(dto.getStartTime())){ |
| | | String[] split = dto.getStartTime().split(" - "); |
| | | startTime1 = split[0]; |
| | | startTime2 = split[1]; |
| | | } |
| | | if (StringUtils.hasLength(dto.getEndTime())){ |
| | | String[] split = dto.getEndTime().split(" - "); |
| | | endTime1 = split[0]; |
| | | endTime2 = split[1]; |
| | | } |
| | | ChargingOrderTimeVO chargingOrderTimeVO = new ChargingOrderTimeVO(); |
| | | |
| | | |
| | | PageInfo<ChargingOrderListVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<ChargingOrderListVO> list = this.baseMapper.chargingList(pageInfo,dto,startTime1,startTime2,endTime1,endTime2); |
| | | for (ChargingOrderListVO chargingOrderListVO : list) { |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(chargingOrderListVO.getSiteId()); |
| | | List<Site> data = siteClient.getSiteByIds(integers).getData(); |
| | | if (!data.isEmpty()) { |
| | | chargingOrderListVO.setSiteName(data.get(0).getName()); |
| | | } |
| | | 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()); |
| | | } |
| | | // todo 充电时长 调用第三方获取 |
| | | TAppUser data3 = appUserClient.getUserById(chargingOrderListVO.getAppUserId()).getData(); |
| | | List<Long> carId = new ArrayList<>(); |
| | | if (chargingOrderListVO.getAppUserCarId() != null) { |
| | | carId.add(chargingOrderListVO.getAppUserCarId()); |
| | | List<TAppUserCar> data4 = appUserCarClient.getCarByIds(carId).getData(); |
| | | if (!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(); |
| | | // 尖峰平谷充电量 度数 |
| | | BigDecimal jian = new BigDecimal("0"); |
| | | BigDecimal feng = new BigDecimal("0"); |
| | | BigDecimal ping = new BigDecimal("0"); |
| | | BigDecimal gu = new BigDecimal("0"); |
| | | BigDecimal total = new BigDecimal("0"); |
| | | for (TChargingOrderAccountingStrategy temp : list2) { |
| | | switch (temp.getType()) { |
| | | case 1: |
| | | jian = jian.add(temp.getChargingCapacity()); |
| | | break; |
| | | case 2: |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | break; |
| | | case 3: |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | break; |
| | | case 4: |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | break; |
| | | } |
| | | } |
| | | total = total.add(jian).add(feng).add(ping).add(gu); |
| | | 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"))+"%(谷)"); |
| | | } |
| | | // 不分页 |
| | | List<ChargingOrderListVO> list1 = this.baseMapper.chargingList1(dto,startTime1,startTime2,endTime1,endTime2); |
| | | chargingOrderTimeVO.setOrderCount(list1.size()); |
| | | // 计算充电总度数 |
| | | BigDecimal electronic = new BigDecimal("0"); |
| | | // 支付金额 |
| | | BigDecimal paymentAmount = new BigDecimal("0"); |
| | | // 电费 |
| | | BigDecimal electrovalence = new BigDecimal("0"); |
| | | // 服务费 |
| | | BigDecimal serviceCharge = new BigDecimal("0"); |
| | | // 尖峰平谷充电到账 |
| | | BigDecimal jianElectronic = new BigDecimal("0"); |
| | | BigDecimal fengElectronic = new BigDecimal("0"); |
| | | BigDecimal pingElectronic = new BigDecimal("0"); |
| | | BigDecimal guElectronic = new BigDecimal("0"); |
| | | // 尖峰平谷服务费 |
| | | BigDecimal jianService = new BigDecimal("0"); |
| | | BigDecimal fengService = new BigDecimal("0"); |
| | | BigDecimal pingService = new BigDecimal("0"); |
| | | BigDecimal guService = new BigDecimal("0"); |
| | | // 尖峰平谷充电量 度数 |
| | | BigDecimal jian = new BigDecimal("0"); |
| | | BigDecimal feng = new BigDecimal("0"); |
| | | 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()); |
| | | 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()); |
| | | break; |
| | | case 2: |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | fengElectronic = fengElectronic.add(temp.getChargingCapacity()); |
| | | fengService = fengService.add(temp.getChargingCapacity()); |
| | | break; |
| | | case 3: |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | pingElectronic = pingElectronic.add(temp.getChargingCapacity()); |
| | | pingService = pingService.add(temp.getChargingCapacity()); |
| | | break; |
| | | case 4: |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | guElectronic = guElectronic.add(temp.getChargingCapacity()); |
| | | guService = guService.add(temp.getChargingCapacity()); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | chargingOrderTimeVO.setChargingCapacity(electronic); |
| | | chargingOrderTimeVO.setPaymentAmount(paymentAmount); |
| | | chargingOrderTimeVO.setElectrovalence(electrovalence); |
| | | chargingOrderTimeVO.setServiceCharge(serviceCharge); |
| | | // 计算尖峰平谷充电量占比 |
| | | BigDecimal add = jianElectronic.add(fengElectronic).add(pingElectronic).add(guElectronic); |
| | | // 计算尖峰平谷服务费占比 |
| | | BigDecimal add1 = jianService.add(fengService).add(pingService).add(guService); |
| | | // 计算尖峰平谷充电到账占比 |
| | | BigDecimal add2 = jian.add(feng).add(ping).add(gu); |
| | | 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"))+"%/" |
| | | +pingElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +guElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%"); |
| | | chargingOrderTimeVO.setServiceProportion(jianService+"元/"+fengService+"元/"+pingService+"元/"+guService+"元-" |
| | | +jianService.divide(add1,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +fengService.divide(add1,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +pingService.divide(add1,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +guService.divide(add1,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%"); |
| | | chargingOrderTimeVO.setElectronicProportion(jian+"元/"+feng+"元/"+ping+"元/"+gu+"元-" |
| | | +jian.divide(add2,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"))+"%"); |
| | | chargingOrderTimeVO.setList(pageInfo); |
| | | return chargingOrderTimeVO; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserAddressClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private AppUserAddressClient appUserAddressClient; |
| | | |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query) { |
| | | public Map<String, Object> getMyExchangeOrder(GetMyExchangeOrder query) { |
| | | Long userid = tokenService.getLoginUserApplet().getUserId(); |
| | | LambdaQueryWrapper<TExchangeOrder> wrapper = new LambdaQueryWrapper<TExchangeOrder>().eq(TExchangeOrder::getDelFlag, 0).eq(TExchangeOrder::getAppUserId, userid); |
| | | if(query.getStatus() == 0){ |
| | |
| | | }else{ |
| | | wrapper.eq(TExchangeOrder::getStatus, query.getStatus()); |
| | | } |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + query.getPageCurr() + "," + query.getPageSize())); |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + pageCurr + "," + query.getPageSize())); |
| | | List<MyExchangeOrderList> pageList = new ArrayList<>(); |
| | | for (TExchangeOrder tExchangeOrder : list) { |
| | | MyExchangeOrderList exchangeOrderList = new MyExchangeOrderList(); |
| | |
| | | exchangeOrderList.setImgUrl(imgUrl); |
| | | pageList.add(exchangeOrderList); |
| | | } |
| | | return pageList; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", pageList); |
| | | map.put("total", count); |
| | | return map; |
| | | } |
| | | |
| | | |
| | |
| | | ExchangeOrderGoodsInfo info = new ExchangeOrderGoodsInfo(); |
| | | info.setId(id); |
| | | info.setStatus(exchangeOrder.getStatus()); |
| | | if(null != exchangeOrder.getAppUserAddressId()){ |
| | | TAppUserAddress userAddress = appUserAddressClient.getAppUserAddressById(exchangeOrder.getAppUserAddressId()).getData(); |
| | | info.setConsignee(userAddress.getName()); |
| | | info.setPhone(userAddress.getPhone()); |
| | | info.setAddress(userAddress.getAddress()); |
| | | } |
| | | info.setExpressCompany(exchangeOrder.getExpressCompany()); |
| | | info.setExpressNumber(exchangeOrder.getExpressNumber()); |
| | | String name = ""; |
| | |
| | | info.setCreateTime(exchangeOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | info.setPoints(exchangeOrder.getPoints()); |
| | | info.setRemark(exchangeOrder.getRemark()); |
| | | if(null != exchangeOrder.getConsignerTime()){ |
| | | info.setDeliveryTime(exchangeOrder.getConsignerTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | if(null != exchangeOrder.getReceivingTime()){ |
| | | info.setFinishTime(exchangeOrder.getReceivingTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | return info; |
| | | } |
| | | |
| | |
| | | } |
| | | PageInfo<TExchangeOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TExchangeOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2); |
| | | |
| | | for (TExchangeOrder tShoppingOrder : list) { |
| | | tShoppingOrder.setUid(tShoppingOrder.getId().toString()); |
| | | switch (tShoppingOrder.getOrderType()){ |
| | | case 1: |
| | | TGoods data = goodsClient.getGoodsById(tShoppingOrder.getGoodsId()).getData(); |
| | | if (data!=null){ |
| | | tShoppingOrder.setName(data.getName()); |
| | | } |
| | | break; |
| | | case 2: |
| | | TCoupon data1 = couponClient.getCouponById1(tShoppingOrder.getCouponId()).getData(); |
| | | if (data1!=null){ |
| | | tShoppingOrder.setName(data1.getName()); |
| | | } |
| | | break; |
| | | } |
| | | if (tShoppingOrder.getAppUserId() != null){ |
| | | TAppUser data = appUserClient.getUserById(tShoppingOrder.getAppUserId()).getData(); |
| | | if (data!=null){ |
| | | tShoppingOrder.setPhone(data.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | |
| | | import com.ruoyi.order.mapper.*; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TOrderAppealService; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private TChargingOrderMapper chargingOrderMapper; |
| | | @Autowired |
| | | private TExchangeOrderMapper exchangeOrderMapper; |
| | | @Autowired |
| | | private TShoppingOrderMapper shoppingOrderMapper; |
| | | @Autowired |
| | | private TVipOrderMapper vipOrderMapper; |
| | | private GoodsClient goodsClient; |
| | | @Autowired |
| | | private ChargingGunClient chargingGunClient; |
| | | |
| | | @Override |
| | | public PageInfo<TOrderAppealVO> pageList(TOrderAppealQuery query) { |
| | |
| | | // 查询当前页的订单 |
| | | List<TChargingOrder> chargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .in(TChargingOrder::getId, orderIds)); |
| | | List<TExchangeOrder> exchangeOrders = exchangeOrderMapper.selectList(Wrappers.lambdaQuery(TExchangeOrder.class) |
| | | .in(TExchangeOrder::getId, orderIds)); |
| | | List<TShoppingOrder> shoppingOrders = shoppingOrderMapper.selectList(Wrappers.lambdaQuery(TShoppingOrder.class) |
| | | .in(TShoppingOrder::getId, orderIds)); |
| | | List<TVipOrder> vipOrders = vipOrderMapper.selectList(Wrappers.lambdaQuery(TVipOrder.class) |
| | | .in(TVipOrder::getId, orderIds)); |
| | | list.forEach(item -> { |
| | | if (item.getOrderType() == 1) { |
| | | TChargingOrder tChargingOrder = chargingOrders.stream().filter(chargingOrder -> chargingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null); |
| | | if(Objects.nonNull(tChargingOrder)){ |
| | | item.setChargingOrder(chargingOrders.stream().filter(chargingOrder -> chargingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | SiteNameVO siteNameVO = chargingGunClient.getAllInfoById(tChargingOrder.getChargingGunId()).getData(); |
| | | item.setGunName(siteNameVO.getGunName()); |
| | | item.setGunNumber(siteNameVO.getGunNumber()); |
| | | item.setPileName(siteNameVO.getPileName()); |
| | | item.setPileNumber(siteNameVO.getPileNumber()); |
| | | item.setSiteName(siteNameVO.getSiteName()); |
| | | } |
| | | } else if (item.getOrderType() == 2) { |
| | | item.setExchangeOrder(exchangeOrders.stream().filter(exchangeOrder -> exchangeOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | }else if (item.getOrderType() == 3) { |
| | | item.setShoppingOrder(shoppingOrders.stream().filter(shoppingOrder -> shoppingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | }else if (item.getOrderType() == 4) { |
| | | item.setVipOrder(vipOrders.stream().filter(vipOrder -> vipOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | TShoppingOrder tShoppingOrder = shoppingOrders.stream().filter(shoppingOrder -> shoppingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null); |
| | | setGoodsInfo(item,tShoppingOrder); |
| | | } |
| | | }); |
| | | list.forEach(e->e.setUid(e.getId().toString())); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public TOrderAppealVO getDetailById(Integer id) { |
| | | public TOrderAppealVO getDetailById(String id) { |
| | | TOrderAppeal orderAppeal = this.baseMapper.selectById(id); |
| | | TOrderAppealVO orderAppealVO = new TOrderAppealVO(); |
| | | BeanUtils.copyProperties(orderAppeal,orderAppealVO); |
| | |
| | | if (orderAppeal.getOrderType() == 1) { |
| | | orderAppealVO.setChargingOrder(chargingOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | } else if (orderAppeal.getOrderType() == 2) { |
| | | orderAppealVO.setExchangeOrder(exchangeOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | }else if (orderAppeal.getOrderType() == 3) { |
| | | orderAppealVO.setShoppingOrder(shoppingOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | }else if (orderAppeal.getOrderType() == 4) { |
| | | orderAppealVO.setVipOrder(vipOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | TShoppingOrder tShoppingOrder = shoppingOrderMapper.selectById(orderAppeal.getOrderId()); |
| | | setGoodsInfo(orderAppealVO,tShoppingOrder); |
| | | } |
| | | return orderAppealVO; |
| | | } |
| | | |
| | | private void setGoodsInfo(TOrderAppealVO orderAppealVO,TShoppingOrder tShoppingOrder){ |
| | | if(Objects.nonNull(tShoppingOrder)){ |
| | | orderAppealVO.setShoppingOrder(tShoppingOrder); |
| | | TGoods goods = goodsClient.getGoodsById(tShoppingOrder.getGoodsId()).getData(); |
| | | if(Objects.nonNull(goods)){ |
| | | orderAppealVO.setGoodsName(goods.getName()); |
| | | orderAppealVO.setGoodsPicture(goods.getCoverPicture()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public AjaxResult addOrderInvoice(AddOrderInvoice addOrderInvoice) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | String orders = addOrderInvoice.getOrders(); |
| | | if(StringUtils.isNotEmpty(orders)){ |
| | | if(StringUtils.isEmpty(orders)){ |
| | | return AjaxResult.error("请选择有效的订单"); |
| | | } |
| | | JSONArray parse = JSONArray.parse(orders); |
| | |
| | | import com.ruoyi.account.api.dto.GrantCouponDto; |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserAddressClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private CouponClient couponClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private AppUserAddressClient appUserAddressClient; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MyShoppingOrderList> getMyShoppingOrderList(GetMyShoppingOrderList query) { |
| | | public Map<String, Object> getMyShoppingOrderList(GetMyShoppingOrderList query) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | LambdaQueryWrapper<TShoppingOrder> wrapper = new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getAppUserId, userId); |
| | | if(query.getStatus() != 0){ |
| | | wrapper.eq(TShoppingOrder::getStatus, query.getStatus()); |
| | | } |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + query.getPageCurr() + ", " + query.getPageSize())); |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + pageCurr + ", " + query.getPageSize())); |
| | | List<MyShoppingOrderList> pageList = new ArrayList<>(); |
| | | for (TShoppingOrder tShoppingOrder : list) { |
| | | MyShoppingOrderList myShoppingOrderList = new MyShoppingOrderList(); |
| | |
| | | myShoppingOrderList.setOrderType(tShoppingOrder.getOrderType()); |
| | | pageList.add(myShoppingOrderList); |
| | | } |
| | | return pageList; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", pageList); |
| | | map.put("total", count); |
| | | return map; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | PageInfo<TShoppingOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TShoppingOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2); |
| | | for (TShoppingOrder tShoppingOrder : list) { |
| | | tShoppingOrder.setUid(tShoppingOrder.getId().toString()); |
| | | switch (tShoppingOrder.getOrderType()){ |
| | | case 1: |
| | | TGoods data = goodsClient.getGoodsById(tShoppingOrder.getGoodsId()).getData(); |
| | | if (data!=null){ |
| | | tShoppingOrder.setName(data.getName()); |
| | | } |
| | | break; |
| | | case 2: |
| | | TCoupon data1 = couponClient.getCouponById1(tShoppingOrder.getCouponId()).getData(); |
| | | if (data1!=null){ |
| | | tShoppingOrder.setName(data1.getName()); |
| | | } |
| | | break; |
| | | } |
| | | if (tShoppingOrder.getAppUserId() != null){ |
| | | TAppUser data = appUserClient.getUserById(tShoppingOrder.getAppUserId()).getData(); |
| | | if (data!=null){ |
| | | tShoppingOrder.setPhone(data.getPhone()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | import com.ruoyi.order.api.query.VipShoppingOrderQuery; |
| | | import com.ruoyi.order.mapper.TVipOrderMapper; |
| | | import com.ruoyi.order.service.TVipOrderService; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class TVipOrderServiceImpl extends ServiceImpl<TVipOrderMapper, TVipOrder> implements TVipOrderService { |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @Override |
| | | public PageInfo<TVipOrder> pageList(VipShoppingOrderQuery query) { |
| | | String startTime1 = null; |
| | |
| | | } |
| | | PageInfo<TVipOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TVipOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2); |
| | | |
| | | for (TVipOrder tVipOrder : list) { |
| | | tVipOrder.setUid(tVipOrder.getId().toString()); |
| | | tVipOrder.setUserUid(tVipOrder.getAppUserId().toString()); |
| | | TVip data = vipClient.getInfo(tVipOrder.getVipId()).getData(); |
| | | if (data!=null){ |
| | | tVipOrder.setName(data.getName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | and t1.charging_gun_id = #{req.gunId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.start_time between #{startTime1} and #{startTime2} |
| | | and (t1.start_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="endTime1 != null and endTime1!=''"> |
| | | and (t1.end_time between #{endTime1} and #{endTime2} |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | <select id="payOrderQuery" resultType="com.ruoyi.order.dto.PayOrderDto"> |
| | |
| | | payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_charging_order UNION ALL |
| | | SELECT |
| | |
| | | payment_amount , |
| | | create_time, |
| | | receiving_time as end_time, |
| | | pay_time |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_shopping_order UNION ALL |
| | | SELECT |
| | |
| | | payment_amount , |
| | | create_time, |
| | | create_time as end_time, |
| | | pay_time |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag |
| | | FROM |
| | | charging_pile_order.t_vip_order UNION ALL |
| | | SELECT |
| | |
| | | order_amount as payment_amount, |
| | | create_time, |
| | | out_parking_time as end_time, |
| | | out_parking_time as pay_time |
| | | out_parking_time as pay_time, |
| | | null as refund_status, |
| | | 0 as final_amount, |
| | | 0 as del_flag |
| | | FROM |
| | | charging_pile_service.t_parking_record ) o |
| | | <where> |
| | | o.del_flag = 0 |
| | | <if test="data.code != null and data.code != ''"> |
| | | AND o.code LIKE CONCAT('%',#{data.code},'%') |
| | | </if> |
| | |
| | | <if test="data.type != null"> |
| | | AND o.type = #{data.type} |
| | | </if> |
| | | <if test="data.status != null"> |
| | | AND o.status = #{data.status} |
| | | </if> |
| | | |
| | | <if test="data.createTime1 != null"> |
| | | AND o.create_time >= #{data.createTime1} |
| | | </if> |
| | |
| | | AND o.create_time <= #{data.createTime2} |
| | | </if> |
| | | </where> |
| | | |
| | | ORDER BY o.create_time desc |
| | | |
| | | </select> |
| | | <select id="getRefundList" resultType="com.ruoyi.order.api.model.TChargingOrderRefund"> |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="chargingList" 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.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="null != req.carIds and req.carIds.size()>0" > |
| | | and t1.app_user_car_id in |
| | | <foreach collection="req.carIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.orderType != null "> |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.siteId != null "> |
| | | and t1.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.start_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="endTime1 != null and endTime1!=''"> |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | <select id="chargingList1" 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.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="null != req.carIds and req.carIds.size()>0" > |
| | | and t1.app_user_car_id in |
| | | <foreach collection="req.carIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.orderType != null "> |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.siteId != null "> |
| | | and t1.site_id = #{req.siteId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.start_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="endTime1 != null and endTime1!=''"> |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | @ResponseBody |
| | | @GetMapping("/getRandomEvaluationTag") |
| | | @ApiOperation(value = "获取随机的4个评价标签", tags = {"小程序-充电记录"}) |
| | | public AjaxResult<List<TEvaluationTag>> getRandomEvaluationTag(){ |
| | | List<TEvaluationTag> list = evaluationTagService.list(new LambdaQueryWrapper<TEvaluationTag>().last(" order by RAND() limit 0, 4")); |
| | | public AjaxResult<List<TEvaluationTag>> getRandomEvaluationTag(Integer type){ |
| | | List<TEvaluationTag> list = evaluationTagService.list(new LambdaQueryWrapper<TEvaluationTag>().eq(TEvaluationTag::getType, type) |
| | | .last(" order by RAND() limit 0, 4")); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |