|
|
@ -95,29 +95,31 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
private QueryWrapper<NewsEntity> getWrapper(Map<String, Object> params) { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
String draft = (String) params.get("draft"); |
|
|
|
String streetId = (String) params.get("streetId"); |
|
|
|
String communityId = (String) params.get("communityId"); |
|
|
|
String gridId = (String) params.get("gridId"); |
|
|
|
String streetId = (String) params.get(FieldConstant.STREET_ID_HUMP); |
|
|
|
String communityId = (String) params.get(FieldConstant.COMMUNITY_ID_HUMP); |
|
|
|
String gridId = (String) params.get(FieldConstant.GRID_ID_HUMP); |
|
|
|
String startTime = (String) params.get("startTime"); |
|
|
|
String endTime = (String) params.get("endTime"); |
|
|
|
String category = (String) params.get("category"); |
|
|
|
String keyword = ((String) params.get("keyword")).trim(); |
|
|
|
String keyword = ((String) params.get("keyword")); |
|
|
|
QueryWrapper<NewsEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(streetId), "STREET_ID", streetId); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(streetId), FieldConstant.STREET_ID, streetId); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(communityId), "COMMUNITY_ID", communityId); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); |
|
|
|
wrapper.ge(StringUtils.isNotBlank(startTime), "CREATED_TIME", startTime); |
|
|
|
wrapper.lt(StringUtils.isNotBlank(endTime), "CREATED_TIME", endTime); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(gridId), FieldConstant.GRID_ID, gridId); |
|
|
|
wrapper.ge(StringUtils.isNotBlank(startTime), FieldConstant.CREATED_TIME, startTime); |
|
|
|
wrapper.lt(StringUtils.isNotBlank(endTime), FieldConstant.CREATED_TIME, endTime); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(category), "NEWS_CATERORY_ID", category); |
|
|
|
wrapper.like(StringUtils.isNotBlank(keyword), "NEWS_TITLE", keyword); |
|
|
|
wrapper.eq("CREATED_BY", user.getId()); |
|
|
|
if (StringUtils.isNotBlank(keyword)) { |
|
|
|
wrapper.like("NEWS_TITLE", keyword.trim()); |
|
|
|
} |
|
|
|
wrapper.eq(FieldConstant.CREATED_BY, user.getId()); |
|
|
|
//draft 前端传上来的一个标志 有则代表是存草稿箱的 1
|
|
|
|
if (StringUtils.isNotEmpty(draft)) { |
|
|
|
wrapper.eq(StringUtils.isNotBlank(draft), "NEWS_RELEASE_STATE", YesOrNoEnum.YES.value()); |
|
|
|
} else { |
|
|
|
wrapper.eq("NEWS_RELEASE_STATE", YesOrNoEnum.NO.value()); |
|
|
|
} |
|
|
|
wrapper.orderByDesc("CREATED_TIME"); |
|
|
|
wrapper.orderByDesc(FieldConstant.CREATED_TIME); |
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
@ -239,7 +241,9 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
if (isSave) { |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
|
updateById(entity); |
|
|
|
entity.setUpdatedBy(user.getRealName()); |
|
|
|
entity.setUpdatedTime(new Date()); |
|
|
|
this.baseDao.updateNewsById(entity); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (CollUtil.isEmpty(newsGridList)) { |
|
|
@ -252,7 +256,9 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
if (isSave) { |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
|
updateById(entity); |
|
|
|
entity.setUpdatedBy(user.getRealName()); |
|
|
|
entity.setUpdatedTime(new Date()); |
|
|
|
this.baseDao.updateNewsById(entity); |
|
|
|
newsDepartmentService.deleteByNewsId(entity.getId()); |
|
|
|
} |
|
|
|
this.newsDepartmentService.save(entity.getId(), newsGridList); |
|
|
|