| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.PagePbCheckUnitCommonDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.TreeListVO; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * title: 党建-报到单位表服务实现类 |
| | |
| | | public R queryByPage(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | |
| | | Long communityId = comPbCheckUnit.getCommunityId(); |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | if (communityId != null){ |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | comPbCheckUnit.setCommunityIds(communityIds); |
| | | } |
| | | comPbCheckUnit.setCommunityIds(communityIds); |
| | | IPage<ComPbCheckUnitVo> checkUnitVoPage= this.baseMapper.queryAllByLimit(comPbCheckUnit, new Page(comPbCheckUnit.getPageNum(), comPbCheckUnit.getPageSize())); |
| | | checkUnitVoPage.getRecords().forEach(checkUnit -> { |
| | | if(StringUtils.isEmpty(checkUnit.getOrgName())){ |
| | |
| | | } |
| | | }); |
| | | return R.ok(checkUnitVoPage); |
| | | } |
| | | |
| | | @Override |
| | | public R treeList(TreeListVO treeListVO) { |
| | | QueryWrapper<ComPbCheckUnit> wrapper = new QueryWrapper<>(); |
| | | if(treeListVO.getName() != null){ |
| | | wrapper.eq("belong_to",treeListVO.getName()); |
| | | } else if(treeListVO.getOrgName() != null){ |
| | | wrapper.eq("org_name",treeListVO.getOrgName()); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | List<ComPbCheckUnit> comPbCheckUnits = this.baseMapper.selectList(wrapper); |
| | | return R.ok(comPbCheckUnits); |
| | | } |
| | | |
| | | @Override |
| | | public R orgList() { |
| | | QueryWrapper<ComPbCheckUnit> wrapper = new QueryWrapper<>(); |
| | | List<ComPbCheckUnitVo> voList = new ArrayList<>(); |
| | | List<ComPbCheckUnit> list = this.baseMapper.selectList(wrapper); |
| | | Map<String, List<ComPbCheckUnit>> map = list.stream().filter(f -> f.getOrgName() != null).collect(Collectors.groupingBy(ComPbCheckUnit::getOrgName)); |
| | | for (Map.Entry<String, List<ComPbCheckUnit>> entry : map.entrySet()) { |
| | | ComPbCheckUnitVo pbCheckUnitVo = new ComPbCheckUnitVo(); |
| | | pbCheckUnitVo.setOrgName(entry.getKey()); |
| | | voList.add(pbCheckUnitVo); |
| | | } |
| | | return R.ok(voList); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | Long communityId = comPbCheckUnit.getCommunityId(); |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | if (communityId != null){ |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | comPbCheckUnit.setCommunityIds(communityIds); |
| | | } |
| | | comPbCheckUnit.setCommunityIds(communityIds); |
| | | IPage<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByLimit(comPbCheckUnit,new Page(comPbCheckUnit.getPageNum(),comPbCheckUnit.getPageSize())); |
| | | checkUnitList.getRecords().forEach(checkUnit -> { |
| | | if(StringUtils.isEmpty(checkUnit.getOrgName())){ |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R unitStatisticsTop(Long communityId, String belongTo, String choice) { |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds) { |
| | | List<Long> communityIds = new ArrayList<>(); |
| | | if (null != communityId){ |
| | | communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds.add(communityId); |
| | | } |
| | | } |
| | | return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice)); |
| | | |
| | | return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public R unitStatistics(PagePbCheckUnitCommonDto commonDto) { |
| | | Long communityId = commonDto.getCommunityId(); |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | if (null != communityId) { |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | return R.ok(this.baseMapper.unitStatistics(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize()))); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId) { |
| | | public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds) { |
| | | |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | List<Long> communityIds = new ArrayList<>(); |
| | | if (null != communityId){ |
| | | communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds.add(communityId); |
| | | } |
| | | } |
| | | return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId)); |
| | | return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto) { |
| | | Long communityId = commonDto.getCommunityId(); |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | if (null != communityId) { |
| | | List<Long> communityIds = comPbMemberDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | return R.ok(this.baseMapper.pbStatisticsBelong(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize()))); |
| | | } |
| | | |