Compare commits

..

31 Commits

Author SHA1 Message Date
dxfeng 0cea01300d 社保福利台账 导出功能增加筛选条件,工号、部门、分部 2025-12-17 10:05:29 +08:00
钱涛 7acdc94380 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-12-05 14:18:59 +08:00
钱涛 b83a916610 修复null 2025-12-05 14:18:39 +08:00
钱涛 e7923a2486 修复业务线查询 2025-12-03 17:34:05 +08:00
钱涛 eebfa5ec3f Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-12-02 14:56:21 +08:00
钱涛 10a11dcca4 处理社保补缴手动填写异常 2025-12-02 14:55:50 +08:00
钱涛 cf68e118fa Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-12-02 10:22:35 +08:00
钱涛 cb423962a2 报表穿透,按照薪资所属月排序 2025-12-02 10:22:14 +08:00
钱涛 d1abbad832 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-11-28 17:48:21 +08:00
钱涛 00fc87ffd8 修复生成年终奖申报表null 2025-11-28 15:41:42 +08:00
钱涛 5377a472cc 社保方案更新日志 2025-11-26 17:20:17 +08:00
钱涛 9f0c00ef25 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-11-24 17:20:43 +08:00
钱涛 85e0b85871 批量操作 2025-11-24 17:20:11 +08:00
钱涛 84e57edee1 常见sql 2025-11-18 17:52:26 +08:00
钱涛 37ff12bf6a 报表 2025-11-18 09:34:24 +08:00
钱涛 4b717e9b2c Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-11-13 11:38:08 +08:00
钱涛 6a061592e5 处理pg脚本 2025-11-13 11:37:46 +08:00
钱涛 20bd294397 考勤引用数据范围100 2025-11-12 14:57:46 +08:00
钱涛 44b5113ae9 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-11-06 11:28:17 +08:00
钱涛 e6a474261c 补缴信息提示优化 2025-11-06 11:27:41 +08:00
钱涛 e537107538 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-11-03 13:36:55 +08:00
钱涛 3dd8db37dc 账套sql类型的人员范围接入状态 2025-11-03 13:35:06 +08:00
钱涛 0a1acc89d3 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-10-29 15:46:38 +08:00
钱涛 b4994dab3f 常用sql 2025-10-29 15:46:24 +08:00
钱涛 310be11f43 Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-10-27 11:23:09 +08:00
钱涛 f1bd47f8b7 修复核算多条件问题 2025-10-27 11:22:51 +08:00
钱涛 a74227f12a action日志 2025-10-23 10:44:50 +08:00
钱涛 038fac392c Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-10-21 16:56:09 +08:00
钱涛 953a590cca 常用sql 2025-10-21 16:55:42 +08:00
钱涛 9205c736ba Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01 2025-10-17 17:29:50 +08:00
钱涛 014cdd7618 增加有序map 2025-10-17 17:29:31 +08:00
37 changed files with 332 additions and 87 deletions

View File

