Commit 5b658f68 by qwmqiuwenmin

fix

parent fc41c44c
...@@ -31,4 +31,6 @@ public interface MaterialApiService { ...@@ -31,4 +31,6 @@ public interface MaterialApiService {
String reUpdalodMetail(String materialId); String reUpdalodMetail(String materialId);
List<MaterialCategoryDTO> listByParentCategory(String categoryId);
} }
...@@ -23,4 +23,6 @@ public interface TabHaobanMaterialCategoryMapper { ...@@ -23,4 +23,6 @@ public interface TabHaobanMaterialCategoryMapper {
TabHaobanMaterialCategory selectByCategoryNameAndParentId(@Param("categoryName")String categoryName, @Param("categoryParentId")String categoryParentId); TabHaobanMaterialCategory selectByCategoryNameAndParentId(@Param("categoryName")String categoryName, @Param("categoryParentId")String categoryParentId);
List<TabHaobanMaterialCategory> listCategory(@Param("wxEnterpriseId")String wxEnterpriseId); List<TabHaobanMaterialCategory> listCategory(@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanMaterialCategory> listByParentCategory(@Param("categoryId")String categoryId);
} }
\ No newline at end of file
...@@ -16,4 +16,6 @@ public interface MaterialCategoryService { ...@@ -16,4 +16,6 @@ public interface MaterialCategoryService {
void editCategory(MaterialCategoryDTO materialCategoryDTO); void editCategory(MaterialCategoryDTO materialCategoryDTO);
List<MaterialCategoryDTO> listByParentCategory(String categoryId);
} }
...@@ -49,4 +49,9 @@ public class MaterialCategoryServiceImpl implements MaterialCategoryService{ ...@@ -49,4 +49,9 @@ public class MaterialCategoryServiceImpl implements MaterialCategoryService{
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanMaterialCategory.class, materialCategoryDTO)); mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanMaterialCategory.class, materialCategoryDTO));
} }
@Override
public List<MaterialCategoryDTO> listByParentCategory(String categoryId) {
return EntityUtil.changeEntityListByJSON(MaterialCategoryDTO.class, mapper.listByParentCategory(categoryId));
}
} }
...@@ -243,4 +243,9 @@ public class MaterialApiServiceImpl implements MaterialApiService { ...@@ -243,4 +243,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
return null; return null;
} }
@Override
public List<MaterialCategoryDTO> listByParentCategory(String categoryId) {
return materialCategoryService.listByParentCategory(categoryId);
}
} }
...@@ -132,4 +132,12 @@ ...@@ -132,4 +132,12 @@
where status_flag = 1 where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
</select> </select>
<select id="listByParentCategory" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_material_category
where status_flag = 1
and category_parent_id = #{categoryId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -93,6 +93,11 @@ public class MaterialController extends WebBaseController{ ...@@ -93,6 +93,11 @@ public class MaterialController extends WebBaseController{
if(dto == null){ if(dto == null){
return resultResponse(HaoBanErrCode.ERR_10016); return resultResponse(HaoBanErrCode.ERR_10016);
} }
List<MaterialCategoryDTO> categoryList = materialApiService.listByParentCategory(categoryId);
if(categoryList != null && !categoryList.isEmpty()){
return resultResponse(HaoBanErrCode.ERR_10017);
}
List<MaterialDTO> list = materialApiService.listMaterialByCategoryId(categoryId); List<MaterialDTO> list = materialApiService.listMaterialByCategoryId(categoryId);
if(list!= null && !list.isEmpty()){ if(list!= null && !list.isEmpty()){
return resultResponse(HaoBanErrCode.ERR_10017); return resultResponse(HaoBanErrCode.ERR_10017);
......
...@@ -95,6 +95,8 @@ public enum HaoBanErrCode { ...@@ -95,6 +95,8 @@ public enum HaoBanErrCode {
ERR_10018(10018,"素材不存在"), ERR_10018(10018,"素材不存在"),
ERR_10019(10019,"存在子分组不能删除"),
ERR_100015(100015,"暂存部门不能删除"), ERR_100015(100015,"暂存部门不能删除"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment