ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -57,10 +58,12 @@ @ApiModelProperty(value = "会员开始时间") @TableField("start_time") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDateTime startTime; @ApiModelProperty(value = "会员结束时间") @TableField("end_time") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private LocalDateTime endTime; @TableField("create_time") ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -5,12 +5,12 @@ import com.ruoyi.account.api.vo.GetAppUserVipDetail; import com.ruoyi.account.service.TAppUserVipDetailService; import com.ruoyi.common.core.domain.R; 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 com.ruoyi.common.security.service.TokenService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * @author zhibing.pu @@ -22,6 +22,8 @@ @Resource private TAppUserVipDetailService appUserVipDetailService; @Resource private TokenService tokenService; /** * 获取用户当前有效的vip明细 @@ -37,5 +39,13 @@ return R.ok(one); } @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(); return R.ok(list); } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -1,4 +1,5 @@ package com.ruoyi.order.controller; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -91,15 +92,23 @@ private TVipOrderService vipOrderService; @Resource private ParkingLotClient parkingLotClient; @Resource private TChargingOrderRefundService chargingOrderRefundService; @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; @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 = "/pay/order/list") @@ -159,12 +168,11 @@ // payOrderInfoDto3.setRefundAmount(new BigDecimal("0")); } return R.ok(); } @ResponseBody @GetMapping(value = "/pay/order/refund/detail") @ApiOperation(value = "退款信息", tags = {"管理后台-支付订单-订单信息"}) @@ -201,6 +209,7 @@ payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); return R.ok(); } @ResponseBody @GetMapping(value = "/pay/order/charging/details") @ApiOperation(value = "充电明细", tags = {"管理后台-支付订单-订单信息"}) @@ -208,7 +217,6 @@ List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); return R.ok(list); } @ResponseBody @@ -220,9 +228,6 @@ } @ResponseBody @PostMapping(value = "/chargingOrder") @ApiOperation(value = "充电桩订单列表", tags = {"管理后台-订单管理"}) @@ -232,6 +237,7 @@ TCharingOrderVO res = chargingOrderService.chargingOrder(dto); return AjaxResult.success(res); } @ResponseBody @PostMapping(value = "/chargingOrderInfo") @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"}) @@ -248,8 +254,10 @@ orderEvaluateService.addOrderEvaluate(dto); return AjaxResult.success(); } /** * 查询用户最近一次充电记录使用的车辆 * * @param * @return */ @@ -269,6 +277,7 @@ /** * 查询会员在本月有多少次享受了充电折扣 * * @param req * @return */ @@ -280,6 +289,7 @@ .between(TChargingOrder::getStartTime, req.getStartTime(), req.getEndTime())).size(); return R.ok(size); } //用户订单数量 @PostMapping(value = "/useOrderCount") public R<Long> useOrderCount(@RequestParam("userId") Long userId) { @@ -287,6 +297,7 @@ return R.ok(count); } //订单详情 @PostMapping(value = "/detail") public R<TChargingOrder> detail(@RequestParam("orderId") Long orderId) { @@ -295,6 +306,7 @@ /** * 根据充电枪id获取正在进行中的订单 * * @param chargingGunId 充电枪id * @return */ @@ -304,8 +316,6 @@ .eq(TChargingOrder::getDelFlag, 0).eq(TChargingOrder::getStatus, 3)); return R.ok(one); } @ResponseBody @@ -326,7 +336,6 @@ } @ResponseBody @GetMapping(value = "/getNoInvoicedOrder") @ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"}) @@ -334,7 +343,6 @@ List<MyChargingOrderList> list = chargingOrderService.getNoInvoicedOrder(query); return AjaxResult.success(list); } @ResponseBody @@ -346,6 +354,7 @@ /** * 充电充值支付回调 * * @param request */ @ResponseBody @@ -387,7 +396,6 @@ } @ResponseBody @GetMapping(value = "/preChargeCheck/{id}") @ApiOperation(value = "获取安全检测数据", tags = {"小程序-扫一扫"}) @@ -401,7 +409,6 @@ } @ResponseBody @GetMapping(value = "/getChargingDetails/{id}") @ApiOperation(value = "获取充电中页面数据", tags = {"小程序-扫一扫"}) @@ -412,7 +419,6 @@ ChargingDetails chargingDetails = chargingOrderService.getChargingDetails(id); return AjaxResult.success(chargingDetails); } @ResponseBody ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderRefundServiceImpl.java
New file @@ -0,0 +1,15 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.order.api.model.TChargingOrderRefund; import com.ruoyi.order.mapper.TChargingOrderRefundMapper; import com.ruoyi.order.service.TChargingOrderRefundService; import org.springframework.stereotype.Service; /** * @author zhibing.pu * @date 2024/8/28 15:18 */ @Service public class TChargingOrderRefundServiceImpl extends ServiceImpl<TChargingOrderRefundMapper, TChargingOrderRefund> implements TChargingOrderRefundService { } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderRefundServiceImpl.java
New file @@ -0,0 +1,15 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.order.api.model.TShoppingOrderRefund; import com.ruoyi.order.mapper.TShoppingOrderRefundMapper; import com.ruoyi.order.service.TShoppingOrderRefundService; import org.springframework.stereotype.Service; /** * @author zhibing.pu * @date 2024/8/28 15:16 */ @Service public class TShoppingOrderRefundServiceImpl extends ServiceImpl<TShoppingOrderRefundMapper, TShoppingOrderRefund> implements TShoppingOrderRefundService { } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
@@ -186,7 +186,7 @@ name = goods.getName(); imgUrl = goods.getCoverPicture(); }else{ TCoupon coupon = couponClient.getCouponById1(tShoppingOrder.getGoodsId()).getData(); TCoupon coupon = couponClient.getCouponById1(tShoppingOrder.getCouponId()).getData(); name = coupon.getName(); imgUrl = coupon.getCoverPicture(); } @@ -227,7 +227,7 @@ name = goods.getName(); imgUrl = goods.getCoverPicture(); }else{ TCoupon coupon = couponClient.getCouponById1(shoppingOrder.getGoodsId()).getData(); TCoupon coupon = couponClient.getCouponById1(shoppingOrder.getCouponId()).getData(); info.setCouponType(coupon.getType()); info.setDays(coupon.getDays()); info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); @@ -243,8 +243,12 @@ info.setCreateTime(shoppingOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); info.setPaymentAmount(shoppingOrder.getPaymentAmount()); info.setRemark(shoppingOrder.getRemark()); if(null != shoppingOrder.getConsignerTime()){ info.setDeliveryTime(shoppingOrder.getConsignerTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); } if(null != shoppingOrder.getReceivingTime()){ info.setFinishTime(shoppingOrder.getReceivingTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); } return info; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TVipOrderRefundServiceImpl.java
New file @@ -0,0 +1,15 @@ package com.ruoyi.order.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.order.api.model.TVipOrderRefund; import com.ruoyi.order.mapper.TVipOrderRefundMapper; import com.ruoyi.order.service.TVipOrderRefundService; import org.springframework.stereotype.Service; /** * @author zhibing.pu * @date 2024/8/28 15:19 */ @Service public class TVipOrderRefundServiceImpl extends ServiceImpl<TVipOrderRefundMapper, TVipOrderRefund> implements TVipOrderRefundService { }