Merge branch 'release/2.16.1.2410.01' into feature/权限

# Conflicts:
#	src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java
This commit is contained in:
钱涛 2024-11-04 14:33:15 +08:00
commit ef13d93fe1
52 changed files with 1548 additions and 121 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

@ -1,5 +1,9 @@
select id from hrsa_tax_agent_emp 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 update hrsa_tax_agent_emp set delete_type = 3

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

View File

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

View File

@ -57,35 +57,6 @@ public class SalarySobRangeBO {
resultParams.add(queryParam); resultParams.add(queryParam);
}); });
return resultParams; 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() return SalarySobRangeListDTO.builder()
.id(salarySobRangePO.getId()) .id(salarySobRangePO.getId())
.salarySobId(salarySobRangePO.getSalarySobId()) .salarySobId(salarySobRangePO.getSalarySobId())
.targetType(targetTypeEnum != null ? targetTypeEnum.getValue() : -1) .targetType(targetTypeEnum)
.targetTypeName(Optional.ofNullable(targetTypeEnum) .targetTypeName(Optional.ofNullable(targetTypeEnum)
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())) .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
.orElse(StringUtils.EMPTY)) .orElse(StringUtils.EMPTY))
@ -125,6 +96,7 @@ public class SalarySobRangeBO {
.target(salarySobRangePO.getTarget()) .target(salarySobRangePO.getTarget())
.targetName(buildTargetName(salarySobRangePO, employeeComInfoMap, departmentComInfoMap, subCompanyComInfoMap, positionComInfoMap)) .targetName(buildTargetName(salarySobRangePO, employeeComInfoMap, departmentComInfoMap, subCompanyComInfoMap, positionComInfoMap))
.employeeStatus(employeeStatusesStr) .employeeStatus(employeeStatusesStr)
.status(parseByStatuses(salarySobRangePO.getEmployeeStatuses()))
.build(); .build();
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -150,6 +122,20 @@ public class SalarySobRangeBO {
return sb.toString(); 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 * @see TargetTypeEnum
*/ */
private Integer targetType; private TargetTypeEnum targetType;
@SalaryTableColumn(text = "对象类型", width = "10%", column = "targetTypeName") @SalaryTableColumn(text = "对象类型", width = "10%", column = "targetTypeName")
@TableTitle(title = "对象类型", dataIndex = "targetTypeName", key = "targetTypeName") @TableTitle(title = "对象类型", dataIndex = "targetTypeName", key = "targetTypeName")
@ -54,4 +54,6 @@ public class SalarySobRangeListDTO {
@SalaryTableColumn(text = "员工状态", width = "10%", column = "employeeStatus") @SalaryTableColumn(text = "员工状态", width = "10%", column = "employeeStatus")
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus") @TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
private String 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.SalaryEmployeeStatusEnum;
import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum;
import com.engine.salary.util.valid.DataCheck; import com.engine.salary.util.valid.DataCheck;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.engine.salary.util.valid.ValidTypeEnum; import com.engine.salary.util.valid.ValidTypeEnum;
import lombok.Data; import lombok.Data;
@ -22,6 +23,9 @@ import java.util.List;
//薪资账套人员范围保存参数") //薪资账套人员范围保存参数")
public class SalarySobRangeSaveParam { public class SalarySobRangeSaveParam {
@DataCheck(require = true, message = "ID不允许为空",runtime = {RuntimeTypeEnum.UPDATE})
private Long id;
//薪资账套的id //薪资账套的id
@DataCheck(require = true, message = "薪资账套的ID不允许为空") @DataCheck(require = true, message = "薪资账套的ID不允许为空")
@ElogTransform( name = "薪资账套id" ) @ElogTransform( name = "薪资账套id" )

View File

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

View File

@ -87,4 +87,15 @@ public class SupplementAccountBaseParam {
* 补缴类型 * 补缴类型
*/ */
private String supplementType; 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

@ -133,6 +133,17 @@ public class InsuranceAccountBatchPO {
@ElogTransform(name = "个税扣缴义务人id") @ElogTransform(name = "个税扣缴义务人id")
private Long paymentOrganization; 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;
private Set<String> opts; private Set<String> opts;
} }

View File

@ -328,4 +328,14 @@ public class InsuranceAccountDetailPO {
*/ */
@ElogTransform(name = "个税扣缴义务人") @ElogTransform(name = "个税扣缴义务人")
private Long paymentOrganization; 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 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 @I18n
private String departmentName; private String departmentName;
@I18n
private String fixedDepartmentName;
private Integer userStatus; private Integer userStatus;
private Integer fixedUserStatus;
private String workcode; private String workcode;
} }

View File

@ -275,6 +275,7 @@ public class TaxAgentBO {
.target(taxAgentManageRange.getTarget()) .target(taxAgentManageRange.getTarget())
.targetName(buildTargetName(taxAgentManageRange, employeeComInfoMap, departmentComInfoMap, subDepartmentComInfoMap, positionComInfoMap)) .targetName(buildTargetName(taxAgentManageRange, employeeComInfoMap, departmentComInfoMap, subDepartmentComInfoMap, positionComInfoMap))
.employeeStatus(buildEmployeeStatus(hrmStatusNameMap, taxAgentManageRange.getEmployeeStatus())) .employeeStatus(buildEmployeeStatus(hrmStatusNameMap, taxAgentManageRange.getEmployeeStatus()))
.status(buildStatus(taxAgentManageRange.getEmployeeStatus()))
.build(); .build();
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -290,6 +291,14 @@ public class TaxAgentBO {
.collect(Collectors.joining(",")); .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") @TableTitle(title ="员工状态",key = "employeeStatus",dataIndex = "employeeStatus")
private String employeeStatus; private String employeeStatus;
private String status;
} }

View File

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

View File

@ -3,6 +3,8 @@
<mapper namespace="com.engine.salary.mapper.InsuranceExportMapper"> <mapper namespace="com.engine.salary.mapper.InsuranceExportMapper">
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO"> <select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -29,6 +31,8 @@
</select> </select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle"> <select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -55,6 +59,8 @@
</select> </select>
<select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver"> <select id="exportAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -120,6 +126,8 @@
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO"> <select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -147,6 +155,8 @@
</select> </select>
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle"> <select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -174,6 +184,8 @@
</select> </select>
<select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver"> <select id="exportRecessionAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.lastname AS userName, e.lastname AS userName,
e.MOBILE AS telephone, e.MOBILE AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -202,6 +214,8 @@
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO"> <select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName, e.username AS userName,
e.mobile AS telephone, e.mobile AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -223,6 +237,8 @@
</select> </select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle"> <select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="oracle">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName, e.username AS userName,
e.mobile AS telephone, e.mobile AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -244,6 +260,8 @@
</select> </select>
<select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver"> <select id="exportExtAccount" resultType="com.engine.salary.entity.siexport.po.AccountExportPO" databaseId="sqlserver">
SELECT a.*, SELECT a.*,
a.department_name AS fixedDepartmentName,
a.status AS fixedUserStatus,
e.username AS userName, e.username AS userName,
e.mobile AS telephone, e.mobile AS telephone,
d.departmentname AS departmentName, d.departmentname AS departmentName,
@ -266,7 +284,8 @@
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO"> <select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO">
SELECT 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( FROM(
SELECT * from hrsa_excel_bill_detail 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} 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>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle"> <select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="oracle">
SELECT 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( FROM(
SELECT * from hrsa_excel_bill_detail 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} 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>
<select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver"> <select id="exportExtExcelAccount" resultType="com.engine.salary.entity.siexport.po.ExcelAccountExportPO" databaseId="sqlserver">
SELECT 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( FROM(
SELECT * from hrsa_excel_bill_detail 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} 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="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/> <result column="tenant_key" property="tenantKey"/>
<result column="payment_organization" property="paymentOrganization"/> <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> </resultMap>
<!-- 表字段 --> <!-- 表字段 -->
@ -103,6 +113,15 @@
, t.update_time , t.update_time
, t.tenant_key , t.tenant_key
, t.payment_organization , 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>
<sql id="baseColumnsNoJoin"> <sql id="baseColumnsNoJoin">
t t
@ -203,6 +222,19 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -244,6 +276,18 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -285,6 +329,18 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.departmentid IN AND e.departmentid IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -327,6 +383,18 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -368,6 +436,18 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
@ -409,6 +489,18 @@
#{taxAgent} #{taxAgent}
</foreach> </foreach>
</if> </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"> <if test="param.departmentIds != null and param.departmentIds.size()>0">
AND e.department_id IN AND e.department_id IN
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")"> <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, 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, 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, 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 VALUES
<foreach collection="accounts" item="item" separator=","> <foreach collection="accounts" item="item" separator=",">
( (
@ -857,7 +950,16 @@
#{item.paymentOrganization}, #{item.paymentOrganization},
#{item.socialPaymentComBaseString}, #{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString}, #{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> </foreach>
</insert> </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, 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, 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, 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"> <foreach collection="accounts" item="item" separator="union all">
select select
#{item.employeeId,jdbcType=DOUBLE}, #{item.employeeId,jdbcType=DOUBLE},
@ -915,7 +1018,16 @@
#{item.paymentOrganization,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,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 from dual
</foreach> </foreach>
</insert> </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, 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, 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, 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 VALUES
( (
#{item.employeeId}, #{item.employeeId},
@ -974,7 +1087,16 @@
#{item.paymentOrganization}, #{item.paymentOrganization},
#{item.socialPaymentComBaseString}, #{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString}, #{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> </foreach>
</insert> </insert>

View File

@ -102,6 +102,15 @@
, t.update_time , t.update_time
, t.tenant_key , t.tenant_key
, t.payment_organization , 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> </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, 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, 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, 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 VALUES
<foreach collection="accounts" item="item" separator=","> <foreach collection="accounts" item="item" separator=",">
( (
@ -185,7 +195,16 @@
#{item.paymentOrganization}, #{item.paymentOrganization},
#{item.socialPaymentComBaseString}, #{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString}, #{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> </foreach>
</insert> </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, 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, 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, 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"> <foreach collection="accounts" item="item" separator="union all">
select select
@ -243,7 +263,16 @@
#{item.paymentOrganization,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,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 from dual
</foreach> </foreach>
</insert> </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, 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, 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, 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 VALUES
( (
#{item.employeeId}, #{item.employeeId},
@ -301,7 +331,16 @@
#{item.paymentOrganization}, #{item.paymentOrganization},
#{item.socialPaymentComBaseString}, #{item.socialPaymentComBaseString},
#{item.fundPaymentComBaseString}, #{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> </foreach>
</insert> </insert>

View File

@ -14,7 +14,7 @@ import java.util.Map;
**/ **/
public interface RecordsBuildService { 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); 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); 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

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

View File

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

View File

@ -70,7 +70,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
} }
@Override @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 = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>(); 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("billMonth", item.getBillMonth());
record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class)); record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class));
record.put("userName", simpleEmployee.getUsername()); record.put("userName", simpleEmployee.getUsername());
record.put("department", simpleEmployee.getDepartmentName());
record.put("supplementaryMonth", item.getSupplementaryMonth());
record.put("mobile", simpleEmployee.getMobile()); 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); ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
record.put("workcode", StringUtils.isBlank(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode()); record.put("workcode", StringUtils.isBlank(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode());
record.put("idNo", Util.null2String(simpleEmployee.getIdNo())); record.put("idNo", Util.null2String(simpleEmployee.getIdNo()));

View File

@ -291,7 +291,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList(); 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); PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent()); pageInfos.setPageNum(queryParam.getCurrent());
@ -358,7 +358,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList(); List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); 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); PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent()); pageInfos.setPageNum(queryParam.getCurrent());
@ -428,7 +428,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList(); List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); 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); PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent()); pageInfos.setPageNum(queryParam.getCurrent());
@ -487,7 +487,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList(); List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); 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); PageInfo<Map<String, Object>> pageInfos = new PageInfo<>(records);
pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setTotal(pageInfo.getTotal());
pageInfos.setPageNum(queryParam.getCurrent()); pageInfos.setPageNum(queryParam.getCurrent());
@ -1588,7 +1588,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
encryptUtil.decryptList(accountExportPOS, AccountExportPO.class); encryptUtil.decryptList(accountExportPOS, AccountExportPO.class);
SalaryI18nUtil.i18nList(accountExportPOS); SalaryI18nUtil.i18nList(accountExportPOS);
// 数据组装 // 数据组装
List<Map<String, Object>> records = getSIExportService(user).buildCommonRecords(accountExportPOS); List<Map<String, Object>> records = getSIExportService(user).buildCommonRecords(accountExportPOS, true);
// excel导出的数据 // excel导出的数据
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(records.size()); List<List<Object>> rows = Lists.newArrayListWithExpectedSize(records.size());
@ -1781,11 +1781,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
if (!empIdsInPayMonthRange.contains(employeeId)) { if (!empIdsInPayMonthRange.contains(employeeId)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员"));
} }
DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
// 封装InsuranceAccountDetailPO // 封装InsuranceAccountDetailPO
Date now = new Date(); Date now = new Date();
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setBillStatus(0); insuranceAccountDetailPO.setBillStatus(0);
insuranceAccountDetailPO.setEmployeeId(employeeId); 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.setPaymentOrganization(paymentOrganization);
insuranceAccountDetailPO.setPaymentStatus(1); insuranceAccountDetailPO.setPaymentStatus(1);
insuranceAccountDetailPO.setResourceFrom(0); insuranceAccountDetailPO.setResourceFrom(0);
@ -4145,7 +4157,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
PageInfo<InsuranceAccountDetailPO> pageInfo = siBatchListCommonPage(queryParam); PageInfo<InsuranceAccountDetailPO> pageInfo = siBatchListCommonPage(queryParam);
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList(); 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> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
Map<String, Object> sumRow = countSum(records); Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow); datas.put("sumRow", sumRow);
@ -4181,7 +4193,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList); list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); 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> maxSizeRecord = records.stream().reduce(new HashMap<>(), (a, b) -> a.size() > b.size() ? a : b);
Map<String, Object> sumRow = countSum(records); Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow); datas.put("sumRow", sumRow);
@ -4220,7 +4232,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList); list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); 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); Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow); datas.put("sumRow", sumRow);
return datas; return datas;
@ -4258,7 +4270,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
list.addAll(extList); list.addAll(extList);
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); 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); Map<String, Object> sumRow = countSum(records);
datas.put("sumRow", sumRow); datas.put("sumRow", sumRow);
return datas; return datas;
@ -4533,6 +4545,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setId(IdGenerator.generate()); insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(employeeId); 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.setBillMonth(billMonth.substring(0, 7));
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue()); insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
@ -4933,7 +4958,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
} }
log.info("开始生成福利核算数据,待处理人员数量:{}", ids.size()); log.info("开始生成福利核算数据,待处理人员数量:{}", ids.size());
siCommonAccount(param.getBillMonth(), ids, param.getPaymentOrganization()); siCommonAccount(param.getBillMonth(), ids, param.getPaymentOrganization(), param.isFlag());
log.info("福利核算数据生成完毕,开始数据处理"); log.info("福利核算数据生成完毕,开始数据处理");
handleData(ids, param); handleData(ids, param);
@ -4961,10 +4986,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 = siArchivesBiz.buildBatchAccount(ids, paymentOrganization);
Map<Long, InsuranceArchivesAccountPO> insuranceArchivesAccountPOS = getSIArchivesService(user).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<>(); List<InsuranceAccountDetailTempPO> list = new ArrayList<>();
int count = 0; int count = 0;
for (Map.Entry<Long, InsuranceArchivesAccountPO> entry : insuranceArchivesAccountPOS.entrySet()) { for (Map.Entry<Long, InsuranceArchivesAccountPO> entry : insuranceArchivesAccountPOS.entrySet()) {
@ -4982,6 +5018,34 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue()); insuranceAccountDetailPO.setResourceFrom(ResourceFromEnum.SYSTEM.getValue());
insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
insuranceAccountDetailPO.setPaymentOrganization(paymentOrganization); 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); accountSocial(insuranceAccountDetailPO, v, billMonth);
@ -5017,7 +5081,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//临时表数据入库 //临时表数据入库
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class); encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 40); List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 20);
lists.forEach(subList -> { lists.forEach(subList -> {
getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList); getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList);
}); });
@ -5903,8 +5967,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
employeeIds = employeeIds.stream().filter(f -> empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); employeeIds = employeeIds.stream().filter(f -> empIdsInPayMonthRange.contains(f)).collect(Collectors.toList());
SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(0, "无核算人员")); 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<>(); List<SupplementAccountBaseParam> baseList = new ArrayList<>();
employeeIds.stream().forEach(id -> { employeeIds.stream().forEach(id -> {
DataCollectionEmployee employee = empMap.get(id);
param.getBillMonthList().stream().forEach(month -> { param.getBillMonthList().stream().forEach(month -> {
SupplementAccountBaseParam supplementAccountBaseParam = SupplementAccountBaseParam.builder() SupplementAccountBaseParam supplementAccountBaseParam = SupplementAccountBaseParam.builder()
.supplementaryMonth(month) .supplementaryMonth(month)
@ -5914,6 +5984,17 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
.billMonth(param.getBillMonth()) .billMonth(param.getBillMonth())
.supplementType(param.getSupplementType()) .supplementType(param.getSupplementType())
.build(); .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())) { if ("2".equals(param.getSupplementType())) {
supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString()); supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString());
supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString()); supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString());
@ -5970,6 +6051,16 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); insuranceAccountDetailPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
insuranceAccountDetailPO.setId(IdGenerator.generate()); insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(baseParam.getEmployeeId()); 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.setPaymentStatus(PaymentStatusEnum.REPAIR.getValue());
insuranceAccountDetailPO.setSupplementaryMonth(baseParam.getSupplementaryMonth()); insuranceAccountDetailPO.setSupplementaryMonth(baseParam.getSupplementaryMonth());
insuranceAccountDetailPO.setPaymentOrganization(baseParam.getPaymentOrganization()); insuranceAccountDetailPO.setPaymentOrganization(baseParam.getPaymentOrganization());

View File

@ -938,7 +938,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
//获取社保档案 //获取社保档案
socialList = getSocialSchemeMapper().getSocialById(socialIds); 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()); .map(InsuranceArchivesSocialSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopSocialIds = toStopSocialIds; List<Long> finalToStopSocialIds = toStopSocialIds;
@ -948,7 +948,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundIds.size() > 0) { if (fundIds.size() > 0) {
fundList = getFundSchemeMapper().getFundById(fundIds); 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()); .map(InsuranceArchivesFundSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopFundIds = toStopFundIds; List<Long> finalToStopFundIds = toStopFundIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopFundIds.contains(f.getFundArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList())); noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopFundIds.contains(f.getFundArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));
@ -957,7 +957,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherIds.size() > 0) { if (otherIds.size() > 0) {
otherList = getOtherSchemeMapper().getOtherById(otherIds); 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()); .map(InsuranceArchivesOtherSchemePO::getId).collect(Collectors.toList());
List<Long> finalToStopOtherIds = toStopOtherIds; List<Long> finalToStopOtherIds = toStopOtherIds;
noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopOtherIds.contains(f.getOtherArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList())); noStopBaseInfoIds = (List<Long>) CollectionUtils.union(noStopBaseInfoIds, baseInfoPOList.stream().filter(f -> !finalToStopOtherIds.contains(f.getOtherArchivesId())).map(InsuranceArchivesBaseInfoPO::getId).collect(Collectors.toList()));
@ -1030,7 +1030,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
} }
@Override @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)) { if (CollectionUtils.isEmpty(ids)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(145969, "没有可以操作的记录")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(145969, "没有可以操作的记录"));
@ -1051,10 +1051,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (baseInfoIds.size() > 0) { if (baseInfoIds.size() > 0) {
getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder() getInsuranceBaseInfoMapper().updateRunStatusByIds(InsuranceArchivesBaseInfoPO.builder()
.ids(baseInfoIds).runStatus(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()).build()); .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); getSocialSchemeMapper().batchUpdateEndTime(socialIds, socialEndYearMonth);
getFundSchemeMapper().batchUpdateEndTime(fundIds, yearMonth); getFundSchemeMapper().batchUpdateEndTime(fundIds, fundEndYearMonth);
getOtherSchemeMapper().batchUpdateEndTime(otherIds, yearMonth); 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.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.EncryptUtil; 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.BalanceAccountBaseParam;
import com.engine.salary.entity.siaccount.param.InspectAccountParam; import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; 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.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIBalanceService; import com.engine.salary.service.SIBalanceService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.IdGenerator;
@ -98,6 +100,10 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
return MapperProxyFactory.getProxy(TaxAgentMapper.class); return MapperProxyFactory.getProxy(TaxAgentMapper.class);
} }
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@Override @Override
public void del(InspectAccountParam param, Long employeeId) { public void del(InspectAccountParam param, Long employeeId) {
@ -323,10 +329,24 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
if (balanceAccountPO != null) { if (balanceAccountPO != null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补差数据已存在,不可重复新增!")); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补差数据已存在,不可重复新增!"));
} }
DataCollectionEmployee employeeById = getSalaryEmployeeService(user).getEmployeeById(employeeId);
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
insuranceAccountDetailPO.setId(IdGenerator.generate()); insuranceAccountDetailPO.setId(IdGenerator.generate());
insuranceAccountDetailPO.setEmployeeId(employeeId); 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.setBillMonth(billMonth);
insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); insuranceAccountDetailPO.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue()); insuranceAccountDetailPO.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());

