From d33c34c76e74dbacf1bf7a57d7d3109e2bc54e68 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 30 八月 2024 11:49:23 +0800 Subject: [PATCH] 代码提交 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java | 89 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 87 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java index 2dee6ca..e64f518 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java @@ -1,8 +1,26 @@ package com.ruoyi.order.controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.account.api.feignClient.AppUserClient; +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.common.security.service.TokenService; +import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.order.api.model.TOrderAppeal; +import com.ruoyi.order.api.query.TOrderAppealQuery; +import com.ruoyi.order.api.vo.TOrderAppealVO; +import com.ruoyi.order.dto.ManageFeedbackDto; +import com.ruoyi.order.dto.ManageOrderAppealQuery; +import com.ruoyi.order.service.TOrderAppealService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; /** * <p> @@ -16,5 +34,72 @@ @RequestMapping("/t-order-appeal") public class TOrderAppealController { + private final TOrderAppealService orderAppealService; + private final TokenService tokenService; + @Resource + private AppUserClient appUserClient; + + @Autowired + public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) { + this.orderAppealService = orderAppealService; + this.tokenService = tokenService; + } + @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "列表") + @PostMapping(value = "/manage/pageList") + public R<Page<TOrderAppeal>> managePageList(@RequestBody ManageOrderAppealQuery manageOrderAppealQuery) { + + Page<TOrderAppeal> page = orderAppealService.lambdaQuery().eq(manageOrderAppealQuery.getStatus() != null, TOrderAppeal::getStatus, manageOrderAppealQuery.getStatus()) + .like(manageOrderAppealQuery.getCode() != null, TOrderAppeal::getCode, manageOrderAppealQuery.getCode()) + .like(manageOrderAppealQuery.getPhone() != null, TOrderAppeal::getPhone, manageOrderAppealQuery.getPhone()) + .eq(manageOrderAppealQuery.getOrderType() != null, TOrderAppeal::getOrderType, manageOrderAppealQuery.getOrderType()) + .in(TOrderAppeal::getOrderType, 1, 2).page(Page.of(manageOrderAppealQuery.getPageCurr(), manageOrderAppealQuery.getPageSize())); + return R.ok(page); + + + } + + @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "后台-订单管理-订单申诉") + @PostMapping(value = "/manage/feedback") + public R manageFeedback(@RequestBody ManageFeedbackDto manageFeedbackDto) { + TOrderAppeal byId = orderAppealService.getById(manageFeedbackDto.getId()); + byId.setFeedback(manageFeedbackDto.getFeedback()); + orderAppealService.updateById(byId); + return R.ok(); + } + + /** + * 查询订单申诉列表 + */ + @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉分页列表") + @PostMapping(value = "/pageList") + public AjaxResult<PageInfo<TOrderAppealVO>> pageList(@RequestBody TOrderAppealQuery query) { + Long userId = tokenService.getLoginUserApplet().getUserId(); + query.setAppUserId(userId); + return AjaxResult.ok(orderAppealService.pageList(query)); + } + + /** + * 查询订单申诉详情 + */ + @GetMapping(value = "/getDetailById") + @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") + public AjaxResult<TOrderAppealVO> getDetailById(String id) { + return AjaxResult.ok(orderAppealService.getDetailById(id)); + } + + + + @ResponseBody + @PostMapping(value = "/addOrderAppeal") + @ApiOperation(value = "申诉订单", tags = {"小程序-充电记录(个人中心)"}) + public AjaxResult addOrderAppeal(@RequestBody TOrderAppeal orderAppeal){ + Long appUserId = tokenService.getLoginUserApplet().getUserId(); + TAppUser data = appUserClient.getUserById(appUserId).getData(); + orderAppeal.setAppUserId(appUserId); + orderAppeal.setStatus(1); + orderAppeal.setPhone(data.getPhone()); + orderAppealService.save(orderAppeal); + return AjaxResult.success(); + } } -- Gitblit v1.7.1