|
|
|
@ -207,7 +207,6 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
//是不是草稿箱
|
|
|
|
entity.setNewsReleaseState(newsReleaseState); |
|
|
|
|
|
|
|
boolean isSave = true; |
|
|
|
if (StringUtils.isBlank(newsDto.getId())) { |
|
|
|
// 新增操作时,保存创建人,创建人部门信息。
|
|
|
|
@ -240,6 +239,7 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
//草稿箱操作
|
|
|
|
if (YesOrNoEnum.YES.value().equals(newsReleaseState)) { |
|
|
|
if (isSave) { |
|
|
|
setNull(newsDto, entity); |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
|
entity.setUpdatedBy(user.getRealName()); |
|
|
|
@ -255,6 +255,7 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
newsGridList = adminResult.getData(); |
|
|
|
} |
|
|
|
if (isSave) { |
|
|
|
setNull(newsDto, entity); |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
|
entity.setUpdatedBy(user.getRealName()); |
|
|
|
@ -269,6 +270,17 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void setNull(NewsDTO newsDto, NewsEntity entity) { |
|
|
|
if(newsDto.getCommunityId()==null||StringUtils.isBlank(newsDto.getCommunity())||newsDto.getCommunityId()==0){ |
|
|
|
entity.setCommunity(null); |
|
|
|
entity.setCommunityId(null); |
|
|
|
} |
|
|
|
if (newsDto.getGridId()==null||newsDto.getGridId()==0||StringUtils.isBlank(newsDto.getGrid())){ |
|
|
|
entity.setGridId(null); |
|
|
|
entity.setGrid(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<EpdcNewsListResultDTO>> listNews(EpdcNewsListFromDTO formDto) { |
|
|
|
|
|
|
|
|