| | |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.store.StoreDto; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IApiServiceSMO apiServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IStoreV1InnerServiceSMO storeV1InnerServiceSMOImpl; |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ApiSMOImpl.class); |
| | | |
| | |
| | | |
| | | IPageData pd = (IPageData) request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA); |
| | | |
| | | |
| | | //todo 校验员工时 是否有访问小区的权限 |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | //todo 如果 登录用户不为空 则将 前段传递的user-id 重写 |
| | | 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")); |
| | | } |
| | | } |
| | | |
| | | // todo 如果 商户不为空则 商户ID写入只头信息中 这里的商户ID 可以是物业ID 或者商家ID |
| | | if (!StringUtil.isEmpty(result.getStoreId())) { |
| | | headers.remove("store-id"); |
| | | headers.put("store-id", result.getStoreId()); |
| | |
| | | headers.put("user-id", "-1"); |
| | | } |
| | | headers.put("store-id", result.getStoreId()); |
| | | // todo 应用是否有接口权限校验 |
| | | ResponseEntity<String> responseEntity = apiServiceSMOImpl.service(body, headers); |
| | | return responseEntity; |
| | | } |