From 461a0bb4d550d959bd5eeb0b2d92aac696ad476b Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 24 Dec 2020 18:07:24 +0800
Subject: [PATCH] add cancelOrder interface
---
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | 18 ++++++++++++++++++
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml | 4 ++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java
index 4f7c62a..891c01f 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java
@@ -1,6 +1,7 @@
package com.matrix.system.app.action;
import com.matrix.core.constance.MatrixConstance;
+import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
@@ -14,6 +15,7 @@
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.ShoppingGoodsCategory;
+import com.matrix.system.hive.bean.SysOrder;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hive.pojo.ShoppingCarItem;
import com.matrix.system.hive.pojo.ShoppingCarItemsVo;
@@ -147,4 +149,20 @@
return ajaxResult;
}
+ @ApiOperation(value = "取消订单", notes = "取消订单")
+ @GetMapping(value = "/cancelOrder/{orderId}")
+ public AjaxResult cancelOrder(@PathVariable("orderId") Long orderId) {
+ SysOrder order = sysOrderService.findById(orderId);
+ if (order == null) {
+ throw new GlobleException("订单不存在");
+ }
+
+
+ int i = sysOrderService.cancelOrder(orderId);
+ if (i > 0) {
+ return AjaxResult.buildSuccessInstance("取消成功");
+ }
+ return AjaxResult.buildFailInstance("取消失败");
+ }
+
}
\ No newline at end of file
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
index 30bfbb7..849f191 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
@@ -1239,7 +1239,7 @@
measure measure,
a.good_type goodsType
from shopping_goods a
- where 1=1
+ where 1=1 and staus = '上架'
<if test="record.queryKey != null and record.queryKey != ''">
and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey}))
</if>
@@ -1259,7 +1259,7 @@
<select id="selectShopppingGoodsAipTotal" resultType="java.lang.Integer">
select count(1)
from shopping_goods a
- where 1=1
+ where 1=1 and staus = '上架'
<if test="record.queryKey != null and record.queryKey != ''">
and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey}))
</if>
--
Gitblit v1.9.1