Merge branch 'release/2.16.1.2410.01' into release/个税版本

# Conflicts:
#	src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java
#	src/com/engine/salary/web/SalaryCommonController.java
#	src/com/engine/salary/wrapper/SalaryCommonWrapper.java
This commit is contained in:
钱涛 2024-11-12 18:01:22 +08:00
commit af7d51ac79
108 changed files with 3476 additions and 390 deletions

View File

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

View File

@ -0,0 +1,70 @@
update hrsa_bill_detail 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,30 @@
CREATE TABLE hrsa_page_link
(
id NUMBER(38,0) primary key NOT NULL,
employee_id NUMBER(38,0),
page varchar2(200),
template_id NUMBER(38,0),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_page_list_template
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
page varchar2(200),
shared_type number,
limit_ids varchar2(2000),
setting CLOB,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

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

View File

@ -0,0 +1,70 @@
update hrsa_bill_detail 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,30 @@
CREATE TABLE hrsa_page_link
(
id NUMBER(38,0) primary key NOT NULL,
employee_id NUMBER(38,0),
page varchar2(200),
template_id NUMBER(38,0),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_page_list_template
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
page varchar2(200),
shared_type number,
limit_ids varchar2(2000),
setting CLOB,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

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

View File

@ -0,0 +1,70 @@
update hrsa_bill_detail 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,30 @@
CREATE TABLE hrsa_page_link
(
id NUMBER(38,0) primary key NOT NULL,
employee_id NUMBER(38,0),
page varchar2(200),
template_id NUMBER(38,0),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_page_list_template
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
page varchar2(200),
shared_type number,
limit_ids varchar2(2000),
setting CLOB,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -0,0 +1,22 @@
ALTER TABLE hrsa_bill_detail_temp
ADD COLUMN subcompany_name text ,
ADD COLUMN subcompany_id bigint(0),
ADD COLUMN department_name text ,
ADD COLUMN department_id bigint(0),
ADD COLUMN jobtitle_name text ,
ADD COLUMN jobtitle_id bigint(0) ,
ADD COLUMN jobcall text ,
ADD COLUMN jobcall_id bigint(0),
ADD COLUMN status text ;
ALTER TABLE hrsa_bill_detail
ADD COLUMN subcompany_name text ,
ADD COLUMN subcompany_id bigint(0),
ADD COLUMN department_name text ,
ADD COLUMN department_id bigint(0),
ADD COLUMN jobtitle_name text ,
ADD COLUMN jobtitle_id bigint(0) ,
ADD COLUMN jobcall text ,
ADD COLUMN jobcall_id bigint(0),
ADD COLUMN status text ;

View File

@ -0,0 +1,29 @@
update hrsa_bill_detail 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,28 @@
CREATE TABLE hrsa_page_link
(
id bigint(0) NOT NULL,
employee_id bigint(0),
page varchar(200),
template_id bigint(0),
creator bigint(0),
create_time datetime(0),
update_time datetime(0),
delete_type int(0),
tenant_key varchar(10),
PRIMARY KEY (id) USING BTREE
);
CREATE TABLE hrsa_page_list_template (
id bigint(0) NOT NULL,
name varchar(200),
page varchar(200),
shared_type int(0),
limit_ids varchar(2000),
setting text,
creator bigint(0),
create_time datetime(0),
update_time datetime(0),
delete_type int(0),
tenant_key varchar(10),
PRIMARY KEY (id) USING BTREE
);

View File

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

View File

@ -0,0 +1,69 @@
update hrsa_bill_detail 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,29 @@
CREATE TABLE hrsa_page_link
(
id NUMBER(38,0) primary key NOT NULL,
employee_id NUMBER(38,0),
page varchar2(200),
template_id NUMBER(38,0),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/
CREATE TABLE hrsa_page_list_template
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
page varchar2(200),
shared_type number,
limit_ids varchar2(2000),
setting CLOB,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
)
/

View File

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

View File

@ -0,0 +1,68 @@
update hrsa_bill_detail 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 @@
create table hrsa_page_link
(
id bigint primary key,
employee_id bigint,
page varchar(200),
template_id bigint,
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10)
);
create table hrsa_page_list_template
(
id bigint primary key,
name varchar(200),
page varchar(200),
shared_type int,
limit_ids varchar(2000),
setting text,
creator bigint,
create_time timestamp,
update_time timestamp,
delete_type int,
tenant_key varchar(10)
);

View File

@ -0,0 +1,23 @@
ALTER TABLE hrsa_bill_detail_temp
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
ALTER TABLE hrsa_bill_detail
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_bill_detail
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_bill_detail 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,29 @@
create table hrsa_page_link
(
id bigint primary key,
employee_id bigint,
page varchar(200),
template_id bigint,
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10)
)
GO
create table hrsa_page_list_template
(
id bigint primary key,
name varchar(200),
page varchar(200),
shared_type int,
limit_ids varchar(2000),
setting text,
creator bigint,
create_time datetime,
update_time datetime,
delete_type int,
tenant_key varchar(10)
)
GO

View File

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

View File

@ -0,0 +1,70 @@
update hrsa_bill_detail 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,30 @@
CREATE TABLE hrsa_page_link
(
id NUMBER(38,0) primary key NOT NULL,
employee_id NUMBER(38,0),
page varchar2(200),
template_id NUMBER(38,0),
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/
CREATE TABLE hrsa_page_list_template
(
id NUMBER(38,0) primary key NOT NULL,
name varchar2(200),
page varchar2(200),
shared_type number,
limit_ids varchar2(2000),
setting CLOB,
creator NUMBER(38,0),
create_time date,
update_time date,
delete_type number,
tenant_key varchar2(10)
);
/

View File

@ -1,5 +1,9 @@
select id from hrsa_tax_agent_emp
where tax_agent_id =id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =id and delete_type = 0)
where tax_agent_id =id
and delete_type = 0
and employee_id not in
(select employee_id from hrsa_salary_archive
where tax_agent_id =id and delete_type = 0)
update hrsa_tax_agent_emp set delete_type = 3

View File

@ -52,6 +52,9 @@ public class InitSalaryAction implements Action {
private String tableName;
private String archiveStatus;
public String getTableName() {
return tableName;
}
@ -132,6 +135,10 @@ public class InitSalaryAction implements Action {
.importDatas(importData)
.build();
if (StringUtils.isNotBlank(archiveStatus) && archiveStatus.equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
build.setKeepStatus(true);
}
//操作人
String uid = importDataMap.getOrDefault("操作人", "1").toString();
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).importSalaryArchiveInit(build);

View File

@ -5,14 +5,12 @@ import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIArchivesService;
import com.engine.salary.service.impl.SIArchivesServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -89,11 +87,24 @@ public class StayDelToStopSIArchiveAction implements Action {
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
String payEndYearMonth = importDataMap.getOrDefault("最后缴纳月", "").toString();
// 如果只有一个最后缴纳月 代表社保公积金其他均使用同一个最后缴纳月
String fundEndYearMonth = importDataMap.getOrDefault("公积金最后缴纳月", "").toString();
String otherEndYearMonth = importDataMap.getOrDefault("其他福利最后缴纳月", "").toString();
if (StrUtil.isNotBlank(payEndYearMonth) && !SalaryDateUtil.checkYearMonth(payEndYearMonth)) {
requestInfo.getRequestManager().setMessage("最后缴纳月格式有误,正确格式示例为'2021-01'");
return FAILURE_AND_CONTINUE;
}
if (StrUtil.isNotBlank(fundEndYearMonth) && !SalaryDateUtil.checkYearMonth(fundEndYearMonth)) {
requestInfo.getRequestManager().setMessage("公积金最后缴纳月格式有误,正确格式示例为'2021-01'");
return FAILURE_AND_CONTINUE;
}
if (StrUtil.isNotBlank(otherEndYearMonth) && !SalaryDateUtil.checkYearMonth(otherEndYearMonth)) {
requestInfo.getRequestManager().setMessage("其他福利最后缴纳月格式有误,正确格式示例为'2021-01'");
return FAILURE_AND_CONTINUE;
}
//操作人
String uid = importDataMap.getOrDefault("操作人","1").toString();
User user = new User(Integer.parseInt(uid));
@ -111,7 +122,7 @@ public class StayDelToStopSIArchiveAction implements Action {
if (StrUtil.isBlank(payEndYearMonth)) {
resultMap = getSIArchivesService(user).stayDelToStop(Collections.singletonList(insuranceArchivesBaseInfoPO.getId()));
} else {
resultMap = getSIArchivesService(user).stopWithoutLimit(Collections.singletonList(insuranceArchivesBaseInfoPO.getId()), payEndYearMonth);
resultMap = getSIArchivesService(user).stopWithoutLimit(Collections.singletonList(insuranceArchivesBaseInfoPO.getId()), payEndYearMonth, fundEndYearMonth, otherEndYearMonth);
}
if (resultMap.get("type").toString().equals("fail")) {
requestInfo.getRequestManager().setMessage(resultMap.get("msg").toString());

View File

@ -517,7 +517,7 @@ public class SIAccountBiz extends Service {
//临时表数据入库
if (CollectionUtils.isNotEmpty(list)) {
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 40);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 20);
lists.forEach(subList -> {
getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList);
});

View File

@ -20,6 +20,8 @@ public class AESEncryptUtil {
static String aesEncryptScrect = bb.getPropValue("hrmSalary", "AESEncryptScrect");
static String aes4SalaryBillEncryptScrect = "OETEP8JBA1C8IH721C1513AE82IFPE5";
/**
* AES加密
*
@ -34,6 +36,31 @@ public class AESEncryptUtil {
return source;
}
/**
* 工资单推送-员工id加密
* @param source
* @return
*/
public static String encrypt4SalaryBill(String source) {
//防止初始化老数据时二次加密
if (StringUtils.isNotBlank(source) && !source.startsWith(SalarySysConstant.SALARY_BILL_PRE_SIGN_ENCRYPT)) {
return SalarySysConstant.SALARY_BILL_PRE_SIGN_ENCRYPT + AES.encrypt(source, aes4SalaryBillEncryptScrect);
}
return source;
}
public static String decrypt4SalaryBill(String encryptStr) {
if (StringUtils.isNotBlank(encryptStr)) {
if (encryptStr.startsWith(SalarySysConstant.SALARY_BILL_PRE_SIGN_ENCRYPT)) {
encryptStr = encryptStr.substring(4, encryptStr.length());
return AES.decrypt(encryptStr, aes4SalaryBillEncryptScrect);
} else {
return "";
}
}
return encryptStr;
}
/**
* AES解密

View File

@ -9,6 +9,7 @@ import com.engine.salary.constant.HrmSalaryPayrollConf;
import com.engine.salary.constant.SalaryArchiveConstant;
import com.engine.salary.constant.SalaryBillConstant;
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryBill.dto.*;
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
@ -248,9 +249,9 @@ public class SalaryBillBO {
String title = billTitle; // 标题
String context = "点击查看详情"; // 内容
// PC端链接
String linkUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=" + id + "&recipient=" + employeeId;
String linkUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=" + id + "&salaryCode=" + AESEncryptUtil.encrypt4SalaryBill(employeeId.toString());
// 移动端链接
String linkMobileUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?type=phone&id=" + id + "&recipient=" + employeeId;
String linkMobileUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?type=phone&id=" + id + "&salaryCode=" + AESEncryptUtil.encrypt4SalaryBill(employeeId.toString());
try {
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(Integer.parseInt(salaryBillSendParam.getSendUser().getUID() + ""));// 创建人id

View File

@ -0,0 +1,26 @@
package com.engine.salary.entity.salaryBill.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName SalaryBillGetTokenParam
* @author Harryxzy
* @date 2024/11/6 9:59
* @description 第三方获取token参数
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryBillGetTokenParam {
//
private String salaryCode;
// 未加密
private String recipient;
}

View File

@ -161,7 +161,7 @@ public class SalaryAcctEmployeePO {
/**
* 状态
*/
@SalaryFormulaVar(defaultLabel = "状态", labelId = 86321, dataType = "string")
@SalaryFormulaVar(defaultLabel = "状态编码", labelId = 86321, dataType = "string")
private String status;
//锁定的项目

View File

@ -12,13 +12,12 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO;
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.google.common.collect.Lists;
import com.engine.salary.util.db.IdGenerator;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -285,40 +284,42 @@ public class SalaryArchiveBO {
// 如果是新增 说明如果没有档案则新增如果有档案而且是停薪就挪到待定薪中以个税扣缴义务人和人员id判断唯一
if (change.getChangeType() == TaxAgentEmpChangeTypeEnum.ADD.getValue()) {
if (salaryArchive != null) {
// 停薪中跳回待定薪从a调动到b又调动到a或者是删除待办后再覆盖
if (stopStatus.contains(salaryArchive.getRunStatus())) {
// 跳回待定薪
salaryArchive.setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
if (salaryArchive.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
salaryArchive.setPayStartDate(today);
salaryArchive.setPayEndDate(null);
}
salaryArchiveUpdateTodoList.add(salaryArchive);
// 待停薪到停薪的就要复制最新的薪资项目
if (salaryArchive.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
// 拷贝最新的薪资项目数据
List<SalaryArchiveItemPO> salaryArchiveItemValuelList = salaryArchiveItemList.stream().filter(i -> i.getSalaryArchiveId().equals(salaryArchive.getId())).collect(Collectors.toList());
salaryArchiveItemValuelList.forEach(i -> {
salaryArchiveItemAddTodos.add(SalaryArchiveItemPO.builder()
.id(IdGenerator.generate())
.salaryArchiveId(salaryArchive.getId())
.employeeId(salaryArchive.getEmployeeId())
.effectiveTime(today)
.adjustReason(SalaryArchiveItemAdjustReasonEnum.INIT.getValue())
.salaryItemId(i.getSalaryItemId())
.itemValue(i.getItemValue())
.description("")
// 不用设置操作人
.operateTime(now)
.createTime(now)
.updateTime(now)
.creator(currentEmployeeId)
.deleteType(NumberUtils.INTEGER_ZERO)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.build());
});
}
}
//存在历史档案不做处理
// // 停薪中跳回待定薪从a调动到b又调动到a或者是删除待办后再覆盖
// if (stopStatus.contains(salaryArchive.getRunStatus())) {
// // 跳回待定薪
// salaryArchive.setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
// if (salaryArchive.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
// salaryArchive.setPayStartDate(today);
// salaryArchive.setPayEndDate(null);
// }
// salaryArchiveUpdateTodoList.add(salaryArchive);
// // 待停薪到停薪的就要复制最新的薪资项目
// if (salaryArchive.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
// // 拷贝最新的薪资项目数据
// List<SalaryArchiveItemPO> salaryArchiveItemValuelList = salaryArchiveItemList.stream().filter(i -> i.getSalaryArchiveId().equals(salaryArchive.getId())).collect(Collectors.toList());
// salaryArchiveItemValuelList.forEach(i -> {
// salaryArchiveItemAddTodos.add(SalaryArchiveItemPO.builder()
// .id(IdGenerator.generate())
// .salaryArchiveId(salaryArchive.getId())
// .employeeId(salaryArchive.getEmployeeId())
// .effectiveTime(today)
// .adjustReason(SalaryArchiveItemAdjustReasonEnum.INIT.getValue())
// .salaryItemId(i.getSalaryItemId())
// .itemValue(i.getItemValue())
// .description("")
// // 不用设置操作人
// .operateTime(now)
// .createTime(now)
// .updateTime(now)
// .creator(currentEmployeeId)
// .deleteType(NumberUtils.INTEGER_ZERO)
// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
// .build());
// });
// }
// }
} else {
salaryArchiveAddTodoList.add(SalaryArchivePO.builder()
.id(IdGenerator.generate())

View File

@ -760,7 +760,8 @@ public class SalaryArchiveExcelBO extends Service {
// 待停薪导入
|| ((sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) && importHandleParam.isSuspendList());
if (isEnabled) {
if (importHandleParam.isInit()) {
if (importHandleParam.isInit() &&
(importHandleParam.getKeepStatus() == null || importHandleParam.getKeepStatus().equals(Boolean.FALSE))) {
sa.setRunStatus(SalaryArchiveStatusEnum.FIXED.getValue());
}
// sa.setModifier(importHandleParam.getCurrentEmployeeId());
@ -782,6 +783,10 @@ public class SalaryArchiveExcelBO extends Service {
.deleteType(NumberUtils.INTEGER_ZERO)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.build();
// 定薪action 保持状态为待定薪
if (importHandleParam.isInit() && importHandleParam.getKeepStatus() != null && importHandleParam.getKeepStatus().equals(Boolean.TRUE)) {
salaryArchive.setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
}
importHandleParam.getSalaryArchiveSaves().add(salaryArchive);
}
return salaryArchive;

View File

@ -42,4 +42,9 @@ public class SalaryArchiveImportActionParam {
* 说明
*/
private String description;
/**
* 档案状态是否保持不变
*/
private Boolean keepStatus;
}

View File

@ -172,4 +172,9 @@ public class SalaryArchiveImportHandleParam {
* 薪资档案-账套关联
*/
List<SalarySobRangeSaveParam> salaryArchiveSobSaves;
/**
* 薪资档案状态是否保持不变
*/
Boolean keepStatus;
}

View File

@ -112,4 +112,10 @@ public class SalaryArchiveQueryParam extends BaseQueryParam {
// 最后发薪日期止
private Date payEndDateEndDate;
// 调薪起始日期
private Date adjustSalaryStartDate;
// 调薪结束日期
private Date adjustSalaryEndDate;
}

View File

@ -57,35 +57,6 @@ public class SalarySobRangeBO {
resultParams.add(queryParam);
});
return resultParams;
// Map<Integer, List<SalarySobRangePO>> rangeMap = SalaryEntityUtil.group2Map(salarySobRanges, SalarySobRangePO::getTargetType);
// List<SalarySobRangeEmpQueryParam> resultParams = Lists.newArrayListWithExpectedSize(rangeMap.size());
// rangeMap.forEach((targetType, salarySobRangePOS) -> {
// List<String> employeeStatus = salarySobRangePOS.stream()
// .map(e -> SalaryEmployeeStatusEnum.parseByValue(e.getEmployeeStatus()))
// .filter(Objects::nonNull)
// .map(e -> e.name().toLowerCase())
// .distinct()
// .collect(Collectors.toList());
// if (employeeStatus.contains(SalaryEmployeeStatusEnum.ALL.name().toLowerCase())) {
// employeeStatus = Collections.emptyList();
// }
// if (employeeStatus.contains(SalaryEmployeeStatusEnum.NORMAL.name().toLowerCase())) {
// employeeStatus = UserStatusEnum.getNormalStatus();
// }
// if (employeeStatus.contains(SalaryEmployeeStatusEnum.UNAVAILABLE.name().toLowerCase())) {
// employeeStatus = UserStatusEnum.getUnavailableStatus();
// }
// TargetTypeEnum targetTypeEnum = TargetTypeEnum.parseByValue(targetType);
// SalarySobRangeEmpQueryParam queryParam = SalarySobRangeEmpQueryParam.builder()
// .targetType(Optional.ofNullable(targetTypeEnum).map(TargetTypeEnum::name).orElse(StringUtils.EMPTY))
// .targetIds(SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getTargetId))
// .employeeStatus(employeeStatus)
// .build();
// resultParams.add(queryParam);
// });
// return resultParams;
}
/**
@ -117,7 +88,7 @@ public class SalarySobRangeBO {
return SalarySobRangeListDTO.builder()
.id(salarySobRangePO.getId())
.salarySobId(salarySobRangePO.getSalarySobId())
.targetType(targetTypeEnum != null ? targetTypeEnum.getValue() : -1)
.targetType(targetTypeEnum)
.targetTypeName(Optional.ofNullable(targetTypeEnum)
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
.orElse(StringUtils.EMPTY))
@ -125,6 +96,7 @@ public class SalarySobRangeBO {
.target(salarySobRangePO.getTarget())
.targetName(buildTargetName(salarySobRangePO, employeeComInfoMap, departmentComInfoMap, subCompanyComInfoMap, positionComInfoMap))
.employeeStatus(employeeStatusesStr)
.status(parseByStatuses(salarySobRangePO.getEmployeeStatuses()))
.build();
})
.collect(Collectors.toList());
@ -150,6 +122,20 @@ public class SalarySobRangeBO {
return sb.toString();
}
private static String parseByStatuses(String employeeStatuses) {
String[] split = employeeStatuses.split(",");
List<Integer> enumsList = Arrays.asList(split).stream().map(item -> Integer.valueOf(item)).collect(Collectors.toList());
List<SalaryEmployeeStatusEnum> salaryEmployeeStatusEnums = SalaryEmployeeStatusEnum.parseByValues(enumsList);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < salaryEmployeeStatusEnums.size(); i++) {
sb.append(salaryEmployeeStatusEnums.get(i));
if (i + 1 != salaryEmployeeStatusEnums.size()) {
sb.append(",");
}
}
return sb.toString();
}
/**
* 解析薪资账套人员范围中对象的名称可能是人员名称部门名称岗位名称
*

View File

@ -37,7 +37,7 @@ public class SalarySobRangeListDTO {
*
* @see TargetTypeEnum
*/
private Integer targetType;
private TargetTypeEnum targetType;
@SalaryTableColumn(text = "对象类型", width = "10%", column = "targetTypeName")
@TableTitle(title = "对象类型", dataIndex = "targetTypeName", key = "targetTypeName")
@ -54,4 +54,6 @@ public class SalarySobRangeListDTO {
@SalaryTableColumn(text = "员工状态", width = "10%", column = "employeeStatus")
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
private String employeeStatus;
private String status;
}

View File

@ -4,6 +4,7 @@ import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
import com.engine.salary.enums.salarysob.TargetTypeEnum;
import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.engine.salary.util.valid.ValidTypeEnum;
import lombok.Data;
@ -22,6 +23,9 @@ import java.util.List;
//薪资账套人员范围保存参数")
public class SalarySobRangeSaveParam {
@DataCheck(require = true, message = "ID不允许为空",runtime = {RuntimeTypeEnum.UPDATE})
private Long id;
//薪资账套的id
@DataCheck(require = true, message = "薪资账套的ID不允许为空")
@ElogTransform( name = "薪资账套id" )

View File

@ -5,9 +5,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor

View File

@ -0,0 +1,20 @@
package com.engine.salary.entity.setting.dto;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListTemplateDTO {
private List<WeaTableColumn> setting;
private List<WeaTableColumn> checked;
}

View File

@ -0,0 +1,21 @@
package com.engine.salary.entity.setting.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListColumnsQueryParam {
@DataCheck(require = true,message = "请选择页面")
private String page;
}

View File

@ -0,0 +1,31 @@
package com.engine.salary.entity.setting.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListTemplateChangeParam {
/**
* 页面0薪资明细
*/
@DataCheck(require = true,message = "请选择页面")
private String page;
/**
* 模板id
*/
@DataCheck(require = true,message = "请选择模板")
private Long templateId;
}

View File

@ -0,0 +1,27 @@
package com.engine.salary.entity.setting.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListTemplateQueryParam {
private Long id;
@DataCheck(require = true,message = "请选择页面")
private String page;
/**
* 字段name
*/
private String name;
}

View File

@ -0,0 +1,43 @@
package com.engine.salary.entity.setting.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListTemplateSaveParam {
private Long id;
/**
* 页面0薪资明细
*/
@DataCheck(require = true,message = "请选择页面")
private String page;
/**
* 模板名称
*/
@DataCheck(require = true,message = "请选择模板名称")
private String name;
@DataCheck(require = true,message = "请选择共享类型")
private Integer sharedType;
private List<Long> limitIds;
/**
* 设置
*/
@DataCheck(require = true,message = "请选择设置")
private List<String> setting;
}

View File

@ -0,0 +1,70 @@
package com.engine.salary.entity.setting.po;
import com.engine.hrmelog.annotation.ElogTransform;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageLinkPO {
@ElogTransform(name = "id")
private Long id;
@ElogTransform(name = "人员id")
private Long employeeId;
/**
* 页面
*/
@ElogTransform(name = "页面")
private String page;
/**
* 页面模板id
*/
@ElogTransform(name = "页面模板id")
private Long templateId;
/**
* 租户ID
*/
@ElogTransform(name = "租户ID")
private String tenantKey;
/**
* 更新时间
*/
@ElogTransform(name = "更新时间")
private Date updateTime;
/**
* 创建时间
*/
@ElogTransform(name = "创建时间")
private Date createTime;
/**
* 创建人
*/
@ElogTransform(name = "创建人")
private Long creator;
/**
* 是否已删除0未删除1已删除
*/
@ElogTransform(name = "是否已删除。0未删除、1已删除")
private Integer deleteType;
//主键id集合
private Collection<Long> ids;
}

View File

@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
* 薪资帐套表
@ -18,8 +19,7 @@ import java.util.Date;
@AllArgsConstructor
public class PageListSettingPO {
@ElogTransform(name = "")
@ElogTransform(name = "id")
private Long id;
/**
@ -32,7 +32,7 @@ public class PageListSettingPO {
* 设置
*/
@ElogTransform(name = "设置")
private String setting;
private List<Long> setting;
/**

View File

@ -0,0 +1,94 @@
package com.engine.salary.entity.setting.po;
import com.engine.hrmelog.annotation.ElogTransform;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
* 薪资帐套表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageListTemplatePO {
@ElogTransform(name = "id")
private Long id;
/**
* 模板名称
*/
@ElogTransform(name = "模板名称")
private String name;
/**
* 页面
*/
@ElogTransform(name = "页面")
private String page;
/**
* 设置
*/
@ElogTransform(name = "设置")
private List<String> setting;
/**
* 是否共享,0否1是
*/
@ElogTransform(name = "是否共享,0否1是")
private Integer sharedType;
/**
* 限制
*/
@ElogTransform(name = "限制")
private List<Long> limitIds;
/**
* 租户ID
*/
@ElogTransform(name = "租户ID")
private String tenantKey;
/**
* 更新时间
*/
@ElogTransform(name = "更新时间")
private Date updateTime;
/**
* 创建时间
*/
@ElogTransform(name = "创建时间")
private Date createTime;
/**
* 创建人
*/
@ElogTransform(name = "创建人")
private Long creator;
/**
* 是否已删除0未删除1已删除
*/
@ElogTransform(name = "是否已删除。0未删除、1已删除")
private Integer deleteType;
//主键id集合
private Collection<Long> ids;
private Boolean checked;
}

View File

@ -44,6 +44,8 @@ public class InsuranceAccountDetailParam extends BaseQueryParam {
private String workcode;
private List<Long> departmentIds;
private List<Long> fixedDepartmentIds;
private List<Long> subCompanyIds;
private List<Long> fixedSubCompanyIds;
}

View File

@ -87,4 +87,15 @@ public class SupplementAccountBaseParam {
* 补缴类型
*/
private String supplementType;
private String subcompanyName;
private Long subcompanyId;
private String departmentName;
private Long departmentId;
private String jobtitleName;
private Long jobtitleId;
private String jobcall;
private Long jobcallId;
private String status;
}

View File

@ -129,5 +129,13 @@ public class InsuranceAccountBatchPO {
@ElogTransform(name = "个税扣缴义务人id")
private Long paymentOrganization;
private String subcompanyName;
private Long subcompanyId;
private String departmentName;
private Long departmentId;
private String jobtitleName;
private Long jobtitleId;
private String jobcall;
private Long jobcallId;
private String status;
}

View File

@ -328,4 +328,14 @@ public class InsuranceAccountDetailPO {
*/
@ElogTransform(name = "个税扣缴义务人")
private Long paymentOrganization;
private String subcompanyName;
private Long subcompanyId;
private String departmentName;
private Long departmentId;
private String jobtitleName;
private Long jobtitleId;
private String jobcall;
private Long jobcallId;
private String status;
}

View File

@ -275,4 +275,15 @@ public class InsuranceAccountDetailTempPO {
* 个税扣缴义务人
*/
private Long paymentOrganization;
private String subcompanyName;
private Long subcompanyId;
private String departmentName;
private Long departmentId;
private String jobtitleName;
private Long jobtitleId;
private String jobcall;
private Long jobcallId;
private String status;
}

View File

@ -22,8 +22,12 @@ public class AccountExportPO extends InsuranceAccountDetailPO {
@I18n
private String departmentName;
@I18n
private String fixedDepartmentName;
private Integer userStatus;
private Integer fixedUserStatus;
private String workcode;
}

View File

@ -301,6 +301,7 @@ public class TaxAgentBO {
.target(taxAgentManageRange.getTarget())
.targetName(buildTargetName(taxAgentManageRange, employeeComInfoMap, departmentComInfoMap, subDepartmentComInfoMap, positionComInfoMap))
.employeeStatus(buildEmployeeStatus(hrmStatusNameMap, taxAgentManageRange.getEmployeeStatus()))
.status(buildStatus(taxAgentManageRange.getEmployeeStatus()))
.build();
})
.collect(Collectors.toList());
@ -316,6 +317,14 @@ public class TaxAgentBO {
.collect(Collectors.joining(","));
}
private static String buildStatus( String employeeStatus) {
List<String> employeeStatusList = JsonUtil.parseList(employeeStatus, String.class);
if (CollectionUtils.isEmpty(employeeStatusList)) {
return StringUtils.EMPTY;
}
return String.join(",", employeeStatusList);
}
/**
* 构建对象名
*

View File

@ -59,4 +59,6 @@ public class TaxAgentManageRangeListDTO {
)
@TableTitle(title ="员工状态",key = "employeeStatus",dataIndex = "employeeStatus")
private String employeeStatus;
private String status;
}

View File

@ -20,6 +20,8 @@ import java.util.List;
@Data
public class TaxAgentManageRangeSaveParam {
private Long id;
/**
* 只能选择 关联人员范围/从范围中排除
*/

View File

@ -0,0 +1,39 @@
package com.engine.salary.enums.setting;
import com.engine.salary.enums.BaseEnum;
/**
* 人员类型
*/
public enum PageListSettingPageEnum implements BaseEnum<String> {
SALARY_DETAILS_REPORT("salary_details_report", "薪资明细报表", 109125)
;
private String value;
private String defaultLabel;
private int labelId;
PageListSettingPageEnum(String value, String defaultLabel, int labelId) {
this.value = value;
this.defaultLabel = defaultLabel;
this.labelId = labelId;
}
@Override
public String getValue() {
return value;
}
@Override
public Integer getLabelId() {
return labelId;
}
@Override
public String getDefaultLabel() {
return defaultLabel;
}
}

View File

@ -3,6 +3,8 @@
<mapper namespace="com.engine.salary.mapper.InsuranceExportMapper">
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -29,6 +31,8 @@
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -55,6 +59,8 @@
</select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -120,6 +126,8 @@
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -147,6 +155,8 @@
</select>
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -174,6 +184,8 @@
</select>
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName,
e.MOBILE AS telephone,
d.departmentname AS departmentName,
@ -202,6 +214,8 @@
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName,
e.mobile AS telephone,
d.departmentname AS departmentName,
@ -223,6 +237,8 @@
</select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName,
e.mobile AS telephone,
d.departmentname AS departmentName,
@ -244,6 +260,8 @@
</select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName,
e.mobile AS telephone,
d.departmentname AS departmentName,
@ -266,7 +284,8 @@
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO">
SELECT
a.*,e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
a.*,
e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
@ -277,7 +296,8 @@
</select>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
SELECT
a.*,e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
a.*,
e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}
@ -288,7 +308,8 @@
</select>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
SELECT
a.*,e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
a.*,
e.username AS userName,e.mobile AS telephone,d.departmentname AS departmentName,e.status AS userStatus,e.workcode AS workcode
FROM(
SELECT * from hrsa_excel_bill_detail
WHERE delete_type = 0 AND bill_month = #{param.billMonth} AND payment_status = #{param.paymentStatus} AND payment_organization = #{param.paymentOrganization}

View File

@ -1,5 +1,6 @@
package com.engine.salary.mapper.archive;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemQueryParam;
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam;
@ -97,4 +98,5 @@ public interface SalaryArchiveItemMapper {
int batchUpdate(@Param("collection") List<SalaryArchiveItemPO> pos);
List<SalaryArchiveItemPO> listByArchiveIdAndEffectiveTime(@Param("salaryArchivesIds")List<Long> salaryArchiveIds, @Param("effectiveRange")LocalDateRange dateRange);
}

View File

@ -1071,6 +1071,28 @@
ORDER BY t.effective_time DESC
</select>
<select id="listByArchiveIdAndEffectiveTime"
resultType="com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_archive_item t
WHERE delete_type = 0
<if test="effectiveRange != null and effectiveRange.fromDate != null">
AND t.effective_time <![CDATA[ >= ]]> #{effectiveRange.fromDate}
</if>
<if test="effectiveRange != null and effectiveRange.endDate != null">
AND t.effective_time <![CDATA[ <= ]]> #{effectiveRange.endDate}
</if>
<if test="salaryArchivesIds != null and salaryArchivesIds.size()>0">
AND t.salary_archive_id IN
<foreach collection="salaryArchivesIds" open="(" item="salaryArchiveId" separator="," close=")">
#{salaryArchiveId}
</foreach>
</if>
ORDER BY t.effective_time DESC
</select>
<update id="deleteBatchIds">
UPDATE hrsa_salary_archive_item

View File

@ -0,0 +1,74 @@
package com.engine.salary.mapper.setting;
import com.engine.salary.entity.setting.po.PageLinkPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface PageLinkMapper {
/**
* 查询所有记录
*
* @return 返回集合没有返回空List
*/
List<PageLinkPO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<PageLinkPO> listSome(PageLinkPO pageLink);
/**
* 根据主键查询
*
* @param id 主键
* @return 返回记录没有返回null
*/
PageLinkPO getById(Long id);
/**
* 新增忽略null字段
*
* @param pageLink 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(PageLinkPO pageLink);
/**
* 修改修改所有字段
*
* @param pageLink 修改的记录
* @return 返回影响行数
*/
int update(PageLinkPO pageLink);
/**
* 修改忽略null字段
*
* @param pageLink 修改的记录
* @return 返回影响行数
*/
int updateIgnoreNull(PageLinkPO pageLink);
/**
* 删除记录
*
* @param pageLink 待删除的记录
* @return 返回影响行数
*/
int delete(PageLinkPO pageLink);
/**
* 批量删除记录
* @param ids 主键id集合
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
PageLinkPO getLink(@Param("employeeId")Long employeeId, @Param("page")String page);
}

View File

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.setting.PageLinkMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageLinkPO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="page" property="page"/>
<result column="template_id" property="templateId"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
create_time
, t.creator
, t.delete_type
, t.employee_id
, t.id
, t.page
, t.template_id
, t.tenant_key
, t.update_time
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_link t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_link t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_link t
WHERE delete_type = 0
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="employeeId != null">
AND employee_id = #{employeeId}
</if>
<if test="id != null">
AND id = #{id}
</if>
<if test="page != null">
AND page = #{page}
</if>
<if test="templateId != null">
AND template_id = #{templateId}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
INSERT INTO hrsa_page_link
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">
create_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="employeeId != null">
employee_id,
</if>
<if test="id != null">
id,
</if>
<if test="page != null">
page,
</if>
<if test="templateId != null">
template_id,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
#{createTime},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="employeeId != null">
#{employeeId},
</if>
<if test="id != null">
#{id},
</if>
<if test="page != null">
#{page},
</if>
<if test="templateId != null">
#{templateId},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
UPDATE hrsa_page_link
<set>
create_time=#{createTime},
creator=#{creator},
delete_type=#{deleteType},
employee_id=#{employeeId},
page=#{page},
template_id=#{templateId},
tenant_key=#{tenantKey},
update_time=#{updateTime},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageLinkPO">
UPDATE hrsa_page_link
<set>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="employeeId != null">
employee_id=#{employeeId},
</if>
<if test="page != null">
page=#{page},
</if>
<if test="templateId != null">
template_id=#{templateId},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_page_link
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
<delete id="deleteByIds">
UPDATE hrsa_page_link
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getLink" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_link t
WHERE delete_type = 0
AND employee_id = #{employeeId}
AND page = #{page}
</select>
</mapper>

View File

@ -69,5 +69,9 @@ public interface PageListSettingMapper {
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
//获取页面默认配置
PageListSettingPO getByPage(String page);
//获取页面配置模板
List<PageListSettingPO> getTemplatesByPage(String page);
}

View File

@ -2,14 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.setting.PageListSettingMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageListSettingPO">
<result column="create_time" property="createTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="id" property="id"/>
<result column="page" property="page"/>
<result column="setting" property="setting"/>
<result column="tenant_key" property="tenantKey"/>
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
<result column="create_time" property="createTime"/>
<result column="creator" property="creator"/>
<result column="update_time" property="updateTime"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
@ -64,9 +64,6 @@
<if test="page != null">
AND page = #{page}
</if>
<if test="setting != null">
AND setting = #{setting}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
@ -130,7 +127,7 @@
#{page},
</if>
<if test="setting != null">
#{setting},
#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="tenantKey != null">
#{tenantKey},
@ -150,7 +147,7 @@
creator=#{creator},
delete_type=#{deleteType},
page=#{page},
setting=#{setting},
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
tenant_key=#{tenantKey},
update_time=#{updateTime},
</set>
@ -175,7 +172,7 @@
page=#{page},
</if>
<if test="setting != null">
setting=#{setting},
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
@ -214,5 +211,13 @@
and page = #{page}
</select>
<select id="getTemplatesByPage" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_list_setting t
WHERE delete_type = 0
and page = #{page}
</select>
</mapper>

View File

@ -0,0 +1,73 @@
package com.engine.salary.mapper.setting;
import com.engine.salary.entity.setting.po.PageListTemplatePO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface PageListTemplateMapper {
/**
* 查询所有记录
*
* @return 返回集合没有返回空List
*/
List<PageListTemplatePO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<PageListTemplatePO> listSome(PageListTemplatePO pageListTemplate);
/**
* 根据主键查询
*
* @param id 主键
* @return 返回记录没有返回null
*/
PageListTemplatePO getById(Long id);
/**
* 新增忽略null字段
*
* @param pageListTemplate 新增的记录
* @return 返回影响行数
*/
int insertIgnoreNull(PageListTemplatePO pageListTemplate);
/**
* 修改修改所有字段
*
* @param pageListTemplate 修改的记录
* @return 返回影响行数
*/
int update(PageListTemplatePO pageListTemplate);
/**
* 修改忽略null字段
*
* @param pageListTemplate 修改的记录
* @return 返回影响行数
*/
int updateIgnoreNull(PageListTemplatePO pageListTemplate);
/**
* 删除记录
*
* @param pageListTemplate 待删除的记录
* @return 返回影响行数
*/
int delete(PageListTemplatePO pageListTemplate);
/**
* 批量删除记录
* @param ids 主键id集合
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
}

View File

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.setting.PageListTemplateMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.setting.po.PageListTemplatePO">
<result column="create_time" property="createTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="id" property="id"/>
<result column="limit_ids" property="limitIds" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
<result column="name" property="name"/>
<result column="page" property="page"/>
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler" />
<result column="shared_type" property="sharedType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
create_time
, t.creator
, t.delete_type
, t.id
, t.limit_ids
, t.name
, t.page
, t.setting
, t.shared_type
, t.tenant_key
, t.update_time
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_list_template t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_list_template t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_page_list_template t
WHERE delete_type = 0
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="id != null">
AND id = #{id}
</if>
<if test="name != null">
AND name = #{name}
</if>
<if test="page != null">
AND page = #{page}
</if>
<if test="setting != null">
AND setting = #{setting}
</if>
<if test="sharedType != null">
AND shared_type = #{sharedType}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
INSERT INTO hrsa_page_list_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">
create_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="id != null">
id,
</if>
<if test="limitIds != null">
limit_ids,
</if>
<if test="name != null">
name,
</if>
<if test="page != null">
page,
</if>
<if test="setting != null">
setting,
</if>
<if test="sharedType != null">
shared_type,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
#{createTime},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="id != null">
#{id},
</if>
<if test="limitIds != null">
#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="name != null">
#{name},
</if>
<if test="page != null">
#{page},
</if>
<if test="setting != null">
#{setting , jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="sharedType != null">
#{sharedType},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
UPDATE hrsa_page_list_template
<set>
create_time=#{createTime},
creator=#{creator},
delete_type=#{deleteType},
limit_ids=#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
name=#{name},
page=#{page},
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
shared_type=#{sharedType},
tenant_key=#{tenantKey},
update_time=#{updateTime},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.setting.po.PageListTemplatePO">
UPDATE hrsa_page_list_template
<set>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="limitIds != null">
limit_ids=#{limitIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="name != null">
name=#{name},
</if>
<if test="page != null">
page=#{page},
</if>
<if test="setting != null">
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
</if>
<if test="sharedType != null">
shared_type=#{sharedType},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_page_list_template
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
<delete id="deleteByIds">
UPDATE hrsa_page_list_template
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -49,6 +49,16 @@
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
<result column="payment_organization" property="paymentOrganization"/>
<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>
<!-- 表字段 -->
@ -103,6 +113,15 @@
, t.update_time
, t.tenant_key
, t.payment_organization
, 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="baseColumnsNoJoin">
t
@ -203,6 +222,19 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -244,6 +276,18 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -285,6 +329,18 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -327,6 +383,18 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -368,6 +436,18 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -409,6 +489,18 @@
#{taxAgent}
</foreach>
</if>
<if test="param.fixedDepartmentIds != null and param.fixedDepartmentIds.size()>0">
AND t.department_id IN
<foreach collection="param.fixedDepartmentIds" open="(" item="fixedDepartmentId" separator="," close=")">
#{fixedDepartmentId}
</foreach>
</if>
<if test="param.fixedSubCompanyIds != null and param.fixedSubCompanyIds.size()>0">
AND t.subcompany_id IN
<foreach collection="param.fixedSubCompanyIds" open="(" item="fixedSubCompanyId" separator="," close=")">
#{fixedSubCompanyId}
</foreach>
</if>
<if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -808,7 +900,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
VALUES
<foreach collection="accounts" item="item" separator=",">
(
@ -857,7 +950,16 @@
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
#{item.otherPaymentComBaseString},
#{item.subcompanyName},
#{item.subcompanyId},
#{item.departmentName},
#{item.departmentId},
#{item.jobtitleName},
#{item.jobtitleId},
#{item.jobcall},
#{item.jobcallId},
#{item.status}
)
</foreach>
</insert>
@ -867,7 +969,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
<foreach collection="accounts" item="item" separator="union all">
select
#{item.employeeId,jdbcType=DOUBLE},
@ -915,7 +1018,16 @@
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,jdbcType=VARCHAR},
#{item.otherPaymentComBaseString,jdbcType=VARCHAR}
#{item.otherPaymentComBaseString,jdbcType=VARCHAR},
#{item.subcompanyName,jdbcType=VARCHAR},
#{item.subcompanyId,jdbcType=DOUBLE},
#{item.departmentName,jdbcType=VARCHAR},
#{item.departmentId,jdbcType=DOUBLE},
#{item.jobtitleName,jdbcType=VARCHAR},
#{item.jobtitleId,jdbcType=DOUBLE},
#{item.jobcall,jdbcType=VARCHAR},
#{item.jobcallId,jdbcType=DOUBLE},
#{item.status,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -926,7 +1038,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
VALUES
(
#{item.employeeId},
@ -974,7 +1087,16 @@
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
#{item.otherPaymentComBaseString},
#{item.subcompanyName},
#{item.subcompanyId},
#{item.departmentName},
#{item.departmentId},
#{item.jobtitleName},
#{item.jobtitleId},
#{item.jobcall},
#{item.jobcallId},
#{item.status}
)
</foreach>
</insert>

View File

@ -102,6 +102,15 @@
, t.update_time
, t.tenant_key
, t.payment_organization
, t.subcompany_name as subcompanyName
, t.subcompany_id as subcompanyId
, t.department_name as departmentName
, t.department_id as departmentId
, t.jobtitle_name as jobtitleName
, t.jobtitle_id as jobtitleId
, t.jobcall as jobcall
, t.jobcall_id as jobcallId
, t.status as status
</sql>
@ -137,7 +146,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
VALUES
<foreach collection="accounts" item="item" separator=",">
(
@ -185,7 +195,16 @@
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
#{item.otherPaymentComBaseString},
#{item.subcompanyName},
#{item.subcompanyId},
#{item.departmentName},
#{item.departmentId},
#{item.jobtitleName},
#{item.jobtitleId},
#{item.jobcall},
#{item.jobcallId},
#{item.status}
)
</foreach>
</insert>
@ -195,7 +214,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
<foreach collection="accounts" item="item" separator="union all">
select
@ -243,7 +263,16 @@
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,jdbcType=VARCHAR},
#{item.otherPaymentComBaseString,jdbcType=VARCHAR}
#{item.otherPaymentComBaseString,jdbcType=VARCHAR},
#{item.subcompanyName,jdbcType=VARCHAR},
#{item.subcompanyId,jdbcType=DOUBLE},
#{item.departmentName,jdbcType=VARCHAR},
#{item.departmentId,jdbcType=DOUBLE},
#{item.jobtitleName,jdbcType=VARCHAR},
#{item.jobtitleId,jdbcType=DOUBLE},
#{item.jobcall,jdbcType=VARCHAR},
#{item.jobcallId,jdbcType=DOUBLE},
#{item.status,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -254,7 +283,8 @@
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization,
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string)
social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string,
subcompany_name,subcompany_id,department_name,department_id,jobtitle_name,jobtitle_id,jobcall,jobcall_id,status)
VALUES
(
#{item.employeeId},
@ -301,7 +331,16 @@
#{item.paymentOrganization},
#{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString},
#{item.otherPaymentComBaseString}
#{item.otherPaymentComBaseString},
#{item.subcompanyName},
#{item.subcompanyId},
#{item.departmentName},
#{item.departmentId},
#{item.jobtitleName},
#{item.jobtitleId},
#{item.jobcall},
#{item.jobcallId},
#{item.status}
)
</foreach>
</insert>

View File

@ -41,6 +41,8 @@ import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
import static com.engine.salary.enums.setting.PageListSettingPageEnum.SALARY_DETAILS_REPORT;
/**
* 薪酬统计员工明细
* <p>Copyright: Copyright (c) 2022</p>
@ -338,37 +340,20 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(emp -> queryParam.getIds().contains(emp.getId())).collect(Collectors.toList());
}
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().sorted(Comparator.comparing(SalaryAcctEmployeePO::getSalaryMonth).reversed()).collect(Collectors.toList());
PageInfo<SalaryAcctEmployeePO> SalaryAcctEmployeePageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salaryAcctEmployeeList);
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salaryAcctEmployeeList);
if (queryParam.isExport()) {
SalaryAcctEmployeePageInfo.setList(salaryAcctEmployeeList);
salaryAcctEmployeePageInfo.setList(salaryAcctEmployeeList);
}
return SalaryAcctEmployeePageInfo;
return salaryAcctEmployeePageInfo;
}
@Override
public SalaryStatisticsEmployeeDetailResultDTO getDetailSalaryAcctResultByAcctEmp(List<SalaryAcctEmployeePO> salaryAcctEmployeeList) {
// 3.获取薪资项目
PageListSettingQueryParam param = PageListSettingQueryParam.builder().page("salary_details_report").build();
PageListSettingQueryParam param = PageListSettingQueryParam.builder().page(SALARY_DETAILS_REPORT.getValue()).build();
Map setting = getSettingService(user).getPageListSetting(param);
List<Long> checked = setting.get("checked") != null ? JsonUtil.parseList(setting.get("checked"), Long.class) : new ArrayList<>();
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(checked);
// salaryItemList = salaryItemList.stream()
// .sorted(new Comparator<SalaryItemPO>() {
// @Override
// public int compare(SalaryItemPO o1, SalaryItemPO o2) {
// if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
// Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
// Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
// return systemType1.compareTo(systemType2);
// } else {
// Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
// Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
// return sortedIndex2.compareTo(sortedIndex1);
// }
// }
// })
// .collect(Collectors.toList());
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
return SalaryStatisticsEmployeeDetailResultDTO.builder()
.salaryAcctEmployeeList(Collections.emptyList())
@ -381,100 +366,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
return SalaryStatisticsEmployeeDetailResultDTO.builder()
.salaryAcctEmployeeList(salaryAcctEmployeeList)
.salaryAcctResultValueList(salaryAcctResultValues)
.salaryItemList(salaryItemList)
.build();
}
// @Override
// public void exportDetailList(Map<String, Object> map, SalaryStatisticsEmployeeDetailQueryParam queryParam) {
// DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(queryParam.getEmployeeId());
// // 获取核算数据
// SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult;
// if (Objects.isNull(employee)) {
// salaryStatisticsEmployeeDetailResult = SalaryStatisticsEmployeeDetailResultDTO.builder()
// .salaryAcctEmployeeList(Lists.newArrayList())
// .salaryAcctResultValueList(Lists.newArrayList())
// .salaryItemList(Lists.newArrayList())
// .build();
// } else {
// salaryStatisticsEmployeeDetailResult = this.getDetailSalaryAcctResult(queryParam);
// }
//
// String nameI18n = (StringUtils.isEmpty(employee.getUsername()) ? "" : "[" + employee.getUsername() + "]") + SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 177855, "薪资明细表");
//
// List<ExcelSheetData> sheetList = new ArrayList<>();
// ExcelSheetData excelSheetData = new ExcelSheetData();
// // 1.工作簿名称
// excelSheetData.setSheetName(nameI18n);
// List<String> headerList = Lists.newArrayList();
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 87614, "薪资所属月"));
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"));
// headerList.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 121908, "收入所得项目"));
// salaryStatisticsEmployeeDetailResult.getSalaryItemList().forEach(item -> headerList.add(item.getName()));
// // 2.表头
// excelSheetData.setHeaders(Collections.singletonList(headerList.toArray(new String[]{})));
//
// List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll(tenantKey);
// Map<Long, String> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentPO::getId, TaxAgentPO::getName);
//
// Map<Long, Map<String, String>> acctResultValueMap = SalaryEntityUtil.convert2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmployeeId, SalaryAcctResultPO::getResultValue);
//
// // 组装数据
// List<List<Object>> rows = new ArrayList<>();
// for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
// if (CollectionUtils.isNotEmpty(queryParam.getIds()) && !queryParam.getIds().contains(se.getId())) {
// continue;
// }
// List<Object> row = new ArrayList<>();
// row.add(se.getSalaryMonth());
// row.add(taxAgentMap.get(se.getTaxAgentId()));
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
// row.add(Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel()));
// // 薪资项目
// Map<String, String> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
// salaryStatisticsEmployeeDetailResult.getSalaryItemList().forEach(item -> row.add(Optional.ofNullable(resultValueMap.get(item.getId().toString())).orElse("")));
//
// rows.add(row);
// }
// if (CollectionUtils.isNotEmpty(rows)) {
// List<Object> countRow = new ArrayList<>();
// countRow.add(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 93278, "合计"));
// countRow.add("-");
// countRow.add("-");
//
// for (int i = 3; i < headerList.size(); i++) {
// BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.D_ZERO);
// for (List<Object> row : rows) {
// sumBigDecimal = sumBigDecimal.add(new BigDecimal(StringUtils.isEmpty(row.get(i).toString()) ? SalaryStatisticsReportBO.ZERO : row.get(i).toString()));
// }
// countRow.add(sumBigDecimal.toString());
// }
// rows.add(countRow);
// }
//
// // 3.表数据
// excelSheetData.setRows(rows);
//
// sheetList.add(excelSheetData);
//
// salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
//// .sharePassword(queryParam.getSharePassword())
// .bizId(map.get("biz").toString())
// .flag(true)
// .userId(employeeId)
// .eteamsId(map.get("eteamsId").toString())
// .tenantKey(tenantKey)
// .operator(map.get("username").toString())
// .module(map.get("module").toString())
// .fileName(nameI18n + ReportTimeUtil.getFormatLocalDateTime(LocalDateTime.now()))
// .handlerName("exportSalaryStatisticsEmployeeDetailList")
// .dataType(nameI18n)
// .function("exportSalaryStatisticsEmployeeDetailList").build(), sheetList);
// }
}

View File

@ -23,7 +23,11 @@ import com.engine.salary.report.service.SalaryStatisticsEmployeeService;
import com.engine.salary.report.service.impl.SalaryStatisticsEmployeeServiceImpl;
import com.engine.salary.report.util.ReportDataUtil;
import com.engine.salary.service.SalaryItemService;
import com.engine.salary.service.SettingService;
import com.engine.salary.service.impl.SalaryItemServiceImpl;
import com.engine.salary.service.impl.SettingServiceImpl;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
@ -46,6 +50,9 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import static com.engine.salary.enums.setting.PageListSettingPageEnum.SALARY_DETAILS_REPORT;
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_DETAILS_REPORT_SHOW_TYPE;
/**
* 薪酬统计员工明细
* <p>Copyright: Copyright (c) 2022</p>
@ -64,6 +71,17 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
}
private SettingService getSettingService(User user) {
return ServiceUtil.getService(SettingServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
//是否模板显示
private final boolean templateShow = "1".equals(getSalarySysConfService(user).getValueByCode(SALARY_DETAILS_REPORT_SHOW_TYPE));
/**
* 员工列表
*
@ -162,39 +180,36 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
Map<String, Object> countResultMap = Maps.newHashMap();
if (CollectionUtils.isNotEmpty(records)) {
PageInfo<Map<String, Object>> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
pageInfo.setList(records);
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
List<WeaTableColumn> weaTableColumns;
//显示方案1显示模板
if (templateShow) {
weaTableColumns = getSettingService(user).getPageListColumns(SALARY_DETAILS_REPORT.getValue());
} else {
// 显示方案0显示定制列,默认方式
weaTableColumns = buildDetailTableColumns(salaryStatisticsEmployeeDetailResult, true);
}
// 结果
resultMap.put("columns", weaTableColumns);
if (queryParam.isExport()) {
Map<String, Object> countResultMap = Maps.newHashMap();
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())) {
if (CollectionUtils.isNotEmpty(records)) {
for (SalaryItemPO item : salaryItems) {
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;
for (Map<String, Object> record : records) {
if (Objects.nonNull(record.get(itemKey)) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
record.put(itemKey, record.get(itemKey).toString());
}
}
}
// 薪资项目合计
if (queryParam.isExport()) {
countResultMap.put(itemKey, sumBigDecimal.toString());
}
}
}
PageInfo<Map<String, Object>> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
pageInfo.setList(records);
if (queryParam.isExport()) {
pageInfo.setList(records);
}
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
// 列表columns
List<WeaTableColumn> weaTableColumns = buildDetailTableColumns(salaryStatisticsEmployeeDetailResult, true);
// 结果
if (queryParam.isExport()) {
resultMap.put("columns", weaTableColumns);
resultMap.put("salaryItems", salaryStatisticsEmployeeDetailResult.getSalaryItemList());
resultMap.put("countResult", countResultMap);
} else {
@ -222,6 +237,8 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
*/
public Map<String, Object> salaryListSum(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
Map<String, Object> resultMap = Maps.newHashMap();
Map<String, Object> sumResultMap = Maps.newHashMap();
resultMap.put("sumRow", sumResultMap);
if (StringUtils.isBlank(queryParam.getStartDateStr()) || StringUtils.isBlank(queryParam.getEndDateStr())) {
return resultMap;
}
@ -229,11 +246,10 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
// 获取发薪人员
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
List<SalaryAcctEmployeePO> employeePOS = salaryAcctEmployeePageInfo.getList();
if (CollectionUtils.isEmpty(employeePOS)){
if (CollectionUtils.isEmpty(employeePOS)) {
return resultMap;
}
Map<String, Object> sumResultMap = Maps.newHashMap();
List<List<SalaryAcctEmployeePO>> empParts = Lists.partition(employeePOS, 500);
@ -251,7 +267,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
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())) {
if (Objects.nonNull(record.get(itemKey)) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
}
}
@ -274,9 +290,9 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
queryParam.setCurrent(1);
queryParam.setExport(true);
Map<String, Object> resultMap = salaryList(queryParam);
List<WeaTableColumn> columns = (List<WeaTableColumn>)resultMap.get("columns");
List<WeaTableColumn> columns = (List<WeaTableColumn>) resultMap.get("columns");
List<Map<String, Object>> resultList = ((PageInfo<Map<String, Object>>) resultMap.get("pageInfo")).getList();
Map<String, Object> countResult = (Map<String, Object>)resultMap.get("countResult");
Map<String, Object> countResult = (Map<String, Object>) resultMap.get("countResult");
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
// 获取薪资项目保留小数位数
@ -289,7 +305,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
SalaryItemPO salaryItemPO = salaryItemMap.get(column.getColumn());
Integer pattern = salaryItemPO == null ? 0 : salaryItemPO.getPattern();
String dataType = salaryItemPO == null ? SalaryDataTypeEnum.STRING.getValue() : salaryItemPO.getDataType();
finalColumns.add(new WeaTableColumnGroup("100px", column.getText(), column.getColumn(), "false", pattern, dataType));
finalColumns.add(new WeaTableColumnGroup("100px", Util.formatMultiLang(column.getText()), column.getColumn(), "false", pattern, dataType));
}
});
List<List<Object>> rowList = new ArrayList<>();
@ -299,7 +315,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
for (Map<String, Object> valueMap : resultList) {
List<Object> list = new ArrayList<>();
for (Object column : finalColumns) {
WeaTableColumnGroup col = (WeaTableColumnGroup)column;
WeaTableColumnGroup col = (WeaTableColumnGroup) column;
if (col.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())) {
try {
list.add(new BigDecimal(Util.null2String(valueMap.get(col.getColumn()))));
@ -316,7 +332,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
List<Object> sumRow = new ArrayList<>();
sumRow.add("总计");
for (int i = 1; i < finalColumns.size(); i++) {
WeaTableColumnGroup weaTableColumnGroup = (WeaTableColumnGroup)finalColumns.get(i);
WeaTableColumnGroup weaTableColumnGroup = (WeaTableColumnGroup) finalColumns.get(i);
if (weaTableColumnGroup.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())) {
try {
sumRow.add(new BigDecimal(Util.null2String(countResult.get(weaTableColumnGroup.getColumn()))));

View File

@ -14,7 +14,7 @@ import java.util.Map;
**/
public interface RecordsBuildService {
List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId);
List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId, boolean dynamicEmpInfo);
List<Map<String, Object>> buildCommonRecordsWithStyle(List<InsuranceAccountDetailPO> list, Long employeeId);

View File

@ -77,7 +77,7 @@ public interface SIArchivesService {
/**
* 批量减员直接减员并给予最后缴纳月
*/
Map<String, Object> stopWithoutLimit(Collection<Long> ids, String yearMonth);
Map<String, Object> stopWithoutLimit(Collection<Long> ids, String yearMonth, String fundEndYearMonth, String otherEndYearMonth);
/**
* 全量减员

View File

@ -30,5 +30,5 @@ public interface SIExportService {
*/
XSSFWorkbook exportAccount(Integer paymentStatus, InsuranceExportParam param);
List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list);
List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list, boolean isImport);
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.service;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemSaveParam;
@ -163,4 +164,13 @@ public interface SalaryArchiveItemService {
ArchiveFieldConfig getConfig();
UploadConfigResponse.Result parseConfig(ArchiveFieldConfig config);
/**
* 根据薪资档案id和生效日期范围获取数据
*
* @param salaryArchiveIds
* @param dateRange
* @return
*/
List<SalaryArchiveItemPO> listByArchiveIdAndEffectiveTime(List<Long> salaryArchiveIds, LocalDateRange dateRange);
}

View File

@ -62,6 +62,7 @@ public interface SalarySobRangeService {
* @param saveParam 保存参数
*/
void save(SalarySobRangeSaveParam saveParam);
void edit(SalarySobRangeSaveParam param);
/**
* 根据主键id删除薪资账套的人员范围

View File

@ -1,12 +1,25 @@
package com.engine.salary.service;
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
import com.engine.salary.entity.setting.param.*;
import com.engine.salary.entity.setting.po.PageListTemplatePO;
import java.util.List;
import java.util.Map;
public interface SettingService {
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
Map getPageListSetting(PageListSettingQueryParam param);
Map getPageListSetting(PageListSettingQueryParam param);
PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param);
List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam queryParam);
PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param);
void changePageListTemplate(PageListTemplateChangeParam param);
List<WeaTableColumn> getPageListColumns(String page);
}

View File

@ -52,7 +52,7 @@ public interface TaxAgentManageRangeService {
* @param saveParam 保存参数
*/
void save(TaxAgentRangeSaveParam saveParam);
void edit(TaxAgentRangeSaveParam param);
/**
* 根据主键id删除管理范围

View File

@ -70,7 +70,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId) {
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId, boolean dynamicEmpInfo) {
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
@ -99,10 +99,24 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
record.put("billMonth", item.getBillMonth());
record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class));
record.put("userName", simpleEmployee.getUsername());
record.put("department", simpleEmployee.getDepartmentName());
record.put("supplementaryMonth", item.getSupplementaryMonth());
record.put("mobile", simpleEmployee.getMobile());
record.put("employeeStatus", simpleEmployee.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(simpleEmployee.getStatus())) : "");
if (!dynamicEmpInfo) {
record.put("department", item.getDepartmentName());
record.put("departmentId", item.getDepartmentId());
record.put("subcompany", item.getSubcompanyName());
record.put("subcompanyId", item.getSubcompanyId());
record.put("jobtitle", item.getJobtitleName());
record.put("jobtitleId", item.getJobtitleId());
record.put("jobcall", item.getJobcall());
record.put("jobcallId", item.getJobcallId());
record.put("employeeStatus", item.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(item.getStatus())) : "");
} else {
record.put("department", simpleEmployee.getDepartmentName());
record.put("departmentId", simpleEmployee.getDepartmentId());
record.put("employeeStatus", simpleEmployee.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(simpleEmployee.getStatus())) : "");
}
record.put("supplementaryMonth", item.getSupplementaryMonth());
ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
record.put("workcode", StringUtils.isBlank(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode());
record.put("idNo", Util.null2String(simpleEmployee.getIdNo()));

View File

@ -339,7 +339,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId, false);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent());
@ -406,7 +406,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId, false);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent());
@ -476,7 +476,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId, false);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent());
@ -535,7 +535,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId, false);
PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent());
@ -1551,11 +1551,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) {
//fixme 重新核算的校验逻辑 1先取台账对应扣缴义务人下的所有账套 2取账套下所有核算记录 3判断核算记录有没有使用对应月份的福利台账
// int num = getSiAccountBiz(user).checkIfBusinessaccounting(param);
int num = checkIfBusinessAccounting(param);
//表示已经被核算过不能重新核算
if (num > 0) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "已被薪酬核算给核算过,无法重新核算!"));
}
// int num = checkIfBusinessAccounting(param);
// //表示已经被核算过不能重新核算
// if (num > 0) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "已被薪酬核算给核算过,无法重新核算!"));
// }
param.setBillStatus(0);
// getSiAccountBiz(user).updateById(param);
updateById(param);
@ -1636,7 +1636,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
encryptUtil.decryptList(accountExportPOS, AccountExportPO.class);
SalaryI18nUtil.i18nList(accountExportPOS);
// 数据组装
List<Map<String, Object>> records = getSIExportService(user).buildCommonRecords(accountExportPOS);
List<Map<String, Object>> records = getSIExportService(user).buildCommonRecords(accountExportPOS, true);
// excel导出的数据
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(records.size());
@ -1829,11 +1829,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
if (!empIdsInPayMonthRange.contains(employeeId)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
}
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
// 封装InsuranceAccountDetailPO
Date now = new Date();
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setBillStatus(0);
insuranceAccountDetailPO.setEmployeeId(employeeId);
if (employee != null) {
insuranceAccountDetailPO.setSubcompanyName(employee.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(employee.getSubcompanyid());
insuranceAccountDetailPO.setDepartmentName(employee.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(employee.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(employee.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(employee.getJobtitleId());
insuranceAccountDetailPO.setJobcall(employee.getJobcall());
insuranceAccountDetailPO.setJobcallId(employee.getJobcallId());
insuranceAccountDetailPO.setStatus(employee.getStatus());
}
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization);
insuranceAccountDetailPO.setPaymentStatus(1);
insuranceAccountDetailPO.setResourceFrom(0);
@ -4193,7 +4205,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
PageInfo<InsuranceAccountDetailPO> pageInfo = siBatchListCommonPage(queryParam);
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
// 数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId, false);
// Map<String, Object> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow);
@ -4229,7 +4241,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId, false);
// Map<String, Object> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow);
@ -4268,7 +4280,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId, false);
Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow);
return datas;
@ -4306,7 +4318,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId);
List<Map<String, Object>> records = getService(user).buildCommonRecords(list, employeeId, false);
Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow);
return datas;
@ -4581,6 +4593,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(employeeId);
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
if (employee != null) {
insuranceAccountDetailPO.setSubcompanyName(employee.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(employee.getSubcompanyid());
insuranceAccountDetailPO.setDepartmentName(employee.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(employee.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(employee.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(employee.getJobtitleId());
insuranceAccountDetailPO.setJobcall(employee.getJobcall());
insuranceAccountDetailPO.setJobcallId(employee.getJobcallId());
insuranceAccountDetailPO.setStatus(employee.getStatus());
}
insuranceAccountDetailPO.setBillMonth(billMonth.substring(0, 7));
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
@ -4981,7 +5006,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
log.info("开始生成福利核算数据,待处理人员数量:{}", ids.size());
siCommonAccount(param.getBillMonth(), ids, param.getPaymentOrganization());
siCommonAccount(param.getBillMonth(), ids, param.getPaymentOrganization(), param.isFlag());
log.info("福利核算数据生成完毕,开始数据处理");
handleData(ids, param);
@ -5009,10 +5034,21 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
public void siCommonAccount(String billMonth, List<Long> ids, Long paymentOrganization) {
public void siCommonAccount(String billMonth, List<Long> ids, Long paymentOrganization, boolean isFirstFlag) {
// Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = siArchivesBiz.buildBatchAccount(ids, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).buildBatchAccount(ids, paymentOrganization);
List<InsuranceAccountDetailPO> historyDetailData = new ArrayList<>();
List<DataCollectionEmployee> employeeList = new ArrayList<>();
if (!isFirstFlag) {
// 不是首次核算需要把社保历史数据取出
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(ids).build()));
} else {
employeeList = getSalaryEmployeeService(user).listByIds(ids);
}
Map<Long, InsuranceAccountDetailPO> historyDetailDataMap = SalaryEntityUtil.convert2Map(historyDetailData, InsuranceAccountDetailPO::getEmployeeId);
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
List<InsuranceAccountDetailTempPO> list = new ArrayList<>();
int count = 0;
for (Map.Entry<Long, InsuranceArchivesAccountPO> entry : insuranceArchivesAccountPOS.entrySet()) {
@ -5030,6 +5066,34 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue());
insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization);
if (isFirstFlag) {
// 初次核算
DataCollectionEmployee employee = employeeMap.get(k);
if (employee != null) {
insuranceAccountDetailPO.setSubcompanyName(employee.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(employee.getSubcompanyid());
insuranceAccountDetailPO.setDepartmentName(employee.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(employee.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(employee.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(employee.getJobtitleId());
insuranceAccountDetailPO.setJobcall(employee.getJobcall());
insuranceAccountDetailPO.setJobcallId(employee.getJobcallId());
insuranceAccountDetailPO.setStatus(employee.getStatus());
}
} else {
InsuranceAccountDetailPO historyDetail = historyDetailDataMap.get(k);
if (historyDetail != null) {
insuranceAccountDetailPO.setSubcompanyName(historyDetail.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(historyDetail.getSubcompanyId());
insuranceAccountDetailPO.setDepartmentName(historyDetail.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(historyDetail.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(historyDetail.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(historyDetail.getJobtitleId());
insuranceAccountDetailPO.setJobcall(historyDetail.getJobcall());
insuranceAccountDetailPO.setJobcallId(historyDetail.getJobcallId());
insuranceAccountDetailPO.setStatus(historyDetail.getStatus());
}
}
//核算社保
accountSocial(insuranceAccountDetailPO, v, billMonth);
@ -5065,7 +5129,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//临时表数据入库
if (CollectionUtils.isNotEmpty(list)) {
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 40);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 20);
lists.forEach(subList -> {
getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList);
});
@ -5950,8 +6014,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
employeeIds = employeeIds.stream().filter(f -> empIdsInPayMonthRange.contains(f)).collect(Collectors.toList());
SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(0, "无核算人员"));
// 获取员工信息
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(employeeIds);
Map<Long, DataCollectionEmployee> empMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
List<SupplementAccountBaseParam> baseList = new ArrayList<>();
employeeIds.stream().forEach(id -> {
DataCollectionEmployee employee = empMap.get(id);
param.getBillMonthList().stream().forEach(month -> {
SupplementAccountBaseParam supplementAccountBaseParam = SupplementAccountBaseParam.builder()
.supplementaryMonth(month)
@ -5961,6 +6031,17 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
.billMonth(param.getBillMonth())
.supplementType(param.getSupplementType())
.build();
if (employee != null) {
supplementAccountBaseParam.setSubcompanyName(employee.getSubcompanyName());
supplementAccountBaseParam.setSubcompanyId(employee.getSubcompanyid());
supplementAccountBaseParam.setDepartmentName(employee.getDepartmentName());
supplementAccountBaseParam.setDepartmentId(employee.getDepartmentId());
supplementAccountBaseParam.setJobtitleName(employee.getJobtitleName());
supplementAccountBaseParam.setJobtitleId(employee.getJobtitleId());
supplementAccountBaseParam.setJobcall(employee.getJobcall());
supplementAccountBaseParam.setJobcallId(employee.getJobcallId());
supplementAccountBaseParam.setStatus(employee.getStatus());
}
if ("2".equals(param.getSupplementType())) {
supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString());
supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString());
@ -6017,6 +6098,16 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(baseParam.getEmployeeId());
insuranceAccountDetailPO.setSubcompanyName(baseParam.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(baseParam.getSubcompanyId());
insuranceAccountDetailPO.setDepartmentName(baseParam.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(baseParam.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(baseParam.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(baseParam.getJobtitleId());
insuranceAccountDetailPO.setJobcall(baseParam.getJobcall());
insuranceAccountDetailPO.setJobcallId(baseParam.getJobcallId());
insuranceAccountDetailPO.setStatus(baseParam.getStatus());
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
insuranceAccountDetailPO.setSupplementaryMonth(baseParam.getSupplementaryMonth());
insuranceAccountDetailPO.setPaymentOrganization(baseParam.getPaymentOrganization());

View File

@ -987,7 +987,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
//获取社保档案
socialList = getSocialSchemeMapper().getSocialById(socialIds);
//筛选可减员的社保档案相关信息
toStopSocialIds = socialList.stream().filter(f-> f.getSocialSchemeId() == null || (f.getSocialEndTime() != null && f.getSocialEndTime().length() > 0 && (f.getSocialEndTime().compareTo(todayMonth)) <= 0))
toStopSocialIds = socialList.stream().filter(f-> f.getSocialSchemeId() == null || (f.getSocialEndTime() != null && f.getSocialEndTime().length() > 0))
.map(InsuranceArchivesSocialSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopSocialIds = toStopSocialIds;
@ -997,7 +997,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundIds.size() > 0) {
fundList = getFundSchemeMapper().getFundById(fundIds);
toStopFundIds = fundList.stream().filter(f->f.getFundSchemeId() == null || (f.getFundEndTime() != null && f.getFundEndTime().length() > 0 && (f.getFundEndTime().compareTo(todayMonth)) <= 0))
toStopFundIds = fundList.stream().filter(f->f.getFundSchemeId() == null || (f.getFundEndTime() != null && f.getFundEndTime().length() > 0))
.map(InsuranceArchivesFundSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopFundIds = toStopFundIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopFundIds.contains(f.getFundArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));
@ -1006,7 +1006,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherIds.size() > 0) {
otherList = getOtherSchemeMapper().getOtherById(otherIds);
toStopOtherIds= otherList.stream().filter(f->f.getOtherSchemeId() == null || (f.getOtherEndTime() != null && f.getOtherEndTime().length() > 0 && (f.getOtherEndTime().compareTo(todayMonth)) <= 0))
toStopOtherIds= otherList.stream().filter(f->f.getOtherSchemeId() == null || (f.getOtherEndTime() != null && f.getOtherEndTime().length() > 0))
.map(InsuranceArchivesOtherSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopOtherIds = toStopOtherIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopOtherIds.contains(f.getOtherArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));
@ -1079,7 +1079,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
}
@Override
public Map<String, Object> stopWithoutLimit(Collection<Long> ids, String yearMonth) {
public Map<String, Object> stopWithoutLimit(Collection<Long> ids, String yearMonth, String fundEndYearMonth, String otherEndYearMonth) {
if (CollectionUtils.isEmpty(ids)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(145969, "没有可以操作的记录"));
@ -1100,10 +1100,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (baseInfoIds.size() > 0) {
getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder()
.ids(baseInfoIds).runStatus(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()).build());
String socialEndYearMonth = yearMonth;
fundEndYearMonth = StringUtils.isBlank(fundEndYearMonth) ? yearMonth : fundEndYearMonth;
otherEndYearMonth = StringUtils.isBlank(otherEndYearMonth) ? yearMonth : otherEndYearMonth;
getSocialSchemeMapper().batchUpdateEndTime(socialIds, yearMonth);
getFundSchemeMapper().batchUpdateEndTime(fundIds, yearMonth);
getOtherSchemeMapper().batchUpdateEndTime(otherIds, yearMonth);
getSocialSchemeMapper().batchUpdateEndTime(socialIds, socialEndYearMonth);
getFundSchemeMapper().batchUpdateEndTime(fundIds, fundEndYearMonth);
getOtherSchemeMapper().batchUpdateEndTime(otherIds, otherEndYearMonth);
}

View File

@ -8,6 +8,7 @@ import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam;
import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
@ -35,6 +36,7 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIBalanceService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.IdGenerator;
@ -98,6 +100,10 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@Override
public void del(InspectAccountParam param, Long employeeId) {
@ -323,10 +329,24 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
if (balanceAccountPO != null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补差数据已存在,不可重复新增!"));
}
DataCollectionEmployee employeeById = getSalaryEmployeeService(user).getEmployeeById(employeeId);
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(employeeId);
if (employeeById != null) {
insuranceAccountDetailPO.setSubcompanyName(employeeById.getSubcompanyName());
insuranceAccountDetailPO.setSubcompanyId(employeeById.getSubcompanyid());
insuranceAccountDetailPO.setDepartmentName(employeeById.getDepartmentName());
insuranceAccountDetailPO.setDepartmentId(employeeById.getDepartmentId());
insuranceAccountDetailPO.setJobtitleName(employeeById.getJobtitleName());
insuranceAccountDetailPO.setJobtitleId(employeeById.getJobtitleId());
insuranceAccountDetailPO.setJobcall(employeeById.getJobcall());
insuranceAccountDetailPO.setJobcallId(employeeById.getJobcallId());
insuranceAccountDetailPO.setStatus(employeeById.getStatus());
}
insuranceAccountDetailPO.setBillMonth(billMonth);
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());

View File

@ -289,7 +289,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().listAll();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class);
//数据组装
List<Map<String, Object>> records = getRecordsBuildService(user).buildCommonRecords(insuranceAccountDetailPOS, null);
List<Map<String, Object>> records = getRecordsBuildService(user).buildCommonRecords(insuranceAccountDetailPOS, null, false);
String welfareTypeName = "";
switch (categoryPO.getWelfareType()) {
case 1:

View File

@ -220,7 +220,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
// }
columns = buildCommonColumns(accountExportPOS, paymentStatus);
records = buildCommonRecords(accountExportPOS);
records = buildCommonRecords(accountExportPOS, false);
List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(0, "社保福利台账");
@ -280,7 +280,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list) {
public List<Map<String, Object>> buildCommonRecords(List<AccountExportPO> list, boolean isExport) {
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>();
@ -294,12 +294,17 @@ public class SIExportServiceImpl extends Service implements SIExportService {
record.put("billMonth", item.getBillMonth());
record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class));
record.put("userName", item.getUserName());
record.put("department", item.getDepartmentName());
if (isExport) {
record.put("department", item.getDepartmentName());
record.put("employeeStatus", item.getUserStatus() == null ? "" : getDefaultLabelByValue(item.getUserStatus()));
} else {
record.put("department", item.getFixedDepartmentName());
record.put("employeeStatus", item.getFixedUserStatus() == null ? "" : getDefaultLabelByValue(item.getFixedUserStatus()));
}
record.put("supplementaryMonth", item.getSupplementaryMonth());
record.put("mobile", item.getTelephone());
record.put("workcode", item.getWorkcode());
record.put("idNo", item.getIdNo());
record.put("employeeStatus", item.getUserStatus() == null ? "" : getDefaultLabelByValue(item.getUserStatus()));
ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(from.getLabelId(), from.getDefaultLabel()));

View File

@ -7,6 +7,7 @@ import com.engine.core.impl.Service;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
@ -27,6 +28,7 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIRecessionService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryEntityUtil;
@ -75,6 +77,10 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@Override
public void save(RecessionParam param, Long employeeId) {
@ -108,12 +114,17 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
//处理数据
List<InsuranceAccountDetailPO> finalDetailPOS = detailPOS;
List<InsuranceAccountDetailPO> finalRecessionDetails = new ArrayList<>();
// 获取员工信息
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(employeeIds);
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
employeeIds.forEach(id -> {
DataCollectionEmployee employee = employeeMap.getOrDefault(id, DataCollectionEmployee.builder().build());
param.getRecessionMonthList().forEach(billMonth -> {
Optional<InsuranceAccountDetailPO> detailPOOptional = finalDetailPOS.stream().filter(
detail -> Objects.equals(billMonth, detail.getBillMonth())
&& Objects.equals(id, detail.getEmployeeId())).findFirst();
detailPOOptional.ifPresent(insuranceAccountDetailPO -> recessionAccount(param, insuranceAccountDetailPO, finalRecessionDetails));
detailPOOptional.ifPresent(insuranceAccountDetailPO -> recessionAccount(param, insuranceAccountDetailPO, finalRecessionDetails, employee));
});
});
//退差数据入库
@ -173,10 +184,10 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
}
private void recessionAccount(RecessionParam param, InsuranceAccountDetailPO insuranceAccountDetailPO, List<InsuranceAccountDetailPO> recessionDetails) {
private void recessionAccount(RecessionParam param, InsuranceAccountDetailPO insuranceAccountDetailPO, List<InsuranceAccountDetailPO> recessionDetails, DataCollectionEmployee employee) {
List<Integer> projects = param.getProjects();
InsuranceAccountDetailPO temp = new InsuranceAccountDetailPO();
recessionBaseBuild(param, temp, insuranceAccountDetailPO);
recessionBaseBuild(param, temp, insuranceAccountDetailPO, employee);
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
recessionSocial(param, temp, insuranceAccountDetailPO);
recessionFund(param, temp, insuranceAccountDetailPO);
@ -198,7 +209,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
private void recessionBaseBuild(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) {
private void recessionBaseBuild(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO, DataCollectionEmployee employee) {
InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization()));
temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
// temp.setId(IdGenerator.generate());
@ -209,6 +220,17 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
temp.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
temp.setTenantKey(insuranceAccountDetailPO.getTenantKey());
temp.setEmployeeId(insuranceAccountDetailPO.getEmployeeId());
temp.setSubcompanyName(employee.getSubcompanyName());
temp.setSubcompanyId(employee.getSubcompanyid());
temp.setDepartmentName(employee.getDepartmentName());
temp.setDepartmentId(employee.getDepartmentId());
temp.setJobtitleName(employee.getJobtitleName());
temp.setJobtitleId(employee.getJobtitleId());
temp.setJobcall(employee.getJobcall());
temp.setJobcallId(employee.getJobcallId());
temp.setStatus(employee.getStatus());
temp.setBillMonth(param.getBillMonth());
temp.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
temp.setBillMonth(param.getBillMonth());
temp.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
temp.setSupplementaryMonth(insuranceAccountDetailPO.getBillMonth());

View File

@ -223,13 +223,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
List<Map<String, String>> resultList = new ArrayList<>();
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
socialIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -257,13 +262,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
});
}
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
if (fundSchemePO != null && (StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString()) || StringUtils.isNotBlank(fundSchemePO.getFundPaymentComBaseString()))) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> fundComMap = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> fundIds = new ArrayList<>();
fundIds.addAll(fundMap == null ? Collections.emptyList() : fundMap.keySet());
fundIds.addAll(fundComMap == null ? Collections.emptyList() : fundComMap.keySet());
fundIds = fundIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
fundIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -291,13 +301,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
});
}
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
if (otherSchemePO != null && (StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString()) || StringUtils.isNotBlank(otherSchemePO.getOtherPaymentComBaseString()))) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> otherComMap = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> otherIds = new ArrayList<>();
otherIds.addAll(otherMap == null ? Collections.emptyList() : otherMap.keySet());
otherIds.addAll(otherComMap == null ? Collections.emptyList() : otherComMap.keySet());
otherIds = otherIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
otherIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -327,13 +342,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
return resultList;
}
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
socialIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -365,15 +385,22 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
&& (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
&& (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
socialIds.forEach( k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -405,15 +432,23 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
&& (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
&& (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() :socialComMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
socialIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -445,15 +480,22 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
&& (!projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
&& (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet());
socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialComMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
socialIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -483,14 +525,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
}
}
if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
if (fundSchemePO != null && (StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString()) || StringUtils.isNotBlank(fundSchemePO.getFundPaymentComBaseString()))) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> fundComMap = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> fundIds = new ArrayList<>();
fundIds.addAll(fundMap == null ? Collections.emptyList() : fundMap.keySet());
fundIds.addAll(fundComMap == null ? Collections.emptyList() : fundComMap.keySet());
fundIds = fundIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
fundIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -520,14 +566,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
}
}
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
if (otherSchemePO != null && (StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString()) || StringUtils.isNotBlank(otherSchemePO.getOtherPaymentComBaseString()))) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> otherComMap = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> otherIds = new ArrayList<>();
otherIds.addAll(otherMap == null ? Collections.emptyList() : otherMap.keySet());
otherIds.addAll(otherComMap == null ? Collections.emptyList() : otherComMap.keySet());
otherIds = otherIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
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) -> {
otherIds.forEach(k -> {
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" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {

View File

@ -742,6 +742,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = getSIArchivesService(user).getSocialByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
// 过滤义务人
socialByEmployeeId = socialByEmployeeId.stream().filter(s -> s.getPaymentOrganization().equals(item.getPaymentOrganization())).collect(Collectors.toList());
encryptUtil.decryptList(socialByEmployeeId, InsuranceArchivesSocialSchemePO.class);
InsuranceArchivesSocialSchemePO socialItem = null;
if (socialByEmployeeId.size() > 0) {
@ -752,6 +754,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = getSIArchivesService(user).getFundByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
// 过滤义务人
fundByEmployeeId = fundByEmployeeId.stream().filter(f -> f.getPaymentOrganization().equals(item.getPaymentOrganization())).collect(Collectors.toList());
encryptUtil.decryptList(fundByEmployeeId, InsuranceArchivesFundSchemePO.class);
if (fundByEmployeeId.size() > 0) {
@ -762,6 +766,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = getSIArchivesService(user).getOtherByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
otherByEmployeeId = otherByEmployeeId.stream().filter(o -> o.getPaymentOrganization().equals(item.getPaymentOrganization())).collect(Collectors.toList());
encryptUtil.decryptList(otherByEmployeeId, InsuranceArchivesOtherSchemePO.class);
if (otherByEmployeeId.size() > 0) {
otherItem = otherByEmployeeId.get(0);

View File

@ -282,7 +282,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap);
//是否锁定
if (lockItems != null && lockItems.contains(salaryItemId)) {
resultValue = empItemValueMap.get(salaryAcctEmployeePOId + "_" + salaryItemId);
resultValue = empItemValueMap.getOrDefault(salaryAcctEmployeePOId + "_" + salaryItemId, StringUtils.EMPTY);
}
// 将已经计算过的薪资项目的值转换成公式变量的值添加到集合中
String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode();

View File

@ -172,7 +172,7 @@ public class SalaryAcctSobConfigServiceImpl extends Service implements SalaryAcc
}
@Override
public void updateBySalaryAcctRecordId(Long salaryAcctRecordId) {
public void updateBySalaryAcctRecordId(Long salaryAcctRecordId) {
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
if (salaryAcctRecord == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156474, "参数错误,薪资核算记录不存在或已被删除"));
@ -185,10 +185,12 @@ public class SalaryAcctSobConfigServiceImpl extends Service implements SalaryAcc
}
getSalaryCacheService(user).set(SalaryCacheKey.ACCT_SOB_CONFIG + salaryAcctRecordId, "TRUE");
deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
getSalaryAcctSobConfigMapper().insertIgnoreNull(salaryAcctSobConfig);
getSalaryCacheService(user).set(SalaryCacheKey.ACCT_SOB_CONFIG + salaryAcctRecordId, "FALSE");
try {
deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
getSalaryAcctSobConfigMapper().insertIgnoreNull(salaryAcctSobConfig);
} finally {
getSalaryCacheService(user).set(SalaryCacheKey.ACCT_SOB_CONFIG + salaryAcctRecordId, "FALSE");
}
}
@Override

View File

@ -545,7 +545,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
// 构建导入需要的数据
SalaryArchiveImportHandleParam importHandleParam = buildImportHandleParam(SalaryArchiveImportHandleParam.builder().isProcess(true).listType(param.getListType()).importType(param.getImportType()).description(param.getDescription()).build());
importHandleParam.setKeepStatus(param.getKeepStatus());
int total = 0;
//excel数据

View File

@ -7,6 +7,7 @@ import com.engine.core.impl.Service;
import com.engine.salary.biz.SalaryArchiveBiz;
import com.engine.salary.biz.SalaryArchiveItemBiz;
import com.engine.salary.biz.SalaryItemBiz;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
@ -807,4 +808,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
return result;
}
@Override
public List<SalaryArchiveItemPO> listByArchiveIdAndEffectiveTime(List<Long> salaryArchiveIds, LocalDateRange dateRange) {
if (CollectionUtils.isEmpty(salaryArchiveIds)) {
return Collections.emptyList();
}
List<SalaryArchiveItemPO> resultList = new ArrayList<>();
List<List<Long>> partition = Lists.partition(salaryArchiveIds, 1000);
partition.forEach(part -> {
resultList.addAll(getSalaryArchiveItemMapper().listByArchiveIdAndEffectiveTime(part, dateRange));
});
return resultList;
}
}

View File

@ -185,6 +185,16 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
}
List<SalaryArchiveListDTO> list = getSalaryArchiveMapper().list(queryParam);
// 过滤调薪日期
if (queryParam.getAdjustSalaryStartDate() != null || queryParam.getAdjustSalaryEndDate() != null) {
List<Long> salaryArchiveIds = list.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(queryParam.getAdjustSalaryStartDate()).endDate(queryParam.getAdjustSalaryEndDate()).build();
List<SalaryArchiveItemPO> salaryArchiveItemPOList = getSalaryArchiveItemService(user).listByArchiveIdAndEffectiveTime(salaryArchiveIds, dateRange);
List<Long> archiveIds = salaryArchiveItemPOList.stream().map(SalaryArchiveItemPO::getSalaryArchiveId).distinct().collect(Collectors.toList());
list = list.stream().filter(dto -> archiveIds.contains(dto.getId())).collect(Collectors.toList());
}
return SalaryI18nUtil.i18nList(list);
}

View File

@ -1920,7 +1920,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
map.put("salaryAcctResult", salaryAcctResultS);
// 工资单确认按钮
if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(), 1) == 0) {
if (salaryTemplate.getAckFeedbackStatus() != null && NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(), 1) == 0) {
// 开启了工资单确认
Integer ackStatus = salarySendInfo.getBillConfirmStatus();
if (ackStatus == null || ackStatus != BillConfimStatusEnum.CONFIRMED.getValue()) {
@ -1935,7 +1935,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
// 工资单反馈
if (NumberUtils.compare(salaryTemplate.getFeedbackStatus(), 1) == 0) {
if (salaryTemplate.getFeedbackStatus() != null && NumberUtils.compare(salaryTemplate.getFeedbackStatus(), 1) == 0) {
// 开启了工资单反馈按钮
Integer confirmStatus = salarySendInfo.getBillConfirmStatus();
map.put("showFeedback", "1");

View File

@ -4,10 +4,10 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrm.biz.OrganizationShowSetBiz;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.biz.SalarySobRangeBiz;
import com.engine.salary.biz.SpecialAddDeductionBiz;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.hrm.PositionInfo;
@ -41,6 +41,7 @@ import com.engine.salary.util.excel.ExcelParseHelper;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -198,6 +199,43 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
}
@Override
public void edit(SalarySobRangeSaveParam param) {
ValidUtil.doValidator(param, RuntimeTypeEnum.UPDATE);
// 查询薪资账套
SalarySobPO salarySobPO = getSalarySobService(user).getById(param.getSalarySobId());
if (Objects.isNull(salarySobPO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
}
deleteByIds(Collections.singleton(param.getId()));
// 查询已有的人员范围
List<SalarySobRangePO> salarySobRangePOS = listBySalarySobIdAndIncludeType(param.getSalarySobId(), param.getIncludeType());
// 处理一下本次的保存参数如果原来添加过对应的人员/部门/岗位那么本次不需要新增只需要更新
SalarySobRangeSaveBO.Result result = SalarySobRangeSaveBO.handle(salarySobRangePOS, param, (long) user.getUID(), false);
// 保存
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobRanges())) {
salarySobRangeBiz.batchInsert(result.getNeedInsertSalarySobRanges());
}
if (CollectionUtils.isNotEmpty(result.getNeedUpdateSalarySobRanges())) {
result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeBiz.updateById(e));
}
//记录日志
String operateTypeName = Objects.equals(param.getIncludeType(), 1) ?
SalaryI18nUtil.getI18nLabel(0, "关联人员范围新增对象") : SalaryI18nUtil.getI18nLabel(0, "从范围中排除新增对象");
LoggerContext<SalarySobRangeSaveParam> loggerContext = new LoggerContext<>();
loggerContext.setUser(user);
loggerContext.setTargetId("" + salarySobPO.getId());
loggerContext.setTargetName(salarySobPO.getName());
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
loggerContext.setOperateTypeName(operateTypeName);
loggerContext.setOperatedesc(operateTypeName);
loggerContext.setNewValues(param);
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
}
@Override
public void deleteByIds(Collection<Long> ids) {
// 查询薪资账套的人员范围

View File

@ -1,25 +1,39 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.cloudstore.eccom.constant.WeaBoolAttr;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
import com.engine.salary.entity.setting.param.PageListSettingSaveParam;
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
import com.engine.salary.entity.setting.param.*;
import com.engine.salary.entity.setting.po.PageLinkPO;
import com.engine.salary.entity.setting.po.PageListSettingPO;
import com.engine.salary.entity.setting.po.PageListTemplatePO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.setting.PageLinkMapper;
import com.engine.salary.mapper.setting.PageListSettingMapper;
import com.engine.salary.mapper.setting.PageListTemplateMapper;
import com.engine.salary.report.common.constant.SalaryConstant;
import com.engine.salary.service.SalaryItemService;
import com.engine.salary.service.SalarySobService;
import com.engine.salary.service.SettingService;
import com.engine.salary.util.JsonUtil;
import com.engine.salary.service.TaxAgentService;
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.engine.salary.util.valid.ValidUtil;
import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
import static com.engine.salary.enums.setting.PageListSettingPageEnum.SALARY_DETAILS_REPORT;
/**
* 薪资核算
@ -35,28 +49,36 @@ public class SettingServiceImpl extends Service implements SettingService {
return MapperProxyFactory.getProxy(PageListSettingMapper.class);
}
private SalarySobService getSalarySobService(User user) {
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
private PageListTemplateMapper getPageListTemplateMapper() {
return MapperProxyFactory.getProxy(PageListTemplateMapper.class);
}
private PageLinkMapper getPageLinkMapper() {
return MapperProxyFactory.getProxy(PageLinkMapper.class);
}
private SalaryItemService getSalaryItemService(User user) {
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
}
private TaxAgentService getTaxAgentService() {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
@Override
public void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam) {
Date now = new Date();
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(pageListSettingSaveParam.getPage());
if (pageListSettingPO != null) {
pageListSettingPO.setSetting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()));
pageListSettingPO.setSetting(pageListSettingSaveParam.getSetting());
pageListSettingPO.setUpdateTime(now);
getPageListSettingMapper().updateIgnoreNull(pageListSettingPO);
} else {
pageListSettingPO = PageListSettingPO.builder()
.id(IdGenerator.generate())
.page(pageListSettingSaveParam.getPage())
.setting(JsonUtil.toJsonString(pageListSettingSaveParam.getSetting()))
.setting(pageListSettingSaveParam.getSetting())
.creator((long) user.getUID())
.createTime(now)
.updateTime(now)
@ -72,7 +94,7 @@ public class SettingServiceImpl extends Service implements SettingService {
String page = param.getPage();
Map result = new HashMap();
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(page);
if ("salary_details_report".equals(page)) {
if (SALARY_DETAILS_REPORT.getValue().equals(page)) {
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
salaryItemList = salaryItemList.stream()
.filter(po -> {
@ -95,8 +117,8 @@ public class SettingServiceImpl extends Service implements SettingService {
})
.collect(Collectors.toList());
result.put("setting", salaryItemList);
if (pageListSettingPO != null && StrUtil.isNotEmpty(pageListSettingPO.getSetting())) {
result.put("checked", JsonUtil.parseList(pageListSettingPO.getSetting(), Long.class));
if (pageListSettingPO != null && CollUtil.isNotEmpty(pageListSettingPO.getSetting())) {
result.put("checked", pageListSettingPO.getSetting());
} else {
List<Long> collect = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
result.put("checked", collect);
@ -104,4 +126,177 @@ public class SettingServiceImpl extends Service implements SettingService {
}
return result;
}
@Override
public PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param) {
String page = param.getPage();
Long id = param.getId();
if (SALARY_DETAILS_REPORT.getValue().equals(page)) {
List<WeaTableColumn> columns = new ArrayList<>();
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(87614, "薪资所属月"), "salaryMonth"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgent"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "账套"), "salarySob"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "userName"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "分部"), "subCompany"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "部门"), "department"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "岗位"), "jobTitle"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "员工状态"), "status"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "workCode"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "入职日期"), "companystartdate"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "次数"), "acctTimes").setDisplay(WeaBoolAttr.FALSE));
if (StrUtil.isNotBlank(param.getName())) {
columns = columns.stream().filter(column -> column.getText().contains(param.getName())).collect(Collectors.toList());
}
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
List<WeaTableColumn> collect = salaryItemList.stream()
.filter(po -> {
String name = param.getName();
if (StrUtil.isNotEmpty(name)) {
return po.getName() != null && po.getName().contains(name);
}
return true;
})
.sorted((o1, o2) -> {
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
return systemType1.compareTo(systemType2);
} else {
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
return sortedIndex2.compareTo(sortedIndex1);
}
})
.map(item -> new WeaTableColumn("100px", item.getName(), item.getId() + SalaryConstant.DYNAMIC_SUFFIX))
.collect(Collectors.toList());
columns.addAll(collect);
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
List<WeaTableColumn> checkedList = new ArrayList<>();
if (id != null) {
PageListTemplatePO po = getPageListTemplateMapper().getById(id);
if (po != null) {
checkedList = Optional.ofNullable(po.getSetting()).orElse(new ArrayList<>())
.stream()
.map(s -> columnMap.getOrDefault(s, new WeaTableColumn()))
.collect(Collectors.toList());
}
}
return PageListTemplateDTO.builder().setting(columns).checked(checkedList).build();
}
return PageListTemplateDTO.builder().build();
}
@Override
public List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam param) {
ValidUtil.doValidator(param);
String page = param.getPage();
PageListTemplatePO build = PageListTemplatePO.builder().page(page).build();
List<PageListTemplatePO> pos = getPageListTemplateMapper().listSome(build);
//获取当前选择的模板
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), SALARY_DETAILS_REPORT.getValue());
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
List<String> taxIds = SalaryEntityUtil.properties(taxAgentPOS, po -> po.getId().toString(), Collectors.toList());
pos = pos.stream()
.filter(po -> {
if (po.getSharedType() == 1) {
List limitIds = po.getLimitIds();
List<String> collect = new ArrayList<>();
for (int i = 0; i < limitIds.size(); i++) {
collect.add(limitIds.get(i).toString());
}
return CollectionUtil.isNotEmpty(limitIds) && CollectionUtil.intersection(collect, taxIds).size() != 0;
}
return true;
})
.peek(po -> {
po.setChecked(link != null && po.getId().equals(link.getTemplateId()));
})
.collect(Collectors.toList());
return pos;
}
@Override
public PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param) {
ValidUtil.doValidator(param);
Date now = new Date();
Long id = param.getId();
PageListTemplatePO po;
if (id == null) {
po = PageListTemplatePO.builder()
.id(IdGenerator.generate())
.page(param.getPage())
.name(param.getName())
.sharedType(param.getSharedType())
.limitIds(param.getLimitIds())
.setting(param.getSetting())
.creator((long) user.getUID())
.createTime(now)
.updateTime(now)
.deleteType(0)
.tenantKey(DEFAULT_TENANT_KEY)
.build();
getPageListTemplateMapper().insertIgnoreNull(po);
} else {
po = getPageListTemplateMapper().getById(id);
if (po == null) {
throw new SalaryRunTimeException("模板不存在!");
}
po.setName(param.getName());
po.setSharedType(param.getSharedType());
po.setLimitIds(param.getLimitIds());
po.setSetting(param.getSetting());
po.setUpdateTime(now);
getPageListTemplateMapper().updateIgnoreNull(po);
}
return po;
}
@Override
public void changePageListTemplate(PageListTemplateChangeParam param) {
ValidUtil.doValidator(param);
List<PageLinkPO> pageLinkPOS = getPageLinkMapper().listSome(PageLinkPO.builder().employeeId((long) user.getUID()).page(param.getPage()).build());
if (CollUtil.isNotEmpty(pageLinkPOS)) {
Set<Long> ids = SalaryEntityUtil.properties(pageLinkPOS, PageLinkPO::getId);
getPageLinkMapper().deleteByIds(ids);
}
PageLinkPO pageLinkPO = PageLinkPO.builder()
.id(IdGenerator.generate())
.employeeId((long) user.getUID())
.page(param.getPage())
.templateId(param.getTemplateId())
.tenantKey(DEFAULT_TENANT_KEY)
.createTime(new Date())
.updateTime(new Date())
.creator((long) user.getUID())
.deleteType(0)
.build();
getPageLinkMapper().insertIgnoreNull(pageLinkPO);
}
@Override
public List<WeaTableColumn> getPageListColumns(String page) {
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), page);
if (link != null) {
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).id(link.getTemplateId()).build());
return pageListTemplate.getChecked();
} else {
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).build());
return pageListTemplate.getSetting();
}
}
}

View File

@ -338,39 +338,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
@Override
public void save(TaxAgentRangeSaveParam saveParam) {
if (saveParam == null) {
throw new SalaryRunTimeException("参数错误");
}
if (Objects.isNull(saveParam.getTaxAgentId())) {
throw new SalaryRunTimeException("个税扣缴义务人的id不允许为空");
}
if (saveParam.getIncludeType() != 0 && saveParam.getIncludeType() != 1) {
throw new SalaryRunTimeException("只能选择 关联人员范围/从范围中排除");
}
if (CollectionUtils.isEmpty(saveParam.getEmployeeStatus())) {
throw new SalaryRunTimeException("员工状态不允许为空");
}
if (CollectionUtils.isNotEmpty(saveParam.getTargetParams())) {
saveParam.getTargetParams().forEach(target -> {
if (target.getTargetType() == null) {
throw new SalaryRunTimeException("对象类型不能为空");
}
if (target.getTargetType() == TargetTypeEnum.SQL) {
if (target.getTarget() == null) {
throw new SalaryRunTimeException("sql不能为空");
}
target.setTargetId(0L);
} else {
if (target.getTargetId() == null) {
throw new SalaryRunTimeException("对象不能为空");
}
}
});
}
checkParam(saveParam);
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(saveParam.getTaxAgentId());
@ -427,6 +395,108 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
}
private void checkParam(TaxAgentRangeSaveParam saveParam) {
if (saveParam == null) {
throw new SalaryRunTimeException("参数错误");
}
if (Objects.isNull(saveParam.getTaxAgentId())) {
throw new SalaryRunTimeException("个税扣缴义务人的id不允许为空");
}
if (saveParam.getIncludeType() != 0 && saveParam.getIncludeType() != 1) {
throw new SalaryRunTimeException("只能选择 关联人员范围/从范围中排除");
}
if (CollectionUtils.isEmpty(saveParam.getEmployeeStatus())) {
throw new SalaryRunTimeException("员工状态不允许为空");
}
if (CollectionUtils.isNotEmpty(saveParam.getTargetParams())) {
saveParam.getTargetParams().forEach(target -> {
if (target.getTargetType() == null) {
throw new SalaryRunTimeException("对象类型不能为空");
}
if (target.getTargetType() == TargetTypeEnum.SQL) {
if (target.getTarget() == null) {
throw new SalaryRunTimeException("sql不能为空");
}
target.setTargetId(0L);
} else {
if (target.getTargetId() == null) {
throw new SalaryRunTimeException("对象不能为空");
}
}
});
}
}
@Override
public void edit(TaxAgentRangeSaveParam param) {
checkParam(param);
if (param.getId() == null) {
throw new SalaryRunTimeException("id不能为空");
}
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId());
if (Objects.isNull(taxAgent)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,个税扣缴义务人不存在或不在权限范围内"));
}
//删除原有的管理范围
getTaxAgentManageRangeMapper().deleteByIds(Collections.singleton(param.getId()));
// 查询已有的管理范围
List<TaxAgentManageRangePO> taxAgentManageAllRanges = listByTaxAgentId(param.getTaxAgentId());
List<TaxAgentManageRangePO> taxAgentManageRanges = taxAgentManageAllRanges.stream().filter(f -> f.getIncludeType().equals(param.getIncludeType())).collect(Collectors.toList());
List<TaxAgentManageRangePO> oldManageList = new ArrayList<>();
taxAgentManageRanges.stream().forEach(p -> {
TaxAgentManageRangePO target = new TaxAgentManageRangePO();
BeanUtils.copyProperties(p, target);
oldManageList.add(target);
});
// 处理一下本次的保存参数如果原来添加过对应的人员/部门/岗位那么本次不需要新增只需要更新
TaxAgentBO.Result result = TaxAgentBO.handleTaxAgentRange(taxAgentManageRanges, param, taxAgent.getId(), (long) user.getUID(), false);
/* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================start */
List<TaxAgentManageRangePO> allRanges = Lists.newArrayList(taxAgentManageAllRanges);
allRanges.addAll(result.getNeedInsertTaxAgentManageRanges());
allRanges.addAll(result.getNeedUpdateTaxAgentManageRanges());
// 去重
allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new));
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL);
List<DataCollectionEmployee> allSalaryEmployees = this.getManageRangeSalaryEmployees(param.getTaxAgentId(), allRanges, salaryEmployees);
/* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */
if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) {
result.getNeedInsertTaxAgentManageRanges().forEach(range -> {
getTaxAgentManageRangeMapper().insertIgnoreNull(range);
// 记录操作日志
String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId();
SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, range.getTaxAgentId(), name, SalaryI18nUtil.getI18nLabel(0, "新增人员范围"), SalaryI18nUtil.getI18nLabel(0, "新增人员范围") + name, range, user);
});
}
if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) {
Map<Long, TaxAgentManageRangePO> oldMap = SalaryEntityUtil.convert2Map(oldManageList, TaxAgentManageRangePO::getId);
result.getNeedUpdateTaxAgentManageRanges().forEach(range -> {
getTaxAgentManageRangeMapper().updateIgnoreNull(range);
// 记录操作日志
TaxAgentManageRangePO oldPO = oldMap.getOrDefault(range.getId(), TaxAgentManageRangePO.builder().build());
String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTargetId();
SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.taxAgentLoggerTemplate, range.getTaxAgentId(), name, SalaryI18nUtil.getI18nLabel(0, "更新人员范围"), SalaryI18nUtil.getI18nLabel(0, "更新人员范围") + name, oldPO, range, user);
});
}
/* 同步本地人员范围的关联人员=========================== */
syncLocalEmp(param.getTaxAgentId(), allSalaryEmployees, param.isSync());
}
private void syncLocalEmp(Long taxAgentId, List<DataCollectionEmployee> allSalaryEmployees, boolean isSync) {
if (isSync) {
syncLocalEmpRange(taxAgentId, allSalaryEmployees, (long) user.getUID());

View File

@ -45,6 +45,11 @@ public class SalarySysConstant {
* 加密后前缀
*/
public static final String PRE_SIGN_ENCRYPT = "AES_";
/**
* 工资单员工加密后前缀
*/
public static final String SALARY_BILL_PRE_SIGN_ENCRYPT = "HSE_";
/**
* 锁的key
*/
@ -161,4 +166,9 @@ public class SalarySysConstant {
* 报表组织类型null/0 核算时组织信息 1实时组织信息
*/
public static final String REPORT_ORGANIZATIN_TYPE = "REPORT_ORGANIZATIN_TYPE";
/**
* 薪资明细页面显示类型
*/
public static final String SALARY_DETAILS_REPORT_SHOW_TYPE = "SALARY_DETAILS_REPORT_SHOW_TYPE";
}

View File

@ -2,6 +2,8 @@ package com.engine.salary.util;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.salaryBill.param.SalaryBillGetTokenParam;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.util.db.IdGenerator;
import org.apache.commons.lang3.StringUtils;
@ -76,8 +78,17 @@ public class SalaryTokenUtil {
*
* @return
*/
public static Map<String, String> GetToken(Long uid) {
public static Map<String, String> GetToken(SalaryBillGetTokenParam param) {
String uid = "";
if (StringUtils.isNotBlank(param.getSalaryCode())) {
uid = AESEncryptUtil.decrypt4SalaryBill(param.getSalaryCode());
} else {
uid = param.getRecipient();
}
Map<String, String> heads = new HashMap<>();
if (StringUtils.isBlank(uid)) {
return heads;
}
BaseBean baseBean = new BaseBean();
RecordSet rs = new RecordSet();
Map<String, String> resultMap = new HashMap<>();
@ -96,10 +107,12 @@ public class SalaryTokenUtil {
String sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SECRET'";
rs.execute(sql);
String secret = "";
if (rs.next() && StringUtils.isNotEmpty(rs.getString("conf_value"))) {
if (rs.next() && StringUtils.isNotBlank(rs.getString("conf_value"))) {
// 从数据库中拿secret
secret = rs.getString("conf_value");
} else {
sql= " update hrsa_salary_sys_conf set delete_type=1 WHERE delete_type = 0 AND conf_key in( 'SALARY_TOKEN_SECRET', 'SALARY_TOKEN_SPK')";
rs.execute(sql);
// 注册获取secret
// 获取当前异构系统RSA加密的公钥
String cpk = new RSA().getRSA_PUB();

View File

@ -539,6 +539,30 @@ public class SalaryArchiveController {
if (StringUtils.isNotBlank(extSalaryArchiveList)) {
param.setExtSalaryArchiveList("true".equals(extSalaryArchiveList));
}
String payStartDateStartDateStr = request.getParameter("payStartDateStartDateStr");
if (StringUtils.isNotBlank(payStartDateStartDateStr) && SalaryDateUtil.checkDay(payStartDateStartDateStr)) {
param.setPayStartDateStartDate(SalaryDateUtil.stringToDate(payStartDateStartDateStr));
}
String payStartDateEndDateStr = request.getParameter("payStartDateEndDateStr");
if (StringUtils.isNotBlank(payStartDateEndDateStr) && SalaryDateUtil.checkDay(payStartDateEndDateStr)) {
param.setPayStartDateEndDate(SalaryDateUtil.stringToDate(payStartDateEndDateStr));
}
String payEndDateStartDateStr = request.getParameter("payEndDateStartDateStr");
if (StringUtils.isNotBlank(payEndDateStartDateStr) && SalaryDateUtil.checkDay(payEndDateStartDateStr)) {
param.setPayEndDateStartDate(SalaryDateUtil.stringToDate(payEndDateStartDateStr));
}
String payEndDateEndDateStr = request.getParameter("payEndDateEndDateStr");
if (StringUtils.isNotBlank(payEndDateEndDateStr) && SalaryDateUtil.checkDay(payEndDateEndDateStr)) {
param.setPayEndDateEndDate(SalaryDateUtil.stringToDate(payEndDateEndDateStr));
}
String adjustSalaryStartDateStr = request.getParameter("adjustSalaryStartDate");
if (StringUtils.isNotBlank(adjustSalaryStartDateStr) && SalaryDateUtil.checkDay(adjustSalaryStartDateStr)) {
param.setAdjustSalaryStartDate(SalaryDateUtil.stringToDate(adjustSalaryStartDateStr));
}
String adjustSalaryEndDate = request.getParameter("adjustSalaryEndDate");
if (StringUtils.isNotBlank(adjustSalaryEndDate) && SalaryDateUtil.checkDay(adjustSalaryEndDate)) {
param.setAdjustSalaryEndDate(SalaryDateUtil.stringToDate(adjustSalaryEndDate));
}
return param;
}

Some files were not shown because too many files have changed in this diff Show More