Helius
2020-12-24 461a0bb4d550d959bd5eeb0b2d92aac696ad476b
add cancelOrder interface
2 files modified
22 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java 18 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml 4 ●●●● patch | view | raw | blame | history
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("取消失败");
    }
}
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>