|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -45,6 +46,7 @@ import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
|
import com.elink.esua.epdc.service.NoticeDepartmentService; |
|
|
|
import com.elink.esua.epdc.service.NoticeService; |
|
|
|
import com.elink.esua.epdc.util.NewsUtils; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -75,23 +77,32 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<NoticeDTO> page(Map<String, Object> params) { |
|
|
|
// String noticeTitle = (String) params.get("noticeTitle");
|
|
|
|
// params.put("noticeTitle", noticeTitle.trim());
|
|
|
|
// QueryWrapper<NoticeEntity> wrapper = this.getWrapper(params)
|
|
|
|
// .eq(FieldConstant.CREATED_BY, SecurityUser.getUserId());
|
|
|
|
//
|
|
|
|
// IPage<NoticeEntity> page = baseDao.selectPage(
|
|
|
|
// getPage(params, FieldConstant.CREATED_TIME, false),
|
|
|
|
// wrapper
|
|
|
|
// );
|
|
|
|
// return getPageData(page, NoticeDTO.class);
|
|
|
|
String noticeTitle = (String) params.get("noticeTitle"); |
|
|
|
params.put("noticeTitle", noticeTitle.trim()); |
|
|
|
QueryWrapper<NoticeEntity> wrapper = this.getWrapper(params) |
|
|
|
.eq(FieldConstant.CREATED_BY, SecurityUser.getUserId()) |
|
|
|
.eq("EXTEND_FLAG", NumConstant.ZERO_L); |
|
|
|
|
|
|
|
IPage<NoticeEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
wrapper |
|
|
|
); |
|
|
|
return getPageData(page, NoticeDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
params.put("createdBy", SecurityUser.getUserId()); |
|
|
|
@Override |
|
|
|
public PageData<NoticeDTO> extendPage(Map<String, Object> params) { |
|
|
|
String noticeTitle = (String) params.get("noticeTitle"); |
|
|
|
params.put("noticeTitle", noticeTitle.trim()); |
|
|
|
|
|
|
|
IPage<NoticeDTO> page = getPage(params); |
|
|
|
List<NoticeDTO> list = baseDao.getModulePageList(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
|
QueryWrapper<NoticeEntity> wrapper = this.getWrapper(params) |
|
|
|
.ne("EXTEND_FLAG", NumConstant.ZERO_L); |
|
|
|
|
|
|
|
IPage<NoticeEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
|
wrapper |
|
|
|
); |
|
|
|
return getPageData(page, NoticeDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -221,7 +232,10 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
entity.setParentDeptNames(deptDTO.getParentDeptNames()); |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> noticeGridList = NewsUtils.getAllGridId(dto.getAllDeptIdsShow()); |
|
|
|
List<Long> noticeGridList = Lists.newArrayList(); |
|
|
|
if (NumConstant.ZERO_STR.equals(dto.getExtendFlag())) { |
|
|
|
noticeGridList = NewsUtils.getAllGridId(dto.getAllDeptIdsShow()); |
|
|
|
} |
|
|
|
|
|
|
|
boolean isSave = true; |
|
|
|
if (StringUtils.isNotBlank(dto.getId())) { |
|
|
@ -238,7 +252,9 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
noticeDepartmentService.deleteByNoticeId(entity.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
this.noticeDepartmentService.save(entity.getId(), noticeGridList); |
|
|
|
if (CollUtil.isNotEmpty(noticeGridList)) { |
|
|
|
this.noticeDepartmentService.save(entity.getId(), noticeGridList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|