数据采集权限
This commit is contained in:
parent
5e67b5937d
commit
c7659e0717
|
|
@ -33,6 +33,22 @@
|
|||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
<page name="专项附加扣除" key="specialAddDeduction">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
<page name="其他免税扣除" key="otherDeduction">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
<page name="往期累计情况" key="addUpSituation">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
<page name="考勤引用" key="attendQuote">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
</module>
|
||||
|
||||
<module name="报表" key="report">
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ package com.engine.salary.biz;
|
|||
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
|
@ -20,23 +18,6 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
||||
/**
|
||||
* 关联查询查询列表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public List<AddUpSituationDTO> list(AddUpSituationQueryParam param) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
|
||||
List<AddUpSituationDTO> list = mapper.list(param);
|
||||
encryptUtil.decryptList(list, AddUpSituationDTO.class);
|
||||
return SalaryI18nUtil.i18nList(list);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
|
|
|
|||
|
|
@ -15,17 +15,17 @@ public class Permission {
|
|||
/**
|
||||
* 是否开启了分权
|
||||
*/
|
||||
private boolean isOpenDevolution;
|
||||
private Boolean isOpenDevolution;
|
||||
|
||||
/**
|
||||
* 是否总管理员
|
||||
*/
|
||||
private boolean isChief;
|
||||
private Boolean isChief;
|
||||
|
||||
/**
|
||||
* 是否扣缴义务人管理员
|
||||
*/
|
||||
private boolean isAdminEnable;
|
||||
private Boolean isAdminEnable;
|
||||
|
||||
/**
|
||||
* 当前页面是否有权限
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 数据采集-累计情况表
|
||||
*/
|
||||
|
|
@ -20,6 +22,7 @@ import lombok.NoArgsConstructor;
|
|||
@SalaryTable(pageId = "a4f85287-e3f9-7841-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX, operates = {
|
||||
@SalaryTableOperate(text = "查看明细")
|
||||
})
|
||||
@Auth(page = "addUpSituation")
|
||||
public class AddUpSituationDTO {
|
||||
//主键id
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
|
|
@ -216,4 +219,6 @@ public class AddUpSituationDTO {
|
|||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
@TableTitle(title = "操作", dataIndex = "operate", key = "operate")
|
||||
private String operate;
|
||||
|
||||
private Set<String> opts;
|
||||
}
|
||||
|
|
@ -2,12 +2,15 @@ package com.engine.salary.entity.datacollection.dto;
|
|||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.salary.annotation.*;
|
||||
import com.engine.salary.enums.auth.AuthCheckTypeEnum;
|
||||
import com.engine.salary.util.excel.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 数据采集-其他免税扣除列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -23,6 +26,7 @@ import lombok.NoArgsConstructor;
|
|||
@SalaryTable(pageId = "a4f85287-e3f9-6612-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX, operates = {
|
||||
@SalaryTableOperate(text = "查看明细")
|
||||
})
|
||||
@Auth(page = "otherDeduction", checkType = AuthCheckTypeEnum.TAX_EMP)
|
||||
public class OtherDeductionListDTO {
|
||||
|
||||
|
||||
|
|
@ -119,4 +123,6 @@ public class OtherDeductionListDTO {
|
|||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
@TableTitle(title = "操作", dataIndex = "operate", key = "operate")
|
||||
private String operate;
|
||||
|
||||
private Set<String> opts;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
|
|||
|
||||
return AuthRoleDTO.builder().id(roleId)
|
||||
.name(po.getName())
|
||||
.description(po.getDescription())
|
||||
.members(authRoleEmpDTOS.size())
|
||||
.opts(authOptPOS.size())
|
||||
.datas(authRoleDataDTOS.size())
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
|
|
@ -32,6 +33,8 @@ import com.engine.salary.service.AddUpDeductionService;
|
|||
import com.engine.salary.service.AddUpSituationService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
|
|
@ -98,6 +101,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
}
|
||||
|
||||
public AuthService getAuthService(User user) {
|
||||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition() {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
|
|
@ -197,19 +204,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
long employeeId = user.getUID();
|
||||
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
|
||||
if (needAuth) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
|
||||
return new PageInfo<>(AddUpSituationDTO.class);
|
||||
}
|
||||
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
|
||||
}
|
||||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(queryParam);
|
||||
list = getAuthService(user).auth(list, AuthFilterTypeEnum.DATA_OPT, AddUpSituationDTO.class);
|
||||
|
||||
PageInfo<AddUpSituationDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpSituationDTO.class);
|
||||
encryptUtil.decryptList(page.getList(), AddUpSituationDTO.class);
|
||||
SalaryI18nUtil.i18nList(list);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
|
@ -302,14 +302,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
List<AddUpSituationDTO> list = biz.list(param);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(param);
|
||||
list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, AddUpSituationDTO.class);
|
||||
encryptUtil.decryptList(list, AddUpSituationDTO.class);
|
||||
SalaryI18nUtil.i18nList(list);
|
||||
|
||||
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
|
|
@ -28,6 +29,8 @@ import com.engine.salary.service.AddUpDeductionService;
|
|||
import com.engine.salary.service.OtherDeductionService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
|
|
@ -96,6 +99,10 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public AuthService getAuthService(User user) {
|
||||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OtherDeductionPO getById(Long id) {
|
||||
return getOtherDeductionMapper().getById(id);
|
||||
|
|
@ -115,17 +122,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
long employeeId = user.getUID();
|
||||
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
|
||||
if (needAuth) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
|
||||
return new PageInfo<>(OtherDeductionListDTO.class);
|
||||
}
|
||||
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
|
||||
}
|
||||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(queryParam);
|
||||
list = getAuthService(user).auth(list, AuthFilterTypeEnum.DATA_OPT, OtherDeductionListDTO.class);
|
||||
|
||||
PageInfo<OtherDeductionListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||
list, OtherDeductionListDTO.class);
|
||||
encryptUtil.decryptList(page.getList(), OtherDeductionListDTO.class);
|
||||
|
|
@ -257,7 +256,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
List<Long> employeeSameIds = new ArrayList<>();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo,null);
|
||||
List<DataCollectionEmployee> emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null);
|
||||
//含在职和离职,选在职数据
|
||||
if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) {
|
||||
employeeSameIds = emps.stream()
|
||||
|
|
@ -514,16 +513,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
param.setOrderRule(orderRule);
|
||||
|
||||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(param);
|
||||
list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, OtherDeductionListDTO.class);
|
||||
encryptUtil.decryptList(list, OtherDeductionListDTO.class);
|
||||
SalaryI18nUtil.i18nList(list);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
|
|
|
|||
|
|
@ -501,6 +501,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
map.put("payEndDate", SalaryDateUtil.getFormatLocalDate(e.getPayEndDate()));
|
||||
map.put("companystartdate", e.getCompanystartdate());
|
||||
map.put("dismissdate", e.getDismissdate());
|
||||
map.put("opts", e.getOpts());
|
||||
|
||||
// 薪资项目动态
|
||||
Optional<Map<String, Object>> optionalItem = salaryArchiveItemData.stream().filter(f -> f.get("salaryArchiveId").toString().equals(e.getId().toString())).findFirst();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.engine.salary.enums.OperateTypeEnum;
|
|||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobMapper;
|
||||
import com.engine.salary.mapper.salarysob.SobTaxLinkMapper;
|
||||
|
|
@ -440,12 +439,12 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// 获取人员范围列表
|
||||
List<TaxAgentManageRangePO> includeList = getTaxAgentManageRangeService(user).listByTaxAgentIdAndIncludeType(taxAgentId, NumberUtils.INTEGER_ONE);
|
||||
includeList.forEach(item -> {
|
||||
item.setEmployeeStatus(parseEnum2ValueStr(item.getEmployeeStatus()));
|
||||
item.setEmployeeStatus(parseJson2ValueStr(item.getEmployeeStatus()));
|
||||
});
|
||||
// 获取从范围中排除
|
||||
List<TaxAgentManageRangePO> excludeList = getTaxAgentManageRangeService(user).listByTaxAgentIdAndIncludeType(taxAgentId, NumberUtils.INTEGER_ZERO);
|
||||
excludeList.forEach(item -> {
|
||||
item.setEmployeeStatus(parseEnum2ValueStr(item.getEmployeeStatus()));
|
||||
item.setEmployeeStatus(parseJson2ValueStr(item.getEmployeeStatus()));
|
||||
});
|
||||
// 将TaxAgentManageRangeListDTO转换为SalarySobRangePO
|
||||
List<SalarySobRangePO> rangeList = convert2SalarySobRangePO(sobId, includeList, excludeList);
|
||||
|
|
@ -514,25 +513,12 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
|
||||
|
||||
/**
|
||||
* @return String
|
||||
* @description 将枚举的defaultLabel转换为value
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/9 16:56
|
||||
* ["0","1","2","3","4","5","6"] -> 0,1,2,3,4,5,6
|
||||
* @param employeeStatus
|
||||
* @return
|
||||
*/
|
||||
private String parseEnum2ValueStr(String employeeStatus) {
|
||||
String[] split = employeeStatus.split(",");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (SalaryEmployeeStatusEnum statusEnum : SalaryEmployeeStatusEnum.values()) {
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (statusEnum.getDefaultLabel().equals(split[i])) {
|
||||
sb.append(statusEnum.getValue());
|
||||
if (i + 1 != split.length) {
|
||||
sb.append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
private String parseJson2ValueStr(String employeeStatus) {
|
||||
return employeeStatus.replace("[","").replace("]","").replaceAll("\"", "");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -997,23 +983,23 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
public void handleHistory() {
|
||||
|
||||
int count = getSobTaxLinkMapper().count();
|
||||
if(count>0){
|
||||
if (count > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobMapper().listAll();
|
||||
salarySobPOS.forEach(sobPO -> {
|
||||
SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.taxAgentId(sobPO.getTaxAgentId())
|
||||
.sobId(sobPO.getId())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.deleteType(0)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO);
|
||||
SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.taxAgentId(sobPO.getTaxAgentId())
|
||||
.sobId(sobPO.getId())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.deleteType(0)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue