|
|
@ -120,13 +120,14 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
if (StringUtils.isNotBlank(gridId)) { |
|
|
|
wrapper.like("ALL_DEPT_IDS", gridId.trim()); |
|
|
|
} |
|
|
|
wrapper.eq(FieldConstant.CREATED_BY, user.getId()); |
|
|
|
wrapper.in("DEPT_ID", user.getDeptIdList()); |
|
|
|
//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.groupBy("ID"); |
|
|
|
wrapper.orderByDesc(FieldConstant.CREATED_TIME); |
|
|
|
return wrapper; |
|
|
|
} |
|
|
@ -142,10 +143,10 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
private List<Long[]> getParentAllDeptInfo(List<Long> listDeptId){ |
|
|
|
private List<Long[]> getParentAllDeptInfo(List<Long> listDeptId) { |
|
|
|
// [0,1,2,3]
|
|
|
|
List<Long[]> allDeptIdsShowList = new ArrayList<>(); |
|
|
|
for (Long list : listDeptId){ |
|
|
|
for (Long list : listDeptId) { |
|
|
|
// 查询父级部门
|
|
|
|
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(list.toString()); |
|
|
|
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); |
|
|
@ -153,7 +154,7 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
String[] deptIdsShow = allDeptIds.split(","); |
|
|
|
Long[] allDeptIdsShowLong = new Long[deptIdsShow.length]; |
|
|
|
// 从第一级开始保存
|
|
|
|
for (int i = 0; i <= deptIdsShow.length -1; i++){ |
|
|
|
for (int i = 0; i <= deptIdsShow.length - 1; i++) { |
|
|
|
allDeptIdsShowLong[i] = Long.valueOf(deptIdsShow[i]); |
|
|
|
} |
|
|
|
allDeptIdsShowList.add(allDeptIdsShowLong); |
|
|
@ -176,7 +177,6 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(NewsDTO dto) { |
|
|
@ -344,16 +344,17 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
|
|
|
|
/** |
|
|
|
* 查看新闻详情时,判断是否要插入新闻已读表 |
|
|
|
* |
|
|
|
* @param formDto |
|
|
|
* @return void |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 10:47 2020-05-15 |
|
|
|
**/ |
|
|
|
private void isInsertNewsRead(EpdcNewsDetailFormDTO formDto){ |
|
|
|
private void isInsertNewsRead(EpdcNewsDetailFormDTO formDto) { |
|
|
|
// 查看新闻详情时,判断是否是第一次查看本条新闻
|
|
|
|
int readCount = newsUserReadService.countNewsIsRead(formDto); |
|
|
|
// 是插入新闻已读表
|
|
|
|
if (readCount == 0){ |
|
|
|
if (readCount == 0) { |
|
|
|
NewsUserReadDTO dto = new NewsUserReadDTO(); |
|
|
|
dto.setNewsId(formDto.getNewsId()); |
|
|
|
dto.setUserId(formDto.getUserId()); |
|
|
@ -361,6 +362,7 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
} |
|
|
|
// 否无操作
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result modifyStatement(EpdcNewsStatementFromDTO statementFromDto) { |
|
|
@ -520,7 +522,7 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
public PageData<NewsDTO> allPage(Map<String, Object> params) { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
List<Long> deptIdList = user.getDeptIdList(); |
|
|
|
params.put("deptIdList",deptIdList); |
|
|
|
params.put("deptIdList", deptIdList); |
|
|
|
IPage<NewsDTO> page = getPage(params); |
|
|
|
List<NewsDTO> newsDaoList = baseDao.selectAllPage(params); |
|
|
|
return new PageData<>(newsDaoList, page.getTotal()); |
|
|
@ -543,17 +545,16 @@ public class NewsServiceImpl extends BaseServiceImpl<NewsDao, NewsEntity> implem |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 组织机构信息处理 |
|
|
|
* |
|
|
|
* @params [dto, newsList] |
|
|
|
* @return java.util.List<com.elink.esua.epdc.entity.NewsEntity> |
|
|
|
* @params [dto, newsList] |
|
|
|
* @author liuchuang |
|
|
|
* @since 2020/3/7 14:47 |
|
|
|
*/ |
|
|
|
private List<NewsEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<NewsDTO> newsList) { |
|
|
|
List<NewsEntity> entities = new ArrayList<>(); |
|
|
|
for (NewsDTO news: newsList) { |
|
|
|
for (NewsDTO news : newsList) { |
|
|
|
NewsEntity entity = new NewsEntity(); |
|
|
|
if (StringUtils.isNotEmpty(news.getParentDeptIds()) && StringUtils.isNotEmpty(news.getParentDeptNames())) { |
|
|
|
List<String> parentDeptIds = Arrays.asList(news.getParentDeptIds().split(",")); |
|
|
|