|
@@ -21,6 +21,7 @@ import com.xjrsoft.config.CommonPropertiesConfig;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
import com.xjrsoft.module.base.mapper.BaseClassMapper;
|
|
import com.xjrsoft.module.base.mapper.BaseClassMapper;
|
|
|
|
|
+import com.xjrsoft.module.base.mapper.BaseGradeMapper;
|
|
|
import com.xjrsoft.module.oa.dto.*;
|
|
import com.xjrsoft.module.oa.dto.*;
|
|
|
import com.xjrsoft.module.oa.entity.News;
|
|
import com.xjrsoft.module.oa.entity.News;
|
|
|
import com.xjrsoft.module.oa.entity.NewsAppendix;
|
|
import com.xjrsoft.module.oa.entity.NewsAppendix;
|
|
@@ -85,6 +86,8 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
|
|
|
|
|
private final UserMapper userMapper;
|
|
private final UserMapper userMapper;
|
|
|
|
|
|
|
|
|
|
+ private final BaseGradeMapper baseGradeMapper;
|
|
|
|
|
+
|
|
|
private final DepartmentMapper departmentMapper;
|
|
private final DepartmentMapper departmentMapper;
|
|
|
|
|
|
|
|
private final BaseClassMapper baseClassMapper;
|
|
private final BaseClassMapper baseClassMapper;
|
|
@@ -182,6 +185,11 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
}
|
|
}
|
|
|
if (relationDto.getRelationType() == 3) {
|
|
if (relationDto.getRelationType() == 3) {
|
|
|
BaseClass baseClass = baseClassMapper.selectById(relationDto.getRelationId());
|
|
BaseClass baseClass = baseClassMapper.selectById(relationDto.getRelationId());
|
|
|
|
|
+ BaseGrade baseGrade = null;
|
|
|
|
|
+ if(baseClass == null){
|
|
|
|
|
+ baseGrade = baseGradeMapper.selectById(relationDto.getRelationId());
|
|
|
|
|
+ }
|
|
|
|
|
+ BaseGrade finalBaseGrade = baseGrade;
|
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
newsRelationConfigMapper.insert(new NewsRelationConfig(){{
|
|
|
setNewsId(news.getId());
|
|
setNewsId(news.getId());
|
|
|
setRelationId(relationDto.getRelationId());
|
|
setRelationId(relationDto.getRelationId());
|
|
@@ -189,6 +197,9 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
if(baseClass != null){
|
|
if(baseClass != null){
|
|
|
setRelationName(baseClass.getName());
|
|
setRelationName(baseClass.getName());
|
|
|
}
|
|
}
|
|
|
|
|
+ if(finalBaseGrade != null){
|
|
|
|
|
+ setRelationName(finalBaseGrade.getName());
|
|
|
|
|
+ }
|
|
|
}});
|
|
}});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -445,27 +456,39 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
|
|
|
|
|
for (AddNewsRelationDto relationDto : updateProclamationDto.getRelationList()) {
|
|
for (AddNewsRelationDto relationDto : updateProclamationDto.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());
|
|
|
|
|
+ }
|
|
|
}});
|
|
}});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -492,19 +515,19 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
|
|
|
|
|
|
|
|
//公告需要添加阅读关系,发送范围 1=全校教职工 2=全校师生 3=指定人员
|
|
//公告需要添加阅读关系,发送范围 1=全校教职工 2=全校师生 3=指定人员
|
|
|
//1=全校教职工,添加全校教职工到关系表
|
|
//1=全校教职工,添加全校教职工到关系表
|
|
|
- if(addNewsDto.getTypeId() == 2 && addNewsDto.getSendRange() == 1){
|
|
|
|
|
- MPJLambdaWrapper<XjrUser> queryUser = new MPJLambdaWrapper<>();
|
|
|
|
|
- queryUser
|
|
|
|
|
- .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, XjrUser::getId)
|
|
|
|
|
- .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId)
|
|
|
|
|
- .eq(Role::getId, 2);
|
|
|
|
|
- List<XjrUser> userList = xjrUserMapper.selectJoinList(XjrUser.class,queryUser);
|
|
|
|
|
|
|
+// if(addNewsDto.getTypeId() == 2 && addNewsDto.getSendRange() == 1){
|
|
|
|
|
+// MPJLambdaWrapper<XjrUser> queryUser = new MPJLambdaWrapper<>();
|
|
|
|
|
+// queryUser
|
|
|
|
|
+// .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, XjrUser::getId)
|
|
|
|
|
+// .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId)
|
|
|
|
|
+// .eq(Role::getId, 2);
|
|
|
|
|
+// List<XjrUser> userList = xjrUserMapper.selectJoinList(XjrUser.class,queryUser);
|
|
|
// for (XjrUser user: userList) {
|
|
// for (XjrUser user: userList) {
|
|
|
// newsRelation.setUserId(user.getId());
|
|
// newsRelation.setUserId(user.getId());
|
|
|
// newsRelationMapper.insert(newsRelation);
|
|
// newsRelationMapper.insert(newsRelation);
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
if (addNewsDto.getTypeId() == 2 && addNewsDto.getSendRange() == 1) {
|
|
if (addNewsDto.getTypeId() == 2 && addNewsDto.getSendRange() == 1) {
|
|
|
for (AddNewsRelationDto relationDto : addNewsDto.getRelationList()) {
|
|
for (AddNewsRelationDto relationDto : addNewsDto.getRelationList()) {
|