Commit 0e12b330 authored by chase's avatar chase

修改模板删除为物理删除

parent 86211194
......@@ -260,23 +260,26 @@ public class TemplateServiceImpl extends AbstractService {
String path = "";
if (templateDb != null) {
TemplateExample example = new TemplateExample();
example.createCriteria().andCodeEqualTo(templateDb.getCode()).andIdEqualTo(templateDb.getId()).andIsActiveAssociationEqualTo(false);
long count = templateMapper.countByExample(example);
if (count > 0) {
path = templateDb.getPath();
//物理删除
deleteIsAtiveAssociation(templateDb);
} else {
if (param.isDeletePermanent() && !templateDb.getIsSystemType()) {
// TemplateExample example = new TemplateExample();
// example.createCriteria().andCodeEqualTo(templateDb.getCode()).andIdEqualTo(templateDb.getId()).andIsActiveAssociationEqualTo(false);
path = templateDb.getPath();
//物理删除
deleteIsAtiveAssociation(templateDb);
} else {
//逻辑删除
logicDeleteIsActiveAssociation(templateDb);
}
}
// long count = templateMapper.countByExample(example);
// if (count > 0) {
// path = templateDb.getPath();
// //物理删除
// deleteIsAtiveAssociation(templateDb);
// } else {
// if (param.isDeletePermanent() && !templateDb.getIsSystemType()) {
// path = templateDb.getPath();
// //物理删除
// deleteIsAtiveAssociation(templateDb);
// } else {
// //逻辑删除
// logicDeleteIsActiveAssociation(templateDb);
// }
// }
}
result.setResult(true);
......@@ -406,10 +409,16 @@ public class TemplateServiceImpl extends AbstractService {
}
private void deleteIsAtiveAssociation(Template templateDb) {
if(templateDb.getId() == null){
return;
}
cellTemplateConfigMapper.deleteCellTemplateConfigByCellTemplate(templateDb.getId());
keyValueReferenceMapper.deleteKeyValueReferenceByCellTemplate(templateDb.getId());
CellTemplateExample example = new CellTemplateExample();
example.createCriteria().andReportTemplateIdEqualTo(templateDb.getId());
cellTemplateMapper.deleteByExample(example);
TemplateExample templateExample = new TemplateExample();
templateExample.createCriteria().andIdEqualTo(templateDb.getId());
templateMapper.deleteByExample(templateExample);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment