Merge branch 'feature/241001-社保台账人员信息快照' into release/2.16.1.2410.01

This commit is contained in:
Harryxzy 2024-11-01 14:33:14 +08:00
commit 989468cdc7
34 changed files with 1253 additions and 44 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,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,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,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,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,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,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,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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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());
@ -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

@ -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());