3 files added
10 files modified
| | |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.DeptTree; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | 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 cc.mrbird.febs.mall.vo.AdminAddAddressTreeVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundAddressVo; |
| | | import cc.mrbird.febs.system.entity.Dept; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | return adminMallOrderService.addAddress(addAddressDto); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款地址-选择 |
| | | */ |
| | | @GetMapping("addAddress/tree") |
| | | @ControllerEndpoint(exceptionMessage = "获取地址失败") |
| | | public List<AdminAddAddressTreeVo> getRefundAddress(){ |
| | | return adminMallOrderService.getRefundAddress(); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款地址-更新退款记录的地址信息 |
| | | */ |
| | | @PostMapping("withAddressUpdate") |
| | | @ControllerEndpoint(operation = "订单退款地址-更新退款记录的地址信息", exceptionMessage = "操作失败") |
| | | public FebsResponse withAddressUpdate(@Valid WithAddressUpdateDto withAddressUpdateDto) { |
| | | return adminMallOrderService.withAddressUpdate(withAddressUpdateDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | return FebsUtil.view("modules/order/updateAddress"); |
| | | } |
| | | |
| | | /** |
| | | * 订单退款-同意并选择地址 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("withAddress/{id}") |
| | | @RequiresPermissions("withAddress:update") |
| | | public String withAddress(@PathVariable long id, Model model) { |
| | | AdminMallOrderRefundVo data = adminMallOrderService.getMallOrderRefundInfoById(id); |
| | | model.addAttribute("withAddress", data); |
| | | return FebsUtil.view("modules/order/withAddress"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpMallGoodsDto", description = "参数接收类") |
| | | public class WithAddressUpdateDto { |
| | | private Long id; |
| | | |
| | | private Long addressId; |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.mall.dto.MallOrderRefundAddressDto; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefundAddress; |
| | | import cc.mrbird.febs.mall.vo.AdminAddAddressTreeVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundAddressVo; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MallOrderRefundAddressMapper extends BaseMapper<MallOrderRefundAddress> { |
| | | |
| | |
| | | @Param("record") MallOrderRefundAddressDto mallOrderRefundAddressDto); |
| | | |
| | | AdminMallOrderRefundAddressVo getMallOrderRefundAddressInfoById(@Param("id")long id); |
| | | |
| | | List<AdminAddAddressTreeVo> getRefundAddress(); |
| | | } |
| | |
| | | MallOrderRefund selectOrderRefundByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | IPage<AdminMallOrderRefundVo> selectRefundListInPage(Page<AdminMallOrderRefundVo> page, @Param("record") MallOrderRefundDto mallOrderRefundDto); |
| | | |
| | | AdminMallOrderRefundVo getMallOrderRefundInfoById(@Param("id")long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAdminMallOrderService extends IService<MallOrderInfo> { |
| | | |
| | | IPage<AdminMallOrderInfoVo> getOrderListInPage(MallOrderInfoDto mallOrderInfo, QueryRequest request); |
| | |
| | | FebsResponse deleteAddress(Long id); |
| | | |
| | | FebsResponse addAddress(AddAddressDto addAddressDto); |
| | | |
| | | List<AdminAddAddressTreeVo> getRefundAddress(); |
| | | |
| | | FebsResponse withAddressUpdate(WithAddressUpdateDto withAddressUpdateDto); |
| | | |
| | | AdminMallOrderRefundVo getMallOrderRefundInfoById(long id); |
| | | } |
| | |
| | | MallOrderRefundOperation mallOrderRefundOperation = new MallOrderRefundOperation(); |
| | | mallOrderRefundOperation.setRefundId(mallOrderRefund.getId()); |
| | | mallOrderRefundOperation.setOrderId(mallOrderRefund.getOrderId()); |
| | | mallOrderRefundOperation.setContent("已同意退款申请"); |
| | | mallOrderRefundOperation.setContent("已同意退款不退货申请"); |
| | | mallOrderRefundOperationMapper.insert(mallOrderRefundOperation); |
| | | |
| | | return new FebsResponse().success(); |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<AdminAddAddressTreeVo> getRefundAddress() { |
| | | List<AdminAddAddressTreeVo> list = mallOrderRefundAddressMapper.getRefundAddress(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse withAddressUpdate(WithAddressUpdateDto withAddressUpdateDto) { |
| | | Long addressId = withAddressUpdateDto.getAddressId(); |
| | | MallOrderRefundAddress mallOrderRefundAddress = mallOrderRefundAddressMapper.selectById(addressId); |
| | | |
| | | MallOrderRefund mallOrderRefund = mallOrderRefundMapper.selectById(withAddressUpdateDto.getId()); |
| | | if(ObjectUtil.isEmpty(mallOrderRefund)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新重试"); |
| | | } |
| | | mallOrderRefund.setStatus(2); |
| | | mallOrderRefund.setName(mallOrderRefundAddress.getName()); |
| | | mallOrderRefund.setPhone(mallOrderRefundAddress.getPhone()); |
| | | mallOrderRefund.setAddress(mallOrderRefundAddress.getAddress()); |
| | | 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 AdminMallOrderRefundVo getMallOrderRefundInfoById(long id) { |
| | | return mallOrderRefundMapper.getMallOrderRefundInfoById(id); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMailGoodsDetailVo", description = "信息返回类") |
| | | public class AdminAddAddressTreeVo { |
| | | |
| | | private Long addressId; |
| | | |
| | | private String addressDetail; |
| | | |
| | | } |
| | |
| | | |
| | | private Long id; |
| | | |
| | | private String name; |
| | | private String buyName; |
| | | |
| | | private String phone; |
| | | private String buyPhone; |
| | | |
| | | private String addressDetail; |
| | | |
| | | private Long orderId; |
| | | |
| | |
| | | |
| | | private String expressNo; |
| | | |
| | | /** |
| | | * 1-仅退款不退货 2-退款退货 |
| | | */ |
| | | private Integer type; |
| | | |
| | | private String expressCom; |
| | | } |
| | |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | | <select id="getRefundAddress" resultType="cc.mrbird.febs.mall.vo.AdminAddAddressTreeVo"> |
| | | select a.id addressId,CONCAT(a.name,a.phone,a.address) addressDetail |
| | | from mall_order_refund_address a |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectRefundListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallOrderRefundVo"> |
| | | select *,b.name,b.phone,c.order_no |
| | | select a.*,b.name buyName ,b.phone buyPhone,c.order_no,CONCAT(a.name,a.phone,a.address) addressDetail |
| | | |
| | | from mall_order_refund a |
| | | left join mall_member b on b.id = a.member_id |
| | | left join mall_order_info c on c.id = a.order_id |
| | |
| | | </where> |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | | <select id="getMallOrderRefundInfoById" resultType="cc.mrbird.febs.mall.vo.AdminMallOrderRefundVo"> |
| | | select * from mall_order_refund where id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | agreeRefund(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'agreeWithAddress') { |
| | | febs.modal.open('选择退货地址', 'modules/order/withAddress/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#address-choose').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'disagree') { |
| | | febs.modal.confirm('拒绝', '拒绝此次退款申请?', function () { |
| | | disagreeRefund(data.id); |
| | |
| | | id: 'orderRefundTable', |
| | | url: ctx + 'admin/order/refundList', |
| | | cols: [[ |
| | | {field: 'name', title: '用户名', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '电话', minWidth: 150,align:'left'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, |
| | | {field: 'buyName', title: '用户名', minWidth: 150,align:'left'}, |
| | | {field: 'buyPhone', title: '电话', minWidth: 150,align:'left'}, |
| | | {field: 'type', title: '退款类型', |
| | | templet: function (d) { |
| | | if (d.type === 1) { |
| | | return '<span">仅退款不退货</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span>退款退货</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'reason', title: '退款原因', minWidth: 150,align:'left'}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | // {field: 'accountStatus', title: '账号状态', |
| | | // templet: function (d) { |
| | | // if (d.accountStatus === 1) { |
| | | // return '<span style="color:green;">正常</span>' |
| | | // } else if (d.accountStatus === 2) { |
| | | // return '<span style="color:red;">禁用</span>' |
| | | // }else{ |
| | | // return '' |
| | | // } |
| | | // }, minWidth: 80,align:'center'}, |
| | | // {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | {field: 'addressDetail', title: '收货信息', minWidth: 150,align:'left'}, |
| | | {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>' |
| | | if(d.type === 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 if(d.type === 2){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agreeWithAddress" 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="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 if(d.status === 4){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refundConfirm" shiro:hasPermission="user:update">退款确认</button>' |
New file |
| | |
| | | <style> |
| | | #address-choose { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #address-choose .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #address-choose #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #address-choose .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="address-choose"> |
| | | <form class="layui-form" action="" lay-filter="address-choose-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">地址:</label> |
| | | <div class="layui-input-inline"> |
| | | <select lay-verify="required" name="addressId" class="address-choose-id"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="address-choose-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | eleTree = layui.eleTree, |
| | | withAddress = [[${withAddress}]], |
| | | $view = $('#address-choose'), |
| | | validate = layui.validate, |
| | | _deptTree; |
| | | |
| | | form.render(); |
| | | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | form.val("address-choose-form", { |
| | | "id": withAddress.id |
| | | }); |
| | | } |
| | | |
| | | //付款方式(下拉框) |
| | | $.get(ctx + 'admin/order/addAddress/tree', function (data) { |
| | | for (var k in data) |
| | | { |
| | | $(".address-choose-id").append("<option value='" + data[k].addressId + "'>" + data[k].addressDetail + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | form.on('submit(address-choose-form-submit)', function (data) { |
| | | febs.post(ctx + 'admin/order/withAddressUpdate', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-order-refund').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |