| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | unitSelectTerm.setLabel(ctUnit.getUnitName()); |
| | | unitSelectTerm.setParentId(ctUnit.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){ |
| | | szbmList.add(unitSelectTerm); |
| | | } |
| | | if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){ |
| | | qzzzxList.add(unitSelectTerm); |
| | | } |
| | | } |
| | |
| | | unitSelectTerm.setLabel(ctUnit.getUnitName()); |
| | | unitSelectTerm.setParentId(ctUnit.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){ |
| | | qzbmList.add(unitSelectTerm); |
| | | } |
| | | if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){ |
| | | zjzzzxList.add(unitSelectTerm); |
| | | } |
| | | } |
| | |
| | | return result; |
| | | }else if (UserBaseConsts.UNIT_GRADE_3 == loginUnit.getUnitGrade()){ |
| | | // 镇街交办 |
| | | // 查询镇街部门数组 |
| | | QueryWrapper<CtDept> ctDeptQueryWrapper = new QueryWrapper<>(); |
| | | ctDeptQueryWrapper.eq("unit_id", loginUnit.getId()); |
| | | List<CtDept> deptList = ctDeptService.list(ctDeptQueryWrapper); |
| | | // 查询镇街的直属部门组织 |
| | | List<SelectTermDTO> zjbmList = new ArrayList<>(); |
| | | for (CtDept ctDept: deptList){ |
| | | QueryWrapper<CtUnit> zjCtUnitQueryWrapper = new QueryWrapper<>(); |
| | | zjCtUnitQueryWrapper.eq("parent_id", loginUnit.getId()) |
| | | .eq("unit_grade", UserBaseConsts.UNIT_GRADE_3) |
| | | .eq("unit_type", UserBaseConsts.UNIT_TYPE_102); |
| | | List<CtUnit> zjCtUnitList = mapper.selectList(zjCtUnitQueryWrapper); |
| | | for (CtUnit zjCtUnit: zjCtUnitList){ |
| | | SelectTermDTO unitSelectTerm = new SelectTermDTO(); |
| | | unitSelectTerm.setValue(ctDept.getId()); |
| | | unitSelectTerm.setLabel(ctDept.getName()); |
| | | unitSelectTerm.setParentId(loginUnit.getId()); |
| | | unitSelectTerm.setValue(zjCtUnit.getId()); |
| | | unitSelectTerm.setLabel(zjCtUnit.getUnitName()); |
| | | unitSelectTerm.setParentId(zjCtUnit.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | zjbmList.add(unitSelectTerm); |
| | | |
| | | } |
| | | |
| | | // 查询镇街部门数组 |
| | | // QueryWrapper<CtDept> ctDeptQueryWrapper = new QueryWrapper<>(); |
| | | // ctDeptQueryWrapper.eq("unit_id", loginUnit.getId()); |
| | | // List<CtDept> deptList = ctDeptService.list(ctDeptQueryWrapper); |
| | | // List<SelectTermDTO> zjbmList = new ArrayList<>(); |
| | | // for (CtDept ctDept: deptList){ |
| | | // SelectTermDTO unitSelectTerm = new SelectTermDTO(); |
| | | // unitSelectTerm.setValue(ctDept.getId()); |
| | | // unitSelectTerm.setLabel(ctDept.getName()); |
| | | // unitSelectTerm.setParentId(loginUnit.getId()); |
| | | // unitSelectTerm.setCheckable(true); |
| | | // zjbmList.add(unitSelectTerm); |
| | | // } |
| | | |
| | | // 查询村社数组 |
| | | QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>(); |
| | | ctUnitQueryWrapper.eq("parent_id", loginUnit.getId()).eq("unit_grade", UserBaseConsts.UNIT_GRADE_4); |
| | |
| | | unitSelectTerm.setLabel(ctUnit.getUnitName()); |
| | | unitSelectTerm.setParentId(ctUnit.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){ |
| | | szbmList.add(unitSelectTerm); |
| | | } |
| | | if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){ |
| | | qzzzxList.add(unitSelectTerm); |
| | | } |
| | | } |
| | |
| | | unitSelectTerm.setLabel(ctUnit.getUnitName()); |
| | | unitSelectTerm.setParentId(ctUnit.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){ |
| | | qzbmList.add(unitSelectTerm); |
| | | } |
| | | if (UserBaseConsts.UNIT_TYPE_3 == ctUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_103 == ctUnit.getUnitType()){ |
| | | zjzzzxList.add(unitSelectTerm); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public CtUnitDTO getParentZzzx(String unitId){ |
| | | try{ |
| | | CtUnit loginCtUnit = mapper.selectById(unitId); |
| | | // 查询当前单位的上级综治中心 |
| | | QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>(); |
| | | ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_1); |
| | | ctUnitQueryWrapper.eq("id", unitId).select("parent_id"); |
| | | CtUnit loginCtUnit = mapper.selectOne(ctUnitQueryWrapper); |
| | | ctUnitQueryWrapper.clear(); |
| | | ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_101); |
| | | CtUnit zzzxCtUnit = mapper.selectOne(ctUnitQueryWrapper); |
| | | CtUnitDTO ctUnitDTO = new CtUnitDTO(); |
| | | BeanUtils.copyProperties(zzzxCtUnit, ctUnitDTO); |
| | |
| | | CtUnitDTO ctUnitDTO = new CtUnitDTO(); |
| | | // 查询自己是否是综治中心 |
| | | CtUnit loginCtUnit = mapper.selectById(unitId); |
| | | if (UserBaseConsts.UNIT_TYPE_1 == loginCtUnit.getUnitType()){ |
| | | if (UserBaseConsts.UNIT_TYPE_101 == loginCtUnit.getUnitType()){ |
| | | BeanUtils.copyProperties(loginCtUnit, ctUnitDTO); |
| | | }else { |
| | | // 查询当前单位的上级综治中心 |
| | | QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>(); |
| | | ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_1); |
| | | ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_101); |
| | | CtUnit zzzxCtUnit = mapper.selectOne(ctUnitQueryWrapper); |
| | | BeanUtils.copyProperties(zzzxCtUnit, ctUnitDTO); |
| | | } |
| | |
| | | throw new ServiceException("CtUnitService.getParentZzzx", e); |
| | | } |
| | | } |
| | | |
| | | public CtUnit selectUnitByGridId(String gridUnitId){ |
| | | return mapper.selectUnitByGridId(gridUnitId); |
| | | } |
| | | } |