From 472b47ffc2be949a11d08de5930699e507ebf0a0 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Tue, 19 Jan 2021 09:26:25 +0800
Subject: [PATCH] 图片配置修改
---
zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java | 112 +++++++++++++++++++++++++++++++++++++
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | 29 +++++++--
zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java | 11 +++
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml | 14 ++++
4 files changed, 160 insertions(+), 6 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 50fb898..fa5ca81 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,7 +15,9 @@
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.plugin.util.CollectionUtils;
import com.matrix.system.hive.pojo.ShoppingCarItem;
@@ -32,6 +34,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -58,11 +61,24 @@
})
@GetMapping(value = "/findShoppingGoodsType")
public AjaxResult findShoppingGoodsType() {
- SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
-
- ShoppingGoodsCategory category = new ShoppingGoodsCategory();
- category.setShopId(user.getShopId());
- return AjaxResult.buildSuccessInstance(shoppingGoodsCategoryService.findByModel(category));
+ 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));
}
@ApiOperation(value = "获取商品列表", notes = "获取商品列表")
@@ -71,7 +87,8 @@
})
@PostMapping(value = "/findShoppingGoods")
public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) {
-
+ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+ shoppingGoodsListDto.setShopId(user.getShopId());
return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto));
}
diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java
index e98ca7d..62a7172 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java
@@ -15,6 +15,9 @@
@ApiModelProperty(value = "商品名称/编号/拼音")
private String queryKey;
+ @ApiModelProperty(value = "商品类型")
+ private String goodType;
+
@ApiModelProperty(value = "类型ID", example = "13")
private Long cateId;
@@ -29,6 +32,14 @@
@ApiModelProperty(hidden = true)
private Long shopId;
+ public String getGoodType() {
+ return goodType;
+ }
+
+ public void setGoodType(String goodType) {
+ this.goodType = goodType;
+ }
+
public Long getShopId() {
return shopId;
}
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java
new file mode 100644
index 0000000..fae082b
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java
@@ -0,0 +1,112 @@
+package com.matrix.system.hive.bean;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @date 2016-07-30 09:54
+ */
+public class ShoppingGoodsCategory2 implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+
+ private String id;
+
+
+ /**
+ * 类型名称
+ */
+ private String name;
+
+
+ /**
+ * 父类型
+ */
+ private Long parentId;
+
+
+ /**
+ * 排序
+ */
+ private Integer sequence;
+
+ /**
+ * 销售平台
+ */
+ private String salePlatform;
+
+
+ private Long shopId;
+
+ private Long companyId;
+
+ public Long getShopId() {
+ return shopId;
+ }
+
+ public void setShopId(Long shopId) {
+ this.shopId = shopId;
+ }
+
+ public Long getCompanyId() {
+ return companyId;
+ }
+
+ public void setCompanyId(Long companyId) {
+ this.companyId = companyId;
+ }
+
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id=id;
+ }
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name=name;
+ }
+
+
+ public Long getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId) {
+ this.parentId=parentId;
+ }
+
+
+ public Integer getSequence() {
+ return sequence;
+ }
+
+ public void setSequence(Integer sequence) {
+ this.sequence=sequence;
+ }
+
+ public String getSalePlatform() {
+ return salePlatform;
+ }
+
+ public void setSalePlatform(String salePlatform) {
+ this.salePlatform = salePlatform;
+ }
+
+ @Override
+ public String toString() {
+ return "ShoppingGoodsCategory [id=" + id + ", name=" + name
+ + ", parentId=" + parentId + ", sequence=" + sequence
+ + ", salePlatform=" + salePlatform + "]";
+ }
+
+
+}
\ 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 61df9a6..aa826ad 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
@@ -1255,6 +1255,13 @@
<if test="record.cateId!=null">
and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId}))
</if>
+ <if test="record.shopId != null and record.shopId !='' ">
+ <![CDATA[ and ( a.shop_id = #{record.shopId} or
+ ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]>
+ </if>
+ <if test="record.goodType!=null">
+ and a.good_type=#{record.goodType}
+ </if>
<if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
<if test="pageVo.sort !=null and pageVo.order !=null">
order by ${pageVo.sort} ${pageVo.order}
@@ -1275,5 +1282,12 @@
<if test="record.cateId!=null">
and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId}))
</if>
+ <if test="record.shopId != null and record.shopId !='' ">
+ <![CDATA[ and ( a.shop_id = #{record.shopId} or
+ ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]>
+ </if>
+ <if test="record.goodType!=null">
+ and a.good_type=#{record.goodType}
+ </if>
</select>
</mapper>
--
Gitblit v1.9.1