|  |  |  | 
|---|
|  |  |  | category.setCreateUser(loginUserInfo.getId()); | 
|---|
|  |  |  | category.setUpdateTime(new Date()); | 
|---|
|  |  |  | category.setUpdateUser(loginUserInfo.getId()); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())){ | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList()) | 
|---|
|  |  |  | && !Constants.equalsInteger(category.getType(),Constants.THREE)){ | 
|---|
|  |  |  | category.setDetail(category.getDetailList().toJSONString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(!Constants.equalsInteger(category.getType(),Constants.ONE)){ | 
|---|
|  |  |  | 
|---|
|  |  |  | category.setUpdateTime(new Date()); | 
|---|
|  |  |  | category.setIsFixed(null); | 
|---|
|  |  |  | category.setUpdateUser(loginUserInfo.getId()); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList())){ | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(category.getDetailList()) | 
|---|
|  |  |  | && !Constants.equalsInteger(category.getType(),Constants.THREE)){ | 
|---|
|  |  |  | category.setDetail(category.getDetailList().toJSONString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | categoryMapper.updateById(category); | 
|---|
|  |  |  | 
|---|
|  |  |  | QueryWrapper<Category> wrapper = new QueryWrapper<>(category); | 
|---|
|  |  |  | return categoryMapper.selectCount(wrapper); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<Category> getCategoryList(Integer type){ | 
|---|
|  |  |  | List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda().eq(Category::getDeleted,Constants.ZERO).eq(Category::getStatus,Constants.ZERO) | 
|---|
|  |  |  | .eq(Objects.nonNull(type),Category::getType,type)); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){ | 
|---|
|  |  |  | String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() | 
|---|
|  |  |  | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode(); | 
|---|
|  |  |  | for (Category category:categoryList) { | 
|---|
|  |  |  | if(StringUtils.isNotBlank(category.getDetail())){ | 
|---|
|  |  |  | category.setDetailList(JSONArray.parseArray(category.getDetail())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(StringUtils.isNotBlank(category.getIcon())){ | 
|---|
|  |  |  | category.setIconFull(path + category.getIcon()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return categoryList; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|