old mode 100644
new mode 100755
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.BaseComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.smo.IGetCommunityStoreInfoSMO; |
| | | import com.java110.front.smo.IPrivilegeServiceSMO; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private IGetCommunityStoreInfoSMO getCommunityStoreInfoSMOImpl; |
| | | |
| | | /** |
| | | * 查询 权限组 |
| | |
| | | Assert.hasLength(pd.getUserId(), "用户未登录请先登录"); |
| | | |
| | | JSONObject privilegeInfoObj = JSONObject.parseObject(pd.getReqData()); |
| | | Assert.jsonObjectHaveKey(privilegeInfoObj, "staffId", "请求报文中未包含员工ID 节点"); |
| | | //Assert.jsonObjectHaveKey(privilegeInfoObj, "staffId", "请求报文中未包含员工ID 节点"); |
| | | |
| | | if (!privilegeInfoObj.containsKey("staffId")) { |
| | | privilegeInfoObj.put("staffId", pd.getUserId()); |
| | | } |
| | | |
| | | ResponseEntity<String> storeInfo = super.getStoreInfo(pd, restTemplate); |
| | | |
| | |
| | | |
| | | ResponseEntity<String> privilegeGroup = super.callCenterService(restTemplate, pd, "", |
| | | ServiceConstant.SERVICE_API_URL + "/api/query.user.privilege?userId=" + privilegeInfoObj.getString("staffId") + "&domain=" + storeInfoObj.getString("storeTypeCd"), HttpMethod.GET); |
| | | |
| | | // ResultVo resultVo = getCommunityStoreInfoSMOImpl.getUserPrivileges(pd, privilegeInfoObj.getString("staffId"), storeInfoObj.getString("storeTypeCd"), restTemplate); |
| | | // ResponseEntity<String> privilegeGroup = new ResponseEntity<>(resultVo.getMsg(), resultVo.getCode() == ResultVo.CODE_OK ? HttpStatus.OK : HttpStatus.BAD_REQUEST); |
| | | if (privilegeGroup.getStatusCode() != HttpStatus.OK) { |
| | | return privilegeGroup; |
| | | } |
| | |
| | | |
| | | JSONArray privileges = resultObj.getJSONArray("privileges"); |
| | | |
| | | JSONArray tmpPrivilegeArrays = new JSONArray(); |
| | | |
| | | JSONObject privilegeObj = null; |
| | | for (int privilegeIndex = 0; privilegeIndex < privileges.size(); privilegeIndex++) { |
| | | privilegeObj = privileges.getJSONObject(privilegeIndex); |
| | | hasSameData(privilegeObj, tmpPrivilegeArrays); |
| | | } |
| | | |
| | | JSONObject resObj = new JSONObject(); |
| | | resObj.put("datas", privileges); |
| | | |