From be8f6b7576fa6b9283ce36fd3ac88ec9714a8e45 Mon Sep 17 00:00:00 2001 From: mactj Date: Fri, 22 Jan 2021 10:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppOrderDetailController.java | 84 +++++---- .../winery/vo/AppRequestRefundDetailVo.java | 42 +++++ mini-app/src/apis/orderApis.js | 5 +- mini-app/src/baseDefine.js | 4 +- .../components/mall/order/order-list-body.wpy | 2 +- .../src/components/order/dialog-refund.wpy | 107 +++++++++-- .../components/user/dialog-registration.wpy | 2 +- mini-app/src/pages/form6.wpy | 2 + mini-app/src/pages/mall/index.wpy | 14 +- mini-app/src/pages/mall/order/order-check.wpy | 1 + mini-app/src/pages/mall/order/order-list.wpy | 5 +- .../src/main/resources/application.yml | 46 ++--- ruoyi-ui/src/api/winery/detail.js | 10 +- ruoyi-ui/src/views/winery/detail/index.vue | 169 +++++++++++------- 14 files changed, 351 insertions(+), 142 deletions(-) create mode 100644 hope-winery/src/main/java/com/ruoyi/winery/vo/AppRequestRefundDetailVo.java diff --git a/hope-winery/src/main/java/com/ruoyi/winery/controller/AppOrderDetailController.java b/hope-winery/src/main/java/com/ruoyi/winery/controller/AppOrderDetailController.java index 9ba877931..d7ca194d0 100644 --- a/hope-winery/src/main/java/com/ruoyi/winery/controller/AppOrderDetailController.java +++ b/hope-winery/src/main/java/com/ruoyi/winery/controller/AppOrderDetailController.java @@ -18,6 +18,7 @@ import com.ruoyi.winery.domain.AppOrder; import com.ruoyi.winery.domain.goods.GoodsMain; import com.ruoyi.winery.service.IAppOrderService; import com.ruoyi.winery.service.IGoodsMainService; +import com.ruoyi.winery.vo.AppRequestRefundDetailVo; import lombok.RequiredArgsConstructor; import org.checkerframework.checker.units.qual.A; import org.springframework.security.access.prepost.PreAuthorize; @@ -43,13 +44,13 @@ import static com.ruoyi.common.core.domain.AjaxResult.error; /** * 订单明细Controller - * + * * @author ruoyi * @date 2021-01-18 */ @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController -@RequestMapping("/winery/detail" ) +@RequestMapping("/winery/detail") public class AppOrderDetailController extends BaseController { private final IAppOrderDetailService iAppOrderDetailService; @@ -68,34 +69,34 @@ public class AppOrderDetailController extends BaseController { */ @PreAuthorize("@ss.hasPermi('winery:detail:list')") @GetMapping("/list") - public TableDataInfo list(AppOrderDetail appOrderDetail) - { + public TableDataInfo list(AppOrderDetail appOrderDetail) { startPage(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(appOrderDetail); - if (appOrderDetail.getDeptId() != null){ - lqw.eq(AppOrderDetail::getDeptId ,appOrderDetail.getDeptId()); + if (appOrderDetail.getDeptId() != null) { + lqw.eq(AppOrderDetail::getDeptId, appOrderDetail.getDeptId()); } - if (appOrderDetail.getUserId() != null){ - lqw.eq(AppOrderDetail::getUserId ,appOrderDetail.getUserId()); + if (appOrderDetail.getUserId() != null) { + lqw.eq(AppOrderDetail::getUserId, appOrderDetail.getUserId()); } - if (StringUtils.isNotBlank(appOrderDetail.getOrderId())){ - lqw.eq(AppOrderDetail::getOrderId ,appOrderDetail.getOrderId()); + if (StringUtils.isNotBlank(appOrderDetail.getOrderId())) { + lqw.eq(AppOrderDetail::getOrderId, appOrderDetail.getOrderId()); } - if (StringUtils.isNotBlank(appOrderDetail.getGoodsId())){ - lqw.eq(AppOrderDetail::getGoodsId ,appOrderDetail.getGoodsId()); + if (StringUtils.isNotBlank(appOrderDetail.getGoodsId())) { + lqw.eq(AppOrderDetail::getGoodsId, appOrderDetail.getGoodsId()); } - if (appOrderDetail.getGoodsCount() != null){ - lqw.eq(AppOrderDetail::getGoodsCount ,appOrderDetail.getGoodsCount()); + if (appOrderDetail.getGoodsCount() != null) { + lqw.eq(AppOrderDetail::getGoodsCount, appOrderDetail.getGoodsCount()); } - if (appOrderDetail.getStatus() != null){ - lqw.eq(AppOrderDetail::getStatus ,appOrderDetail.getStatus()); + if (appOrderDetail.getStatus() != null) { + lqw.eq(AppOrderDetail::getStatus, appOrderDetail.getStatus()); } - if (StringUtils.isNotBlank(appOrderDetail.getRefundNo())){ - lqw.eq(AppOrderDetail::getRefundNo ,appOrderDetail.getRefundNo()); + if (StringUtils.isNotBlank(appOrderDetail.getRefundNo())) { + lqw.eq(AppOrderDetail::getRefundNo, appOrderDetail.getRefundNo()); } - if (appOrderDetail.getRefundTime() != null){ - lqw.eq(AppOrderDetail::getRefundTime ,appOrderDetail.getRefundTime()); + if (appOrderDetail.getRefundTime() != null) { + lqw.eq(AppOrderDetail::getRefundTime, appOrderDetail.getRefundTime()); } + lqw.orderByDesc(AppOrderDetail::getCreateTime); List list = iAppOrderDetailService.list(lqw); for (AppOrderDetail detail : list) { detail.setGoods(goodsMainService.getById(detail.getGoodsId())); @@ -106,22 +107,22 @@ public class AppOrderDetailController extends BaseController { /** * 导出订单明细列表 */ - @PreAuthorize("@ss.hasPermi('winery:detail:export')" ) - @Log(title = "订单明细" , businessType = BusinessType.EXPORT) - @GetMapping("/export" ) + @PreAuthorize("@ss.hasPermi('winery:detail:export')") + @Log(title = "订单明细", businessType = BusinessType.EXPORT) + @GetMapping("/export") public AjaxResult export(AppOrderDetail appOrderDetail) { LambdaQueryWrapper lqw = new LambdaQueryWrapper(appOrderDetail); List list = iAppOrderDetailService.list(lqw); - ExcelUtil util = new ExcelUtil(AppOrderDetail. class); - return util.exportExcel(list, "detail" ); + ExcelUtil util = new ExcelUtil(AppOrderDetail.class); + return util.exportExcel(list, "detail"); } /** * 获取订单明细详细信息 */ - @PreAuthorize("@ss.hasPermi('winery:detail:query')" ) - @GetMapping(value = "/{id}" ) - public AjaxResult getInfo(@PathVariable("id" ) String id) { + @PreAuthorize("@ss.hasPermi('winery:detail:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { AppOrderDetail detail = iAppOrderDetailService.getById(id); detail.setGoods(goodsMainService.getById(detail.getGoodsId())); return AjaxResult.success(detail); @@ -130,8 +131,8 @@ public class AppOrderDetailController extends BaseController { /** * 新增订单明细 */ - @PreAuthorize("@ss.hasPermi('winery:detail:add')" ) - @Log(title = "订单明细" , businessType = BusinessType.INSERT) + @PreAuthorize("@ss.hasPermi('winery:detail:add')") + @Log(title = "订单明细", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody AppOrderDetail appOrderDetail) { return toAjax(iAppOrderDetailService.save(appOrderDetail) ? 1 : 0); @@ -140,8 +141,8 @@ public class AppOrderDetailController extends BaseController { /** * 修改订单明细 */ - @PreAuthorize("@ss.hasPermi('winery:detail:edit')" ) - @Log(title = "订单明细" , businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('winery:detail:edit')") + @Log(title = "订单明细", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody AppOrderDetail appOrderDetail) { return toAjax(iAppOrderDetailService.updateById(appOrderDetail) ? 1 : 0); @@ -150,9 +151,9 @@ public class AppOrderDetailController extends BaseController { /** * 删除订单明细 */ - @PreAuthorize("@ss.hasPermi('winery:detail:remove')" ) - @Log(title = "订单明细" , businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}" ) + @PreAuthorize("@ss.hasPermi('winery:detail:remove')") + @Log(title = "订单明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(iAppOrderDetailService.removeByIds(Arrays.asList(ids)) ? 1 : 0); } @@ -185,4 +186,17 @@ public class AppOrderDetailController extends BaseController { return error(); } } + + + @PreAuthorize("@ss.hasPermi('winery:detail:query')") + @Log(title = "请求退款", businessType = BusinessType.OTHER) + @PostMapping("/requestRefund") + AjaxResult requestRefund(@RequestBody AppRequestRefundDetailVo vo) { + AppOrderDetail detail = iAppOrderDetailService.getById(vo.getId()); + detail.setStatus(1); + detail.setRefundReason(vo.getRefundReason()); + iAppOrderDetailService.updateById(detail); + return AjaxResult.success(detail); + + } } diff --git a/hope-winery/src/main/java/com/ruoyi/winery/vo/AppRequestRefundDetailVo.java b/hope-winery/src/main/java/com/ruoyi/winery/vo/AppRequestRefundDetailVo.java new file mode 100644 index 000000000..b8c3ea1fd --- /dev/null +++ b/hope-winery/src/main/java/com/ruoyi/winery/vo/AppRequestRefundDetailVo.java @@ -0,0 +1,42 @@ +package com.ruoyi.winery.vo; + +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.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.winery.domain.goods.GoodsMain; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 请求退款对象 + * + * @author ruoyi + * @date 2021-01-18 + */ +@Data +@ToString +@EqualsAndHashCode +@NoArgsConstructor +@Accessors(chain = true) +public class AppRequestRefundDetailVo implements Serializable { + + /** + * 明细ID + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + private String id; + + + @Excel(name = "退款理由") + private String refundReason; + +} diff --git a/mini-app/src/apis/orderApis.js b/mini-app/src/apis/orderApis.js index d60f152d9..33479bf38 100644 --- a/mini-app/src/apis/orderApis.js +++ b/mini-app/src/apis/orderApis.js @@ -24,9 +24,10 @@ class OrderApis { }) } - refundOrder(id) { + requestRefund(data) { return request.post({ - url: baseUrl + 'winery/detail/refund/' + id + url: baseUrl + 'winery/detail/requestRefund', + data: data }) } diff --git a/mini-app/src/baseDefine.js b/mini-app/src/baseDefine.js index 535c40ce3..a424de070 100644 --- a/mini-app/src/baseDefine.js +++ b/mini-app/src/baseDefine.js @@ -5,8 +5,8 @@ */ // export const baseUrl = 'http://36.1.50.18:18989/' -export const baseUrl = 'http://127.0.0.1:18989/' -// export const baseUrl = 'https://mall.xiao4r.com/api/' +// export const baseUrl = 'http://127.0.0.1:18989/' +export const baseUrl = 'https://mall.xiao4r.com/api/' export const imgbaseUrl = 'https://www.xiao4r.com/xiao4rstatic/img/winery/' export const sysImgBaseUrl = 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' diff --git a/mini-app/src/components/mall/order/order-list-body.wpy b/mini-app/src/components/mall/order/order-list-body.wpy index fc16bb6de..1bbd01996 100644 --- a/mini-app/src/components/mall/order/order-list-body.wpy +++ b/mini-app/src/components/mall/order/order-list-body.wpy @@ -185,7 +185,7 @@ wepy.component({ onRefund(item) { // 申请退款 - appManager.showToast('即将开放:如需联系退款请拨打客服热线17395097925') + eventHub.$emit('onShowRefund', item) }, onDetail(item) { appManager.navigateTo(goodsDetailPage + '?id=' + item.goods.id) diff --git a/mini-app/src/components/order/dialog-refund.wpy b/mini-app/src/components/order/dialog-refund.wpy index dceb8ea3a..e71f19dbe 100644 --- a/mini-app/src/components/order/dialog-refund.wpy +++ b/mini-app/src/components/order/dialog-refund.wpy @@ -4,7 +4,6 @@ return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey } - module.exports.parseImage = parseImage; @@ -15,9 +14,33 @@ module.exports.parseImage = parseImage; width: 100%; height: 536rpx; z-index: -10; - - } + +.cell-item { + margin-left: 22px; + margin-top: 12px; + display: flex; + align-items: center; +} + +.cell-input { + + display: flex; + justify-content: center; + align-items: center; + + input { + margin-left: 10px; + border: #dddddd solid 1px; + border-radius: 8px; + padding: 5px 10px; + width: 320rpx; + } +} + + + +