|
|
|
@ -40,16 +40,18 @@ public class KnowledgeSummaryController {
|
|
|
|
|
if (StringUtils.isBlank(sysKnowledgeSummary.getContent())) {
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "内容不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(sysKnowledgeSummary.getThreeTagId())||StringUtils.isBlank(sysKnowledgeSummary.getThreeTagName())){
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请先选择章节!");
|
|
|
|
|
}
|
|
|
|
|
//不为空修改
|
|
|
|
|
SysKnowledgeSummaryExample example = new SysKnowledgeSummaryExample();
|
|
|
|
|
SysKnowledgeSummaryExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andOneTagIdEqualTo(sysKnowledgeSummary.getOneTagId()).andThreeTagIdEqualTo(sysKnowledgeSummary.getThreeTagId()).andTwoTagIdEqualTo(sysKnowledgeSummary.getTwoTagId());
|
|
|
|
|
List<SysKnowledgeSummary> sysKnowledgeSummaries = knowledgeSummaryMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
if (sysKnowledgeSummaries != null && !sysKnowledgeSummaries.isEmpty()) {
|
|
|
|
|
if (StringUtils.isNotBlank(sysKnowledgeSummary.getKnowledgeSummaryId())) {
|
|
|
|
|
SysKnowledgeSummary sysKnowledgeSummaries = knowledgeSummaryMapper.selectByPrimaryKey(sysKnowledgeSummary.getKnowledgeSummaryId());
|
|
|
|
|
|
|
|
|
|
if (sysKnowledgeSummaries != null) {
|
|
|
|
|
knowledgeSummaryMapper.updateByPrimaryKeyWithBLOBs(sysKnowledgeSummary);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "修改成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//新增
|
|
|
|
|
String uuid = IdUtil.randomUUID();
|
|
|
|
|
sysKnowledgeSummary.setKnowledgeSummaryId(uuid);
|
|
|
|
@ -96,6 +98,11 @@ public class KnowledgeSummaryController {
|
|
|
|
|
@RequestParam String oneId,
|
|
|
|
|
@RequestParam String twoId,
|
|
|
|
|
@RequestParam String threeId) {
|
|
|
|
|
//单独处理打印
|
|
|
|
|
if (threeId.equals("f7498d64-0231-42c4-bc1e-8a0186eab56a")) {
|
|
|
|
|
System.out.println("操作对象为变量时前端传的数据,一级ID===》》》》" + oneId + "二级Id===》》" + twoId + "三级Id===》》" + threeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除知识概要
|
|
|
|
|
try {
|
|
|
|
|
knowledgeSummaryMapper.deleteByPrimaryKey(id);
|
|
|
|
@ -121,6 +128,11 @@ public class KnowledgeSummaryController {
|
|
|
|
|
SysKnowledgeSummaryExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andOneTagIdEqualTo(oneId).andThreeTagIdEqualTo(threeId).andTwoTagIdEqualTo(twoId);
|
|
|
|
|
List<SysKnowledgeSummary> sysKnowledgeSummaries = knowledgeSummaryMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
//单独处理打印
|
|
|
|
|
if (threeId.equals("f7498d64-0231-42c4-bc1e-8a0186eab56a")) {
|
|
|
|
|
System.out.println("操作对象为变量时前端传的数据,一级ID===》》》》" + oneId + "二级Id===》》" + twoId + "三级Id===》》" + threeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sysKnowledgeSummaries != null && !sysKnowledgeSummaries.isEmpty()) {
|
|
|
|
|
return new ResultEntity<SysKnowledgeSummary>(sysKnowledgeSummaries.get(0));
|
|
|
|
|
} else return null;
|
|
|
|
|