外部人员终极版

This commit is contained in:
钱涛 2023-03-15 22:48:01 +08:00
parent 81650888c7
commit 62d124efb1
19 changed files with 237 additions and 210 deletions

View File

@ -385,4 +385,9 @@ public class SalaryArchiveBO {
*/
private List<Long> changeIds;
}
public static boolean isNotExtEmp(SalaryArchivePO po) {
return po.getEmployeeType() == null || po.getEmployeeType() == 1;
}
}

View File

@ -0,0 +1,54 @@
package com.engine.salary.enums.datacollection;
import com.engine.salary.enums.BaseEnum;
import java.util.Arrays;
import java.util.Optional;
/**
* 人员使用枚举
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum UseEmployeeTypeEnum implements BaseEnum<Integer> {
ORG(0, "组织架构", 109125),
EXT(1, "非系统人员", 119127),
ALl(2, "所有人员", 119127),
;
private int value;
private String defaultLabel;
private int labelId;
UseEmployeeTypeEnum(int value, String defaultLabel, int labelId) {
this.value = value;
this.defaultLabel = defaultLabel;
this.labelId = labelId;
}
@Override
public Integer getValue() {
return value;
}
@Override
public Integer getLabelId() {
return labelId;
}
@Override
public String getDefaultLabel() {
return defaultLabel;
}
public static String getNameByValue(String value) {
Optional<UseEmployeeTypeEnum> optional = Arrays.stream(UseEmployeeTypeEnum.values()).filter(r -> r.getValue().toString().equals(value)).findFirst();
return optional.isPresent() ? optional.get().name() : "";
}
}

View File

@ -536,32 +536,60 @@
SELECT
<include refid="salaryItemAdjustRecordColumn"/>
FROM hrsa_salary_archive_item t1
LEFT JOIN hrmresource e ON e.id = t1.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmresource o ON o.id = t1.operator
LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id
WHERE
t1.delete_type = 0
AND e.status != '7' and (e.accounttype is null or e.accounttype = 0)
<if test="salaryItemIds != null and salaryItemIds.size()>0">
AND t1.salary_item_id IN
<foreach collection="salaryItemIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 关键字(姓名、部门、薪资项目名称 -->
<if test="param.keyword != null and param.keyword != ''">
AND
(
e.lastname like CONCAT('%',#{param.keyword},'%')
OR d.departmentname like CONCAT('%',#{param.keyword},'%')
OR t2.name like CONCAT('%',#{param.keyword},'%')
)
</if>
<if test="param.adjustItem != null and param.adjustItem != ''">
AND t2.name like CONCAT('%',#{param.adjustItem},'%')
</if>
<include refid="paramSql"/>
<if test="param.ids != null and param.ids.size()>0">
AND t1.id IN
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!--员工id,用于查询个人调薪记录-->
<if test="param.employeeId != null">
AND t1.employee_id = #{param.employeeId}
</if>
<!-- 薪资档案id -->
<if test="param.salaryArchiveId != null">
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<!-- 部门 -->
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND d.id IN
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 调整原因 -->
<if test="param.adjustReason != null and param.adjustReason != ''">
AND t1.adjust_reason = #{param.adjustReason}
</if>
<!-- 生效日期 -->
<if test="param.effectiveTime != null and param.effectiveTime.size() == 2">
AND (t1.effective_time BETWEEN #{param.effectiveTime[0]} AND #{param.effectiveTime[1]})
</if>
<!-- 操作日期 -->
<if test="param.operateTime != null and param.operateTime.size() == 2">
AND (t1.operate_time BETWEEN CONCAT(#{param.operateTime[0]},' 00:00:00') AND
CONCAT(#{param.operateTime[1]},' 23:59:59'))
</if>
<!-- 操作人 -->
<if test="param.operatorIds != null and param.operatorIds.size()>0">
AND t1.operator IN
<foreach collection="param.operatorIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY t1.effective_time DESC,t1.id DESC
</select>
<select id="salaryItemAdjustRecordList"
@ -570,9 +598,6 @@
t1.id,
t1.employee_id,
e.lastname as username,
e.status AS employeeStatus,
d.departmentname AS departmentName,
t1.effective_time,
t1.adjust_reason,
t2.name AS adjust_item,
@ -584,28 +609,16 @@
t1.salary_item_id
FROM hrsa_salary_archive_item t1
LEFT JOIN hrmresource e ON e.id = t1.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmresource o ON o.id = t1.operator
LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id
WHERE
t1.delete_type = 0
AND e.status != '7' and (e.accounttype is null or e.accounttype = 0)
<if test="salaryItemIds != null and salaryItemIds.size()>0">
AND t1.salary_item_id IN
<foreach collection="salaryItemIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<if test="param.keyword != null and param.keyword != ''">
AND
(
e.lastname like '%'||#{param.keyword}||'%'
OR d.departmentname like '%'||#{param.keyword}||'%'
OR t2.name like '%'||#{param.keyword}||'%'
)
</if>
<if test="param.adjustItem != null and param.adjustItem != ''">
AND t2.name like '%'||#{param.adjustItem}||'%'
</if>
@ -625,28 +638,6 @@
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<if test="param.username != null and param.username != ''">
AND e.lastname like '%'||#{param.username}||'%'
</if>
<if test="param.positionIds != null and param.positionIds.size()>0">
AND e.jobtitle IN
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<if test="param.userstatus != null and param.userstatus != ''">
AND e.status = #{param.userstatus}
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND d.id IN
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<if test="param.adjustReason != null and param.adjustReason != ''">
AND t1.adjust_reason = #{param.adjustReason}
</if>
@ -679,9 +670,6 @@
t1.id,
t1.employee_id,
e.lastname as username,
e.status AS employeeStatus,
d.departmentname AS departmentName,
t1.effective_time,
t1.adjust_reason,
t2.name AS adjust_item,
@ -693,13 +681,10 @@
t1.salary_item_id
FROM hrsa_salary_archive_item t1
LEFT JOIN hrmresource e ON e.id = t1.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmresource o ON o.id = t1.operator
LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id
WHERE
t1.delete_type = 0
AND e.status != '7' and (e.accounttype is null or e.accounttype = 0)
<if test="salaryItemIds != null and salaryItemIds.size()>0">
AND t1.salary_item_id IN
<foreach collection="salaryItemIds" open="(" item="id" separator="," close=")">
@ -707,14 +692,6 @@
</foreach>
</if>
<if test="param.keyword != null and param.keyword != ''">
AND
(
e.lastname like '%'+#{param.keyword}+'%'
OR d.departmentname like '%'+#{param.keyword}+'%'
OR t2.name like '%'+#{param.keyword}+'%'
)
</if>
<if test="param.adjustItem != null and param.adjustItem != ''">
AND t2.name like '%'+#{param.adjustItem}+'%'
</if>
@ -734,20 +711,6 @@
AND t1.salary_archive_id = #{param.salaryArchiveId}
</if>
<if test="param.username != null and param.username != ''">
AND e.lastname like '%'+#{param.username}+'%'
</if>
<if test="param.positionIds != null and param.positionIds.size()>0">
AND e.jobtitle IN
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<if test="param.userstatus != null and param.userstatus != ''">
AND e.status = #{param.userstatus}
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND d.id IN
@ -775,19 +738,12 @@
</foreach>
</if>
<if test="param.description != null and param.description != ''">
AND t1.description like '%'+#{param.description}+'%'
</if>
ORDER BY t1.effective_time DESC,t1.id DESC
</select>
<sql id="salaryItemAdjustRecordColumn">
t1.id,
t1.employee_id,
e.lastname as username,
e.status AS employeeStatus,
d.departmentname AS departmentName,
t1.effective_time,
t1.adjust_reason,
t2.name AS adjust_item,

View File

@ -14,6 +14,7 @@
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="employee_type" property="employeeType"/>
</resultMap>
<resultMap id="SalaryAccEmployeeCountMap"
@ -36,7 +37,8 @@
t.create_time,
t.update_time,
t.delete_type,
t.tenant_key
t.tenant_key,
t.employee_type
</sql>
<sql id="emp1Column">
@ -44,13 +46,13 @@
.
id
, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type
</sql>
<insert id="batchInsert">
INSERT INTO hrsa_salary_acct_emp(
salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
creator, create_time, update_time, delete_type, tenant_key)
creator, create_time, update_time, delete_type, tenant_key,employee_type)
VALUES
<foreach collection="collection" item="emp" separator=",">
(
@ -63,14 +65,15 @@
#{emp.createTime},
#{emp.updateTime},
#{emp.deleteType},
#{emp.tenantKey}
#{emp.tenantKey},
#{emp.employeeType}
)
</foreach>
</insert>
<insert id="batchInsert" databaseId="oracle">
INSERT INTO hrsa_salary_acct_emp(
salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
creator, create_time, update_time, delete_type, tenant_key)
creator, create_time, update_time, delete_type, tenant_key,employee_type)
<foreach collection="collection" item="emp" separator="union all">
select
@ -83,7 +86,8 @@
#{emp.createTime,jdbcType=DATE},
#{emp.updateTime,jdbcType=DATE},
#{emp.deleteType,jdbcType=INTEGER},
#{emp.tenantKey,jdbcType=VARCHAR}
#{emp.tenantKey,jdbcType=VARCHAR},
#{emp.employeeType,jdbcType=INTEGER}
from dual
</foreach>
</insert>
@ -91,7 +95,7 @@
<foreach collection="collection" item="emp" separator=";">
INSERT INTO hrsa_salary_acct_emp(
salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
creator, create_time, update_time, delete_type, tenant_key)
creator, create_time, update_time, delete_type, tenant_key,employee_type)
VALUES
(
#{emp.salaryAcctRecordId},
@ -103,7 +107,8 @@
#{emp.createTime},
#{emp.updateTime},
#{emp.deleteType},
#{emp.tenantKey}
#{emp.tenantKey},
#{emp.employeeType}
)
</foreach>
</insert>
@ -151,13 +156,13 @@
SELECT DISTINCT
emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type
FROM (
SELECT
id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
creator, create_time, update_time, delete_type, tenant_key
creator, create_time, update_time, delete_type, tenant_key,employee_type
FROM hrsa_salary_acct_emp
WHERE
@ -228,13 +233,13 @@
SELECT DISTINCT
emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month,
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key
emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type
FROM (
SELECT
id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month,
creator, create_time, update_time, delete_type, tenant_key
creator, create_time, update_time, delete_type, tenant_key,employee_type
FROM hrsa_salary_acct_emp
WHERE

View File

@ -82,9 +82,6 @@
<if test="employeeType != null">
AND employee_type = #{employeeType}
</if>
<if test="employeeType == null">
AND (employee_type is null or employee_type = 0)
</if>
<if test="taxAgentIds != null and taxAgentIds.size()>0">
AND tax_agent_id IN
<foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">

View File

@ -43,5 +43,6 @@ public interface ExtEmpService {
Collection<DataCollectionEmployee> getEmployeeByIdsAll(List<Long> ids);
Collection<DataCollectionEmployee> listAllForReport();
ExtEmpPO getById(Long id);
}

View File

@ -2,6 +2,7 @@ package com.engine.salary.service;
import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam;
import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import java.util.Collection;
import java.util.List;
@ -29,7 +30,7 @@ public interface TaxAgentEmpService{
* @param taxAgentIds
* @return
*/
List<TaxAgentEmpPO> listByTaxAgentIds(List<Long> taxAgentIds);
List<TaxAgentEmpPO> listByTaxAgentIds(List<Long> taxAgentIds, UseEmployeeTypeEnum type);
/**
* 同步人员到本地关联表

View File

@ -243,11 +243,5 @@ public interface TaxAgentService {
Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam);
/**
* 获取个税扣缴义务人下的人员范围
*
* @param taxAgentId
* @return
*/
Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId);
}

