|
@@ -15,6 +15,9 @@ import com.xjrsoft.common.model.result.R;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.authority.entity.DataAuth;
|
|
|
+import com.xjrsoft.module.authority.vo.DataAuthListVo;
|
|
|
+import com.xjrsoft.module.authority.vo.DataAuthPageVo;
|
|
|
import com.xjrsoft.module.oa.dto.*;
|
|
|
import com.xjrsoft.module.oa.entity.News;
|
|
|
import com.xjrsoft.module.oa.entity.NewsAppendix;
|
|
@@ -26,8 +29,11 @@ import com.xjrsoft.module.oa.vo.NewsAppendixVo;
|
|
|
import com.xjrsoft.module.oa.vo.NewsPageVo;
|
|
|
import com.xjrsoft.module.oa.vo.NewsRelationVo;
|
|
|
import com.xjrsoft.module.oa.vo.NewsVo;
|
|
|
+import com.xjrsoft.module.organization.entity.User;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
|
import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -221,18 +227,18 @@ public class NewsController {
|
|
|
@GetMapping("/page-relation")
|
|
|
@ApiOperation(value = "获取新闻阅读权限分页")
|
|
|
public R pageRelation(NewsRelationPageDto dto) {
|
|
|
- MPJLambdaWrapper<NewsRelation> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
- queryWrapper.disableSubLogicDel()
|
|
|
- .eq(NewsRelation::getNewsId, dto.getNewsId())
|
|
|
- .eq(ObjectUtil.isNotEmpty(dto.getReadMark()) && dto.getReadMark() > 0, NewsRelation::getReadMark, dto.getReadMark() == 1 ? 0 : 1)
|
|
|
- .isNull(ObjectUtil.isNotEmpty(dto.getReplyMark()) && dto.getReplyMark() == 1, NewsRelation::getReplyContent)
|
|
|
- .isNotNull(ObjectUtil.isNotEmpty(dto.getReplyMark()) && dto.getReplyMark() == 2, NewsRelation::getReplyContent)
|
|
|
- .select(NewsRelation::getId)
|
|
|
- .select(NewsRelation.class, x -> VoToColumnUtil.fieldsToColumns(NewsRelationVo.class).contains(x.getProperty()))
|
|
|
- .leftJoin(XjrUser.class, XjrUser::getId, NewsRelation::getUserId,ext->ext.selectAs(XjrUser::getName,NewsRelationVo::getUserName));
|
|
|
|
|
|
- IPage<NewsRelation> page = newsRelationService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
- PageOutput<NewsRelationVo> pageOutput = ConventPage.getPageOutput(page, NewsRelationVo.class);
|
|
|
+ IPage<NewsRelationVo> page = newsRelationService.selectJoinListPage(ConventPage.getPage(dto), NewsRelationVo.class,
|
|
|
+ new MPJLambdaWrapper<NewsRelation>()
|
|
|
+ .eq(NewsRelation::getNewsId, dto.getNewsId())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(dto.getReadMark()) && dto.getReadMark() > 0, NewsRelation::getReadMark, dto.getReadMark() == 1 ? 0 : 1)
|
|
|
+ .isNull(ObjectUtil.isNotEmpty(dto.getReplyMark()) && dto.getReplyMark() == 1, NewsRelation::getReplyContent)
|
|
|
+ .isNotNull(ObjectUtil.isNotEmpty(dto.getReplyMark()) && dto.getReplyMark() == 2, NewsRelation::getReplyContent)
|
|
|
+ .select(NewsRelation::getId)
|
|
|
+ .select(NewsRelation.class, x -> VoToColumnUtil.fieldsToColumns(NewsRelationVo.class).contains(x.getProperty()))
|
|
|
+ .leftJoin(XjrUser.class, XjrUser::getId, NewsRelation::getUserId, ext -> ext.selectAs(XjrUser::getName, NewsRelationVo::getUserName))
|
|
|
+ );
|
|
|
+ PageOutput<NewsRelationVo> pageOutput = ConventPage.getPageOutput(page);
|
|
|
return R.ok(pageOutput);
|
|
|
}
|
|
|
@GetMapping("/count-relation")
|