Merge remote-tracking branch 'origin/feature/人员信息快照' into custom/宁波精华

# Conflicts:
#	resource/WEB-INF/prop/hrmSalary.properties
This commit is contained in:
Harryxzy 2024-06-18 17:41:51 +08:00
commit 7e7ff97e7a
66 changed files with 1480 additions and 132 deletions

View File

@ -1,5 +1,5 @@
log=false
defaultCloseNonStandard149=true
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
version=2.14.2.240530.02
version=2.14.3.2406.01
openFormulaForcedEditing=false

View File

@ -0,0 +1,27 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
/
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add department_id NUMBER null;
/
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
/

View File

@ -0,0 +1,70 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
);
/

View File

@ -0,0 +1,27 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
/
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add department_id NUMBER null;
/
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
/

View File

@ -0,0 +1,70 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
);
/

View File

@ -0,0 +1,27 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
/
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add department_id NUMBER null;
/
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
/

View File

@ -0,0 +1,70 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
);
/

View File

@ -0,0 +1,10 @@
ALTER TABLE hrsa_salary_acct_emp
ADD COLUMN subcompany_name varchar(200) ,
ADD COLUMN subcompany_id bigint(0),
ADD COLUMN department_name varchar(200),
ADD COLUMN department_id bigint(0),
ADD COLUMN jobtitle_name varchar(200) ,
ADD COLUMN jobtitle_id bigint(0) ,
ADD COLUMN jobcall varchar(200),
ADD COLUMN jobcall_id bigint(0),
ADD COLUMN status varchar(200);

View File

@ -0,0 +1,29 @@
update hrsa_salary_acct_emp a INNER JOIN (
select e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) as b
on a.employee_id = b.employeeId
set a.department_id = b.departmentId,
a.department_name = b.departmentName,
a.subcompany_id = b.subcompanyid,
a.subcompany_name = b.subcompanyName,
a.jobtitle_id = b.jobtitleId,
a.jobtitle_name = b.jobtitleName,
a.jobcall_id = b.jobcallId,
a.jobcall = b.jobcall,
a.status = b.status
where a.delete_type=0;

View File

@ -0,0 +1,18 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL
/
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null
/
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL
/
alter table hrsa_salary_acct_emp add department_id NUMBER null
/
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL
/
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL
/
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL
/
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL
/
alter table hrsa_salary_acct_emp add status varchar2(200) NULL
/

View File

@ -0,0 +1,69 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
/

View File

@ -0,0 +1,9 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar(200);
alter table hrsa_salary_acct_emp add subcompany_id bigint;
alter table hrsa_salary_acct_emp add department_name varchar(200);
alter table hrsa_salary_acct_emp add department_id bigint;
alter table hrsa_salary_acct_emp add jobtitle_name varchar(200);
alter table hrsa_salary_acct_emp add jobtitle_id bigint;
alter table hrsa_salary_acct_emp add jobcall varchar(200);
alter table hrsa_salary_acct_emp add jobcall_id bigint;
alter table hrsa_salary_acct_emp add status varchar(200);

View File

@ -0,0 +1,68 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
);

View File

@ -0,0 +1,11 @@
ALTER TABLE hrsa_salary_acct_emp
ADD subcompany_name varchar(200),
subcompany_id bigint,
department_name varchar(200),
department_id bigint,
jobtitle_name varchar(200),
jobtitle_id bigint,
jobcall varchar(200),
jobcall_id bigint,
status varchar(200)
GO

View File

@ -0,0 +1,31 @@
UPDATE hrsa_salary_acct_emp
set department_id = b.departmentId,
department_name = b.departmentName,
subcompany_id = b.subcompanyid,
subcompany_name = b.subcompanyName,
jobtitle_id = b.jobtitleId,
jobtitle_name = b.jobtitleName,
jobcall_id = b.jobcallId,
jobcall = b.jobcall,
status = b.status
FROM hrsa_salary_acct_emp a INNER JOIN (
select e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) as b
on a.employee_id = b.employeeId
WHERE a.delete_type=0
GO

View File

@ -0,0 +1,27 @@
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
/
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add department_id NUMBER null;
/
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
/
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
/
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
/

View File

@ -0,0 +1,70 @@
update hrsa_salary_acct_emp a
set
(
department_id ,
department_name,
subcompany_id ,
subcompany_name,
jobtitle_id ,
jobtitle_name ,
jobcall_id,
jobcall,
status
)
=
(
select
b.departmentId,
b.departmentName,
b.subcompanyid,
b.subcompanyName,
b.jobtitleId,
b.jobtitleName,
b.jobcallId,
b.jobcall,
b.status from
(
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
)
where a.delete_type=0 and
exists (select 1 from (
select
e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) b
where a.employee_id = b.employeeId
);
/

View File

@ -18,4 +18,4 @@ left join hrmresource e on e.id= result.employee_id
left join hrsa_tax_agent t on a.tax_agent_id=t.id
where a.delete_type=0 and i.delete_type=0 and t.delete_type=0 and c.delete_type=0
and a.employee_id=人员id and t.name=扣缴义务人名称
and effective_time <= now() and c.name='基本工资' order by effective_time desc
c.name='基本工资' order by effective_time desc

View File

@ -980,7 +980,31 @@
"infinite": true
}
]
}
},
{
"name": "DAYSINMONTH",
"chineseName": "返回指定月的天数",
"description": "返回指定月的天数。",
"example": "DAYSINMONTH('2024-01-01')",
"result": "31",
"paramDescs": [
"*日期*(必选)"
],
"formatString": "DAYSINMONTH(日期)",
"paramArray": [],
"paramData": [],
"returnType": "number",
"type": "function",
"validForm": "days_in_month",
"paramCount": -1,
"paramStatuses": [
{
"dataType": "date",
"must": true,
"infinite": true
}
]
},
],
"dataType": "date",
"name": "日期函数",

View File

@ -261,7 +261,7 @@ public class SalaryBillBO {
}
Util_Message.store(messageBean);
} catch (IOException e) {
e.printStackTrace();
log.error("消息发送失败",e);
}
}

View File

@ -0,0 +1,32 @@
package com.engine.salary.entity.salaryBill.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 工资单预览参数
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryPreviewParam {
/**
* 工资单id
*/
private Long salaryInfoId;
/**
* 员工id
*/
private Long recipient;
}

View File