View File

@ -662,8 +662,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
List<SalaryAcctEmployeePO> accountedEmployeeData =
getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM"));
for (TaxAgentPO taxAgent : taxAgents) {
Collection<Long> employeeIds = getTaxAgentService(user)
.listEmployeeIdsInTaxAgent(taxAgent.getId());
List<SpecialAddDeductionPO> employeePOs = getSpecialAddDeductionService(user)
.getSpecialAddDeductionPOByEmployee(null, taxAgent.getId());

View File

@ -157,7 +157,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
}
}
}
return getExternalEmployeeMapper().getById(id);
return po;
}

View File

@ -14,7 +14,6 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
@ -317,19 +316,12 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
long employeeId = user.getUID();
if (getTaxAgentService(user).isNeedAuth(employeeId)) {
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
salaryArchives = salaryArchives.stream().filter(f ->
// 作为管理员
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
// 作为分管理员
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
// || employeeId.equals(f.getModifier())
).collect(Collectors.toList());
}
Map<Long, String> idNoEmpMap =
// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey)
// :
new HashMap<>();
if (queryParam.getHasData()) {
List<Map<String, Object>> listMaps = salaryArchiveService(user)

View File

@ -11,12 +11,14 @@ import com.engine.salary.entity.salaryarchive.param.*;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SalaryArchiveItemService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.excel.ExcelUtil;
@ -56,6 +58,10 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user);
}
private TaxAgentService getTaxAgentService(User user) {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
/**
* 获取未生效 lt
*
@ -179,7 +185,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
List<SalaryArchiveItemPO> salaryArchiveItems = Lists.newArrayList();
if (isNoNeedSalaryItem) {
salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds));
salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds));
} else {
List<List<Long>> partition = Lists.partition((List) saIds, 1000);
Collection<Long> finalSalaryItemIds = salaryItemIds;
@ -216,31 +222,31 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(115437, "停薪列表禁止操作"));
}
SalaryArchiveItemPO salaryArchiveItem = null;
if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null ) {
if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null) {
salaryArchiveItem = salaryArchiveItemMapper.getById(salaryArchiveItemSaveParam.getSalaryArchiveItemId());
if (salaryArchiveItem == null || !salaryArchiveItem.getSalaryArchiveId().equals(salaryArchiveId)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100428, "该薪资档案的薪资项目的调整记录不存在"));
}
if (salaryArchiveItemSaveParam.getSalaryArchiveItems().size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(149535, "单个调整不能处理多个薪资项目"));
} else if (!salaryArchiveItems.get(0).getSalaryItemId().equals(salaryArchiveItem.getSalaryItemId())){
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 149539, "单个调薪的目标项目和调整明细项目id不一致"));
} else if (!salaryArchiveItems.get(0).getSalaryItemId().equals(salaryArchiveItem.getSalaryItemId())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(149539, "单个调薪的目标项目和调整明细项目id不一致"));
}
}
// 构建更新PO
SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam,salaryArchiveItems,salaryItemIds,salaryArchiveItem);
SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam, salaryArchiveItems, salaryItemIds, salaryArchiveItem);
salaryArchiveItemMapper.updateIgnoreNull(updateSalaryArchiveItemPO);
}
return StringUtils.EMPTY;
}
/**
* @description 构建薪资档案中调薪的更新PO
* @return null
* @description 构建薪资档案中调薪的更新PO
* @author Harryxzy
* @date 2022/11/14 14:24
*/
private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam,List<SalaryArchiveItemDetailSaveParam> salaryArchiveItems,List<Long> salaryItemIds,SalaryArchiveItemPO salaryArchiveItem) {
private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam, List<SalaryArchiveItemDetailSaveParam> salaryArchiveItems, List<Long> salaryItemIds, SalaryArchiveItemPO salaryArchiveItem) {
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
// 获取生效+未生效的数据
@ -267,8 +273,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
}
// 修改了生效日期
if(!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())){
boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime));
if (!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())) {
boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime));
if (isEffectiveTimeRepeat) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153539, "已经存在该生效日期的调整记录,请修改生效日期"));
}
@ -276,9 +282,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
// 1.检验是否可以调整
// if (effectiveSalaryItem != null) {
// 当前已经生效的时间
// 当前已经生效的时间
// Date effectiveTime = effectiveSalaryItem.getEffectiveTime();
// 1.1 如果保存的生效日期早于<当前已生效
// 1.1 如果保存的生效日期早于<当前已生效
// if (saveEffectiveTime.before(effectiveTime)) {
// if(salaryArchiveItemSaveParam.getCanOperator() == Boolean.TRUE){
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100429, "生效日期不可早于当前已生效的调整日期"));
@ -545,9 +551,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98299, "参数错误,薪资项目不存在或已被删除"));
}
// if (salaryArchiveItem.getEffectiveTime().after(new Date())) {
salaryArchiveItem.setDeleteType(1);
// 删除未生效数据
salaryArchiveItemMapper.updateById(salaryArchiveItem);
salaryArchiveItem.setDeleteType(1);
// 删除未生效数据
salaryArchiveItemMapper.updateById(salaryArchiveItem);
// } else {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98299, "该薪资项目已生效不可删除"));
// }
@ -561,7 +567,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
*/
@Override
public List<SalaryItemPO> getCanAdjustSalaryItems() {
return salaryItemMapper.getCanAdjustSalaryItems();
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
List<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
List<SalaryItemPO> canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems();
canAdjustSalaryItems = canAdjustSalaryItems.stream()
.filter(item -> item.getSharedType() == null
|| 0 == item.getSharedType()
|| (StringUtils.isNotBlank(item.getTaxAgentIds()) && SalaryEntityUtil.judgeIntersection(taxAgentIds, Arrays.stream(item.getTaxAgentIds().split(",")).map(Long::valueOf).collect(Collectors.toList()))))
.collect(Collectors.toList());
return canAdjustSalaryItems;
}

