系统模板配置

This commit is contained in:
钱涛 2024-12-05 10:17:12 +08:00
parent 0114bdeb3f
commit 5fedafc67e
2 changed files with 7 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public class PageListTemplateDTO {
@TableTitle(title = "是否系统模板",dataIndex = "systemTypeName",key = "systemTypeName")
private String systemTypeName;
@TableTitle(title = "范围",dataIndex = "systemType",key = "systemType")
@TableTitle(title = "范围",dataIndex = "limits",key = "limits")
private String limits;
/**

View File

@ -289,10 +289,11 @@ public class SettingServiceImpl extends Service implements SettingService {
//权限控制
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
List<Long> taxIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
Boolean chief = getTaxAgentService().isChief((long) user.getUID());
pos = pos.stream().filter(po -> {
SharedTypeEnum sharedTypeEnum = SharedTypeEnum.parseByValue(po.getSharedType());
//系统模板直接可见
if(po.getSystemType()==1){
if (chief || po.getSystemType() == 1) {
return true;
}
//私有只能自己看到
@ -376,6 +377,8 @@ public class SettingServiceImpl extends Service implements SettingService {
List<PageListTemplatePO> pos = getPageListTemplateMapper().listSome(build);
//权限控制
List<TaxAgentPO> agentPOList = getTaxAgentService().listAll();
Map<Long, String> idNameMap = SalaryEntityUtil.convert2Map(agentPOList, TaxAgentPO::getId, TaxAgentPO::getName);
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
Boolean chief = getTaxAgentService().isChief((long) user.getUID());
List<Long> taxIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
@ -383,7 +386,7 @@ public class SettingServiceImpl extends Service implements SettingService {
.filter(po -> {
SharedTypeEnum sharedTypeEnum = SharedTypeEnum.parseByValue(po.getSharedType());
//系统模板直接可见
if(po.getSystemType()==1){
if (chief || po.getSystemType() == 1) {
return true;
}
//私有只能自己看到
@ -404,6 +407,7 @@ public class SettingServiceImpl extends Service implements SettingService {
.systemType(po.getSystemType())
.sharedTypeName(SharedTypeEnum.parseByValue(po.getSharedType()).getDefaultLabel())
.systemTypeName(po.getSystemType() == 1 ? "系统模板" : "自定义")
.limits(CollUtil.isEmpty(po.getLimitIds()) ? "所有" : Optional.ofNullable(po.getLimitIds()).orElse(new ArrayList<>()).stream().map(id -> idNameMap.getOrDefault(id, "")).collect(Collectors.joining(",")))
.limitIds(po.getLimitIds())
.setting(po.getSetting())
.canEdit(chief || (Objects.equals((long) user.getUID(), po.getCreator()) && po.getSystemType() == 0))