@ -15,6 +15,7 @@ import com.google.common.collect.Sets;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.Util;
import java.util.*;
import java.util.stream.Collectors;
@ -121,9 +122,9 @@ public class SalaryAcctEmployeeBO {
}
public static List<SalaryAcctEmployeePO> convert2Employee(Collection<DataCollectionEmployee> employee,
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
Long employeeId) {
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
Long employeeId) {
if (CollectionUtils.isEmpty(employee)) {
return Collections.emptyList();
}
@ -147,6 +148,15 @@ public class SalaryAcctEmployeeBO {
.employeeId(emp.getEmployeeId())
.employeeType(emp.isExtEmp() ? 1 : 0)
.taxAgentId(taxAgentId)
.departmentId(emp.getDepartmentId())
.departmentName(emp.getDepartmentName())
.jobcall(emp.getJobcall())
.jobcallId(emp.getJobcallId())
.jobtitleId(emp.getJobtitleId())
.jobtitleName(emp.getJobtitleName())
.subcompanyId(emp.getSubcompanyid())
.subcompanyName(emp.getSubcompanyName())
.status(emp.getStatus())
.creator(employeeId)
.createTime(now)
.updateTime(now)
@ -159,6 +169,24 @@ public class SalaryAcctEmployeeBO {
return resultList;
}
/**
* 核算人员信息替换实时信息
* @param simpleEmployee
* @param acctEmployeePO
*/
public static void copyAcctEmp(DataCollectionEmployee simpleEmployee, SalaryAcctEmployeePO acctEmployeePO) {
simpleEmployee.setDepartmentId(acctEmployeePO.getDepartmentId());
simpleEmployee.setDepartmentName(acctEmployeePO.getDepartmentName());
simpleEmployee.setSubcompanyid(acctEmployeePO.getSubcompanyId());
simpleEmployee.setSubcompanyName(acctEmployeePO.getSubcompanyName());
simpleEmployee.setJobcallId(acctEmployeePO.getJobcallId());
simpleEmployee.setJobcall(acctEmployeePO.getJobcall());
simpleEmployee.setJobtitleId(acctEmployeePO.getJobtitleId());
simpleEmployee.setJobtitleName(acctEmployeePO.getJobtitleName());
simpleEmployee.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(acctEmployeePO.getStatus(), "1"))));
simpleEmployee.setStatus(acctEmployeePO.getStatus());
}
public static List<List<SalaryAcctEmployeePO>> partitionByEmployeeId(List<SalaryAcctEmployeePO> salaryAcctEmployees) {
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {

View File

@ -20,6 +20,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO;
import com.engine.salary.entity.salarysob.po.*;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.SalaryValueTypeEnum;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.util.SalaryEntityUtil;
@ -31,6 +32,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.BeanUtils;
import weaver.general.Util;
import java.lang.reflect.Field;
import java.util.*;
@ -251,7 +253,7 @@ public class SalaryAcctResultBO {
* @param taxAgents
* @param consolidatedTaxSalaryAcctEmpIds
* @param customBackCalcParameters
* @param isBackCalc
* @param dynamicEmpInfo
* @return
*/
public static List<Map<String, Object>> buildTableData(List<SalaryItemPO> salaryItems,
@ -263,10 +265,11 @@ public class SalaryAcctResultBO {
Set<Long> consolidatedTaxSalaryAcctEmpIds,
Map<Long, String> customParameters,
Map<Long, String> customBackCalcParameters,
boolean isBackCalc) {
boolean dynamicEmpInfo) {
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
return Collections.emptyList();
}
SalaryI18nUtil.i18nList(salaryAcctEmployees);
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getEmployeeId);
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
@ -278,12 +281,35 @@ public class SalaryAcctResultBO {
// 薪资项目的字段类型前端依据这个判断是否需要展示千分位
Map<String, String> dataTypeMap = SalaryEntityUtil.convert2Map(salaryItems, salaryItemPO -> salaryItemPO.getId() + DATA_TYPE_SUFFIX, SalaryItemPO::getDataType);
map.putAll(dataTypeMap);
// TODO ?看一下如果不是回算这会不会有回算的东西?
// 人员信息字段的值
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()));
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
// 员工信息字段的字段类型
if (dynamicEmpInfo) {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
} else {
if ("departmentName".equals(salarySobEmpField.getFieldCode())) {
map.put("departmentName", e.getDepartmentName());
} else if ("departmentId".equals(salarySobEmpField.getFieldCode())) {
map.put("departmentId", e.getDepartmentId());
} else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) {
map.put("subcompanyName", e.getSubcompanyName());
} else if ("jobcall".equals(salarySobEmpField.getFieldCode())) {
map.put("jobcall", e.getJobcall());
} else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) {
map.put("jobcallId", e.getJobcallId());
} else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) {
map.put("jobtitleName", e.getJobtitleName());
} else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) {
map.put("jobtitleId", e.getJobtitleId());
} else if ("status".equals(salarySobEmpField.getFieldCode())) {
map.put("status", e.getStatus());
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(e.getStatus())));
} else {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
}
}
map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
}
// 主键id
@ -328,7 +354,8 @@ public class SalaryAcctResultBO {
List<TaxAgentPO> taxAgents,
Map<Long, String> customParameters,
Set<Long> consolidatedTaxSalaryAcctEmpIds,
Set<Long> includeSalaryItemIds) {
Set<Long> includeSalaryItemIds,
boolean dynamicEmpInfo) {
if (CollectionUtils.isEmpty(simpleEmployees)) {
return Collections.emptyList();
}
@ -344,8 +371,32 @@ public class SalaryAcctResultBO {
// 员工信息字段的值
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId()));
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
// 员工信息字段的字段类型
if (dynamicEmpInfo) {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
} else {
if ("departmentName".equals(salarySobEmpField.getFieldCode())) {
map.put("departmentName", salaryAcctEmployee.getDepartmentName());
} else if ("departmentId".equals(salarySobEmpField.getFieldCode())) {
map.put("departmentId", salaryAcctEmployee.getDepartmentId());
} else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) {
map.put("subcompanyName", salaryAcctEmployee.getSubcompanyName());
} else if ("jobcall".equals(salarySobEmpField.getFieldCode())) {
map.put("jobcall", salaryAcctEmployee.getJobcall());
} else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) {
map.put("jobcallId", salaryAcctEmployee.getJobcallId());
} else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) {
map.put("jobtitleName", salaryAcctEmployee.getJobtitleName());
} else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) {
map.put("jobtitleId", salaryAcctEmployee.getJobtitleId());
} else if ("status".equals(salarySobEmpField.getFieldCode())) {
map.put("status", salaryAcctEmployee.getStatus());
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(salaryAcctEmployee.getStatus(), "1"))));
} else {
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
}
}
map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
}
// 系统值

View File

