|
|
|
@ -6,15 +6,19 @@ import com.bsd.cases.constants.Constants;
|
|
|
|
|
import com.bsd.cases.mapper.CaseCategoryMapper;
|
|
|
|
|
import com.bsd.cases.model.CaseCategory;
|
|
|
|
|
import com.bsd.cases.model.CaseContent;
|
|
|
|
|
import com.bsd.cases.model.CaseUsers;
|
|
|
|
|
import com.bsd.cases.service.CaseCategoryService;
|
|
|
|
|
import com.bsd.cases.util.AjaxRequest;
|
|
|
|
|
import com.bsd.cases.util.AjaxResult;
|
|
|
|
|
import com.bsd.cases.util.PageAjax;
|
|
|
|
|
import com.bsd.cases.util.PageUtils;
|
|
|
|
|
import com.bsd.cases.vo.CaseCategoryVo;
|
|
|
|
|
import com.bsd.cases.vo.CaseSearchVo;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import tk.mybatis.mapper.entity.Example;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -201,11 +205,40 @@ public class CaseCategoryServiceImpl extends BaseServiceImpl<CaseCategoryMapper,
|
|
|
|
|
ajaxResult.setRetmsg("成功删除类别");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//待确认
|
|
|
|
|
return ajaxResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过parentId获取类别
|
|
|
|
|
* @param parentId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<CaseCategory> getBakCategoryByParentId(Long parentId) {
|
|
|
|
|
CaseCategory findCaseCategory = new CaseCategory();
|
|
|
|
|
findCaseCategory.setState(Constants.STATE_VALID);
|
|
|
|
|
if (null == parentId) {
|
|
|
|
|
//获取一级分类
|
|
|
|
|
findCaseCategory.setLevel(1);
|
|
|
|
|
}else {
|
|
|
|
|
//获取其他分类
|
|
|
|
|
findCaseCategory.setParentId(parentId);
|
|
|
|
|
}
|
|
|
|
|
List<CaseCategory> caseCategoryList = caseCategoryMapper.select(findCaseCategory);
|
|
|
|
|
return caseCategoryList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ajaxResult;
|
|
|
|
|
@Override
|
|
|
|
|
public PageAjax<CaseCategory> searchBakCategory(String name, Integer pageNum) {
|
|
|
|
|
Example example = new Example(CaseCategory.class);
|
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andEqualTo("state", Constants.STATE_VALID);
|
|
|
|
|
criteria.andLike("name", "%"+name+"%");
|
|
|
|
|
PageHelper.startPage(pageNum, Constants.PAGE_SIZE);
|
|
|
|
|
List<CaseCategory> caseCategoryList = caseCategoryMapper.selectByExample(example);
|
|
|
|
|
PageAjax<CaseCategory> pageAjax = new PageAjax<>(caseCategoryList);
|
|
|
|
|
return pageAjax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|