个税扣缴义务人 人员范围 增加角色类型
This commit is contained in:
parent
6a8a2b73d4
commit
4f0e9597a4
|
|
@ -3,6 +3,7 @@ package com.engine.salary.biz;
|
|||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.RoleInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
|
|
@ -244,4 +245,16 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
public List<RoleInfo> listRoleInfo(List<Long> roleIds) {
|
||||
if (CollectionUtils.isEmpty(roleIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.listRoleInfo(roleIds);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.entity.hrm;
|
||||
|
||||
import com.engine.salary.annotation.I18n;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RoleInfo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@I18n
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -2,12 +2,8 @@ package com.engine.salary.entity.taxagent.bo;
|
|||
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.agency.po.PaymentAgencyPO;
|
||||
import com.engine.salary.entity.auth.po.AuthRolePO;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.hrm.*;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
|
||||
|
|
@ -24,11 +20,11 @@ import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum;
|
|||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.page.Column;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -251,7 +247,7 @@ public class TaxAgentBO {
|
|||
*/
|
||||
public static List<TaxAgentManageRangeListDTO> convert2ListDTO(List<TaxAgentManageRangePO> taxAgentManageRanges, List<DataCollectionEmployee> employeeComInfos,
|
||||
List<DeptInfo> departmentComInfos, List<SubCompanyInfo> subDepartmentComInfos,
|
||||
List<PositionInfo> positionComInfos, List<HrmStatus> hrmStatusList) {
|
||||
List<PositionInfo> positionComInfos, List<HrmStatus> hrmStatusList, List<RoleInfo> roleComInfos) {
|
||||
if (CollectionUtils.isEmpty(taxAgentManageRanges)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
@ -259,6 +255,7 @@ public class TaxAgentBO {
|
|||
Map<Long, String> departmentComInfoMap = SalaryEntityUtil.convert2Map(departmentComInfos, DeptInfo::getId, DeptInfo::getName);
|
||||
Map<Long, String> subDepartmentComInfoMap = SalaryEntityUtil.convert2Map(subDepartmentComInfos, SubCompanyInfo::getId, SubCompanyInfo::getName);
|
||||
Map<Long, String> positionComInfoMap = SalaryEntityUtil.convert2Map(positionComInfos, PositionInfo::getId, PositionInfo::getName);
|
||||
Map<Long, String> roleComInfoMap = SalaryEntityUtil.convert2Map(roleComInfos, RoleInfo::getId, RoleInfo::getName);
|
||||
|
||||
Map<String, String> hrmStatusNameMap = SalaryEntityUtil.convert2Map(hrmStatusList, hrmStatus -> String.valueOf(hrmStatus.getId()), HrmStatus::getName);
|
||||
|
||||
|
|
@ -273,7 +270,7 @@ public class TaxAgentBO {
|
|||
.orElse(StringUtils.EMPTY))
|
||||
.targetId(taxAgentManageRange.getTargetId())
|
||||
.target(taxAgentManageRange.getTarget())
|
||||
.targetName(buildTargetName(taxAgentManageRange, employeeComInfoMap, departmentComInfoMap, subDepartmentComInfoMap, positionComInfoMap))
|
||||
.targetName(buildTargetName(taxAgentManageRange, employeeComInfoMap, departmentComInfoMap, subDepartmentComInfoMap, positionComInfoMap,roleComInfoMap))
|
||||
.employeeStatus(buildEmployeeStatus(hrmStatusNameMap, taxAgentManageRange.getEmployeeStatus()))
|
||||
.status(buildStatus(taxAgentManageRange.getEmployeeStatus()))
|
||||
.build();
|
||||
|
|
@ -310,7 +307,7 @@ public class TaxAgentBO {
|
|||
* @return
|
||||
*/
|
||||
private static String buildTargetName(TaxAgentManageRangePO taxAgentManageRange, Map<Long, String> employeeComInfoMap, Map<Long, String> departmentComInfoMap,
|
||||
Map<Long, String> subDepartmentComInfoMap, Map<Long, String> positionComInfoMap) {
|
||||
Map<Long, String> subDepartmentComInfoMap, Map<Long, String> positionComInfoMap,Map<Long, String> roleComInfoMap) {
|
||||
TargetTypeEnum targetTypeEnum = TargetTypeEnum.parseByValue(taxAgentManageRange.getTargetType());
|
||||
if (Objects.isNull(targetTypeEnum)) {
|
||||
return StringUtils.EMPTY;
|
||||
|
|
@ -324,6 +321,8 @@ public class TaxAgentBO {
|
|||
return subDepartmentComInfoMap.getOrDefault(taxAgentManageRange.getTargetId(), StringUtils.EMPTY);
|
||||
case POSITION:
|
||||
return positionComInfoMap.getOrDefault(taxAgentManageRange.getTargetId(), StringUtils.EMPTY);
|
||||
case ROLE:
|
||||
return roleComInfoMap.getOrDefault(taxAgentManageRange.getTargetId(), StringUtils.EMPTY);
|
||||
case SQL:
|
||||
return taxAgentManageRange.getTarget();
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ public enum TargetTypeEnum implements BaseEnum<Integer> {
|
|||
SUBCOMPANY(3, "分部", 107369),
|
||||
POSITION(4, "岗位", 90633),
|
||||
ALL(5, "所有人", 107729),
|
||||
SQL(6, "SQL", 107729);
|
||||
SQL(6, "SQL", 107729),
|
||||
ROLE(7, "角色", 87626);
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.engine.salary.mapper.datacollection;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.JobCallInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.hrm.*;
|
||||
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
|
||||
import com.engine.salary.entity.hrm.param.HrmQueryParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
|
|
@ -188,4 +185,11 @@ public interface EmployMapper {
|
|||
* @return
|
||||
*/
|
||||
List<DataCollectionEmployee> listByKeyword(@Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 获取角色信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<RoleInfo> listRoleInfo(@Param("collection") List<Long> ids);
|
||||
}
|
||||
|
|
@ -721,4 +721,17 @@
|
|||
from hrmjobcall job
|
||||
where job.id = #{jobCallId}
|
||||
</select>
|
||||
|
||||
<select id="listRoleInfo" resultType="com.engine.salary.entity.hrm.RoleInfo">
|
||||
select t.id,
|
||||
t.rolesname as name
|
||||
from hrmroles t
|
||||
where 1=1
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.JobCallInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.hrm.*;
|
||||
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
|
|
@ -210,4 +207,6 @@ public interface SalaryEmployeeService {
|
|||
JobCallInfo getJobCallInfoById(Long jobCallId);
|
||||
|
||||
List<DataCollectionEmployee> snapshot(List<Long> employeeIds, Date snapshotTime);
|
||||
|
||||
List<RoleInfo> listRoleInfo(List<Long> roleIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ import com.engine.salary.biz.EmployBiz;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.SalarySobExtRangePO;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.JobCallInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.hrm.*;
|
||||
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
|
||||
import com.engine.salary.entity.hrm.dto.FieldSetting;
|
||||
import com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO;
|
||||
|
|
@ -707,4 +704,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
return SalaryI18nUtil.i18nList(employees);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RoleInfo> listRoleInfo(List<Long> roleIds) {
|
||||
return SalaryI18nUtil.i18nList(employBiz.listRoleInfo(roleIds));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.HrmStatus;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.hrm.*;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeListDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
|
||||
|
|
@ -51,6 +48,7 @@ import org.springframework.beans.BeanUtils;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
|
@ -188,6 +186,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
Map<Long, Set<Long>> virtualSubCompanyMap = SalaryEntityUtil.group2Map(virtualEmpListBySubCom, DataCollectionEmployee::getSubcompanyid, DataCollectionEmployee::getEmployeeId);
|
||||
|
||||
List<DataCollectionEmployee> salaryEmployeeList = Lists.newArrayList();
|
||||
HrmUserVarify hrmUserVarify = new HrmUserVarify();
|
||||
for (TaxAgentManageRangePO manageRange : taxAgentManageRanges) {
|
||||
if (!TargetTypeEnum.SQL.getValue().equals(manageRange.getTargetType())) {
|
||||
boolean isVirtual = manageRange.getTargetId().compareTo(0L) < 0 ? true : false;
|
||||
|
|
@ -225,6 +224,9 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.POSITION.getValue()) && Objects.equals(manageRange.getTargetId(), salaryEmployee.getJobtitleId())) {
|
||||
return true;
|
||||
}
|
||||
if (Objects.equals(manageRange.getTargetType(), TargetTypeEnum.ROLE.getValue()) && hrmUserVarify.checkUserRight(salaryEmployee.getEmployeeId().toString(), manageRange.getTargetId().toString(),"0")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
salaryEmployeeList.addAll(employees);
|
||||
|
|
@ -314,13 +316,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
// 查询岗位信息
|
||||
List<Long> positionIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.POSITION.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList());
|
||||
List<PositionInfo> positionComInfos = getSalaryEmployeeService().listPositionInfo(positionIds);
|
||||
|
||||
// 查询角色信息
|
||||
List<Long> roleIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.ROLE.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList());
|
||||
List<RoleInfo> roleComInfos = getSalaryEmployeeService().listRoleInfo(roleIds);
|
||||
// 分页参数
|
||||
PageInfo<TaxAgentManageRangeListDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentManageRangeListDTO.class);
|
||||
// 查询人员状态
|
||||
// List<HrmStatus> hrmStatusList = hrmCommonHrmStatusService.list();
|
||||
List<HrmStatus> hrmStatusList = UserStatusEnum.getHrmStatusList();
|
||||
// 薪资账套的人员范围po转换成列表dto
|
||||
List<TaxAgentManageRangeListDTO> taxAgentManageRangeList = TaxAgentBO.convert2ListDTO(taxAgentManageRanges, employeeComInfos, departmentComInfos, subDepartmentComInfos, positionComInfos, hrmStatusList);
|
||||
List<TaxAgentManageRangeListDTO> taxAgentManageRangeList = TaxAgentBO.convert2ListDTO(taxAgentManageRanges, employeeComInfos, departmentComInfos, subDepartmentComInfos, positionComInfos, hrmStatusList,roleComInfos);
|
||||
// 根据对象名称过滤
|
||||
if (StringUtils.isNotEmpty(queryParam.getTargetName())) {
|
||||
taxAgentManageRangeList = taxAgentManageRangeList.stream().filter(f -> f.getTargetName().contains(queryParam.getTargetName())).collect(Collectors.toList());
|
||||
|
|
|
|||
Loading…
Reference in New Issue