| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @author zzj |
| | |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "社会组织列表",response = ComActSocialOrgVO.class) |
| | | @ApiOperation(value = "社会组织列表", response = ComActSocialOrgVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | if(this.getCommunityId()!=null){ |
| | | R r=communityService.detailCommunity(this.getCommunityId()); |
| | | if(R.isOk(r)){ |
| | | ComActVO comActVO=JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ComActVO.class); |
| | | if(comActVO!=null){ |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | commonPage.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } else if (isNull(commonPage.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | R r = communityService.detailCommunity(commonPage.getCommunityId()); |
| | | if (R.isOk(r)) { |
| | | ComActVO comActVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ComActVO.class); |
| | | if (comActVO != null) { |
| | | commonPage.setStreetId(comActVO.getStreetId()); |
| | | } |
| | | } |
| | | } |
| | | commonPage.setCommunityId(null); |
| | | return this.communityService.comActSocialOrgSelectAll(commonPage); |
| | | } |
| | | |