| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.google.common.collect.Lists; |
| | |
| | | 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 com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_dangjian.dao.ComPbMemberDAO; |
| | | import com.panzhihua.service_dangjian.dao.ComPbMemberRoleDAO; |
| | |
| | | private ComPbMemberRoleDAO comPbMemberRoleDAO; |
| | | @Resource |
| | | private ComPbMemberService comPbMemberService; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | |
| | | */ |
| | | @Override |
| | | public R queryByPage(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | |
| | | Long communityId = comPbCheckUnit.getCommunityId(); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | 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())){ |
| | |
| | | */ |
| | | @Override |
| | | public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) { |
| | | Long communityId = comPbCheckUnit.getCommunityId(); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | 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())){ |
| | |
| | | */ |
| | | @Override |
| | | public R unitStatisticsTop(Long communityId, String belongTo, String choice) { |
| | | return R.ok(this.baseMapper.unitStatisticsTop(communityId, belongTo, choice)); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public R unitStatistics(PagePbCheckUnitCommonDto commonDto) { |
| | | Long communityId = commonDto.getCommunityId(); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | return R.ok(this.baseMapper.unitStatistics(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize()))); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId) { |
| | | return R.ok(this.baseMapper.pbStatisticsTop(communityId, belongTo, choice, checkUnitId)); |
| | | |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto) { |
| | | Long communityId = commonDto.getCommunityId(); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | return R.ok(this.baseMapper.pbStatisticsBelong(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize()))); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R pbStatisticsUnit(PagePbCheckUnitCommonDto commonDto) { |
| | | Long communityId = commonDto.getCommunityId(); |
| | | R r = communityService.selectCommunityIds(communityId); |
| | | List<Long> communityIds = null; |
| | | if(R.isOk(r)){ |
| | | communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | }else { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | commonDto.setCommunityIds(communityIds); |
| | | return R.ok(this.baseMapper.pbStatisticsUnit(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize()))); |
| | | } |
| | | } |