View File

@ -925,14 +925,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
public Map<String, Long> queryTabTotal() {
long currentEmployeeId = user.getUID();
// // 1.历史数据处理
// handleHistory(currentEmployeeId);
// // 2.待停薪自动处理
// handleSuspendData(currentEmployeeId);
// // 3.增量数据处理
// handleChangeData(currentEmployeeId);
// tab页签数量
Map<String, Long> result = new HashMap<>();
@ -941,7 +933,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
//获取管理的人员范围
List<TaxAgentManageRangeEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
Map<Long, List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee>> taxAgentEmployeesMap = SalaryEntityUtil.convert2Map(taxAgentEmployeeDTOS, TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getEmployeeList);
List<SalaryArchivePO> list = null;
List<SalaryArchivePO> list = new ArrayList<>();
if (needAuth) {
// 获取作为管理员的所有个税扣缴义务人列表
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId);
@ -966,17 +958,23 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
long fixedTotal = 0L;
long suspendTotal = 0L;
long stopTotal = 0L;
long extTotal = 0L;
for (SalaryArchivePO sa : list) {
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
pendingTotal += 1;
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
fixedTotal += 1;
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
suspendTotal += 1;
Integer employeeType = sa.getEmployeeType();
if (employeeType == null || employeeType == 0) {
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
pendingTotal += 1;
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
fixedTotal += 1;
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
suspendTotal += 1;
}
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
stopTotal += 1;
}
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
stopTotal += 1;
} else {
extTotal += 1;
}
}
@ -984,6 +982,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
result.put(SalaryArchiveListTypeEnum.FIXED.getValue(), fixedTotal);
result.put(SalaryArchiveListTypeEnum.SUSPEND.getValue(), suspendTotal);
result.put(SalaryArchiveListTypeEnum.STOP.getValue(), stopTotal);
result.put(SalaryArchiveListTypeEnum.EXT.getValue(), extTotal);
return result;
}

