师傅退单/商家退单
This commit is contained in:
parent
daa1555f62
commit
063717b4ca
|
|
@ -823,6 +823,16 @@ public class OrderDetailController extends BaseController {
|
||||||
return AjaxResult.success("发起成功");
|
return AjaxResult.success("发起成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝订单
|
||||||
|
* 后台管理系统使用,可控制权限
|
||||||
|
*/
|
||||||
|
@PostMapping("/reject")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult reject(OrderDetail orderDetail) {
|
||||||
|
return rejectDetailOrder(orderDetail);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拒绝订单
|
* 拒绝订单
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -815,4 +815,14 @@ public class OrderMasterController extends BaseController {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拒绝订单
|
||||||
|
* 后台管理系统使用,可控制权限
|
||||||
|
*/
|
||||||
|
@PostMapping("/reject")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult reject(OrderMaster orderMaster) {
|
||||||
|
int i = orderMasterService.reject(orderMaster);
|
||||||
|
return AjaxResult.success(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,17 @@
|
||||||
+ '<small>接单时间:' + row.revTime + '</small>';
|
+ '<small>接单时间:' + row.revTime + '</small>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'left',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info"></i>查看</a> ');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderDetailReject(\'' + row.id + '\')"><i class="fa fa-remove"></i>师傅退单</a> ');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderMasterReject(\'' + row.orderMasterId + '\')"><i class="fa fa-remove"></i>商家退单</a> ');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'goodsWorker',
|
field: 'goodsWorker',
|
||||||
title: '商家信息',
|
title: '商家信息',
|
||||||
|
|
@ -144,16 +155,6 @@
|
||||||
field: 'changeMoney',
|
field: 'changeMoney',
|
||||||
title: '商家追加金额',
|
title: '商家追加金额',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
align: 'left'
|
|
||||||
// formatter: function (value, row, index) {
|
|
||||||
// var actions = [];
|
|
||||||
// actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\''
|
|
||||||
// + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
|
||||||
// return actions.join('');
|
|
||||||
// }
|
|
||||||
},{
|
},{
|
||||||
field: 'orderType',
|
field: 'orderType',
|
||||||
title: '订单类型',
|
title: '订单类型',
|
||||||
|
|
@ -190,6 +191,20 @@
|
||||||
var url = "order/goods?orderId=" + id;
|
var url = "order/goods?orderId=" + id;
|
||||||
$.modal.open("商品信息", url);
|
$.modal.open("商品信息", url);
|
||||||
}
|
}
|
||||||
|
function orderDetailReject(id) {
|
||||||
|
$.modal.confirm("确定要退单吗?", function() {
|
||||||
|
const url = "detail/reject";
|
||||||
|
const data = { "id": id };
|
||||||
|
$.operate.post(url, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function orderMasterReject(id) {
|
||||||
|
$.modal.confirm("确定要退单吗?", function() {
|
||||||
|
const url = "master/reject";
|
||||||
|
const data = { "id": id };
|
||||||
|
$.operate.post(url, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -110,4 +110,6 @@ public interface OrderDetailMapper {
|
||||||
* @return 1
|
* @return 1
|
||||||
*/
|
*/
|
||||||
int updateDrawCashStatus(@Param("drawCashId") String drawCashId, @Param("drawCashStatus") int drawCashStatus, @Param("arrivalTime") Date arrivalTime);
|
int updateDrawCashStatus(@Param("drawCashId") String drawCashId, @Param("drawCashStatus") int drawCashStatus, @Param("arrivalTime") Date arrivalTime);
|
||||||
|
|
||||||
|
int deleteByMaster(Long masterId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,4 +173,6 @@ public interface OrderDetailService {
|
||||||
* @return 1
|
* @return 1
|
||||||
*/
|
*/
|
||||||
int updateTimeout(Long id, int timeout, int timeoutFineTimes);
|
int updateTimeout(Long id, int timeout, int timeoutFineTimes);
|
||||||
|
|
||||||
|
int deleteByMaster(Long masterId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ghy.order.service;
|
package com.ghy.order.service;
|
||||||
|
|
||||||
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
import com.ghy.order.domain.OrderMaster;
|
import com.ghy.order.domain.OrderMaster;
|
||||||
import com.ghy.order.request.AppOrderRequest;
|
import com.ghy.order.request.AppOrderRequest;
|
||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||||
|
|
@ -162,4 +163,6 @@ public interface OrderMasterService {
|
||||||
* @return 1
|
* @return 1
|
||||||
*/
|
*/
|
||||||
int removeWorker(Long id);
|
int removeWorker(Long id);
|
||||||
|
|
||||||
|
int reject(OrderMaster orderMaster);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -769,4 +769,9 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
public int updateTimeout(Long id, int timeout, int timeoutFineTimes) {
|
public int updateTimeout(Long id, int timeout, int timeoutFineTimes) {
|
||||||
return orderDetailMapper.updateTimeout(id, timeout, timeoutFineTimes);
|
return orderDetailMapper.updateTimeout(id, timeout, timeoutFineTimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByMaster(Long masterId) {
|
||||||
|
return orderDetailMapper.deleteByMaster(masterId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -518,4 +518,17 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
||||||
public int removeWorker(Long id) {
|
public int removeWorker(Long id) {
|
||||||
return orderMasterMapper.removeWorker(id);
|
return orderMasterMapper.removeWorker(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int reject(OrderMaster orderMaster) {
|
||||||
|
// 删主单的 workerId
|
||||||
|
int i1 = orderMasterMapper.removeWorker(orderMaster.getId());
|
||||||
|
// 删子单对应的 OrderGoods
|
||||||
|
List<OrderDetail> orderDetails = orderDetailService.selectByOrderMasterId(orderMaster.getId());
|
||||||
|
orderDetails.forEach(x -> orderGoodsService.deleteByOrderDetailId(x.getId()));
|
||||||
|
// 删子单
|
||||||
|
orderDetailService.deleteByMaster(orderMaster.getId());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,10 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByMaster">
|
||||||
|
DELETE FROM order_detail WHERE order_master_id = #{masterId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<update id="updateOrderDetail" parameterType="com.ghy.order.domain.OrderDetail">
|
<update id="updateOrderDetail" parameterType="com.ghy.order.domain.OrderDetail">
|
||||||
UPDATE order_detail
|
UPDATE order_detail
|
||||||
<set>
|
<set>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue