|
|
|
|
@ -16,6 +16,7 @@ import net.mingsoft.basic.util.PinYinUtil; |
|
|
|
|
import net.mingsoft.basic.util.StringUtil; |
|
|
|
|
import net.mingsoft.cms.biz.ICategoryBiz; |
|
|
|
|
import net.mingsoft.cms.entity.CategoryEntity; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
|
@ -180,7 +181,7 @@ public class CategoryAction extends BaseAction { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param category 分类实体 |
|
|
|
|
* @param categorys 分类实体 |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "批量删除分类列表接口") |
|
|
|
|
@PostMapping("/delete") |
|
|
|
|
@ -295,12 +296,35 @@ public class CategoryAction extends BaseAction { |
|
|
|
|
@ApiOperation(value = "批量更新模版") |
|
|
|
|
@GetMapping("/updateTemplate") |
|
|
|
|
@ResponseBody |
|
|
|
|
public ResultData updateTemplate(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){ |
|
|
|
|
|
|
|
|
|
//父栏目是列表
|
|
|
|
|
|
|
|
|
|
//父栏目是封面
|
|
|
|
|
@RequiresPermissions("cms:category:update") |
|
|
|
|
public ResultData updateTemplate(@ModelAttribute @ApiIgnore CategoryEntity category){ |
|
|
|
|
if (category ==null || StringUtils.isEmpty(category.getId())) { |
|
|
|
|
return ResultData.build().error(getResString("err.error", this.getResString("id"))); |
|
|
|
|
} |
|
|
|
|
category = categoryBiz.getById(category.getId()); |
|
|
|
|
category.setCategoryParentId(null); |
|
|
|
|
List<CategoryEntity> childs = categoryBiz.queryChilds(category); |
|
|
|
|
//更新与父节点相同类型的子栏目的模板内容
|
|
|
|
|
for (int i =0; i < childs.size(); i++) { |
|
|
|
|
if (childs.get(i).getCategoryType().equals(category.getCategoryType())) { |
|
|
|
|
childs.get(i).setCategoryUrl(category.getCategoryUrl()); |
|
|
|
|
childs.get(i).setCategoryListUrl(category.getCategoryListUrl()); |
|
|
|
|
categoryBiz.updateEntity(childs.get(i)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ResultData.build().success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "复制栏目") |
|
|
|
|
@GetMapping("/copyCategory") |
|
|
|
|
@ResponseBody |
|
|
|
|
@RequiresPermissions("cms:category:save") |
|
|
|
|
public ResultData copyCategory(@ModelAttribute @ApiIgnore CategoryEntity category){ |
|
|
|
|
if (category == null || StringUtils.isEmpty(category.getId())) { |
|
|
|
|
return ResultData.build().error(getResString("err.error", this.getResString("id"))); |
|
|
|
|
} |
|
|
|
|
categoryBiz.copyCategory(category); |
|
|
|
|
return ResultData.build().success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|