From 8d105b1378477e9c5be8c1c6055b2a2fe34e806e Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 22 Jan 2021 10:47:41 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java             |   11 +++++++++++
 zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java |    4 ++--
 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml              |    6 ++++++
 zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java     |    4 +++-
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java
index db24fd7..412a3a4 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java
@@ -6,6 +6,8 @@
 import com.matrix.system.hive.action.BaseController;
 import com.matrix.system.hive.bean.Article;
 import com.matrix.system.hive.bean.ArticleType;
+import com.matrix.system.hive.bean.SysShopInfo;
+import com.matrix.system.hive.dao.SysShopInfoDao;
 import com.matrix.system.hive.service.ArticleService;
 import com.matrix.system.hive.service.ArticleTypeService;
 import io.swagger.annotations.Api;
@@ -32,7 +34,7 @@
     @GetMapping(value = "/findKnowledgeType")
     public AjaxResult findKnowledgeType() {
         ArticleType type = new ArticleType();
-        type.setShopId(getMe().getCompanyId());
+        type.setCompanyId(getMe().getCompanyId());
         type.setParentId(0L);
         return AjaxResult.buildSuccessInstance(articleTypeService.findByModel(type));
     }
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java
index 2857afc..3811381 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java
@@ -77,7 +77,7 @@
 	public @ResponseBody AjaxResult queryAll(ArticleType articleType) {
 		SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
 		articleType.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY);
-		articleType.setShopId(users.getShopId());
+		articleType.setCompanyId(users.getCompanyId());
 		return new AjaxResult(AjaxResult.STATUS_SUCCESS,	currentService.findByModel(articleType), 0);
 	}
 	
@@ -115,7 +115,7 @@
    		articleType.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY);
 		SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
 		articleType.setShopId(users.getShopId());
-
+		articleType.setCompanyId(users.getCompanyId());
 		Long parentId = articleType.getParentId();
 		List<Long> ids = new ArrayList<>();
 		while (parentId != 0) {
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java
index 3c9420e..fc2cee1 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java
@@ -58,6 +58,8 @@
 	private Long shopId;
 
 	private String parentIds;
+
+	private Long companyId;
 			
 	/**
 	 * 扩展属性
@@ -83,6 +85,15 @@
 	public void setArticle(Article article) {
 		this.article = article;
 	}*/
+
+	public Long getCompanyId() {
+		return companyId;
+	}
+
+	public void setCompanyId(Long companyId) {
+		this.companyId = companyId;
+	}
+
 	public Long getId() {
 		return id;
 	}
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml
index 65db100..1cdc488 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml
@@ -15,6 +15,7 @@
 		<result property="type" column="type" />
 		<result property="parentIds" column="parent_ids" />
 		<result property="shopId" column="shop_id"/>
+		<result property="companyId" column="company_id" />
 			<!--扩展属性  -->
 			<!-- <association property="article" javaType="Article"
 			column="{type_id=id}" select="com.matrix.system.hive.dao.ArticleDao.selectById" /> -->
@@ -32,6 +33,7 @@
 			icon,
 			type,
 			shop_id,
+			company_id,
 			parent_ids
 		)
 	VALUES (
@@ -44,6 +46,7 @@
 			#{icon},
 			#{type},
 			#{shopId},
+			#{companyId},
 			#{parentIds}
 	)
 	</insert>
@@ -250,6 +253,9 @@
 			<if test="record.shopId != null and record.shopId !='' ">
 				and shop_id = #{record.shopId}
 			</if>
+			<if test="record.companyId != null and record.companyId !='' ">
+				and company_id = #{record.companyId}
+			</if>
 		</if>
 	</select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1