|
@@ -113,24 +113,19 @@ public class ContentServiceImpl extends ServiceImpl<ContentMapper, ContentEntity
|
|
public Result saveEntity(ContentDto param) {
|
|
public Result saveEntity(ContentDto param) {
|
|
Long id = param.getId();
|
|
Long id = param.getId();
|
|
ContentEntity entity;
|
|
ContentEntity entity;
|
|
- boolean isIndex = false;
|
|
|
|
Long imgIndexId = param.getImgIndexId();
|
|
Long imgIndexId = param.getImgIndexId();
|
|
if (id == null) {
|
|
if (id == null) {
|
|
entity = new ContentEntity();
|
|
entity = new ContentEntity();
|
|
BeanUtils.copyProperties(param, entity);
|
|
BeanUtils.copyProperties(param, entity);
|
|
entity.setCreatorId(baseService.getUserId());
|
|
entity.setCreatorId(baseService.getUserId());
|
|
this.save(entity);
|
|
this.save(entity);
|
|
- if (imgIndexId != null){
|
|
|
|
- isIndex = true;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
} else {
|
|
} else {
|
|
entity = this.getById(id);
|
|
entity = this.getById(id);
|
|
BaseRuntimeException.isNull(entity, ErrorEnum.FAILURE_SYS_2001);
|
|
BaseRuntimeException.isNull(entity, ErrorEnum.FAILURE_SYS_2001);
|
|
BeanUtils.copyProperties(param, entity);
|
|
BeanUtils.copyProperties(param, entity);
|
|
- if (imgIndexId !=null && !imgIndexId.equals(entity.getImgIndexId())){
|
|
|
|
- isIndex = true;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
this.updateById(entity);
|
|
this.updateById(entity);
|
|
}
|
|
}
|
|
|
|
|