Merge branch 'release/个税二期' into release/个税版本
This commit is contained in:
commit
464bb9d623
|
|
@ -0,0 +1,40 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
request_status number default 1 not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null,
|
||||||
|
tax_agent_id number not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||||
|
/
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
employee_id number not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id number not null,
|
||||||
|
reason varchar2(255) not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
request_status number default 1 not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null,
|
||||||
|
tax_agent_id number not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||||
|
/
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
employee_id number not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id number not null,
|
||||||
|
reason varchar2(255) not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
request_status number default 1 not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null,
|
||||||
|
tax_agent_id number not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||||
|
/
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
employee_id number not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id number not null,
|
||||||
|
reason varchar2(255) not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id bigint primary key comment 'ID' ,
|
||||||
|
create_time datetime comment '创建时间' ,
|
||||||
|
update_time datetime comment '修改时间' ,
|
||||||
|
creator bigint comment '创建人id' ,
|
||||||
|
delete_type int default 0 comment '是否删除' ,
|
||||||
|
tenant_key varchar(10) comment '租户KEY' ,
|
||||||
|
request_id bigint not null comment '查询请求ID' ,
|
||||||
|
request_status tinyint(1) default 1 not null comment '请求处理状态:10待处理 20处理中 99已完成' ,
|
||||||
|
tax_year_month datetime not null comment '税款所属期' ,
|
||||||
|
outer_request_id varchar(50) not null comment '外部接口查询请求ID' ,
|
||||||
|
tax_agent_id bigint not null comment '个税扣缴义务人Id'
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int
|
||||||
|
;
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify column lock_version int default 0
|
||||||
|
;
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id bigint primary key comment 'ID' ,
|
||||||
|
create_time datetime comment '创建时间' ,
|
||||||
|
update_time datetime comment '修改时间' ,
|
||||||
|
creator bigint comment '创建人id' ,
|
||||||
|
delete_type int default 0 comment '是否删除' ,
|
||||||
|
tenant_key varchar(10) comment '租户KEY' ,
|
||||||
|
request_id bigint not null comment '查询请求ID' ,
|
||||||
|
employee_id bigint not null comment '员工ID' ,
|
||||||
|
employee_type int not null comment '员工类型' ,
|
||||||
|
tax_agent_id bigint not null comment '个税扣缴义务人ID' ,
|
||||||
|
reason varchar(255) not null comment '失败原因' ,
|
||||||
|
tax_year_month datetime not null comment '税款所属期' ,
|
||||||
|
outer_request_id varchar(50) not null comment '外部接口查询请求id'
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar(255)
|
||||||
|
;
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255)
|
||||||
|
;
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar(255)
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6);
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12');
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12');
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12');
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658;
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658;
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
request_status number default 1 not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null,
|
||||||
|
tax_agent_id number not null
|
||||||
|
)
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify lock_version default 0
|
||||||
|
/
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
employee_id number not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id number not null,
|
||||||
|
reason varchar2(255) not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null
|
||||||
|
)
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5)
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255)
|
||||||
|
/
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255)
|
||||||
|
/
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar2(255)
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5)
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6)
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'))
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'))
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'))
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id bigint primary key ,
|
||||||
|
create_time timestamp,
|
||||||
|
update_time timestamp,
|
||||||
|
creator bigint,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar(10),
|
||||||
|
request_id bigint not null,
|
||||||
|
request_status smallint default 1 not null,
|
||||||
|
tax_year_month timestamp not null,
|
||||||
|
outer_request_id varchar(50) not null,
|
||||||
|
tax_agent_id bigint not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request alter column lock_version set default 0;
|
||||||
|
/
|
||||||
|
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id bigint primary key ,
|
||||||
|
create_time timestamp,
|
||||||
|
update_time timestamp,
|
||||||
|
creator bigint,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar(10),
|
||||||
|
request_id bigint not null,
|
||||||
|
employee_id bigint not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id bigint not null,
|
||||||
|
reason varchar(255) not null,
|
||||||
|
tax_year_month timestamp not null,
|
||||||
|
outer_request_id varchar(50) not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar(255)
|
||||||
|
/
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar(255)
|
||||||
|
/
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar(255)
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5)
|
||||||
|
/
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6)
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658
|
||||||
|
/
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id bigint primary key ,
|
||||||
|
create_time datetime,
|
||||||
|
update_time datetime,
|
||||||
|
creator bigint,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key nvarchar(10),
|
||||||
|
request_id bigint not null,
|
||||||
|
request_status tinyint default 1 not null,
|
||||||
|
tax_year_month datetime not null,
|
||||||
|
outer_request_id nvarchar(50) not null,
|
||||||
|
tax_agent_id bigint not null
|
||||||
|
)
|
||||||
|
GO
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int
|
||||||
|
GO
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add constraint df_lock_version_71db6820 default 0 for lock_version
|
||||||
|
GO
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id bigint primary key ,
|
||||||
|
create_time datetime,
|
||||||
|
update_time datetime,
|
||||||
|
creator bigint,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key nvarchar(10),
|
||||||
|
request_id bigint not null,
|
||||||
|
employee_id bigint not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id bigint not null,
|
||||||
|
reason nvarchar(255) not null,
|
||||||
|
tax_year_month datetime not null,
|
||||||
|
outer_request_id nvarchar(50) not null
|
||||||
|
)
|
||||||
|
GO
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5)
|
||||||
|
GO
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income nvarchar(255)
|
||||||
|
GO
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax nvarchar(255)
|
||||||
|
GO
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment nvarchar(255)
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5)
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6)
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
GO
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
GO
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, '2023-09-05 14:41:12', '2023-09-05 14:41:12')
|
||||||
|
GO
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658
|
||||||
|
GO
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658
|
||||||
|
GO
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
create table hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
request_status number default 1 not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null,
|
||||||
|
tax_agent_id number not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request add lock_version int;
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_deduction_request modify lock_version default 0;
|
||||||
|
/
|
||||||
|
|
||||||
|
create table hrsa_add_up_deduction_req_fail
|
||||||
|
(
|
||||||
|
id number primary key ,
|
||||||
|
create_time date,
|
||||||
|
update_time date,
|
||||||
|
creator number,
|
||||||
|
delete_type int default 0,
|
||||||
|
tenant_key varchar2(10),
|
||||||
|
request_id number not null,
|
||||||
|
employee_id number not null,
|
||||||
|
employee_type int not null,
|
||||||
|
tax_agent_id number not null,
|
||||||
|
reason varchar2(255) not null,
|
||||||
|
tax_year_month date not null,
|
||||||
|
outer_request_id varchar2(50) not null
|
||||||
|
);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-05 16:30:11','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
alter table hrsa_add_up_situation add tax_adjustment varchar2(255);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 5);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, '2022-03-14 11:32:30', '2022-03-18 16:59:24', 0, 'all_teams', 703433961629614119, 6);
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'));
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658;
|
||||||
|
/
|
||||||
|
|
||||||
|
|
@ -504,7 +504,12 @@ public class SIAccountBiz extends Service {
|
||||||
//TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
//TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
||||||
String billMonth = param.getBillMonth();
|
String billMonth = param.getBillMonth();
|
||||||
try {
|
try {
|
||||||
List<InsuranceAccountDetailTempPO> list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization());
|
// List<InsuranceAccountDetailTempPO> list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization());
|
||||||
|
List<InsuranceAccountDetailTempPO> list = new ArrayList<>();
|
||||||
|
List<List<Long>> partitionDetailTempInfo = Lists.partition((List<Long>) ids, 100);
|
||||||
|
partitionDetailTempInfo.forEach(part -> list.addAll(
|
||||||
|
getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(part, billMonth, param.getPaymentOrganization())));
|
||||||
|
|
||||||
encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class);
|
encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class);
|
||||||
Integer paymentStatus = 0;
|
Integer paymentStatus = 0;
|
||||||
log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size());
|
log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size());
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,10 @@ public class SzyhApiConstant {
|
||||||
* 刷新缴款状态
|
* 刷新缴款状态
|
||||||
*/
|
*/
|
||||||
public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback";
|
public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback";
|
||||||
|
/**
|
||||||
|
* 企业申报数据明细查询
|
||||||
|
*/
|
||||||
|
public static final String GET_COMPANY_INCOMES = "gateway/iit/report/getCompanyIncomes";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.annotation.Encrypt;
|
||||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||||
import com.engine.salary.annotation.SalaryTable;
|
import com.engine.salary.annotation.SalaryTable;
|
||||||
import com.engine.salary.annotation.SalaryTableOperate;
|
import com.engine.salary.annotation.SalaryTableOperate;
|
||||||
|
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -49,6 +50,12 @@ public class AddUpSituation {
|
||||||
*/
|
*/
|
||||||
private Integer year;
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员类型
|
||||||
|
* @see DataCollectionEmployeeTypeEnum
|
||||||
|
*/
|
||||||
|
private Integer employeeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计收入额
|
* 累计收入额
|
||||||
*/
|
*/
|
||||||
|
|
@ -80,57 +87,65 @@ public class AddUpSituation {
|
||||||
/**
|
/**
|
||||||
* 累计子女教育
|
* 累计子女教育
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计子女教育", labelId = 86321, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpChildEducation;
|
private String addUpChildEducation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计继续教育
|
* 累计继续教育
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计继续教育", labelId = 86323, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpContinuingEducation;
|
private String addUpContinuingEducation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计住房贷款利息
|
* 累计住房贷款利息
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计住房贷款利息", labelId = 86324, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpHousingLoanInterest;
|
private String addUpHousingLoanInterest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计住房租金
|
* 累计住房租金
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计住房租金", labelId = 86325, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpHousingRent;
|
private String addUpHousingRent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计赡养老人
|
* 累计赡养老人
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计赡养老人", labelId = 86326, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpSupportElderly;
|
private String addUpSupportElderly;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计大病医疗
|
* 累计大病医疗
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计大病医疗", labelId = 105142, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpIllnessMedical;
|
private String addUpIllnessMedical;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计婴幼儿照护
|
* 累计婴幼儿照护
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计婴幼儿照护", labelId = 117732, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpInfantCare;
|
private String addUpInfantCare;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计婴幼儿照护
|
* 累计婴幼儿照护
|
||||||
*/
|
*/
|
||||||
@SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number")
|
// @SalaryFormulaVar(defaultLabel = "累计个人养老金", labelId = 117732, dataType = "number")
|
||||||
@Encrypt
|
@Encrypt
|
||||||
|
@Deprecated
|
||||||
private String addUpPrivatePension;
|
private String addUpPrivatePension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -175,6 +190,27 @@ public class AddUpSituation {
|
||||||
@Encrypt
|
@Encrypt
|
||||||
private String addUpAdvanceTax;
|
private String addUpAdvanceTax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际累计已预扣预缴税额
|
||||||
|
*/
|
||||||
|
@SalaryFormulaVar(defaultLabel = "实际累计已预扣预缴税额", labelId = 233557, dataType = "number")
|
||||||
|
@Encrypt
|
||||||
|
private String actualAddUpAdvanceTax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个税调差
|
||||||
|
*/
|
||||||
|
@SalaryFormulaVar(defaultLabel = "个税调差", labelId = 233559, dataType = "number")
|
||||||
|
@Encrypt
|
||||||
|
private String taxAdjustment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计应纳税所得额
|
||||||
|
*/
|
||||||
|
@SalaryFormulaVar(defaultLabel = "累计应纳税所得额", labelId = 85371, dataType = "number")
|
||||||
|
@Encrypt
|
||||||
|
private String addUpTaxableIncome;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,28 @@
|
||||||
package com.engine.salary.entity.datacollection.bo;
|
package com.engine.salary.entity.datacollection.bo;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||||
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||||
|
import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.GenderEnum;
|
||||||
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||||||
|
import com.engine.salary.service.impl.AddUpDeductionServiceImpl;
|
||||||
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
import com.engine.salary.util.SalaryI18nUtil;
|
||||||
import dm.jdbc.util.IdGenerator;
|
import dm.jdbc.util.IdGenerator;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 数据采集
|
* @Description: 数据采集
|
||||||
|
|
@ -318,79 +331,80 @@ public class DataCollectionBO {
|
||||||
return requestParam;
|
return requestParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static List<Map<String, Object>> getEmployeeList(List<EmployeeDeclarePO> declarePOList) {
|
public static List<Map<String, Object>> getEmployeeList(List<EmployeeDeclarePO> declarePOList) {
|
||||||
// List<Map<String, Object>> employeeList = new ArrayList<>();
|
List<Map<String, Object>> employeeList = new ArrayList<>();
|
||||||
// for (EmployeeDeclarePO employeeDeclarePO : declarePOList) {
|
for (EmployeeDeclarePO employeeDeclarePO : declarePOList) {
|
||||||
// Map<String, Object> employeeMap = new HashMap<>(32);
|
Map<String, Object> employeeMap = new HashMap<>(32);
|
||||||
// employeeMap.put("xm", employeeDeclarePO.getEmployeeName());
|
employeeMap.put("xm", employeeDeclarePO.getEmployeeName());
|
||||||
// employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||||
// employeeMap.put("zzhm", employeeDeclarePO.getCardNum());
|
employeeMap.put("zzhm", employeeDeclarePO.getCardNum());
|
||||||
// employeeMap.put("lxdh", employeeDeclarePO.getMobile());
|
employeeMap.put("lxdh", employeeDeclarePO.getMobile());
|
||||||
// employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel());
|
employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel());
|
||||||
// employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel());
|
employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel());
|
||||||
// employeeMap.put("rzsgrq", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getEmploymentDate()));
|
employeeMap.put("rzsgrq", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getEmploymentDate()));
|
||||||
// employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel());
|
employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel());
|
||||||
// employeeMap.put("csny", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getBirthday()));
|
employeeMap.put("csny", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getBirthday()));
|
||||||
// employeeMap.put("gj", "中国");
|
employeeMap.put("gj", "中国");
|
||||||
// employeeMap.put("rydq", "境内");
|
employeeMap.put("rydq", "境内");
|
||||||
// boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability());
|
boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability());
|
||||||
// boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents());
|
boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents());
|
||||||
// employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel());
|
employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel());
|
||||||
// employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null);
|
employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null);
|
||||||
// employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel());
|
employeeMap.computeIfAbsent("sfls", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel());
|
||||||
// employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null);
|
employeeMap.computeIfAbsent("lszh", e -> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null);
|
||||||
// employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel());
|
employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel());
|
||||||
// employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel());
|
employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel());
|
||||||
// employeeList.add(employeeMap);
|
employeeList.add(employeeMap);
|
||||||
// }
|
}
|
||||||
// return employeeList;
|
return employeeList;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) {
|
public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) {
|
||||||
// return AddUpDeduction.builder()
|
return AddUpDeduction.builder()
|
||||||
// .id(IdGenerator.generate())
|
.id(IdGenerator.generate())
|
||||||
// .addUpChildEducation(feedback.getLjznjyzc().toString())
|
.addUpChildEducation(feedback.getLjznjyzc().toString())
|
||||||
// .addUpContinuingEducation(feedback.getLjjxjyzc().toString())
|
.addUpContinuingEducation(feedback.getLjjxjyzc().toString())
|
||||||
// .addUpHousingRent(feedback.getLjzfzjzc().toString())
|
.addUpHousingRent(feedback.getLjzfzjzc().toString())
|
||||||
// .addUpInfantCare(feedback.getLjyyezhzc().toString())
|
.addUpInfantCare(feedback.getLjyyezhzc().toString())
|
||||||
// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString())
|
.addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString())
|
||||||
// .addUpSupportElderly(feedback.getLjsylrzc().toString())
|
.addUpSupportElderly(feedback.getLjsylrzc().toString())
|
||||||
// .addUpIllnessMedical("0")
|
.addUpIllnessMedical("0")
|
||||||
// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue())
|
// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue())
|
||||||
// .lastUpdateTime(LocalDateTime.now())
|
// .lastUpdateTime(LocalDateTime.now())
|
||||||
// .updateTime(LocalDateTime.now())
|
.updateTime(new Date())
|
||||||
// .build();
|
.build();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||||||
// AddUpDeductionRequestPO requestPO,
|
AddUpDeductionRequestPO requestPO,
|
||||||
// Long employeeId) {
|
Long employeeId) {
|
||||||
// return AddUpDeductionRequestFailPO.builder()
|
Date now = new Date();
|
||||||
// .id(IdGenerator.generate())
|
return AddUpDeductionRequestFailPO.builder()
|
||||||
// .requestId(requestPO.getRequestId())
|
.id(IdGenerator.generate())
|
||||||
// .outerRequestId(requestPO.getOuterRequestId())
|
.requestId(requestPO.getRequestId())
|
||||||
// .taxYearMonth(requestPO.getTaxYearMonth())
|
.outerRequestId(requestPO.getOuterRequestId())
|
||||||
// .taxAgentId(requestPO.getTaxAgentId())
|
.taxYearMonth(requestPO.getTaxYearMonth())
|
||||||
// .employeeId(Optional.ofNullable(employeeId).orElse(0L))
|
.taxAgentId(requestPO.getTaxAgentId())
|
||||||
// .createTime(LocalDateTime.now())
|
.employeeId(employeeId)
|
||||||
// .updateTime(LocalDateTime.now())
|
.createTime(now)
|
||||||
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
.updateTime(now)
|
||||||
// .creator(requestWrapper.getCurrentEmployeeId())
|
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
// .tenantKey(requestPO.getTenantKey())
|
.creator(requestWrapper.getCurrentEmployeeId())
|
||||||
// .build();
|
.tenantKey(requestPO.getTenantKey())
|
||||||
// }
|
.build();
|
||||||
//
|
}
|
||||||
// public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
|
||||||
// return AddUpDeductionRequestResultDTO.builder()
|
public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||||
// .requestId(requestId.toString())
|
return AddUpDeductionRequestResultDTO.builder()
|
||||||
// .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"),
|
.requestId(requestId.toString())
|
||||||
// requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(),
|
.msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"),
|
||||||
// requestWrapper.getFailPOList().size()))
|
requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(),
|
||||||
// .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success")
|
requestWrapper.getFailPOList().size()))
|
||||||
// .finish(true)
|
.result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success")
|
||||||
// .build();
|
.finish(true)
|
||||||
// }
|
.build();
|
||||||
//
|
}
|
||||||
|
|
||||||
// public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
|
// public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
|
||||||
// return AddUpDeduction.builder()
|
// return AddUpDeduction.builder()
|
||||||
// .id(IdGenerator.generate())
|
// .id(IdGenerator.generate())
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.engine.salary.entity.datacollection.dto;
|
||||||
|
|
||||||
|
import com.engine.salary.annotation.SalaryTableColumn;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加扣除-在线获取失败列表
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date 2022-11-07 15:01:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel("数据采集-累计专项附加扣除-在线获取失败列表")
|
||||||
|
public class AddUpDeductionRequestFailListDTO {
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "姓名", labelId = 85429, width = "100")
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String employeeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工id")
|
||||||
|
private Long employeeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("id主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("人员类型")
|
||||||
|
private String employeeType;
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "个税扣缴义务人", labelId = 86184, width = "150")
|
||||||
|
@ApiModelProperty("个税扣缴义务人")
|
||||||
|
private String taxAgentName;
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "工号", labelId = 86317, width = "100")
|
||||||
|
@ApiModelProperty("工号")
|
||||||
|
private String jobNum;
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "部门", labelId = 86185, width = "100")
|
||||||
|
@ApiModelProperty("部门")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "身份证件号码", labelId = 102782, width = "150")
|
||||||
|
@ApiModelProperty("证件号码")
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
@SalaryTableColumn(text = "失败原因", labelId = 144832, width = "600")
|
||||||
|
@ApiModelProperty("失败原因")
|
||||||
|
private String failReason;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.engine.salary.entity.datacollection.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加扣除-在线获取结果
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date 2022-11-01 09:47:27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@ApiModel("数据采集-累计专项附加扣除-在线获取结果")
|
||||||
|
public class AddUpDeductionRequestResultDTO {
|
||||||
|
@ApiModelProperty("请求id")
|
||||||
|
private String requestId;
|
||||||
|
|
||||||
|
@ApiModelProperty("提示语")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
@ApiModelProperty("处理结果")
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否结束轮询")
|
||||||
|
private Boolean finish;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.engine.salary.entity.datacollection.param;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加月份+扣缴主体参数
|
||||||
|
*
|
||||||
|
* @author : chengliming
|
||||||
|
* @Date: 2022-09-29 10:38:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("数据采集-累计专项附加月份+扣缴主体参数")
|
||||||
|
public class AddUpDeductionMonthTaxAgentParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("税款所属期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date declareMonth;
|
||||||
|
|
||||||
|
@ApiModelProperty("个税扣缴义务人的主键id")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.engine.salary.entity.datacollection.param;
|
||||||
|
|
||||||
|
import com.engine.salary.common.BaseQueryParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加扣除-在线获取失败记录查询参数
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date 2022-11-01 14:40:36
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel("数据采集-累计专项附加扣除-在线获取失败记录查询参数")
|
||||||
|
public class AddUpDeductionRequestFailQueryParam extends BaseQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("请求ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.engine.salary.entity.datacollection.po;
|
||||||
|
|
||||||
|
import com.engine.salary.report.enums.EmployeeTypeEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加扣除在线查询失败表
|
||||||
|
* <p>Copyright: Copyright (c) 2023</p>
|
||||||
|
* <p>Company: 泛微软件</p>
|
||||||
|
*
|
||||||
|
* @author qiantao
|
||||||
|
* @version 1.0
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
//hrsa_add_up_deduction_req_fail")
|
||||||
|
//数据采集-累计专项附加扣除在线查询失败表")
|
||||||
|
public class AddUpDeductionRequestFailPO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4950145856639514995L;
|
||||||
|
|
||||||
|
//ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//创建时间", ignore = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
//修改时间", ignore = true)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
//创建人id", ignore = true)
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
//是否删除", ignore = true)
|
||||||
|
private Integer deleteType;
|
||||||
|
|
||||||
|
//租户KEY", ignore = true)
|
||||||
|
private String tenantKey;
|
||||||
|
|
||||||
|
//查询请求ID")
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
//外部查询请求ID")
|
||||||
|
private String outerRequestId;
|
||||||
|
|
||||||
|
//员工Id")
|
||||||
|
private Long employeeId;
|
||||||
|
|
||||||
|
//个税扣缴义务人ID")
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
//失败原因")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
//税款所属期")
|
||||||
|
private Date taxYearMonth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see EmployeeTypeEnum
|
||||||
|
*/
|
||||||
|
//人员类型")
|
||||||
|
private Integer employeeType;
|
||||||
|
|
||||||
|
|
||||||
|
private Collection<Long> ids;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.engine.salary.entity.datacollection.po;
|
||||||
|
|
||||||
|
import com.engine.salary.enums.datacollection.EnumAddUpDeductionRequestStatus;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-累计专项附加扣除在线查询表
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date: 2022-10-26 16:07:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
//hrsa_add_up_deduction_request
|
||||||
|
//数据采集-累计专项附加扣除在线查询表
|
||||||
|
public class AddUpDeductionRequestPO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1452863635879051515L;
|
||||||
|
|
||||||
|
//ID
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//创建时间"
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
//修改时间"
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
//创建人id"
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
//是否删除"
|
||||||
|
private Integer deleteType;
|
||||||
|
|
||||||
|
//租户KEY"
|
||||||
|
private String tenantKey;
|
||||||
|
|
||||||
|
//乐观锁版本"
|
||||||
|
private Integer lockVersion;
|
||||||
|
|
||||||
|
//查询请求ID
|
||||||
|
private Long requestId;
|
||||||
|
|
||||||
|
//外部接口查询请求ID
|
||||||
|
private String outerRequestId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see EnumAddUpDeductionRequestStatus
|
||||||
|
*/
|
||||||
|
//请求处理状态
|
||||||
|
private Integer requestStatus;
|
||||||
|
|
||||||
|
//税款所属期
|
||||||
|
private Date taxYearMonth;
|
||||||
|
|
||||||
|
//个税扣缴义务人ID
|
||||||
|
private Long taxAgentId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Collection<Long> ids;
|
||||||
|
private Collection<Integer> requestStatuss;
|
||||||
|
private Integer oldStatus;
|
||||||
|
private Integer oldLockVersion;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.engine.salary.entity.datacollection.po;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据采集-抽象接口-方便使用泛型封装方法(po继承类会导致加密aop报错,原因不知,所以这里使用接口抽象)
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date: 2022-09-30 10:55:40
|
||||||
|
*/
|
||||||
|
public interface DataCollectionBaseInfo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取id
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long getId();
|
||||||
|
|
||||||
|
Long getModifier();
|
||||||
|
|
||||||
|
Long getEmployeeId();
|
||||||
|
|
||||||
|
Long getTaxAgentId();
|
||||||
|
|
||||||
|
Integer getDeleteType();
|
||||||
|
|
||||||
|
String getTenantKey();
|
||||||
|
|
||||||
|
LocalDateTime getCreateTime();
|
||||||
|
|
||||||
|
LocalDateTime getUpdateTime();
|
||||||
|
|
||||||
|
void setId(Long id);
|
||||||
|
|
||||||
|
void setModifier(Long modifier);
|
||||||
|
|
||||||
|
void setEmployeeId(Long employeeId);
|
||||||
|
|
||||||
|
void setTaxAgentId(Long taxAgentId);
|
||||||
|
|
||||||
|
void setDeleteType(Integer deleteType);
|
||||||
|
|
||||||
|
void setTenantKey(String tenantKey);
|
||||||
|
|
||||||
|
void setCreateTime(LocalDateTime createTime);
|
||||||
|
|
||||||
|
void setUpdateTime(LocalDateTime updateTime);
|
||||||
|
|
||||||
|
void setCreator(Long creator);
|
||||||
|
}
|
||||||
|
|
@ -17,6 +17,7 @@ import java.util.Date;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
//hrsa_special_add_deduction
|
||||||
public class SpecialAddDeductionPO {
|
public class SpecialAddDeductionPO {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,395 @@
|
||||||
|
package com.engine.salary.entity.datacollection.response;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员专项附加扣除信息查询结果
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date 2022-10-27 10:00 AM
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class GetCompanyIncomesResponse extends BaseResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回数据
|
||||||
|
*/
|
||||||
|
private Body body;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员专项附加扣除信息查询结果body
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public static class Body {
|
||||||
|
/**
|
||||||
|
* 明细
|
||||||
|
*/
|
||||||
|
private List<Detail> sfmx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合计
|
||||||
|
*/
|
||||||
|
private Sum sfhj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Detail {
|
||||||
|
/**
|
||||||
|
* 是否明细申报
|
||||||
|
**/
|
||||||
|
private String sfmxsb;
|
||||||
|
/**
|
||||||
|
* 纳税人姓名
|
||||||
|
**/
|
||||||
|
private String xm;
|
||||||
|
/**
|
||||||
|
* 纳税识别号
|
||||||
|
**/
|
||||||
|
private String nsrsbh;
|
||||||
|
/**
|
||||||
|
* 证件类型
|
||||||
|
**/
|
||||||
|
private String zjlx;
|
||||||
|
/**
|
||||||
|
* 证件号码
|
||||||
|
**/
|
||||||
|
private String zjhm;
|
||||||
|
/**
|
||||||
|
* 非居民个人
|
||||||
|
**/
|
||||||
|
private String sffjm;
|
||||||
|
/**
|
||||||
|
* 所得项目名称
|
||||||
|
**/
|
||||||
|
private String sdxmmc;
|
||||||
|
/**
|
||||||
|
* 收入额
|
||||||
|
**/
|
||||||
|
private String sre;
|
||||||
|
/**
|
||||||
|
* 费用
|
||||||
|
**/
|
||||||
|
private String fy;
|
||||||
|
/**
|
||||||
|
* 免税收入
|
||||||
|
**/
|
||||||
|
private String mssr;
|
||||||
|
/**
|
||||||
|
* 财产原值
|
||||||
|
**/
|
||||||
|
private String ccyz;
|
||||||
|
/**
|
||||||
|
* 投资抵扣
|
||||||
|
**/
|
||||||
|
private String tzdk;
|
||||||
|
/**
|
||||||
|
* 允许扣除的费用
|
||||||
|
**/
|
||||||
|
private String yxkcsf;
|
||||||
|
/**
|
||||||
|
* 减计比例
|
||||||
|
**/
|
||||||
|
private String jjbl;
|
||||||
|
/**
|
||||||
|
* 减除费用
|
||||||
|
**/
|
||||||
|
private String jcfy;
|
||||||
|
/**
|
||||||
|
* 基本养老保险
|
||||||
|
**/
|
||||||
|
private String jbylaobxf;
|
||||||
|
/**
|
||||||
|
* 基本医疗保险费
|
||||||
|
**/
|
||||||
|
private String jbylbxf;
|
||||||
|
/**
|
||||||
|
* 失业保险费
|
||||||
|
**/
|
||||||
|
private String sybxf;
|
||||||
|
/**
|
||||||
|
* 住房公积金
|
||||||
|
**/
|
||||||
|
private String zfgjj;
|
||||||
|
/**
|
||||||
|
* 年金
|
||||||
|
**/
|
||||||
|
private String nj;
|
||||||
|
/**
|
||||||
|
* 商业健康保险
|
||||||
|
**/
|
||||||
|
private String syjkbx;
|
||||||
|
/**
|
||||||
|
* 税延养老保险
|
||||||
|
**/
|
||||||
|
private String syylbx;
|
||||||
|
/**
|
||||||
|
* 其它扣除
|
||||||
|
**/
|
||||||
|
private String qt;
|
||||||
|
/**
|
||||||
|
* 准予扣除的捐赠额
|
||||||
|
**/
|
||||||
|
private String zykcjze;
|
||||||
|
/**
|
||||||
|
* 累计收入额
|
||||||
|
**/
|
||||||
|
private String ljsre;
|
||||||
|
/**
|
||||||
|
* 累计减除费用
|
||||||
|
**/
|
||||||
|
private String ljjcfy;
|
||||||
|
/**
|
||||||
|
* 累计专项扣除
|
||||||
|
**/
|
||||||
|
private String ljzxkc;
|
||||||
|
/**
|
||||||
|
* 累计子女教育
|
||||||
|
**/
|
||||||
|
private String ljznjy;
|
||||||
|
/**
|
||||||
|
* 累计赡养老人
|
||||||
|
**/
|
||||||
|
private String ljsylr;
|
||||||
|
/**
|
||||||
|
* 累计住房贷款利息
|
||||||
|
**/
|
||||||
|
private String ljzfdklx;
|
||||||
|
/**
|
||||||
|
* 累计住房租金
|
||||||
|
**/
|
||||||
|
private String ljzfzj;
|
||||||
|
/**
|
||||||
|
* 累计继续教育
|
||||||
|
**/
|
||||||
|
private String ljjxjy;
|
||||||
|
/**
|
||||||
|
* 累计3岁以下婴幼儿照护支出
|
||||||
|
**/
|
||||||
|
private String ljyyezhzc;
|
||||||
|
/**
|
||||||
|
* 累计其它扣除
|
||||||
|
**/
|
||||||
|
private String ljqtkc;
|
||||||
|
/**
|
||||||
|
* 累计准予扣除的捐赠额
|
||||||
|
**/
|
||||||
|
private String ljzykcjze;
|
||||||
|
/**
|
||||||
|
* 累计个人养老金
|
||||||
|
**/
|
||||||
|
private String ljgrylj;
|
||||||
|
/**
|
||||||
|
* 应纳税所得额
|
||||||
|
**/
|
||||||
|
private String ynssde;
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
**/
|
||||||
|
private String sl;
|
||||||
|
/**
|
||||||
|
* 协定税率
|
||||||
|
**/
|
||||||
|
private String xdsl;
|
||||||
|
/**
|
||||||
|
* 速算扣除数
|
||||||
|
**/
|
||||||
|
private String sskcs;
|
||||||
|
/**
|
||||||
|
* 应纳税额
|
||||||
|
**/
|
||||||
|
private String ynse;
|
||||||
|
/**
|
||||||
|
* 减免税额
|
||||||
|
**/
|
||||||
|
private String jmse;
|
||||||
|
/**
|
||||||
|
* 已扣缴税额
|
||||||
|
**/
|
||||||
|
private String ykjse;
|
||||||
|
/**
|
||||||
|
* 应补退税额
|
||||||
|
**/
|
||||||
|
private String ybtse;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
**/
|
||||||
|
private String bz;
|
||||||
|
/**
|
||||||
|
* 分摊年度数
|
||||||
|
**/
|
||||||
|
private String ftnds;
|
||||||
|
/**
|
||||||
|
* 年减除费用
|
||||||
|
**/
|
||||||
|
private String njcfy;
|
||||||
|
/**
|
||||||
|
* 应扣缴税额
|
||||||
|
**/
|
||||||
|
private String kjse;
|
||||||
|
/**
|
||||||
|
* 证券账户号
|
||||||
|
**/
|
||||||
|
private String zqzhh;
|
||||||
|
/**
|
||||||
|
* 股票代码
|
||||||
|
**/
|
||||||
|
private String gpdm;
|
||||||
|
/**
|
||||||
|
* 股票名称
|
||||||
|
**/
|
||||||
|
private String gpmc;
|
||||||
|
/**
|
||||||
|
* 每股计税价格
|
||||||
|
**/
|
||||||
|
private String mgjsjg;
|
||||||
|
/**
|
||||||
|
* 转让股数
|
||||||
|
**/
|
||||||
|
private String zrgs;
|
||||||
|
/**
|
||||||
|
* 限售股原值
|
||||||
|
**/
|
||||||
|
private String xsgyz;
|
||||||
|
/**
|
||||||
|
* 合理税费
|
||||||
|
**/
|
||||||
|
private String hlsf;
|
||||||
|
/**
|
||||||
|
* 扣除及减除项目合计
|
||||||
|
**/
|
||||||
|
private String kcjjcxmhj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合计
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Sum {
|
||||||
|
/**
|
||||||
|
* 收入额合计
|
||||||
|
*/
|
||||||
|
private String srehj;
|
||||||
|
/**
|
||||||
|
* 免税收入合计
|
||||||
|
*/
|
||||||
|
private String mssrhj;
|
||||||
|
/**
|
||||||
|
* 财产原值合计
|
||||||
|
*/
|
||||||
|
private String ccyzhj;
|
||||||
|
/**
|
||||||
|
* 投资抵扣合计
|
||||||
|
*/
|
||||||
|
private String tzdkhj;
|
||||||
|
/**
|
||||||
|
* 允许扣除的税费合计
|
||||||
|
*/
|
||||||
|
private String yxkcsfhj;
|
||||||
|
/**
|
||||||
|
* 基本养老保险费合计
|
||||||
|
*/
|
||||||
|
private String jbylaobxfhj;
|
||||||
|
/**
|
||||||
|
* 基本医疗保险费合计
|
||||||
|
*/
|
||||||
|
private String jbylbxfhj;
|
||||||
|
/**
|
||||||
|
* 失业保险费合计
|
||||||
|
*/
|
||||||
|
private String sybxfhj;
|
||||||
|
/**
|
||||||
|
* 住房公积金合计
|
||||||
|
*/
|
||||||
|
private String zfgjjhj;
|
||||||
|
/**
|
||||||
|
* 年金合计
|
||||||
|
*/
|
||||||
|
private String njhj;
|
||||||
|
/**
|
||||||
|
* 商业健康保险合计
|
||||||
|
*/
|
||||||
|
private String syjkbxhj;
|
||||||
|
/**
|
||||||
|
* 税延养老保险合计
|
||||||
|
*/
|
||||||
|
private String syylbxhj;
|
||||||
|
/**
|
||||||
|
* 其他扣除合计
|
||||||
|
*/
|
||||||
|
private String qthj;
|
||||||
|
/**
|
||||||
|
* 准予扣除的捐赠额合计
|
||||||
|
*/
|
||||||
|
private String zykcjzehj;
|
||||||
|
/**
|
||||||
|
* 累计收入额合计
|
||||||
|
*/
|
||||||
|
private String ljsrehj;
|
||||||
|
/**
|
||||||
|
* 累计专项扣除合计
|
||||||
|
*/
|
||||||
|
private String ljzxkchj;
|
||||||
|
/**
|
||||||
|
* 累计子女教育合计
|
||||||
|
*/
|
||||||
|
private String ljznjyhj;
|
||||||
|
/**
|
||||||
|
* 累计赡养老人合计
|
||||||
|
*/
|
||||||
|
private String ljsylrhj;
|
||||||
|
/**
|
||||||
|
* 累计住房贷款利息合计
|
||||||
|
*/
|
||||||
|
private String ljzfdklxhj;
|
||||||
|
/**
|
||||||
|
* 累计住房租金合计
|
||||||
|
*/
|
||||||
|
private String ljzfzjhj;
|
||||||
|
/**
|
||||||
|
* 累计继续教育合计
|
||||||
|
*/
|
||||||
|
private String ljjxjyhj;
|
||||||
|
/**
|
||||||
|
* 累计3岁以下婴幼儿照护支出合计
|
||||||
|
*/
|
||||||
|
private String ljyyezhzchj;
|
||||||
|
/**
|
||||||
|
* 累计其他扣除合计
|
||||||
|
*/
|
||||||
|
private String ljqtkchj;
|
||||||
|
/**
|
||||||
|
* 累计准予扣除的捐赠额合计
|
||||||
|
*/
|
||||||
|
private String ljzykcjzehj;
|
||||||
|
/**
|
||||||
|
* 累计个人养老金合计
|
||||||
|
*/
|
||||||
|
private String ljgryljhj;
|
||||||
|
/**
|
||||||
|
* 应纳税所得额合计
|
||||||
|
*/
|
||||||
|
private String ynssdehj;
|
||||||
|
/**
|
||||||
|
* 应纳税额合计
|
||||||
|
*/
|
||||||
|
private String ynsehj;
|
||||||
|
/**
|
||||||
|
* 减免税额合计
|
||||||
|
*/
|
||||||
|
private String jmsehj;
|
||||||
|
/**
|
||||||
|
* 已扣缴税额合计
|
||||||
|
*/
|
||||||
|
private String ykjsehj;
|
||||||
|
/**
|
||||||
|
* 应补退税额合计
|
||||||
|
*/
|
||||||
|
private String ybtsehj;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,28 +2,28 @@ package com.engine.salary.entity.datacollection.response;
|
||||||
|
|
||||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员专项附加扣除信息查询结果
|
* 人员专项附加扣除信息查询结果
|
||||||
* <p>Copyright: Copyright (c) 2023</p>
|
|
||||||
* <p>Company: 泛微软件</p>
|
|
||||||
*
|
*
|
||||||
* @author qiantao
|
* @author qiantao
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class QuerySpecialAmountResponse extends BaseResponse {
|
public class QuerySpecialAmountResponse extends BaseResponse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回数据
|
* 返回数据
|
||||||
*/
|
*/
|
||||||
private QuerySpecialAmountBody body;
|
private Body body;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员专项附加扣除信息查询结果body
|
* 人员专项附加扣除信息查询结果body
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public static class QuerySpecialAmountBody {
|
public static class Body {
|
||||||
/**
|
/**
|
||||||
* 请求查询ID
|
* 请求查询ID
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -219,4 +219,5 @@ public class EmployeeDeclarePO {
|
||||||
|
|
||||||
private Collection<Long> ids;
|
private Collection<Long> ids;
|
||||||
private Collection<Long> employeeIds;
|
private Collection<Long> employeeIds;
|
||||||
|
private Collection<Long> taxAgentIds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.engine.salary.entity.salaryacct.po;
|
package com.engine.salary.entity.salaryacct.po;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,7 +17,10 @@ import java.util.Date;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
// "hrsa_acct_tax_agent")
|
// "hrsa_acct_tax_agent")
|
||||||
public class SalaryAcctTaxAgentPO {
|
public class SalaryAcctTaxAgentPO {
|
||||||
|
|
||||||
|
|
@ -67,10 +72,15 @@ public class SalaryAcctTaxAgentPO {
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Date startMonth;
|
||||||
|
private Date endMonth;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ public class TaxAgentTaxReturnPO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
//查询条件
|
//查询条件
|
||||||
|
private Collection<Long> ids;
|
||||||
private Collection<Long> taxAgentIds;
|
private Collection<Long> taxAgentIds;
|
||||||
private Collection<String> taxCodes;
|
private Collection<String> taxCodes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.engine.salary.enums.datacollection;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计附加扣除请求外部接口处理状态
|
||||||
|
*
|
||||||
|
* @author chengliming
|
||||||
|
* @date 2021-10-26 16:50:52
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("squid:S00115")
|
||||||
|
public enum EnumAddUpDeductionRequestStatus {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待处理(废弃)
|
||||||
|
*/
|
||||||
|
READY(10),
|
||||||
|
/**
|
||||||
|
* 处理中
|
||||||
|
*/
|
||||||
|
RUNNING(20),
|
||||||
|
/**
|
||||||
|
* 已完成
|
||||||
|
*/
|
||||||
|
COMPLETED(99),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
|
||||||
|
private static final Map<Integer, String> VALUE_NAME_MAP;
|
||||||
|
|
||||||
|
static {
|
||||||
|
final EnumAddUpDeductionRequestStatus[] values = EnumAddUpDeductionRequestStatus.values();
|
||||||
|
VALUE_NAME_MAP = new HashMap<>(values.length);
|
||||||
|
for (EnumAddUpDeductionRequestStatus value : values) {
|
||||||
|
VALUE_NAME_MAP.put(value.getValue(), value.name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumAddUpDeductionRequestStatus(Integer value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(int index) {
|
||||||
|
return VALUE_NAME_MAP.get(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.engine.salary.mapper.datacollection;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AddUpDeductionRequestFailMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有记录
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<AddUpDeductionRequestFailPO> listAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<AddUpDeductionRequestFailPO> listSome(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主键查询
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 返回记录,没有返回null
|
||||||
|
*/
|
||||||
|
AddUpDeductionRequestFailPO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增,忽略null字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionReqFail 新增的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int insertIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
void batchInsert(@Param("collection") Collection<AddUpDeductionRequestFailPO> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,修改所有字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionReqFail 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int update(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,忽略null字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionReqFail 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int updateIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除记录
|
||||||
|
*
|
||||||
|
* @param addUpDeductionReqFail 待删除的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int delete(AddUpDeductionRequestFailPO addUpDeductionReqFail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除记录
|
||||||
|
* @param ids 主键id集合
|
||||||
|
*/
|
||||||
|
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,384 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.engine.salary.mapper.datacollection.AddUpDeductionRequestFailMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="creator" property="creator"/>
|
||||||
|
<result column="delete_type" property="deleteType"/>
|
||||||
|
<result column="employee_id" property="employeeId"/>
|
||||||
|
<result column="employee_type" property="employeeType"/>
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="outer_request_id" property="outerRequestId"/>
|
||||||
|
<result column="reason" property="reason"/>
|
||||||
|
<result column="request_id" property="requestId"/>
|
||||||
|
<result column="tax_agent_id" property="taxAgentId"/>
|
||||||
|
<result column="tax_year_month" property="taxYearMonth"/>
|
||||||
|
<result column="tenant_key" property="tenantKey"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 表字段 -->
|
||||||
|
<sql id="baseColumns">
|
||||||
|
t
|
||||||
|
.
|
||||||
|
create_time
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.employee_id
|
||||||
|
, t.employee_type
|
||||||
|
, t.id
|
||||||
|
, t.outer_request_id
|
||||||
|
, t.reason
|
||||||
|
, t.request_id
|
||||||
|
, t.tax_agent_id
|
||||||
|
, t.tax_year_month
|
||||||
|
, t.tenant_key
|
||||||
|
, t.update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="listAll" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_req_fail t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据主键获取单条记录 -->
|
||||||
|
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_req_fail t
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 条件查询 -->
|
||||||
|
<select id="listSome" resultMap="BaseResultMap"
|
||||||
|
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_req_fail t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<if test="createTime != null">
|
||||||
|
AND create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
AND creator = #{creator}
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
AND delete_type = #{deleteType}
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
AND employee_id = #{employeeId}
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
AND employee_type = #{employeeType}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
AND outer_request_id = #{outerRequestId}
|
||||||
|
</if>
|
||||||
|
<if test="reason != null">
|
||||||
|
AND reason = #{reason}
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
AND request_id = #{requestId}
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
AND tax_agent_id = #{taxAgentId}
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
AND tax_year_month = #{taxYearMonth}
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
AND tenant_key = #{tenantKey}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
AND update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
<if test="ids != null and ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 插入不为NULL的字段 -->
|
||||||
|
<insert id="insertIgnoreNull"
|
||||||
|
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_req_fail
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
creator,
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type,
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
employee_id,
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
employee_type,
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
outer_request_id,
|
||||||
|
</if>
|
||||||
|
<if test="reason != null">
|
||||||
|
reason,
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
request_id,
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
tax_agent_id,
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
tax_year_month,
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
tenant_key,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
#{employeeId},
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
#{employeeType},
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
#{outerRequestId},
|
||||||
|
</if>
|
||||||
|
<if test="reason != null">
|
||||||
|
#{reason},
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
#{requestId},
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
#{taxYearMonth},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="batchInsert">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||||
|
request_id,
|
||||||
|
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||||
|
outer_request_id)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="collection" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.id},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.employeeId},
|
||||||
|
#{item.employeeType},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.reason},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.outerRequestId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsert" databaseId="postgresql">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||||
|
request_id,
|
||||||
|
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||||
|
outer_request_id)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="collection" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.id},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.employeeId},
|
||||||
|
#{item.employeeType},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.reason},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.outerRequestId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsert" databaseId="oracle">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||||
|
request_id,
|
||||||
|
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||||
|
outer_request_id)
|
||||||
|
|
||||||
|
<foreach collection="collection" item="item" separator="union all">
|
||||||
|
select
|
||||||
|
#{item.id},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.employeeId},
|
||||||
|
#{item.employeeType},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.reason},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.outerRequestId}
|
||||||
|
from dual
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<insert id="batchInsert" databaseId="sqlserver">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_req_fail (id, create_time, update_time, creator, delete_type, tenant_key,
|
||||||
|
request_id,
|
||||||
|
employee_id, employee_type, tax_agent_id, reason, tax_year_month,
|
||||||
|
outer_request_id)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="collection" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.id},
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.updateTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.employeeId},
|
||||||
|
#{item.employeeType},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.reason},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.outerRequestId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 更新,更新全部字段 -->
|
||||||
|
<update id="update" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||||
|
UPDATE hrsa_add_up_deduction_req_fail
|
||||||
|
<set>
|
||||||
|
create_time=#{createTime},
|
||||||
|
creator=#{creator},
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
employee_id=#{employeeId},
|
||||||
|
employee_type=#{employeeType},
|
||||||
|
outer_request_id=#{outerRequestId},
|
||||||
|
reason=#{reason},
|
||||||
|
request_id=#{requestId},
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
tax_year_month=#{taxYearMonth},
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 更新不为NULL的字段 -->
|
||||||
|
<update id="updateIgnoreNull"
|
||||||
|
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO">
|
||||||
|
UPDATE hrsa_add_up_deduction_req_fail
|
||||||
|
<set>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time=#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
creator=#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="employeeId != null">
|
||||||
|
employee_id=#{employeeId},
|
||||||
|
</if>
|
||||||
|
<if test="employeeType != null">
|
||||||
|
employee_type=#{employeeType},
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
outer_request_id=#{outerRequestId},
|
||||||
|
</if>
|
||||||
|
<if test="reason != null">
|
||||||
|
reason=#{reason},
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
request_id=#{requestId},
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
tax_year_month=#{taxYearMonth},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 根据主键删除记录 -->
|
||||||
|
<delete id="delete">
|
||||||
|
UPDATE hrsa_add_up_deduction_req_fail
|
||||||
|
SET delete_type=1
|
||||||
|
WHERE id = #{id}
|
||||||
|
AND delete_type = 0
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
UPDATE hrsa_add_up_deduction_req_fail
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.engine.salary.mapper.datacollection;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AddUpDeductionRequestMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有记录
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<AddUpDeductionRequestPO> listAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
*
|
||||||
|
* @return 返回集合,没有返回空List
|
||||||
|
*/
|
||||||
|
List<AddUpDeductionRequestPO> listSome(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主键查询
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 返回记录,没有返回null
|
||||||
|
*/
|
||||||
|
AddUpDeductionRequestPO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增,忽略null字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionRequest 新增的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int insertIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param addUpDeductionRequest
|
||||||
|
*/
|
||||||
|
void batchInsert(@Param("collection") List<AddUpDeductionRequestPO> addUpDeductionRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,修改所有字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionRequest 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int update(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改,忽略null字段
|
||||||
|
*
|
||||||
|
* @param addUpDeductionRequest 修改的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int updateIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除记录
|
||||||
|
*
|
||||||
|
* @param addUpDeductionRequest 待删除的记录
|
||||||
|
* @return 返回影响行数
|
||||||
|
*/
|
||||||
|
int delete(AddUpDeductionRequestPO addUpDeductionRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除记录
|
||||||
|
* @param ids 主键id集合
|
||||||
|
*/
|
||||||
|
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||||
|
|
||||||
|
int updateRequestStatusLockVersion(AddUpDeductionRequestPO build);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,388 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.engine.salary.mapper.datacollection.AddUpDeductionRequestMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="creator" property="creator"/>
|
||||||
|
<result column="delete_type" property="deleteType"/>
|
||||||
|
<result column="id" property="id"/>
|
||||||
|
<result column="lock_version" property="lockVersion"/>
|
||||||
|
<result column="outer_request_id" property="outerRequestId"/>
|
||||||
|
<result column="request_id" property="requestId"/>
|
||||||
|
<result column="request_status" property="requestStatus"/>
|
||||||
|
<result column="tax_agent_id" property="taxAgentId"/>
|
||||||
|
<result column="tax_year_month" property="taxYearMonth"/>
|
||||||
|
<result column="tenant_key" property="tenantKey"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 表字段 -->
|
||||||
|
<sql id="baseColumns">
|
||||||
|
t
|
||||||
|
.
|
||||||
|
create_time
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.id
|
||||||
|
, t.lock_version
|
||||||
|
, t.outer_request_id
|
||||||
|
, t.request_id
|
||||||
|
, t.request_status
|
||||||
|
, t.tax_agent_id
|
||||||
|
, t.tax_year_month
|
||||||
|
, t.tenant_key
|
||||||
|
, t.update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="listAll" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_request t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据主键获取单条记录 -->
|
||||||
|
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_request t
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 条件查询 -->
|
||||||
|
<select id="listSome" resultMap="BaseResultMap"
|
||||||
|
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
SELECT
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
FROM hrsa_add_up_deduction_request t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
<if test="createTime != null">
|
||||||
|
AND create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
AND creator = #{creator}
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
AND delete_type = #{deleteType}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="lockVersion != null">
|
||||||
|
AND lock_version = #{lockVersion}
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
AND outer_request_id = #{outerRequestId}
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
AND request_id = #{requestId}
|
||||||
|
</if>
|
||||||
|
<if test="requestStatus != null">
|
||||||
|
AND request_status = #{requestStatus}
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
AND tax_agent_id = #{taxAgentId}
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
AND tax_year_month = #{taxYearMonth}
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
AND tenant_key = #{tenantKey}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
AND update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
<if test="ids != null and ids.size()>0">
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 插入不为NULL的字段 -->
|
||||||
|
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_request
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
creator,
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type,
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="lockVersion != null">
|
||||||
|
lock_version,
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
outer_request_id,
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
request_id,
|
||||||
|
</if>
|
||||||
|
<if test="requestStatus != null">
|
||||||
|
request_status,
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
tax_agent_id,
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
tax_year_month,
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
tenant_key,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="lockVersion != null">
|
||||||
|
#{lockVersion},
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
#{outerRequestId},
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
#{requestId},
|
||||||
|
</if>
|
||||||
|
<if test="requestStatus != null">
|
||||||
|
#{requestStatus},
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
#{taxYearMonth},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="batchInsert">
|
||||||
|
|
||||||
|
INSERT INTO hrsa_add_up_deduction_request
|
||||||
|
(
|
||||||
|
create_time,
|
||||||
|
creator,
|
||||||
|
delete_type,
|
||||||
|
id,
|
||||||
|
lock_version,
|
||||||
|
outer_request_id,
|
||||||
|
request_id,
|
||||||
|
request_status,
|
||||||
|
tax_agent_id,
|
||||||
|
tax_year_month,
|
||||||
|
tenant_key,
|
||||||
|
update_time
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
<foreach collection="collection" item="item" separator=",">
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.id},
|
||||||
|
#{item.lockVersion},
|
||||||
|
#{item.outerRequestId},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.requestStatus},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.updateTime}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="batchInsert" databaseId="oracle">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_request (
|
||||||
|
create_time,
|
||||||
|
creator,
|
||||||
|
delete_type,
|
||||||
|
id,
|
||||||
|
lock_version,
|
||||||
|
outer_request_id,
|
||||||
|
request_id,
|
||||||
|
request_status,
|
||||||
|
tax_agent_id,
|
||||||
|
tax_year_month,
|
||||||
|
tenant_key,
|
||||||
|
update_time
|
||||||
|
)
|
||||||
|
<foreach collection="collection" item="item" separator="union all">
|
||||||
|
select
|
||||||
|
#{item.createTime,jdbcType=DATE},
|
||||||
|
#{item.creator,jdbcType=DOUBLE},
|
||||||
|
#{item.deleteType,jdbcType=INTEGER},
|
||||||
|
#{item.id,jdbcType=DOUBLE},
|
||||||
|
#{item.lockVersion,jdbcType=INTEGER},
|
||||||
|
#{item.outerRequestId,jdbcType=DOUBLE},
|
||||||
|
#{item.requestId,jdbcType=DOUBLE},
|
||||||
|
#{item.requestStatus,jdbcType=INTEGER},
|
||||||
|
#{item.taxAgentId,jdbcType=DOUBLE},
|
||||||
|
#{item.taxYearMonth,jdbcType=DATE},
|
||||||
|
#{item.tenantKey,jdbcType=VARCHAR},
|
||||||
|
#{item.updateTime,jdbcType=DATE}
|
||||||
|
from dual
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="batchInsert" databaseId="sqlserver">
|
||||||
|
<foreach collection="collection" item="item" separator=";">
|
||||||
|
INSERT INTO hrsa_add_up_deduction_request (
|
||||||
|
create_time,
|
||||||
|
creator,
|
||||||
|
delete_type,
|
||||||
|
id,
|
||||||
|
lock_version,
|
||||||
|
outer_request_id,
|
||||||
|
request_id,
|
||||||
|
request_status,
|
||||||
|
tax_agent_id,
|
||||||
|
tax_year_month,
|
||||||
|
tenant_key,
|
||||||
|
update_time
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{item.createTime},
|
||||||
|
#{item.creator},
|
||||||
|
#{item.deleteType},
|
||||||
|
#{item.id},
|
||||||
|
#{item.lockVersion},
|
||||||
|
#{item.outerRequestId},
|
||||||
|
#{item.requestId},
|
||||||
|
#{item.requestStatus},
|
||||||
|
#{item.taxAgentId},
|
||||||
|
#{item.taxYearMonth},
|
||||||
|
#{item.tenantKey},
|
||||||
|
#{item.updateTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 更新,更新全部字段 -->
|
||||||
|
<update id="update" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
UPDATE hrsa_add_up_deduction_request
|
||||||
|
<set>
|
||||||
|
create_time=#{createTime},
|
||||||
|
creator=#{creator},
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
lock_version=#{lockVersion},
|
||||||
|
outer_request_id=#{outerRequestId},
|
||||||
|
request_id=#{requestId},
|
||||||
|
request_status=#{requestStatus},
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
tax_year_month=#{taxYearMonth},
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 更新不为NULL的字段 -->
|
||||||
|
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
UPDATE hrsa_add_up_deduction_request
|
||||||
|
<set>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time=#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="creator != null">
|
||||||
|
creator=#{creator},
|
||||||
|
</if>
|
||||||
|
<if test="deleteType != null">
|
||||||
|
delete_type=#{deleteType},
|
||||||
|
</if>
|
||||||
|
<if test="lockVersion != null">
|
||||||
|
lock_version=#{lockVersion},
|
||||||
|
</if>
|
||||||
|
<if test="outerRequestId != null">
|
||||||
|
outer_request_id=#{outerRequestId},
|
||||||
|
</if>
|
||||||
|
<if test="requestId != null">
|
||||||
|
request_id=#{requestId},
|
||||||
|
</if>
|
||||||
|
<if test="requestStatus != null">
|
||||||
|
request_status=#{requestStatus},
|
||||||
|
</if>
|
||||||
|
<if test="taxAgentId != null">
|
||||||
|
tax_agent_id=#{taxAgentId},
|
||||||
|
</if>
|
||||||
|
<if test="taxYearMonth != null">
|
||||||
|
tax_year_month=#{taxYearMonth},
|
||||||
|
</if>
|
||||||
|
<if test="tenantKey != null">
|
||||||
|
tenant_key=#{tenantKey},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id} AND delete_type = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 根据主键删除记录 -->
|
||||||
|
<delete id="delete">
|
||||||
|
UPDATE hrsa_add_up_deduction_request
|
||||||
|
SET delete_type=1
|
||||||
|
WHERE id = #{id}
|
||||||
|
AND delete_type = 0
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
UPDATE hrsa_add_up_deduction_request
|
||||||
|
SET delete_type = 1
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND id IN
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateRequestStatusLockVersion"
|
||||||
|
parameterType="com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO">
|
||||||
|
UPDATE hrsa_add_up_deduction_request
|
||||||
|
<set>
|
||||||
|
request_status=#{requestStatus},
|
||||||
|
lock_version=#{lockVersion},
|
||||||
|
update_time=#{updateTime},
|
||||||
|
</set>
|
||||||
|
WHERE delete_type = 0
|
||||||
|
AND request_status=#{oldStatus}
|
||||||
|
AND lock_version=#{oldLockVersion}
|
||||||
|
AND id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -202,6 +202,12 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="taxAgentIds != null and taxAgentIds.size()>0">
|
||||||
|
AND tax_agent_id IN
|
||||||
|
<foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
||||||
|
#{taxAgentId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.engine.salary.mapper.salaryacct;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 薪资核算记录对应的个税扣缴义务人
|
||||||
|
* @author: xiajun
|
||||||
|
* @modified By: xiajun
|
||||||
|
* @date: Created in 2022/11/22 1:47 PM
|
||||||
|
* @version:v1.0
|
||||||
|
*/
|
||||||
|
public interface SalaryAcctTaxAgentMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取核算记录和扣缴义务人对应关系
|
||||||
|
* @param salaryAcctIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SalaryAcctTaxAgentPO> listAcctTaxAgent(@Param("salaryAcctRecordIds") Collection<Long> salaryAcctIds);
|
||||||
|
|
||||||
|
List<SalaryAcctTaxAgentPO> listByTaxCycleRange(SalaryAcctTaxAgentPO queryWrapper);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.engine.salary.mapper.salaryacct.SalaryAcctTaxAgentMapper">
|
||||||
|
<select id="listAcctTaxAgent" resultType="com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO">
|
||||||
|
select record.id as salaryAcctRecordId,
|
||||||
|
sob.income_category as incomeCategory,
|
||||||
|
sob.tax_agent_id as taxAgentId,
|
||||||
|
record.salary_month as salaryMonth,
|
||||||
|
record.tax_cycle as taxCycle
|
||||||
|
FROM hrsa_salary_acct_record record
|
||||||
|
left join hrsa_salary_sob sob
|
||||||
|
on record.salary_sob_id = sob.id
|
||||||
|
where record.delete_type = 0 and sob.delete_type = 0
|
||||||
|
<if test="salaryAcctRecordIds != null and salaryAcctRecordIds.size()>0">
|
||||||
|
AND record.id IN
|
||||||
|
<foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||||
|
#{salaryAcctRecordId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listByTaxCycleRange" resultType="com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO">
|
||||||
|
select record.id as salaryAcctRecordId,
|
||||||
|
sob.income_category as incomeCategory,
|
||||||
|
sob.tax_agent_id as taxAgentId,
|
||||||
|
record.salary_month as salaryMonth,
|
||||||
|
record.tax_cycle as taxCycle
|
||||||
|
FROM hrsa_salary_acct_record record
|
||||||
|
left join hrsa_salary_sob sob
|
||||||
|
on record.salary_sob_id = sob.id
|
||||||
|
where record.delete_type = 0 and sob.delete_type = 0
|
||||||
|
<if test="startMonth != null">
|
||||||
|
AND record.tax_cycle >=#{startMonth}
|
||||||
|
</if>
|
||||||
|
<if test="endMonth != null">
|
||||||
|
AND record.tax_cycle <=#{endMonth}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -3,10 +3,10 @@ package com.engine.salary.service;
|
||||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||||
import com.engine.salary.util.page.PageInfo;
|
import com.engine.salary.util.page.PageInfo;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
|
@ -157,4 +157,43 @@ public interface AddUpDeductionService {
|
||||||
* @author lfc
|
* @author lfc
|
||||||
*/
|
*/
|
||||||
String autoAddAll(Date yearMonth, Boolean isAdmin);
|
String autoAddAll(Date yearMonth, Boolean isAdmin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取数据
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取结果查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AddUpDeductionRequestResultDTO onlineFeedback();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取失败记录
|
||||||
|
*
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<AddUpDeductionRequestFailListDTO> onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取反馈失败记录
|
||||||
|
*
|
||||||
|
* @param requestId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AddUpDeductionRequestFailPO> getAddUpDeductionRequestFailPOList(Long requestId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出反馈失败记录
|
||||||
|
*
|
||||||
|
* @param requestId
|
||||||
|
*/
|
||||||
|
XSSFWorkbook exportOnlineFeedbackFail(Long requestId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,4 +112,12 @@ public interface AddUpSituationService {
|
||||||
* @date 2022/10/31 14:00
|
* @date 2022/10/31 14:00
|
||||||
*/
|
*/
|
||||||
AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam);
|
AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取实际累计已预扣预缴税额
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,13 @@ public interface SalaryAcctRecordService {
|
||||||
*/
|
*/
|
||||||
Long save(SalaryAcctRecordSaveParam saveParam);
|
Long save(SalaryAcctRecordSaveParam saveParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存之前检查一下是否可以新建核算
|
||||||
|
*
|
||||||
|
* @param salaryAcctTaxAgents
|
||||||
|
*/
|
||||||
|
void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新薪资核算记录的状态
|
* 更新薪资核算记录的状态
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.engine.salary.service;
|
package com.engine.salary.service;
|
||||||
|
|
||||||
import com.engine.salary.common.YearMonthRange;
|
import com.engine.salary.common.YearMonthRange;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -33,25 +32,25 @@ public interface SalaryAcctTaxAgentService {
|
||||||
*/
|
*/
|
||||||
List<SalaryAcctTaxAgentPO> listByTaxCycleRange(YearMonthRange taxCycleRange);
|
List<SalaryAcctTaxAgentPO> listByTaxCycleRange(YearMonthRange taxCycleRange);
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 根据薪资核算人员初始化
|
// * 根据薪资核算人员初始化
|
||||||
*
|
// *
|
||||||
* @param salaryAcctEmployees
|
// * @param salaryAcctEmployees
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
List<SalaryAcctTaxAgentPO> initBySalaryAcctEmployees(List<SalaryAcctEmployeePO> salaryAcctEmployees);
|
// List<SalaryAcctTaxAgentPO> initBySalaryAcctEmployees(List<SalaryAcctEmployeePO> salaryAcctEmployees);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 批量保存
|
// * 批量保存
|
||||||
*
|
// *
|
||||||
* @param salaryAcctTaxAgents
|
// * @param salaryAcctTaxAgents
|
||||||
*/
|
// */
|
||||||
void batchSave(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents);
|
// void batchSave(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents);
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 根据薪资核算记录id删除关联的个税扣缴义务人
|
// * 根据薪资核算记录id删除关联的个税扣缴义务人
|
||||||
*
|
// *
|
||||||
* @param salaryAcctRecordIds
|
// * @param salaryAcctRecordIds
|
||||||
*/
|
// */
|
||||||
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
|
// void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -240,4 +240,6 @@ public interface SalaryArchiveService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SalaryArchivePO> listPayEndDateIsNull(List<Long> employeeIds);
|
List<SalaryArchivePO> listPayEndDateIsNull(List<Long> employeeIds);
|
||||||
|
|
||||||
|
List<SalaryArchivePO> listByRunStatus(List<String> asList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.service;
|
package com.engine.salary.service;
|
||||||
|
|
||||||
|
import com.engine.salary.common.YearMonthRange;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||||
|
|
@ -59,4 +60,14 @@ public interface TaxDeclarationService {
|
||||||
void deleteByTaxDeclareRecordIds(Collection<Long> taxDeclareRecordIds);
|
void deleteByTaxDeclareRecordIds(Collection<Long> taxDeclareRecordIds);
|
||||||
|
|
||||||
void saveBatch(List<TaxDeclarationPO> taxDeclarations);
|
void saveBatch(List<TaxDeclarationPO> taxDeclarations);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据税款所属期查询个税申报表
|
||||||
|
*
|
||||||
|
* @param yearMonthRange
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TaxDeclarationPO> listByTaxCycleRange(YearMonthRange yearMonthRange);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
String requestId = Optional.ofNullable(queryResponse)
|
String requestId = Optional.ofNullable(queryResponse)
|
||||||
.map(QuerySpecialAmountResponse::getBody)
|
.map(QuerySpecialAmountResponse::getBody)
|
||||||
.map(QuerySpecialAmountResponse.QuerySpecialAmountBody::getRequestId)
|
.map(QuerySpecialAmountResponse.Body::getRequestId)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) {
|
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) {
|
||||||
log.info("getAsyncQueryResponse4Payment code error:{}", JSON.toJSONString(queryResponse));
|
log.info("getAsyncQueryResponse4Payment code error:{}", JSON.toJSONString(queryResponse));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.api.browser.bean.SearchConditionGroup;
|
import com.api.browser.bean.SearchConditionGroup;
|
||||||
import com.api.browser.bean.SearchConditionItem;
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
import com.api.browser.util.ConditionFactory;
|
import com.api.browser.util.ConditionFactory;
|
||||||
|
|
@ -11,35 +12,57 @@ import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.biz.AddUpDeductionBiz;
|
import com.engine.salary.biz.AddUpDeductionBiz;
|
||||||
import com.engine.salary.common.LocalDateRange;
|
import com.engine.salary.common.LocalDateRange;
|
||||||
|
import com.engine.salary.constant.SzyhApiConstant;
|
||||||
import com.engine.salary.encrypt.EncryptUtil;
|
import com.engine.salary.encrypt.EncryptUtil;
|
||||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.datacollection.bo.DataCollectionBO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||||
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||||
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
||||||
|
import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse;
|
||||||
|
import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse;
|
||||||
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
|
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||||
|
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
|
||||||
|
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
||||||
|
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
||||||
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
import com.engine.salary.enums.datacollection.EnumAddUpDeductionRequestStatus;
|
||||||
|
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||||
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||||
|
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||||
|
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
|
||||||
|
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||||
|
import com.engine.salary.mapper.datacollection.AddUpDeductionRequestFailMapper;
|
||||||
|
import com.engine.salary.mapper.datacollection.AddUpDeductionRequestMapper;
|
||||||
|
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
|
||||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||||
|
import com.engine.salary.report.enums.EmployeeTypeEnum;
|
||||||
import com.engine.salary.service.*;
|
import com.engine.salary.service.*;
|
||||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||||
import com.engine.salary.sys.service.SalarySysConfService;
|
import com.engine.salary.sys.service.SalarySysConfService;
|
||||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||||
import com.engine.salary.util.SalaryDateUtil;
|
import com.engine.salary.util.*;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
|
||||||
import com.engine.salary.util.SalaryI18nUtil;
|
|
||||||
import com.engine.salary.util.db.MapperProxyFactory;
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
import com.engine.salary.util.excel.ExcelComment;
|
import com.engine.salary.util.excel.ExcelComment;
|
||||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||||
|
|
@ -48,6 +71,9 @@ import com.engine.salary.util.page.PageInfo;
|
||||||
import com.engine.salary.util.page.SalaryPageUtil;
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import dm.jdbc.util.IdGenerator;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
@ -61,6 +87,8 @@ import java.io.InputStream;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||||
|
|
@ -73,6 +101,7 @@ import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TEN
|
||||||
* @author qiantao
|
* @author qiantao
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
**/
|
**/
|
||||||
|
@Slf4j
|
||||||
public class AddUpDeductionServiceImpl extends Service implements AddUpDeductionService {
|
public class AddUpDeductionServiceImpl extends Service implements AddUpDeductionService {
|
||||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||||
|
|
||||||
|
|
@ -108,6 +137,38 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
return ServiceUtil.getService(SpecialAddDeductionServiceImpl.class, user);
|
return ServiceUtil.getService(SpecialAddDeductionServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private EmployeeDeclareMapper getEmployeeDeclareMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddUpDeductionRequestMapper getAddUpDeductionRequestMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(AddUpDeductionRequestMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddUpDeductionRequestFailMapper getAddUpDeductionRequestFailMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(AddUpDeductionRequestFailMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExtEmpService getExtEmpService(User user) {
|
||||||
|
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||||
|
|
@ -410,7 +471,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
throw new SalaryRunTimeException("该数据不存在!");
|
throw new SalaryRunTimeException("该数据不存在!");
|
||||||
}
|
}
|
||||||
Long taxAgentId = byId.getTaxAgentId();
|
Long taxAgentId = byId.getTaxAgentId();
|
||||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId));
|
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId));
|
||||||
if (!canEdit) {
|
if (!canEdit) {
|
||||||
//没有编辑权限
|
//没有编辑权限
|
||||||
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
||||||
|
|
@ -440,7 +501,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
|
|
||||||
//税款所属期
|
//税款所属期
|
||||||
String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth();
|
String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth();
|
||||||
if (declareMonthStr .equals("")) {
|
if (declareMonthStr.equals("")) {
|
||||||
throw new SalaryRunTimeException("税款所属期不能为空!");
|
throw new SalaryRunTimeException("税款所属期不能为空!");
|
||||||
}
|
}
|
||||||
// 获取所有个税扣缴义务人
|
// 获取所有个税扣缴义务人
|
||||||
|
|
@ -468,7 +529,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
.updateTime(now)
|
.updateTime(now)
|
||||||
.creator((long) user.getUID())
|
.creator((long) user.getUID())
|
||||||
.declareMonth(declareMonth).build();
|
.declareMonth(declareMonth).build();
|
||||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpDeductionRecordParam.getEmployeeId()));
|
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpDeductionRecordParam.getEmployeeId()));
|
||||||
if (!employeeSameId) {
|
if (!employeeSameId) {
|
||||||
throw new SalaryRunTimeException("员工信息不存在");
|
throw new SalaryRunTimeException("员工信息不存在");
|
||||||
}
|
}
|
||||||
|
|
@ -552,7 +613,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
||||||
}
|
}
|
||||||
// 判断是否在个税扣缴义务人范围内
|
// 判断是否在个税扣缴义务人范围内
|
||||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst();
|
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst();
|
||||||
if (!first.isPresent()) {
|
if (!first.isPresent()) {
|
||||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||||
}
|
}
|
||||||
|
|
@ -587,7 +648,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) {
|
if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) {
|
||||||
// 设置了个税扣缴义务人
|
// 设置了个税扣缴义务人
|
||||||
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
||||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId));
|
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId));
|
||||||
if (!canDelete) {
|
if (!canDelete) {
|
||||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
||||||
}
|
}
|
||||||
|
|
@ -636,12 +697,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
@Override
|
@Override
|
||||||
public String autoAddAll(Date yearMonth, Boolean isAdmin) {
|
public String autoAddAll(Date yearMonth, Boolean isAdmin) {
|
||||||
String cacheKey = "addUpDeduction_autoAddAll_processing";
|
String cacheKey = "addUpDeduction_autoAddAll_processing";
|
||||||
Object objVal = Util_DataCache.getObjVal( cacheKey);
|
Object objVal = Util_DataCache.getObjVal(cacheKey);
|
||||||
if(objVal != null){
|
if (objVal != null) {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试"));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Util_DataCache.setObjVal(cacheKey,true );
|
Util_DataCache.setObjVal(cacheKey, true);
|
||||||
//如果是定时任务直接查询所有,isAdmin传true
|
//如果是定时任务直接查询所有,isAdmin传true
|
||||||
boolean isChief = Boolean.TRUE.equals(isAdmin)
|
boolean isChief = Boolean.TRUE.equals(isAdmin)
|
||||||
|| getTaxAgentService(user).isChief((long) user.getUID());
|
|| getTaxAgentService(user).isChief((long) user.getUID());
|
||||||
|
|
@ -969,7 +1030,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
if (getTaxAgentService(user).isOpenDevolution() && !isChief) {
|
if (getTaxAgentService(user).isOpenDevolution() && !isChief) {
|
||||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
|
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
|
||||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||||
// List<AddUpDeduction> lastList = getLastListByModifier(employeeId, tenantKey);
|
// List<AddUpDeduction> lastList = getLastListByModifier(employeeId);
|
||||||
list = list.stream().filter(f ->
|
list = list.stream().filter(f ->
|
||||||
// 作为管理员
|
// 作为管理员
|
||||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||||
|
|
@ -1200,4 +1261,487 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "税款所属期必传"));
|
||||||
|
// 获取接口配置
|
||||||
|
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
|
||||||
|
// 获取包装类
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig);
|
||||||
|
// 获取报税信息
|
||||||
|
List<TaxAgentTaxReturnPO> taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet());
|
||||||
|
List<TaxAgentTaxReturnPO> failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList());
|
||||||
|
SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "企业未通过验证,暂时无法获取累计专项附加扣除数据,请先在【个税扣缴义务人】菜单验证企业报税信息"));
|
||||||
|
Map<String, Object> result = new HashMap<>(1);
|
||||||
|
if (!failReturnPOList.isEmpty()) {
|
||||||
|
String failTaxAgentNames = failReturnPOList.stream().map(e -> requestWrapper.getTaxAgentMap().get(e.getTaxAgentId())).collect(Collectors.joining("、"));
|
||||||
|
result.put("msg", String.format(SalaryI18nUtil.getI18nLabel(183782, "%s未通过登记验证,无法在线获取数据"), failTaxAgentNames));
|
||||||
|
}
|
||||||
|
// 获取请求
|
||||||
|
List<AddUpDeductionRequestPO> requestPOList = getAddUpDeductionRequestPOS();
|
||||||
|
SalaryAssert.isEmpty(requestPOList, SalaryI18nUtil.getI18nLabel(153341, "获取中,稍后请点击【获取结果下载】"));
|
||||||
|
// 获取报送成功的人员名单
|
||||||
|
Map<Long, List<EmployeeDeclarePO>> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth());
|
||||||
|
// 开始请求接口获取数据
|
||||||
|
List<QuerySpecialAmountResponse.Body> querySpecialAmountBodies = getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList);
|
||||||
|
// 持久化数据
|
||||||
|
persistFeedbackData(param, querySpecialAmountBodies);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddUpDeductionOnlineRequestWrapper getAddUpDeductionOnlineRequestWrapper(List<AddUpDeductionRequestPO> requestPOList, TaxDeclarationApiConfigPO apiConfig) {
|
||||||
|
boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||||
|
long employeeId = (long) user.getUID();
|
||||||
|
boolean isChief = getTaxAgentService(user).isChief(employeeId);
|
||||||
|
List<TaxAgentPO> taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List<TaxAgentPO>) getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||||
|
List<Long> taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList());
|
||||||
|
// 获取薪资档案
|
||||||
|
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList(
|
||||||
|
SalaryArchiveStatusEnum.FIXED.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.SUSPEND.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|
||||||
|
);
|
||||||
|
salaryArchiveList = salaryArchiveList.stream().filter(e -> taxAgentIdSet.contains(e.getTaxAgentId())).collect(Collectors.toList());
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents, (long) user.getUID());
|
||||||
|
requestWrapper.setApiConfig(apiConfig);
|
||||||
|
return requestWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, List<EmployeeDeclarePO>> getEmpDeclareMap(Collection<Long> taxAgentIds, Date declareMonth) {
|
||||||
|
List<EmployeeDeclarePO> employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth);
|
||||||
|
SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取累计专项附加扣除数据。"));
|
||||||
|
return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<EmployeeDeclarePO> getEmployeeDeclarePOList(Collection<Long> taxAgentIds, Date declareMonth) {
|
||||||
|
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<QuerySpecialAmountResponse.Body> getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param,
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||||||
|
Map<Long, List<EmployeeDeclarePO>> taxAgentEmployeeDeclareMap,
|
||||||
|
List<TaxAgentTaxReturnPO> taxReturnPOList) {
|
||||||
|
List<QuerySpecialAmountResponse.Body> queryResponseList = new ArrayList<>();
|
||||||
|
for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) {
|
||||||
|
if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 发起请求
|
||||||
|
String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId());
|
||||||
|
List<EmployeeDeclarePO> declarePOList = taxAgentEmployeeDeclareMap.getOrDefault(returnPO.getTaxAgentId(), new ArrayList<>());
|
||||||
|
if (declarePOList.isEmpty()) {
|
||||||
|
log.info("该主体下没有报送成功的人员,主体名称:{}", taxAgentName);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QuerySpecialAmountResponse queryResponse = getQuerySpecialAmountResponse(returnPO, taxAgentName, declarePOList, param, requestWrapper.getApiConfig());
|
||||||
|
// 校验请求结果
|
||||||
|
String responseCode = Optional.ofNullable(queryResponse)
|
||||||
|
.map(QuerySpecialAmountResponse::getHead)
|
||||||
|
.map(SzyhResponseHead::getCode)
|
||||||
|
.orElse(null);
|
||||||
|
String outerRequestId = Optional.ofNullable(queryResponse)
|
||||||
|
.map(QuerySpecialAmountResponse::getBody)
|
||||||
|
.map(QuerySpecialAmountResponse.Body::getRequestId)
|
||||||
|
.orElse(null);
|
||||||
|
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(outerRequestId)) {
|
||||||
|
log.info("getQuerySpecialAmountBodies error:{}", JSON.toJSONString(queryResponse));
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
|
||||||
|
}
|
||||||
|
queryResponse.getBody().setTaxAgentId(returnPO.getTaxAgentId());
|
||||||
|
queryResponseList.add(queryResponse.getBody());
|
||||||
|
}
|
||||||
|
return queryResponseList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void persistFeedbackData(AddUpDeductionMonthTaxAgentParam param, List<QuerySpecialAmountResponse.Body> queryResponseList) {
|
||||||
|
long requestId = IdGenerator.generate();
|
||||||
|
for (QuerySpecialAmountResponse.Body body : queryResponseList) {
|
||||||
|
AddUpDeductionRequestPO po = AddUpDeductionRequestPO.builder()
|
||||||
|
.id(IdGenerator.generate())
|
||||||
|
.requestId(requestId)
|
||||||
|
.taxAgentId(body.getTaxAgentId())
|
||||||
|
.requestStatus(EnumAddUpDeductionRequestStatus.RUNNING.getValue())
|
||||||
|
.outerRequestId(body.getRequestId())
|
||||||
|
.taxYearMonth(param.getDeclareMonth())
|
||||||
|
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
|
.tenantKey(DEFAULT_TENANT_KEY)
|
||||||
|
.createTime(new Date())
|
||||||
|
.updateTime(new Date())
|
||||||
|
.creator((long) user.getUID())
|
||||||
|
.lockVersion(0)
|
||||||
|
.build();
|
||||||
|
getAddUpDeductionRequestMapper().insertIgnoreNull(po);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private QuerySpecialAmountResponse getQuerySpecialAmountResponse(TaxAgentTaxReturnPO returnPO,
|
||||||
|
String taxAgentName,
|
||||||
|
List<EmployeeDeclarePO> declarePOList,
|
||||||
|
AddUpDeductionMonthTaxAgentParam param,
|
||||||
|
TaxDeclarationApiConfigPO apiConfig) {
|
||||||
|
String url = apiConfig.getHost() + SzyhApiConstant.QUERY_SPECIAL_AMOUNT;
|
||||||
|
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getDeclareMonth()));
|
||||||
|
requestParam.put("rylb", DataCollectionBO.getEmployeeList(declarePOList));
|
||||||
|
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||||
|
log.info("getQuerySpecialAmountResponse params --- \n{}\n", reqJson);
|
||||||
|
Map<String, String> params = new HashMap<>(1);
|
||||||
|
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
// 开始请求
|
||||||
|
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||||
|
log.info("getQuerySpecialAmountResponse res --- {}", res);
|
||||||
|
return JsonUtil.parseObject(res, QuerySpecialAmountResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AddUpDeductionRequestResultDTO onlineFeedback() {
|
||||||
|
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
|
||||||
|
List<AddUpDeductionRequestPO> requestPOList = getAddUpDeductionRequestPOS();
|
||||||
|
// 校验请求是否合法
|
||||||
|
Long requestId = checkRequestPOList(requestPOList);
|
||||||
|
// 前置数据封装为包装类
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(requestPOList, apiConfig);
|
||||||
|
// 开始请求反馈数据
|
||||||
|
AddUpDeductionRequestResultDTO resultDTO = getQuerySpecialAmountFeedback(requestWrapper);
|
||||||
|
// 判断是否需要继续轮询或者异常退出
|
||||||
|
if (!resultDTO.getFinish()) {
|
||||||
|
return resultDTO;
|
||||||
|
}
|
||||||
|
// 更新请求状态为已完成
|
||||||
|
updateRequestStatus(requestPOList, EnumAddUpDeductionRequestStatus.RUNNING.getValue(), EnumAddUpDeductionRequestStatus.COMPLETED.getValue());
|
||||||
|
// 获取员工信息
|
||||||
|
setEmployeeInfoMap(requestWrapper);
|
||||||
|
// 获取已存在的累计附加扣除数据
|
||||||
|
setExistedDataMap(requestWrapper);
|
||||||
|
// 开始处理反馈结果
|
||||||
|
TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper
|
||||||
|
= new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(requestPOList.get(0).getTaxYearMonth(), requestWrapper.getApiConfig(), EnumDeclareApiBusinessType.ADD_UP_DEDUCTION, (long) user.getUID());
|
||||||
|
handleFeedbackData(requestWrapper, apiFlowUpdateWrapper);
|
||||||
|
// 持久化数据
|
||||||
|
persistFeedbackData(requestWrapper);
|
||||||
|
// 更新流量统计数据
|
||||||
|
getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper);
|
||||||
|
// 返回结果
|
||||||
|
return DataCollectionBO.buildRequestResultDTO(requestId, requestWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<AddUpDeductionRequestFailListDTO> onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) {
|
||||||
|
List<AddUpDeductionRequestFailPO> addUpDeductionRequestFailPOS = getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(queryParam.getRequestId()).build());
|
||||||
|
List<AddUpDeductionRequestFailPO> list = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), addUpDeductionRequestFailPOS);
|
||||||
|
// 获取薪资档案
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null);
|
||||||
|
this.getEmployeeInfoMap(requestWrapper);
|
||||||
|
|
||||||
|
List<AddUpDeductionRequestFailListDTO> listDTOList = list.stream().map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList());
|
||||||
|
|
||||||
|
PageInfo<AddUpDeductionRequestFailListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOList, AddUpDeductionRequestFailListDTO.class);
|
||||||
|
page.setTotal(addUpDeductionRequestFailPOS.size());
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AddUpDeductionRequestFailPO> getAddUpDeductionRequestFailPOList(Long requestId) {
|
||||||
|
return getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(requestId).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XSSFWorkbook exportOnlineFeedbackFail( Long requestId) {
|
||||||
|
List<List<Object>> rows = new ArrayList<>();
|
||||||
|
// 表头
|
||||||
|
List<Object> headers = new ArrayList<>();
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(106277, "身份证号码"));
|
||||||
|
headers.add(SalaryI18nUtil.getI18nLabel(144832, "失败原因"));
|
||||||
|
rows.add(headers);
|
||||||
|
// 获取薪资档案
|
||||||
|
AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null);
|
||||||
|
// 获取身份信息map
|
||||||
|
this.getEmployeeInfoMap(requestWrapper);
|
||||||
|
// 获取数据
|
||||||
|
List<AddUpDeductionRequestFailPO> pos = getAddUpDeductionRequestFailPOList(requestId);
|
||||||
|
// 组装数据
|
||||||
|
for (AddUpDeductionRequestFailPO po : pos) {
|
||||||
|
AddUpDeductionRequestFailListDTO failListDTO = requestWrapper.buildAddUpDeductionRequestFailListDTO(po);
|
||||||
|
List<Object> row = new ArrayList<>();
|
||||||
|
row.add(failListDTO.getEmployeeName());
|
||||||
|
row.add(failListDTO.getTaxAgentName());
|
||||||
|
row.add(failListDTO.getJobNum());
|
||||||
|
row.add(failListDTO.getDepartmentName());
|
||||||
|
row.add(failListDTO.getIdNo());
|
||||||
|
row.add(failListDTO.getFailReason());
|
||||||
|
rows.add(row);
|
||||||
|
}
|
||||||
|
// 生成表格
|
||||||
|
return ExcelUtil.genWorkbookV2(rows, "在线获取专项附加扣除失败数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper wrapper) {
|
||||||
|
// 身份证号
|
||||||
|
List<Long> employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList());
|
||||||
|
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||||
|
Map<Long, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getEmployeeId);
|
||||||
|
wrapper.setUserInfoUserIdMap(simpleUserInfoMap);
|
||||||
|
// 人员信息
|
||||||
|
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||||
|
Map<Long, DataCollectionEmployee> simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||||
|
wrapper.setSimpleEmployeeMap(simpleEmployeeMap);
|
||||||
|
// 外部人员信息
|
||||||
|
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listAll();
|
||||||
|
Map<Long, ExtEmpPO> extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId, e -> e);
|
||||||
|
wrapper.setExtEmployeePOMap(extEmployeePOMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<AddUpDeductionRequestPO> getAddUpDeductionRequestPOS() {
|
||||||
|
return getAddUpDeductionRequestMapper().listSome(AddUpDeductionRequestPO.builder().requestStatus(EnumAddUpDeductionRequestStatus.RUNNING.getValue()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper) {
|
||||||
|
requestWrapper.getRequestFeedBackMap().forEach((outerRequestId, feedbacks) -> feedbacks.forEach(feedback -> {
|
||||||
|
DataCollectionEmployee simpleUserInfo = requestWrapper.getUserInfoIdNoMap().get(feedback.getZzhm());
|
||||||
|
Long extEmpId = requestWrapper.getExtEmployeeIdCardMap().get(feedback.getZzhm());
|
||||||
|
Long employeeId = Optional.ofNullable(simpleUserInfo)
|
||||||
|
.map(DataCollectionEmployee::getEmployeeId)
|
||||||
|
.orElse(extEmpId);
|
||||||
|
AddUpDeductionRequestPO requestPO = requestWrapper.getRequestPoMap().get(outerRequestId);
|
||||||
|
|
||||||
|
// 流量使用情况
|
||||||
|
TaxDeclarationApiFlowRecordPO flowRecordPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, requestPO.getTaxAgentId(), employeeId);
|
||||||
|
|
||||||
|
if (employeeId == null || StringUtils.isNotEmpty(feedback.getSbyy())) {
|
||||||
|
// 处理失败数据
|
||||||
|
AddUpDeductionRequestFailPO failPO = DataCollectionBO.buildAddUpDeductionRequestFailPO(requestWrapper, requestPO, employeeId);
|
||||||
|
failPO.setReason(employeeId == null
|
||||||
|
? String.format("该人员报送成功的身份证号与人事档案下的身份证号不一致,报送人员信息:[%s]|[%s]", feedback.getXm(), feedback.getZzhm())
|
||||||
|
: feedback.getSbyy());
|
||||||
|
failPO.setEmployeeType(simpleUserInfo != null ? EmployeeTypeEnum.ORGANIZATION.getValue() :
|
||||||
|
extEmpId != null ? EmployeeTypeEnum.EXT_EMPLOYEE.getValue() : 2);
|
||||||
|
requestWrapper.getFailPOList().add(failPO);
|
||||||
|
flowRecordPO.setEmployeeId(Optional.ofNullable(employeeId).orElse(0L));
|
||||||
|
flowRecordPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue());
|
||||||
|
} else {
|
||||||
|
// 处理成功数据
|
||||||
|
AddUpDeduction po = DataCollectionBO.buildAddUpDeductionPO(feedback);
|
||||||
|
Long poId = requestWrapper.getExistedDataMap().get(requestPO.getTaxAgentId() + "-" + employeeId);
|
||||||
|
if (Objects.nonNull(poId)) {
|
||||||
|
po.setId(poId);
|
||||||
|
requestWrapper.getUpdateList().add(po);
|
||||||
|
} else {
|
||||||
|
setBaseInfo2PO(requestWrapper, employeeId, requestPO, po);
|
||||||
|
requestWrapper.getInsertList().add(po);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowRecordPO);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long checkRequestPOList(List<AddUpDeductionRequestPO> requestPOList) {
|
||||||
|
Map<Integer, List<AddUpDeductionRequestPO>> statusRequestMap = SalaryEntityUtil.group2Map(requestPOList, AddUpDeductionRequestPO::getRequestStatus);
|
||||||
|
if (CollectionUtils.isEmpty(statusRequestMap.get(EnumAddUpDeductionRequestStatus.RUNNING.getValue()))) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153343, "请先点击【在线获取】按钮,选择税款所属期进行获取数据。"));
|
||||||
|
}
|
||||||
|
Set<Long> requestIds = SalaryEntityUtil.properties(requestPOList, AddUpDeductionRequestPO::getRequestId);
|
||||||
|
if (requestIds.size() != 1) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153344, "当前同时存在多个任务,请联系管理员进行处理。"));
|
||||||
|
}
|
||||||
|
return requestPOList.get(0).getRequestId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||||
|
// 内部员工(详细信息)
|
||||||
|
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG);
|
||||||
|
Map<Long, DataCollectionEmployee> simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId);
|
||||||
|
requestWrapper.setSimpleEmployeeMap(simpleEmployeeMap);
|
||||||
|
// 内部员工(身份证信息)
|
||||||
|
List<Long> employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList());
|
||||||
|
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||||
|
Map<String, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo);
|
||||||
|
requestWrapper.setUserInfoIdNoMap(simpleUserInfoMap);
|
||||||
|
// 外部员工信息
|
||||||
|
List<ExtEmpPO> extEmployeePOS = getExtEmpService(user).listAll();
|
||||||
|
Map<String, Long> extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getIdNo, ExtEmpPO::getId);
|
||||||
|
requestWrapper.setExtEmployeeIdCardMap(extEmployeePOMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||||
|
List<Long> taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList());
|
||||||
|
List<AddUpDeduction> poList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(requestWrapper.getRequestPOList().get(0).getTaxYearMonth()).taxAgentIds(taxAgentIds).build());
|
||||||
|
requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddUpDeductionRequestResultDTO getQuerySpecialAmountFeedback(AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||||
|
for (AddUpDeductionRequestPO requestPO : requestWrapper.getRequestPOList()) {
|
||||||
|
QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(requestWrapper.getApiConfig(), requestPO);
|
||||||
|
// 校验请求结果
|
||||||
|
String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null);
|
||||||
|
String msg = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null);
|
||||||
|
if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)) {
|
||||||
|
// 如果接口仍在处理中,则继续轮询
|
||||||
|
return AddUpDeductionRequestResultDTO.builder().finish(false).build();
|
||||||
|
}
|
||||||
|
// 获取返回的人员信息列表
|
||||||
|
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) {
|
||||||
|
log.info("getQuerySpecialAmountFeedback not success error:{}", JSON.toJSONString(response));
|
||||||
|
throw new SalaryRunTimeException(msg);
|
||||||
|
}
|
||||||
|
List<QuerySpecialAmountFeedbackResponse.Feedback> feedbacks = Optional.of(response)
|
||||||
|
.map(QuerySpecialAmountFeedbackResponse::getBody)
|
||||||
|
.map(QuerySpecialAmountFeedbackResponse.Body::getRyxxlb)
|
||||||
|
.orElse(new ArrayList<>());
|
||||||
|
if (feedbacks.isEmpty()) {
|
||||||
|
log.info("getQuerySpecialAmountFeedback empty data error:{}", JSON.toJSONString(response));
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||||
|
}
|
||||||
|
requestWrapper.getRequestFeedBackMap().put(requestPO.getOuterRequestId(), feedbacks);
|
||||||
|
requestWrapper.getRequestPoMap().put(requestPO.getOuterRequestId(), requestPO);
|
||||||
|
}
|
||||||
|
return AddUpDeductionRequestResultDTO.builder().finish(true).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void persistFeedbackData(AddUpDeductionOnlineRequestWrapper requestWrapper) {
|
||||||
|
if (!requestWrapper.getInsertList().isEmpty()) {
|
||||||
|
List<List<AddUpDeduction>> insertPartition = Lists.partition(requestWrapper.getInsertList(), 100);
|
||||||
|
insertPartition.forEach(list -> {
|
||||||
|
list = encryptUtil.encryptList(list, AddUpDeduction.class);
|
||||||
|
getAddUpDeductionMapper().insertData(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!requestWrapper.getUpdateList().isEmpty()) {
|
||||||
|
List<List<AddUpDeduction>> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 100);
|
||||||
|
updatePartition.forEach(list -> {
|
||||||
|
list = encryptUtil.encryptList(list, AddUpDeduction.class);
|
||||||
|
getAddUpDeductionMapper().updateData(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!requestWrapper.getFailPOList().isEmpty()) {
|
||||||
|
List<List<AddUpDeductionRequestFailPO>> failPartition = Lists.partition(requestWrapper.getFailPOList(), 100);
|
||||||
|
failPartition.forEach(list -> getAddUpDeductionRequestFailMapper().batchInsert(list));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBaseInfo2PO(AddUpDeductionOnlineRequestWrapper wrapper, Long employeeId, AddUpDeductionRequestPO requestPO, AddUpDeduction po) {
|
||||||
|
po.setId(IdGenerator.generate());
|
||||||
|
po.setDeclareMonth(wrapper.getRequestPOList().get(0).getTaxYearMonth());
|
||||||
|
po.setTaxAgentId(requestPO.getTaxAgentId());
|
||||||
|
po.setEmployeeId(employeeId);
|
||||||
|
po.setCreateTime(new Date());
|
||||||
|
po.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||||
|
// po.setModifier(wrapper.getCurrentEmployeeId());
|
||||||
|
po.setTenantKey(wrapper.getTenantKey());
|
||||||
|
po.setCreator(wrapper.getCurrentEmployeeId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateRequestStatus(List<AddUpDeductionRequestPO> requestPOList, Integer oldStatus, Integer newStatus) {
|
||||||
|
for (AddUpDeductionRequestPO requestPO : requestPOList) {
|
||||||
|
int i = getAddUpDeductionRequestMapper().updateRequestStatusLockVersion(AddUpDeductionRequestPO.builder()
|
||||||
|
.requestStatus(newStatus)
|
||||||
|
.lockVersion(requestPO.getLockVersion() + 1)
|
||||||
|
.updateTime(new Date())
|
||||||
|
.oldStatus(oldStatus)
|
||||||
|
.id(requestPO.getId())
|
||||||
|
.oldLockVersion(requestPO.getLockVersion())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
// SalaryAssert.isTrue(update, SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuerySpecialAmountFeedbackResponse getQuerySpecialAmountFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, AddUpDeductionRequestPO requestPO) {
|
||||||
|
String url = apiConfig.getHost() + SzyhApiConstant.GET_QUERY_SPECIAL_AMOUNT_FEEDBACK;
|
||||||
|
Map<String, String> params = new HashMap<>(1);
|
||||||
|
params.put("requestId", requestPO.getOuterRequestId());
|
||||||
|
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
String res = HttpUtil.getRequest(url, header, params);
|
||||||
|
log.info("GET_QUERY_SPECIAL_AMOUNT_FEEDBACK res = {}", res);
|
||||||
|
return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AddUpDeductionOnlineRequestWrapper {
|
||||||
|
private String tenantKey;
|
||||||
|
private Long currentEmployeeId;
|
||||||
|
// 单次请求对应的反馈数据map
|
||||||
|
private Map<String, List<QuerySpecialAmountFeedbackResponse.Feedback>> requestFeedBackMap;
|
||||||
|
private Map<String, AddUpDeductionRequestPO> requestPoMap;
|
||||||
|
// 查询薪资档案(定薪、待停薪、停薪)
|
||||||
|
private List<SalaryArchivePO> salaryArchiveList;
|
||||||
|
private Map<Long, String> taxAgentMap;
|
||||||
|
// 员工信息map(身份证号 -> 员工ID)
|
||||||
|
private Map<String, DataCollectionEmployee> userInfoIdNoMap;
|
||||||
|
// 员工信息map(员工ID -> 身份证)
|
||||||
|
private Map<Long, DataCollectionEmployee> userInfoUserIdMap;
|
||||||
|
// 员工详细信息map(key = 员工ID)
|
||||||
|
private Map<Long, DataCollectionEmployee> simpleEmployeeMap;
|
||||||
|
// 获取当前库中累计附加扣除的数据
|
||||||
|
private Map<String, Long> existedDataMap;
|
||||||
|
// 需要新增的数据
|
||||||
|
private List<AddUpDeduction> insertList;
|
||||||
|
// 需要更新的数据
|
||||||
|
private List<AddUpDeduction> updateList;
|
||||||
|
// 失败数据(分页)
|
||||||
|
private List<AddUpDeductionRequestFailListDTO> failDTOList;
|
||||||
|
// 失败数据(持久化)
|
||||||
|
private List<AddUpDeductionRequestFailPO> failPOList;
|
||||||
|
// 请求详细信息列表
|
||||||
|
private List<AddUpDeductionRequestPO> requestPOList;
|
||||||
|
// 外部人员(身份证 -> id)
|
||||||
|
private Map<String, Long> extEmployeeIdCardMap;
|
||||||
|
// 外部人员(id -> 实体)
|
||||||
|
private Map<Long, ExtEmpPO> extEmployeePOMap;
|
||||||
|
// api配置
|
||||||
|
private TaxDeclarationApiConfigPO apiConfig;
|
||||||
|
|
||||||
|
public AddUpDeductionOnlineRequestWrapper(List<AddUpDeductionRequestPO> requestPOList,
|
||||||
|
List<SalaryArchivePO> salaryArchiveList,
|
||||||
|
List<TaxAgentPO> taxAgents,
|
||||||
|
Long currentEmployeeId) {
|
||||||
|
this.requestFeedBackMap = new HashMap<>();
|
||||||
|
this.requestPoMap = new HashMap<>();
|
||||||
|
this.insertList = new ArrayList<>();
|
||||||
|
this.updateList = new ArrayList<>();
|
||||||
|
this.failDTOList = new ArrayList<>();
|
||||||
|
this.failPOList = new ArrayList<>();
|
||||||
|
this.salaryArchiveList = salaryArchiveList;
|
||||||
|
this.requestPOList = requestPOList;
|
||||||
|
this.tenantKey = DEFAULT_TENANT_KEY;
|
||||||
|
this.currentEmployeeId = currentEmployeeId;
|
||||||
|
this.taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddUpDeductionRequestFailListDTO buildAddUpDeductionRequestFailListDTO(AddUpDeductionRequestFailPO failPO) {
|
||||||
|
DataCollectionEmployee userInfo = this.userInfoUserIdMap.get(failPO.getEmployeeId());
|
||||||
|
ExtEmpPO extEmployeePO = this.extEmployeePOMap.get(failPO.getEmployeeId());
|
||||||
|
DataCollectionEmployee simpleEmployee = this.simpleEmployeeMap.get(failPO.getEmployeeId());
|
||||||
|
String departmentName = Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getDepartmentName).orElse("");
|
||||||
|
|
||||||
|
AddUpDeductionRequestFailListDTO listDTO = AddUpDeductionRequestFailListDTO.builder()
|
||||||
|
.id(failPO.getId().toString())
|
||||||
|
.employeeId(failPO.getEmployeeId())
|
||||||
|
.employeeType(EmployeeTypeEnum.parseByValue(failPO.getEmployeeType()).toString())
|
||||||
|
.employeeName(Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getUsername)
|
||||||
|
.orElse(Optional.ofNullable(extEmployeePO).map(ExtEmpPO::getUsername)
|
||||||
|
.orElse("")))
|
||||||
|
.jobNum(Optional.ofNullable(simpleEmployee).map(DataCollectionEmployee::getWorkcode).orElse(""))
|
||||||
|
.idNo(Optional.ofNullable(userInfo).map(DataCollectionEmployee::getIdNo)
|
||||||
|
.orElse(Optional.ofNullable(extEmployeePO).map(ExtEmpPO::getIdNo)
|
||||||
|
.orElse("")))
|
||||||
|
.departmentName(Optional.ofNullable(departmentName).orElse(""))
|
||||||
|
.failReason(failPO.getReason())
|
||||||
|
.taxAgentName(this.taxAgentMap.get(failPO.getTaxAgentId()))
|
||||||
|
.build();
|
||||||
|
Pattern pattern = Pattern.compile("\\[+[\\u4e00-\\u9fa5]*+]+\\|+\\[+[0-9]*+]");
|
||||||
|
Matcher matcher = pattern.matcher(Optional.ofNullable(failPO.getReason()).orElse(""));
|
||||||
|
if (matcher.find()) {
|
||||||
|
String[] split = failPO.getReason().split("\\|");
|
||||||
|
listDTO.setEmployeeName(split[0].substring(split[0].indexOf('[') + 1, split[0].indexOf(']')));
|
||||||
|
listDTO.setIdNo(split[1].substring(split[1].indexOf('[') + 1, split[1].indexOf(']')));
|
||||||
|
}
|
||||||
|
return listDTO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.api.browser.bean.SearchConditionGroup;
|
import com.api.browser.bean.SearchConditionGroup;
|
||||||
import com.api.browser.bean.SearchConditionItem;
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
import com.api.browser.util.ConditionFactory;
|
import com.api.browser.util.ConditionFactory;
|
||||||
|
|
@ -8,33 +9,38 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.biz.AddUpSituationBiz;
|
import com.engine.salary.biz.AddUpSituationBiz;
|
||||||
|
import com.engine.salary.constant.SzyhApiConstant;
|
||||||
import com.engine.salary.encrypt.EncryptUtil;
|
import com.engine.salary.encrypt.EncryptUtil;
|
||||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
|
import com.engine.salary.entity.datacollection.bo.DataCollectionBO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationImportParam;
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationParam;
|
import com.engine.salary.entity.datacollection.response.GetCompanyIncomesResponse;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||||
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||||
|
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
|
||||||
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
|
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||||
|
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||||
|
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||||
|
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
|
||||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||||
import com.engine.salary.service.AddUpDeductionService;
|
import com.engine.salary.service.*;
|
||||||
import com.engine.salary.service.AddUpSituationService;
|
|
||||||
import com.engine.salary.service.SalaryEmployeeService;
|
|
||||||
import com.engine.salary.service.TaxAgentService;
|
|
||||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||||
import com.engine.salary.sys.service.SalarySysConfService;
|
import com.engine.salary.sys.service.SalarySysConfService;
|
||||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||||
import com.engine.salary.util.SalaryDateUtil;
|
import com.engine.salary.util.*;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
|
||||||
import com.engine.salary.util.SalaryI18nUtil;
|
|
||||||
import com.engine.salary.util.db.MapperProxyFactory;
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
import com.engine.salary.util.excel.ExcelComment;
|
import com.engine.salary.util.excel.ExcelComment;
|
||||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||||
|
|
@ -43,8 +49,10 @@ import com.engine.salary.util.page.PageInfo;
|
||||||
import com.engine.salary.util.page.SalaryPageUtil;
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
import org.apache.poi.util.IOUtils;
|
import org.apache.poi.util.IOUtils;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import weaver.file.ImageFileManager;
|
import weaver.file.ImageFileManager;
|
||||||
|
|
@ -61,6 +69,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class AddUpSituationServiceImpl extends Service implements AddUpSituationService {
|
public class AddUpSituationServiceImpl extends Service implements AddUpSituationService {
|
||||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||||
|
|
||||||
|
|
@ -84,12 +93,28 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) {
|
||||||
|
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
AddUpSituationBiz biz = new AddUpSituationBiz();
|
AddUpSituationBiz biz = new AddUpSituationBiz();
|
||||||
|
|
||||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EmployeeDeclareMapper getEmployeeDeclareMapper() {
|
||||||
|
return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getSearchCondition() {
|
public Map<String, Object> getSearchCondition() {
|
||||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||||
|
|
@ -274,7 +299,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
// excel标题
|
// excel标题
|
||||||
final List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
|
final List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
|
||||||
"累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人",
|
"累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人",
|
||||||
"累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金");
|
"累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金");
|
||||||
|
|
||||||
//排序配置
|
//排序配置
|
||||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||||
|
|
@ -340,7 +365,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
//excel标题
|
//excel标题
|
||||||
List<String> title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计",
|
List<String> title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计",
|
||||||
"累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利",
|
"累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利",
|
||||||
"累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金");
|
"累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金");
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||||
//查询详细信息
|
//查询详细信息
|
||||||
|
|
@ -609,7 +634,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
||||||
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
||||||
String nextTaxYearMonthStr = taxYearMonthStr;
|
String nextTaxYearMonthStr = taxYearMonthStr;
|
||||||
if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){
|
if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) {
|
||||||
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
||||||
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
||||||
}
|
}
|
||||||
|
|
@ -693,7 +718,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工");
|
errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工");
|
||||||
errorData.add(errorMessageMap);
|
errorData.add(errorMessageMap);
|
||||||
errorSum += 1;
|
errorSum += 1;
|
||||||
}else {
|
} else {
|
||||||
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
||||||
po.setEmployeeId(employeeId);
|
po.setEmployeeId(employeeId);
|
||||||
}
|
}
|
||||||
|
|
@ -744,7 +769,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 判断是否有核算过
|
// 判断是否有核算过
|
||||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12") ) {
|
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
||||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst();
|
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst();
|
||||||
boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId()));
|
boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId()));
|
||||||
if (optionalAcctEmp.isPresent() && isExist) {
|
if (optionalAcctEmp.isPresent() && isExist) {
|
||||||
|
|
@ -846,8 +871,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 编辑数据
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @description 编辑数据
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/27 21:32
|
* @date 2022/10/27 21:32
|
||||||
*/
|
*/
|
||||||
|
|
@ -860,12 +885,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
// 获取所有个税扣缴义务人
|
// 获取所有个税扣缴义务人
|
||||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
|
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
|
||||||
AddUpSituation byId = biz.getById(addUpSituationParam.getId());
|
AddUpSituation byId = biz.getById(addUpSituationParam.getId());
|
||||||
if(byId == null){
|
if (byId == null) {
|
||||||
throw new SalaryRunTimeException("该数据不存在!");
|
throw new SalaryRunTimeException("该数据不存在!");
|
||||||
}
|
}
|
||||||
Long taxAgentId = byId.getTaxAgentId();
|
Long taxAgentId = byId.getTaxAgentId();
|
||||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId));
|
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId));
|
||||||
if(!canEdit){
|
if (!canEdit) {
|
||||||
//没有编辑权限
|
//没有编辑权限
|
||||||
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
||||||
}
|
}
|
||||||
|
|
@ -873,14 +898,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
||||||
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
||||||
String nextTaxYearMonthStr = taxYearMonthStr;
|
String nextTaxYearMonthStr = taxYearMonthStr;
|
||||||
if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){
|
if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) {
|
||||||
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
||||||
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
||||||
}
|
}
|
||||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(nextTaxYearMonthStr);
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(nextTaxYearMonthStr);
|
||||||
|
|
||||||
// 判断是否有核算过
|
// 判断是否有核算过
|
||||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
||||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst();
|
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst();
|
||||||
if (optionalAcctEmp.isPresent()) {
|
if (optionalAcctEmp.isPresent()) {
|
||||||
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
||||||
|
|
@ -903,8 +928,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 新建数据
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @description 新建数据
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/27 22:04
|
* @date 2022/10/27 22:04
|
||||||
*/
|
*/
|
||||||
|
|
@ -947,8 +972,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
|
|
||||||
|
|
||||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpSituationParam.getEmployeeId()));
|
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpSituationParam.getEmployeeId()));
|
||||||
if(!employeeSameId){
|
if (!employeeSameId) {
|
||||||
throw new SalaryRunTimeException("员工信息不存在");
|
throw new SalaryRunTimeException("员工信息不存在");
|
||||||
}
|
}
|
||||||
po.setEmployeeId(addUpSituationParam.getEmployeeId());
|
po.setEmployeeId(addUpSituationParam.getEmployeeId());
|
||||||
|
|
@ -967,7 +992,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常
|
// fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常
|
||||||
// if (openDevolution) {
|
// if (openDevolution) {
|
||||||
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
|
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
|
||||||
// if (!optionalTaxAgentEmp.isPresent()) {
|
// if (!optionalTaxAgentEmp.isPresent()) {
|
||||||
|
|
@ -1055,15 +1080,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||||
// 判断是否有核算过
|
// 判断是否有核算过
|
||||||
List<Long> deleteList = new ArrayList<>();
|
List<Long> deleteList = new ArrayList<>();
|
||||||
for(int i=0; i<deleteIds.size(); i++){
|
for (int i = 0; i < deleteIds.size(); i++) {
|
||||||
Long id = deleteIds.get(i);
|
Long id = deleteIds.get(i);
|
||||||
AddUpSituation byId = biz.getById(id);
|
AddUpSituation byId = biz.getById(id);
|
||||||
if(byId == null){
|
if (byId == null) {
|
||||||
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
||||||
}
|
}
|
||||||
// 判断是否在个税扣缴义务人范围内
|
// 判断是否在个税扣缴义务人范围内
|
||||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst();
|
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst();
|
||||||
if(!first.isPresent()){
|
if (!first.isPresent()) {
|
||||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||||
}
|
}
|
||||||
// 判断用户是否存在
|
// 判断用户是否存在
|
||||||
|
|
@ -1089,23 +1114,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
AddUpSituationBiz biz = new AddUpSituationBiz();
|
AddUpSituationBiz biz = new AddUpSituationBiz();
|
||||||
Date declareMonthDate = new Date();
|
Date declareMonthDate = new Date();
|
||||||
try {
|
try {
|
||||||
declareMonthDate = (sdf.parse(declareMonthStr+"-01"));
|
declareMonthDate = (sdf.parse(declareMonthStr + "-01"));
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
throw new SalaryRunTimeException("日期异常");
|
throw new SalaryRunTimeException("日期异常");
|
||||||
}
|
}
|
||||||
AddUpSituation queryParam = null;
|
AddUpSituation queryParam = null;
|
||||||
|
|
||||||
if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){
|
if (deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()) {
|
||||||
// 设置了个税扣缴义务人
|
// 设置了个税扣缴义务人
|
||||||
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
||||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId));
|
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId));
|
||||||
if(!canDelete){
|
if (!canDelete) {
|
||||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
||||||
}
|
}
|
||||||
ArrayList<Long> tai = new ArrayList<>();
|
ArrayList<Long> tai = new ArrayList<>();
|
||||||
tai.add(taxAgentId);
|
tai.add(taxAgentId);
|
||||||
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build();
|
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build();
|
||||||
}else {
|
} else {
|
||||||
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(taxAgentIds).build();
|
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(taxAgentIds).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1115,7 +1140,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||||
// 获取已经核算的数据
|
// 获取已经核算的数据
|
||||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||||
for(AddUpSituation item : list){
|
for (AddUpSituation item : list) {
|
||||||
if (CollectionUtils.isNotEmpty(employees)) {
|
if (CollectionUtils.isNotEmpty(employees)) {
|
||||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
Optional<SalaryAcctEmployeePO> optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||||
if (optionalAcctEmp.isPresent()) {
|
if (optionalAcctEmp.isPresent()) {
|
||||||
|
|
@ -1137,11 +1162,11 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
ids.add(addUpSituationParam.getId());
|
ids.add(addUpSituationParam.getId());
|
||||||
AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build();
|
AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build();
|
||||||
List<AddUpSituationRecordDTO> list = biz.recordList(build);
|
List<AddUpSituationRecordDTO> list = biz.recordList(build);
|
||||||
if(list == null || list.size()==0){
|
if (list == null || list.size() == 0) {
|
||||||
throw new SalaryRunTimeException("该数据不存在!");
|
throw new SalaryRunTimeException("该数据不存在!");
|
||||||
}
|
}
|
||||||
String taxAgentName = list.get(0).getTaxAgentName();
|
String taxAgentName = list.get(0).getTaxAgentName();
|
||||||
if(!taxAgentNames.contains(taxAgentName)){
|
if (!taxAgentNames.contains(taxAgentName)) {
|
||||||
throw new SalaryRunTimeException("您无权查看该数据!");
|
throw new SalaryRunTimeException("您无权查看该数据!");
|
||||||
}
|
}
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
|
|
@ -1150,10 +1175,182 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
||||||
@Override
|
@Override
|
||||||
public void batchSave(List<AddUpSituation> list) {
|
public void batchSave(List<AddUpSituation> list) {
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
list = encryptUtil.encryptList(list,AddUpSituation.class);
|
list = encryptUtil.encryptList(list, AddUpSituation.class);
|
||||||
List<List<AddUpSituation>> partition = Lists.partition(list, 50);
|
List<List<AddUpSituation>> partition = Lists.partition(list, 50);
|
||||||
partition.forEach(getAddUpSituationMapper()::insertData);
|
partition.forEach(getAddUpSituationMapper()::insertData);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "税款所属期必传"));
|
||||||
|
// 获取接口配置
|
||||||
|
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
|
||||||
|
// 获取包装类
|
||||||
|
AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig);
|
||||||
|
// 获取报税信息
|
||||||
|
List<TaxAgentTaxReturnPO> taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet());
|
||||||
|
List<TaxAgentTaxReturnPO> failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList());
|
||||||
|
SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "企业未通过验证,暂时无法获取累计专项附加扣除数据,请先在【个税扣缴义务人】菜单验证企业报税信息"));
|
||||||
|
Map<String, Object> result = new HashMap<>(1);
|
||||||
|
if (!failReturnPOList.isEmpty()) {
|
||||||
|
String failTaxAgentNames = failReturnPOList.stream().map(e -> requestWrapper.getTaxAgentMap().get(e.getTaxAgentId())).collect(Collectors.joining("、"));
|
||||||
|
result.put("msg", String.format(SalaryI18nUtil.getI18nLabel(183782, "%s未通过登记验证,无法在线获取数据"), failTaxAgentNames));
|
||||||
|
}
|
||||||
|
// 获取报送成功的人员名单
|
||||||
|
Map<Long, List<EmployeeDeclarePO>> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth());
|
||||||
|
// 开始请求接口获取数据
|
||||||
|
getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param,
|
||||||
|
AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper,
|
||||||
|
Map<Long, List<EmployeeDeclarePO>> taxAgentEmployeeDeclareMap,
|
||||||
|
List<TaxAgentTaxReturnPO> taxReturnPOList) {
|
||||||
|
List<AddUpSituation> updateList = new ArrayList<>();
|
||||||
|
List<AddUpSituation> insertList = new ArrayList<>();
|
||||||
|
for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) {
|
||||||
|
if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 发起请求
|
||||||
|
String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId());
|
||||||
|
List<EmployeeDeclarePO> declarePOList = taxAgentEmployeeDeclareMap.getOrDefault(returnPO.getTaxAgentId(), new ArrayList<>());
|
||||||
|
if (declarePOList.isEmpty()) {
|
||||||
|
log.info("该主体下没有报送成功的人员,主体名称:{}", taxAgentName);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
List<AddUpSituation> poList = getAddUpSituationMapper().listSome((AddUpSituation.builder().taxYearMonth(param.getDeclareMonth()).taxAgentId(returnPO.getTaxAgentId()).build()));
|
||||||
|
Map<String, AddUpSituation> poMap = SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId());
|
||||||
|
|
||||||
|
// 内部员工(身份证信息)
|
||||||
|
List<Long> employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList());
|
||||||
|
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||||
|
Map<String, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo);
|
||||||
|
|
||||||
|
for (int i = 1; true; i++) {
|
||||||
|
GetCompanyIncomesResponse queryResponse = getCompanyIncomes(returnPO, taxAgentName, param, requestWrapper.getApiConfig(), i);
|
||||||
|
// 校验请求结果
|
||||||
|
String responseCode = Optional.ofNullable(queryResponse)
|
||||||
|
.map(GetCompanyIncomesResponse::getHead)
|
||||||
|
.map(SzyhResponseHead::getCode)
|
||||||
|
.orElse(null);
|
||||||
|
List<GetCompanyIncomesResponse.Detail> details = Optional.ofNullable(queryResponse)
|
||||||
|
.map(GetCompanyIncomesResponse::getBody)
|
||||||
|
.map(GetCompanyIncomesResponse.Body::getSfmx)
|
||||||
|
.orElse(null);
|
||||||
|
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) {
|
||||||
|
log.info("getCompanyIncomes error:{}", JSON.toJSONString(queryResponse));
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(details)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Date now = new Date();
|
||||||
|
for (GetCompanyIncomesResponse.Detail detail : details) {
|
||||||
|
DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(detail.getZjhm());
|
||||||
|
Long employeeId = Optional.ofNullable(simpleUserInfo)
|
||||||
|
.map(DataCollectionEmployee::getEmployeeId)
|
||||||
|
.orElse(0L);
|
||||||
|
if (poMap.containsKey(returnPO.getTaxAgentId() + "-" + employeeId)) {
|
||||||
|
AddUpSituation po = poMap.get(returnPO.getTaxAgentId() + "-" + employeeId);
|
||||||
|
po.setUpdateTime(now);
|
||||||
|
po.setActualAddUpAdvanceTax(detail.getKjse());
|
||||||
|
po.setTaxAdjustment(SalaryEntityUtil.string2BigDecimalDefault0(detail.getKjse()).subtract(SalaryEntityUtil.string2BigDecimalDefault0(po.getAddUpAdvanceTax())).toString());
|
||||||
|
updateList.add(po);
|
||||||
|
} else {
|
||||||
|
AddUpSituation po = new AddUpSituation();
|
||||||
|
// po.setId(IdGenerator.generate());
|
||||||
|
po.setCreateTime(now);
|
||||||
|
po.setUpdateTime(now);
|
||||||
|
po.setCreator(requestWrapper.getCurrentEmployeeId());
|
||||||
|
po.setDeleteType(NumberUtils.INTEGER_ZERO);
|
||||||
|
po.setTenantKey(requestWrapper.getTenantKey());
|
||||||
|
po.setYear(param.getDeclareMonth().getYear());
|
||||||
|
po.setTaxYearMonth(param.getDeclareMonth());
|
||||||
|
po.setEmployeeType(0);
|
||||||
|
po.setTaxAgentId(returnPO.getTaxAgentId());
|
||||||
|
po.setEmployeeId(employeeId);
|
||||||
|
po.setAddUpIncome("0");
|
||||||
|
po.setAddUpSubtraction("0");
|
||||||
|
po.setAddUpSocialSecurityTotal("0");
|
||||||
|
po.setAddUpAccumulationFundTotal("0");
|
||||||
|
po.setAddUpEnterpriseAndOther("0");
|
||||||
|
po.setAddUpOtherDeduction("0");
|
||||||
|
po.setAddUpTaxExemptIncome("0");
|
||||||
|
po.setAddUpAllowedDonation("0");
|
||||||
|
po.setAddUpTaxSavings("0");
|
||||||
|
po.setAddUpAdvanceTax("0");
|
||||||
|
po.setAddUpTaxableIncome("0");
|
||||||
|
po.setActualAddUpAdvanceTax(detail.getKjse());
|
||||||
|
po.setTaxAdjustment(detail.getKjse());
|
||||||
|
insertList.add(po);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!insertList.isEmpty()) {
|
||||||
|
List<List<AddUpSituation>> insertPartition = Lists.partition(insertList, 50);
|
||||||
|
insertPartition.forEach(list -> {
|
||||||
|
list = encryptUtil.encryptList(list, AddUpSituation.class);
|
||||||
|
getAddUpSituationMapper().insertData(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!updateList.isEmpty()) {
|
||||||
|
List<List<AddUpSituation>> updatePartition = Lists.partition(updateList, 50);
|
||||||
|
updatePartition.forEach(list -> {
|
||||||
|
list = encryptUtil.encryptList(list, AddUpSituation.class);
|
||||||
|
getAddUpSituationMapper().updateData(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private GetCompanyIncomesResponse getCompanyIncomes(TaxAgentTaxReturnPO returnPO,
|
||||||
|
String taxAgentName,
|
||||||
|
AddUpDeductionMonthTaxAgentParam param,
|
||||||
|
TaxDeclarationApiConfigPO apiConfig,
|
||||||
|
Integer pageNo) {
|
||||||
|
String url = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES;
|
||||||
|
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getDeclareMonth()));
|
||||||
|
requestParam.put("pageSize", 1000);
|
||||||
|
requestParam.put("pageNo", pageNo);
|
||||||
|
requestParam.put("reportType", 1);
|
||||||
|
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||||
|
log.info("getCompanyIncomes params --- \n{}\n", reqJson);
|
||||||
|
Map<String, String> params = new HashMap<>(1);
|
||||||
|
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
// 开始请求
|
||||||
|
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||||
|
log.info("getCompanyIncomes res --- {}", res);
|
||||||
|
return JsonUtil.parseObject(res, GetCompanyIncomesResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper getAddUpDeductionOnlineRequestWrapper(List<AddUpDeductionRequestPO> requestPOList, TaxDeclarationApiConfigPO apiConfig) {
|
||||||
|
boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||||
|
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||||
|
List<TaxAgentPO> taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List<TaxAgentPO>) getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID());
|
||||||
|
Set<Long> taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId);
|
||||||
|
// 获取薪资档案
|
||||||
|
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listByRunStatus(Arrays.asList(
|
||||||
|
SalaryArchiveStatusEnum.FIXED.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.SUSPEND.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue(),
|
||||||
|
SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()));
|
||||||
|
salaryArchiveList = salaryArchiveList.stream().filter(e -> taxAgentIdSet.contains(e.getTaxAgentId())).collect(Collectors.toList());
|
||||||
|
AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper = new AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper(requestPOList, salaryArchiveList, taxAgents, (long) user.getUID());
|
||||||
|
requestWrapper.setApiConfig(apiConfig);
|
||||||
|
return requestWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, List<EmployeeDeclarePO>> getEmpDeclareMap(Collection<Long> taxAgentIds, Date declareMonth) {
|
||||||
|
List<EmployeeDeclarePO> employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth);
|
||||||
|
SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "暂无人员报送状态为正常的数据,请先报送再获取累计专项附加扣除数据。"));
|
||||||
|
return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<EmployeeDeclarePO> getEmployeeDeclarePOList(Collection<Long> taxAgentIds, Date declareMonth) {
|
||||||
|
return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,7 @@ import com.engine.salary.formlua.entity.parameter.DataType;
|
||||||
import com.engine.salary.formlua.entity.standard.ExcelResult;
|
import com.engine.salary.formlua.entity.standard.ExcelResult;
|
||||||
import com.engine.salary.service.FormulaRunService;
|
import com.engine.salary.service.FormulaRunService;
|
||||||
import com.engine.salary.sys.enums.OpenEnum;
|
import com.engine.salary.sys.enums.OpenEnum;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.engine.salary.util.JsonUtil;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.ql.util.express.DefaultContext;
|
import com.ql.util.express.DefaultContext;
|
||||||
import com.ql.util.express.ExpressRunner;
|
import com.ql.util.express.ExpressRunner;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -35,8 +33,6 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
||||||
|
|
||||||
private static ExpressRunner runner = new ExpressRunner(true, false);
|
private static ExpressRunner runner = new ExpressRunner(true, false);
|
||||||
|
|
||||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
|
|
||||||
private final BaseBean baseBean = new BaseBean();
|
private final BaseBean baseBean = new BaseBean();
|
||||||
|
|
||||||
private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log"));
|
private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log"));
|
||||||
|
|
@ -85,24 +81,25 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
||||||
String openDecrypt = "";
|
String openDecrypt = "";
|
||||||
String result = "";
|
String result = "";
|
||||||
try {
|
try {
|
||||||
JsonNode jsonNode = objectMapper.readTree(extendParam);
|
Map<String, String> map = JsonUtil.parseMap(extendParam, String.class);
|
||||||
//返回值配置
|
//返回值配置
|
||||||
JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey");
|
sqlReturnKey = map.getOrDefault("sqlReturnKey", "");
|
||||||
if (sqlReturnKeyNode != null) {
|
if (StringUtils.isNotBlank(sqlReturnKey)) {
|
||||||
sqlReturnKey = sqlReturnKeyNode.asText().trim();
|
sqlReturnKey = sqlReturnKey.trim();
|
||||||
}
|
}
|
||||||
//数据源配置
|
//数据源配置
|
||||||
JsonNode datasourceNode = jsonNode.get("datasource");
|
String datasourceJson = map.getOrDefault("datasource", "");
|
||||||
if (datasourceNode != null) {
|
if (StringUtils.isNotBlank(datasourceJson)) {
|
||||||
JsonNode datasourceIdNode = datasourceNode.get("datasourceId");
|
Map<String, String> datasourceIdMap = JsonUtil.parseMap(datasourceJson, String.class);
|
||||||
if (datasourceIdNode != null) {
|
String datasourceIdNode = datasourceIdMap.getOrDefault("datasourceId","");
|
||||||
datasourceId = datasourceIdNode.asText();
|
if (StringUtils.isNotBlank(datasourceIdNode)) {
|
||||||
|
datasourceId = datasourceIdNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//是否需要解密
|
//是否需要解密
|
||||||
JsonNode decrypt = jsonNode.get("openDecrypt");
|
String decrypt = map.get("openDecrypt");
|
||||||
if (decrypt != null) {
|
if (StringUtils.isNotBlank(decrypt)) {
|
||||||
openDecrypt = decrypt.asText().trim();
|
openDecrypt = decrypt.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
//解析sql
|
//解析sql
|
||||||
|
|
@ -164,13 +161,13 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
||||||
|
|
||||||
String extendParam = expressFormula.getExtendParam();
|
String extendParam = expressFormula.getExtendParam();
|
||||||
try {
|
try {
|
||||||
JsonNode jsonNode = objectMapper.readTree(extendParam);
|
Map<String, String> map = JsonUtil.parseMap(extendParam, String.class);
|
||||||
//返回值配置
|
//返回值配置
|
||||||
JsonNode isCustomFunctionNode = jsonNode.get("isCustomFunction");
|
String isCustomFunctionNode = map.getOrDefault("isCustomFunction", "");
|
||||||
if (isCustomFunctionNode != null) {
|
if (StringUtils.isNotBlank(isCustomFunctionNode)) {
|
||||||
isCustomFunction = StringUtils.equals(isCustomFunctionNode.asText().trim(), "1");
|
isCustomFunction = StringUtils.equals(isCustomFunctionNode.trim(), "1");
|
||||||
}
|
}
|
||||||
} catch (JsonProcessingException e) {
|
} catch (Exception e) {
|
||||||
log.error("express execute fail, extendParam parse fail {}", extendParam, e);
|
log.error("express execute fail, extendParam parse fail {}", extendParam, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.common.LocalDateRange;
|
import com.engine.salary.common.LocalDateRange;
|
||||||
|
import com.engine.salary.common.YearMonthRange;
|
||||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||||
|
|
@ -14,6 +15,8 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||||
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
|
|
@ -32,6 +35,8 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
import com.engine.salary.util.page.PageInfo;
|
import com.engine.salary.util.page.PageInfo;
|
||||||
import com.engine.salary.util.page.SalaryPageUtil;
|
import com.engine.salary.util.page.SalaryPageUtil;
|
||||||
import com.engine.salary.util.valid.ValidUtil;
|
import com.engine.salary.util.valid.ValidUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.math.NumberUtils;
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
|
|
@ -78,6 +83,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
||||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
// private SalaryCheckResultService salaryCheckResultService;
|
// private SalaryCheckResultService salaryCheckResultService;
|
||||||
//
|
//
|
||||||
// private SalaryCheckResultDetailService salaryCheckResultDetailService;
|
// private SalaryCheckResultDetailService salaryCheckResultDetailService;
|
||||||
|
|
@ -271,9 +280,11 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
||||||
public Long save(SalaryAcctRecordSaveParam saveParam) {
|
public Long save(SalaryAcctRecordSaveParam saveParam) {
|
||||||
ValidUtil.doValidator(saveParam);
|
ValidUtil.doValidator(saveParam);
|
||||||
//检查
|
//检查
|
||||||
checkBeforeSave(saveParam);
|
// checkBeforeSave(saveParam);
|
||||||
|
|
||||||
|
|
||||||
|
SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId());
|
||||||
|
|
||||||
// 查询税款所属期
|
// 查询税款所属期
|
||||||
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth());
|
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth());
|
||||||
// 薪资所属月所在年的日期范围(第一天~最后一天)
|
// 薪资所属月所在年的日期范围(第一天~最后一天)
|
||||||
|
|
@ -293,12 +304,20 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
||||||
|
|
||||||
// 转换成po
|
// 转换成po
|
||||||
SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, (long) user.getUID());
|
SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, (long) user.getUID());
|
||||||
|
|
||||||
|
//检查
|
||||||
|
// 检查是否能够新建核算
|
||||||
|
SalaryAcctTaxAgentPO build = SalaryAcctTaxAgentPO.builder().incomeCategory(salarySobPO.getIncomeCategory()).taxAgentId(salarySobPO.getTaxAgentId()).taxCycle(salaryAcctRecordPO.getTaxCycle()).build();
|
||||||
|
List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents = new ArrayList<>();
|
||||||
|
salaryAcctTaxAgents.add(build);
|
||||||
|
checkBeforeSave(salaryAcctRecordPO, salaryAcctTaxAgents);
|
||||||
|
|
||||||
// 保存薪资核算记录
|
// 保存薪资核算记录
|
||||||
getSalaryAcctRecordMapper().insertIgnoreNull(salaryAcctRecordPO);
|
getSalaryAcctRecordMapper().insertIgnoreNull(salaryAcctRecordPO);
|
||||||
// 初始化薪资核算人员
|
// 初始化薪资核算人员
|
||||||
getSalaryAcctEmployeeService(user).initBySalaryAcctRecord(salaryAcctRecordPO);
|
getSalaryAcctEmployeeService(user).initBySalaryAcctRecord(salaryAcctRecordPO);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey);
|
// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId());
|
||||||
// LoggerContext<SalaryAcctRecordPO> loggerContext = new LoggerContext<>();
|
// LoggerContext<SalaryAcctRecordPO> loggerContext = new LoggerContext<>();
|
||||||
// loggerContext.setTargetId("" + salaryAcctRecordPO.getId());
|
// loggerContext.setTargetId("" + salaryAcctRecordPO.getId());
|
||||||
// loggerContext.setTargetName(targetName);
|
// loggerContext.setTargetName(targetName);
|
||||||
|
|
@ -438,6 +457,136 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存之前检查一下是否可以新建核算
|
||||||
|
*
|
||||||
|
* @param salaryAcctTaxAgents
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents) {
|
||||||
|
// 查询薪资账套
|
||||||
|
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecord.getSalarySobId());
|
||||||
|
IncomeCategoryEnum incomeCategoryEnums = IncomeCategoryEnum.parseByValue(salarySobPO.getIncomeCategory());
|
||||||
|
if (incomeCategoryEnums == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) {
|
||||||
|
// 如果当前是单独核算年终奖,无需校验其他所得项目的薪资核算记录
|
||||||
|
checkBeforeSaveAnnual(salaryAcctTaxAgents);
|
||||||
|
} else {
|
||||||
|
checkBeforeSaveCommon(salaryAcctTaxAgents);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBeforeSaveAnnual(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents) {
|
||||||
|
salaryAcctTaxAgents = salaryAcctTaxAgents.stream()
|
||||||
|
.filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 查询本次薪资核算记录的税款所属期所在年度的薪资核算记录
|
||||||
|
Set<Integer> sameYearSet = Sets.newHashSet();
|
||||||
|
List<SalaryAcctTaxAgentPO> otherSalaryAcctTaxAgents = Lists.newArrayList();
|
||||||
|
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||||
|
Date taxCycle = salaryAcctTaxAgent.getTaxCycle();
|
||||||
|
if (!sameYearSet.contains(taxCycle.getYear())) {
|
||||||
|
sameYearSet.add(taxCycle.getYear());
|
||||||
|
// 税款所属期所在年度的1月~12月
|
||||||
|
YearMonthRange taxCycleRange = new YearMonthRange()
|
||||||
|
.setStartMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(1)))
|
||||||
|
.setEndMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(12)));
|
||||||
|
// 税款所属期所在年度所有的薪资核算记录
|
||||||
|
otherSalaryAcctTaxAgents.addAll(getSalaryAcctTaxAgentService(user).listByTaxCycleRange(taxCycleRange));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 排除掉所得项目不是全年一次性奖金收入的薪资核算记录
|
||||||
|
otherSalaryAcctTaxAgents = otherSalaryAcctTaxAgents.stream()
|
||||||
|
.filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同
|
||||||
|
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||||
|
SalaryAcctTaxAgentPO diffTaxCycleSalaryAcctTaxAgent = otherSalaryAcctTaxAgents.stream()
|
||||||
|
.filter(e -> Objects.equals(salaryAcctTaxAgent.getTaxAgentId(), e.getTaxAgentId())
|
||||||
|
&& !Objects.equals(salaryAcctTaxAgent.getTaxCycle(), e.getTaxCycle()))
|
||||||
|
.findAny()
|
||||||
|
.orElse(null);
|
||||||
|
if (diffTaxCycleSalaryAcctTaxAgent != null) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "全年一次性奖金收入一年内只能申报一次,所以税款所属期必须相同"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBeforeSaveCommon(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents) {
|
||||||
|
// 排除掉所得项目为全年一次性奖金收入的薪资核算记录
|
||||||
|
salaryAcctTaxAgents = salaryAcctTaxAgents.stream()
|
||||||
|
.filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Set<Integer> sameYearSet = Sets.newHashSet();
|
||||||
|
List<TaxDeclarationPO> sameYearTaxDeclarations = Lists.newArrayList();
|
||||||
|
List<SalaryAcctTaxAgentPO> sameYearSalaryAcctTaxAgents = Lists.newArrayList();
|
||||||
|
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||||
|
Date taxCycle = salaryAcctTaxAgent.getTaxCycle();
|
||||||
|
if (!sameYearSet.contains(taxCycle.getYear())) {
|
||||||
|
sameYearSet.add(taxCycle.getYear());
|
||||||
|
// 税款所属期所在年度的1月~12月
|
||||||
|
YearMonthRange taxCycleRange = new YearMonthRange()
|
||||||
|
.setStartMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(1)))
|
||||||
|
.setEndMonth(SalaryDateUtil.toDateStartOfMonth(SalaryDateUtil.localDate2YearMonth(taxCycle).withMonth(12)));
|
||||||
|
// 税款所属期所在年度所有的个税申报表
|
||||||
|
sameYearTaxDeclarations.addAll(getTaxDeclarationService(user).listByTaxCycleRange(taxCycleRange));
|
||||||
|
// 税款所属期所在年度所有的薪资核算记录
|
||||||
|
sameYearSalaryAcctTaxAgents.addAll(getSalaryAcctTaxAgentService(user).listByTaxCycleRange(taxCycleRange));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 排除掉所得项目为全年一次性奖金收入的个税申报表和薪资核算记录
|
||||||
|
sameYearTaxDeclarations = sameYearTaxDeclarations.stream()
|
||||||
|
.filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
sameYearSalaryAcctTaxAgents = sameYearSalaryAcctTaxAgents.stream()
|
||||||
|
.filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 查询个税扣缴义务人
|
||||||
|
Set<Long> taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||||
|
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||||
|
Map<Long, String> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||||
|
|
||||||
|
Set<String> declareTaxAgents = SalaryEntityUtil.properties(sameYearTaxDeclarations, e -> e.getTaxAgentId() + "-" + e.getTaxCycle());
|
||||||
|
Map<Long, List<SalaryAcctTaxAgentPO>> sameYearSalaryAcctTaxAgentMap = SalaryEntityUtil
|
||||||
|
.group2Map(sameYearSalaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||||
|
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||||
|
List<SalaryAcctTaxAgentPO> salaryAcctTaxAgentList = sameYearSalaryAcctTaxAgentMap.getOrDefault(salaryAcctTaxAgent.getTaxAgentId(), Collections.emptyList())
|
||||||
|
.stream()
|
||||||
|
.filter(e -> !Objects.equals(salaryAcctTaxAgent.getSalaryAcctRecordId(), e.getSalaryAcctRecordId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isEmpty(salaryAcctTaxAgentList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 如果某个月(税款所属期)还未申报,不可以新建之后月份的薪资核算
|
||||||
|
SalaryAcctTaxAgentPO notDeclareSalaryAcctTaxAgent = salaryAcctTaxAgentList.stream()
|
||||||
|
.filter(e -> salaryAcctTaxAgent.getTaxCycle().compareTo(e.getTaxCycle()) > 0
|
||||||
|
&& !declareTaxAgents.contains(e.getTaxAgentId() + "-" + e.getTaxCycle()))
|
||||||
|
.findAny()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(notDeclareSalaryAcctTaxAgent)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160504, "个税扣缴义务人「{0}」的税款所属期「{1}」的个税还未申报,请先申报后再来新建税款所属期「{2}」的薪资核算")
|
||||||
|
.replace("{0}", taxAgentMap.get(notDeclareSalaryAcctTaxAgent.getTaxAgentId()))
|
||||||
|
.replace("{1}", SalaryDateUtil.getFormatYYYYMM(notDeclareSalaryAcctTaxAgent.getTaxCycle()))
|
||||||
|
.replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getTaxCycle())));
|
||||||
|
}
|
||||||
|
// 如果某个月(税款所属期)已经核算了,不可以新建之前月份的薪资核算
|
||||||
|
SalaryAcctTaxAgentPO calculatedSalaryAcctTaxAgent = salaryAcctTaxAgentList.stream()
|
||||||
|
.filter(e -> salaryAcctTaxAgent.getTaxCycle().compareTo(e.getTaxCycle()) < 0)
|
||||||
|
.findAny()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(calculatedSalaryAcctTaxAgent)) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160506, "个税扣缴义务人「{0}」已经存在薪资所属月「{1}」的薪资核算记录了,无法新建薪资所属月「{2}」的薪资核算")
|
||||||
|
.replace("{0}", taxAgentMap.get(calculatedSalaryAcctTaxAgent.getTaxAgentId()))
|
||||||
|
.replace("{1}", SalaryDateUtil.getFormatYYYYMM(calculatedSalaryAcctTaxAgent.getSalaryMonth()))
|
||||||
|
.replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getSalaryMonth())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<SalaryAcctRecordPO> listByCreateDate(LocalDateRange taxCycleRebootYearRange, Set<Long> salarySobIds) {
|
private List<SalaryAcctRecordPO> listByCreateDate(LocalDateRange taxCycleRebootYearRange, Set<Long> salarySobIds) {
|
||||||
return getSalaryAcctRecordMapper().listByCreateDate(taxCycleRebootYearRange, salarySobIds);
|
return getSalaryAcctRecordMapper().listByCreateDate(taxCycleRebootYearRange, salarySobIds);
|
||||||
}
|
}
|
||||||
|
|
@ -594,7 +743,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
||||||
// salaryAcctRecordPO.setUpdateTime(new Date());
|
// salaryAcctRecordPO.setUpdateTime(new Date());
|
||||||
// getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
|
// getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey);
|
// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId());
|
||||||
// LoggerContext<SalaryAcctRecordPO> loggerContext = new LoggerContext<>();
|
// LoggerContext<SalaryAcctRecordPO> loggerContext = new LoggerContext<>();
|
||||||
// loggerContext.setTargetId("" + salaryAcctRecordPO.getId());
|
// loggerContext.setTargetId("" + salaryAcctRecordPO.getId());
|
||||||
// loggerContext.setTargetName(targetName);
|
// loggerContext.setTargetName(targetName);
|
||||||
|
|
|
||||||
|
|
@ -1,65 +1,45 @@
|
||||||
//package com.engine.salary.service.impl;
|
package com.engine.salary.service.impl;
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.engine.core.impl.Service;
|
||||||
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.engine.salary.common.YearMonthRange;
|
||||||
//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||||
//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
import com.engine.salary.mapper.salaryacct.SalaryAcctTaxAgentMapper;
|
||||||
//import com.engine.core.impl.Service;
|
import com.engine.salary.service.SalaryAcctTaxAgentService;
|
||||||
//import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
//import com.engine.salary.service.SalaryAcctTaxAgentService;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
//import com.google.common.collect.Lists;
|
|
||||||
//import com.google.common.collect.Sets;
|
import java.util.Collection;
|
||||||
//import com.weaver.common.distribution.genid.IdGenerator;
|
import java.util.Collections;
|
||||||
//import com.weaver.common.hr.util.Util;
|
import java.util.List;
|
||||||
//import com.weaver.hrm.salary.common.YearMonthRange;
|
import java.util.Objects;
|
||||||
//import com.weaver.hrm.salary.dao.SalaryAcctTaxAgentMapper;
|
|
||||||
//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService {
|
||||||
//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum;
|
|
||||||
//import org.apache.commons.collections4.CollectionUtils;
|
private SalaryAcctTaxAgentMapper getSalaryAcctTaxAgentMapper() {
|
||||||
//import org.springframework.transaction.annotation.Transactional;
|
return MapperProxyFactory.getProxy(SalaryAcctTaxAgentMapper.class);
|
||||||
//
|
}
|
||||||
//import java.time.LocalDateTime;
|
@Override
|
||||||
//import java.util.*;
|
public List<SalaryAcctTaxAgentPO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||||
//
|
if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
||||||
///**
|
return Collections.emptyList();
|
||||||
// * @description:
|
}
|
||||||
// * @author: xiajun
|
return getSalaryAcctTaxAgentMapper().listAcctTaxAgent(salaryAcctRecordIds);
|
||||||
// * @modified By: xiajun
|
}
|
||||||
// * @date: 2022/7/29 9:45
|
|
||||||
// * @version:v1.0
|
@Override
|
||||||
// */
|
public List<SalaryAcctTaxAgentPO> listByTaxCycleRange(YearMonthRange taxCycleRange) {
|
||||||
//public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService {
|
SalaryAcctTaxAgentPO queryWrapper = new SalaryAcctTaxAgentPO();
|
||||||
//
|
if (Objects.nonNull(taxCycleRange.getStartMonth())) {
|
||||||
// private SalaryAcctTaxAgentMapper salaryAcctTaxAgentMapper;
|
queryWrapper.setStartMonth(taxCycleRange.getStartMonth());
|
||||||
//
|
}
|
||||||
|
if (Objects.nonNull(taxCycleRange.getEndMonth())) {
|
||||||
|
queryWrapper.setEndMonth(taxCycleRange.getEndMonth());
|
||||||
|
}
|
||||||
|
return getSalaryAcctTaxAgentMapper().listByTaxCycleRange(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public List<SalaryAcctTaxAgentPO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds, String tenantKey) {
|
// public List<SalaryAcctTaxAgentPO> initBySalaryAcctEmployees(List<SalaryAcctEmployeePO> salaryAcctEmployees) {
|
||||||
// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
|
||||||
// return Collections.emptyList();
|
|
||||||
// }
|
|
||||||
// return new LambdaQueryChainWrapper<>(salaryAcctTaxAgentMapper)
|
|
||||||
// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey)
|
|
||||||
// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
|
||||||
// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds)
|
|
||||||
// .list();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public List<SalaryAcctTaxAgentPO> listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) {
|
|
||||||
// LambdaQueryWrapper<SalaryAcctTaxAgentPO> queryWrapper = Wrappers.lambdaQuery();
|
|
||||||
// queryWrapper.eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey);
|
|
||||||
// queryWrapper.eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
|
||||||
// if (Objects.nonNull(taxCycleRange.getStartMonth())) {
|
|
||||||
// queryWrapper.ge(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getStartMonth().toString());
|
|
||||||
// }
|
|
||||||
// if (Objects.nonNull(taxCycleRange.getEndMonth())) {
|
|
||||||
// queryWrapper.le(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getEndMonth().toString());
|
|
||||||
// }
|
|
||||||
// return salaryAcctTaxAgentMapper.selectList(queryWrapper);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public List<SalaryAcctTaxAgentPO> initBySalaryAcctEmployees(List<SalaryAcctEmployeePO> salaryAcctEmployees, Long employeeId, String tenantKey) {
|
|
||||||
// if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
// if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||||
// return Collections.emptyList();
|
// return Collections.emptyList();
|
||||||
// }
|
// }
|
||||||
|
|
@ -89,19 +69,18 @@
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
// public void batchSave(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents) {
|
||||||
// public void batchSave(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents, String tenantKey) {
|
|
||||||
// if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) {
|
// if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) {
|
||||||
// saveBatch(salaryAcctTaxAgents);
|
// saveBatch(salaryAcctTaxAgents);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds, String tenantKey) {
|
// public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||||
// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// new LambdaUpdateChainWrapper<>(salaryAcctTaxAgentMapper)
|
// new LambdaUpdateChainWrapper<>(getSalaryAcctTaxAgentMapper())
|
||||||
// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey)
|
// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey)
|
||||||
// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
|
||||||
// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds)
|
// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds)
|
||||||
|
|
@ -109,4 +88,4 @@
|
||||||
// .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now())
|
// .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now())
|
||||||
// .update();
|
// .update();
|
||||||
// }
|
// }
|
||||||
//}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1292,4 +1292,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
||||||
}
|
}
|
||||||
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
|
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SalaryArchivePO> listByRunStatus(List<String> list) {
|
||||||
|
return getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().runStatusList(list).build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,9 @@ import com.engine.salary.mapper.formula.FormulaVarMapper;
|
||||||
import com.engine.salary.service.FormulaRunService;
|
import com.engine.salary.service.FormulaRunService;
|
||||||
import com.engine.salary.service.RemoteExcelService;
|
import com.engine.salary.service.RemoteExcelService;
|
||||||
import com.engine.salary.service.SalaryFormulaService;
|
import com.engine.salary.service.SalaryFormulaService;
|
||||||
|
import com.engine.salary.util.JsonUtil;
|
||||||
import com.engine.salary.util.db.MapperProxyFactory;
|
import com.engine.salary.util.db.MapperProxyFactory;
|
||||||
import com.engine.salary.util.valid.ValidUtil;
|
import com.engine.salary.util.valid.ValidUtil;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import dm.jdbc.util.IdGenerator;
|
import dm.jdbc.util.IdGenerator;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -47,7 +45,6 @@ import java.util.stream.Collectors;
|
||||||
**/
|
**/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaService {
|
public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaService {
|
||||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
|
|
||||||
private FormulaMapper getFormulaMapper() {
|
private FormulaMapper getFormulaMapper() {
|
||||||
return MapperProxyFactory.getProxy(FormulaMapper.class);
|
return MapperProxyFactory.getProxy(FormulaMapper.class);
|
||||||
|
|
@ -171,12 +168,9 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
|
||||||
|
|
||||||
String sqlReturnKey = "";
|
String sqlReturnKey = "";
|
||||||
try {
|
try {
|
||||||
JsonNode jsonNode = objectMapper.readTree(extendParam);
|
Map<String, String> map = JsonUtil.parseMap(extendParam, String.class);
|
||||||
JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey");
|
sqlReturnKey = map.getOrDefault("sqlReturnKey", "");
|
||||||
if (sqlReturnKeyNode != null) {
|
} catch (Exception e) {
|
||||||
sqlReturnKey = sqlReturnKeyNode.asText();
|
|
||||||
}
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
log.error("express execute fail, sql extendParam parse fail", e);
|
log.error("express execute fail, sql extendParam parse fail", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,12 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService {
|
||||||
if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) {
|
if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) {
|
||||||
salarySobItem = salarySobItemMap.get("addUpTaxPayable");
|
salarySobItem = salarySobItemMap.get("addUpTaxPayable");
|
||||||
}
|
}
|
||||||
|
if (Objects.equals(declaredField.getName(), "addUpTaxExemptIncome")) {
|
||||||
|
salarySobItem = salarySobItemMap.get("addUpTaxFreeIncome");
|
||||||
|
}
|
||||||
|
if (Objects.equals(declaredField.getName(), "addUpTaxSavings")) {
|
||||||
|
salarySobItem = salarySobItemMap.get("addUpTaxDeduction");
|
||||||
|
}
|
||||||
if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) {
|
if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.service.impl;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.common.LocalDateRange;
|
import com.engine.salary.common.LocalDateRange;
|
||||||
|
import com.engine.salary.common.YearMonthRange;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
|
|
@ -357,4 +358,11 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
||||||
getTaxDeclarationMapper().batchInsert(taxDeclarations);
|
getTaxDeclarationMapper().batchInsert(taxDeclarations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TaxDeclarationPO> listByTaxCycleRange(YearMonthRange yearMonthRange) {
|
||||||
|
return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder()
|
||||||
|
.salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build())
|
||||||
|
.build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SalaryAcctTaxAgentService salaryAcctTaxAgentService;
|
private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) {
|
||||||
|
return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user);
|
||||||
|
}
|
||||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||||
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import com.engine.common.util.ParamUtil;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||||
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||||
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.*;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.util.ResponseResult;
|
import com.engine.salary.util.ResponseResult;
|
||||||
import com.engine.salary.util.SalaryDateUtil;
|
import com.engine.salary.util.SalaryDateUtil;
|
||||||
|
|
@ -22,10 +24,7 @@ import weaver.hrm.User;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.POST;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
@ -271,8 +270,8 @@ public class AddUpDeductionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 新建累计专项附加扣除
|
|
||||||
* @return String
|
* @return String
|
||||||
|
* @description 新建累计专项附加扣除
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/26 14:23
|
* @date 2022/10/26 14:23
|
||||||
*/
|
*/
|
||||||
|
|
@ -285,8 +284,8 @@ public class AddUpDeductionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 获取累计专项附加扣除信息
|
|
||||||
* @return String
|
* @return String
|
||||||
|
* @description 获取累计专项附加扣除信息
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/31 11:23
|
* @date 2022/10/31 11:23
|
||||||
*/
|
*/
|
||||||
|
|
@ -300,8 +299,8 @@ public class AddUpDeductionController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 编辑累计专项附加扣除
|
|
||||||
* @return String
|
* @return String
|
||||||
|
* @description 编辑累计专项附加扣除
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/25 14:08
|
* @date 2022/10/25 14:08
|
||||||
*/
|
*/
|
||||||
|
|
@ -314,8 +313,8 @@ public class AddUpDeductionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 累计专项附加扣除-删除所选
|
|
||||||
* @return String
|
* @return String
|
||||||
|
* @description 累计专项附加扣除-删除所选
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/27 14:08
|
* @date 2022/10/27 14:08
|
||||||
*/
|
*/
|
||||||
|
|
@ -328,8 +327,8 @@ public class AddUpDeductionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 累计专项附加扣除-一键清空
|
|
||||||
* @return String
|
* @return String
|
||||||
|
* @description 累计专项附加扣除-一键清空
|
||||||
* @author Harryxzy
|
* @author Harryxzy
|
||||||
* @date 2022/10/27 14:08
|
* @date 2022/10/27 14:08
|
||||||
*/
|
*/
|
||||||
|
|
@ -353,6 +352,7 @@ public class AddUpDeductionController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键自动累计
|
* 一键自动累计
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
|
|
@ -374,4 +374,107 @@ public class AddUpDeductionController {
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
return new ResponseResult<Date, String>(user).run(getAddUpDeductionWrapper(user)::autoAddAll, date);
|
return new ResponseResult<Date, String>(user).run(getAddUpDeductionWrapper(user)::autoAddAll, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取
|
||||||
|
*
|
||||||
|
* @param param 前端请求参数
|
||||||
|
* @return WeaResult 接口返回信息
|
||||||
|
*/
|
||||||
|
@Path("/online/request")
|
||||||
|
@POST
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<AddUpDeductionMonthTaxAgentParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::onlineRequest, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取结果查询
|
||||||
|
*
|
||||||
|
* @return WeaResult 接口返回信息
|
||||||
|
*/
|
||||||
|
@Path("/online/feedback")
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String onlineFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<AddUpDeductionMonthTaxAgentParam, AddUpDeductionRequestResultDTO>(user).run(getAddUpDeductionWrapper(user)::onlineFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取失败结果查询
|
||||||
|
*
|
||||||
|
* @return WeaResult 接口返回信息
|
||||||
|
*/
|
||||||
|
@Path("/online/feedback/fail")
|
||||||
|
@POST
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String onlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRequestFailQueryParam queryParam) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<AddUpDeductionRequestFailQueryParam, PageInfo<AddUpDeductionRequestFailListDTO>>(user).run(getAddUpDeductionWrapper(user)::onlineFeedbackFail, queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取结果导出
|
||||||
|
*
|
||||||
|
* @return WeaResult 接口返回信息
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/online/feedback/fail/export")
|
||||||
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
|
public Response exportOnlineFeedbackFail(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "requestId") Long requestId) {
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
|
||||||
|
|
||||||
|
XSSFWorkbook workbook = getAddUpDeductionWrapper(user).exportOnlineFeedbackFail(requestId);
|
||||||
|
|
||||||
|
String fileName = "在线获取专项附加扣除失败数据" + LocalDate.now();
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamingOutput output = outputStream -> {
|
||||||
|
workbook.write(outputStream);
|
||||||
|
outputStream.flush();
|
||||||
|
};
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("往期累计情况导入模板导出异常", e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 在线获取表单
|
||||||
|
// *
|
||||||
|
// * @return WeaResult 返回结果
|
||||||
|
// */
|
||||||
|
// @Path("/online/request/form")
|
||||||
|
// @GET
|
||||||
|
// @Produces(MediaType.APPLICATION_JSON)
|
||||||
|
// public String getForm() {
|
||||||
|
// return WeaResult.success(addUpDeductionWrapper.getRequestForm());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 自动计算次月
|
||||||
|
// *
|
||||||
|
// * @param queryParam 查询条件
|
||||||
|
// * @return WeaResult 返回结果
|
||||||
|
// */
|
||||||
|
// @Path("/autoCalculate")
|
||||||
|
// @POST
|
||||||
|
// @Produces(MediaType.APPLICATION_JSON)
|
||||||
|
// public String autoCalculate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionQueryParam queryParam) {
|
||||||
|
// addUpDeductionWrapper.autoCalculate(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||||
|
// return WeaResult.success(null);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -354,4 +354,17 @@ public class AddUpSituationController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线获取实际累计已预扣预缴税额
|
||||||
|
*
|
||||||
|
* @param param 前端请求参数
|
||||||
|
* @return WeaResult 接口返回信息
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/online/actualAddUpAdvanceTax")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String onlineRequest(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return new ResponseResult<AddUpDeductionMonthTaxAgentParam, Map<String, Object>>(user).run(getAddUpSituationWrapper(user)::onlineRequest, param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestFailListDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRequestResultDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestFailPO;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.service.AddUpDeductionService;
|
import com.engine.salary.service.AddUpDeductionService;
|
||||||
import com.engine.salary.service.SalaryEmployeeService;
|
import com.engine.salary.service.SalaryEmployeeService;
|
||||||
|
|
@ -179,4 +179,36 @@ public class AddUpDeductionWrapper extends Service {
|
||||||
}
|
}
|
||||||
return getAddUpDeductionService(user).autoAddAll(yearMonth, null);
|
return getAddUpDeductionService(user).autoAddAll(yearMonth, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
return getAddUpDeductionService(user).onlineRequest(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddUpDeductionRequestResultDTO onlineFeedback() {
|
||||||
|
return getAddUpDeductionService(user).onlineFeedback();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<AddUpDeductionRequestFailListDTO> onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) {
|
||||||
|
if (queryParam.getRequestId() == null) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153345, "在线获取的请求ID不可为空"));
|
||||||
|
}
|
||||||
|
PageInfo<AddUpDeductionRequestFailListDTO> page = getAddUpDeductionService(user).onlineFeedbackFail(queryParam);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public XSSFWorkbook exportOnlineFeedbackFail(Long requestId) {
|
||||||
|
List<AddUpDeductionRequestFailPO> poList = getAddUpDeductionService(user).getAddUpDeductionRequestFailPOList(requestId);
|
||||||
|
if (CollectionUtils.isEmpty(poList)) {
|
||||||
|
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(95795, "数据不存在") + "[id:%s]", requestId));
|
||||||
|
}
|
||||||
|
return getAddUpDeductionService(user).exportOnlineFeedbackFail(requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// public WeaForm getRequestForm() {
|
||||||
|
// WeaForm weaForm = SalaryFormatUtil.<AddUpDeductionRequestFormDTO>getInstance().buildForm(AddUpDeductionRequestFormDTO.class, new AddUpDeductionRequestFormDTO());
|
||||||
|
// WeaFormSalaryItem item = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER, "month", "YYYY-MM", "YYYY-MM");
|
||||||
|
// item.setRequired(true);
|
||||||
|
// weaForm.getItems().put("declareMonth", item);
|
||||||
|
// return weaForm;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,7 @@ import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
||||||
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam;
|
import com.engine.salary.entity.datacollection.param.*;
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationImportParam;
|
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationParam;
|
|
||||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.service.AddUpSituationService;
|
import com.engine.salary.service.AddUpSituationService;
|
||||||
import com.engine.salary.service.impl.AddUpSituationServiceImpl;
|
import com.engine.salary.service.impl.AddUpSituationServiceImpl;
|
||||||
|
|
@ -169,4 +166,8 @@ public class AddUpSituationWrapper extends Service {
|
||||||
public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) {
|
public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) {
|
||||||
return getAddUpSituationService(user).getAddUpSituation(addUpSituationParam);
|
return getAddUpSituationService(user).getAddUpSituation(addUpSituationParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> onlineRequest(AddUpDeductionMonthTaxAgentParam param) {
|
||||||
|
return getAddUpSituationService(user).onlineRequest(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue