src/main/java/cc/mrbird/febs/dapp/controller/AdminMallGoodsController.java
@@ -231,6 +231,18 @@ return adminMallGoodsService.deliverGoods(deliverGoodsDto); } /** * 订单列表-删除订单 * * @param id * @return */ @GetMapping("delOrder/{id}") @ControllerEndpoint(operation = "订单列表-删除订单", exceptionMessage = "操作失败") public FebsResponse delOrder(@NotNull(message = "{required}") @PathVariable Long id) { return adminMallGoodsService.delOrder(id); } @GetMapping(value = "/findDicByType/{type}") public FebsResponse findDicByType(@PathVariable("type") String type) { return new FebsResponse().success().data(adminMallGoodsService.findDataDicByType(type)); src/main/java/cc/mrbird/febs/dapp/controller/ViewAdminMallGoodsController.java
@@ -129,8 +129,9 @@ // @RequiresPermissions("deliverGoods:update") public String deliverGoods(@PathVariable long id, Model model) { AdminMallOrderVo data = mallGoodsService.getMallOrderInfoById(id); data.setId(id); model.addAttribute("deliverInfo", data); return FebsUtil.view("modules/order/deliverGoods"); return FebsUtil.view("goods/deliverGoods"); } @GetMapping("profitSetting") src/main/java/cc/mrbird/febs/dapp/mapper/DappMemberDao.java
@@ -109,4 +109,7 @@ IPage<MallAddressInfo> selectShopAddressListInPage(@Param("record")MallGoodsQueryDto queryDto, Page<MallAddressInfo> page); int updateIsDefault(@Param("isDefault") Integer isDefault, @Param("memberId") Long memberId, @Param("id") Long id); void deleteByOrderId(@Param("orderId")Long id); } src/main/java/cc/mrbird/febs/dapp/service/IAdminMallGoodsService.java
@@ -67,4 +67,6 @@ AdminMallOrderVo getMallOrderInfoById(long id); FebsResponse deliverGoods(DeliverGoodsDto deliverGoodsDto); FebsResponse delOrder(Long id); } src/main/java/cc/mrbird/febs/dapp/service/impl/AdminMallGoodsService.java
@@ -15,6 +15,8 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -43,6 +45,7 @@ private final PlatformBannerMapper platformBannerMapper; private final MallGoodsImagesMapper mallGoodsImagesMapper; private final DappMemberDao dappMemberDao; @Override public IPage<MallGoods> getCategoryListInPage(MallGoods mallGoods, QueryRequest request) { @@ -458,4 +461,15 @@ return new FebsResponse().success(); } @Override public FebsResponse delOrder(Long id) { MallOrderInfo mallOrderInfo = mallOrderInfoMapper.selectById(id); if(ObjectUtil.isEmpty(mallOrderInfo)){ return new FebsResponse().fail().message("订单不存在,请刷新重试"); } mallOrderInfoMapper.deleteById(id); dappMemberDao.deleteByOrderId(id); return new FebsResponse().success(); } } src/main/java/cc/mrbird/febs/dapp/vo/AdminMallOrderVo.java
@@ -14,4 +14,6 @@ private String phone; private String address; private String area; } src/main/resources/mapper/dapp/DappMemberDao.xml
@@ -384,4 +384,8 @@ and id = #{id} </if> </update> <delete id="deleteByOrderId"> delete from mall_order_item where order_id = #{orderId} </delete> </mapper> src/main/resources/templates/febs/views/goods/deliverGoods.html
File was renamed from src/main/resources/templates/febs/views/goods/orderdeliverGoods.html @@ -40,6 +40,13 @@ </div> </div> <div class="layui-form-item"> <label class="layui-form-label febs-form-item-require">区域:</label> <div class="layui-input-block"> <input type="text" name="area" autocomplete="off" class="layui-input" readonly> </div> </div> <div class="layui-form-item"> <label class="layui-form-label febs-form-item-require">地址:</label> <div class="layui-input-block"> <input type="text" name="address" @@ -89,6 +96,7 @@ "id": deliverInfo.id, "name": deliverInfo.name, "phone": deliverInfo.phone, "area": deliverInfo.area, "address": deliverInfo.address }); } src/main/resources/templates/febs/views/goods/orderList.html
@@ -72,33 +72,23 @@ </div> </form> <table lay-filter="orderTable" lay-data="{id: 'orderTable'}"></table> <style type="text/css"> .layui-table-cell{ text-align:center; height: auto; white-space: nowrap; /*文本不会换行,在同一行显示*/ overflow: hidden; /*超出隐藏*/ text-overflow: ellipsis; /*省略号显示*/ } .layui-table img{ max-width:100px } </style> <!-- <style type="text/css">--> <!-- .layui-table-cell{--> <!-- text-align:center;--> <!-- height: auto;--> <!-- white-space: nowrap; /*文本不会换行,在同一行显示*/--> <!-- overflow: hidden; /*超出隐藏*/--> <!-- text-overflow: ellipsis; /*省略号显示*/--> <!-- }--> <!-- .layui-table img{--> <!-- max-width:100px--> <!-- }--> <!-- </style>--> </div> </div> </div> </div> </div> <!-- 表格操作栏 start --> <script type="text/html" id="mall-order-option"> {{# if(d.status === 2) { }} <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="deliverGoods">发货</button> <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button> {{# } else if(d.status === 3) { }} <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="delOrder">删除</button> {{# } else { }} {{# } }} </script> <script type="text/html" id="user-option"> <span shiro:lacksPermission="user:view,user:update,user:delete"> <span class="layui-badge-dot febs-bg-orange"></span> 无权限 @@ -170,7 +160,7 @@ }); function delOrder(id) { febs.get(ctx + 'admin/order/delOrder/' + id, null, function () { febs.get(ctx + 'admin/goods/delOrder/' + id, null, function () { febs.alert.success('操作成功'); $query.click(); }); @@ -214,12 +204,37 @@ return '' } }, minWidth: 80,align:'center'}, {field: 'deliverState', title: '发货状态', templet: function (d) { if (d.deliverState === 1) { return '<span style="color:blue;">待发货</span>' } else if (d.deliverState === 2) { return '<span style="color:green;">已发货</span>' }else if (d.deliverState === 3) { return '<span style="color:red;">已收货</span>' }else{ return '' } }, minWidth: 80,align:'center'}, {field: 'orderTime', title: '下单时间', minWidth: 200,align:'left'}, {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, {field: 'payTime', title: '支付时间', minWidth: 200,align:'left'}, {field: 'payOrderNo', title: '支付订单号', minWidth: 200,align:'left'}, {title: '操作', minWidth: 200 ,toolbar: '#mall-order-option',hide:mallOrderOption,align:'left', fixed:'right'}, {title: '操作', templet: function (d) { if (d.status === 2) { if(d.deliverState === 1){ return '<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="deliverGoods">发货</button>' +'<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button>' }else{ return '<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button>' } }else if(d.status === 3){ return '<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="delOrder">删除</button>' }else{ return '<button class="layui-btn layui-btn-warm layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="delOrder">删除</button>' } },minWidth: 200,align:'center', fixed:'right'} ]] }); }