New file |
| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO; |
| | | import com.panzhihua.service_dangjian.dao.ComPbOrgDAO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbOrgDO; |
| | | import com.panzhihua.service_dangjian.service.PartyOrganizationService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党组织 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 11:40 |
| | | **/ |
| | | @Service |
| | | public class PartyOrganizationServiceImpl implements PartyOrganizationService { |
| | | @Resource |
| | | private ComPbOrgDAO comPbOrgDAO; |
| | | /** |
| | | * 平台所有党组织 |
| | | * |
| | | * @return 党组织集合 |
| | | */ |
| | | @Override |
| | | public List<PartyOrganizationVO> listPartyOrganization(Long communityId) { |
| | | List<PartyOrganizationVO> partyOrganizationVOS=new ArrayList<>(); |
| | | List<ComPbOrgDO> comPbOrgDOS = comPbOrgDAO.selectList(new QueryWrapper<ComPbOrgDO>().lambda().eq(ComPbOrgDO::getCommunityId,communityId)); |
| | | if (!ObjectUtils.isEmpty(comPbOrgDOS)) { |
| | | comPbOrgDOS.forEach(comPbOrgDO -> { |
| | | PartyOrganizationVO partyOrganizationVO=new PartyOrganizationVO(); |
| | | partyOrganizationVO.setId(comPbOrgDO.getId()); |
| | | partyOrganizationVO.setName(comPbOrgDO.getName()); |
| | | partyOrganizationVOS.add(partyOrganizationVO); |
| | | }); |
| | | } |
| | | return partyOrganizationVOS; |
| | | } |
| | | } |