@ -65,6 +65,11 @@ public class SalaryAcctResultQueryParam extends BaseQueryParam {
//薪资项目id
private Collection<Long> salaryItemIds;
/**
* 是否需要实时人员信息
*/
private boolean dynamicEmpInfo;
//其他条件
private List<OtherCondition> otherConditions;

View File

@ -1,6 +1,7 @@
package com.engine.salary.entity.salaryacct.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.annotation.I18n;
import com.engine.salary.annotation.SalaryFormulaVar;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import lombok.AllArgsConstructor;
@ -112,6 +113,35 @@ public class SalaryAcctEmployeePO {
@ElogTransform(name = "锁定状态")
private Integer lockStatus;
/**
* 分部
*/
@I18n
private String subcompanyName;
private Long subcompanyId;
/**
* 部门
*/
@I18n
private String departmentName;
private Long departmentId;
/**
* 岗位
*/
@I18n
private String jobtitleName;
private Long jobtitleId;
/**
* 职称
*/
@I18n
private String jobcall;
private Long jobcallId;
/**
* 状态
*/
private String status;
//--------条件----------
//主键id集合

View File

@ -40,8 +40,6 @@ public class SalaryItemBO {
private static final BaseBean baseBean = new BaseBean();
//强制开启账套的公式配置
private static final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
@ -86,6 +84,10 @@ public class SalaryItemBO {
if (CollectionUtils.isEmpty(salaryItems)) {
return Collections.emptyList();
}
//强制开启账套的公式配置
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
return salaryItems.stream().map(salaryItemPO -> {
@ -134,6 +136,9 @@ public class SalaryItemBO {
if (CollectionUtils.isEmpty(salaryItems)) {
return Collections.emptyList();
}
//强制开启账套的公式配置
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
return salaryItems.stream().map(salaryItemPO -> {

View File

@ -63,7 +63,7 @@ public class SalaryItemSaveParam {
private Integer roundingMode;
//保留小数位
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "小数位最多为8")
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 10, message = "小数位最多为10")
private Integer pattern;
/**

View File

@ -53,7 +53,7 @@ public class SalarySobItemFormDTO {
private Integer roundingMode;
//保留小数位")
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "小数位最多为8")
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 10, message = "小数位最多为10")
private Integer pattern;
//取值方式")

View File

@ -90,7 +90,7 @@ public enum FilterEnum implements BaseEnum<String> {
return StringUtils::isEmpty;
}
},
ISNOTEMPTY("ISNOTEMPTY", "包含", 1) {
ISNOTEMPTY("ISNOTEMPTY", "不为空", 1) {
@Override
public Predicate<String> filter(List<String> params) {
return StringUtils::isNotEmpty;

View File

@ -985,7 +985,31 @@ public class FormluaConstant {
" \"infinite\": true\n" +
" }\n" +
" ]\n" +
" }\n" +
" },\n" +
" {\n" +
" \"name\": \"DAYSINMONTH\",\n" +
" \"chineseName\": \"返回指定月的天数\",\n" +
" \"description\": \"返回指定月的天数。\",\n" +
" \"example\": \"DAYSINMONTH('2024-01-01')\",\n" +
" \"result\": \"31\",\n" +
" \"paramDescs\": [\n" +
" \"*日期*(必选)\"\n" +
" ],\n" +
" \"formatString\": \"DAYSINMONTH(日期)\",\n" +
" \"paramArray\": [],\n" +
" \"paramData\": [],\n" +
" \"returnType\": \"number\",\n" +
" \"type\": \"function\",\n" +
" \"validForm\": \"days_in_month\",\n" +
" \"paramCount\": -1,\n" +
" \"paramStatuses\": [\n" +
" {\n" +
" \"dataType\": \"date\",\n" +
" \"must\": true,\n" +
" \"infinite\": true\n" +
" }\n" +
" ]\n" +
" },\n" +
" ],\n" +
" \"dataType\": \"date\",\n" +
" \"name\": \"日期函数\",\n" +

View File

@ -189,6 +189,7 @@ public class QlExpress {
runner.addFunctionOfServiceMethod("CURRSECOND", dateTimeService, "currSecond", new Class[]{Object[].class}, "");
runner.addFunctionOfServiceMethod("MAXDATE", dateTimeService, "maxDate", new Class[]{Object[].class}, "");
runner.addFunctionOfServiceMethod("MINDATE", dateTimeService, "minDate", new Class[]{Object[].class}, "");
runner.addFunctionOfServiceMethod("DAYSINMONTH", dateTimeService, "daysInMonth", new Class[]{Object[].class}, "");
// runner.addFunctionOfServiceMethod("DAYOFMONTH", dateTimeService, "dayOfMonth", new Class[]{Object[].class}, "");
//聚合函数

View File

@ -1,6 +1,5 @@
package com.engine.salary.formlua.func.compare;
import com.alibaba.fastjson.JSON;
import com.engine.salary.formlua.core.exception.ErrorType;
import com.engine.salary.formlua.entity.parameter.DataType;
import com.engine.salary.formlua.util.CompareUtil;
@ -37,7 +36,6 @@ public class EqOperator extends OperatorEqualsLessMore {
public Object executeInner(Object... list) throws Exception {
DataType result=new DataType();
result.setDataType(DataType.BOOL);
logger.info("等于号参数:"+JSON.toJSONString(list));
String oper="=";
if(list.length!=2){
throw new RuntimeException("[=]"+ ErrorType.MAX_VAR_COUNT.name());
@ -75,7 +73,6 @@ public class EqOperator extends OperatorEqualsLessMore {
int i=0;
for (;i<firstOptions.length;i++){
boolean loopresult=OperatorEqualsLessMore.executeInner("=",firstOptions[i],secondOptions[i]);
logger.info("比较选项结果"+loopresult);
if(!loopresult){
result.setContent(false);
break;
@ -138,7 +135,6 @@ public class EqOperator extends OperatorEqualsLessMore {
}else {
Object firstParam=ExcelParamUtil.getParamContent(dataList.get(0),"");
Object secondParam=ExcelParamUtil.getParamContent(dataList.get(1),"");
logger.info("等于号比较:"+firstParam+"-->"+secondParam);
if((firstParam instanceof String || firstParam instanceof Character) && (secondParam instanceof String || secondParam instanceof Character)){
if(firstParam.toString().length()==1&&secondParam.toString().length()==1){
boolean r=firstParam.toString().equals(secondParam.toString());

View File

@ -1,6 +1,5 @@
package com.engine.salary.formlua.func.compare;
import com.alibaba.fastjson.JSON;
import com.engine.salary.formlua.entity.parameter.DataType;
import com.engine.salary.formlua.util.CompareUtil;
import com.engine.salary.formlua.util.DateUtil;
@ -22,7 +21,6 @@ public class GreaterOperator extends OperatorEqualsLessMore {
result.setDataType(DataType.BOOL);
// IgnoreParamFilter.filterCompareFunc(op1,op2,">");
String datatype = ExcelParamUtil.checkParamType(op1);
logger.info("大于号比较:" + JSON.toJSONString(op1) + "-->" + JSON.toJSONString(op2));
//对option的特殊处理获取option的字符串后根据逗号分割然后排序数组数组长度不一致返回false一致则循环对比直到同样下标的数据不一致返回false否则为true
try {
if (datatype.equals(DataType.OPTION)) {
@ -77,8 +75,6 @@ public class GreaterOperator extends OperatorEqualsLessMore {
}
result.setContent(dateResult);
} else {
logger.info("参数1" + ExcelParamUtil.convertParamValToNumber(op1) + "");
logger.info("参数2" + ExcelParamUtil.convertParamValToNumber(op2) + "");
boolean r;
if (ExcelParamUtil.getParamType(op1).toLowerCase().equals("double") || ExcelParamUtil.getParamType(op2).toLowerCase().equals("double")) {
r = OperatorEqualsLessMore.executeInner(">", ExcelParamUtil.convertParamValToNumber(op1), ExcelParamUtil.convertParamValToNumber(op2));

View File

@ -52,10 +52,9 @@ public class WOperatorDiv extends OperatorMultiDiv {
newList[1] = secondParam;
try {
Object r = super.executeInner(newList);
logger.info("乘法运算:" + r.toString());
result.setContent(new BigDecimal(r + ""));
} catch (Exception e) {
logger.info("除法计算异常返回0" + e.getMessage());
logger.error("除法计算异常返回0" + e.getMessage());
result.setContent(0);
}
return result;

View File

@ -89,4 +89,11 @@ import com.engine.salary.formlua.entity.parameter.DataType;
*/
DataType currSecond(Object... objects);
/**
* 获取月有多少天
* @param objects
* @return
*/
DataType daysInMonth(Object... objects);
}

View File

@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@ -549,7 +550,6 @@ public class DateTimeServiceImpl implements DateTimeService {
date = lastday;
break;
}
logger.info("firstday:" + firstday + " lastday:" + lastday);
return new DataType(DataType.STRING, date);
}
@ -998,6 +998,37 @@ public class DateTimeServiceImpl implements DateTimeService {
int year = cal.get(Calendar.SECOND);
return new DataType(DataType.NUMBER, year);
}
@Override
public DataType daysInMonth(Object... objects) {
Class[] typeObjects = new Class[]{DateAndString.class};
IgnoreParamFilter.commonFilter("YEAR", 1, 1, typeObjects, objects);
Object obj = objects[0];
Object date = DateUtil.getContent(obj, formatter);
if (ExcelParamUtil.checkIsNull(date, ExcelParamUtil.CHECKLEVEL_STRING)) {
return new DataType(DataType.NUMBER, 0);
}
int year = 0;
try {
year = getDateTimeValue(date, "Y", "YEAR");
} catch (ParseException e) {
logger.error("err", e);
throw new RuntimeException(e);
}
IgnoreParamFilter.commonFilter("MONTH", 1, 1, typeObjects, objects);
int month = 0;
try {
month = getDateTimeValue(date, "M", "MONTH") + 1;
} catch (ParseException e) {
logger.error("err", e);
throw new RuntimeException(e);
}
YearMonth yearMonth = YearMonth.of(year, month);
int daysInMonth = yearMonth.lengthOfMonth();
return new DataType(DataType.NUMBER, daysInMonth);
}
/*******以下为日期函数的一些公共逻辑********/
@ -1256,7 +1287,7 @@ public class DateTimeServiceImpl implements DateTimeService {
r = true;
break;
} catch (ParseException e) {
logger.info(e.getMessage());
logger.error(e.getMessage());
r = false;
}
}

View File

@ -79,7 +79,6 @@ public class FinanceServiceImpl implements FinanceService{
int intLen = integerNum.length();
for (int i = 0; i < intLen; i++) {
String n = integerNum.substring(i, i+1);
logger.info("转换中文:"+n);
int p = intLen - i - 1;
int q = p / 4;
int m = p % 4;

View File

@ -1,6 +1,5 @@
package com.engine.salary.formlua.func.logic;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.formlua.core.exception.ExcelRunTimeException;
import com.engine.salary.formlua.entity.parameter.DataType;
@ -26,7 +25,6 @@ public class IfOperator extends OperatorIf {
throw new ExcelRunTimeException("IF函数只允许三个参数");
}
Object obj = list.get(0).getObject(parent);
logger.info("IF参数" + JSON.toJSONString(obj));
boolean isDataTypeBool = false;
DataType boolDtaType = null;
if (obj != null && obj instanceof DataType) {

View File

@ -477,7 +477,6 @@ public class LogicServiceImpl implements LogicService {
Object obj = objects[i - 1];
String typeStr = ExcelParamUtil.getParamType(obj);
typeStr = ExcelParamUtil.checkParamType(typeStr);
logger.info(typeStr);
if (type == null) {
type = typeStr;
} else {

View File

@ -236,7 +236,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
int replaceLength=(repIdx-1)+repLenth;
if(replaceLength>sourceStr.length()){
// throw new RunTimeException(errorJson.getString("msg"));
logger.info("REPLACE函数替换位置超过了字符长度");
replaceLength=sourceStr.length();
}
String cutStr=sourceStr.substring(repIdx-1,replaceLength);
@ -463,7 +462,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
sex = "";
}
}
logger.info(sex);
return new DataType(DataType.STRING,sex);
}
@ -471,7 +469,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
public DataType nativePlace(String idCard){
int nativePlaceCode=Integer.parseInt(idCard.substring(0, 6));
String nativePlace= NativePlace.getNativePlace(nativePlaceCode);
logger.info("您所在的地区为:\n" + nativePlace);
return new DataType(DataType.STRING,nativePlace);
}
@ -489,7 +486,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
if(dataType!=null && dataType.getContent()!=null){
age=dataType.getContent();
}
logger.info("年龄:"+age);
}
} catch (ParseException e) {
logger.error("err",e);
@ -526,7 +522,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
}
String birth=year+"-"+month+"-"+day;
logger.info("生日为:"+birth);
result=birth;
break;
@ -756,12 +751,10 @@ public class StringFormulaServiceImpl implements StringFormulaService {
if(fieldType.equalsIgnoreCase("string")){
if(content!=null){
try {
logger.info("isJson函数的JSON字符转换"+content+"");
JSON.parseObject(content+"");
resultDataType=new DataType(DataType.BOOL,true);
} catch (Exception e) {
logger.info("err",e);
logger.info("不是正常的JSON字符");
logger.error("err",e);
resultDataType=new DataType(DataType.BOOL,false);
}
}else{
@ -800,13 +793,11 @@ public class StringFormulaServiceImpl implements StringFormulaService {
if(fieldType.equalsIgnoreCase("string")){
if(content!=null){
try {
logger.info("isJson函数的JSON字符转换"+content+"");
JSONObject jsonObject=JSON.parseObject(content+"");
Object jsonValue=jsonObject.get(objectKey+"");
resultDataType=new DataType(DataType.STRING,jsonValue==null?"":jsonValue.toString());
} catch (Exception e) {
logger.info("err",e);
logger.info("不是正常的JSON字符");
resultDataType=new DataType(DataType.STRING,"");
}
}else{

View File

@ -87,7 +87,6 @@ public class DateUtil {
try {
format.setLenient(false);
format.parse(dateString);
logger.info(dateString);
} catch (ParseException e) {
// logger.error("err",e);
convertSuccess=false;

View File

@ -1,6 +1,5 @@
package com.engine.salary.formlua.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.formlua.core.exception.ErrorType;
import com.engine.salary.formlua.entity.parameter.DataType;
@ -39,7 +38,6 @@ public class IgnoreParamFilter {
* @return
*/
public static boolean isEmployee(Object object) {
logger.info("校验人员参数" + JSON.toJSONString(object));
// if (object instanceof DataType) {
// DataType dataType = (DataType) object;
// if (dataType.getComponentKey() != null && dataType.getComponentKey().equalsIgnoreCase(ComponentType.Employee.toString())) {
@ -227,7 +225,6 @@ public class IgnoreParamFilter {
* @throws RuntimeException
*/
public static void filterAggFunc(String func, Object... objects) throws RuntimeException {
logger.info("聚合参数:" + JSON.toJSONString(objects));
Integer number = getSetFuncNumber(func);
Map<String, String> map = new HashMap<>();
boolean mustNumber = false;

View File

@ -99,10 +99,16 @@
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.companystartdate as companystartdate,
e.mobile as mobile
e.mobile as mobile,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
job.id as jobcallId,
job.name as jobcall
from hrmresource e
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join hrmjobcall job on e.jobcall=job.id
WHERE e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
<if test="params != null and params.size() > 0">
AND ( 1=2
@ -139,14 +145,6 @@
#{status}
</foreach>
</if>
<!-- &#45;&#45; 在职-->
<!-- <if test="param.employeeStatus != null and param.employeeStatus == 'normal'">-->
<!-- AND em.status in (0,1,2,3)-->
<!-- </if>-->
<!-- &#45;&#45; 离职-->
<!-- <if test="param.employeeStatus != null and param.employeeStatus == 'unavailable'">-->
<!-- AND em.status in (4,5,6)-->
<!-- </if>-->
)
</foreach>
)
@ -187,14 +185,6 @@
#{status}
</foreach>
</if>
<!-- &#45;&#45; 在职-->
<!-- <if test="param.employeeStatus != null and param.employeeStatus == 'normal'">-->
<!-- AND em.status in (0,1,2,3)-->
<!-- </if>-->
<!-- &#45;&#45; 离职-->
<!-- <if test="param.employeeStatus != null and param.employeeStatus == 'unavailable'">-->
<!-- AND em.status in (4,5,6)-->
<!-- </if>-->
)
</foreach>
)

View File

@ -16,6 +16,15 @@
<result column="tenant_key" property="tenantKey"/>
<result column="employee_type" property="employeeType"/>
<result column="lock_status" property="lockStatus"/>
<result column="subcompany_name" property="subcompanyName"/>
<result column="subcompany_id" property="subcompanyId"/>
<result column="department_name" property="departmentName"/>
<result column="department_id" property="departmentId"/>
<result column="jobtitle_name" property="jobtitleName"/>
<result column="jobtitle_id" property="jobtitleId"/>
<result column="jobcall" property="jobcall"/>
<result column="jobcall_id" property="jobcallId"/>
<result column="status" property="status"/>
</resultMap>
<resultMap id="SalaryAccEmployeeCountMap"
@ -40,7 +49,16 @@
t.delete_type,
t.tenant_key,
t.employee_type,
t.lock_status
t.lock_status,
t.subcompany_name,
t.subcompany_id,
t.department_name,
t.department_id,
t.jobtitle_name,
t.jobtitle_id,
t.jobcall,
t.jobcall_id,
t.status
</sql>
<sql id="emp1Column">
@ -54,7 +72,16 @@
<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,employee_type,lock_status)
creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
subcompany_name,
subcompany_id,
department_name,
department_id,
jobtitle_name,
jobtitle_id,
jobcall,
jobcall_id,
status)
VALUES
<foreach collection="collection" item="emp" separator=",">
(
@ -69,15 +96,32 @@
#{emp.deleteType},
#{emp.tenantKey},
#{emp.employeeType},
#{emp.lockStatus}
#{emp.lockStatus},
#{emp.subcompanyName},
#{emp.subcompanyId},
#{emp.departmentName},
#{emp.departmentId},
#{emp.jobtitleName},
#{emp.jobtitleId},
#{emp.jobcall},
#{emp.jobcallId},
#{emp.status}
)
</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,employee_type,lock_status)
creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
subcompany_name,
subcompany_id,
department_name,
department_id,
jobtitle_name,
jobtitle_id,
jobcall,
jobcall_id,
status)
<foreach collection="collection" item="emp" separator="union all">
select
#{emp.salaryAcctRecordId,jdbcType=DOUBLE},
@ -92,6 +136,15 @@
#{emp.tenantKey,jdbcType=VARCHAR},
#{emp.employeeType,jdbcType=INTEGER},
#{emp.lockStatus,jdbcType=INTEGER}
#{emp.subcompanyName,jdbcType=VARCHAR},
#{emp.subcompanyId,jdbcType=DOUBLE},
#{emp.departmentName,jdbcType=VARCHAR},
#{emp.departmentId,jdbcType=DOUBLE},
#{emp.jobtitleName,jdbcType=VARCHAR},
#{emp.jobtitleId,jdbcType=DOUBLE},
#{emp.jobcall,jdbcType=VARCHAR},
#{emp.jobcallId,jdbcType=DOUBLE},
#{emp.status,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -99,7 +152,16 @@
<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,employee_type,lock_status)
creator, create_time, update_time, delete_type, tenant_key,employee_type,lock_status,
subcompany_name,
subcompany_id,
department_name,
department_id,
jobtitle_name,
jobtitle_id,
jobcall,
jobcall_id,
status)
VALUES
(
#{emp.salaryAcctRecordId},
@ -113,7 +175,16 @@
#{emp.deleteType},
#{emp.tenantKey},
#{emp.employeeType},
#{emp.lockStatus}
#{emp.lockStatus},
#{emp.subcompanyName},
#{emp.subcompanyId},
#{emp.departmentName},
#{emp.departmentId},
#{emp.jobtitleName},
#{emp.jobtitleId},
#{emp.jobcall},
#{emp.jobcallId},
#{emp.status}
)
</foreach>
</insert>
@ -1150,6 +1221,15 @@
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="lock_status" property="lockStatus"/>
<result column="subcompany_name" property="subcompanyName"/>
<result column="subcompany_id" property="subcompanyId"/>
<result column="department_name" property="departmentName"/>
<result column="department_id" property="departmentId"/>
<result column="jobtitle_name" property="jobtitleName"/>
<result column="jobtitle_id" property="jobtitleId"/>
<result column="jobcall" property="jobcall"/>
<result column="jobcall_id" property="jobcallId"/>
<result column="status" property="status"/>
</resultMap>
<!-- 表字段 -->
@ -1169,6 +1249,15 @@
, t.tenant_key
, t.employee_type
, t.lock_status
, t.subcompany_name
, t.subcompany_id
, t.department_name
, t.department_id
, t.jobtitle_name
, t.jobtitle_id
, t.jobcall
, t.jobcall_id
, t.status
</sql>
@ -1274,7 +1363,7 @@
UPDATE hrsa_salary_acct_emp
SET lock_status = #{lockStatus}
WHERE delete_type = 0
AND salary_acct_record_id =#{recordId}
AND salary_acct_record_id = #{recordId}
</update>
</mapper>

View File

@ -116,6 +116,14 @@ public interface InsuranceAccountDetailMapper {
*/
List<InsuranceAccountDetailPO> querySupplementListByBillMonth(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
/**
* 查询补差数据
* @param billMonth 账单月份
* @param paymentOrganization 个税扣缴义务人
* @return
*/
List<InsuranceAccountDetailPO> queryBalanceListByBillMonth(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
/**
* 查询正常缴纳数据
* @param billMonth 账单月份

View File

@ -497,6 +497,7 @@
<select id="queryNormalList" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.social_scheme_id,t.fund_scheme_id,t.other_scheme_id,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
@ -541,6 +542,17 @@
AND t.payment_organization = #{paymentOrganization}
</select>
<select id="queryBalanceListByBillMonth" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.supplementary_month,t.supplementary_projects
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 4
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
</select>
<select id="queryNormalListByBillMonth" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id

View File

@ -18,6 +18,7 @@ import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.BaseBean;
import weaver.general.Util;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@ -172,7 +173,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
public List<Map<String, String>> getBalanceOfLeaveColumns() {
Map<String, Object> paramsMap = new HashMap<String, Object>();
paramsMap.put("dateScope", "6");
paramsMap.put("selectedYear", 2023);
paramsMap.put("selectedYear", LocalDate.now().getYear());
paramsMap.put("dataScope", "3");
paramsMap.put("resourceId", 92);
paramsMap.put("status", "9");

View File

@ -746,7 +746,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
// 报表分享时间校验
String formatLocalDateTime = SalaryDateUtil.getFormatLocalDate(LocalDateTime.now());
List<SalaryStatisticsPushPO> result = pushList.stream().filter(pushPO -> {
if (pushPO.getStartTime().compareTo(formatLocalDateTime) > 0 || (StringUtils.isNotEmpty(pushPO.getEndTime()) && pushPO.getEndTime().compareTo(formatLocalDateTime) < 0)) {
if ((StringUtils.isNotBlank(pushPO.getStartTime()) && pushPO.getStartTime().compareTo(formatLocalDateTime) > 0) || (StringUtils.isNotEmpty(pushPO.getEndTime()) && pushPO.getEndTime().compareTo(formatLocalDateTime) < 0)) {
return false;
}
return true;

View File

@ -24,6 +24,7 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -137,6 +138,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
/**
* 获取员工发薪明细列表
*
* @param queryParam
*/
public Map<String, Object> salaryList(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
@ -147,7 +149,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
// 获取发薪人员
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
// 获取薪资核算结果
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
Map<String, Object> countResultMap = Maps.newHashMap();
@ -183,7 +185,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
// 结果
if (queryParam.isExport()) {
resultMap.put("columns", weaTableColumns);
resultMap.put("salaryItems",salaryStatisticsEmployeeDetailResult.getSalaryItemList());
resultMap.put("salaryItems", salaryStatisticsEmployeeDetailResult.getSalaryItemList());
resultMap.put("countResult", countResultMap);
} else {
WeaTable table = new WeaTable();
@ -205,6 +207,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
/**
* 获取员工发薪明细列表
*
* @param queryParam
*/
public Map<String, Object> salaryListSum(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
@ -215,25 +218,37 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
queryParam.setExport(true);
// 获取发薪人员
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
// 获取薪资核算结果
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
List<SalaryAcctEmployeePO> employeePOS = salaryAcctEmployeePageInfo.getList();
Map<String, Object> sumResultMap = Maps.newHashMap();
if (CollectionUtils.isNotEmpty(records)) {
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
for (SalaryItemPO item : salaryItems) {
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;
for (Map<String, Object> record : records) {
if (record.containsKey(itemKey)) {
if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
List<List<SalaryAcctEmployeePO>> empParts = Lists.partition(employeePOS, 500);
for (int i = 0; i < empParts.size(); i++) {
// 获取薪资核算结果
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(empParts.get(i));
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
if (CollectionUtils.isNotEmpty(records)) {
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
for (SalaryItemPO item : salaryItems) {
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;
for (Map<String, Object> record : records) {
if (record.containsKey(itemKey)) {
if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
}
}
}
Object o = sumResultMap.get(itemKey + "_n");
if (o != null) {
sumBigDecimal = sumBigDecimal.add((BigDecimal) o);
}
sumResultMap.put(itemKey + "_n", sumBigDecimal);
// 薪资项目合计
sumResultMap.put(itemKey, ReportDataUtil.thousandthConvert(sumBigDecimal.toString()));
}
// 薪资项目合计
sumResultMap.put(itemKey, ReportDataUtil.thousandthConvert(sumBigDecimal.toString()));
}
}
resultMap.put("sumRow", sumResultMap);
@ -263,12 +278,12 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
// 合计
List<Object> sumRow = new ArrayList<>();
sumRow.add("总计");
for (int i=1; i<columns.size(); i++) {
for (int i = 1; i < columns.size(); i++) {
sumRow.add(Util.null2String(countResult.get(columns.get(i).getColumn())));
}
rowList.add(sumRow);
return ExcelUtilPlus.genWorkbookV2(rowList,"薪资明细",true);
return ExcelUtilPlus.genWorkbookV2(rowList, "薪资明细", true);
}
// public Map<String, Object> exportDetailList(SalaryStatisticsEmployeeDetailQueryParam queryParam) {

View File

@ -1,7 +1,10 @@
package com.engine.salary.service;
import com.engine.salary.entity.salaryBill.dto.SalaryBillSendDTO;
import com.engine.salary.entity.salaryBill.param.SalaryExportPdfParam;
import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam;
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
import java.util.List;
import java.util.Map;
@ -52,6 +55,15 @@ public interface SalaryBillService {
String genPdfBeforeExport(SalaryExportPdfParam salaryExportPdfParam);
/**
* 构建发放参数
* @param salarySend
* @param taxAgentName
* @param salaryTemplate
* @return
*/
SalaryBillSendDTO buildSendParams(SalarySendPO salarySend, String taxAgentName, SalaryTemplatePO salaryTemplate);
/**
* 工资单撤回
*

View File

@ -218,4 +218,11 @@ public interface SalarySendService {
List<SalarySendPO> getByIds(List<Long> salarySendId);
List<SalarySendPO> listSome(SalarySendPO param);
/**
* 工资单预览
* @param param
* @return
*/
Map<String, Object> preview(SalaryPreviewParam param);
}

View File

@ -2056,6 +2056,40 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return resultList;
}
/**
* 获取福利台账中的补差数据
* @param billMonth 账单月份
* @param paymentOrganization 个税扣缴义务人id
* @return
*/
private List<Map<String, Object>> getBalanceDataByBillMonth(String billMonth, Long paymentOrganization) {
List<Map<String, Object>> resultList = new ArrayList<>();
DataCollectionEmployee employee = new DataCollectionEmployee();
TaxAgentPO taxAgentPO = taxAgentBiz.getById(paymentOrganization);
List<InsuranceAccountDetailPO> balanceDataList = getInsuranceAccountDetailMapper().queryBalanceListByBillMonth(billMonth, paymentOrganization);
for(InsuranceAccountDetailPO po : balanceDataList) {
Map<String, Object> resultMap = new HashMap<>();
employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId());
resultMap.put("username", employee.getUsername());
resultMap.put("departmentName", employee.getDepartmentName());
resultMap.put("mobile", employee.getMobile());
resultMap.put("workcode", employee.getWorkcode());
resultMap.put("idNo", employee.getIdNo());
resultMap.put("taxAgentName", taxAgentPO.getName());
resultMap.put("billMonth", billMonth);
resultMap.put("supplementaryMonth", po.getSupplementaryMonth());
resultList.add(resultMap);
}
return resultList;
}
/**
* 获取福利台账中的正常缴纳数据
* @param billMonth 账单月份
@ -3469,6 +3503,61 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
// resultMap.put("data", dataMap);
// resultMap.put("items", addGroups);
// 获取当前放方案信息
InsuranceArchivesSocialSchemePO socialSchemePO = new InsuranceArchivesSocialSchemePO();
InsuranceArchivesFundSchemePO fundSchemePO = new InsuranceArchivesFundSchemePO();
InsuranceArchivesOtherSchemePO otherSchemePO = new InsuranceArchivesOtherSchemePO();
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = new ArrayList<>();
List<Long> schemeIdList = new ArrayList<>();
if (insuranceAccountDetailPO.getSocialSchemeId() == null) {
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization())
.build());
if (socialSchemePOList.size() > 0) {
encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class);
socialSchemePO = socialSchemePOList.get(0);
}
schemeIdList.add(socialSchemePO.getSocialSchemeId());
} else {
schemeIdList.add(insuranceAccountDetailPO.getSocialSchemeId());
}
if (insuranceAccountDetailPO.getFundSchemeId() == null) {
List<InsuranceArchivesFundSchemePO> fundSchemePOList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization())
.build());
if (fundSchemePOList.size() > 0) {
encryptUtil.decryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class);
fundSchemePO = fundSchemePOList.get(0);
}
schemeIdList.add(fundSchemePO.getFundSchemeId());
} else {
schemeIdList.add(insuranceAccountDetailPO.getFundSchemeId());
}
if (insuranceAccountDetailPO.getOtherSchemeId() == null) {
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization())
.build());
if (otherSchemePOList.size() > 0) {
encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class);
otherSchemePO = otherSchemePOList.get(0);
}
schemeIdList.add(otherSchemePO.getOtherSchemeId());
} else {
schemeIdList.add(insuranceAccountDetailPO.getOtherSchemeId());
}
schemeIdList = schemeIdList.stream().filter(schemeId -> schemeId != null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(schemeIdList)) {
insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(schemeIdList);
}
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
List<Map<String, String>> perList = new ArrayList<>();
List<Map<String, String>> comList = new ArrayList<>();
for (SearchConditionGroup group : addGroups) {
@ -3487,6 +3576,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
map.put("insuranceName", item.getLabel());
map.put("insuranceId", insuranceId);
map.put("insuranceValue", dataMap.get(domkey[0]));
map.put("validNum", schemeValidNumMap.getOrDefault(insuranceId + "-2", 2).toString());
if (map.get("insuranceValue") != null && !"".equals(map.get("insuranceValue"))) {
perList.add(map);
@ -3500,6 +3590,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
map.put("insuranceName", item.getLabel());
map.put("insuranceId", insuranceId);
map.put("insuranceValue", dataMap.get(domkey[0]));
map.put("validNum", schemeValidNumMap.getOrDefault(insuranceId + "-1", 2).toString());
if (map.get("insuranceValue") != null && !"".equals(map.get("insuranceValue"))) {
comList.add(map);
@ -3528,10 +3619,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
//对比可进行缴纳福利项与上面的已有福利项生成map
for (Map<String, String> balancePayItem : balancePaymentGroup) {
Map<String, Object> target = (Map<String, Object>)targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope"));
if (targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")) == null) {
balancePayItem.put("insuranceValue", "");
balancePayItem.put("validNum", balancePayItem.get("validNum"));
resultList.add(balancePayItem);
} else {
target.put("validNum", balancePayItem.get("validNum"));
}
}
}
}
@ -3774,7 +3870,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<List<Object>> rows = new ArrayList<>();
//查询当前已有的补差数据
List<Map<String, Object>> resultMapList = getSupplyDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
List<Map<String, Object>> resultMapList = getBalanceDataByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
// excel导出的数据
rows.add(headerList);
for (Map<String, Object> map : resultMapList) {

View File

@ -4,12 +4,11 @@ import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam;
import com.engine.salary.entity.siaccount.param.EditAccountDetailParam;
import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
@ -24,7 +23,6 @@ import com.engine.salary.enums.siaccount.ResourceFromEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.sicategory.IsPaymentEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
@ -39,17 +37,15 @@ import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIBalanceService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import com.engine.salary.util.db.IdGenerator;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.User;
import java.math.BigDecimal;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@ -175,6 +171,8 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -187,6 +185,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -198,6 +197,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -207,6 +207,8 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(fundSchemePO.getFundSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
fundMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -219,6 +221,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -230,6 +233,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -239,6 +243,9 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(otherSchemePO.getOtherSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
otherMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -251,6 +258,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -262,6 +270,7 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});

View File

@ -28,10 +28,7 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -230,6 +227,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -241,6 +240,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -251,6 +251,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -260,6 +261,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(fundSchemePO.getFundSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
fundMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -271,6 +274,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -281,6 +285,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -290,6 +295,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(otherSchemePO.getOtherSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
otherMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -301,6 +308,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -311,6 +319,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -322,6 +331,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -333,6 +344,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -343,6 +355,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -358,6 +371,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -369,6 +384,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -379,6 +395,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -394,6 +411,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -405,6 +424,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -415,6 +435,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -430,6 +451,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -441,6 +464,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -451,6 +475,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -462,6 +487,9 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(fundSchemePO.getFundSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
fundMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -473,6 +501,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -483,6 +512,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});
@ -494,6 +524,9 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(otherSchemePO.getOtherSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
otherMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) != null && welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
@ -505,6 +538,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
comMap.put("paymentScopeSign", "com");
comMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue(), 2).toString());
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
@ -515,6 +549,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
perMap.put("paymentScopeSign", "per");
perMap.put("validNum",schemeValidNumMap.getOrDefault(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue(), 2).toString());
resultList.add(perMap);
}
});

View File

@ -117,7 +117,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
@Override
public SalaryAcctEmployeePO getById(Long id) {
return getSalaryAcctEmployeeMapper().getById(id);
SalaryAcctEmployeePO po = getSalaryAcctEmployeeMapper().getById(id);
SalaryI18nUtil.i18n(po);
return po;
}
@Override
@ -235,7 +237,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
BeanUtils.copyProperties(queryParam, salaryAcctEmployeeQueryParam);
// 查询薪资核算人员分页
// 如果需要筛选是否合并计税
if (StringUtils.isNotEmpty(queryParam.getConsolidatedTaxation())) {
if (StringUtils.isNotEmpty(queryParam.getConsolidatedTaxation()) && queryParam.getConsolidatedTaxation().equals("1")) {
return listPageByParam4ConsolidatedTax(salaryAcctEmployeeQueryParam);
} else {
return listPageByParam(salaryAcctEmployeeQueryParam);

View File

@ -389,6 +389,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
// List<Object> headerList = new ArrayList<>(weaTableColumns);
List<Object> headerList = new ArrayList<>(finalWeaTableColumns);
// 查询薪资核算结果
queryParam.setDynamicEmpInfo(true);
List<Map<String, Object>> resultMapList = getSalaryAcctResultService(user).listByParam(queryParam);
@ -757,6 +758,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
rows.add(headerList);
if (param.getImportType() != null && param.getImportType().equals("true")) {
// 需要导出现有数据查询薪资核算结果
param.setDynamicEmpInfo(true);
List<Map<String, Object>> resultMapList = getSalaryAcctResultService(user).listByParam(param);
for (Map<String, Object> map : resultMapList) {
List<Object> row = Lists.newArrayListWithExpectedSize(headerColumnGroup.size());

View File

@ -219,10 +219,11 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<List<Long>> partition = Lists.partition((List<Long>) salaryAcctEmployeeIds, 500);
List<SalaryAcctResultPO> salaryAcctResultPOS = new ArrayList<>();
partition.forEach(empIds -> {
salaryAcctResultPOS.addAll(getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).build()));
List<SalaryAcctResultPO> resultPOS = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).build());
encryptUtil.decryptList(resultPOS, SalaryAcctResultPO.class);
salaryAcctResultPOS.addAll(resultPOS);
});
// 解密
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
return salaryAcctResultPOS;
}
@ -495,7 +496,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
});
// 转换成薪资核算结果列表
return SalaryAcctResultBO.buildTableData(salaryItemPOS, salarySobEmpFieldPOS, simpleEmployees, salaryAcctEmployeePOS, salaryAcctResultPOS, taxAgentPOS, salaryAcctEmployeeIds4ConsolidatedTax, customParameters, customBackCalcParameters, isBackCalc);
return SalaryAcctResultBO.buildTableData(salaryItemPOS, salarySobEmpFieldPOS, simpleEmployees, salaryAcctEmployeePOS, salaryAcctResultPOS, taxAgentPOS, salaryAcctEmployeeIds4ConsolidatedTax, customParameters, customBackCalcParameters, queryParam.isDynamicEmpInfo());
}
@ -789,7 +790,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
acctResults = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId())).collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
}
List<Long> lockEmpIds = salaryAcctEmployeePOS.stream().filter(po -> LockStatusEnum.LOCK.getValue().equals(po.getLockStatus())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
if(CollUtil.isNotEmpty(lockEmpIds)){
if (CollUtil.isNotEmpty(lockEmpIds)) {
List<SalaryAcctResultPO> acctResultPOS = listBySalaryAcctEmployeeIds(lockEmpIds);
Map<String, SalaryAcctResultPO> acctResultMaps = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
acctResults.putAll(acctResultMaps);

View File

@ -382,16 +382,16 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
// SalaryArchiveExcelBO.createExcelComment(excelComments, requireI18n + '' + SalaryI18nUtil.getI18nLabel(127641, "多个账套之间用,分隔"), 0, 0, 3, 3);
// int i = enableHr ? 10 : 9;
if (isPendingList) {
excelComments.add(new ExcelComment(6, 0, 8, 2, SalaryI18nUtil.getI18nLabel(100458, "格式样例为'2022-01-01'、'2022/1/1'")));
excelComments.add(new ExcelComment(7, 0, 9, 2, SalaryI18nUtil.getI18nLabel(100458, "格式样例为'2022-01-01'、'2022/1/1'")));
// excelComments.add(new ExcelComment(5, 0, 8, 2, SalaryI18nUtil.getI18nLabel(100458, "格式样例为'2022-01-01'、'2022/1/1'")));
} else if (isFixedList) {
if (isInit) {
excelComments.add(new ExcelComment(6, 0, 8, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,格式样例为'2022-01-01'、'2022/1/1'")));
excelComments.add(new ExcelComment(7, 0, 9, 2, SalaryI18nUtil.getI18nLabel(100458, "格式样例为'2022-01-01'、'2022/1/1'")));
excelComments.add(new ExcelComment(8, 0, 10, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,格式样例为'2022-01-01'、'2022/1/1'")));
} else if (isSalaryItemAdjust) {
excelComments.add(new ExcelComment(6, 0, 8, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,可填写如:入职,转正,调薪,晋升,降职,调岗,调岗调薪,离职,其他,初始化")));
excelComments.add(new ExcelComment(7, 0, 9, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,格式样例为'2022-01-01'、'2022/1/1'")));
excelComments.add(new ExcelComment(8, 0, 10, 2, SalaryI18nUtil.getI18nLabel(100458, "格式样例为'2022-01-01'、'2022/1/1'")));
excelComments.add(new ExcelComment(9, 0, 11, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,格式样例为'2022-01-01'、'2022/1/1'")));
} else if (isSalaryItemAdjust) {
excelComments.add(new ExcelComment(7, 0, 9, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,可填写如:入职,转正,调薪,晋升,降职,调岗,调岗调薪,离职,其他,初始化")));
excelComments.add(new ExcelComment(8, 0, 10, 2, SalaryI18nUtil.getI18nLabel(100458, "必填,格式样例为'2022-01-01'、'2022/1/1'")));
}
} else if (isSuspendList) {
// SalaryArchiveExcelBO.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(109736, "格式样例为'2022-01-01'、'2022/1/1'"), 0, 0, i + 1, i + 1);

View File

@ -337,7 +337,7 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
* @param salaryTemplate
* @return
*/
private SalaryBillSendDTO buildSendParams(SalarySendPO salarySend, String taxAgentName, SalaryTemplatePO salaryTemplate) {
public SalaryBillSendDTO buildSendParams(SalarySendPO salarySend, String taxAgentName, SalaryTemplatePO salaryTemplate) {
// 发送通道
Set<MessageChannelEnum> sendChannels = SalaryBillBO.buildSendChannels(salaryTemplate);
if (CollectionUtils.isEmpty(sendChannels)) {

View File

@ -160,7 +160,7 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary
// 查询薪资核算所用薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItemPOS = salaryAcctConfig.getSalarySobItems();
// 过滤在账套中隐藏的薪资项目
salarySobItemPOS = salarySobItemPOS.stream().filter(po -> po.getItemHide()==null || po.getItemHide() == 0).collect(Collectors.toList());
salarySobItemPOS = salarySobItemPOS.stream().filter(po -> po.getItemHide() == null || po.getItemHide() == 0).collect(Collectors.toList());
// 查询公式详情
Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
@ -230,7 +230,7 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary
Set<Long> includeSalaryItemIds = Sets.newHashSetWithExpectedSize(salaryItemPOS.size());
// 转换成薪资核算线下对比结果
List<Map<String, Object>> resultMapList = SalaryAcctResultBO.buildComparisonTableData(salaryItemPOS, salarySobEmpFieldPOS, simpleEmployees,
salaryAcctEmployeePOS, salaryAcctResultPOS, excelAcctResultPOS, taxAgentPOS, customParameters, salaryAcctEmployeeIds4ConsolidatedTax, includeSalaryItemIds);
salaryAcctEmployeePOS, salaryAcctResultPOS, excelAcctResultPOS, taxAgentPOS, customParameters, salaryAcctEmployeeIds4ConsolidatedTax, includeSalaryItemIds, queryParam.isDynamicEmpInfo());
// 系统值和线下值一致的人员
if (queryParam.isOnlyDiffEmployee()) {
// 过滤系统值和线下值一致的薪资核算人员

View File

@ -328,7 +328,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
// 从hrmresource和hrmresourcevirtual可能获取到重复人员数据需要根据人员id去重
result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new));
return SalaryI18nUtil.i18nList(result);
//部门分部等信息备份到核算人员表中不进行多语言处理
// return SalaryI18nUtil.i18nList(result);
return result;
}
/**

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Validator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -25,6 +26,7 @@ import com.engine.salary.entity.salaryBill.param.*;
import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO;
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
import com.engine.salary.entity.salaryacct.bo.SalaryAcctFormulaBO;
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
@ -564,13 +566,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
// }
// 获取薪资项目数据
SalaryAcctResultPO acctPo = new SalaryAcctResultPO();
acctPo.setDeleteType(0);
acctPo.setSalaryAcctRecordId(salarySendInfo.getSalaryAcctRecordId());
acctPo.setEmployeeId(currentEmployeeId);
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(acctPo);
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordId(salarySendInfo.getSalaryAcctRecordId()).employeeId(currentEmployeeId).build());
if (CollUtil.isEmpty(salaryAcctResultPOS)) {
throw new SalaryRunTimeException("薪资核算结果不存在!");
}
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salarySendInfo.getSalaryAcctRecordId());
@ -647,6 +646,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(salarySendInfo.getTaxAgentId());
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salarySendInfo.getEmployeeId());
SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctResultPOS.get(0).getSalaryAcctEmpId());
SalaryAcctEmployeeBO.copyAcctEmp(simpleEmployee, acctEmployeePO);
buildEmployeeInfo(employeeInformation, simpleEmployee, taxAgentPO.getName(), SalaryAcctResultBO.buildEmployeeFieldName());
map.put("employeeInformation", employeeInformation);
map.put("salaryGroups", itemSetListDTOS);
@ -700,6 +701,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
return map;
}
private Date getLimitMonth() {
//工资单时效性
salaryBillViewingLimitSetting salaryBillViewingLimitSetting = getSalaryBillBaseSetService(user).getSalaryBillViewingLimitSetting();
@ -941,7 +944,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
.jobtitleName(simpleEmployee.getJobtitleName())
.jobtitleId(simpleEmployee.getJobtitleId())
.status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus())
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(simpleEmployee.getStatus())).getDefaultLabel())
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(),"1"))).getDefaultLabel())
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
.workcode(StringUtils.isEmpty(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode())
@ -1834,4 +1837,191 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
public List<SalarySendPO> listSome(SalarySendPO param) {
return getSalarySendMapper().listSome(param);
}
@Override
public Map<String, Object> preview(SalaryPreviewParam param) {
Long salaryInfoId = param.getSalaryInfoId();
Long recipient = param.getRecipient();
if (salaryInfoId == null) {
throw new SalaryRunTimeException("工资单记录不存在!");
}
SalarySendInfoPO po = new SalarySendInfoPO();
po.setDeleteType(0);
po.setId(salaryInfoId);
List<SalarySendInfoPO> salarySendInfos = salarySendInfoMapper.listSome(po);
if (CollectionUtils.isEmpty(salarySendInfos)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
}
SalarySendInfoPO salarySendInfo = salarySendInfos.get(0);
// 获取默认模板信息
SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId());
if (salarySendPO == null) {
throw new SalaryRunTimeException("工资单不存在");
}
SalarySendPO sendPo = new SalarySendPO();
sendPo.setDeleteType(0);
sendPo.setId(salarySendInfo.getSalarySendId());
List<SalarySendPO> salarySends = mapper.listSome(sendPo);
if (CollectionUtils.isEmpty(salarySends)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100512, "工资单发放不存在"));
}
SalarySendPO salarySend = salarySends.get(0);
Date salaryMonth = salarySend.getSalaryMonth();
// 获取模板
SalarySobPO salarySob = getSalarySobService(user).getById(salarySend.getSalarySobId());
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(salarySendInfo.getTaxAgentId());
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Arrays.asList(salarySend.getSalarySobId(), salarySob.getId()));
if (CollectionUtils.isEmpty(salaryTemplates)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100518, "没有默认模板,无法发送"));
}
SalaryBillSendDTO salaryBillSendDTO = getSalaryBillService(user).buildSendParams(sendPo, taxAgentPO.getName(), salaryTemplates.get(0));
SalaryTemplatePO salaryTemplate = salaryBillSendDTO.getSalaryTemplate();
if (salaryTemplate==null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100513, "没有默认模板,无法查看"));
}
// 判断是否是补发
boolean isReplenish = NumberUtils.INTEGER_ONE.equals(salarySendInfo.getSalaryAcctType());
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordId(salarySendInfo.getSalaryAcctRecordId()).employeeId(recipient).build());
if (CollUtil.isEmpty(salaryAcctResultPOS)) {
throw new SalaryRunTimeException("薪资核算结果不存在!");
}
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salarySendInfo.getSalaryAcctRecordId());
if (salaryAcctRecordPO == null) {
throw new SalaryRunTimeException("薪资核算记录不存在!");
}
List<Map<String, Object>> salaryAcctResultS = null;
if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && !isReplenish) {
// 该记录回算过,并且获取的不是回算后的工资单
salaryAcctResultS = salaryAcctResultPOS.stream().map(m -> {
Map<String, Object> map = new LinkedHashMap<>();
map.put("salaryItemId", m.getSalaryItemId());
map.put("resultValue", m.getOriginResultValue());
return map;
}).collect(Collectors.toList());
} else {
salaryAcctResultS = salaryAcctResultPOS.stream().map(m -> {
Map<String, Object> map = new LinkedHashMap<>();
map.put("salaryItemId", m.getSalaryItemId());
map.put("resultValue", m.getResultValue());
return map;
}).collect(Collectors.toList());
}
Map<String, Object> map = new LinkedHashMap<>();
map.put("tenantName", "");
map.put("sendTime", SalaryDateUtil.getFormatLocalDateTime(salarySendInfo.getSendTime()));
List<SalaryTemplateSalaryItemSetListDTO> listDTOS = JSONArray.parseArray(isReplenish ? salaryTemplate.getReplenishSalaryItemSetting() : salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
Optional<SalaryTemplateSalaryItemSetListDTO> optionalEmployeeInformation = listDTOS.stream().filter(e -> SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).findFirst();
SalaryTemplateSalaryItemSetListDTO employeeInformation = optionalEmployeeInformation.orElse(null);
List<SalaryTemplateSalaryItemSetListDTO> itemSetListDTOS = listDTOS.stream().filter(e -> !SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).collect(Collectors.toList());
List<Map<String, Object>> finalSalaryAcctResultS = salaryAcctResultS;
itemSetListDTOS.stream().forEach(item -> {
item.getItems()
.forEach(e -> {
if (CollectionUtils.isEmpty(finalSalaryAcctResultS)) {
e.setSalaryItemValue("");
} else {
Object o = finalSalaryAcctResultS.stream()
.filter(f -> f.get("salaryItemId") != null && String.valueOf(f.get("salaryItemId")).equals(e.getSalaryItemId())).findFirst()
.orElse(new HashMap<>())
.get("resultValue");
e.setSalaryItemValue(o == null ? "" : (String) o);
}
});
});
/**
* 过滤空
*/
if (Objects.equals(1, salaryTemplate.getSalaryItemNullStatus())) {
for (SalaryTemplateSalaryItemSetListDTO itemSetListDTO : itemSetListDTOS) {
List<SalaryTemplateSalaryItemListDTO> items = itemSetListDTO.getItems();
List<SalaryTemplateSalaryItemListDTO> collect = items.stream().filter(item -> StringUtils.isNotBlank(item.getSalaryItemValue())).collect(Collectors.toList());
itemSetListDTO.setItems(collect);
}
}
/**
* 过滤0
*/
if (Objects.equals(1, salaryTemplate.getSalaryItemZeroStatus())) {
for (SalaryTemplateSalaryItemSetListDTO itemSetListDTO : itemSetListDTOS) {
List<SalaryTemplateSalaryItemListDTO> items = itemSetListDTO.getItems();
List<SalaryTemplateSalaryItemListDTO> collect = items.stream()
.filter(item -> SalaryEntityUtil.string2BigDecimal(item.getSalaryItemValue()) == null
|| BigDecimal.ZERO.compareTo(SalaryEntityUtil.string2BigDecimal(item.getSalaryItemValue())) != 0)
.collect(Collectors.toList());
itemSetListDTO.setItems(collect);
}
}
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salarySendInfo.getEmployeeId());
SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctResultPOS.get(0).getSalaryAcctEmpId());
SalaryAcctEmployeeBO.copyAcctEmp(simpleEmployee, acctEmployeePO);
buildEmployeeInfo(employeeInformation, simpleEmployee, taxAgentPO.getName(), SalaryAcctResultBO.buildEmployeeFieldName());
map.put("employeeInformation", employeeInformation);
map.put("salaryGroups", itemSetListDTOS);
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, recipient));
// 工资单水印文本型动态变量 == 处理
handleSalaryWatermark(salaryTemplate, salarySendInfo, recipient);
map.put("salaryTemplate", salaryTemplate);
map.put("salaryAcctResult", salaryAcctResultS);
// 工资单确认按钮
if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(), 1) == 0) {
// 开启了工资单确认
Integer ackStatus = salarySendInfo.getBillConfirmStatus();
if (ackStatus == null || ackStatus != BillConfimStatusEnum.CONFIRMED.getValue()) {
map.put("showAck", "1");
} else {
map.put("showAck", "0");
}
map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId());
} else {
map.put("showAck", "0");
}
// 工资单反馈
if (NumberUtils.compare(salaryTemplate.getFeedbackStatus(), 1) == 0) {
// 开启了工资单反馈按钮
Integer confirmStatus = salarySendInfo.getBillConfirmStatus();
map.put("showFeedback", "1");
// 除非确认状态为已确认否则可以一直反馈
if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(), 1) == 0 && confirmStatus != null && confirmStatus == BillConfimStatusEnum.CONFIRMED.getValue()) {
map.put("showFeedback", "0");
}
map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId());
} else {
map.put("showFeedback", "0");
}
// 记录查看日志
String targetName = taxAgentPO.getName() + "-" + SalaryDateUtil.getFormatYearMonth(salarySendInfo.getSalaryMonth());
LoggerContext<SalaryItemPO> loggerContext = new LoggerContext<>();
loggerContext.setUser(user);
loggerContext.setTargetId(String.valueOf(salarySendInfo.getId()));
loggerContext.setTargetName(targetName);
loggerContext.setOperateType(OperateTypeEnum.READ.getValue());
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "预览工资单") + ": " + targetName + " " + salaryInfoId);
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "预览工资单") + ": " + targetName);
SalaryElogConfig.mySalaryBillLoggerTemplate.write(loggerContext);
return map;
}
}