View File

@ -289,7 +289,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().listAll(); List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().listAll();
encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); 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 = ""; String welfareTypeName = "";
switch (categoryPO.getWelfareType()) { switch (categoryPO.getWelfareType()) {
case 1: case 1:

View File

@ -220,7 +220,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
// } // }
columns = buildCommonColumns(accountExportPOS, paymentStatus); columns = buildCommonColumns(accountExportPOS, paymentStatus);
records = buildCommonRecords(accountExportPOS); records = buildCommonRecords(accountExportPOS, false);
List<List<Object>> excelSheetData = new ArrayList<>(); List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称 //工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(0, "社保福利台账"); String sheetName = SalaryI18nUtil.getI18nLabel(0, "社保福利台账");
@ -280,7 +280,7 @@ public class SIExportServiceImpl extends Service implements SIExportService {
} }
@Override @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 = siArchivesBiz.isDiffWelBase();
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase(); boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
List<Map<String, Object>> result = new ArrayList<>(); 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("billMonth", item.getBillMonth());
record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class)); record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class));
record.put("userName", item.getUserName()); 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("supplementaryMonth", item.getSupplementaryMonth());
record.put("mobile", item.getTelephone()); record.put("mobile", item.getTelephone());
record.put("workcode", item.getWorkcode()); record.put("workcode", item.getWorkcode());
record.put("idNo", item.getIdNo()); record.put("idNo", item.getIdNo());
record.put("employeeStatus", item.getUserStatus() == null ? "" : getDefaultLabelByValue(item.getUserStatus()));
ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class); ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(from.getLabelId(), from.getDefaultLabel())); 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.salary.config.SalaryElogConfig;
import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.encrypt.EncryptUtil; 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.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; 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.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIRecessionService; import com.engine.salary.service.SIRecessionService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxAgentService;
import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEntityUtil;
@ -75,6 +77,10 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
return MapperProxyFactory.getProxy(TaxAgentMapper.class); return MapperProxyFactory.getProxy(TaxAgentMapper.class);
} }
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@Override @Override
public void save(RecessionParam param, Long employeeId) { public void save(RecessionParam param, Long employeeId) {
@ -108,12 +114,17 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
//处理数据 //处理数据
List<InsuranceAccountDetailPO> finalDetailPOS = detailPOS; List<InsuranceAccountDetailPO> finalDetailPOS = detailPOS;
List<InsuranceAccountDetailPO> finalRecessionDetails = new ArrayList<>(); List<InsuranceAccountDetailPO> finalRecessionDetails = new ArrayList<>();
// 获取员工信息
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByIds(employeeIds);
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
employeeIds.forEach(id -> { employeeIds.forEach(id -> {
DataCollectionEmployee employee = employeeMap.getOrDefault(id, DataCollectionEmployee.builder().build());
param.getRecessionMonthList().forEach(billMonth -> { param.getRecessionMonthList().forEach(billMonth -> {
Optional<InsuranceAccountDetailPO> detailPOOptional = finalDetailPOS.stream().filter( Optional<InsuranceAccountDetailPO> detailPOOptional = finalDetailPOS.stream().filter(
detail -> Objects.equals(billMonth, detail.getBillMonth()) detail -> Objects.equals(billMonth, detail.getBillMonth())
&& Objects.equals(id, detail.getEmployeeId())).findFirst(); && 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(); List<Integer> projects = param.getProjects();
InsuranceAccountDetailPO temp = new InsuranceAccountDetailPO(); InsuranceAccountDetailPO temp = new InsuranceAccountDetailPO();
recessionBaseBuild(param, temp, insuranceAccountDetailPO); recessionBaseBuild(param, temp, insuranceAccountDetailPO, employee);
if (projects.contains(ProjectTypeEnum.ALL.getValue())) { if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
recessionSocial(param, temp, insuranceAccountDetailPO); recessionSocial(param, temp, insuranceAccountDetailPO);
recessionFund(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())); InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization()));
temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue()); temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
// temp.setId(IdGenerator.generate()); // temp.setId(IdGenerator.generate());
@ -209,6 +220,17 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
temp.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); temp.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
temp.setTenantKey(insuranceAccountDetailPO.getTenantKey()); temp.setTenantKey(insuranceAccountDetailPO.getTenantKey());
temp.setEmployeeId(insuranceAccountDetailPO.getEmployeeId()); 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.setBillMonth(param.getBillMonth());
temp.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue()); temp.setBillStatus(BillStatusEnum.NOT_ARCHIVED.getValue());
temp.setSupplementaryMonth(insuranceAccountDetailPO.getBillMonth()); temp.setSupplementaryMonth(insuranceAccountDetailPO.getBillMonth());

View File

@ -4,10 +4,10 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.hrm.biz.OrganizationShowSetBiz; import com.engine.hrm.biz.OrganizationShowSetBiz;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.biz.SalarySobRangeBiz; import com.engine.salary.biz.SalarySobRangeBiz;
import com.engine.salary.biz.SpecialAddDeductionBiz; import com.engine.salary.biz.SpecialAddDeductionBiz;
import com.engine.salary.config.SalaryElogConfig; 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.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.DeptInfo;
import com.engine.salary.entity.hrm.PositionInfo; 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.excel.ExcelUtil;
import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.engine.salary.util.valid.ValidUtil; import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -198,6 +199,43 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); 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 @Override
public void deleteByIds(Collection<Long> ids) { public void deleteByIds(Collection<Long> ids) {
// 查询薪资账套的人员范围 // 查询薪资账套的人员范围

View File

@ -339,39 +339,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
@Override @Override
public void save(TaxAgentRangeSaveParam saveParam) { public void save(TaxAgentRangeSaveParam saveParam) {
if (saveParam == null) { checkParam(saveParam);
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("对象不能为空");
}
}
});
}
// 查询个税扣缴义务人 // 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(saveParam.getTaxAgentId()); TaxAgentPO taxAgent = getTaxAgentService(user).getById(saveParam.getTaxAgentId());
@ -428,6 +396,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) { private void syncLocalEmp(Long taxAgentId, List<DataCollectionEmployee> allSalaryEmployees, boolean isSync) {
if (isSync) { if (isSync) {
syncLocalEmpRange(taxAgentId, allSalaryEmployees, (long) user.getUID()); syncLocalEmpRange(taxAgentId, allSalaryEmployees, (long) user.getUID());

View File

@ -259,6 +259,17 @@ public class SalarySobController {
return new ResponseResult<SalarySobRangeSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::save, saveParam); return new ResponseResult<SalarySobRangeSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::save, saveParam);
} }
/**
* 保存薪资账套人员范围
*/
@POST
@Path("/range/edit")
@Produces(MediaType.APPLICATION_JSON)
public String editSalarySobRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobRangeSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::edit, saveParam);
}
/** /**
* 删除薪资账套人员范围 * 删除薪资账套人员范围
*/ */

View File

@ -263,6 +263,14 @@ public class TaxAgentController {
return new ResponseResult<TaxAgentRangeSaveParam, String>(user).run(getTaxAgentWrapper(user)::saveRange, saveParam); return new ResponseResult<TaxAgentRangeSaveParam, String>(user).run(getTaxAgentWrapper(user)::saveRange, saveParam);
} }
//保存人员范围
@POST
@Path("/range/edit")
@Produces(MediaType.APPLICATION_JSON)
public String editRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeSaveParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxAgentRangeSaveParam, String>(user).run(getTaxAgentWrapper(user)::editRange, param);
}
//删除人员范围 //删除人员范围

View File

@ -104,6 +104,36 @@ public class SalarySobRangeWrapper extends Service {
getSalarySobRangeService(user).save(saveParam); getSalarySobRangeService(user).save(saveParam);
} }
public void edit(SalarySobRangeSaveParam param) {
Optional.ofNullable(param.getTargetParams()).orElse(new ArrayList<>())
.forEach(targetParam -> {
if (StrUtil.isNotBlank(targetParam.getTarget())) {
targetParam.setTarget(targetParam.getTarget()
.replace("", "select")
.replace("", "SELECT")
.replace("", "join")
.replace("", "JOIN")
.replace("", "and")
.replace("", "AND")
.replace("", "or")
.replace("", "OR")
.replace("", "in")
.replace("", "IN")
.replace("", "like")
.replace("", "LIKE")
.replace("", "exists")
.replace("", "EXISTS")
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
}
});
getSalarySobRangeService(user).edit(param);
}
/** /**
* 保存 * 保存
* *

View File

@ -363,6 +363,40 @@ public class TaxAgentWrapper extends Service {
} }
public String editRange(TaxAgentRangeSaveParam param) {
//将select因XSS过滤造成的异常字符转换回来
Optional.ofNullable(param.getTargetParams()).orElse(new ArrayList<>())
.forEach(targetParam -> {
if (StrUtil.isNotBlank(targetParam.getTarget())) {
targetParam.setTarget(targetParam.getTarget()
.replace("", "select")
.replace("", "SELECT")
.replace("", "join")
.replace("", "JOIN")
.replace("", "and")
.replace("", "AND")
.replace("", "or")
.replace("", "OR")
.replace("", "in")
.replace("", "IN")
.replace("", "like")
.replace("", "LIKE")
.replace("", "exists")
.replace("", "EXISTS")
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
}
});
getTaxAgentManageRangeService(user).edit(param);
return StringUtils.EMPTY;
}
/** /**
* 删除管理范围 * 删除管理范围
* *