@ -1,41 +1,42 @@
CREATE TABLE hrsa_hrm_snapshot (
ID bigint(0) NOT NULL,
CREATE TABLE hrsa_hrm_snapshot
(
ID bigint NOT NULL,
snapshot_time timestamp,
employee_id bigint(0),
employee_id bigint,
loginid varchar(100),
LASTNAME varchar(60),
SEX char(1),
BIRTHDAY char(10) ,
NATIONALITY int(0) ,
NATIONALITY int ,
MARITALSTATUS char(1) ,
TELEPHONE varchar(60),
MOBILE varchar(60) ,
MOBILECALL varchar(60) ,
EMAIL varchar(60),
LOCATIONID int(0),
LOCATIONID int,
WORKROOM varchar(60),
HOMEADDRESS varchar(100),
RESOURCETYPE char(1) ,
STARTDATE char(10) ,
ENDDATE char(10),
JOBTITLE int(0) ,
JOBTITLE int ,
JOBTITLENAME varchar(200) ,
JOBACTIVITYDESC varchar(200),
JOBLEVEL int(0) ,
SECLEVEL int(0) ,
DEPARTMENTID int(0) ,
JOBLEVEL int ,
SECLEVEL int ,
DEPARTMENTID int ,
DEPARTMENTNAME varchar(200) ,
SUBCOMPANYID1 int(0) ,
SUBCOMPANYID1 int ,
SUBCOMPANYNAME varchar(200) ,
COSTCENTERID int(0) ,
MANAGERID int(0) ,
ASSISTANTID int(0),
BANKID1 int(0) ,
COSTCENTERID int ,
MANAGERID int ,
ASSISTANTID int,
BANKID1 int ,
ACCOUNTID1 varchar(100) ,
LASTLOGINDATE char(10) ,
CERTIFICATENUM varchar(60) ,
NATIVEPLACE varchar(100) ,
EDUCATIONLEVEL int(0) ,
EDUCATIONLEVEL int ,
BEMEMBERDATE char(10) ,
BEPARTYDATE char(10) ,
WORKCODE varchar(60) ,
@ -44,8 +45,8 @@ CREATE TABLE hrsa_hrm_snapshot (
RESIDENTPLACE varchar(200) ,
POLICY varchar(30) ,
DEGREE varchar(30) ,
USEKIND int(0) ,
JOBCALL int(0) ,
USEKIND int ,
JOBCALL int ,
jobcallname varchar(200) ,
ACCUMFUNDACCOUNT varchar(30),
BIRTHPLACE varchar(60) ,
@ -54,14 +55,14 @@ CREATE TABLE hrsa_hrm_snapshot (
RESIDENTPOSTCODE varchar(60) ,
EXTPHONE varchar(50) ,
MANAGERSTR varchar(500),
STATUS int(0) ,
STATUS int ,
FAX varchar(60) ,
ISLABOUUNION char(1),
TEMPRESIDENTNUMBER varchar(60),
PROBATIONENDDATE char(10),
COUNTRYID int(0) ,
ACCOUNTTYPE int(0) ,
BELONGTO int(0) ,
COUNTRYID int ,
ACCOUNTTYPE int ,
BELONGTO int ,
ACCOUNTNAME varchar(200) ,
companystartdate varchar(10),
workstartdate varchar(10) ,

View File

@ -18,7 +18,8 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人
二、删除停薪员工档案
update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive set delete_type=3 where delete_type=0 and run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive_item set delete_type=3 where delete_type=0
二、删除停薪员工社保档案
update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
@ -28,10 +29,10 @@ update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
--删除社保福利档案
update hrsa_insurance_base_info set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_insurance_base_info set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
-- 删除薪资档案
update hrsa_salary_archive set delete_type=3 where employee_id = ? and tax_agent_id=?
@ -45,4 +46,13 @@ update hrsa_other_archives set delete_type=3;
update hrsa_tax_agent_emp set delete_type=3;
-- 删除核算记录
update hrsa_salary_acct_record set delete_type=3 where delete_type=0 and id= 核算记录id;
update hrsa_salary_acct_emp set delete_type=3 where delete_type=0 and salary_acct_record_id=核算记录id;
update hrsa_salary_acct_result set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;
--删除工资单信息
update hrsa_salary_send set delete_type=3 where delete_type=0 and salary_accounting_id = 核算记录id;
update hrsa_salary_send_info set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id;

View File

@ -1,3 +1,5 @@
## 薪资档案生成不了
select id from hrsa_tax_agent_emp
where tax_agent_id =扣缴义务人id
and delete_type = 0
@ -6,5 +8,14 @@ and employee_id not in
where tax_agent_id =扣缴义务人id and delete_type = 0)
update hrsa_tax_agent_emp set delete_type = 3
update hrsa_tax_agent_emp set delete_type = 3 where delete_type = 0
where tax_agent_id=扣缴义务人id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =扣缴义务人id and delete_type = 0)
## 考勤引用
drop sequence HRSA_ATTEND_QUOTE_ID
/
drop trigger HRSA_ATTEND_QUOTE_TRI
/

View File

@ -80,6 +80,8 @@ public class CheckEditSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, CheckEditSIArchiveAction.SalaryField::getSalaryName, CheckEditSIArchiveAction.SalaryField::getValue));
log.info("CheckEditSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = list.stream().filter(f -> f.salaryName.equals("档案状态")).findFirst().map(CheckEditSIArchiveAction.SalaryField::getValue).orElse("1");

View File

@ -78,6 +78,7 @@ public class CheckEditSalaryAction implements Action {
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
log.info("CheckEditSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
.importDatas(importData)
.build();

View File

@ -98,7 +98,7 @@ public class CheckInitSalaryAction implements Action {
list.add(new SalaryField(processField, salaryName, value));
}
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("CheckInitSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
return doSalaryArchiveInit(requestInfo, importDataMap);
} catch (Exception e) {
log.error("定薪检查异常", e);

View File

@ -89,6 +89,7 @@ public class CheckStayAddToPaySIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStayAddToPaySIArchiveAction.SalaryField::getSalaryName, CheckStayAddToPaySIArchiveAction.SalaryField::getValue);
log.info("CheckStayAddToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -88,6 +88,7 @@ public class CheckStayDelToStopSIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStayDelToStopSIArchiveAction.SalaryField::getSalaryName, CheckStayDelToStopSIArchiveAction.SalaryField::getValue);
log.info("CheckStayDelToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -92,6 +92,7 @@ public class CheckStopSalaryAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStopSalaryAction.SalaryField::getSalaryName, CheckStopSalaryAction.SalaryField::getValue);
log.info("CheckStopSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -88,6 +88,7 @@ public class CopyToPaySIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, CopyToPaySIArchiveAction.SalaryField::getSalaryName, CopyToPaySIArchiveAction.SalaryField::getValue));
log.info("CopyToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//操作人
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(CopyToPaySIArchiveAction.SalaryField::getValue).orElse("1");
//增员

View File

@ -79,6 +79,7 @@ public class EditSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditSIArchiveAction.SalaryField::getSalaryName, EditSIArchiveAction.SalaryField::getValue));
log.info("EditSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = list.stream().filter(f -> f.salaryName.equals("档案状态")).findFirst().map(EditSIArchiveAction.SalaryField::getValue).orElse("1");

View File

@ -77,7 +77,7 @@ public class EditSalaryAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
log.info("EditSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
.importDatas(importData)
.build();

View File

@ -97,6 +97,7 @@ public class EditToPaySIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditToPaySIArchiveAction.SalaryField::getSalaryName, EditToPaySIArchiveAction.SalaryField::getValue));
log.info("EditToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = EmployeeStatusEnum.STAY_ADD.getValue();

View File

@ -97,6 +97,7 @@ public class EditToStopSIArchiveAction implements Action {
}
List<Map<String, Object>> importData = new ArrayList<>();
importData.add(SalaryEntityUtil.convert2Map(list, EditToStopSIArchiveAction.SalaryField::getSalaryName, EditToStopSIArchiveAction.SalaryField::getValue));
log.info("EditToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importData);
//福利执行状态
String runStatus = EmployeeStatusEnum.PAYING.getValue();

View File

@ -100,7 +100,7 @@ public class InitSalaryAction implements Action {
}
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("InitSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
return doSalaryArchiveInit(requestInfo, importDataMap);
} catch (Exception e) {
log.error("定薪异常", e);

View File

@ -108,6 +108,7 @@ public class RehireAction implements Action {
list.add(new SalaryField(processField, salaryName, value));
}
Map<String, Object> salaryFieldMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
log.info("RehireActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), salaryFieldMap);
String taxAgentName = salaryFieldMap.getOrDefault("个税扣缴义务人", "").toString();
String empIdStr = salaryFieldMap.getOrDefault("员工id", "").toString();
if (StringUtils.isBlank(taxAgentName) || StringUtils.isBlank(empIdStr)) {

View File

@ -93,6 +93,7 @@ public class StayAddToPaySIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StayAddToPaySIArchiveAction.SalaryField::getSalaryName, StayAddToPaySIArchiveAction.SalaryField::getValue);
log.info("StayAddToPaySIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -94,6 +94,7 @@ public class StayDelToStopSIArchiveAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StayDelToStopSIArchiveAction.SalaryField::getSalaryName, StayDelToStopSIArchiveAction.SalaryField::getValue);
log.info("StayDelToStopSIArchiveActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){

View File

@ -99,6 +99,7 @@ public class StopSalaryAction implements Action {
}
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StopSalaryAction.SalaryField::getSalaryName, StopSalaryAction.SalaryField::getValue);
log.info("StopSalaryActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
//操作人
String uid = importDataMap.getOrDefault("操作人","1").toString();
User user = new User(Integer.parseInt(uid));

View File

@ -117,6 +117,7 @@ public class UpdateSISchemeDetailAction implements Action {
rs.beforFirst();
// 流程数据
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, UpdateSISchemeDetailAction.SalaryField::getSalaryName, UpdateSISchemeDetailAction.SalaryField::getValue);
log.info("UpdateSISchemeDetailActiontableName {}workflowid{},流程参数:{}",tableName, requestInfo.getWorkflowid(), importDataMap);
//设置更新对象元素
String schemeId = importDataMap.getOrDefault("福利方案id", "").toString();
String schemeName = importDataMap.getOrDefault("福利方案名称", "").toString();

View File

@ -45,4 +45,6 @@ public class InsuranceExportParam extends BaseQueryParam {
private List<Long> taxAgents;
private String workcode;
private List<Long> departmentIds;
private List<Long> subCompanyIds;
}

View File

@ -723,6 +723,7 @@ public class TaxDeclarationBO {
private static String findStringValue(String fieldCode, Map<Long, List<SalaryAcctResultPO>> resultMap, Map<String, Long> salaryItemMap) {
return resultMap.getOrDefault(salaryItemMap.getOrDefault(fieldCode, 0L), Collections.emptyList()).stream()
.map(SalaryAcctResultPO::getResultValue)
.filter(Objects::nonNull)
.findFirst().orElse("");
}

View File

@ -23,6 +23,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -51,6 +52,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -79,6 +81,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -96,6 +99,7 @@
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
<include refid="paramSql"/>
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
@ -108,6 +112,7 @@
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
<include refid="paramSql"/>
</select>
<select id="exportExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
@ -120,6 +125,7 @@
LEFT JOIN hrmresource e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
where e.status not in (7)
<include refid="paramSql"/>
</select>
@ -147,6 +153,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -176,6 +183,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -205,6 +213,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where e.status not in (7)
<include refid="paramSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -233,6 +242,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.department_id
LEFT JOIN hrmsubcompany c ON c.id = e.subcompany_id
where e.status not in (7)
<include refid="extParamSql"/>
<!-- 排序 -->
</select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
@ -256,6 +266,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.department_id
LEFT JOIN hrmsubcompany c ON c.id = e.subcompany_id
where e.status not in (7)
<include refid="extParamSql"/>
<!-- 排序 -->
</select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
@ -279,6 +290,7 @@
LEFT JOIN hrmdepartment d ON d.id = e.department_id
LEFT JOIN hrmsubcompany c ON c.id = e.subcompany_id
where e.status not in (7)
<include refid="extParamSql"/>
<!-- 排序 -->
</select>
@ -293,6 +305,7 @@
LEFT JOIN hrsa_external_employee e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.department_id
where e.status not in (7)
<include refid="extParamSql"/>
</select>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
SELECT
@ -305,6 +318,7 @@
LEFT JOIN hrsa_external_employee e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.department_id
where e.status not in (7)
<include refid="extParamSql"/>
</select>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
SELECT
@ -317,5 +331,113 @@
LEFT JOIN hrsa_external_employee e ON e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.department_id
where e.status not in (7)
<include refid="extParamSql"/>
</select>
<sql id="paramSql">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like CONCAT('%',#{param.workcode},'%')
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompanyid1 IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
<sql id="paramSql" databaseId="oracle">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'||#{param.workcode}||'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompanyid1 IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
<sql id="paramSql" databaseId="sqlserver">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'+#{param.workcode}+'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompanyid1 IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
<sql id="extParamSql">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like CONCAT('%',#{param.workcode},'%')
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompany_id IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
<sql id="extParamSql" databaseId="oracle">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'||#{param.workcode}||'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompany_id IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
<sql id="extParamSql" databaseId="sqlserver">
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'+#{param.workcode}+'%'
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
#{departmentId}
</foreach>
</if>
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompany_id IN
<foreach collection="param.subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
#{subCompanyId}
</foreach>
</if>
</sql>
</mapper>

View File

@ -11,7 +11,6 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
@ -31,6 +30,8 @@ import com.engine.salary.service.*;
import com.engine.salary.service.auth.AuthService;
import com.engine.salary.service.auth.AuthServiceImpl;
import com.engine.salary.service.impl.*;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
@ -49,6 +50,8 @@ import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
import static com.engine.salary.sys.constant.SalarySysConstant.REPORT_ORGANIZATIN_TYPE;
/**
* 薪酬统计员工明细
* <p>Copyright: Copyright (c) 2022</p>
@ -103,6 +106,11 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
return ServiceUtil.getService(SettingServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private final boolean isRealOrg = "1".equals(getSalarySysConfService(user).getValueByCode(REPORT_ORGANIZATIN_TYPE));
@Override
public PageInfo<SalaryStatisticsEmployeeListDTO> listPage(SalaryStatisticsEmployeeQueryParam queryParam) {
List<SalaryStatisticsEmployeeListDTO> list = Collections.emptyList();
@ -262,13 +270,21 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
map.put("salarySob", SalarySobMap.get(se.getSalarySobId()));
map.put("acctTimes", salaryAcctRecordMap.get(se.getSalaryAcctRecordId()));
map.put("userName", Util.null2String(emp.getUsername()));
map.put("workCode", Util.null2String(emp.getWorkcode()));
map.put("idNo", Util.null2String(emp.getIdNo()));
map.put("companystartdate", Util.null2String(emp.getCompanystartdate()));
if(isRealOrg){
map.put("subCompany", Util.null2String(emp.getSubcompanyName()));
map.put("department", Util.null2String(emp.getDepartmentName()));
map.put("jobTitle", Util.null2String(emp.getJobtitleName()));
map.put("status", Util.null2String(NumberUtil.isNumber(emp.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(emp.getStatus())).getDefaultLabel() : null));
map.put("workCode", Util.null2String(emp.getWorkcode()));
map.put("idNo", Util.null2String(emp.getIdNo()));
map.put("companystartdate", Util.null2String(emp.getCompanystartdate()));
}else {
map.put("subCompany", Util.null2String(se.getSubcompanyName()));
map.put("department", Util.null2String(se.getDepartmentName()));
map.put("jobTitle", Util.null2String(se.getJobtitleName()));
map.put("status", Util.null2String(NumberUtil.isNumber(se.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(se.getStatus())).getDefaultLabel() : null));
}
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
// map.put("incomeCategory", Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));

View File

@ -525,7 +525,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
throw new SalaryRunTimeException("该维度值中无数据!");
}
// 同一个人放在一起
listByDimensionValue = listByDimensionValue.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getEmployeeId)).collect(Collectors.toList());
listByDimensionValue = listByDimensionValue.stream().sorted((a,b)-> b.getSalaryMonth().compareTo(a.getSalaryMonth())).collect(Collectors.toList());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOList = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), listByDimensionValue);
// 获取此分页的核算人员

View File

@ -1,6 +1,7 @@
package com.engine.salary.service.auth;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrmelog.entity.dto.LoggerContext;
@ -63,6 +64,12 @@ public class AuthRoleServiceImpl extends Service implements AuthRoleService {
public PageInfo<AuthRoleDTO> roleList(AuthRoleListQueryParam param) {
List<AuthRolePO> authRolePOS = getAuthRoleMapper().list(param);
String name = param.getName();
if(StrUtil.isNotBlank(name)){
authRolePOS = authRolePOS.stream().filter(po -> po.getName().contains(name)).collect(Collectors.toList());
}
int total = authRolePOS.size();
List<AuthRoleDTO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), authRolePOS)

View File

@ -519,7 +519,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<Map<String, Object>> attendQuoteSyncData = new ArrayList<>();
Attend4Salary attend4Salary = new Attend4Salary();
try {
int partSize = 500;
int partSize = 100;
List<List<Long>> partition = Lists.partition(employeeIds, partSize);
for (List<Long> part : partition) {
attend4Salary.setBeginDate(attendCycleRange.getFromDate());

View File

@ -93,7 +93,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
Map<Long, DataCollectionEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity()));
list.forEach(item -> {
Map<String, Object> record = new HashMap<>();
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId());
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId()) ==null?new DataCollectionEmployee():collect.get(item.getEmployeeId());
record.put("id", item.getId());
record.put("employeeId", item.getEmployeeId());
record.put("billMonth", item.getBillMonth());

View File

@ -1666,7 +1666,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
// Long taxAgentId = 0L;
List<InsuranceAccountDetailPO> list = new ArrayList<>();
String username = (String) map.getOrDefault("姓名", "");
String billMonth = (String) map.getOrDefault("账单月份", "");
String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", "");
String supplementaryMonth = (String) map.getOrDefault("补缴月份", "");
@ -1770,11 +1770,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//校验补缴人员是否存在福利档案基础信息并且runStatus处于正在缴纳或者待减员
InsuranceArchivesBaseInfoPO insuranceBaseInfo = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(paymentOrganization, employeeId);
if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) ) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补缴人员中存在未设置福利档案人员或相关人员不在福利在缴人员中,不可新建补缴信息!"));
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(0, "补缴未设置福利档案人员或不在福利在缴人员中,不可新建补缴信息!"));
}
List<Long> empIdsInPayMonthRange = listCanPayEmpIds(paymentOrganization, billMonth.substring(0, 7));
if (!empIdsInPayMonthRange.contains(employeeId)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
}
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
// 封装InsuranceAccountDetailPO

View File

@ -485,8 +485,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
if(socialComMap !=null){
socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());

View File

@ -2473,6 +2473,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
* @param employeeId
*/
public String update(InsuranceSchemeReqParam updateParam, long employeeId) {
log.info("福利方案更新参数:{}", updateParam);
//查询是否存在福利方案
InsuranceSchemePO insuranceSchemePO = getById(updateParam.getInsuranceScheme().getId());
if (Objects.isNull(insuranceSchemePO)) {
@ -2506,6 +2507,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//更新福利方案主表
InsuranceSchemePO insuranceSchemePO1 = InsuranceSchemeBO.buildInsuranceSchemePO(insuranceSchemePO, updateParam.getInsuranceScheme());
getInsuranceSchemeMapper().update(insuranceSchemePO1);
log.info("福利方案更新主表:{}", insuranceSchemePO1);
//记录主表操作日志
loggerContext.setNewValues(insuranceSchemePO1);
SalaryElogConfig.siSchemeLoggerTemplate.write(loggerContext);
@ -2529,6 +2531,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//更新福利方案明细表 先删后插
getInsuranceSchemeDetailMapper().batchDeleteByPrimaryIds(Collections.singleton(updateParam.getInsuranceScheme().getId()));
//更新明细表
log.info("福利方案更新明细表:{}", insuranceSchemeDetailPOS);
encryptUtil.encryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
insuranceSchemeDetailPOS.forEach(getInsuranceSchemeDetailMapper()::insert);

View File

@ -326,14 +326,25 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
if (CollectionUtils.isNotEmpty(otherConditions)) {
List<Long> items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList());
List<SalaryAcctResultPO> list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items);
Map<Long, List<SalaryAcctResultPO>> acctEmpResultsMap = SalaryEntityUtil.group2Map(list, SalaryAcctResultPO::getSalaryAcctEmpId);
Set<Long> removeAcctEmpIds = new HashSet<>();
for (Long acctEmpId : acctEmpResultsMap.keySet()) {
List<SalaryAcctResultPO> acctEmpResults = acctEmpResultsMap.get(acctEmpId);
//如果有一个条件不成立就删除
for (int i = 0; i < otherConditions.size(); i++) {
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
Long itemId = otherCondition.getItemId();
FilterEnum filter = otherCondition.getFilter();
List<String> params = otherCondition.getParams();
list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList());
for (SalaryAcctResultPO po : acctEmpResults) {
if(Objects.equals(po.getSalaryItemId(), itemId) && !filter.filter(params).test(po.getResultValue())){
removeAcctEmpIds.add(po.getSalaryAcctEmpId());
}
List<Long> salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList());
}
}
}
acctEmpResultsMap.keySet().removeAll(removeAcctEmpIds);
List<Long> salaryAcctEmpId = Lists.newArrayList(acctEmpResultsMap.keySet());
if (CollectionUtils.isEmpty(salaryAcctEmpId)) {
//条件不满足直接返回空列表

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -418,10 +419,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
result.addAll(employBiz.listByVirtualParams(virtualParams));
for (SalarySobRangeEmpQueryParam param:includeQueryParams) {
if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){
List<Long> empIds = new ArrayList<>();
includeQueryParams.stream()
.filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name()))
.forEach(param -> {
String sql = param.getTarget();
RecordSet rs = new RecordSet();
if (rs.execute(sql)) {
@ -429,9 +429,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
empIds.add((long) rs.getInt("id"));
}
}
});
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
result.addAll(employees);
if(CollUtil.isNotEmpty(empIds)){
Collection<String> employeeStatus = param.getEmployeeStatus();
List<DataCollectionEmployee> employeeByIdsAll = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds);
List<DataCollectionEmployee> collect = employeeByIdsAll.stream().filter(e -> employeeStatus.contains(e.getStatus())).collect(Collectors.toList());
result.addAll(collect);
}
}
}
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据需要根据人员id去重
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));

View File

@ -135,6 +135,15 @@ public class SalaryEntityUtil {
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a));
}
public static <T, K, V> Map<K, V> convert2LinkedMap(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();
}
return objs.stream()
.filter(e -> valueMapper.apply(e) != null && keyMapper.apply(e) != null)
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a, LinkedHashMap::new));
}
public static <R, T> Map<R, List<T>> group2Map(Collection<T> objs, Function<T, R> function) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();

View File

@ -112,8 +112,14 @@ public class SIExportController {
@Path("/common/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportAccount(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("billMonth") String billMonth,@QueryParam("paymentOrganization") String paymentOrganization) {
InsuranceExportParam param = InsuranceExportParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization).build();
@QueryParam("billMonth") String billMonth,@QueryParam("paymentOrganization") String paymentOrganization,@QueryParam("departmentIds") String departmentIds,@QueryParam("subCompanyIds") String subCompanyIds,@QueryParam("workcode") String workcode) {
InsuranceExportParam param = InsuranceExportParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization).workcode(workcode).build();
if(StringUtils.isNotBlank(departmentIds)){
param.setDepartmentIds(Arrays.stream(departmentIds.split(",")).map(Long::parseLong).collect(Collectors.toList()));
}
if(StringUtils.isNotBlank(subCompanyIds)){
param.setSubCompanyIds(Arrays.stream(subCompanyIds.split(",")).map(Long::parseLong).collect(Collectors.toList()));
}
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getSIExportWrapper(user).exportAccount(PaymentStatusEnum.COMMON.getValue(),param);
String time = LocalDate.now().toString();

View File

@ -485,7 +485,7 @@ public class SalaryBillController {
@Produces(MediaType.APPLICATION_JSON)
public String batGrant(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySendBatParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::batGrant, queryParam);
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batGrant, queryParam);
}
/**
@ -499,7 +499,7 @@ public class SalaryBillController {
@Produces(MediaType.APPLICATION_JSON)
public String batWithdraw(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendBatParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySendBatParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::batWithdraw, queryParam);
return new ResponseResult<SalarySendBatParam, String>(user).run(getSalarySendWrapper(user)::batWithdraw, queryParam);
}

View File

@ -688,6 +688,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
/**
* 发送短信验证码
*
* @param param 短信验证码发送参数
*/
public void sendMobileCode(SMSCodeSendParam param) {
@ -696,6 +697,7 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
/**
* 校验短信验证码
*
* @param param
* @return
*/
@ -740,26 +742,48 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
}
public void batGrant(SalarySendBatParam param) {
public String batGrant(SalarySendBatParam param) {
List<Long> salarySendIds = param.getSalarySendIds();
int successCount = 0;
int failCount = 0;
String failMsg = "";
for (int i = 0; i < salarySendIds.size(); i++) {
try {
Long sendId = salarySendIds.get(i);
SalarySendGrantParam grantParam = SalarySendGrantParam.builder()
.salarySendId(sendId)
.build();
grant(grantParam);
successCount++;
} catch (Exception e) {
failCount++;
failMsg = failMsg + "" + (i + 1) + "个发放失败!失败原因:" + e.getMessage() + "\n";
}
}
public void batWithdraw(SalarySendBatParam param) {
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
}
public String batWithdraw(SalarySendBatParam param) {
List<Long> salarySendIds = param.getSalarySendIds();
int successCount = 0;
int failCount = 0;
String failMsg = "";
for (int i = 0; i < salarySendIds.size(); i++) {
try {
Long sendId = salarySendIds.get(i);
SalarySendWithdrawParam grantParam = SalarySendWithdrawParam.builder()
.salarySendId(sendId)
.build();
withdraw(grantParam);
}
} catch (Exception e) {
failCount++;
failMsg = failMsg + "" + (i + 1) + "个撤回失败!失败原因:" + e.getMessage() + "\n";
}
}
return String.format("成功:" + successCount + "个,失败:" + failCount + "个%s", failCount == 0 ? "" : ",失败原因:" + failMsg);
}
}