java110
2023-07-25 5ff56bcae888ab329774828b553f6414014a7373
springboot/src/main/java/com/java110/boot/smo/DefaultAbstractComponentSMO.java
@@ -381,14 +381,10 @@
        Assert.hasLength(pd.getUserId(), "用户未登录请先登录");
        ResultVo resultVo = getCommunityStoreInfoSMOImpl.getStoreInfo(pd, restTemplate, pd.getUserId());
        logger.debug("ruleId getStoreInfo :{}", resultVo.toString());
        logger.debug("查询商户信息 getStoreInfo :{}", resultVo.toString());
        return new ResponseEntity<String>(resultVo.getMsg(), resultVo.getCode() == ResultVo.CODE_OK ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
    }
    private ResponseEntity<String> getStoreEnterCommunitys(IPageData pd, String storeId, String storeTypeCd, RestTemplate restTemplate) {
        ResultVo resultVo = getCommunityStoreInfoSMOImpl.getStoreEnterCommunitys(pd, storeId, storeTypeCd, restTemplate);
        return new ResponseEntity<String>(resultVo.getMsg(), resultVo.getCode() == ResultVo.CODE_OK ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
    }
    /**
     * 查询商户信息
@@ -397,17 +393,12 @@
     */
    protected void checkStoreEnterCommunity(IPageData pd, String storeId, String storeTypeCd, String communityId, RestTemplate restTemplate) {
        Assert.hasLength(pd.getUserId(), "用户未登录请先登录");
        ResponseEntity<String> responseEntity = null;
        responseEntity = getStoreEnterCommunitys(pd, storeId, storeTypeCd, restTemplate);
        if (responseEntity.getStatusCode() != HttpStatus.OK) {
        ResultVo resultVo =  getCommunityStoreInfoSMOImpl.getStoreEnterCommunitys(pd, storeId, storeTypeCd, restTemplate);
        if (resultVo.getCode() != ResultVo.CODE_OK) {
            throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "还未入驻小区,请先入驻小区");
        }
        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "data", "还未入驻小区,请先入驻小区");
        JSONObject community = JSONObject.parseObject(responseEntity.getBody().toString());
        JSONArray communitys = community.getJSONArray("data");
        JSONArray communitys = JSONArray.parseArray(resultVo.getData().toString());
        if (communitys == null || communitys.size() == 0) {
            throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "还未入驻小区,请先入驻小区");
@@ -420,7 +411,6 @@
        }
    }
    private JSONObject getCurrentCommunity(JSONArray communitys, String communityId) {
        for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {