Merge branch 'release/个税版本' into custom/艾志工业
# Conflicts: # src/com/engine/salary/biz/EmployBiz.java # src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java # src/com/engine/salary/service/AddUpSituationService.java # src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java # src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java # src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java # src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java # src/com/engine/salary/web/AddUpSituationController.java # src/com/engine/salary/wrapper/AddUpSituationWrapper.java
This commit is contained in:
commit
f3f814a145
|
|
@ -1,5 +1,5 @@
|
|||
log=false
|
||||
defaultCloseNonStandard149=true
|
||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||
version=2.14.3.2406.01
|
||||
version=2.15.1.2407.01
|
||||
openFormulaForcedEditing=false
|
||||
|
|
@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
salary_sob_id NUMBER(38,0) NULL ,
|
||||
income_category varchar2(100) ,
|
||||
tax_index varchar2(100) ,
|
||||
salary_item_id NUMBER(38,0) NULL ,
|
||||
creator NUMBER(38,0) DEFAULT 0,
|
||||
create_time DATE DEFAULT sysdate,
|
||||
update_time DATE DEFAULT sysdate,
|
||||
delete_type number DEFAULT 0,
|
||||
tenant_key varchar2(10) DEFAULT ''
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE hrsa_salary_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_back_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date default sysdate,
|
||||
update_time date default sysdate,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
salary_acct_record_id number,
|
||||
tax_agent_id number,
|
||||
request_id varchar2(100)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
salary_sob_id NUMBER(38,0) NULL ,
|
||||
income_category varchar2(100) ,
|
||||
tax_index varchar2(100) ,
|
||||
salary_item_id NUMBER(38,0) NULL ,
|
||||
creator NUMBER(38,0) DEFAULT 0,
|
||||
create_time DATE DEFAULT sysdate,
|
||||
update_time DATE DEFAULT sysdate,
|
||||
delete_type number DEFAULT 0,
|
||||
tenant_key varchar2(10) DEFAULT ''
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE hrsa_salary_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_back_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date default sysdate,
|
||||
update_time date default sysdate,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
salary_acct_record_id number,
|
||||
tax_agent_id number,
|
||||
request_id varchar2(100)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
salary_sob_id NUMBER(38,0) NULL ,
|
||||
income_category varchar2(100) ,
|
||||
tax_index varchar2(100) ,
|
||||
salary_item_id NUMBER(38,0) NULL ,
|
||||
creator NUMBER(38,0) DEFAULT 0,
|
||||
create_time DATE DEFAULT sysdate,
|
||||
update_time DATE DEFAULT sysdate,
|
||||
delete_type number DEFAULT 0,
|
||||
tenant_key varchar2(10) DEFAULT ''
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE hrsa_salary_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_back_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date default sysdate,
|
||||
update_time date default sysdate,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
salary_acct_record_id number,
|
||||
tax_agent_id number,
|
||||
request_id varchar2(100)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -33,8 +33,7 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id bigint(0) NOT NULL,
|
||||
create_time datetime(0) ,
|
||||
update_time datetime(0) ,
|
||||
creator bigint(0) ,
|
||||
delete_type int(0) ,
|
||||
tenant_key varchar(10),
|
||||
salary_sob_id bigint(0),
|
||||
income_category varchar(100) ,
|
||||
tax_index varchar(100) ,
|
||||
salary_item_id bigint(0) ,
|
||||
PRIMARY KEY (id)
|
||||
) ;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp
|
||||
ADD COLUMN subcompany_name varchar(200) ,
|
||||
ADD COLUMN subcompany_id bigint(0),
|
||||
ADD COLUMN department_name varchar(200),
|
||||
ADD COLUMN department_id bigint(0),
|
||||
ADD COLUMN jobtitle_name varchar(200) ,
|
||||
ADD COLUMN jobtitle_id bigint(0) ,
|
||||
ADD COLUMN jobcall varchar(200),
|
||||
ADD COLUMN jobcall_id bigint(0),
|
||||
ADD COLUMN status varchar(200);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
update hrsa_salary_acct_emp a INNER JOIN (
|
||||
select e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) as b
|
||||
on a.employee_id = b.employeeId
|
||||
set a.department_id = b.departmentId,
|
||||
a.department_name = b.departmentName,
|
||||
a.subcompany_id = b.subcompanyid,
|
||||
a.subcompany_name = b.subcompanyName,
|
||||
a.jobtitle_id = b.jobtitleId,
|
||||
a.jobtitle_name = b.jobtitleName,
|
||||
a.jobcall_id = b.jobcallId,
|
||||
a.jobcall = b.jobcall,
|
||||
a.status = b.status
|
||||
where a.delete_type=0;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_item add default_value varchar(255);
|
||||
alter table hrsa_salary_sob_item add default_value varchar(255);
|
||||
alter table hrsa_salary_sob_back_item add default_value varchar(255);
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
CREATE TABLE hrsa_api_task_record (
|
||||
id bigint(0) NOT NULL ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param text ,
|
||||
response text,
|
||||
tenant_key varchar(255) ,
|
||||
delete_type int(0) ,
|
||||
create_time datetime(0),
|
||||
update_time datetime(0),
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id bigint primary key comment 'ID' ,
|
||||
create_time datetime default now() comment '创建时间' ,
|
||||
update_time datetime default now() comment '修改时间' ,
|
||||
creator bigint comment '创建人id' ,
|
||||
delete_type int default 0 comment '是否删除' ,
|
||||
tenant_key varchar(10) comment '租户KEY' ,
|
||||
salary_acct_record_id bigint comment '薪资核算记录id' ,
|
||||
tax_agent_id bigint comment '个税扣缴义务人id' ,
|
||||
request_id varchar(100) comment '请求requestId'
|
||||
)
|
||||
;
|
||||
|
|
@ -45,9 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1)
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1)
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
salary_sob_id NUMBER(38,0) NULL ,
|
||||
income_category varchar2(100) ,
|
||||
tax_index varchar2(100) ,
|
||||
salary_item_id NUMBER(38,0) NULL ,
|
||||
creator NUMBER(38,0) DEFAULT 0,
|
||||
create_time DATE DEFAULT sysdate,
|
||||
update_time DATE DEFAULT sysdate,
|
||||
delete_type number DEFAULT 0,
|
||||
tenant_key varchar2(10) DEFAULT ''
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add department_id NUMBER null
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL
|
||||
/
|
||||
alter table hrsa_salary_acct_emp add status varchar2(200) NULL
|
||||
/
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE hrsa_salary_item ADD default_value varchar2(255) NULL
|
||||
/
|
||||
ALTER TABLE hrsa_salary_sob_item ADD default_value varchar2(255) NULL
|
||||
/
|
||||
ALTER TABLE hrsa_salary_sob_back_item ADD default_value varchar2(255) NULL
|
||||
/
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
)
|
||||
/
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date default sysdate,
|
||||
update_time date default sysdate,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
salary_acct_record_id number,
|
||||
tax_agent_id number,
|
||||
request_id varchar2(100)
|
||||
)
|
||||
/
|
||||
|
|
@ -33,8 +33,7 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id bigserial NOT NULL,
|
||||
salary_sob_id bigint ,
|
||||
income_category varchar(100) ,
|
||||
tax_index varchar(100) ,
|
||||
salary_item_id bigint ,
|
||||
creator bigint NOT NULL DEFAULT 0 ,
|
||||
create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
|
||||
update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
|
||||
delete_type int NOT NULL DEFAULT 0 ,
|
||||
tenant_key varchar(10) NOT NULL DEFAULT '' ,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar(200);
|
||||
alter table hrsa_salary_acct_emp add subcompany_id bigint;
|
||||
alter table hrsa_salary_acct_emp add department_name varchar(200);
|
||||
alter table hrsa_salary_acct_emp add department_id bigint;
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar(200);
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id bigint;
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar(200);
|
||||
alter table hrsa_salary_acct_emp add jobcall_id bigint;
|
||||
alter table hrsa_salary_acct_emp add status varchar(200);
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
);
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_salary_item add default_value VARCHAR(255);
|
||||
alter table hrsa_salary_sob_item add default_value VARCHAR(255);
|
||||
alter table hrsa_salary_sob_back_item add default_value VARCHAR(255);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id bigint primary key ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param text ,
|
||||
response text,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
/
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time timestamp default now(),
|
||||
update_time timestamp default now(),
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10),
|
||||
salary_acct_record_id bigint,
|
||||
tax_agent_id bigint,
|
||||
request_id varchar(100)
|
||||
);
|
||||
/
|
||||
|
|
@ -45,9 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1)
|
||||
GO
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1)
|
||||
GO
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_sob_tax_rule
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
creator bigint,
|
||||
delete_type int,
|
||||
tenant_key nvarchar(10),
|
||||
salary_sob_id bigint,
|
||||
income_category varchar(100),
|
||||
tax_index varchar(100),
|
||||
salary_item_id bigint
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
ALTER TABLE hrsa_salary_acct_emp
|
||||
ADD subcompany_name varchar(200),
|
||||
subcompany_id bigint,
|
||||
department_name varchar(200),
|
||||
department_id bigint,
|
||||
jobtitle_name varchar(200),
|
||||
jobtitle_id bigint,
|
||||
jobcall varchar(200),
|
||||
jobcall_id bigint,
|
||||
status varchar(200)
|
||||
GO
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
UPDATE hrsa_salary_acct_emp
|
||||
set department_id = b.departmentId,
|
||||
department_name = b.departmentName,
|
||||
subcompany_id = b.subcompanyid,
|
||||
subcompany_name = b.subcompanyName,
|
||||
jobtitle_id = b.jobtitleId,
|
||||
jobtitle_name = b.jobtitleName,
|
||||
jobcall_id = b.jobcallId,
|
||||
jobcall = b.jobcall,
|
||||
status = b.status
|
||||
FROM hrsa_salary_acct_emp a INNER JOIN (
|
||||
select e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) as b
|
||||
on a.employee_id = b.employeeId
|
||||
WHERE a.delete_type=0
|
||||
GO
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
alter table hrsa_salary_item add default_value varchar(255)
|
||||
go
|
||||
alter table hrsa_salary_sob_item add default_value varchar(255)
|
||||
go
|
||||
alter table hrsa_salary_sob_back_item add default_value varchar(255)
|
||||
go
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id bigint primary key ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param ntext ,
|
||||
response ntext,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
delete_type int default 0,
|
||||
tenant_key nvarchar(10)
|
||||
)
|
||||
GO
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id bigint primary key ,
|
||||
create_time datetime default getdate(),
|
||||
update_time datetime default getdate(),
|
||||
creator bigint,
|
||||
delete_type int default 0,
|
||||
tenant_key nvarchar(10),
|
||||
salary_acct_record_id bigint,
|
||||
tax_agent_id bigint,
|
||||
request_id nvarchar(100)
|
||||
)
|
||||
GO
|
||||
|
|
@ -45,10 +45,6 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀۼƼõÃâ˰¶î', 'addUpTaxDeduction', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÓ¦¿Û½É˰¶î', 'addUpTaxPayable', '', NULL, NULL,1);
|
||||
/
|
||||
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES
|
||||
(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', 'ÀÛ¼ÆÒѽÉ˰¶î', 'addUpAdvanceTax', '', NULL, NULL,1);
|
||||
/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
CREATE TABLE hrsa_sob_tax_rule (
|
||||
id NUMBER(38,0) primary key NOT NULL,
|
||||
salary_sob_id NUMBER(38,0) NULL ,
|
||||
income_category varchar2(100) ,
|
||||
tax_index varchar2(100) ,
|
||||
salary_item_id NUMBER(38,0) NULL ,
|
||||
creator NUMBER(38,0) DEFAULT 0,
|
||||
create_time DATE DEFAULT sysdate,
|
||||
update_time DATE DEFAULT sysdate,
|
||||
delete_type number DEFAULT 0,
|
||||
tenant_key varchar2(10) DEFAULT ''
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
alter table hrsa_salary_acct_emp add subcompany_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add subcompany_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add department_id NUMBER null;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_name varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobtitle_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall varchar2(200) NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add jobcall_id NUMBER NULL;
|
||||
/
|
||||
|
||||
alter table hrsa_salary_acct_emp add status varchar2(200) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
update hrsa_salary_acct_emp a
|
||||
set
|
||||
(
|
||||
department_id ,
|
||||
department_name,
|
||||
subcompany_id ,
|
||||
subcompany_name,
|
||||
jobtitle_id ,
|
||||
jobtitle_name ,
|
||||
jobcall_id,
|
||||
jobcall,
|
||||
status
|
||||
)
|
||||
=
|
||||
(
|
||||
select
|
||||
b.departmentId,
|
||||
b.departmentName,
|
||||
b.subcompanyid,
|
||||
b.subcompanyName,
|
||||
b.jobtitleId,
|
||||
b.jobtitleName,
|
||||
b.jobcallId,
|
||||
b.jobcall,
|
||||
b.status from
|
||||
(
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
)
|
||||
where a.delete_type=0 and
|
||||
exists (select 1 from (
|
||||
select
|
||||
e.id as employeeId,
|
||||
d.departmentname as departmentName,
|
||||
d.id as departmentId,
|
||||
sc.SUBCOMPANYNAME as subcompanyName,
|
||||
sc.id as subcompanyid,
|
||||
c.jobtitlename as jobtitleName,
|
||||
c.id as jobtitleId,
|
||||
e.status as status,
|
||||
e.jobcall as jobcallId,
|
||||
job.name as jobcall
|
||||
from hrmresource e
|
||||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
||||
left join hrmjobcall job on e.jobcall=job.id
|
||||
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
|
||||
) b
|
||||
where a.employee_id = b.employeeId
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE hrsa_salary_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_back_item ADD default_value varchar2(255) NULL;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
create table hrsa_acct_calc_tax_req
|
||||
(
|
||||
id number primary key ,
|
||||
create_time date default sysdate,
|
||||
update_time date default sysdate,
|
||||
creator number,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10),
|
||||
salary_acct_record_id number,
|
||||
tax_agent_id number,
|
||||
request_id varchar2(100)
|
||||
);
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
del sql202205100201.sql sql202205100402.sql sql202205130903.sql sql202205200203.sql sql202205310203.sql sql202206071403.sql sql202206090403.sql sql202206141003.sql sql202206160500.sql sql202206230403.sql sql202207110803.sql sql202207120303.sql sql202207210203.sql sql202208051103.sql sql202208080403.sql sql202208240403.sql sql202208240503.sql sql202210080203.sql sql202210080403.sql sql202210170203.sql sql202210170303.sql sql202211090103.sql sql202211090301.sql sql202211090402.sql sql202211170503.sql sql202212080903.sql sql202212081003.sql sql202212230103.sql sql202301310403.sql sql202302060801.sql sql202302060902.sql sql202302090303.sql sql202302200403.sql sql202303130101.sql sql202303130202.sql sql202303150403.sql sql202304040503.sql sql202304260103.sql sql202304270203.sql sql202304270303.sql sql202304270501.sql sql202305050302.sql sql202305170903.sql sql202306020403.sql sql202306020603.sql sql202306080103.sql sql202306200203.sql sql202306260103.sql sql202307170403.sql sql202307180603.sql sql202307200603.sql sql202308080403.sql sql202308080503.sql sql202308090203.sql sql202308170403.sql sql202309210203.sql sql202310130403.sql sql202310250103.sql sql202311070403.sql sql202311080603.sql sql202311150103.sql sql202312130203.sql sql202401080103.sql sql202401230403.sql sql202401300303.sql sql202402190103.sql sql202402280703.sql sql202403150103.sql sql202404010103.sql
|
||||
|
|
@ -18,4 +18,4 @@ left join hrmresource e on e.id= result.employee_id
|
|||
left join hrsa_tax_agent t on a.tax_agent_id=t.id
|
||||
where a.delete_type=0 and i.delete_type=0 and t.delete_type=0 and c.delete_type=0
|
||||
and a.employee_id=人员id and t.name=扣缴义务人名称
|
||||
and effective_time <= now() and c.name='基本工资' order by effective_time desc
|
||||
c.name='基本工资' order by effective_time desc
|
||||
|
|
@ -3,3 +3,59 @@ INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete
|
|||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000003, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '其他', 'royaltiesOther', 'number', 'qt', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000004, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '备注', 'royaltiesRemark', 'string', 'bz', NULL, 0);
|
||||
INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000005, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '减免税额', 'royaltiesTaxDeduction', 'number', 'jmse', NULL, 0);
|
||||
|
||||
|
||||
CREATE TABLE hrsa_api_task_record (
|
||||
id bigint(0) NOT NULL ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param text ,
|
||||
response text,
|
||||
tenant_key varchar(255) ,
|
||||
delete_type int(0) ,
|
||||
create_time datetime(0),
|
||||
update_time datetime(0),
|
||||
PRIMARY KEY (id) USING BTREE
|
||||
);
|
||||
|
||||
create table hrsa_api_task_record
|
||||
(
|
||||
id number primary key ,
|
||||
source varchar2(500) ,
|
||||
api varchar2(500),
|
||||
param clob ,
|
||||
response clob,
|
||||
create_time date,
|
||||
update_time date,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar2(10)
|
||||
)
|
||||
/
|
||||
|
||||
create table hrsa_api_task_record
|
||||
(
|
||||
id bigint primary key ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param ntext ,
|
||||
response ntext,
|
||||
create_time datetime,
|
||||
update_time datetime,
|
||||
delete_type int default 0,
|
||||
tenant_key nvarchar(10)
|
||||
)
|
||||
GO
|
||||
|
||||
create table hrsa_api_task_record
|
||||
(
|
||||
id bigint primary key ,
|
||||
source varchar(500) ,
|
||||
api varchar(500),
|
||||
param text ,
|
||||
response text,
|
||||
create_time timestamp,
|
||||
update_time timestamp,
|
||||
delete_type int default 0,
|
||||
tenant_key varchar(10)
|
||||
);
|
||||
/
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
* 返回指定日志范围内的工作日天数
|
||||
* @param beginDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @param userid 人员ID
|
||||
* @return
|
||||
*/
|
||||
public String getWorkDays(String beginDate, String endDate, int userid) {
|
||||
BaseBean bean = new BaseBean();
|
||||
//设置日期格式
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//起始日期
|
||||
if (beginDate == null || beginDate.length() == 0) {
|
||||
beginDate = bean.getPropValue("scheduleWorkDayForFormula", "fromDate");
|
||||
beginDate = beginDate == null ? "" : beginDate.trim();
|
||||
if (beginDate.length() == 0) {
|
||||
beginDate = df.format(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
//截止日期
|
||||
if (endDate == null || endDate.length() == 0) {
|
||||
endDate = bean.getPropValue("scheduleWorkDayForFormula", "endDate");
|
||||
endDate = endDate == null ? "" : endDate.trim();
|
||||
if (endDate.length() == 0) {
|
||||
endDate = df.format(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
boolean isBig = false;
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date begin = sdf.parse(beginDate);
|
||||
Date end = sdf.parse(endDate);
|
||||
if (begin.compareTo(end) > 0) {
|
||||
String temp = beginDate;
|
||||
beginDate = endDate;
|
||||
endDate = temp;
|
||||
isBig = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
bean.writeLog("ExcelFormulaWorkday解析日期报错", e);
|
||||
}
|
||||
|
||||
int workDayCount = 0;
|
||||
User user = new User(userid);
|
||||
HrmScheduleManager manager = new HrmScheduleManager(user);
|
||||
Map<String, Boolean> mapWorkday = manager.isWorkday(beginDate, endDate, manager.getSubCompanyId());
|
||||
if (mapWorkday != null && mapWorkday.size() > 0) {
|
||||
Iterator<String> itr = mapWorkday.keySet().iterator();
|
||||
while (itr.hasNext()) {
|
||||
String tempDate = itr.next();
|
||||
Boolean isWorkDay = mapWorkday.get(tempDate);
|
||||
if (isWorkDay) {
|
||||
if (isBig) {
|
||||
workDayCount--;
|
||||
} else {
|
||||
workDayCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return workDayCount+"";
|
||||
}
|
||||
|
|
@ -2,11 +2,23 @@ package com.engine.salary.action;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.wrapper.SalaryArchiveWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -25,6 +37,18 @@ public class CheckInitSalaryAction implements Action {
|
|||
return ServiceUtil.getService(SalaryArchiveWrapper.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveMapper getSalaryArchiveMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryArchiveMapper.class);
|
||||
}
|
||||
|
||||
private String tableName;
|
||||
|
||||
|
||||
|
|
@ -57,40 +81,72 @@ public class CheckInitSalaryAction implements Action {
|
|||
String value = fieldMap.get(processField);
|
||||
list.add(new SalaryField(processField, salaryName, value));
|
||||
}
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
|
||||
if(!importDataMap.containsKey("生效日期")){
|
||||
importDataMap.put("生效日期", SalaryDateUtil.getFormatDate(new Date()));
|
||||
}
|
||||
if(!importDataMap.containsKey("最后发薪日期")){
|
||||
importDataMap.put("最后发薪日期", "");
|
||||
}
|
||||
importData.add(importDataMap);
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(SalaryField::getValue).orElse("1");
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).checkSalaryArchiveInit(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
log.error("定薪检查存在异常 requestId:{} ,参数:{}, map:{}", requestInfo.getRequestid(), build, map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
return doSalaryArchiveInit(requestInfo, importDataMap);
|
||||
} catch (Exception e) {
|
||||
log.error("定薪检查异常", e);
|
||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
public String doSalaryArchiveInit(RequestInfo requestInfo, Map<String, Object> importDataMap) {
|
||||
User user = new User();
|
||||
user.setLoginid("sysadmin");
|
||||
user.setUid(1);
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
if(!importDataMap.containsKey("生效日期")){
|
||||
importDataMap.put("生效日期", SalaryDateUtil.getFormatDate(new Date()));
|
||||
}
|
||||
if(!importDataMap.containsKey("最后发薪日期")){
|
||||
importDataMap.put("最后发薪日期", "");
|
||||
}
|
||||
importData.add(importDataMap);
|
||||
|
||||
// 首先判断是否已经存在薪资档案,且薪资档案状态为待定薪
|
||||
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
|
||||
String empIdStr = importDataMap.getOrDefault("员工id", "").toString();
|
||||
if (StringUtils.isBlank(taxAgentName)) {
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不能为空");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
// 获取义务人信息
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(taxAgentName).build());
|
||||
if (CollectionUtils.isEmpty(taxAgentPOS)) {
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = taxAgentPOS.get(0).getId();
|
||||
// 获取员工id
|
||||
if (NumberUtils.isCreatable(empIdStr)) {
|
||||
List<SalaryArchivePO> salaryArchivePOList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(Long.valueOf(empIdStr)).build());
|
||||
if (CollectionUtils.isNotEmpty(salaryArchivePOList) && !salaryArchivePOList.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
|
||||
// 存在薪资档案,且薪资档案状态不是待定薪,修改状态为待定薪
|
||||
salaryArchivePOList.get(0).setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
|
||||
salaryArchivePOList.get(0).setPayEndDate(null);
|
||||
getSalaryArchiveMapper().update(salaryArchivePOList.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(user).checkSalaryArchiveInit(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
log.error("定薪检查存在异常 requestId:{} ,参数:{}, map:{}", requestInfo.getRequestid(), build, map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,23 @@ package com.engine.salary.action;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.wrapper.SalaryArchiveWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -25,6 +37,18 @@ public class InitSalaryAction implements Action {
|
|||
return ServiceUtil.getService(SalaryArchiveWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveMapper getSalaryArchiveMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryArchiveMapper.class);
|
||||
}
|
||||
|
||||
private String tableName;
|
||||
|
||||
|
||||
|
|
@ -39,12 +63,10 @@ public class InitSalaryAction implements Action {
|
|||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
try {
|
||||
|
||||
Property[] properties = requestInfo.getMainTableInfo().getProperty();
|
||||
Map<String, String> fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName,
|
||||
property -> Util.null2String(property.getValue())));
|
||||
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
String queryImageId = "select salaryname,processfield from " + tableName + " where workflowid = ?";
|
||||
|
|
@ -57,44 +79,79 @@ public class InitSalaryAction implements Action {
|
|||
String value = fieldMap.get(processField);
|
||||
list.add(new SalaryField(processField, salaryName, value));
|
||||
}
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
|
||||
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
|
||||
if(!importDataMap.containsKey("生效日期")){
|
||||
importDataMap.put("生效日期", SalaryDateUtil.getFormatDate(new Date()));
|
||||
}
|
||||
if(!importDataMap.containsKey("最后发薪日期")){
|
||||
importDataMap.put("最后发薪日期", "");
|
||||
}
|
||||
importData.add(importDataMap);
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(SalaryField::getValue).orElse("1");
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).importSalaryArchiveInit(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
log.error("定薪存在异常 requestId:{} ,参数:{}, map:{}", requestInfo.getRequestid(), build, map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
return doSalaryArchiveInit(requestInfo, importDataMap);
|
||||
} catch (Exception e) {
|
||||
log.error("定薪异常", e);
|
||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
public String doSalaryArchiveInit(RequestInfo requestInfo, Map<String, Object> importDataMap) {
|
||||
User user = new User();
|
||||
user.setLoginid("sysadmin");
|
||||
user.setUid(1);
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
if(!importDataMap.containsKey("生效日期")){
|
||||
importDataMap.put("生效日期", SalaryDateUtil.getFormatDate(new Date()));
|
||||
}
|
||||
if(!importDataMap.containsKey("最后发薪日期")){
|
||||
importDataMap.put("最后发薪日期", "");
|
||||
}
|
||||
importData.add(importDataMap);
|
||||
|
||||
// 首先判断是否已经存在薪资档案,且薪资档案状态为待定薪
|
||||
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
|
||||
String empIdStr = importDataMap.getOrDefault("员工id", "").toString();
|
||||
if (StringUtils.isBlank(taxAgentName)) {
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不能为空");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
// 获取义务人信息
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(taxAgentName).build());
|
||||
if (CollectionUtils.isEmpty(taxAgentPOS)) {
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = taxAgentPOS.get(0).getId();
|
||||
// 获取员工id
|
||||
if (NumberUtils.isCreatable(empIdStr)) {
|
||||
List<SalaryArchivePO> salaryArchivePOList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(Long.valueOf(empIdStr)).build());
|
||||
if (CollectionUtils.isNotEmpty(salaryArchivePOList) && !salaryArchivePOList.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
|
||||
// 存在薪资档案,且薪资档案状态不是待定薪,修改状态为待定薪
|
||||
salaryArchivePOList.get(0).setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
|
||||
salaryArchivePOList.get(0).setPayEndDate(null);
|
||||
getSalaryArchiveMapper().update(salaryArchivePOList.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
String uid = importDataMap.getOrDefault("操作人", "1").toString();
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).importSalaryArchiveInit(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
log.error("定薪存在异常 requestId:{} ,参数:{}, map:{}", requestInfo.getRequestid(), build, map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SalaryField {
|
||||
|
||||
private String processField;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.engine.salary.service.TaxAgentService;
|
|||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentManageRangeServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.wrapper.SalaryArchiveWrapper;
|
||||
|
|
@ -89,9 +90,9 @@ public class RehireAction implements Action {
|
|||
String value = fieldMap.get(processField);
|
||||
list.add(new SalaryField(processField, salaryName, value));
|
||||
}
|
||||
Map<String, String> salaryFieldMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
|
||||
String taxAgentName = salaryFieldMap.get("个税扣缴义务人");
|
||||
String empIdStr = salaryFieldMap.get("员工id");
|
||||
Map<String, Object> salaryFieldMap = SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue);
|
||||
String taxAgentName = salaryFieldMap.getOrDefault("个税扣缴义务人", "").toString();
|
||||
String empIdStr = salaryFieldMap.getOrDefault("员工id", "").toString();
|
||||
if (StringUtils.isBlank(taxAgentName) || StringUtils.isBlank(empIdStr)) {
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人、或员工id不能为空");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
|
|
@ -107,47 +108,69 @@ public class RehireAction implements Action {
|
|||
Long employeeId = Long.valueOf(empIdStr);
|
||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).build());
|
||||
if (CollectionUtils.isEmpty(salaryArchivePOS)){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工不存在薪资档案!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
// 直接走定薪action生成档案
|
||||
InitSalaryAction initSalaryAction = new InitSalaryAction();
|
||||
return initSalaryAction.doSalaryArchiveInit(requestInfo, salaryFieldMap);
|
||||
|
||||
// requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工不存在薪资档案!");
|
||||
// return FAILURE_AND_CONTINUE;
|
||||
} else if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())) {
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工没有发过薪。需取消停薪后,申请定薪流程!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
|
||||
// 停薪来自待停薪 1、取消停薪
|
||||
getSalaryArchiveWrapper(user).cancelStop(Collections.singletonList(salaryArchivePOS.get(0).getId()));
|
||||
}
|
||||
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()) || salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
|
||||
// 1、如果不在人员范围内则把他加入义务人的人员范围,2、删除待办
|
||||
addTaxAgentRangeIfNotExist(taxAgentId, employeeId, user);
|
||||
getSalaryArchiveWrapper(user).deleteSuspendTodo(Collections.singletonList(salaryArchivePOS.get(0).getId()));
|
||||
}
|
||||
|
||||
// 调薪
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(RehireAction.SalaryField::getValue).orElse("1");
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).adjustmentSalaryArchive(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
// 回滚档案状态
|
||||
// 先把状态变成待定薪然后走定薪action
|
||||
salaryArchivePOS.get(0).setRunStatus(SalaryArchiveStatusEnum.PENDING.getValue());
|
||||
salaryArchivePOS.get(0).setPayEndDate(null);
|
||||
getSalaryArchiveMapper().update(salaryArchivePOS.get(0));
|
||||
log.error("调薪存在异常 requestId:{} map:{}", requestInfo.getRequestid(), map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
InitSalaryAction initSalaryAction = new InitSalaryAction();
|
||||
return initSalaryAction.doSalaryArchiveInit(requestInfo, salaryFieldMap);
|
||||
|
||||
// requestInfo.getRequestManager().setMessage("该个税扣缴义务人下,该员工没有发过薪。需取消停薪后,申请定薪流程!");
|
||||
// return FAILURE_AND_CONTINUE;
|
||||
} else {
|
||||
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
|
||||
// 停薪来自待停薪 1、取消停薪
|
||||
getSalaryArchiveWrapper(user).cancelStop(Collections.singletonList(salaryArchivePOS.get(0).getId()));
|
||||
}
|
||||
if (salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()) ||
|
||||
salaryArchivePOS.get(0).getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
|
||||
// 1、如果不在人员范围内则把他加入义务人的人员范围,2、删除待办
|
||||
addTaxAgentRangeIfNotExist(taxAgentId, employeeId, user);
|
||||
getSalaryArchiveWrapper(user).deleteSuspendTodo(Collections.singletonList(salaryArchivePOS.get(0).getId()));
|
||||
}
|
||||
|
||||
// 调薪
|
||||
List<Map<String, Object>> importData = new ArrayList<>();
|
||||
importData.add(SalaryEntityUtil.convert2Map(list, SalaryField::getSalaryName, SalaryField::getValue));
|
||||
|
||||
SalaryArchiveImportActionParam build = SalaryArchiveImportActionParam.builder()
|
||||
.importDatas(importData)
|
||||
.build();
|
||||
|
||||
//操作人
|
||||
String uid = list.stream().filter(f -> f.salaryName.equals("操作人")).findFirst().map(RehireAction.SalaryField::getValue).orElse("1");
|
||||
Map<String, Object> map = getSalaryArchiveWrapper(new User(Integer.parseInt(uid))).adjustmentSalaryArchive(build);
|
||||
|
||||
List errorNotice = (List) map.get("errorNotice");
|
||||
if (CollectionUtils.isNotEmpty(errorNotice)) {
|
||||
// 回滚档案状态
|
||||
getSalaryArchiveMapper().update(salaryArchivePOS.get(0));
|
||||
log.error("调薪存在异常 requestId:{} map:{}", requestInfo.getRequestid(), map);
|
||||
List<Map<String, String>> excelComments = (List<Map<String, String>>) map.get("errorNotice");
|
||||
StringBuilder message = new StringBuilder("");
|
||||
for (Map<String, String> comments : excelComments) {
|
||||
message.append(comments.get("message")).append("\n");
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
// 如果有起始发薪日期字段,则更新档案的起始发薪日期
|
||||
String startPayDate = salaryFieldMap.getOrDefault("起始发薪日期", "").toString();
|
||||
if (StringUtils.isNotBlank(startPayDate)) {
|
||||
Date date = SalaryDateUtil.dateStrToLocalDate(startPayDate);
|
||||
if (date != null) {
|
||||
Long salaryArchiveId = salaryArchivePOS.get(0).getId();
|
||||
getSalaryArchiveMapper().updatePayStartDateById(salaryArchiveId, date);
|
||||
}
|
||||
|
||||
}
|
||||
requestInfo.getRequestManager().setMessage(message.toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("返聘调薪异常", e);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.engine.salary.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface TaxField {
|
||||
String name();
|
||||
|
||||
String taxIndex();
|
||||
}
|
||||
|
|
@ -62,6 +62,23 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> getEmployeeByIdsIncludeAccountType(List<Long> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
List<DataCollectionEmployee> dataList = new ArrayList<>();
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
List<List<Long>> partition = Lists.partition(list, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
dataList.addAll(mapper.getEmployeeByIdsIncludeAccountType(longs));
|
||||
}
|
||||
return dataList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> getEmployeeByIdsAll(List<Long> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
|
|
@ -102,6 +119,19 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
public PositionInfo getPositionInfoById(Long positionId) {
|
||||
if (positionId == null) {
|
||||
return null;
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getPositionInfoById(positionId);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> listByParams(List<SalarySobRangeEmpQueryParam> includeQueryParams) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
|
|
@ -171,6 +201,20 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
public SubCompanyInfo getSubCompanyInfoById(Long subCompanyId) {
|
||||
if (subCompanyId == null) {
|
||||
return null;
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getSubCompanyInfoById(subCompanyId);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<DataCollectionEmployee> listAllForReport() {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
|
|
@ -211,4 +255,15 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public DeptInfo getDeptInfoById(Long departmentId) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getDeptInfoById(departmentId);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ public class SalaryCacheKey {
|
|||
*/
|
||||
public final static String ACCT_PROGRESS = "ACCT_PROGRESS_";
|
||||
|
||||
/**
|
||||
* 核算税后工资进度
|
||||
*/
|
||||
public final static String AFTER_TAXA_CCT_PROGRESS = "AFTER_TAX_ACCT_PROGRESS_";
|
||||
|
||||
/**
|
||||
* 薪资核算的账套配置
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
//@Configuration
|
||||
//public class SalaryPermissionConfig {
|
||||
//
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionConfig permissionConfig;
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionModuleSourceService permissionModuleSourceService;
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionModuleTargetService permissionModuleTargetService;
|
||||
//
|
||||
// public static final String TABLE_NAME = "hrsa";
|
||||
|
|
|
|||
|
|
@ -23,12 +23,20 @@ public class SzyhApiConstant {
|
|||
/**
|
||||
* 企业注册接口
|
||||
*/
|
||||
public static final String GET_REGISTER_INFO_URL = "gateway/iit/declare/getCompanyRegisterInfo";
|
||||
public static final String GET_REGISTER_INFO_URL = "gateway/iit/service/getCompanyRegisterInfo";
|
||||
/**
|
||||
* 企业注册反馈接口
|
||||
*/
|
||||
public static final String GET_REGISTER_INFO_FEEDBACK_URL = "/gateway/iit/service/getCompanyRegisterInfoFeedback";
|
||||
|
||||
/**
|
||||
* 校验密码接口
|
||||
*/
|
||||
public static final String CHECK_PASSWORD_URL = "gateway/iit/check/checkPassword";
|
||||
public static final String CHECK_PASSWORD_URL = "gateway/iit/service/check/checkPassword";
|
||||
/**
|
||||
* 校验密码反馈接口
|
||||
*/
|
||||
public static final String CHECK_PASSWORD_FEEDBACK_URL = "gateway/iit/service/check/getCheckPasswordFeedback";
|
||||
|
||||
/**
|
||||
* 人员专项附加扣除信息查询
|
||||
|
|
@ -73,22 +81,27 @@ public class SzyhApiConstant {
|
|||
/**
|
||||
* 更正申报
|
||||
*/
|
||||
public static final String UPDATE_DECLARE = "/gateway/iit/report/correct";
|
||||
public static final String UPDATE_DECLARE = "/gateway/iit/service/correct";
|
||||
|
||||
/**
|
||||
* 更正申报反馈
|
||||
*/
|
||||
public static final String UPDATE_DECLARE_FEEDBACK = "/gateway/iit/service/getCorrectFeedback";
|
||||
|
||||
/**
|
||||
* 撤销更正申报
|
||||
*/
|
||||
public static final String CANCEL_CORRECT = "gateway/iit/report/cancelCorrect";
|
||||
|
||||
/**
|
||||
* 税局端申报状态查询
|
||||
*/
|
||||
public static final String QUERY_DECLARE_STATUS = "/gateway/iit/report/queryDeclarationRecord";
|
||||
|
||||
/**
|
||||
* 企业申报数据明细查询
|
||||
*/
|
||||
public static final String QUERY_COMPANY_INCOMES = "/gateway/iit/report/getCompanyIncomes";
|
||||
public static final String GET_COMPANY_INCOMES = "gateway/iit/service/getCompanyIncomes";
|
||||
|
||||
/**
|
||||
* 企业申报数据明细查询反馈
|
||||
*/
|
||||
public static final String GET_COMPANY_INCOMES_FEEDBACK = "gateway/iit/service/getCompanyIncomesFeedback";
|
||||
|
||||
/**
|
||||
* 获取流量统计情况
|
||||
|
|
@ -133,19 +146,53 @@ public class SzyhApiConstant {
|
|||
/**
|
||||
* 缴款凭证作废
|
||||
*/
|
||||
public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/payment/cancelWithholdingVoucher";
|
||||
public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/service/cancelWithholdingVoucher";
|
||||
|
||||
/**
|
||||
* 缴款凭证作废反馈
|
||||
*/
|
||||
public static final String CANCEL_WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/service/getCancelWithholdingVoucher";
|
||||
|
||||
|
||||
/**
|
||||
* 完税证明
|
||||
*/
|
||||
public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher";
|
||||
public static final String GET_WITHHELD_VOUCHER = "gateway/iit/service/getWithheldVoucher";
|
||||
|
||||
/**
|
||||
* 刷新缴款状态
|
||||
* 完税证明反馈
|
||||
*/
|
||||
public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback";
|
||||
public static final String GET_WITHHELD_VOUCHER_FEEDBACK = "gateway/iit/service/getWithheldVoucherFeedback";
|
||||
|
||||
/**
|
||||
* 企业申报数据明细查询
|
||||
* 查询缴款状态
|
||||
*/
|
||||
public static final String GET_COMPANY_INCOMES = "gateway/iit/report/getCompanyIncomes";
|
||||
public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/service/getSyncWithholdingFeedback";
|
||||
|
||||
/**
|
||||
* 查询缴款状态反馈
|
||||
*/
|
||||
public static final String GET_SYNC_WITHHOLDING_FEEDBACK_FEEDBACK = "gateway/iit/service/getSyncWithholding";
|
||||
|
||||
|
||||
/**
|
||||
* 个人养老金下载
|
||||
*/
|
||||
public static final String DOWNLOAD_PERSONAL_PENSION = "gateway/iit/personalPension/download";
|
||||
/**
|
||||
* 获取个人养老金下载反馈
|
||||
*/
|
||||
public static final String DOWNLOAD_PERSONAL_PENSION_FEEDBACK = "gateway/iit/personalPension/getDownloadFeedback";
|
||||
/**
|
||||
* 异步计算个税
|
||||
*/
|
||||
public static final String CALCULATE_ASYN_INDIVIDUAL_INCOME_TAX = "gateway/iit/calculateTax/calculateASynIndividualIncomeTax";
|
||||
/**
|
||||
* 查询算税反馈结果
|
||||
*/
|
||||
public static final String ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK = "gateway/iit/calculateTax/getASynIndividualIncomeTaxFeedback";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -158,6 +205,11 @@ public class SzyhApiConstant {
|
|||
*/
|
||||
public static final String HANDLING_CODE = "000004";
|
||||
|
||||
/**
|
||||
* 异步计算任务还未结束
|
||||
*/
|
||||
public static final String TASK_HANDLING_CODE = "100004";
|
||||
|
||||
/**
|
||||
* 企业服务不可用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -980,7 +980,31 @@
|
|||
"infinite": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "DAYSINMONTH",
|
||||
"chineseName": "返回指定月的天数",
|
||||
"description": "返回指定月的天数。",
|
||||
"example": "DAYSINMONTH('2024-01-01')",
|
||||
"result": "31",
|
||||
"paramDescs": [
|
||||
"*日期*(必选)"
|
||||
],
|
||||
"formatString": "DAYSINMONTH(日期)",
|
||||
"paramArray": [],
|
||||
"paramData": [],
|
||||
"returnType": "number",
|
||||
"type": "function",
|
||||
"validForm": "days_in_month",
|
||||
"paramCount": -1,
|
||||
"paramStatuses": [
|
||||
{
|
||||
"dataType": "date",
|
||||
"must": true,
|
||||
"infinite": true
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
"dataType": "date",
|
||||
"name": "日期函数",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.engine.salary.entity.api;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ApiTaskRecordPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* api操作
|
||||
*/
|
||||
private String api;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private String param;
|
||||
/**
|
||||
* 反馈
|
||||
*/
|
||||
private String response;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -130,11 +130,6 @@ public class EmployeeDeclareRefresh {
|
|||
employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue());
|
||||
employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum)));
|
||||
employeeDeclare.setNationality("中国");
|
||||
} else {
|
||||
// fixme 阿富汗
|
||||
// employeeDeclare.setNationality("阿富汗");
|
||||
// employeeDeclare.setEntryDate();
|
||||
// employeeDeclare.setDepartureDate();
|
||||
}
|
||||
// 对人员处理「人员状态」、「离职日期」
|
||||
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.engine.salary.entity.hrm;
|
||||
|
||||
import com.engine.salary.annotation.I18n;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 职称基本信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class JobCallInfo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@I18n
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -261,7 +261,7 @@ public class SalaryBillBO {
|
|||
}
|
||||
Util_Message.store(messageBean);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("消息发送失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 工资单预览参数
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryPreviewParam {
|
||||
|
||||
/**
|
||||
* 工资单id
|
||||
*/
|
||||
private Long salaryInfoId;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long recipient;
|
||||
|
||||
}
|
||||
|
|
@ -68,6 +68,10 @@ public class SalarySendDetailQueryParam extends BaseQueryParam {
|
|||
// @JsonIgnore
|
||||
private List<Integer> sendStatuss;
|
||||
|
||||
|
||||
// 导出时显示列定制信息
|
||||
List<String> columns;
|
||||
|
||||
public static String checkParam(SalarySendDetailQueryParam saveParam) {
|
||||
if (saveParam.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import lombok.experimental.Accessors;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -173,11 +174,7 @@ public class CalculateFormulaVarBO {
|
|||
String fieldValue = map.getOrDefault(fieldName, StringUtils.EMPTY);
|
||||
//日期值取yyyy-MM-dd
|
||||
if (StringUtils.isNotBlank(fieldValue) && fieldValue.length() > 10 && SalaryDateUtil.parse(fieldValue, DATE_TIME_FORMATTER_PATTERN) != null) {
|
||||
if (StringUtils.isNotBlank(salaryDateFormat)) {
|
||||
fieldValue = fieldValue.substring(0, salaryDateFormat.length());
|
||||
} else {
|
||||
fieldValue = fieldValue.substring(0, 10);
|
||||
}
|
||||
fieldValue = fieldValue.substring(0, 10);
|
||||
}
|
||||
formulaVarValues.add(new FormulaVarValue().setFieldId(fieldId).setFieldValue(fieldValue));
|
||||
}
|
||||
|
|
@ -529,11 +526,7 @@ public class CalculateFormulaVarBO {
|
|||
String fieldValue = map.getOrDefault(fieldName, StringUtils.EMPTY);
|
||||
//判断是否是日期,日期值取yyyy-MM-dd
|
||||
if (StringUtils.isNotBlank(fieldValue) && fieldValue.length() > 10 && SalaryDateUtil.parse(fieldValue, DATE_TIME_FORMATTER_PATTERN) != null) {
|
||||
if (StringUtils.isNotBlank(salaryDateFormat)) {
|
||||
fieldValue = fieldValue.substring(0, salaryDateFormat.length());
|
||||
} else {
|
||||
fieldValue = fieldValue.substring(0, 10);
|
||||
}
|
||||
fieldValue = fieldValue.substring(0, 10);
|
||||
}
|
||||
return new FormulaVarValue().setFieldId(fieldId).setFieldValue(fieldValue);
|
||||
}).collect(Collectors.toList()));
|
||||
|
|
@ -566,7 +559,7 @@ public class CalculateFormulaVarBO {
|
|||
employeeMap.forEach((key, po) -> {
|
||||
// 获取po的状态
|
||||
if(po.getStatus() != null && NumberUtil.isNumber(po.getStatus())) {
|
||||
po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(po.getStatus())));
|
||||
po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(po.getStatus(),"1"))));
|
||||
}
|
||||
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
|
||||
Map<String, String> map = JsonUtil.parseMap(po, String.class);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,11 @@ public class SalaryAcctCalculateBO {
|
|||
*/
|
||||
private BlockingDeque<Result> results;
|
||||
|
||||
/**
|
||||
* 个税项目
|
||||
*/
|
||||
private List<Long> taxIds;
|
||||
|
||||
/**
|
||||
* 系统算税启用状态
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.google.common.collect.Sets;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -121,9 +122,9 @@ public class SalaryAcctEmployeeBO {
|
|||
}
|
||||
|
||||
public static List<SalaryAcctEmployeePO> convert2Employee(Collection<DataCollectionEmployee> employee,
|
||||
SalaryAcctRecordPO salaryAcctRecord,
|
||||
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
|
||||
Long employeeId) {
|
||||
SalaryAcctRecordPO salaryAcctRecord,
|
||||
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
|
||||
Long employeeId) {
|
||||
if (CollectionUtils.isEmpty(employee)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
@ -147,6 +148,15 @@ public class SalaryAcctEmployeeBO {
|
|||
.employeeId(emp.getEmployeeId())
|
||||
.employeeType(emp.isExtEmp() ? 1 : 0)
|
||||
.taxAgentId(taxAgentId)
|
||||
.departmentId(emp.getDepartmentId())
|
||||
.departmentName(emp.getDepartmentName())
|
||||
.jobcall(emp.getJobcall())
|
||||
.jobcallId(emp.getJobcallId())
|
||||
.jobtitleId(emp.getJobtitleId())
|
||||
.jobtitleName(emp.getJobtitleName())
|
||||
.subcompanyId(emp.getSubcompanyid())
|
||||
.subcompanyName(emp.getSubcompanyName())
|
||||
.status(emp.getStatus())
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
|
|
@ -159,6 +169,24 @@ public class SalaryAcctEmployeeBO {
|
|||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 核算人员信息替换实时信息
|
||||
* @param simpleEmployee
|
||||
* @param acctEmployeePO
|
||||
*/
|
||||
public static void copyAcctEmp(DataCollectionEmployee simpleEmployee, SalaryAcctEmployeePO acctEmployeePO) {
|
||||
simpleEmployee.setDepartmentId(acctEmployeePO.getDepartmentId());
|
||||
simpleEmployee.setDepartmentName(acctEmployeePO.getDepartmentName());
|
||||
simpleEmployee.setSubcompanyid(acctEmployeePO.getSubcompanyId());
|
||||
simpleEmployee.setSubcompanyName(acctEmployeePO.getSubcompanyName());
|
||||
simpleEmployee.setJobcallId(acctEmployeePO.getJobcallId());
|
||||
simpleEmployee.setJobcall(acctEmployeePO.getJobcall());
|
||||
simpleEmployee.setJobtitleId(acctEmployeePO.getJobtitleId());
|
||||
simpleEmployee.setJobtitleName(acctEmployeePO.getJobtitleName());
|
||||
simpleEmployee.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(acctEmployeePO.getStatus(), "1"))));
|
||||
simpleEmployee.setStatus(acctEmployeePO.getStatus());
|
||||
}
|
||||
|
||||
|
||||
public static List<List<SalaryAcctEmployeePO>> partitionByEmployeeId(List<SalaryAcctEmployeePO> salaryAcctEmployees) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
||||
|
|
@ -62,7 +63,7 @@ public class SalaryAcctFormulaBO {
|
|||
salaryItemPattern = salarySobBackItemMap.get(salaryItem.getId()).getPattern();
|
||||
}
|
||||
BigDecimal bigDecimalValue = SalaryEntityUtil.empty2Zero(value);
|
||||
return SalaryEntityUtil.carryRule(salaryItemPattern, salaryItemRoundingMode, bigDecimalValue).toString();
|
||||
return SalaryEntityUtil.carryRule(salaryItemPattern, salaryItemRoundingMode, bigDecimalValue).toPlainString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +72,7 @@ public class SalaryAcctFormulaBO {
|
|||
* @param simpleEmployee
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> convert2FormulaEmployee(DataCollectionEmployee simpleEmployee) {
|
||||
public static Map<String, String> convert2FormulaEmployee(DataCollectionEmployee simpleEmployee, SalaryAcctEmployeePO salaryAcctEmployeePO, boolean dynamicEmpInfo) {
|
||||
if (simpleEmployee == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
|
@ -79,27 +80,55 @@ public class SalaryAcctFormulaBO {
|
|||
.map(sex -> StringUtils.equals(sex, "0") ? SalaryI18nUtil.getI18nLabel(102440, "男")
|
||||
: SalaryI18nUtil.getI18nLabel(102442, "女"))
|
||||
.orElse(StringUtils.EMPTY);
|
||||
SalaryFormulaEmployeeDTO formulaEmployee = SalaryFormulaEmployeeDTO.builder()
|
||||
.employeeId(simpleEmployee.getEmployeeId())
|
||||
.username(simpleEmployee.getUsername())
|
||||
.email(simpleEmployee.getEmail())
|
||||
.mobile(simpleEmployee.getMobile())
|
||||
.telephone(simpleEmployee.getTelephone())
|
||||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.departmentName(simpleEmployee.getDepartmentName())
|
||||
.departmentId(simpleEmployee.getDepartmentId())
|
||||
.subcompanyName(simpleEmployee.getSubcompanyName())
|
||||
.jobtitleName(simpleEmployee.getJobtitleName())
|
||||
.jobtitleId(simpleEmployee.getJobtitleId())
|
||||
.jobcall(simpleEmployee.getJobcall())
|
||||
.jobcallId(simpleEmployee.getJobcallId())
|
||||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.build();
|
||||
|
||||
SalaryFormulaEmployeeDTO formulaEmployee = null;
|
||||
if (dynamicEmpInfo) {
|
||||
formulaEmployee = SalaryFormulaEmployeeDTO.builder()
|
||||
.employeeId(simpleEmployee.getEmployeeId())
|
||||
.username(simpleEmployee.getUsername())
|
||||
.email(simpleEmployee.getEmail())
|
||||
.mobile(simpleEmployee.getMobile())
|
||||
.telephone(simpleEmployee.getTelephone())
|
||||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.departmentName(simpleEmployee.getDepartmentName())
|
||||
.departmentId(simpleEmployee.getDepartmentId())
|
||||
.subcompanyName(simpleEmployee.getSubcompanyName())
|
||||
.subcompanyId(simpleEmployee.getSubcompanyid())
|
||||
.jobtitleName(simpleEmployee.getJobtitleName())
|
||||
.jobtitleId(simpleEmployee.getJobtitleId())
|
||||
.jobcall(simpleEmployee.getJobcall())
|
||||
.jobcallId(simpleEmployee.getJobcallId())
|
||||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.build();
|
||||
} else {
|
||||
formulaEmployee = SalaryFormulaEmployeeDTO.builder()
|
||||
.employeeId(simpleEmployee.getEmployeeId())
|
||||
.username(simpleEmployee.getUsername())
|
||||
.email(simpleEmployee.getEmail())
|
||||
.mobile(simpleEmployee.getMobile())
|
||||
.telephone(simpleEmployee.getTelephone())
|
||||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.departmentName(salaryAcctEmployeePO.getDepartmentName())
|
||||
.departmentId(salaryAcctEmployeePO.getDepartmentId())
|
||||
.subcompanyName(salaryAcctEmployeePO.getSubcompanyName())
|
||||
.subcompanyId(salaryAcctEmployeePO.getSubcompanyId())
|
||||
.jobtitleName(salaryAcctEmployeePO.getJobtitleName())
|
||||
.jobtitleId(salaryAcctEmployeePO.getJobtitleId())
|
||||
.jobcall(salaryAcctEmployeePO.getJobcall())
|
||||
.jobcallId(salaryAcctEmployeePO.getJobcallId())
|
||||
.companystartdate(simpleEmployee.getCompanystartdate())
|
||||
.birthday(simpleEmployee.getBirthday())
|
||||
.workcode(simpleEmployee.getWorkcode())
|
||||
.idNo(simpleEmployee.getIdNo())
|
||||
.build();
|
||||
}
|
||||
return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
|
|
@ -20,6 +21,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO;
|
|||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
|
|
@ -31,8 +33,10 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -251,7 +255,7 @@ public class SalaryAcctResultBO {
|
|||
* @param taxAgents
|
||||
* @param consolidatedTaxSalaryAcctEmpIds
|
||||
* @param customBackCalcParameters
|
||||
* @param isBackCalc
|
||||
* @param dynamicEmpInfo
|
||||
* @return
|
||||
*/
|
||||
public static List<Map<String, Object>> buildTableData(List<SalaryItemPO> salaryItems,
|
||||
|
|
@ -263,10 +267,11 @@ public class SalaryAcctResultBO {
|
|||
Set<Long> consolidatedTaxSalaryAcctEmpIds,
|
||||
Map<Long, String> customParameters,
|
||||
Map<Long, String> customBackCalcParameters,
|
||||
boolean isBackCalc) {
|
||||
boolean dynamicEmpInfo) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
SalaryI18nUtil.i18nList(salaryAcctEmployees);
|
||||
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getEmployeeId);
|
||||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
|
|
@ -278,12 +283,35 @@ public class SalaryAcctResultBO {
|
|||
// 薪资项目的字段类型(前端依据这个判断是否需要展示千分位)
|
||||
Map<String, String> dataTypeMap = SalaryEntityUtil.convert2Map(salaryItems, salaryItemPO -> salaryItemPO.getId() + DATA_TYPE_SUFFIX, SalaryItemPO::getDataType);
|
||||
map.putAll(dataTypeMap);
|
||||
// TODO ?看一下如果不是回算这会不会有回算的东西?
|
||||
// 人员信息字段的值
|
||||
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()));
|
||||
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()), e, true);
|
||||
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
// 员工信息字段的字段类型
|
||||
if (dynamicEmpInfo) {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
} else {
|
||||
if ("departmentName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentName", e.getDepartmentName());
|
||||
} else if ("departmentId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentId", e.getDepartmentId());
|
||||
} else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("subcompanyName", e.getSubcompanyName());
|
||||
} else if ("jobcall".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcall", e.getJobcall());
|
||||
} else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcallId", e.getJobcallId());
|
||||
} else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleName", e.getJobtitleName());
|
||||
} else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleId", e.getJobtitleId());
|
||||
} else if ("status".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("status", e.getStatus());
|
||||
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(e.getStatus(), "1"))));
|
||||
} else {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
}
|
||||
}
|
||||
map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
|
||||
}
|
||||
// 主键id
|
||||
|
|
@ -328,7 +356,8 @@ public class SalaryAcctResultBO {
|
|||
List<TaxAgentPO> taxAgents,
|
||||
Map<Long, String> customParameters,
|
||||
Set<Long> consolidatedTaxSalaryAcctEmpIds,
|
||||
Set<Long> includeSalaryItemIds) {
|
||||
Set<Long> includeSalaryItemIds,
|
||||
boolean dynamicEmpInfo) {
|
||||
if (CollectionUtils.isEmpty(simpleEmployees)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
@ -342,10 +371,34 @@ public class SalaryAcctResultBO {
|
|||
boolean different = false;
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
// 员工信息字段的值
|
||||
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId()));
|
||||
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId()), salaryAcctEmployee, false);
|
||||
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
// 员工信息字段的字段类型
|
||||
if (dynamicEmpInfo) {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
} else {
|
||||
if ("departmentName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentName", salaryAcctEmployee.getDepartmentName());
|
||||
} else if ("departmentId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("departmentId", salaryAcctEmployee.getDepartmentId());
|
||||
} else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("subcompanyName", salaryAcctEmployee.getSubcompanyName());
|
||||
} else if ("jobcall".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcall", salaryAcctEmployee.getJobcall());
|
||||
} else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobcallId", salaryAcctEmployee.getJobcallId());
|
||||
} else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleName", salaryAcctEmployee.getJobtitleName());
|
||||
} else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("jobtitleId", salaryAcctEmployee.getJobtitleId());
|
||||
} else if ("status".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("status", salaryAcctEmployee.getStatus());
|
||||
} else if ("statusName".equals(salarySobEmpField.getFieldCode())) {
|
||||
map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(salaryAcctEmployee.getStatus(), "1"))));
|
||||
} else {
|
||||
map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode()));
|
||||
}
|
||||
}
|
||||
map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue());
|
||||
}
|
||||
// 系统值
|
||||
|
|
@ -367,13 +420,20 @@ public class SalaryAcctResultBO {
|
|||
// 薪资项目字段的字段类型
|
||||
map.put(salaryItem.getId() + DATA_TYPE_SUFFIX, salaryItem.getDataType());
|
||||
SalaryDataTypeEnum dataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItem.getDataType());
|
||||
if (dataTypeEnum == SalaryDataTypeEnum.STRING) {
|
||||
if (!StringUtils.equals(acctResultValue, excelResultValue)) {
|
||||
different = true;
|
||||
includeSalaryItemIds.add(salaryItem.getId());
|
||||
if (dataTypeEnum == SalaryDataTypeEnum.NUMBER) {
|
||||
if (NumberUtil.isNumber(acctResultValue) && NumberUtil.isNumber(excelResultValue)) {
|
||||
if (new BigDecimal(acctResultValue).compareTo(new BigDecimal(excelResultValue)) != 0) {
|
||||
different = true;
|
||||
includeSalaryItemIds.add(salaryItem.getId());
|
||||
}
|
||||
} else {
|
||||
if (SalaryEntityUtil.empty2Zero(acctResultValue).compareTo(SalaryEntityUtil.empty2Zero(excelResultValue)) != 0) {
|
||||
different = true;
|
||||
includeSalaryItemIds.add(salaryItem.getId());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (SalaryEntityUtil.empty2Zero(acctResultValue).compareTo(SalaryEntityUtil.empty2Zero(excelResultValue)) != 0) {
|
||||
if (!StringUtils.equals(acctResultValue, excelResultValue)) {
|
||||
different = true;
|
||||
includeSalaryItemIds.add(salaryItem.getId());
|
||||
}
|
||||
|
|
@ -424,16 +484,52 @@ public class SalaryAcctResultBO {
|
|||
List<Long> lockItems) {
|
||||
|
||||
// 员工信息字段
|
||||
Map<String, String> employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee);
|
||||
Map<String, String> employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee, salaryAcctEmployee, false);
|
||||
// 个税扣缴义务人
|
||||
employeeFieldValueMap.put("taxAgentName", Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY));
|
||||
Map<String, String> employeeFieldNameMap = buildEmployeeFieldName();
|
||||
List<String> canEditKeys = Arrays.asList("subcompany", "department", "jobtitle", "jobcall");
|
||||
List<SalaryAcctEmployeeInfoDTO> employeeInfos = salarySobEmpFields.stream()
|
||||
.map(e -> SalaryAcctEmployeeInfoDTO.builder()
|
||||
.fieldName(employeeFieldNameMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY))
|
||||
.fieldValue(employeeFieldValueMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY))
|
||||
.build())
|
||||
.map(e -> {
|
||||
String fieldCode = e.getFieldCode();
|
||||
String fieldType = employeeFieldNameMap.getOrDefault(fieldCode + "_type", StringUtils.EMPTY);
|
||||
SalaryAcctEmployeeInfoDTO dto = SalaryAcctEmployeeInfoDTO.builder()
|
||||
.fieldCode(fieldCode)
|
||||
.fieldName(employeeFieldNameMap.getOrDefault(fieldCode, StringUtils.EMPTY))
|
||||
.fieldValue(employeeFieldValueMap.getOrDefault(fieldCode, StringUtils.EMPTY))
|
||||
.fieldType(fieldType)
|
||||
.canEdit(fieldType.contains("Browser") ? true : false)
|
||||
.build();
|
||||
|
||||
String codeKey = fieldCode.replace("Id", "").replace("Name", "");
|
||||
if (canEditKeys.contains(codeKey)) {
|
||||
// 前端用于回写浏览框
|
||||
Map<String, String> fieldValueMap = new HashMap<>();
|
||||
fieldValueMap.put("id", employeeFieldValueMap.getOrDefault(codeKey + "Id", StringUtils.EMPTY));
|
||||
fieldValueMap.put("name", employeeFieldValueMap.getOrDefault(codeKey + "Name", StringUtils.EMPTY));
|
||||
if (codeKey.equals("jobcall")) {
|
||||
fieldValueMap.put("name", employeeFieldValueMap.getOrDefault("jobcall", StringUtils.EMPTY));
|
||||
}
|
||||
dto.setFieldValue(fieldValueMap);
|
||||
}
|
||||
return dto;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<String> needRemoveFieldNames = new ArrayList<String>();
|
||||
// 过滤出是浏览框类型的且人员信息中同时存在名称和id的字段
|
||||
employeeInfos.stream()
|
||||
.filter(e -> e.getFieldType().contains("Browser"))
|
||||
.map(e -> SalaryAcctEmployeeInfoDTO.builder().fieldName(e.getFieldName().replace("ID", "")).build())
|
||||
.collect(Collectors.groupingBy(SalaryAcctEmployeeInfoDTO::getFieldName))
|
||||
.forEach((k, v) -> {
|
||||
if (v.size() > 1) {
|
||||
needRemoveFieldNames.add(k + "ID");
|
||||
}
|
||||
});
|
||||
|
||||
// 移除字段
|
||||
employeeInfos = employeeInfos.stream().filter(info -> !needRemoveFieldNames.contains(info.getFieldName())).collect(Collectors.toList());
|
||||
// 薪资项目的值
|
||||
Map<Long, String> resultValueMap = SalaryEntityUtil.convert2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
|
||||
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
|
||||
|
|
@ -536,7 +632,7 @@ public class SalaryAcctResultBO {
|
|||
Map<String, SalaryAcctResultListColumnDTO> formulaContentMap,
|
||||
List<Long> lockItems) {
|
||||
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0));
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(1));
|
||||
String itemFormulaContent;
|
||||
if (Objects.equals(salaryValueTypeEnum.getValue(), SalaryValueTypeEnum.FORMULA.getValue())) {
|
||||
itemFormulaContent = Optional.ofNullable(formulaContentMap.get(salarySobItemPO.getSalaryItemId().toString())).map(SalaryAcctResultListColumnDTO::getFormulaContent).orElse("");
|
||||
|
|
@ -658,6 +754,7 @@ public class SalaryAcctResultBO {
|
|||
}
|
||||
SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class);
|
||||
employeeFieldNameMap.put(declaredField.getName(), SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
|
||||
employeeFieldNameMap.put(declaredField.getName() + "_type", annotation.dataType());
|
||||
}
|
||||
return employeeFieldNameMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,199 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SalaryCalcTax {
|
||||
|
||||
/**
|
||||
* 薪资核算记录
|
||||
*/
|
||||
private SalaryAcctRecordPO salaryAcctRecord;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的个税扣缴义务人
|
||||
*/
|
||||
private List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的薪资核算人员
|
||||
*/
|
||||
private List<SalaryAcctEmployeePO> salaryAcctEmployees;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的薪资核算结果
|
||||
*/
|
||||
private List<SalaryAcctResultPO> salaryAcctResultValues;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人
|
||||
*/
|
||||
private List<TaxAgentPO> taxAgents;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人的个税信息
|
||||
*/
|
||||
private List<TaxAgentTaxReturnPO> taxAgentTaxReturns;
|
||||
|
||||
/**
|
||||
* 个税申报表字段
|
||||
*/
|
||||
private List<TaxReportColumnPO> taxReportColumns;
|
||||
|
||||
/**
|
||||
* 薪资账套的个税申报表字段对应
|
||||
*/
|
||||
private List<SalarySobTaxReportRulePO> salarySobTaxReportRules;
|
||||
|
||||
/**
|
||||
* 报送人员
|
||||
*/
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
public Map<Long, Map<String, Object>> buildCalcTaxRequestParam() {
|
||||
// 薪资核算关联的个税扣缴义务人
|
||||
Map<Long, List<SalaryAcctTaxAgentPO>> salaryAcctAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||
// 薪资核算关联的薪资核算人员
|
||||
Map<Long, List<SalaryAcctEmployeePO>> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxAgentId);
|
||||
// 薪资核算关联的薪资核算结果
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
// 个税扣款义务人
|
||||
Map<Long, TaxAgentPO> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId);
|
||||
// 个税扣款义务人的个税信息
|
||||
Map<Long, TaxAgentTaxReturnPO> taxAgentTaxReturnMap = SalaryEntityUtil.convert2Map(taxAgentTaxReturns, TaxAgentTaxReturnPO::getTaxAgentId);
|
||||
// 个税申报表字段
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);
|
||||
// 薪资账套的个税申报表字段对应
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex);
|
||||
// 报送人员
|
||||
Map<Long, List<EmployeeDeclarePO>> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId);
|
||||
|
||||
Map<Long, Map<String, Object>> resultMap = new HashMap<>();
|
||||
|
||||
for (Map.Entry<Long, List<SalaryAcctTaxAgentPO>> entry : salaryAcctAgentMap.entrySet()) {
|
||||
TaxAgentPO taxAgent = taxAgentMap.get(entry.getKey());
|
||||
if (taxAgent == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人不存在或已被删除"));
|
||||
}
|
||||
TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnMap.get(taxAgent.getId());
|
||||
if (taxAgentTaxReturn == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人没有维护个税信息"));
|
||||
}
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = salaryAcctEmployeeMap.get(taxAgent.getId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
continue;
|
||||
}
|
||||
List<EmployeeDeclarePO> employeeDeclares = employeeDeclareMap.get(taxAgent.getId());
|
||||
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该个税扣缴义务人无申报人员"));
|
||||
}
|
||||
|
||||
// 注册的企业信息-->请求参数
|
||||
Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(entry.getValue().get(0).getTaxCycle()));
|
||||
// 综合所得
|
||||
requestParam.put("zhsd", buildZHSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees,
|
||||
salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares));
|
||||
|
||||
resultMap.put(taxAgent.getId(), requestParam);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private Map<String, Object> buildZHSDRequestParam(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents,
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees,
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap,
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap,
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap,
|
||||
List<EmployeeDeclarePO> employeeDeclares) {
|
||||
Map<String, List<SalaryAcctEmployeePO>> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil
|
||||
.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory);
|
||||
|
||||
Map<String, Object> requestParam = new HashMap<>();
|
||||
|
||||
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum
|
||||
.parseByValue(salaryAcctTaxAgent.getIncomeCategory());
|
||||
List<TaxReportColumnPO> taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString());
|
||||
List<SalaryAcctEmployeePO> subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString());
|
||||
Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(subSalaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId);
|
||||
|
||||
SalaryCalcTaxRequest salaryCalcTaxRequest = new SalaryCalcTaxRequest(salaryAcctEmployeeMap,
|
||||
salaryAcctResultValueMap, taxReportColumns, salarySobTaxReportRuleMap, employeeDeclares);
|
||||
|
||||
switch (incomeCategoryEnum) {
|
||||
case WAGES_AND_SALARIES:
|
||||
requestParam.put("zcgzxj", salaryCalcTaxRequest.buildZCGZXJRequestParam());
|
||||
break;
|
||||
case ONETIME_ANNUAL_BONUS:
|
||||
requestParam.put("qnycxjjsslb", salaryCalcTaxRequest.buildQNYCXJJSSLBRequestParam());
|
||||
break;
|
||||
case COMPENSATION_FOR_RETIRE:
|
||||
requestParam.put("ntycxbcjlb", salaryCalcTaxRequest.buildNTYCXBCJLBRequestParam());
|
||||
break;
|
||||
case COMPENSATION_FOR_DISMISS:
|
||||
requestParam.put("jcldhtycxbcjlb", salaryCalcTaxRequest.buildJCLDHTYCXBCJLBRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE:
|
||||
requestParam.put("grgqjl", salaryCalcTaxRequest.buildGRGQJLRequestParam());
|
||||
break;
|
||||
case ANNUITY_RECEIPT:
|
||||
requestParam.put("qynj", salaryCalcTaxRequest.buildQYNJRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_LABOR:
|
||||
requestParam.put("lwbclb", salaryCalcTaxRequest.buildLWBCLBRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_INSURANCE_SALESMAN:
|
||||
requestParam.put("bxyxy", salaryCalcTaxRequest.buildBXYXYRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_SECURITIES_BROKER:
|
||||
requestParam.put("zqjjr", salaryCalcTaxRequest.buildZQJJRRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR:
|
||||
requestParam.put("qtlxlwbc", salaryCalcTaxRequest.buildQTLXLWBCRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_OTHER_LABOR:
|
||||
requestParam.put("qtflxlwbc", salaryCalcTaxRequest.buildQTFLXLWBCRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_AUTHOR:
|
||||
requestParam.put("gcsdlb", salaryCalcTaxRequest.buildGCSDLBRequestParam());
|
||||
break;
|
||||
case ROYALTIES:
|
||||
requestParam.put("txq", salaryCalcTaxRequest.buildTXQRequestParam());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return requestParam;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import lombok.Data;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 异步算税的反馈结果
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxFeedback {
|
||||
|
||||
private Map<String, Object> dataMap;
|
||||
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
public SalaryCalcTaxFeedback(Map<String, Object> dataMap, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
this.dataMap = dataMap;
|
||||
this.employeeDeclares = employeeDeclares;
|
||||
}
|
||||
|
||||
public Map<Long, String> buildZCGZXJFeedback() {
|
||||
Map<String, String> successDataMap = new HashMap<>();
|
||||
List<Map> successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class);
|
||||
for (Map map : successList) {
|
||||
// 证件号码
|
||||
String zzhm = Util.null2String(map.get("zzhm"));
|
||||
// 应补退税额
|
||||
String ybtse = Util.null2String(map.get("ybtse"));
|
||||
|
||||
successDataMap.put(zzhm, ybtse);
|
||||
}
|
||||
Map<Long, String> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public Map<Long, String> buildOtherFeedback() {
|
||||
Map<String, String> successDataMap = new HashMap<>();
|
||||
List<Map> successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class);
|
||||
for (Map map : successList) {
|
||||
// 证件号码
|
||||
String zzhm = Util.null2String(map.get("zzhm"));
|
||||
// 应补退税额
|
||||
String ybtse = Util.null2String(map.get("yingkjse"));
|
||||
|
||||
successDataMap.put(zzhm, ybtse);
|
||||
}
|
||||
Map<Long, String> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,258 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.wbi.util.Util;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SalaryCalcTaxRequest {
|
||||
|
||||
private Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap;
|
||||
private Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap;
|
||||
private List<TaxReportColumnPO> taxReportColumns;
|
||||
private Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap;
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
/**
|
||||
* 正常工资薪金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildZCGZXJRequestParam() {
|
||||
// 人员列表
|
||||
List<Map<String, Object>> RYLBRequestParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
|
||||
// 正常工资薪金列表
|
||||
List<Map<String, Object>> ZCGZXJLBRequestParams = buildRequestParams(IncomeCategoryEnum.WAGES_AND_SALARIES,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 人员列表
|
||||
param.put("rylb", RYLBRequestParam);
|
||||
// 正常工资薪金列表
|
||||
param.put("zcgzxjlb", ZCGZXJLBRequestParams);
|
||||
// 正常工资薪金是否需要专项
|
||||
param.put("zcgzxjsfxyzx", 1);
|
||||
// 正常工资薪金是否传入专项累计
|
||||
param.put("zcgzxjsfcrlj", 0);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全年一次性奖金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQNYCXJJSSLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ONETIME_ANNUAL_BONUS,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 稿酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildGCSDLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一般劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildLWBCLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解除劳动合同一次性补偿金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildJCLDHTYCXBCJLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_DISMISS,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险营销员佣金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildBXYXYRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 保险营销员薪金列表
|
||||
param.put("bxyxylwbclb", requestParams);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 证券经纪人佣金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildZQJJRRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 证券经纪人薪金列表
|
||||
param.put("zqjjrsdlb", requestParams);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他连续劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildQTLXLWBCRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("qtlxlwbclb", Lists.newArrayList());
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特许权使用费所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildTXQRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ROYALTIES,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人股权激励收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildGRGQJLRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 年金领取
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQYNJRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ANNUITY_RECEIPT,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内退一次性补偿金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildNTYCXBCJLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_RETIRE,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他非连续劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQTFLXLWBCRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum,
|
||||
List<EmployeeDeclarePO> employeeDeclares,
|
||||
Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap,
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap) {
|
||||
List<Map<String, Object>> requestParams = Lists.newArrayListWithExpectedSize(salaryAcctResultValueMap.size());
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeDeclare.getEmployeeId());
|
||||
if (salaryAcctEmployee == null) {
|
||||
continue;
|
||||
}
|
||||
List<SalaryAcctResultPO> salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId());
|
||||
if (salaryAcctResultValue == null) {
|
||||
continue;
|
||||
}
|
||||
Map<Long, String> map = SalaryEntityUtil.convert2Map(salaryAcctResultValue, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
|
||||
Map<String, Object> requestParam = buildRequestParam(incomeCategoryEnum, employeeDeclare, map);
|
||||
if (MapUtils.isNotEmpty(requestParam)) {
|
||||
requestParams.add(requestParam);
|
||||
}
|
||||
}
|
||||
return requestParams;
|
||||
}
|
||||
|
||||
private Map<String, Object> buildRequestParam(IncomeCategoryEnum incomeCategoryEnum,
|
||||
EmployeeDeclarePO employeeDeclare,
|
||||
Map<Long, String> salaryAcctResultValue) {
|
||||
if (CollectionUtils.isEmpty(taxReportColumns)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Object> requestParam = Maps.newHashMap();
|
||||
// 姓名
|
||||
requestParam.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
requestParam.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
requestParam.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
|
||||
for (TaxReportColumnPO taxReportColumn : taxReportColumns) {
|
||||
Long dataKey = null;
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = salarySobTaxReportRuleMap.get(taxReportColumn.getReportColumnDataIndex());
|
||||
if (salarySobTaxReportRule != null && salarySobTaxReportRule.getSalaryItemId() != null) {
|
||||
dataKey = salarySobTaxReportRule.getSalaryItemId();
|
||||
}
|
||||
String value = salaryAcctResultValue.getOrDefault(dataKey, StringUtils.EMPTY);
|
||||
if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) {
|
||||
value = Util.getBigDecimalValue(value, BigDecimal.ZERO).toPlainString();
|
||||
} else if (Objects.equals(taxReportColumn.getDataType(), "integer")) {
|
||||
value = Util.getBigDecimalValue(value, BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString();
|
||||
}
|
||||
requestParam.put(taxReportColumn.getRequestParamKey(), value);
|
||||
}
|
||||
return requestParam;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 未报送人员列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AbnormalEmployeeListDTO {
|
||||
|
||||
//主键id
|
||||
private Long id;
|
||||
|
||||
//人员id
|
||||
private Long employeeId;
|
||||
|
||||
//姓名
|
||||
@TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName")
|
||||
private String employeeName;
|
||||
|
||||
//工号")
|
||||
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||
private String jobNum;
|
||||
|
||||
}
|
||||
|
|
@ -23,5 +23,14 @@ public class SalaryAcctEmployeeInfoDTO {
|
|||
private String fieldName;
|
||||
|
||||
//字段值
|
||||
private String fieldValue;
|
||||
private Object fieldValue;
|
||||
|
||||
// code
|
||||
private String fieldCode;
|
||||
|
||||
// 用于编辑时前端渲染对应输入选择框
|
||||
private String fieldType;
|
||||
|
||||
// 是否可编辑
|
||||
private boolean canEdit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxInfoDTO {
|
||||
|
||||
/**
|
||||
* 是否显示计算个税按钮
|
||||
*/
|
||||
private boolean showCalcTaxButton;
|
||||
|
||||
/**
|
||||
* 是否显示获取个税计算反馈按钮
|
||||
*/
|
||||
private boolean showCalcTaxFeedbackButton;
|
||||
|
||||
/**
|
||||
* 是否显示核算税后薪资按钮
|
||||
*/
|
||||
private boolean showCalcAfterTaxButton;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 未报送人员列表
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AbnormalEmployeeListQueryParam extends BaseQueryParam {
|
||||
|
||||
//工号、姓名、身份证号码")
|
||||
private String keyword;
|
||||
|
||||
//个税申报记录id")
|
||||
private Long recordId;
|
||||
|
||||
@JsonIgnore
|
||||
//个税扣缴义务人id")
|
||||
private Long taxAgentId;
|
||||
|
||||
@JsonIgnore
|
||||
//税款所属期")
|
||||
private Date taxCycle;
|
||||
}
|
||||
|
|
@ -65,6 +65,11 @@ public class SalaryAcctResultQueryParam extends BaseQueryParam {
|
|||
//薪资项目id
|
||||
private Collection<Long> salaryItemIds;
|
||||
|
||||
/**
|
||||
* 是否需要实时人员信息
|
||||
*/
|
||||
private boolean dynamicEmpInfo;
|
||||
|
||||
//其他条件
|
||||
private List<OtherCondition> otherConditions;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeInfoDTO;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -30,6 +31,9 @@ public class SalaryAcctResultSaveParam {
|
|||
@DataCheck(require = true,message = "薪资项目的值的集合不能为空")
|
||||
private Collection<SalaryAcctResultDetailItemParam> items;
|
||||
|
||||
// 员工基础信息
|
||||
private Collection<SalaryAcctEmployeeInfoDTO> employeeInfos;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 税后薪资核算的参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAfterTaxAcctCalculateParam {
|
||||
@DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxParam {
|
||||
|
||||
/**
|
||||
* 参数错误,薪资核算记录ID不能为空
|
||||
*/
|
||||
@DataCheck(require = true,message = "薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ElogTransform(name = "薪资核算在线计算个税请求")
|
||||
//hrsa_acct_calc_tax_req
|
||||
public class SalaryAcctCalcTaxReqPO {
|
||||
|
||||
@ElogTransform(name = "主键id", ignore = true)
|
||||
private Long id;
|
||||
|
||||
@ElogTransform(name = "薪资核算记录", ignore = true)
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
@ElogTransform(name = "个税扣缴义务人id", ignore = true)
|
||||
private Long taxAgentId;
|
||||
|
||||
@ElogTransform(name = "请求requestId", ignore = true)
|
||||
private String requestId;
|
||||
|
||||
@ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
|
||||
@ElogTransform(name = "创建人id", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
@ElogTransform(name = "是否删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
@ElogTransform(name = "创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
@ElogTransform(name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
//--------条件----------
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.annotation.I18n;
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -123,6 +124,35 @@ public class SalaryAcctEmployeePO {
|
|||
@ElogTransform(name = "锁定状态")
|
||||
private Integer lockStatus;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@I18n
|
||||
private String subcompanyName;
|
||||
private Long subcompanyId;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@I18n
|
||||
private String departmentName;
|
||||
private Long departmentId;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@I18n
|
||||
private String jobtitleName;
|
||||
private Long jobtitleId;
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
@I18n
|
||||
private String jobcall;
|
||||
private Long jobcallId;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
//--------条件----------
|
||||
//主键id集合
|
||||
|
|
|
|||
|
|
@ -21,14 +21,16 @@ import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
|||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
|
@ -344,7 +346,7 @@ public class SalaryArchiveExcelBO extends Service {
|
|||
*/
|
||||
public static boolean singleRowCheck(List<String> allTodoSalaryArchives, Map<String, Object> map, List<String> headers,
|
||||
int effectiveTimeIndex, List<Map<String, String>> excelComments, int errorCount,
|
||||
SalaryArchiveImportHandleParam importHandleParam, List<Long> azDepAuthEmpIds, Map<String, Long> taxAgentNameMap) {
|
||||
SalaryArchiveImportHandleParam importHandleParam, List<Long> azDepAuthEmpIds, Map<String, Long> taxAgentNameMap, User user) {
|
||||
//是否是流程
|
||||
boolean process = importHandleParam.isProcess();
|
||||
|
||||
|
|
@ -723,7 +725,7 @@ public class SalaryArchiveExcelBO extends Service {
|
|||
// 7.薪资项目列处理(待定薪\定薪的初始化\定薪的调薪)
|
||||
} else {
|
||||
isError = handleSalaryItem(isError, effectiveTimeIndex, excelComments, errorCount, j,
|
||||
effectiveTime, finalSalaryArchive, adjustReason, importHandleParam, key.toString(), cellVal, map);
|
||||
effectiveTime, finalSalaryArchive, adjustReason, importHandleParam, key.toString(), cellVal, map, user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -873,14 +875,14 @@ public class SalaryArchiveExcelBO extends Service {
|
|||
public static boolean handleSalaryItem(boolean isError, int effectiveTimeIndex,
|
||||
List<Map<String, String>> excelComments, int errorCount, int j,
|
||||
Date effectiveTime, SalaryArchivePO finalSalaryArchive, String salaryItemAdjustReason, SalaryArchiveImportHandleParam importHandleParam,
|
||||
String key, String cellVal, Map<String, Object> map) {
|
||||
String key, String cellVal, Map<String, Object> map, User user) {
|
||||
|
||||
String rowindex = "第" + map.get("index") + "行";
|
||||
// 薪资项目数据
|
||||
if (isError || importHandleParam.isSuspendList() || (importHandleParam.isSalaryItemAdjust() && effectiveTime == null) || finalSalaryArchive == null) {
|
||||
return isError;
|
||||
}
|
||||
Optional<SalaryItemPO> optionalSalaryItem = importHandleParam.getSalaryItems().stream().filter(e -> e.getName().equals(key)).findFirst();
|
||||
Optional<SalaryItemPO> optionalSalaryItem = importHandleParam.getSalaryItems().stream().filter(e -> Util.formatMultiLang(e.getName(), String.valueOf(user.getLanguage())).equals(key)).findFirst();
|
||||
// 可以处理薪资项目的条件:有薪资项目+待定薪列表+定薪列表(调薪和初始化导入)
|
||||
boolean isEnable = optionalSalaryItem.isPresent() && (importHandleParam.isPendingList() || importHandleParam.isInit() || importHandleParam.isSalaryItemAdjust());
|
||||
if (isEnable) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ public class SalaryArchiveQueryParam extends BaseQueryParam {
|
|||
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
private List<Long> taxAgentIds;
|
||||
private String taxAgentName;
|
||||
|
||||
//分部id
|
||||
|
|
|
|||
|
|
@ -31,22 +31,24 @@ public class SalaryFormulaEmployeeDTO {
|
|||
private String username;
|
||||
|
||||
//部门
|
||||
@SalaryFormulaVar(defaultLabel = "部门", labelId = 86185, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "部门", labelId = 86185, dataType = "departmentBrowser")
|
||||
private String departmentName;
|
||||
@SalaryFormulaVar(defaultLabel = "部门ID", labelId = 86185, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "部门ID", labelId = 86185, dataType = "departmentBrowser")
|
||||
private Long departmentId;
|
||||
|
||||
|
||||
//分部
|
||||
@SalaryFormulaVar(defaultLabel = "分部", labelId = 82465, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "分部", labelId = 82465, dataType = "subcompanyBrowser")
|
||||
private String subcompanyName;
|
||||
|
||||
private Long subcompanyId;
|
||||
|
||||
|
||||
|
||||
//岗位
|
||||
@SalaryFormulaVar(defaultLabel = "岗位", labelId = 90633, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "岗位", labelId = 90633, dataType = "jobtitleBrowser")
|
||||
private String jobtitleName;
|
||||
@SalaryFormulaVar(defaultLabel = "岗位ID", labelId = 90633, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "岗位ID", labelId = 90633, dataType = "jobtitleBrowser")
|
||||
private Long jobtitleId;
|
||||
|
||||
@SalaryFormulaVar(defaultLabel = "入职日期", labelId = 86319, dataType = "string")
|
||||
|
|
@ -88,9 +90,9 @@ public class SalaryFormulaEmployeeDTO {
|
|||
|
||||
|
||||
//职称
|
||||
@SalaryFormulaVar(defaultLabel = "职称", labelId = 98623, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "职称", labelId = 98623, dataType = "jobcallBrowser")
|
||||
private String jobcall;
|
||||
@SalaryFormulaVar(defaultLabel = "职称ID", labelId = 98623, dataType = "string")
|
||||
@SalaryFormulaVar(defaultLabel = "职称ID", labelId = 98623, dataType = "jobcallBrowser")
|
||||
private Long jobcallId;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ public class SalaryItemBO {
|
|||
|
||||
private static final BaseBean baseBean = new BaseBean();
|
||||
|
||||
//强制开启账套的公式配置
|
||||
private static final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
|
||||
|
||||
|
|
@ -86,6 +84,10 @@ public class SalaryItemBO {
|
|||
if (CollectionUtils.isEmpty(salaryItems)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
//强制开启账套的公式配置
|
||||
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
||||
return salaryItems.stream().map(salaryItemPO -> {
|
||||
|
|
@ -134,6 +136,9 @@ public class SalaryItemBO {
|
|||
if (CollectionUtils.isEmpty(salaryItems)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//强制开启账套的公式配置
|
||||
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
||||
return salaryItems.stream().map(salaryItemPO -> {
|
||||
|
|
@ -171,6 +176,7 @@ public class SalaryItemBO {
|
|||
.sortedIndex(salaryItemPO.getSortedIndex())
|
||||
.description(salaryItemPO.getDescription())
|
||||
.salaryItemType(salaryItemPO.getUseInEmployeeSalary() == 0 ? "薪资项目" : "档案字段")
|
||||
.defaultValue(salaryItemPO.getDefaultValue())
|
||||
.build();
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
|
|
@ -202,7 +208,8 @@ public class SalaryItemBO {
|
|||
.setTaxAgentIds(salaryItemPO.getTaxAgentIds())
|
||||
.setSharedType(salaryItemPO.getSharedType())
|
||||
.setSortedIndex(salaryItemPO.getSortedIndex())
|
||||
.setWidth(salaryItemPO.getWidth());
|
||||
.setWidth(salaryItemPO.getWidth())
|
||||
.setDefaultValue(salaryItemPO.getDefaultValue());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -283,6 +290,7 @@ public class SalaryItemBO {
|
|||
.taxAgentIds(saveParam.getTaxAgentIds())
|
||||
.sortedIndex(saveParam.getSortedIndex())
|
||||
.width(saveParam.getWidth())
|
||||
.defaultValue(saveParam.getDefaultValue())
|
||||
.build();
|
||||
// 开启了"薪资档案引用",取值方式固定为输入
|
||||
// if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) {
|
||||
|
|
|
|||
|
|
@ -98,4 +98,7 @@ public class SalaryItemFormDTO {
|
|||
|
||||
// 宽度
|
||||
private Integer width;
|
||||
|
||||
// 默认值
|
||||
private String defaultValue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ public class SalaryItemSobListDTO {
|
|||
//排序
|
||||
private Integer sortedIndex;
|
||||
|
||||
// 默认值
|
||||
private String defaultValue;
|
||||
|
||||
|
||||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
private String operate;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue