Commit f38a5e38 by kangxiaoshan

权限

parent aad91a16
...@@ -214,7 +214,7 @@ public class ContractController { ...@@ -214,7 +214,7 @@ public class ContractController {
platform = dropall; platform = dropall;
} }
return ResultModel.OK(service.findBody(platform)); return ResultModel.OK(service.findBody(platform,loginAccount));
} }
@RequestMapping(value = "find/code", method = RequestMethod.GET) @RequestMapping(value = "find/code", method = RequestMethod.GET)
......
package common.service; package common.service;
import common.model.*; import common.model.*;
import tkio.model.PackageType;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -15,7 +14,7 @@ public interface ContractService { ...@@ -15,7 +14,7 @@ public interface ContractService {
Boolean checkTime(String email, String platfrom, String type, String product); Boolean checkTime(String email, String platfrom, String type, String product);
List<ContractBody> findBody(String platform); List<ContractBody> findBody(String platform, User loginAccount);
String getContractCode(String code); String getContractCode(String code);
......
...@@ -194,7 +194,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -194,7 +194,7 @@ public class ContractServiceImpl implements ContractService {
} }
@Override @Override
public List<ContractBody> findBody(String platform) { public List<ContractBody> findBody(String platform, User loginAccount) {
if ("all".equals(platform)) { if ("all".equals(platform)) {
List<ContractBody> all = contractBodyRepository.findAllDis(); List<ContractBody> all = contractBodyRepository.findAllDis();
...@@ -203,6 +203,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -203,6 +203,12 @@ public class ContractServiceImpl implements ContractService {
List<ContractBody> common = contractBodyRepository.findByPlatform("common"); List<ContractBody> common = contractBodyRepository.findByPlatform("common");
List<ContractBody> byPlatform = contractBodyRepository.findByPlatform(platform); List<ContractBody> byPlatform = contractBodyRepository.findByPlatform(platform);
common.addAll(byPlatform); common.addAll(byPlatform);
if (RoleEnum.FINANCE.getKey().equals(loginAccount.getRole())) {
Map<String, Object> filter = authService.getAuthExtends(loginAccount);
common = common.stream().filter(t -> filter.get(t.getCode()) != null).collect(Collectors.toList());
}
return common; return common;
} }
......
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