From a9f950c0d11a687a7a940443b8c765f6d87ae4f1 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Tue, 20 Apr 2021 00:26:22 +0800
Subject: [PATCH] 合并新的修改
---
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | 45 ++++++++++++++++++++++-----------------------
1 files changed, 22 insertions(+), 23 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 fa5ca81..67a8262 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
@@ -15,10 +15,8 @@
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.action.util.QueryUtil;
-import com.matrix.system.hive.bean.ShoppingGoods;
-import com.matrix.system.hive.bean.ShoppingGoodsCategory;
-import com.matrix.system.hive.bean.ShoppingGoodsCategory2;
-import com.matrix.system.hive.bean.SysOrder;
+import com.matrix.system.hive.bean.*;
+import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hive.pojo.ShoppingCarItem;
import com.matrix.system.hive.pojo.ShoppingCarItemsVo;
@@ -55,30 +53,28 @@
@Autowired
private SysOrderService sysOrderService;
+ @Autowired
+ private SysShopInfoDao shopInfoDao;
+
@ApiOperation(value = "获取商品类型列表", notes = "获取商品类型列表")
@ApiResponses({
@ApiResponse(code = 200, message = "ok", response = ShoppingGoodsCategory.class)
})
@GetMapping(value = "/findShoppingGoodsType")
public AjaxResult findShoppingGoodsType() {
- List<ShoppingGoodsCategory2> list=new ArrayList<>();
- ShoppingGoodsCategory2 jjcp=new ShoppingGoodsCategory2();
- jjcp.setId("家居产品");
- jjcp.setName("家居产品");
- jjcp.setParentId(0L);
- ShoppingGoodsCategory2 xm=new ShoppingGoodsCategory2();
- xm.setId("项目");
- xm.setName("项目");
- xm.setParentId(0L);
- ShoppingGoodsCategory2 tc=new ShoppingGoodsCategory2();
- tc.setId("套餐");
- tc.setName("套餐");
- tc.setParentId(0L);
- ShoppingGoodsCategory2 czk=new ShoppingGoodsCategory2();
- czk.setId("充值卡");
- czk.setName("充值卡");
- czk.setParentId(0L);
- return AjaxResult.buildSuccessInstance(Arrays.asList(jjcp,xm,tc,czk));
+ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+
+ SysShopInfo zbShop = shopInfoDao.selectZbShop(user.getCompanyId());
+ ShoppingGoodsCategory category = new ShoppingGoodsCategory();
+ category.setShopId(zbShop.getId());
+ List<ShoppingGoodsCategory> list = new ArrayList<>();
+ List<ShoppingGoodsCategory> byModel = shoppingGoodsCategoryService.findByModel(category);
+ ShoppingGoodsCategory type = new ShoppingGoodsCategory();
+ type.setName("全部");
+ type.setParentId(0L);
+ list.add(type);
+ list.addAll(byModel);
+ return AjaxResult.buildSuccessInstance(list);
}
@ApiOperation(value = "获取商品列表", notes = "获取商品列表")
@@ -88,7 +84,10 @@
@PostMapping(value = "/findShoppingGoods")
public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) {
SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
- shoppingGoodsListDto.setShopId(user.getShopId());
+ if (!DataAuthUtil.hasAllShopAuth()) {
+ shoppingGoodsListDto.setShopId(user.getShopId());
+ }
+ QueryUtil.setQueryLimitCom(shoppingGoodsListDto);
return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto));
}
--
Gitblit v1.9.1