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)); } 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) { 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; } 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>