Compare commits

...

2 Commits

Author SHA1 Message Date
ck 2480acf169 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/main/java/com/bsd/cases/service/impl/CaseContentServiceImpl.java
5 years ago
ck e3aff986b7 排序 5 years ago

@ -68,20 +68,25 @@ public class CaseCategoryServiceImpl extends BaseServiceImpl<CaseCategoryMapper,
*/ */
@Override @Override
public JSONObject getCaseCategoryByParentId(Long parentId,Integer pageNum,Integer pageSize) { public JSONObject getCaseCategoryByParentId(Long parentId,Integer pageNum,Integer pageSize) {
CaseCategory findCaseCategory = new CaseCategory(); // CaseCategory findCaseCategory = new CaseCategory();
Example example = new Example(CaseCategory.class);
example.setOrderByClause("update_date_time DESC");
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("state",Constants.STATE_VALID);
if (null == parentId){ if (null == parentId){
CaseCategory findCaseCategory2 = new CaseCategory(); CaseCategory findCaseCategory2 = new CaseCategory();
findCaseCategory2.setLevel(2); findCaseCategory2.setLevel(2);
findCaseCategory2.setState(Constants.STATE_VALID); findCaseCategory2.setState(Constants.STATE_VALID);
List<CaseCategory> caseCategoryList2 = caseCategoryMapper.select(findCaseCategory2); List<CaseCategory> caseCategoryList2 = caseCategoryMapper.select(findCaseCategory2);
findCaseCategory.setState(Constants.STATE_VALID); // findCaseCategory.setState(Constants.STATE_VALID);
parentId = caseCategoryList2.get(0).getId(); parentId = caseCategoryList2.get(0).getId();
findCaseCategory.setParentId(parentId); // findCaseCategory.setParentId(parentId);
criteria.andEqualTo("parentId",parentId);
}else { }else {
findCaseCategory.setState(Constants.STATE_VALID); // findCaseCategory.setState(Constants.STATE_VALID);
findCaseCategory.setParentId(parentId); criteria.andEqualTo("parentId",parentId);
} }
List<CaseCategory> caseCategoryList = caseCategoryMapper.select(findCaseCategory); List<CaseCategory> caseCategoryList = caseCategoryMapper.selectByExample(example);
JSONObject pageJson = PageUtils.page(caseCategoryList,pageNum,pageSize); JSONObject pageJson = PageUtils.page(caseCategoryList,pageNum,pageSize);
JSONArray jsonArray = pageJson.getJSONArray("list"); JSONArray jsonArray = pageJson.getJSONArray("list");
caseCategoryList = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), CaseCategory.class); caseCategoryList = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), CaseCategory.class);

@ -52,8 +52,7 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
private CaseContentScoreMapper caseContentScoreMapper; private CaseContentScoreMapper caseContentScoreMapper;
@Resource @Resource
private CaseContentForwardMapper caseContentForwardMapper; private CaseContentForwardMapper caseContentForwardMapper;
private Logger logger = LogUtils.getPlatformLogger();
private Logger logger = LogUtils.getBussinessLogger();
/** /**
* *
@ -195,8 +194,7 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
JSONArray contentAttachmentJson = jsonObject.getJSONArray("contentAttachmentJson"); JSONArray contentAttachmentJson = jsonObject.getJSONArray("contentAttachmentJson");
JSONArray contentMaterialJson = jsonObject.getJSONArray("contentMaterialJson"); JSONArray contentMaterialJson = jsonObject.getJSONArray("contentMaterialJson");
System.out.println("CKTEST"+jsonObject.toJSONString()); System.out.println("CKTEST"+jsonObject.toJSONString());
logger.info("CKTEST"+jsonObject.toJSONString()); logger.info("CKTEST"+jsonObject.toJSONString());if (null == contentId) {
if (null == contentId) {
//新增 //新增
if (StringUtils.isBlank(contentTitle)) { if (StringUtils.isBlank(contentTitle)) {
ajaxResult.setRetcode(AjaxResult.FAILED); ajaxResult.setRetcode(AjaxResult.FAILED);
@ -417,12 +415,4 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
} }
return ajaxResult; return ajaxResult;
} }
@Override
public AjaxResult getAllContentList() {
AjaxResult ajaxResult = new AjaxResult();
List<CaseContent> caseContentList = caseContentMapper.getAllContentList();
ajaxResult.setData(caseContentList);
return ajaxResult;
}
} }

Loading…
Cancel
Save