View File

@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam;
import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO;
import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum;
import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum;
import com.engine.salary.mapper.taxagent.TaxAgentEmpMapper;
@ -56,11 +57,20 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
}
@Override
public List<TaxAgentEmpPO> listByTaxAgentIds(List<Long> taxAgentIds) {
public List<TaxAgentEmpPO> listByTaxAgentIds(List<Long> taxAgentIds, UseEmployeeTypeEnum type) {
if (CollectionUtils.isEmpty(taxAgentIds)) {
return Lists.newArrayList();
}
return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build());
TaxAgentEmpPO param = TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build();
if (type == UseEmployeeTypeEnum.ORG) {
param.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue());
}
if (type == UseEmployeeTypeEnum.EXT) {
param.setEmployeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue());
}
return getTaxAgentEmpMapper().listSome(param);
}
@Override
@ -69,7 +79,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
return;
}
List<Long> taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList());
List<TaxAgentEmpPO> taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds);
List<TaxAgentEmpPO> taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG);
Date now = new Date();
// 关联表
List<TaxAgentEmpPO> taxAgentEmployeeAddList = Lists.newArrayList();
@ -162,7 +172,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
return;
}
List<Long> taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList());
List<TaxAgentEmpPO> taxAgentEmployeeExistList = this.listExtByTaxAgentIds(taxAgentIds);
List<TaxAgentEmpPO> taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG);
Date now = new Date();
// 关联表
List<TaxAgentEmpPO> taxAgentEmployeeAddList = Lists.newArrayList();
@ -252,10 +262,4 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic
}
}
private List<TaxAgentEmpPO> listExtByTaxAgentIds(List<Long> taxAgentIds) {
if (CollectionUtils.isEmpty(taxAgentIds)) {
return Lists.newArrayList();
}
return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()).taxAgentIds(taxAgentIds).build());
}
}

