Commit d1f47fc6 authored by huyuchen's avatar huyuchen

新增订单作废

parent 9910a63d
......@@ -114,4 +114,8 @@ public class OrderConstants {
* 一次性导出不可超过20000条,请分批导出
*/
public static final String EXPORT_TOO_LONG = "一次性导出不可超过20000条,请分批导出";
/**
* 订单作废失败
*/
public static final String ORDER_INVALID_FAILED = "订单状态为待办理才可作废";
}
......@@ -140,4 +140,17 @@ public class OrderController {
return R.ok(tOrderService.getOrderReplyPageList(page,orderNo));
}
/**
* 订单作废
*
* @author licancan
* @param id
* @return {@link R< String>}
*/
@PostMapping("/invalidOrder")
@Operation(summary = "订单作废", description = "订单作废")
public R invalidOrder(@RequestParam String id) {
return tOrderService.invalidOrder(id);
}
}
......@@ -108,4 +108,13 @@ public interface TOrderService extends IService<TOrder> {
* @throws IOException
*/
R receiveOrderReply(OrderReplyAddVO vo) throws IOException;
/**
* 订单作废
*
* @author licancan
* @param id
* @return {@link R}
*/
R invalidOrder(String id);
}
......@@ -582,4 +582,13 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
public R invalidOrder(String id) {
TOrder one = baseMapper.selectById(id);
if (Common.isNotNull(one) && CommonConstants.ZERO_INT == one.getOrderStatus()) {
return R.failed(OrderConstants.ORDER_INVALID_FAILED);
}
one.setDeleteFlag(CommonConstants.ONE_INT);
baseMapper.updateById(one);
return R.ok();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment