| | |
| | | @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.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.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; |
| | | |
| | | } |
| | |
| | | |
| | | 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.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; |
| | | |
| | |
| | | private TOrderEvaluateService orderEvaluateService; |
| | | |
| | | |
| | | @ApiOperation(tags = {"小程序-充电订单"},value = "充电订单评价标签及数量查询") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<List<TEvaluationTagVO>> list() { |
| | | return AjaxResult.ok(orderEvaluateService.getTagList()); |
| | | @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)); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | @Mapper |
| | | public interface TOrderEvaluateMapper extends BaseMapper<TOrderEvaluate> { |
| | | |
| | | /** |
| | | * 订单评价分页列表查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderEvaluateVO> pageList(@Param("query") TOrderEvaluateQuery query,@Param("pageInfo")PageInfo<TOrderEvaluateVO> pageInfo); |
| | | } |
| | |
| | | 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; |
| | |
| | | * 获取评价标签 |
| | | * @return |
| | | */ |
| | | List<TEvaluationTagVO> getTagList(); |
| | | List<TEvaluationTagVO> getTagCount(); |
| | | |
| | | /** |
| | | * 充电订单评价分页列表查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderEvaluateVO> getTagList(TOrderEvaluateQuery query); |
| | | } |
| | |
| | | |
| | | 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.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; |
| | |
| | | private TEvaluationTagClient evaluationTagClient; |
| | | @Autowired |
| | | private TOrderEvaluateTagMapper orderEvaluateTagMapper; |
| | | @Autowired |
| | | private TChargingOrderMapper chargingOrderMapper; |
| | | @Override |
| | | public List<TEvaluationTagVO> getTagList() { |
| | | public List<TEvaluationTagVO> getTagCount() { |
| | | // 查询标签列表 |
| | | R<List<TEvaluationTagVO>> r = evaluationTagClient.getTagList(); |
| | | List<TEvaluationTagVO> tagList = r.getData(); |
| | |
| | | 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(); |
| | |
| | | <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> |
| | |
| | | public class TEvaluationTagServiceImpl extends ServiceImpl<TEvaluationTagMapper, TEvaluationTag> implements TEvaluationTagService { |
| | | |
| | | @Override |
| | | public List<TEvaluationTagVO> getTagList() { |
| | | public List<TEvaluationTagVO> getTagCount() { |
| | | return this.baseMapper.getTagList(); |
| | | } |
| | | } |