View File

@ -21,6 +21,7 @@ import com.engine.salary.entity.taxagent.param.TaxAgentAdminChangeCheckParam;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.taxagent.param.TaxAgentSaveParam;
import com.engine.salary.entity.taxagent.po.*;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
import com.engine.salary.enums.taxagent.TaxAgentRoleTypeEnum;
@ -32,7 +33,6 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
import com.engine.salary.mapper.salarysob.SalarySobMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.*;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
@ -137,7 +137,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
return convert2TaxAgentEmployeePO(employees);
}
public List<TaxAgentEmployeePO> convert2TaxAgentEmployeePO(List<DataCollectionEmployee> dataCollectionEmployees){
public List<TaxAgentEmployeePO> convert2TaxAgentEmployeePO(List<DataCollectionEmployee> dataCollectionEmployees) {
List<TaxAgentEmployeePO> result = new ArrayList<>();
dataCollectionEmployees.stream().forEach(PO -> {
TaxAgentEmployeePO taxAgentEmployeePO = new TaxAgentEmployeePO();
@ -285,7 +285,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
List<TaxAgentPO> taxAgents = getTaxAgentMapper().listAll();
List<Long> taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
List<TaxAgentEmpPO> taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds);
List<TaxAgentEmpPO> taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG);
if (CollectionUtils.isEmpty(taxAgentEmployees)) {
return Lists.newArrayList();
@ -602,7 +602,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
List<Long> taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
List<TaxAgentEmployeePO> allEmployees =convert2TaxAgentEmployeePO(employees);
List<TaxAgentEmployeePO> allEmployees = convert2TaxAgentEmployeePO(employees);
if (employeeStatus != null) {
List<String> personnelStatusList;
// 查询人员状态
@ -626,13 +626,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
if (CollectionUtils.isNotEmpty(adminTaxAgentIds)) {
taxAgentManageRangeEmployeeList.addAll(getTaxAgentEmp(allTaxAgents, adminTaxAgentIds, allEmployees));
}
// 2.根据作为非管理员查找自己作为分管理员 对应的管理范围人员
List<Long> noAdminTaxAgentIds = allTaxAgents.stream()
.map(TaxAgentPO::getId)
.filter(id -> !adminTaxAgentIds.contains(id)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(noAdminTaxAgentIds)) {
// taxAgentManageRangeEmployeeList.addAll(getTaxAgentSubAdminEmp(allTaxAgents, noAdminTaxAgentIds, allEmployees));
}
return taxAgentManageRangeEmployeeList;
}
@ -720,7 +713,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
*/
private List<TaxAgentManageRangeEmployeeDTO> getTaxAgentEmp(List<TaxAgentPO> allTaxAgents, List<Long> taxAgentIds, List<TaxAgentEmployeePO> allEmployees) {
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeList = Lists.newArrayList();
List<TaxAgentEmpPO> taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds);
List<TaxAgentEmpPO> taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ALl);
taxAgentEmps = taxAgentEmps.stream().filter(f -> allEmployees.stream().anyMatch(e -> e.getEmployeeId().equals(f.getEmployeeId()))).collect(Collectors.toList());
@ -772,12 +765,4 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
return taxAgentEmployeeList;
}
@Override
public Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId) {
List<TaxAgentEmpPO> taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId));
return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId);
}
}

