列表方法添加数据权限

This commit is contained in:
wans 2020-10-23 10:19:44 +08:00
parent 10eee4cfba
commit 4f27b7dd5a
16 changed files with 105 additions and 12 deletions

View File

@ -169,6 +169,8 @@ public class AdvancedModelServiceImpl extends AbstractService implements IAdvanc
@Override
public SuccessResultList<List<AdvancedModelDTO>> listPageAdvancedModel(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<AdvancedModelDTO> advancedModelDTOs = advancedModelDao.listAdvancedModel(page.getParams());
PageInfo<AdvancedModelDTO> pageInfo = new PageInfo<>(advancedModelDTOs);
return new SuccessResultList<>(advancedModelDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -27,6 +27,7 @@ public class PartyRulesServiceImpl extends BaseService implements IPartyRulesSer
@Override
public SuccessResultList<List<ArticleContentDTO>> listPagePartyRules(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
//page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<ArticleContentDTO> articleContentDTOs = partyRulesDao.listPagePartyRules(page.getParams());
PageInfo<ArticleContentDTO> pageInfo = new PageInfo<>(articleContentDTOs);
return new SuccessResultList<>(articleContentDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -169,6 +169,8 @@ public class FamousSecretaryOfficeServiceImpl extends AbstractService implements
@Override
public SuccessResultList<List<FamousSecretaryOfficeDTO>> listPageFamousSecretaryOffice(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<FamousSecretaryOfficeDTO> famousSecretaryOfficeDTOs = famousSecretaryOfficeDao.listFamousSecretaryOffice(page.getParams());
PageInfo<FamousSecretaryOfficeDTO> pageInfo = new PageInfo<>(famousSecretaryOfficeDTOs);
return new SuccessResultList<>(famousSecretaryOfficeDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -169,6 +169,8 @@ public class InteractiveActivityServiceImpl extends AbstractService implements I
@Override
public SuccessResultList<List<InteractiveActivityDTO>> listPageInteractiveActivity(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<InteractiveActivityDTO> interactiveActivityDTOs = interactiveActivityDao.listInteractiveActivity(page.getParams());
PageInfo<InteractiveActivityDTO> pageInfo = new PageInfo<>(interactiveActivityDTOs);
return new SuccessResultList<>(interactiveActivityDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -175,6 +175,8 @@ public class PartyBuildingCaseServiceImpl extends AbstractService implements IPa
@Override
public SuccessResultList<List<PartyBuildingCaseDTO>> listPagePartyBuildingCase(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<PartyBuildingCaseDTO> partyBuildingCaseDTOs = partyBuildingCaseDao.listPartyBuildingCase(page.getParams());
for (PartyBuildingCaseDTO item : partyBuildingCaseDTOs){
if("1".equals(item.getCreator().trim())){

View File

@ -180,6 +180,8 @@ public class PartyMemberPointsServiceImpl extends AbstractService implements IPa
@Override
public SuccessResultList<List<PartyMemberPointsDTO>> listPagePartyMemberPoints(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
setDataAuthorityInfo(page.getParams());
List<PartyMemberPointsDTO> partyMemberPointsDTOs = partyMemberPointsDao.listPartyMemberPoints(page.getParams());
PageInfo<PartyMemberPointsDTO> pageInfo = new PageInfo<>(partyMemberPointsDTOs);
return new SuccessResultList<>(partyMemberPointsDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -181,6 +181,8 @@ public class PartyPaymentServiceImpl extends AbstractService implements IPartyPa
@Override
public SuccessResultList<List<PartyPaymentDTO>> listPagePartyPayment(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<PartyPaymentDTO> partyPaymentDTOs = partyPaymentDao.listPartyPayment(page.getParams());
PageInfo<PartyPaymentDTO> pageInfo = new PageInfo<>(partyPaymentDTOs);
return new SuccessResultList<>(partyPaymentDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -2,7 +2,6 @@ package com.cm.partybuilding.service.threemeetlesson.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
@ -19,7 +18,9 @@ import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ThreeMeetLessonServiceImpl
@ -169,6 +170,8 @@ public class ThreeMeetLessonServiceImpl extends AbstractService implements IThre
@Override
public SuccessResultList<List<ThreeMeetLessonDTO>> listPageThreeMeetLesson(ListPage page) throws SearchException {
PageHelper.startPage(page.getPage(), page.getRows());
setDataAuthorityInfo(page.getParams());
page.getParams().put("creator",securityComponent.getCurrentUser().getUserId());
List<ThreeMeetLessonDTO> threeMeetLessonDTOs = threeMeetLessonDao.listThreeMeetLesson(page.getParams());
PageInfo<ThreeMeetLessonDTO> pageInfo = new PageInfo<>(threeMeetLessonDTOs);
return new SuccessResultList<>(threeMeetLessonDTOs, pageInfo.getPageNum(), pageInfo.getTotal());

View File

@ -172,6 +172,17 @@
#{advancedModelIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
</select>
<!-- 先进典型统计 -->

View File

@ -169,6 +169,17 @@
#{famousSecretaryOfficeIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
</select>
<!-- 名书记工作室统计 -->

View File

@ -151,6 +151,17 @@
#{interactiveActivityIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
</select>
<!-- 互联互动统计 -->

View File

@ -140,6 +140,17 @@
#{partyBuildingCaseIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
ORDER BY t1.gmt_create DESC
</select>

View File

@ -129,6 +129,17 @@
#{partyMemberPointsIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
ORDER BY t1.current_points DESC
</select>

View File

@ -155,6 +155,17 @@
#{partyPaymentIds[${index}]}
</foreach>
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
ORDER BY t1.payment_date DESC
</select>

View File

@ -71,16 +71,16 @@
#{articleContentIds[${index}]}
</foreach>
</if>
<if test="creator != null and creator != ''">
AND
t1.creator = #{creator}
</if>
<if test="creators != null and creators.size > 0">
AND
t1.creator IN
<foreach collection="creators" index="index" open="(" separator="," close=")">
#{creators[${index}]}
</foreach>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
ORDER BY t1.publish_date DESC
</select>

View File

@ -172,6 +172,17 @@
<if test="endTime != null and endTime != ''">
AND LEFT(t1.decide_time, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="data_authority != null and data_authority != ''">
<if test="data_authority == 'self' ">
AND t1.creator = #{creator}
</if>
<if test="data_authority != 'self'">
AND t1.creator IN
<foreach collection="data_creators" open="(" close=")" separator="," index="index">
#{data_creators[${index}]}
</foreach>
</if>
</if>
</select>
<!-- 统计 -->