lidongdong
2024-06-26 2c47237a314a8965f1b33be140f03eaa3e8804df
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
@@ -16,6 +16,7 @@
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.common.PbCheckUnitStatisticsVo;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO;
import com.panzhihua.common.utlis.StringUtils;
@@ -34,6 +35,8 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * title: 党建-报到单位表服务实现类
@@ -88,12 +91,27 @@
        QueryWrapper<ComPbCheckUnit> wrapper = new QueryWrapper<>();
        if(treeListVO.getName() != null){
            wrapper.eq("belong_to",treeListVO.getName());
        }
        if(treeListVO.getOrgName() != null){
        } 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);
    }
    /**
@@ -282,7 +300,7 @@
     * @return
     */
    @Override
    public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds) {
    public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds,String yearTime) {
        List<Long> communityIds = new ArrayList<>();
        if (null != communityId){
             communityIds = comPbMemberDAO.selectIds(communityId);
@@ -290,8 +308,13 @@
                communityIds.add(communityId);
            }
        }
        return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds));
        //查询 活动总积分
        PbCheckUnitStatisticsVo vo = this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds,yearTime);
        if(null != vo) {
            Integer sum = this.baseMapper.organSumIntegral(communityIds,yearTime);
            vo.setOrganSumIntegral(sum);
        }
        return R.ok(vo);
    }
    /**
@@ -322,7 +345,7 @@
     * @return
     */
    @Override
    public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds) {
    public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds ,String yearTime) {
        List<Long> communityIds = new ArrayList<>();
        if (null != communityId){
@@ -331,7 +354,13 @@
                communityIds.add(communityId);
            }
        }
        return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds));
        //查询 活动总积分
        PbCheckUnitStatisticsVo vo = this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds,yearTime);
        if(null != vo) {
            Integer sum = this.baseMapper.pbOrganSumIntegral(communityIds,yearTime);
            vo.setOrganSumIntegral(sum);
        }
        return R.ok(vo);
    }
    /**