master
ck 5 years ago
parent 739fc28c9c
commit e3aff986b7

@ -68,20 +68,25 @@ public class CaseCategoryServiceImpl extends BaseServiceImpl<CaseCategoryMapper,
*/
@Override
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){
CaseCategory findCaseCategory2 = new CaseCategory();
findCaseCategory2.setLevel(2);
findCaseCategory2.setState(Constants.STATE_VALID);
List<CaseCategory> caseCategoryList2 = caseCategoryMapper.select(findCaseCategory2);
findCaseCategory.setState(Constants.STATE_VALID);
// findCaseCategory.setState(Constants.STATE_VALID);
parentId = caseCategoryList2.get(0).getId();
findCaseCategory.setParentId(parentId);
// findCaseCategory.setParentId(parentId);
criteria.andEqualTo("parentId",parentId);
}else {
findCaseCategory.setState(Constants.STATE_VALID);
findCaseCategory.setParentId(parentId);
// findCaseCategory.setState(Constants.STATE_VALID);
criteria.andEqualTo("parentId",parentId);
}
List<CaseCategory> caseCategoryList = caseCategoryMapper.select(findCaseCategory);
List<CaseCategory> caseCategoryList = caseCategoryMapper.selectByExample(example);
JSONObject pageJson = PageUtils.page(caseCategoryList,pageNum,pageSize);
JSONArray jsonArray = pageJson.getJSONArray("list");
caseCategoryList = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), CaseCategory.class);

@ -8,6 +8,7 @@ import com.bsd.cases.model.*;
import com.bsd.cases.service.CaseContentService;
import com.bsd.cases.service.CaseUsersService;
import com.bsd.cases.util.AjaxResult;
import com.bsd.cases.util.LogUtils;
import com.bsd.cases.util.PageAjax;
import com.bsd.cases.util.PageUtils;
import com.bsd.cases.vo.CaseContentBakVo;
@ -16,6 +17,7 @@ import com.bsd.cases.vo.CaseContentDetailVo;
import com.bsd.cases.vo.CaseContentVo;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -50,7 +52,7 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
private CaseContentScoreMapper caseContentScoreMapper;
@Resource
private CaseContentForwardMapper caseContentForwardMapper;
private Logger logger = LogUtils.getPlatformLogger();
/**
*
*
@ -190,7 +192,8 @@ public class CaseContentServiceImpl extends BaseServiceImpl<CaseContentMapper, C
Long contentId = jsonObject.getLong("contentId");
JSONArray contentAttachmentJson = jsonObject.getJSONArray("contentAttachmentJson");
JSONArray contentMaterialJson = jsonObject.getJSONArray("contentMaterialJson");
logger.info("CKTEST"+ jsonObject.toJSONString());
System.out.println("CKTEST"+ jsonObject.toJSONString());
if (null == contentId) {
//新增
if (StringUtils.isBlank(contentTitle)) {

Loading…
Cancel
Save