Merge branch 'master' of http://120.27.238.55:7000/r/xc-mall
2 files added
7 files modified
| | |
| | | import cc.mrbird.febs.mall.dto.MallOrderInfoDto; |
| | | import cc.mrbird.febs.mall.dto.MallOrderRefundDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderRefundOperationMapper; |
| | | import cc.mrbird.febs.mall.service.IAdminMallGoodsService; |
| | | import cc.mrbird.febs.mall.service.IAdminMallOrderService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 订单退款列表 |
| | | * 订单退款-列表 |
| | | * @param mallOrderRefundDto |
| | | * @param request |
| | | * @return |
| | |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款-详情 |
| | | */ |
| | | @GetMapping("/seeRefund") |
| | | public FebsResponse seeRefund(QueryRequest request, MallOrderRefund mallOrderRefund,Integer parentId) { |
| | | if(parentId==null){ |
| | | ViewMallOrderController.idFromRefund=0; |
| | | } |
| | | mallOrderRefund.setId(ViewMallOrderController.idFromRefund); |
| | | Map<String, Object> dataTable = getDataTable(adminMallOrderService.seeRefund(request, mallOrderRefund)); |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款-同意 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("agreeRefund/{id}") |
| | | @ControllerEndpoint(operation = "订单退款-同意", exceptionMessage = "操作失败") |
| | | public FebsResponse agreeRefund(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminMallOrderService.agreeRefund(id); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款-拒绝 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("disagreeRefund/{id}") |
| | | @ControllerEndpoint(operation = "订单退款-拒绝", exceptionMessage = "操作失败") |
| | | public FebsResponse disagreeRefund(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminMallOrderService.disagreeRefund(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | public static long idFromMember; |
| | | |
| | | public static long idFromRefund; |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * @return |
| | |
| | | return FebsUtil.view("modules/order/refundList"); |
| | | } |
| | | |
| | | /** |
| | | * 退款详情 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("seeRefund/{id}") |
| | | public String seeReceiveInfo(@PathVariable long id, Model model) { |
| | | idFromRefund = id; |
| | | return FebsUtil.view("modules/order/Refunding"); |
| | | } |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefund; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefundOperation; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundOperationVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface MallOrderRefundOperationMapper extends BaseMapper<MallOrderRefundOperation> { |
| | | |
| | | IPage<AdminMallOrderRefundOperationVo> selectRefundOperationInPage(Page<AdminMallOrderRefundOperationVo> page, @Param("record") MallOrderRefund mallOrderRefund); |
| | | |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.dto.MallOrderInfoDto; |
| | | import cc.mrbird.febs.mall.dto.MallOrderRefundDto; |
| | | import cc.mrbird.febs.mall.entity.MallOrderInfo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderInfoVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderVo; |
| | | import cc.mrbird.febs.mall.vo.AdminOrderDetailVo; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefund; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | AdminOrderDetailVo getMallOrderDetailById(long id); |
| | | |
| | | IPage<AdminMallOrderRefundVo> getRefundListInPage(MallOrderRefundDto mallOrderRefundDto, QueryRequest request); |
| | | |
| | | IPage<AdminMallOrderRefundOperationVo> seeRefund(QueryRequest request, MallOrderRefund mallOrderRefund); |
| | | |
| | | FebsResponse agreeRefund(Long id); |
| | | |
| | | FebsResponse disagreeRefund(Long id); |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.dto.DeliverGoodsDto; |
| | | import cc.mrbird.febs.mall.dto.MallOrderInfoDto; |
| | | import cc.mrbird.febs.mall.dto.MallOrderRefundDto; |
| | | import cc.mrbird.febs.mall.entity.MallExpressInfo; |
| | | import cc.mrbird.febs.mall.entity.MallOrderInfo; |
| | | import cc.mrbird.febs.mall.entity.MallOrderItem; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefund; |
| | | import cc.mrbird.febs.mall.mapper.MallExpressInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderItemMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderRefundMapper; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IAdminMallOrderService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderInfoVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderVo; |
| | | import cc.mrbird.febs.mall.vo.AdminOrderDetailVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | private final MallOrderItemMapper mallOrderItemMapper; |
| | | |
| | | private final MallOrderRefundMapper mallOrderRefundMapper; |
| | | |
| | | private final MallOrderRefundOperationMapper mallOrderRefundOperationMapper; |
| | | |
| | | @Override |
| | | public IPage<AdminMallOrderInfoVo> getOrderListInPage(MallOrderInfoDto mallOrderInfo, QueryRequest request) { |
| | |
| | | return adminMallOrderRefundVos; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AdminMallOrderRefundOperationVo> seeRefund(QueryRequest request, MallOrderRefund mallOrderRefund) { |
| | | Page<AdminMallOrderRefundOperationVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AdminMallOrderRefundOperationVo> adminMallOrderRefundOperationVos = mallOrderRefundOperationMapper.selectRefundOperationInPage(page, mallOrderRefund); |
| | | return adminMallOrderRefundOperationVos; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agreeRefund(Long id) { |
| | | MallOrderRefund mallOrderRefund = mallOrderRefundMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(mallOrderRefund)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新重试"); |
| | | } |
| | | mallOrderRefund.setStatus(2); |
| | | mallOrderRefundMapper.updateById(mallOrderRefund); |
| | | |
| | | MallOrderRefundOperation mallOrderRefundOperation = new MallOrderRefundOperation(); |
| | | mallOrderRefundOperation.setRefundId(mallOrderRefund.getId()); |
| | | mallOrderRefundOperation.setOrderId(mallOrderRefund.getOrderId()); |
| | | mallOrderRefundOperation.setContent("已同意退款申请"); |
| | | mallOrderRefundOperationMapper.insert(mallOrderRefundOperation); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse disagreeRefund(Long id) { |
| | | MallOrderRefund mallOrderRefund = mallOrderRefundMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(mallOrderRefund)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新重试"); |
| | | } |
| | | mallOrderRefund.setStatus(3); |
| | | mallOrderRefundMapper.updateById(mallOrderRefund); |
| | | |
| | | MallOrderRefundOperation mallOrderRefundOperation = new MallOrderRefundOperation(); |
| | | mallOrderRefundOperation.setRefundId(mallOrderRefund.getId()); |
| | | mallOrderRefundOperation.setOrderId(mallOrderRefund.getOrderId()); |
| | | mallOrderRefundOperation.setContent("不同意退款申请"); |
| | | mallOrderRefundOperationMapper.insert(mallOrderRefundOperation); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMallOrderRefundOperationVo", description = "信息返回类") |
| | | public class AdminMallOrderRefundOperationVo { |
| | | |
| | | private long id; |
| | | |
| | | private String content; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createdTime; |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallOrderRefundOperationMapper"> |
| | | |
| | | <select id="selectRefundOperationInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallOrderRefundOperationVo"> |
| | | select * from mall_order_refund_operation a where a.refund_id = #{record.id} |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | table.on('tool(orderRefundTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'deliverGoods') { |
| | | febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#deliver-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'seeOrder') { |
| | | febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, { |
| | | if (layEvent === 'refunding') { |
| | | febs.modal.open( '退款进度', 'modules/order/seeRefund/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | | if (layEvent === 'agree') { |
| | | febs.modal.confirm('同意', '同意此次退款申请?', function () { |
| | | agreeRefund(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'disagree') { |
| | | febs.modal.confirm('拒绝', '拒绝此次退款申请?', function () { |
| | | disagreeRefund(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function agreeRefund(id) { |
| | | febs.get(ctx + 'admin/order/agreeRefund/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | function disagreeRefund(id) { |
| | | febs.get(ctx + 'admin/order/disagreeRefund/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | $add.on('click', function () { |
| | | febs.view.tab.change("/modules/goods/goodsAddNew/"); |
| | | }); |
| | | |
| | | function initTable() { |
| | |
| | | // } |
| | | // }, minWidth: 80,align:'center'}, |
| | | // {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // if (d.status === 1) { |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | // }else{ |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // } |
| | | // },minWidth: 300,align:'center'} |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.status === 1){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | } |
| | | |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
New file |
| | |
| | | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-refunding-child" lay-title="退款进度"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <table lay-filter="refundingTableChild" lay-data="{id: 'refundingTableChild'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect' ,'eleTree'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | treeSelect = layui.treeSelect, |
| | | dropdown = layui.dropdown, |
| | | $view = $('#febs-refunding-child'), |
| | | $query = $view.find('#queryChild'), |
| | | $searchForm = $view.find('formChild'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | | createTimeFrom, |
| | | createTimeTo; |
| | | |
| | | form.render(); |
| | | |
| | | initTable(); |
| | | |
| | | laydate.render({ |
| | | elem: '#user-createTime', |
| | | range: true, |
| | | trigger: 'click' |
| | | }); |
| | | |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'refundingTableChild', |
| | | url: ctx + 'admin/order/seeRefund?parentId=1', |
| | | cols: [[ |
| | | {field: 'content', title: '内容', minWidth: 80,align:'center'}, |
| | | {field: 'createdTime', title: '时间', minWidth: 150,align:'left'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | </script> |