101captain
2022-07-20 c40f8e3d2e08e108780091776437242528bf61d6
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActSocialOrgApi.java
@@ -3,6 +3,7 @@
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;
@@ -13,6 +14,9 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
/**
 * @author zzj
@@ -31,18 +35,23 @@
     * @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);
    }