Commit 778a36e6 by guojuxing

去掉前置资源-全部有权限

parent bab8ecb1
......@@ -132,7 +132,8 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
enterpriseResourceRel.setEnterpriseId(enterpriseId);
enterpriseResourceRel.setResourceCode(res.getResourceCode());
enterpriseResourceRel.setResourceName(res.getResourceName());
enterpriseResourceRel.setResourceSwitch(0);
//去掉前置资源,默认都有权限
enterpriseResourceRel.setResourceSwitch(1);
enterpriseResourceRelService.saveResource(enterpriseResourceRel);
}
}
......@@ -271,7 +272,12 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
public ServiceResponse<List<EnterpriseResourceRelDTO>> getBusinessFrontRes(Integer enterpriseId) {
List<TabEnterpriseResourceRel> list = enterpriseResourceRelService.getByEnterpriseId(enterpriseId);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(EntityUtil.changeEntityListNew(EnterpriseResourceRelDTO.class, list));
List<EnterpriseResourceRelDTO> temp = EntityUtil.changeEntityListNew(EnterpriseResourceRelDTO.class, list);
for (EnterpriseResourceRelDTO dto : temp) {
//去掉前置资源,默认都有权限
dto.setResourceSwitch(1);
}
return ServiceResponse.success(temp);
} else {
ServiceResponse<List<BusinessFrontResDTO>> businessFrontResListResult = businessFrontResApiService
.listGroupResourceCode();
......@@ -281,7 +287,8 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
List<EnterpriseResourceRelDTO> result = new ArrayList<>(resourceList.size());
for (BusinessFrontResDTO res : resourceList) {
EnterpriseResourceRelDTO temp = new EnterpriseResourceRelDTO();
temp.setResourceSwitch(0);
//去掉前置资源,默认都有权限
temp.setResourceSwitch(1);
temp.setResourceName(res.getResourceName());
temp.setResourceCode(res.getResourceCode());
result.add(temp);
......
......@@ -31,6 +31,7 @@ public class EnterpriseGoodsResourceApiServiceImpl implements EnterpriseGoodsRes
if (CollectionUtils.isNotEmpty(businessFront)) {
hasGoodsAuth = businessFront.stream().anyMatch(e -> "goods".equals(e.getResourceCode()) && e.getResourceSwitch().intValue() == 1);
}
return ServiceResponse.success(hasGoodsAuth);
//去掉前置资源,全部有权限
return ServiceResponse.success(true);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment