|
@@ -101,14 +101,16 @@ public class BasicTemplateServiceImpl extends ServiceImpl<BasicTemplateMapper, B
|
|
}
|
|
}
|
|
// 修改
|
|
// 修改
|
|
else {
|
|
else {
|
|
- if (basicTemplate != null && basicTemplate.getId().longValue() != template.getId().longValue()) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("模板名称已存在");
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotBlank((basicTemplate.getPreviewPath()))) {
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(basicTemplate.getPreviewPath());
|
|
|
|
- String type = jsonObject.getString(SystemConstant.TYPE);
|
|
|
|
- if (Objects.nonNull(type) && type.equalsIgnoreCase(SystemConstant.LOCAL)) {
|
|
|
|
- FileUtils.forceDelete(new File(jsonObject.getString(SystemConstant.PATH)));
|
|
|
|
|
|
+ if (basicTemplate != null) {
|
|
|
|
+ if (basicTemplate.getId().longValue() != template.getId().longValue()) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("模板名称已存在");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank((basicTemplate.getPreviewPath()))) {
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(basicTemplate.getPreviewPath());
|
|
|
|
+ String type = jsonObject.getString(SystemConstant.TYPE);
|
|
|
|
+ if (Objects.nonNull(type) && type.equalsIgnoreCase(SystemConstant.LOCAL)) {
|
|
|
|
+ FileUtils.forceDelete(new File(jsonObject.getString(SystemConstant.PATH)));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|