View File

@ -11,7 +11,6 @@ import com.engine.salary.wrapper.SalaryArchiveItemWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.login.AuthenticUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -21,10 +20,8 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Arrays;
import java.util.Map;
import java.util.Optional;
import java.util.Vector;
/**
* 福利报表
@ -70,7 +67,6 @@ public class SIReportController {
String pageSize = Optional.ofNullable(request.getParameter("pageSize")).orElse("10");
salaryItemAdjustRecordQueryParam.setCurrent(Integer.valueOf(current));
salaryItemAdjustRecordQueryParam.setPageSize(Integer.valueOf(pageSize));
getSalaryArchiveItemWrapper(user).adjustRecordList(salaryItemAdjustRecordQueryParam);
return new ResponseResult<SalaryItemAdjustRecordQueryParam, PageInfo<SalaryItemAdjustRecordListDTO>>(user).run(getSalaryArchiveItemWrapper(user)::adjustRecordList, salaryItemAdjustRecordQueryParam);
}
}

View File

@ -225,6 +225,7 @@ public class SalaryArchiveController {
/**
* 外部人员列表
*
* @param request
* @param response
* @param queryParam
@ -239,7 +240,6 @@ public class SalaryArchiveController {
}
/**
* 取消停薪
*
@ -411,9 +411,15 @@ public class SalaryArchiveController {
boolean isInit = SalaryArchiveImportTypeEnum.INIT.getValue().equals(queryParam.getImportType());
boolean isSalaryItemAdjust = SalaryArchiveImportTypeEnum.SALARYITEMADJUST.getValue().equals(queryParam.getImportType());
boolean isExtEmp = queryParam.isExtSalaryArchiveList();
// 名称
String finalNameI18n = SalaryI18nUtil.getI18nLabel(101601, "薪资档案导入模板-")
+ SalaryI18nUtil.getI18nLabel(listTypeEnum.getLabelId(), listTypeEnum.getDefaultLabel());
if (isExtEmp) {
finalNameI18n += "-非系统人员";
}
if (isFixedList) {
// 初始化
if (isInit) {
@ -496,6 +502,12 @@ public class SalaryArchiveController {
if (StringUtils.isNotBlank(listType)) {
param.setListType(SalaryArchiveListTypeEnum.parseByValue(listType));
}
//1标识外部人员
String extSalaryArchiveList = request.getParameter("extSalaryArchiveList");
extSalaryArchiveList ="1";
if (StringUtils.isNotBlank(extSalaryArchiveList)) {
param.setExtSalaryArchiveList("1".equals(extSalaryArchiveList));
}
return param;
}
@ -736,8 +748,8 @@ public class SalaryArchiveController {
/**
* @description 编辑前获取薪资项目调整信息
* @return String
* @description 编辑前获取薪资项目调整信息
* @author Harryxzy
* @date 2022/11/15 9:25
*/
@ -750,8 +762,8 @@ public class SalaryArchiveController {
}
/**
* @description 单个档案的薪资项目调整的编辑
* @return String
* @description 单个档案的薪资项目调整的编辑
* @author Harryxzy
* @date 2022/11/11 13:50
*/
@ -944,7 +956,6 @@ public class SalaryArchiveController {
/******** 个税扣缴义务人调整记录 end ***********************************************************************************************/
@GET
@Path("/handleRepeatData")
@Produces(MediaType.APPLICATION_JSON)

View File

@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveItemFormDTO;
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
import com.engine.salary.entity.salaryarchive.dto.SingleSalaryItemAdjustRecordListDTO;
@ -15,12 +16,8 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SalaryArchiveItemService;
import com.engine.salary.service.SalaryItemService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl;
import com.engine.salary.service.impl.SalaryItemServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.service.*;
import com.engine.salary.service.impl.*;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.proxy.SalaryArchiveItemWrapperProxy;
@ -56,6 +53,15 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
private SalaryArchiveService getSalaryArchiveService(User user) {
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
/**
* 构建薪资项目基础信息表单
*
@ -217,6 +223,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
List<SalaryItemPO> salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
List<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(queryParam.getEmployeeId());
List<SalaryItemAdjustRecordListDTO> listAll = getSalaryArchiveItemService(user).salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds);
PageInfo<SalaryItemAdjustRecordListDTO> list = getSalaryArchiveItemService(user).salaryItemAdjustRecordListPage(queryParam, salaryItemIds);
List<SalaryItemAdjustRecordListDTO> listResult = list.getList();
@ -228,7 +236,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
Optional<SalaryItemAdjustRecordListDTO> optional = listAll.stream().filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId()) && f.getSalaryItemId().equals(m.getSalaryItemId())).findFirst();
m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : "");
m.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(m.getEmployeeStatus())));
m.setUsername(employee.getUsername());
m.setDepartmentName(employee.getDepartmentName());
m.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(employee.getStatus())));
m.setAdjustReason(SalaryArchiveItemAdjustReasonEnum.getDefaultLabelByValue(m.getAdjustReason()));
});
@ -242,7 +252,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
* @return
*/
public PageInfo<SingleSalaryItemAdjustRecordListDTO> singleSalaryItemAdjustRecordList(SingleSalaryItemAdjustRecordQueryParam queryParam) {
if (queryParam.getSalaryArchiveId() == null) {
Long salaryArchiveId = queryParam.getSalaryArchiveId();
if (salaryArchiveId == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100425, "薪资档案id不能为空"));
}
// 获取所有可被引用的薪资项目
@ -266,8 +278,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
}
Optional<SalaryItemAdjustRecordListDTO> optional = listAll.stream()
.filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId()))
.filter(f ->f.getSalaryItemId().equals(m.getSalaryItemId()))
.filter(f->f.getEffectiveTime().before(m.getEffectiveTime()))
.filter(f -> f.getSalaryItemId().equals(m.getSalaryItemId()))
.filter(f -> f.getEffectiveTime().before(m.getEffectiveTime()))
.findFirst();
m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : "");
@ -279,7 +291,7 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
});
List<Long> salaryItemPageIds = resultList.stream().map(SingleSalaryItemAdjustRecordListDTO::getSalaryItemId).collect(Collectors.toList());
List<SalaryArchiveItemPO> effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(queryParam.getSalaryArchiveId(), salaryItemPageIds);
List<SalaryArchiveItemPO> effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(salaryArchiveId, salaryItemPageIds);
// 行记录按钮权限控制
for (int i = 0; i < resultList.size(); i++) {
SingleSalaryItemAdjustRecordListDTO singleSalaryItemAdjustRecord = resultList.get(i);

View File

@ -306,6 +306,7 @@ public class SalaryArchiveWrapper extends Service {
/**
* 外部人员
*
* @param queryParam
* @return
*/
@ -316,7 +317,6 @@ public class SalaryArchiveWrapper extends Service {
}
/**
* 获取薪资档案详情表单
*
@ -438,15 +438,17 @@ public class SalaryArchiveWrapper extends Service {
* @return
*/
public XSSFWorkbook downloadTemplate(SalaryArchiveQueryParam queryParam) {
if (queryParam.getListType() == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(109712, "列表类型必传"));
} else {
// 定薪列表导入有调薪导入和初始化导入
if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) {
Optional<SalaryArchiveImportTypeEnum> optional = Arrays.stream(SalaryArchiveImportTypeEnum.values())
.filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst();
if (!optional.isPresent()) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "导入类型不正确"));
if(!queryParam.isExtSalaryArchiveList()){
if (queryParam.getListType() == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(109712, "列表类型必传"));
} else {
// 定薪列表导入有调薪导入和初始化导入
if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) {
Optional<SalaryArchiveImportTypeEnum> optional = Arrays.stream(SalaryArchiveImportTypeEnum.values())
.filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst();
if (!optional.isPresent()) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "导入类型不正确"));
}
}
}
}