1、批量插入报表支持oracle

2、累计、往期返聘人员适配
This commit is contained in:
钱涛 2022-08-16 10:39:45 +08:00
parent ddccbb0d78
commit a7c022f38d
5 changed files with 137 additions and 3 deletions

View File

@ -16,6 +16,14 @@ public interface SalaryAcctResultReportMapper {
*/
List<SalaryAcctResultReportPO> listSome(SalaryAcctResultReportPO salaryAcctResultReportPO);
/**
* 新增忽略null字段
*
* @param salaryAcctResultReport 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(SalaryAcctResultReportPO salaryAcctResultReport);
/**
* 删除记录

View File

@ -115,6 +115,124 @@
</select>
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.report.po.SalaryAcctResultReportPO">
INSERT INTO hrsa_salary_acct_result_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="costcenterId != null">
costcenter_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="departmentId != null">
department_id,
</if>
<if test="employeeId != null">
employee_id,
</if>
<if test="id != null">
id,
</if>
<if test="jobtitleId != null">
jobtitle_id,
</if>
<if test="locationId != null">
location_id,
</if>
<if test="resultValue != null">
result_value,
</if>
<if test="salaryAcctEmpId != null">
salary_acct_emp_id,
</if>
<if test="salaryAcctRecordId != null">
salary_acct_record_id,
</if>
<if test="salaryItemId != null">
salary_item_id,
</if>
<if test="salarySobId != null">
salary_sob_id,
</if>
<if test="subcompanyId != null">
subcompany_id,
</if>
<if test="taxAgentId != null">
tax_agent_id,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="costcenterId != null">
#{costcenterId},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="departmentId != null">
#{departmentId},
</if>
<if test="employeeId != null">
#{employeeId},
</if>
<if test="id != null">
#{id},
</if>
<if test="jobtitleId != null">
#{jobtitleId},
</if>
<if test="locationId != null">
#{locationId},
</if>
<if test="resultValue != null">
#{resultValue},
</if>
<if test="salaryAcctEmpId != null">
#{salaryAcctEmpId},
</if>
<if test="salaryAcctRecordId != null">
#{salaryAcctRecordId},
</if>
<if test="salaryItemId != null">
#{salaryItemId},
</if>
<if test="salarySobId != null">
#{salarySobId},
</if>
<if test="subcompanyId != null">
#{subcompanyId},
</if>
<if test="taxAgentId != null">
#{taxAgentId},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<!-- 根据主键删除记录 -->
<delete id="delete" parameterType="com.engine.salary.entity.report.po.SalaryAcctResultReportPO">
UPDATE hrsa_salary_acct_result_report
@ -287,7 +405,7 @@
<delete id="deleteByAcctEmpIdsAndSalaryItemIds">
DELETE FROM hrsa_salary_acct_result_report
WHERE delete_type = 0
WHERE delete_type = 0
AND salary_acct_emp_id IN
<foreach collection="salaryAcctEmpIds" open="(" item="salaryAcctEmpId" separator="," close=")">
#{salaryAcctEmpId}

View File

@ -255,6 +255,9 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
errorMessageMap.put("message", rowIndex + "员工信息不能为空且不可重复(姓名与部门同时确认唯一)");
errorData.add(errorMessageMap);
errorSum += 1;
}else{
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
addUpDeduction.setEmployeeId(employeeId);
}
} else {
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;

View File

@ -641,6 +641,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
errorMessageMap.put("message", rowIndex + "员工信息不能为空且不可重复(姓名与部门同时确认唯一)");
errorData.add(errorMessageMap);
errorSum += 1;
}else {
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
po.setEmployeeId(employeeId);
}
} else {
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;

View File

@ -62,8 +62,10 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
public void batchSave(Collection<SalaryAcctResultReportPO> pos) {
if (CollectionUtils.isNotEmpty(pos)) {
SalaryAcctResultReportPOEncrypt.encryptList(pos);
List<List<SalaryAcctResultReportPO>> partition = Lists.partition((List) pos, 100);
partition.forEach(getSalaryAcctResultReportMapper()::batchInsert);
// List<List<SalaryAcctResultReportPO>> partition = Lists.partition((List) pos, 100);
// partition.forEach(getSalaryAcctResultReportMapper()::batchInsert);
pos.forEach(getSalaryAcctResultReportMapper()::insertIgnoreNull);
}
}