View File

@ -566,7 +566,20 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
String formulaContent = CollectionUtils.isEmpty(expressFormulas) ? "" : expressFormulas.get(0).getFormula();
Integer valueType = salarySobItemPO.getValueType() == null ? salaryItemPO.getValueType() : salarySobItemPO.getValueType();
salarySobItemFormDTO.setId(salarySobItemPO.getId()).setName(salaryItemPO.getName()).setItemHide(Integer.valueOf(salarySobItemPO.getItemHide().toString())).setDataType(salaryItemPO.getDataType()).setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()).setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()).setValueType(valueType).setFormulaId(salarySobItemPO.getFormulaId()).setFormulaContent(CollectionUtils.isNotEmpty(expressFormulas) ? formulaContent : "").setOriginFormulaContent(valueType.equals(SalaryValueTypeEnum.FORMULA.getValue()) ? formulaContent : "").setOriginSqlContent(valueType.equals(SalaryValueTypeEnum.SQL.getValue()) ? formulaContent : "").setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()).setDescription(salarySobItemPO.getDescription()).setCanEdit((openFormulaForcedEditing || salaryItemPO.getCanEdit().equals(1)) ? 1 : 0);
salarySobItemFormDTO
.setId(salarySobItemPO.getId())
.setName(salaryItemPO.getName())
.setItemHide(salarySobItemPO.getItemHide()==null?0:Integer.parseInt(salarySobItemPO.getItemHide().toString()))
.setDataType(salaryItemPO.getDataType())
.setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode())
.setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern())
.setValueType(valueType).setFormulaId(salarySobItemPO.getFormulaId())
.setFormulaContent(CollectionUtils.isNotEmpty(expressFormulas) ? formulaContent : "")
.setOriginFormulaContent(valueType.equals(SalaryValueTypeEnum.FORMULA.getValue()) ? formulaContent : "")
.setOriginSqlContent(valueType.equals(SalaryValueTypeEnum.SQL.getValue()) ? formulaContent : "")
.setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
.setDescription(salarySobItemPO.getDescription())
.setCanEdit((openFormulaForcedEditing || salaryItemPO.getCanEdit().equals(1)) ? 1 : 0);
}
return salarySobItemFormDTO;
}

