Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("发放优惠券-选择人员列表DTO") |
| | | public class ChoiceUserListQueryDto extends BasePage { |
| | | @ApiModelProperty(value = "用户手机号") |
| | | String userPhone; |
| | | @ApiModelProperty(value = "市code") |
| | | String cityCode; |
| | | @ApiModelProperty(value = "省code") |
| | | String provinceCode; |
| | | @ApiModelProperty(value = "用户标签ids 多个逗号分隔") |
| | | String userTagId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("管理后台发放优惠券DTO") |
| | | public class GrantCouponDto { |
| | | @ApiModelProperty("用户ids 逗号分隔") |
| | | private String userIds; |
| | | @ApiModelProperty("优惠券id") |
| | | private Integer couponId; |
| | | @ApiModelProperty("发放方式 1积分 2现金") |
| | | private Integer waysToObtain; |
| | | @ApiModelProperty("结束时间 前端忽略") |
| | | private LocalDateTime endTime; |
| | | } |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserListQueryDto extends BasePage { |
| | | private String userPhone; |
| | | private String cityCode; |
| | | private Integer status; |
| | | private Integer userTagId; |
| | | private Integer vipTypeId; |
| | | private Integer companyId; |
| | | @ApiModelProperty(value = "用户手机号") |
| | | String userPhone; |
| | | @ApiModelProperty(value = "所在地code") |
| | | String cityCode; |
| | | @ApiModelProperty(value = "状态 1正常2冻结 3注销") |
| | | Integer status; |
| | | @ApiModelProperty(value = "用户标签id") |
| | | Integer userTagId; |
| | | @ApiModelProperty(value = "会员类型id") |
| | | Integer vipTypeId; |
| | | @ApiModelProperty(value = "单位id") |
| | | Integer companyId; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | public R<Integer> getUseCountByCouponId(Integer couponId) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<PageInfo<ExchangeRecordVO>> getExchangeRecordByCouponId(ExchangeRecordGoodsQuery couponId) { |
| | | return R.fail("根据优惠券id查询领取记录:"+throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.api.factory; |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 门店服务降级处理 |
| | |
| | | public AppUserClient create(Throwable throwable) { |
| | | log.error("账户服务调用失败:{}", throwable.getMessage()); |
| | | return new AppUserClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<List<Long>> getUserIdsByPhone(String phone) { |
| | | return R.fail("根据手机号查询用户ids失败:"+throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.account.api.factory.AppCouponFallbackFactory; |
| | | import com.ruoyi.account.api.factory.AppUserFallbackFactory; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 用户服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "AppCouponClient", value = ServiceNameConstants.CONTRACT_ACCOUNT, fallbackFactory = AppCouponFallbackFactory.class) |
| | | @FeignClient(contextId = "AppCouponClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppCouponFallbackFactory.class) |
| | | public interface AppCouponClient { |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/t-app-coupon/getUseCountByCouponId") |
| | | public R<Integer> getUseCountByCouponId(Integer couponId); |
| | | /** |
| | | * 后台远程调用 根据优惠券id 查询领取记录 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-app-coupon/getExchangeRecordByCouponId") |
| | | R<PageInfo<ExchangeRecordVO>> getExchangeRecordByCouponId(@RequestBody ExchangeRecordGoodsQuery couponId); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.account.api.factory.AppUserFallbackFactory; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "AppUserClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = AppUserFallbackFactory.class) |
| | | @FeignClient(contextId = "AppUserClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppUserFallbackFactory.class) |
| | | public interface AppUserClient { |
| | | |
| | | @ApiOperation(value = "管理后台-根据手机号查询用户ids", tags = {"管理后台-活动费用统计"}) |
| | | @PostMapping(value = "/t-app-user/user/getUserIdsByPhone") |
| | | public R<List<Long>> getUserIdsByPhone(@RequestParam("phone") String phone); |
| | | |
| | | } |
| | |
| | | @ApiModel("管理后台 优惠券兑换记录列表返回VO") |
| | | public class ExchangeRecordVO { |
| | | @ApiModelProperty(value = "获得时间") |
| | | private String createTime; |
| | | private String createTime1; |
| | | @ApiModelProperty(value = "获得时间 前端忽略") |
| | | private LocalDateTime createTime; |
| | | @ApiModelProperty(value = "获得用户") |
| | | private String phone; |
| | | @ApiModelProperty(value = "优惠金额") |
| | |
| | | private String orderId; |
| | | @ApiModelProperty(value = " 前端忽略 获取方式 1=积分兑换 2现金购买") |
| | | private Integer waysToObtain; |
| | | @ApiModelProperty(value = " 是否删除0否1是") |
| | | @ApiModelProperty(value = "优惠券id") |
| | | private Integer couponId; |
| | | @ApiModelProperty(value = " 是否删除0否1是 前端忽略") |
| | | private Integer delFlag; |
| | | @ApiModelProperty(value = "三方支付流水号 前端忽略") |
| | | private String serialNumber; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.api.factory; |
| | | |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 充电桩服务降级处理 |
| | |
| | | public ChargingPileClient create(Throwable throwable) { |
| | | log.error("充电桩调用失败:{}", throwable.getMessage()); |
| | | return new ChargingPileClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<List<TChargingPile>> getChargingPileBySiteId(Integer siteId) { |
| | | return R.fail("通过站点id获取充电桩列表失败:"+throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.api.feignClient; |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingPileFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 充电桩服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingPileClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ChargingPileFallbackFactory.class) |
| | | @FeignClient(contextId = "ChargingPileClient", value = ServiceNameConstants.CHARGINGPILE_SERVICE, fallbackFactory = ChargingPileFallbackFactory.class) |
| | | public interface ChargingPileClient { |
| | | |
| | | /** |
| | | * 管理后台-通过站点id获取充电桩列表 不分页 |
| | | */ |
| | | @ApiOperation(value = "管理后台-通过站点id获取充电桩列表 不分页") |
| | | @PostMapping(value = "/t-charging-pile/getChargingPileBySiteId") |
| | | public R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId); |
| | | |
| | | } |
| | |
| | | * 充电订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingPileClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ChargingPileFallbackFactory.class) |
| | | @FeignClient(contextId = "ChargingPileClient", value = ServiceNameConstants.INTEGRATION_SERVICE, fallbackFactory = ChargingPileFallbackFactory.class) |
| | | public interface ChargingPileClient { |
| | | |
| | | |
| | |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | |
| | | @Override |
| | | public R<List<Integer>> getSalesCountByGoodsId(String goodsIds) { |
| | | return null; |
| | | return R.fail("根据商品订单ids查询销量:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> getCodeByOrderId(String goodsIds) { |
| | | return R.fail("根据订单ids查询现金购买优惠券订单编号:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TActivityVO> activityStatistics(TActivityStatisticsQuery dto) { |
| | | return R.fail("查询活动费用统计失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | * 充电订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ChargingOrderFallbackFactory.class) |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ChargingOrderFallbackFactory.class) |
| | | public interface ChargingOrderClient { |
| | | @PostMapping(value = "/t-charging-order/useOrderCount") |
| | | R<Long> useOrderCount(@RequestParam Long userId); |
| | |
| | | * 充电订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ExchangeOrderFallbackFactory.class) |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ExchangeOrderFallbackFactory.class) |
| | | public interface ExchangeOrderClient { |
| | | |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory; |
| | | import com.ruoyi.order.api.factory.OrderFallbackFactory; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 后台订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.CONTRACT_ORDER, fallbackFactory = OrderFallbackFactory.class) |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderFallbackFactory.class) |
| | | public interface OrderClient { |
| | | |
| | | @PostMapping("/t-exchange-order/getSalesCountByGoodsIds") |
| | | R<List<Integer>> getSalesCountByGoodsId(String goodsIds); |
| | | |
| | | /** |
| | | * 管理后台 根据t_app_coupon订单购买或者兑换优惠券的订单编号 |
| | | * @param goodsIds 订单号-商品类型 |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-exchange-order/getCodeByOrderId") |
| | | public R<List<String>> getCodeByOrderId(String goodsIds); |
| | | /** |
| | | * 管理后台 活动费用统计 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/t-exchange-order/activityStatistics") |
| | | public R<TActivityVO> activityStatistics(@RequestBody TActivityStatisticsQuery dto); |
| | | } |
| | |
| | | @TableField("app_user_car_id") |
| | | private Integer appUserCarId; |
| | | |
| | | @ApiModelProperty(value = "站点 id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "停车场id") |
| | | @TableField("parking_lot_id") |
| | | private Integer parkingLotId; |
New file |
| | |
| | | package com.ruoyi.order.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | 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; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_grant_vip") |
| | | @ApiModel(value="TGrantVip对象", description="") |
| | | public class TGrantVip extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "购买的会员id") |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | @ApiModelProperty(value = "购买的会员id") |
| | | @TableField("vip_id") |
| | | private BigDecimal orderAmount; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台-活动费用统计Query") |
| | | public class TActivityStatisticsQuery extends BasePage { |
| | | @ApiModelProperty(value = "用户电话") |
| | | private String phone; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "参与类型1优惠券 2会员抵扣 3会员活动 4赠送会员") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "订单类型1充电订单 2商品订单 3会员订单 4赠送会员") |
| | | private Integer orderType; |
| | | @ApiModelProperty(value = "电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "消费时间开始(2020-01-02 00:00)") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "消费时间结束(2020-01-02 00:00)") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "用户ids 前端忽略") |
| | | private List<Long> userIds; |
| | | @ApiModelProperty(value = "充电桩ids 前端忽略") |
| | | private List<Integer> chargingPileIds; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderEvaluateQuery对象",description = "订单评价查询条件") |
| | | public class TOrderEvaluateQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "订单id集合 前端忽略") |
| | | private List<Long> orderIds; |
| | | |
| | | @ApiModelProperty(value = "标签类型 1=最新 2=有图 3=好评 4=中差评 5=其他") |
| | | private Integer tagType; |
| | | |
| | | @ApiModelProperty(value = "标签id 标签类型为5时传输此字段") |
| | | private Integer tagId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.ser.Serializers; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.order.api.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "管理后台活动费用统计分页列表", description = "管理后台活动费用统计分页列表") |
| | | public class TActivityStatisticslVO extends BasePojo { |
| | | |
| | | @ApiModelProperty(value = "用户手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "参与类型 优惠券 会员抵扣 会员活动 赠送会员") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "订单类型 充电订单 商品订单 会员订单 赠送会员") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "应付/价值") |
| | | private BigDecimal orderAmount; |
| | | @ApiModelProperty(value = "优惠券抵扣") |
| | | private BigDecimal couponDiscountAmount; |
| | | @ApiModelProperty(value = "会员抵扣") |
| | | private BigDecimal vipDiscountAmount; |
| | | @ApiModelProperty(value = "实付") |
| | | private BigDecimal paymentAmount; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private String time; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private BigDecimal total; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private BigDecimal coupon; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private BigDecimal discount; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private BigDecimal vipActivity; |
| | | @ApiModelProperty(value = "消费时间") |
| | | private BigDecimal grantVip; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | 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; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderAppealVO对象", description = "订单申诉VO对象") |
| | | public class TActivityVO { |
| | | @ApiModelProperty(value = "分页列表") |
| | | private PageInfo<TActivityStatisticslVO> list; |
| | | @ApiModelProperty(value = "优惠总额") |
| | | private BigDecimal total; |
| | | @ApiModelProperty(value = "优惠券总额") |
| | | private BigDecimal coupon; |
| | | @ApiModelProperty(value = "会员抵扣总额") |
| | | private BigDecimal discount; |
| | | @ApiModelProperty(value = "会员活动") |
| | | private BigDecimal vipActivity; |
| | | @ApiModelProperty(value = "赠送会员") |
| | | private BigDecimal grantVip; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderEvaluateVO对象",description = "订单评价") |
| | | public class TOrderEvaluateVO extends TOrderEvaluate { |
| | | |
| | | @ApiModelProperty(value = "用户") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.TEvaluationTagClient; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 评价标签服务降级处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class TEvaluationTagFallbackFactory implements FallbackFactory<TEvaluationTagClient> { |
| | | private static final Logger log = LoggerFactory.getLogger(TEvaluationTagFallbackFactory.class); |
| | | |
| | | @Override |
| | | public TEvaluationTagClient create(Throwable throwable) { |
| | | log.error("调用失败:{}", throwable.getMessage()); |
| | | return new TEvaluationTagClient() { |
| | | |
| | | @Override |
| | | public R<List<TEvaluationTagVO>> getTagList() { |
| | | return R.fail("获取标签列表:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | * 商品服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "UnitClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = OtherFallbackFactory.class) |
| | | @FeignClient(contextId = "UnitClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = OtherFallbackFactory.class) |
| | | public interface OtherClient { |
| | | //单位分页 |
| | | @PostMapping(value = "/t-company/unit/page") |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/9 18:14 |
| | | */ |
| | | @FeignClient(contextId = "RoleSiteClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = RoleSiteFallbackFactory.class) |
| | | @FeignClient(contextId = "RoleSiteClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = RoleSiteFallbackFactory.class) |
| | | public interface RoleSiteClient { |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.factory.RoleSiteFallbackFactory; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/9 18:14 |
| | | */ |
| | | @FeignClient(contextId = "TEvaluationTagClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = RoleSiteFallbackFactory.class) |
| | | public interface TEvaluationTagClient { |
| | | |
| | | |
| | | /** |
| | | * 获取标签列表 |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-evaluation-tag/getTagList") |
| | | R<List<TEvaluationTagVO>> getTagList(); |
| | | } |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/9 18:14 |
| | | */ |
| | | @FeignClient(contextId = "UserSiteClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = UserSiteFallbackFactory.class) |
| | | @FeignClient(contextId = "UserSiteClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = UserSiteFallbackFactory.class) |
| | | public interface UserSiteClient { |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.other.api.vo; |
| | | |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TEvaluationTagVO对象", description = "评价标签") |
| | | public class TEvaluationTagVO extends TEvaluationTag{ |
| | | |
| | | @ApiModelProperty(value = "评价标签数量") |
| | | private Integer tagCount; |
| | | |
| | | } |
| | |
| | | * 充电订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ChargingOrderFallbackFactory.class) |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.PAYMENT_SERVICE, fallbackFactory = ChargingOrderFallbackFactory.class) |
| | | public interface ChargingOrderClient { |
| | | |
| | | |
| | |
| | | * 文件服务的serviceid |
| | | */ |
| | | public static final String FILE_SERVICE = "ruoyi-file"; |
| | | /** |
| | | * 后台服务的serviceid |
| | | */ |
| | | public static final String MANAGEMENT_SERVICE = "ruoyi-management"; |
| | | |
| | | /** |
| | | * 车辆服务的serviceid |
| | | */ |
| | | public static final String VEHICLE_SERVICE = "ruoyi-vehicle"; |
| | | |
| | | /** |
| | | * 车辆合同的serviceid |
| | | */ |
| | | public static final String CONTRACT_SERVICE = "ruoyi-contract"; |
| | | public static final String CONTRACT_ORDER = "ruoyi-order"; |
| | | public static final String CONTRACT_ACCOUNT = "ruoyi-account"; |
| | | public static final String ACCOUNT_SERVICE = "ruoyi-account"; |
| | | public static final String CHARGINGPILE_SERVICE = "ruoyi-chargingPile"; |
| | | public static final String OTHER_SERVICE = "ruoyi-other"; |
| | | public static final String ORDER_SERVICE = "ruoyi-order"; |
| | | public static final String INTEGRATION_SERVICE = "ruoyi-integration"; |
| | | public static final String PAYMENT_SERVICE = "ruoyi-payment"; |
| | | } |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.account.api.dto.GrantCouponDto; |
| | | import com.ruoyi.account.api.model.TAppCoupon; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/getExchangeRecordByCouponId") |
| | | public R<PageInfo<ExchangeRecordVO>> getUseCountByCouponId(ExchangeRecordGoodsQuery couponId){ |
| | | public R<PageInfo<ExchangeRecordVO>> getExchangeRecordByCouponId(@RequestBody ExchangeRecordGoodsQuery couponId){ |
| | | return R.ok(tAppCouponService.pagelist(couponId)); |
| | | } |
| | | |
| | | /** |
| | | * 后台远程调用 给用户发放优惠券 |
| | | */ |
| | | @PostMapping("/grantCoupon") |
| | | public R getExchangeRecordByCouponId(@RequestBody GrantCouponDto dto){ |
| | | List<TAppCoupon> res = new ArrayList<>(); |
| | | for (String s : dto.getUserIds().split(",")) { |
| | | TAppCoupon tAppCoupon = new TAppCoupon(); |
| | | tAppCoupon.setAppUserId(Long.valueOf(s)); |
| | | tAppCoupon.setCouponId(dto.getCouponId()); |
| | | tAppCoupon.setEndTime(dto.getEndTime()); |
| | | tAppCoupon.setWaysToObtain(dto.getWaysToObtain()); |
| | | tAppCoupon.setStatus(1); |
| | | res.add(tAppCoupon); |
| | | } |
| | | tAppCouponService.saveBatch(res); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.*; |
| | |
| | | |
| | | @Resource |
| | | private ExchangeOrderClient exchangeOrderClient; |
| | | |
| | | @ApiOperation(value = "管理后台-根据手机号查询用户ids", tags = {"管理后台-活动费用统计"}) |
| | | @PostMapping(value = "/user/getUserIdsByPhone") |
| | | public R<List<Long>> getUserIdsByPhone(@RequestParam("phone") String phone) { |
| | | |
| | | return R.ok(appUserService.list(new QueryWrapper<TAppUser>().like("phone",phone)).stream().map(TAppUser::getId).collect(Collectors.toList())); |
| | | } |
| | | @ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/page") |
| | | public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) { |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券发放-选择人员") |
| | | @PostMapping("/choiceUser") |
| | | public R<Page<TAppUser>> choiceUser(@RequestBody ChoiceUserListQueryDto userListQueryDto) { |
| | | List<Long> userIds = new ArrayList<>(); |
| | | //如果要筛选标签。用标签获取useids |
| | | if (userListQueryDto.getUserTagId() != null){ |
| | | String[] split = userListQueryDto.getUserTagId().split(","); |
| | | userIds = appUserTagService.lambdaQuery().in(TAppUserTag::getUserTagId, Arrays.asList(split)).list().stream().map(TAppUserTag::getAppUserId).collect(Collectors.toList()); |
| | | } |
| | | //列表查询 |
| | | Page<TAppUser> page = appUserService.lambdaQuery() |
| | | .like(userListQueryDto.getUserPhone() != null && !"".equals(userListQueryDto.getUserPhone()), TAppUser::getPhone, userListQueryDto.getUserPhone()) |
| | | .eq(userListQueryDto.getCityCode() != null && !"".equals(userListQueryDto.getCityCode()), TAppUser::getCityCode, userListQueryDto.getCityCode()) |
| | | .eq(userListQueryDto.getProvinceCode() != null && !"".equals(userListQueryDto.getProvinceCode()), TAppUser::getProvinceCode, userListQueryDto.getProvinceCode()) |
| | | .in(!userIds.isEmpty(),TAppUser::getId,userIds) |
| | | .eq(TAppUser::getStatus,1) |
| | | .page(Page.of(userListQueryDto.getPageCurr(), userListQueryDto.getPageSize())); |
| | | if (page.getRecords().isEmpty()){ |
| | | return R.ok(page); |
| | | } |
| | | List<Integer> vipIds = new ArrayList<>(); |
| | | vipIds = page.getRecords().stream().map(TAppUser::getVipId).collect(Collectors.toList()); |
| | | //获取会员map |
| | | R<Map<Integer, String>> vipMap = otherClient.getVipMap(vipIds); |
| | | //循环处理 |
| | | for (TAppUser appUser : page.getRecords()) { |
| | | //拿到最新的tagId |
| | | TAppUserTag one = appUserTagService.lambdaQuery().eq(TAppUserTag::getAppUserId, appUser.getId()).orderByDesc(TAppUserTag::getCreateTime).last("limit 1").one(); |
| | | //设置最新的tagName |
| | | R<TUserTag> byIdTag = otherClient.getByIdTag(one.getUserTagId()); |
| | | if (byIdTag.getData()!=null) { |
| | | appUser.setTagName(byIdTag.getData().getName()); |
| | | } |
| | | //匹配vipMap的值 |
| | | appUser.setVipName(vipMap.getData().get(appUser.getVipId())); |
| | | //累计充电次数 |
| | | R<Long> useOrderCount = chargingOrderClient.useOrderCount(appUser.getId()); |
| | | appUser.setOrderCount(useOrderCount.getData()); |
| | | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户添加编辑", tags = {"用户管理-用户列表"}) |
| | |
| | | import com.ruoyi.account.service.TAppCouponService; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | @Service |
| | | public class TAppCouponServiceImpl extends ServiceImpl<TAppCouponMapper, TAppCoupon> implements TAppCouponService { |
| | | |
| | | @Autowired |
| | | private OrderClient orderClient; |
| | | @Override |
| | | public PageInfo<ExchangeRecordVO> pagelist(ExchangeRecordGoodsQuery dto) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | PageInfo<ExchangeRecordVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<ExchangeRecordVO> list = this.baseMapper.pageList(pageInfo,dto); |
| | | // 现金优惠券 |
| | | // 订单ids |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | // 积分优惠券 |
| | | StringBuilder stringBuilder1 = new StringBuilder(); |
| | | |
| | | for (ExchangeRecordVO exchangeRecordVO : list) { |
| | | switch (exchangeRecordVO.getWaysToObtain()){ |
| | | case 1: |
| | | if (exchangeRecordVO.getSerialNumber()!=null){ |
| | | stringBuilder.append(exchangeRecordVO.getSerialNumber()).append(","); |
| | | if (exchangeRecordVO.getOrderId()!=null){ |
| | | stringBuilder.append(exchangeRecordVO.getOrderId()).append(","); |
| | | }else{ |
| | | stringBuilder.append("0").append(","); |
| | | } |
| | | break; |
| | | case 2: |
| | | if (exchangeRecordVO.getSerialNumber()!=null){ |
| | | stringBuilder1.append(exchangeRecordVO.getSerialNumber()).append(","); |
| | | if (exchangeRecordVO.getOrderId()!=null){ |
| | | stringBuilder.append("-").append(exchangeRecordVO.getOrderId()).append(","); |
| | | }else{ |
| | | stringBuilder1.append("0").append(","); |
| | | stringBuilder.append("-").append("0").append(","); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | Date date = DateUtils.toDate(exchangeRecordVO.getEndTime()); |
| | | Date date1 = DateUtils.toDate(exchangeRecordVO.getCreateTime()); |
| | | exchangeRecordVO.setEndTime1(format.format(date)); |
| | | exchangeRecordVO.setCreateTime1(format.format(date1)); |
| | | if (exchangeRecordVO.getStatus()==1){ |
| | | if (exchangeRecordVO.getDelFlag() == 1){ |
| | | // 删除了 就是已取消状态 |
| | |
| | | exchangeRecordVO.setStatus(2); |
| | | } |
| | | } |
| | | // 根据购买方式 查询对应订单号 |
| | | } |
| | | |
| | | // 去除最后一个字符 |
| | | if (StringUtils.hasText(stringBuilder.toString())){ |
| | | String string = stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString(); |
| | | // 远程调用 查询关联的现金优惠券订单编号 |
| | | // 远程调用 查询关联的订单编号 |
| | | List<String> data = orderClient.getCodeByOrderId(string).getData(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setOrderId(data.get(i)); |
| | | } |
| | | } |
| | | if (StringUtils.hasText(stringBuilder.toString())){ |
| | | String string = stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString(); |
| | | // 远程调用 查询关联的积分兑换优惠券订单编号 |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getSiteList1") |
| | | @ApiOperation(value = "获取站点列表 不分页", tags = {"管理后台-活动费用统计"}) |
| | | public AjaxResult<List<Site>> getSiteList1(){ |
| | | return AjaxResult.success(siteService.list(new QueryWrapper<>())); |
| | | } |
| | | @ApiOperation(value = "获取站点分页列表", tags = {"小程序-站点管理"}) |
| | | @PostMapping("/pageList") |
| | | public AjaxResult<PageInfo<SiteVO>> pageList(@Validated @RequestBody SiteQuery query){ |
| | |
| | | |
| | | @ApiOperation(value = "获取站点下充电桩及充电枪列表", tags = {"小程序-站点管理-站点详情"}) |
| | | @GetMapping("/getChargingGunList") |
| | | public AjaxResult<List<TChargingPileVO>> getChargingGunList(@RequestParam(name = "siteId",value = "站点id")Integer siteId){ |
| | | return AjaxResult.success(chargingPileService.getChargingGunList(siteId)); |
| | | public AjaxResult<List<TChargingPileVO>> getChargingGunList(@RequestParam(value = "siteId")@ApiParam(value = "站点id", required = true)Integer siteId, |
| | | @RequestParam(value = "siteId",required = false)@ApiParam(value = "类型 1=超充,2=快充,3=慢充")Integer type){ |
| | | return AjaxResult.success(chargingPileService.getChargingGunList(siteId,type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取站点下充电枪数量统计", tags = {"小程序-站点管理-站点详情"}) |
| | | @GetMapping("/getChargingGunCount") |
| | | public AjaxResult<Map<String,ChargingGunCountVO>> getChargingGunCount(@RequestParam(name = "siteId",value = "站点id")Integer siteId){ |
| | | public AjaxResult<Map<String,ChargingGunCountVO>> getChargingGunCount(@RequestParam(value = "siteId")@ApiParam(value = "站点id", required = true)Integer siteId){ |
| | | return AjaxResult.success(chargingGunService.getChargingGunCount(siteId)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | 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.chargingPile.api.dto.PageChargingPileListDTO; |
| | |
| | | return AjaxResult.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getSiteId,siteId))); |
| | | } |
| | | /** |
| | | * 管理后台-通过站点id获取充电桩列表 不分页 |
| | | */ |
| | | @ApiOperation(value = "管理后台-通过站点id获取充电桩列表 不分页") |
| | | @PostMapping(value = "/getChargingPileBySiteId") |
| | | public R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId) { |
| | | return R.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getSiteId,siteId))); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * 获取站点下充电桩及充电枪列表 |
| | | * @param siteId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<TChargingPileVO> getChargingGunList(Integer siteId); |
| | | List<TChargingPileVO> getChargingGunList(Integer siteId,Integer type); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TChargingPileVO> getChargingGunList(Integer siteId) { |
| | | public List<TChargingPileVO> getChargingGunList(Integer siteId,Integer type) { |
| | | List<TChargingPileVO> chargingPileVOS = this.baseMapper.getChargingGunList(siteId); |
| | | List<TChargingGun> chargingGuns = chargingGunService.list(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getSiteId, siteId)); |
| | | .eq(TChargingGun::getSiteId, siteId) |
| | | .eq(TChargingGun::getChargeMode, type)); |
| | | // 查询充电枪信息 |
| | | chargingPileVOS.forEach(item -> { |
| | | List<TChargingGun> gunList = chargingGuns.stream().filter(gun -> gun.getChargingPileId().equals(item.getId())).collect(Collectors.toList()); |
| | | item.setChargingGunList(gunList); |
| | | item.setChargingGunList(chargingGuns.stream().filter(gun -> gun.getChargingPileId().equals(item.getId())).collect(Collectors.toList())); |
| | | }); |
| | | return chargingPileVOS; |
| | | } |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- ruoyi-modules-other-api --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-other</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-account</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <!-- ruoyi-modules-chargingPile-api --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-chargingPile</artifactId> |
| | | <version>3.6.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TExchangeOrderService; |
| | | import com.ruoyi.order.service.TShoppingOrderService; |
| | | import com.ruoyi.order.service.TVipOrderService; |
| | | import com.ruoyi.order.service.impl.TChargingOrderServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private TShoppingOrderService tShoppingOrderService; |
| | | @Autowired |
| | | private TExchangeOrderService exchangeOrderService; |
| | | @Autowired |
| | | private TChargingOrderService chargingOrderService; |
| | | @Autowired |
| | | private TVipOrderService vipOrderService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private ChargingPileClient chargingPileClient; |
| | | /** |
| | | * 管理后台 活动费用统计 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/activityStatistics") |
| | | public R<TActivityVO> activityStatistics(@RequestBody TActivityStatisticsQuery dto) { |
| | | if (StringUtils.hasLength(dto.getPhone())){ |
| | | // 远程调用查询出符合条件的用户ids |
| | | List<Long> data = appUserClient.getUserIdsByPhone(dto.getPhone()).getData(); |
| | | dto.setUserIds(data); |
| | | } |
| | | if (dto.getSiteId()!=null){ |
| | | // 远程调用查询出符合条件的充电桩ids |
| | | List<TChargingPile> data = chargingPileClient.getChargingPileBySiteId(dto.getSiteId()).getData(); |
| | | dto.setChargingPileIds(data.stream().map(TChargingPile::getId).collect(Collectors.toList())); |
| | | } |
| | | return R.ok(tShoppingOrderService.activityStatistics(dto)); |
| | | } |
| | | |
| | | //订单详情 |
| | | @PostMapping(value = "/detail") |
| | |
| | | return R.ok(res); |
| | | } |
| | | /** |
| | | * 管理后台 根据t_app_coupon流水号查询现金优惠券的订单编号 |
| | | * 管理后台 根据t_app_coupon订单ids查询优惠券的订单编号 |
| | | * @param goodsIds 订单号-商品类型 |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCodeBySerialNumber") |
| | | public R<List<String>> getCodeBySerialNumber(String goodsIds){ |
| | | @PostMapping("/getCodeByOrderId") |
| | | public R<List<String>> getCodeByOrderId(String goodsIds){ |
| | | String[] split = goodsIds.split("-"); |
| | | List<String> strings = new ArrayList<>(); |
| | | for (String s : split) { |
| | | TShoppingOrder one = tShoppingOrderService.getOne(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type", 2) |
| | | .eq("serial_number", s)); |
| | | if (one != null){ |
| | | strings.add(one.getCode()); |
| | | if (s.contains("-")){ |
| | | // 带有负号的是积分兑换的订单 |
| | | TExchangeOrder one = exchangeOrderService.getOne(new QueryWrapper<TExchangeOrder>() |
| | | .eq("order_type", 2) |
| | | .eq("id", s.replace("-",""))); |
| | | if (one != null){ |
| | | strings.add(one.getCode()); |
| | | }else{ |
| | | strings.add(""); |
| | | } |
| | | }else{ |
| | | strings.add(""); |
| | | TShoppingOrder one = tShoppingOrderService.getOne(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type", 2) |
| | | .eq("id", s)); |
| | | if (one != null){ |
| | | strings.add(one.getCode()); |
| | | }else{ |
| | | strings.add(""); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | return R.ok(strings); |
| | | } |
| | | /** |
| | | * 管理后台 根据t_app_coupon流水号查询积分兑换优惠券的订单编号 |
| | | * 管理后台 根据t_app_coupon订单ids查询积分兑换优惠券的订单编号 |
| | | * @param goodsIds 订单号-商品类型 |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCodeBySerialNumberIntegral") |
| | | public R<List<String>> getCodeBySerialNumberIntegral(String goodsIds){ |
| | | String[] split = goodsIds.split("-"); |
| | | List<String> strings = new ArrayList<>(); |
| | | for (String s : split) { |
| | | TExchangeOrder one = exchangeOrderService.getOne(new QueryWrapper<TExchangeOrder |
| | | >() |
| | | .eq("order_type", 2) |
| | | .eq("serial_number", s)); |
| | | if (one != null){ |
| | | strings.add(one.getCode()); |
| | | }else{ |
| | | strings.add(""); |
| | | } |
| | | } |
| | | |
| | | return R.ok(strings); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | 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.order.api.query.TOrderEvaluateQuery; |
| | | import com.ruoyi.order.api.vo.TOrderEvaluateVO; |
| | | import com.ruoyi.order.service.TOrderEvaluateService; |
| | | import com.ruoyi.other.api.feignClient.TEvaluationTagClient; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/t-order-evaluate") |
| | | public class TOrderEvaluateController { |
| | | |
| | | @Autowired |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | |
| | | |
| | | @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价标签及数量查询") |
| | | @PostMapping(value = "/getTagCount") |
| | | public AjaxResult<List<TEvaluationTagVO>> getTagCount() { |
| | | return AjaxResult.ok(orderEvaluateService.getTagCount()); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价分页列表查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TOrderEvaluateVO>> pageList(@RequestBody TOrderEvaluateQuery query) { |
| | | return AjaxResult.ok(orderEvaluateService.getTagList(query)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TGrantVip; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TGrantVipMapper extends BaseMapper<TGrantVip> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.query.TOrderEvaluateQuery; |
| | | import com.ruoyi.order.api.vo.TOrderEvaluateVO; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface TOrderEvaluateMapper extends BaseMapper<TOrderEvaluate> { |
| | | |
| | | /** |
| | | * 订单评价分页列表查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderEvaluateVO> pageList(@Param("query") TOrderEvaluateQuery query,@Param("pageInfo")PageInfo<TOrderEvaluateVO> pageInfo); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TOrderEvaluateTag; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface TOrderEvaluateTagMapper extends BaseMapper<TOrderEvaluateTag> { |
| | | |
| | | /** |
| | | * 获取标签评价数量 |
| | | * @param tagIds |
| | | * @return |
| | | */ |
| | | List<TEvaluationTagVO> getCountByTagIds(@Param("tagIds") List<Integer> tagIds); |
| | | } |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface TShoppingOrderMapper extends BaseMapper<TShoppingOrder> { |
| | | |
| | | List<TActivityStatisticslVO> activityStatistics(@Param("pageInfo") PageInfo<TActivityStatisticslVO> pageInfo, @Param("req")TActivityStatisticsQuery dto); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.order.api.model.TGrantVip; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface TGrantVipService extends IService<TGrantVip> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.query.TOrderEvaluateQuery; |
| | | import com.ruoyi.order.api.vo.TOrderEvaluateVO; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderEvaluateService extends IService<TOrderEvaluate> { |
| | | |
| | | /** |
| | | * 获取评价标签 |
| | | * @return |
| | | */ |
| | | List<TEvaluationTagVO> getTagCount(); |
| | | |
| | | /** |
| | | * 充电订单评价分页列表查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderEvaluateVO> getTagList(TOrderEvaluateQuery query); |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TShoppingOrderService extends IService<TShoppingOrder> { |
| | | |
| | | TActivityVO activityStatistics(TActivityStatisticsQuery dto); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.api.model.TGrantVip; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import com.ruoyi.order.mapper.TGrantVipMapper; |
| | | import com.ruoyi.order.mapper.TVipOrderMapper; |
| | | import com.ruoyi.order.service.TGrantVipService; |
| | | import com.ruoyi.order.service.TVipOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Service |
| | | public class TGrantVipServiceImpl extends ServiceImpl<TGrantVipMapper, TGrantVip> implements TGrantVipService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.query.TOrderEvaluateQuery; |
| | | import com.ruoyi.order.api.vo.TOrderEvaluateVO; |
| | | import com.ruoyi.order.mapper.TChargingOrderMapper; |
| | | import com.ruoyi.order.mapper.TOrderEvaluateMapper; |
| | | import com.ruoyi.order.mapper.TOrderEvaluateTagMapper; |
| | | import com.ruoyi.order.service.TOrderEvaluateService; |
| | | import com.ruoyi.other.api.feignClient.TEvaluationTagClient; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TOrderEvaluateServiceImpl extends ServiceImpl<TOrderEvaluateMapper, TOrderEvaluate> implements TOrderEvaluateService { |
| | | |
| | | @Autowired |
| | | private TEvaluationTagClient evaluationTagClient; |
| | | @Autowired |
| | | private TOrderEvaluateTagMapper orderEvaluateTagMapper; |
| | | @Autowired |
| | | private TChargingOrderMapper chargingOrderMapper; |
| | | @Override |
| | | public List<TEvaluationTagVO> getTagCount() { |
| | | // 查询标签列表 |
| | | R<List<TEvaluationTagVO>> r = evaluationTagClient.getTagList(); |
| | | List<TEvaluationTagVO> tagList = r.getData(); |
| | | List<Integer> tagIds = tagList.stream().map(TEvaluationTagVO::getId).collect(Collectors.toList()); |
| | | // 统计标签使用数量 |
| | | List<TEvaluationTagVO> counts = orderEvaluateTagMapper.getCountByTagIds(tagIds); |
| | | tagList.forEach(tag -> { |
| | | counts.forEach(count -> { |
| | | if (tag.getId().equals(count.getId())) { |
| | | tag.setTagCount(count.getTagCount()); |
| | | } |
| | | }); |
| | | }); |
| | | tagList = tagList.stream().sorted(Comparator.comparing(TEvaluationTagVO::getTagCount).reversed()).collect(Collectors.toList()); |
| | | // 统计有图,好评,中差评数量 |
| | | long imgUrlCount = this.count(Wrappers.lambdaQuery(TOrderEvaluate.class) |
| | | .isNotNull(TOrderEvaluate::getImgUrl)); |
| | | packageTagCount(imgUrlCount,"有图",tagList); |
| | | long goodCount = this.count(Wrappers.lambdaQuery(TOrderEvaluate.class) |
| | | .ge(TOrderEvaluate::getMark,4)); |
| | | packageTagCount(goodCount,"好评",tagList); |
| | | long badCount = this.count(Wrappers.lambdaQuery(TOrderEvaluate.class) |
| | | .le(TOrderEvaluate::getMark,3)); |
| | | packageTagCount(badCount,"中差评",tagList); |
| | | return tagList; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TOrderEvaluateVO> getTagList(TOrderEvaluateQuery query) { |
| | | PageInfo<TOrderEvaluateVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | // 查询站点下的所有订单 |
| | | List<TChargingOrder> tChargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .eq(TChargingOrder::getSiteId, query.getSiteId())); |
| | | if(CollectionUtils.isEmpty(tChargingOrders)){ |
| | | return new PageInfo<>(); |
| | | } |
| | | List<Long> orderIds = tChargingOrders.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | query.setOrderIds(orderIds); |
| | | List<TOrderEvaluateVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | /** |
| | | * 统计有图,好评,中差评数量 |
| | | * @param count |
| | | * @param name |
| | | * @param tagList |
| | | */ |
| | | private void packageTagCount(Long count,String name,List<TEvaluationTagVO> tagList){ |
| | | if(count>0){ |
| | | TEvaluationTagVO evaluationTagVO = new TEvaluationTagVO(); |
| | | evaluationTagVO.setName(name); |
| | | evaluationTagVO.setTagCount(Integer.parseInt(String.valueOf(count))); |
| | | tagList.add(evaluationTagVO); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.order.mapper.TShoppingOrderMapper; |
| | | import com.ruoyi.order.service.TShoppingOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TShoppingOrderServiceImpl extends ServiceImpl<TShoppingOrderMapper, TShoppingOrder> implements TShoppingOrderService { |
| | | |
| | | @Override |
| | | public TActivityVO activityStatistics(TActivityStatisticsQuery dto) { |
| | | TActivityVO res = new TActivityVO(); |
| | | |
| | | |
| | | |
| | | PageInfo<TActivityStatisticslVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<TActivityStatisticslVO> list = this.baseMapper.activityStatistics(pageInfo,dto); |
| | | list.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime())); |
| | | // 优惠券金额 |
| | | BigDecimal coupon = new BigDecimal("0"); |
| | | // 会员抵扣金额 |
| | | BigDecimal discount = new BigDecimal("0"); |
| | | // 会员活动金额 |
| | | BigDecimal vipActivity = new BigDecimal("0"); |
| | | // 赠送会员 |
| | | BigDecimal grantVip = new BigDecimal("0"); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list) { |
| | | // 判断享有了哪些类型 |
| | | switch (tActivityStatisticslVO.getOrderType()){ |
| | | case 1: |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | |
| | | // 充电订单 优惠券金额大于0 |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | discount = discount.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | stringBuilder.append("会员抵扣").append("+"); |
| | | } |
| | | stringBuilder.deleteCharAt(stringBuilder.length()-1); |
| | | tActivityStatisticslVO.setType(stringBuilder.toString()); |
| | | tActivityStatisticslVO.setTime(simpleDateFormat.format(tActivityStatisticslVO.getCreateTime())); |
| | | break; |
| | | case 2: |
| | | StringBuilder stringBuilder1 = new StringBuilder(); |
| | | |
| | | // 购物订单 优惠券金额大于0 |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder1.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getVipDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | discount = discount.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | stringBuilder1.append("会员抵扣").append("+"); |
| | | } |
| | | stringBuilder1.deleteCharAt(stringBuilder1.length()-1); |
| | | tActivityStatisticslVO.setType(stringBuilder1.toString()); |
| | | tActivityStatisticslVO.setTime(simpleDateFormat.format(tActivityStatisticslVO.getCreateTime())); |
| | | break; |
| | | case 3: |
| | | // 会员订单 优惠金额大于0 |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | vipActivity = vipActivity.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | } |
| | | tActivityStatisticslVO.setType("会员活动"); |
| | | tActivityStatisticslVO.setTime(simpleDateFormat.format(tActivityStatisticslVO.getCreateTime())); |
| | | break; |
| | | case 4: |
| | | // 赠送会员订单 如果支付金额为0 那么就是后台赠送的会员 |
| | | if (tActivityStatisticslVO.getPaymentAmount().compareTo(BigDecimal.ZERO)==0){ |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getOrderAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(simpleDateFormat.format(tActivityStatisticslVO.getCreateTime())); |
| | | }else{ |
| | | // 赠送 |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(simpleDateFormat.format(tActivityStatisticslVO.getCreateTime())); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | res.setList(pageInfo); |
| | | res.setTotal(coupon.add(discount).add(vipActivity).add(grantVip)); |
| | | res.setCoupon(coupon); |
| | | res.setDiscount(discount); |
| | | res.setVipActivity(vipActivity); |
| | | res.setGrantVip(grantVip); |
| | | return res; |
| | | } |
| | | } |
| | |
| | | <result column="order_classification" property="orderClassification" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="app_user_car_id" property="appUserCarId" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="parking_lot_id" property="parkingLotId" /> |
| | | <result column="charging_pile_id" property="chargingPileId" /> |
| | | <result column="charging_gun_id" property="chargingGunId" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, order_type, order_classification, app_user_id, app_user_car_id, parking_lot_id, charging_pile_id, charging_gun_id, start_time, end_time, status, recharge_amount, recharge_payment_type, recharge_payment_status, recharge_serial_number, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | id, code, order_type, order_classification, app_user_id, app_user_car_id,site_id, parking_lot_id, charging_pile_id, charging_gun_id, start_time, end_time, status, recharge_amount, recharge_payment_type, recharge_payment_status, recharge_serial_number, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, order_type, order_id, app_user_id, mark, content, img_url, evaluation_response, create_time, response_time, del_flag |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.order.api.vo.TOrderEvaluateVO"> |
| | | select id, order_type, order_id, app_user_id, mark, content, img_url, evaluation_response, |
| | | create_time, response_time, del_flag |
| | | from t_order_evaluate where id in |
| | | (select toe.id |
| | | from t_order_evaluate toe |
| | | left join t_order_evaluate_tag toet on toe.id = toet.order_evaluate_id |
| | | <where> |
| | | <if test="query.orderIds != null and query.orderIds.size()>0"> |
| | | and toe.order_id in |
| | | <foreach collection="query.orderIds" item="orderId" open="(" separator="," close=")"> |
| | | #{orderId} |
| | | </foreach> |
| | | </if> |
| | | <if test="query.tagType != null"> |
| | | <choose> |
| | | <when test="query.tagType == 2"> |
| | | AND toe.img_url IS NOT NULL |
| | | </when> |
| | | <when test="query.tagType == 3"> |
| | | AND toe.mark >= 4 |
| | | </when> |
| | | <when test="query.tagType == 4"> |
| | | AND toe.mark <= 3 |
| | | </when> |
| | | <when test="query.tagType == 5"> |
| | | AND toet.evaluation_tag_id = #{query.tagId} |
| | | </when> |
| | | </choose> |
| | | </if> |
| | | AND toe.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | GROUP BY toe.id) |
| | | <if test="query.tagType != null"> |
| | | <choose> |
| | | <when test="query.tagType == 1"> |
| | | ORDER BY create_time DESC |
| | | </when> |
| | | <otherwise> |
| | | ORDER BY |
| | | CASE |
| | | WHEN img_url IS NOT NULL THEN 0 |
| | | ELSE 1 |
| | | END ASC, |
| | | create_time DESC; |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="query.tagType == null"> |
| | | ORDER BY |
| | | CASE |
| | | WHEN img_url IS NOT NULL THEN 0 |
| | | ELSE 1 |
| | | END ASC, |
| | | create_time DESC; |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, order_evaluate_id, evaluation_tag_id |
| | | </sql> |
| | | <select id="getCountByTagIds" resultType="com.ruoyi.other.api.vo.TEvaluationTagVO"> |
| | | SELECT evaluation_tag_id,count(id) AS tagCount FROM t_order_evaluate_tag |
| | | <where> |
| | | <if test="tagIds != null and tagIds.size() > 0"> |
| | | AND evaluation_tag_id IN |
| | | <foreach collection="tagIds" item="tagId" open="(" separator="," close=")"> |
| | | #{tagId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY evaluation_tag_id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, code, app_user_id, order_type, goods_id, coupon_id, purchase_quantity, app_user_address_id, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, payment_status, payment_type, serial_number, remark, status, express_company, express_number, consigner_id, consigner_time, receiving_time, cancellation_time, cancellation_id, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | </sql> |
| | | <select id="activityStatistics" resultType="com.ruoyi.order.api.vo.TActivityStatisticslVO"> |
| | | <if test="req.orderType == null or req.orderType == 1"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | select t1.code ,t1.order_amount as orderAmount, |
| | | t1.coupon_discount_amount as couponDiscountAmount, |
| | | t1.vip_discount_amount as vipDiscountAmount, |
| | | t1.payment_amount as paymentAmount, |
| | | t1.create_time as createTime, |
| | | 1 as orderType |
| | | 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="req.type != null and req.type != '' and req.type == 1"> |
| | | and t1.coupon_discount_amount != null and t1.coupon_discount_amount != 0 |
| | | </if> |
| | | <if test="req.type != null and req.type != '' and req.type == 2"> |
| | | and t1.vip_discount_amount != null and t1.vip_discount_amount != 0 |
| | | </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="null != req.chargingPileIds and req.chargingPileIds.size()>0" > |
| | | and t1.charging_pile_id in |
| | | <foreach collection="req.chargingPileIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t1.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t1.recharge_payment_status =2 |
| | | and t1.refund_status !=2 |
| | | </if> |
| | | </if> |
| | | <if test="req.orderType == null or req.orderType == 2"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | union all |
| | | select t2.code ,t2.order_amount as orderAmount, |
| | | t2.coupon_discount_amount as couponDiscountAmount, |
| | | t2.vip_discount_amount as vipDiscountAmount, |
| | | t2.payment_amount as paymentAmount, |
| | | t2.create_time as createTime, |
| | | 2 as orderType |
| | | from t_shopping_order t2 |
| | | where 1 = 1 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t2.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="req.type != null and req.type != '' and req.type == 1"> |
| | | and t2.coupon_discount_amount != null and t1.coupon_discount_amount != 0 |
| | | </if> |
| | | <if test="req.type != null and req.type != '' and req.type == 2"> |
| | | and t2.vip_discount_amount != null and t1.vip_discount_amount != 0 |
| | | </if> |
| | | <if test="req.type == null "> |
| | | and t2.vip_discount_amount != null and t1.vip_discount_amount != 0 and t2.coupon_discount_amount != null and t1.coupon_discount_amount != 0 |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t2.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t2.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t2.refund_status !=2 |
| | | and t2.payment_status =2 |
| | | </if> |
| | | </if> |
| | | <if test="req.orderType == null or req.orderType == 3"> |
| | | <if test="req.type == null or req.type == 3"> |
| | | union all |
| | | select t3.code ,t3.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | t3.discount_amount as vipDiscountAmount, |
| | | t3.payment_amount as paymentAmount, |
| | | t3.create_time as createTime, |
| | | 3 as orderType |
| | | from t_vip_order t3 |
| | | where 1 = 1 |
| | | and t3.type ==1 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t3.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="req.type == null "> |
| | | and t3.discount_amount != null and t3.discount_amount != 0 |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t3.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t3.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t3.payment_status =2 |
| | | </if> |
| | | </if> |
| | | <if test="req.orderType == null or req.orderType == 4"> |
| | | <if test="req.type == null or req.type == 4"> |
| | | union all |
| | | select t4.code ,t4.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | t4.discount_amount as vipDiscountAmount, |
| | | t4.payment_amount as paymentAmount, |
| | | t4.create_time as createTime, |
| | | 4 as orderType |
| | | from t_vip_order t4 |
| | | where 1 = 1 |
| | | and t4.type =2 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t4.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="req.type == null "> |
| | | and t4.discount_amount != null and t4.discount_amount != 0 |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t4.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t4.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t4.payment_status =2 |
| | | </if> |
| | | </if> |
| | | <if test="req.orderType == null or req.orderType == 4"> |
| | | <if test="req.type == null or req.type == 4"> |
| | | union all |
| | | select t5.code ,t5.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | 0 as vipDiscountAmount, |
| | | 0 as paymentAmount, |
| | | t5.create_time as createTime, |
| | | 4 as orderType |
| | | from t_grant_vip t5 |
| | | where 1 = 1 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t5.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t5.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t5.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | 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.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.other.api.domain.TActivity; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.dto.AdvertisingDTO; |
| | | import com.ruoyi.other.query.CouponQuery; |
| | | import com.ruoyi.other.service.TActivityService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理后台活动费用统计 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/activity") |
| | | public class TActivityStatisticsController { |
| | | @Autowired |
| | | private OrderClient orderClient; |
| | | @ApiOperation(tags = {"管理后台-活动费用统计"},value = "管理后台活动费用统计") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<TActivityVO> pageList(@RequestBody TActivityStatisticsQuery query) { |
| | | return AjaxResult.ok(orderClient.activityStatistics(query).getData()); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.dto.GrantCouponDto; |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | |
| | | import com.ruoyi.other.service.TActivityService; |
| | | import com.ruoyi.other.service.TCouponService; |
| | | import com.ruoyi.other.service.TGoodsService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping("/exchangeRecord") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券查看详情-兑换记录") |
| | | public AjaxResult<PageInfo<ExchangeRecordVO>> exchangeRecord(@RequestBody ExchangeRecordGoodsQuery dto) { |
| | | |
| | | return AjaxResult.ok(null); |
| | | PageInfo<ExchangeRecordVO> data = appCouponClient.getExchangeRecordByCouponId(dto).getData(); |
| | | List<ExchangeRecordVO> records = data.getRecords(); |
| | | for (ExchangeRecordVO record : records) { |
| | | TCoupon byId = tCouponService.getById(record.getCouponId()); |
| | | if (byId!=null){ |
| | | record.setDiscountAmount("¥"+byId.getDiscountAmount()); |
| | | if (Objects.equals(byId.getMeetTheConditions(), BigDecimal.ZERO)){ |
| | | record.setMeetTheConditions("无门槛"); |
| | | }else{ |
| | | record.setMeetTheConditions("满"+byId.getMeetTheConditions()+"元可用"); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.ok(data); |
| | | } |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "发放优惠券") |
| | | @GetMapping(value = "/pageList") |
| | | public AjaxResult pageList(@RequestBody GrantCouponDto dto) { |
| | | TCoupon byId = tCouponService.getById(dto.getCouponId()); |
| | | Integer waysToObtain = byId.getWaysToObtain(); |
| | | dto.setWaysToObtain(waysToObtain); |
| | | switch (byId.getValidityPeriodMode()){ |
| | | case 1: |
| | | dto.setEndTime(byId.getEndTime()); |
| | | break; |
| | | case 2: |
| | | dto.setEndTime(LocalDateTime.now().plusDays(byId.getDays())); |
| | | break; |
| | | } |
| | | // 远程送优惠券 |
| | | return AjaxResult.success(); |
| | | } |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券列表分页查询") |
| | | @PostMapping(value = "/pageList") |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import com.ruoyi.other.service.TEvaluationTagService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/t-evaluation-tag") |
| | | public class TEvaluationTagController { |
| | | |
| | | private final TEvaluationTagService evaluationTagService; |
| | | |
| | | @Autowired |
| | | public TEvaluationTagController(TEvaluationTagService evaluationTagService) { |
| | | this.evaluationTagService = evaluationTagService; |
| | | } |
| | | |
| | | @PostMapping("/getTagList") |
| | | public R<List<TEvaluationTagVO>> getTagList() { |
| | | return R.ok(evaluationTagService.getTagList()); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.TSystemConfiguration; |
| | | import com.ruoyi.other.service.TSystemConfigurationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @ApiOperation(tags = {"小程序-系统设置"},value = "联系客服") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam(name = "type",value = "1=客服信息,2=系统设置") Integer type) { |
| | | public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam(name = "type")@ApiParam(value = "1=客服信息,2=系统设置") Integer type) { |
| | | return AjaxResult.ok(systemConfigurationService.getOne(Wrappers.lambdaQuery(TSystemConfiguration.class) |
| | | .eq(TSystemConfiguration::getType, type))); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TEvaluationTagMapper extends BaseMapper<TEvaluationTag> { |
| | | |
| | | /** |
| | | * 获取评价标签列表 |
| | | * @return |
| | | */ |
| | | List<TEvaluationTagVO> getTagList(); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TEvaluationTagService extends IService<TEvaluationTag> { |
| | | |
| | | /** |
| | | * 查询标签列表 |
| | | * @return |
| | | */ |
| | | List<TEvaluationTagVO> getTagList(); |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | | import com.ruoyi.other.mapper.TEvaluationTagMapper; |
| | | import com.ruoyi.other.service.TEvaluationTagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TEvaluationTagServiceImpl extends ServiceImpl<TEvaluationTagMapper, TEvaluationTag> implements TEvaluationTagService { |
| | | |
| | | @Override |
| | | public List<TEvaluationTagVO> getTagCount() { |
| | | return this.baseMapper.getTagList(); |
| | | } |
| | | } |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.other.api.domain.TEvaluationTag"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="type" property="type" /> |
| | | <result column="`name`" property="name" /> |
| | | <result column="`type`" property="type" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, type, create_time, del_flag |
| | | id, `name`, `type`, create_time, del_flag |
| | | </sql> |
| | | <select id="getTagList" resultType="com.ruoyi.other.api.vo.TEvaluationTagVO"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from t_evaluation_tag where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} ORDER BY `type` |
| | | </select> |
| | | |
| | | </mapper> |