|
@@ -36,6 +36,7 @@ import com.xjrsoft.module.oa.service.INewsService;
|
|
|
import com.xjrsoft.module.oa.vo.*;
|
|
import com.xjrsoft.module.oa.vo.*;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
|
|
import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
|
|
|
import com.xjrsoft.module.organization.entity.*;
|
|
import com.xjrsoft.module.organization.entity.*;
|
|
|
|
|
+import com.xjrsoft.module.organization.mapper.DepartmentMapper;
|
|
|
import com.xjrsoft.module.organization.mapper.UserDeptRelationMapper;
|
|
import com.xjrsoft.module.organization.mapper.UserDeptRelationMapper;
|
|
|
import com.xjrsoft.module.organization.mapper.UserMapper;
|
|
import com.xjrsoft.module.organization.mapper.UserMapper;
|
|
|
import com.xjrsoft.module.organization.service.IWeChatService;
|
|
import com.xjrsoft.module.organization.service.IWeChatService;
|
|
@@ -84,6 +85,8 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
|
|
|
|
|
private final UserMapper userMapper;
|
|
private final UserMapper userMapper;
|
|
|
|
|
|
|
|
|
|
+ private final DepartmentMapper departmentMapper;
|
|
|
|
|
+
|
|
|
private final BaseClassMapper baseClassMapper;
|
|
private final BaseClassMapper baseClassMapper;
|
|
|
|
|
|
|
|
private final XjrUserMapper xjrUserMapper;
|
|
private final XjrUserMapper xjrUserMapper;
|
|
@@ -156,27 +159,36 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
if (addProclamationDto.getSendRange() == 3 && addProclamationDto.getRelationList() != null) {
|
|
if (addProclamationDto.getSendRange() == 3 && addProclamationDto.getRelationList() != null) {
|
|
|
for (AddNewsRelationDto relationDto : addProclamationDto.getRelationList()) {
|
|
for (AddNewsRelationDto relationDto : addProclamationDto.getRelationList()) {
|
|
|
if (relationDto.getRelationType() == 1) {
|
|
if (relationDto.getRelationType() == 1) {
|
|
|
|
|
+ Department department = departmentMapper.selectById(relationDto.getRelationId());
|
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
|
setNewsId(news.getId());
|
|
setNewsId(news.getId());
|
|
|
setRelationId(relationDto.getRelationId());
|
|
setRelationId(relationDto.getRelationId());
|
|
|
setRelationType(relationDto.getRelationType());
|
|
setRelationType(relationDto.getRelationType());
|
|
|
- setRelationName("部门");
|
|
|
|
|
|
|
+ if(department != null){
|
|
|
|
|
+ setRelationName(department.getName());
|
|
|
|
|
+ }
|
|
|
}});
|
|
}});
|
|
|
}
|
|
}
|
|
|
if (relationDto.getRelationType() == 2) {
|
|
if (relationDto.getRelationType() == 2) {
|
|
|
|
|
+ XjrUser xjrUser = xjrUserMapper.selectById(relationDto.getRelationId());
|
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
|
setNewsId(news.getId());
|
|
setNewsId(news.getId());
|
|
|
setRelationId(relationDto.getRelationId());
|
|
setRelationId(relationDto.getRelationId());
|
|
|
setRelationType(relationDto.getRelationType());
|
|
setRelationType(relationDto.getRelationType());
|
|
|
- setRelationName("人员");
|
|
|
|
|
|
|
+ if(xjrUser != null){
|
|
|
|
|
+ setRelationName(xjrUser.getName());
|
|
|
|
|
+ }
|
|
|
}});
|
|
}});
|
|
|
}
|
|
}
|
|
|
if (relationDto.getRelationType() == 3) {
|
|
if (relationDto.getRelationType() == 3) {
|
|
|
|
|
+ BaseClass baseClass = baseClassMapper.selectById(relationDto.getRelationId());
|
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
|
setNewsId(news.getId());
|
|
setNewsId(news.getId());
|
|
|
setRelationId(relationDto.getRelationId());
|
|
setRelationId(relationDto.getRelationId());
|
|
|
setRelationType(relationDto.getRelationType());
|
|
setRelationType(relationDto.getRelationType());
|
|
|
- setRelationName("班级");
|
|
|
|
|
|
|
+ if(baseClass != null){
|
|
|
|
|
+ setRelationName(baseClass.getName());
|
|
|
|
|
+ }
|
|
|
}});
|
|
}});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -264,7 +276,8 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
.eq(News::getTypeId, 2)
|
|
.eq(News::getTypeId, 2)
|
|
|
.like(dto.getFullHead() != null, News::getFullHead, dto.getFullHead())
|
|
.like(dto.getFullHead() != null, News::getFullHead, dto.getFullHead())
|
|
|
.like(dto.getKeyword() != null, News::getNewsContent, dto.getKeyword())
|
|
.like(dto.getKeyword() != null, News::getNewsContent, dto.getKeyword())
|
|
|
- .orderByDesc(News::getReleaseTime);
|
|
|
|
|
|
|
+ .orderByDesc(News::getReleaseTime)
|
|
|
|
|
+ .disableSubLogicDel();
|
|
|
IPage<ProclamationPageVo> page = this.selectJoinListPage(ConventPage.getPage(dto), ProclamationPageVo.class, queryNews);
|
|
IPage<ProclamationPageVo> page = this.selectJoinListPage(ConventPage.getPage(dto), ProclamationPageVo.class, queryNews);
|
|
|
return page;
|
|
return page;
|
|
|
}
|
|
}
|
|
@@ -284,7 +297,8 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
.eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
|
|
.eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
|
|
|
.or()
|
|
.or()
|
|
|
.eq(News::getSendRange, 2)
|
|
.eq(News::getSendRange, 2)
|
|
|
- .orderByDesc(News::getReleaseTime);
|
|
|
|
|
|
|
+ .orderByDesc(News::getReleaseTime)
|
|
|
|
|
+ .disableSubLogicDel();;
|
|
|
IPage<ProclamationPageVo> page = this.selectJoinListPage(ConventPage.getPage(dto), ProclamationPageVo.class, queryNews);
|
|
IPage<ProclamationPageVo> page = this.selectJoinListPage(ConventPage.getPage(dto), ProclamationPageVo.class, queryNews);
|
|
|
return page;
|
|
return page;
|
|
|
}
|
|
}
|