| | |
| | | import com.java110.api.smo.IApiServiceSMO; |
| | | import com.java110.api.smo.api.IApiSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.dto.store.StoreDto; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | |
| | | //开发者和运营不校验小区 |
| | | if(StoreDto.STORE_TYPE_ADMIN.equals(storeTypeCd) || StoreDto.STORE_TYPE_DEV.equals(storeTypeCd)){ |
| | | return new ComponentValidateResult(storeId, storeTypeCd, "", pd.getUserId(), pd.getUserName()); |
| | | } |
| | | |
| | | String communityId = ""; |
| | | if (paramIn != null && paramIn.containsKey("communityId") && !StringUtil.isEmpty(paramIn.getString("communityId"))) { |
| | | if (paramIn != null && paramIn.containsKey("communityId") |
| | | && !StringUtil.isEmpty(paramIn.getString("communityId")) |
| | | && !"-1".equals(paramIn.getString("communityId"))) { |
| | | communityId = paramIn.getString("communityId"); |
| | | checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate); |
| | | } |
| | |
| | | |
| | | |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | if (!StringUtil.isEmpty(result.getUserId())) { |
| | | if (!StringUtil.isEmpty(result.getLoginUserId())) { |
| | | headers.remove("user-id"); |
| | | headers.remove("user_id"); |
| | | headers.put("user-id", result.getUserId()); |
| | | headers.put("user_id", result.getUserId()); |
| | | headers.put("login-user-id",result.getLoginUserId()); |
| | | if (!StringUtil.isEmpty(result.getUserName())) { |
| | | headers.put("user-name", URLEncoder.encode(result.getUserName(), "UTF-8")); |
| | | } |
| | | } |
| | | |
| | | if (!StringUtil.isEmpty(result.getStoreId())) { |
| | | headers.remove("store-id"); |
| | | headers.put("store-id", result.getStoreId()); |
| | | } |
| | | |
| | | if (!headers.containsKey("user_id")) { |
| | | headers.put("user_id", "-1"); |
| | | } |
| | | if (!headers.containsKey("user-id")) { |
| | | headers.put("user-id", "-1"); |
| | | } |
| | | headers.put("store-id", result.getStoreId()); |
| | | ResponseEntity<String> responseEntity = apiServiceSMOImpl.service(body, headers); |
| | | return responseEntity; |