|
|
@ -35,10 +35,10 @@ import com.elink.esua.epdc.dao.NoticeDao; |
|
|
|
import com.elink.esua.epdc.dao.NoticeDepartmentDao; |
|
|
|
import com.elink.esua.epdc.dto.NoticeDTO; |
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcContentListFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcNoticeBrowseFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcNoticeListFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNoticeDetailResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNoticeListResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.*; |
|
|
|
import com.elink.esua.epdc.entity.NoticeEntity; |
|
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.redis.NoticeRedis; |
|
|
@ -77,8 +77,12 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<NoticeDTO> page(Map<String, Object> params) { |
|
|
|
params.put("createdBy", SecurityUser.getUserId()); |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
if (null == user) { |
|
|
|
throw new RenException("登陆状态失效,请退出重新登陆"); |
|
|
|
} |
|
|
|
|
|
|
|
params.put("deptIdList", user.getDeptIdList()); |
|
|
|
IPage<NoticeDTO> page = getPage(params); |
|
|
|
List<NoticeDTO> list = baseDao.getModulePageList(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
@ -86,10 +90,16 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<NoticeDTO> extendPage(Map<String, Object> params) { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
if (null == user) { |
|
|
|
throw new RenException("登陆状态失效,请退出重新登陆"); |
|
|
|
} |
|
|
|
|
|
|
|
params.put("deptIdList", user.getDeptIdList()); |
|
|
|
String noticeTitle = (String) params.get("noticeTitle"); |
|
|
|
params.put("noticeTitle", noticeTitle.trim()); |
|
|
|
|
|
|
|
QueryWrapper<NoticeEntity> wrapper = this.getWrapper(params) |
|
|
|
QueryWrapper<NoticeEntity> wrapper = this.getExtendWrapper(params) |
|
|
|
.ne("EXTEND_FLAG", NumConstant.ZERO_L); |
|
|
|
|
|
|
|
IPage<NoticeEntity> page = baseDao.selectPage( |
|
|
@ -130,6 +140,19 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<NoticeEntity> getExtendWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
String noticeTitle = ((String) params.get("noticeTitle")); |
|
|
|
if (StringUtils.isNotBlank(noticeTitle)) { |
|
|
|
noticeTitle.trim(); |
|
|
|
} |
|
|
|
QueryWrapper<NoticeEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) |
|
|
|
.like(StringUtils.isNotBlank(noticeTitle), "NOTICE_TITLE", noticeTitle) |
|
|
|
.in("DEPT_ID", params.get("deptIdList")); |
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public NoticeDTO get(String id) { |
|
|
|
NoticeEntity entity = baseDao.selectById(id); |
|
|
@ -448,4 +471,23 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity> |
|
|
|
|
|
|
|
return entities; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<EpdcNoticeModuleListResultDTO> listContentModules() { |
|
|
|
return baseDao.selectListContentModules(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<EpdcContentListResultDTO> listContents(EpdcContentListFormDTO formDto) { |
|
|
|
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); |
|
|
|
formDto.setPageIndex(pageIndex); |
|
|
|
return baseDao.selectListContents(formDto); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public EpdcContentDetailResultDTO getContentDetailById(String id) { |
|
|
|
// 增加浏览数
|
|
|
|
baseDao.addContentReadingAmount(id); |
|
|
|
return baseDao.getContentDetailById(id); |
|
|
|
} |
|
|
|
} |
|
|
|