View File

@ -317,7 +317,7 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
List<SalaryTemplateSalaryItemListDTO> newItems = new ArrayList<>();
for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) {
SalarySobEmpFieldPO empFieldPO = getSalarySobEmpFieldMapper().getById(Long.valueOf(templateItem.getSalaryItemId()));
if (empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) {
if (empFieldPO != null && empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) {
templateItem.setId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString());
templateItem.setSalaryItemId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString());
newItems.add(templateItem);
@ -341,7 +341,7 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
List<SalaryTemplateSalaryItemListDTO> newItems = new ArrayList<>();
for (SalaryTemplateSalaryItemListDTO templateItem : salaryItemSetting.getItems()) {
SalarySobEmpFieldPO empFieldPO = getSalarySobEmpFieldMapper().getById(Long.valueOf(templateItem.getSalaryItemId()));
if (empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) {
if (empFieldPO != null && empFieldCodeList.contains(empFieldPO.getFieldCode()) && empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()) != null) {
templateItem.setId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString());
templateItem.setSalaryItemId(empFieldCodeWithIdMap.get(empFieldPO.getFieldCode()).toString());
newItems.add(templateItem);

View File

@ -323,6 +323,20 @@ public class SalaryBillController {
return new ResponseResult<Long, SalarySendBaseInfoDTO>(user).run(getSalarySendWrapper(user)::getBaseInfo, id);
}
/**
* 预览工资单
*
* @param param
* @return
*/
@POST
@Path("/preview")
@Produces(MediaType.APPLICATION_JSON)
public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryPreviewParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryPreviewParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::preview, param);
}
/**
* 工资单发放信息列表的高级搜索
*
@ -563,6 +577,7 @@ public class SalaryBillController {
/**
* 下载pdf前先进行校验 生成
*
* @param request
* @param response
* @return

View File

@ -219,6 +219,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
return getSalarySendService(user).getBaseInfo(id);
}
public Map<String, Object> preview(SalaryPreviewParam param) {
return getSalarySendService(user).preview(param);
}
/**
* 工资单发放信息列表的高级搜索
*