diff --git a/resource/sqlupgrade/DM/sql202309040303.sql b/resource/sqlupgrade/DM/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309040303.sql @@ -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 +); +/ + diff --git a/resource/sqlupgrade/DM/sql202309050103.sql b/resource/sqlupgrade/DM/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309050103.sql @@ -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); +/ + diff --git a/resource/sqlupgrade/DM/sql202309050203.sql b/resource/sqlupgrade/DM/sql202309050203.sql new file mode 100644 index 000000000..4603c0e75 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202309050203.sql @@ -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; +/ + diff --git a/resource/sqlupgrade/GS/sql202309040303.sql b/resource/sqlupgrade/GS/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309040303.sql @@ -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 +); +/ + diff --git a/resource/sqlupgrade/GS/sql202309050103.sql b/resource/sqlupgrade/GS/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309050103.sql @@ -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); +/ + diff --git a/resource/sqlupgrade/GS/sql202309050203.sql b/resource/sqlupgrade/GS/sql202309050203.sql new file mode 100644 index 000000000..4603c0e75 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202309050203.sql @@ -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; +/ + diff --git a/resource/sqlupgrade/JC/sql202309040303.sql b/resource/sqlupgrade/JC/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309040303.sql @@ -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 +); +/ + diff --git a/resource/sqlupgrade/JC/sql202309050103.sql b/resource/sqlupgrade/JC/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309050103.sql @@ -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); +/ + diff --git a/resource/sqlupgrade/JC/sql202309050203.sql b/resource/sqlupgrade/JC/sql202309050203.sql new file mode 100644 index 000000000..4603c0e75 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202309050203.sql @@ -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; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202309040303.sql b/resource/sqlupgrade/Mysql/sql202309040303.sql new file mode 100644 index 000000000..09de22bfa --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309040303.sql @@ -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' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202309050103.sql b/resource/sqlupgrade/Mysql/sql202309050103.sql new file mode 100644 index 000000000..67dd54d95 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309050103.sql @@ -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); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202309050203.sql b/resource/sqlupgrade/Mysql/sql202309050203.sql new file mode 100644 index 000000000..c5fce8081 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202309050203.sql @@ -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; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309040303.sql b/resource/sqlupgrade/Oracle/sql202309040303.sql new file mode 100644 index 000000000..1e666275e --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309040303.sql @@ -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 +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050103.sql b/resource/sqlupgrade/Oracle/sql202309050103.sql new file mode 100644 index 000000000..c010cb4ef --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309050103.sql @@ -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) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql new file mode 100644 index 000000000..62458bdf3 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202309050203.sql @@ -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 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309040303.sql b/resource/sqlupgrade/PG/sql202309040303.sql new file mode 100644 index 000000000..eefe81ecd --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309040303.sql @@ -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 +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050103.sql b/resource/sqlupgrade/PG/sql202309050103.sql new file mode 100644 index 000000000..442635f18 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309050103.sql @@ -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); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202309050203.sql b/resource/sqlupgrade/PG/sql202309050203.sql new file mode 100644 index 000000000..50cbec61f --- /dev/null +++ b/resource/sqlupgrade/PG/sql202309050203.sql @@ -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 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309040303.sql b/resource/sqlupgrade/SQLServer/sql202309040303.sql new file mode 100644 index 000000000..bdfa19c5f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309040303.sql @@ -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 \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050103.sql b/resource/sqlupgrade/SQLServer/sql202309050103.sql new file mode 100644 index 000000000..362f2654c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309050103.sql @@ -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 \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202309050203.sql b/resource/sqlupgrade/SQLServer/sql202309050203.sql new file mode 100644 index 000000000..7e102b81a --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202309050203.sql @@ -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 \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202309040303.sql b/resource/sqlupgrade/ST/sql202309040303.sql new file mode 100644 index 000000000..5805822bc --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309040303.sql @@ -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 +); +/ + diff --git a/resource/sqlupgrade/ST/sql202309050103.sql b/resource/sqlupgrade/ST/sql202309050103.sql new file mode 100644 index 000000000..e9e5dfeee --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309050103.sql @@ -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); +/ + diff --git a/resource/sqlupgrade/ST/sql202309050203.sql b/resource/sqlupgrade/ST/sql202309050203.sql new file mode 100644 index 000000000..4603c0e75 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202309050203.sql @@ -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; +/ + diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 47e0741f7..69b12aa04 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -504,7 +504,12 @@ public class SIAccountBiz extends Service { //TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); String billMonth = param.getBillMonth(); try { - List list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); +// List list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); + List list = new ArrayList<>(); + List> partitionDetailTempInfo = Lists.partition((List) ids, 100); + partitionDetailTempInfo.forEach(part -> list.addAll( + getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(part, billMonth, param.getPaymentOrganization()))); + encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class); Integer paymentStatus = 0; log.info("鏍哥畻鏄庣粏涓存椂琛 hrsa_bill_detail_temp寰呭鐞嗘暟閲忥細{}", list.size()); diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index 698f662f8..b4e04552a 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -137,6 +137,10 @@ public class SzyhApiConstant { * 鍒锋柊缂存鐘舵 */ public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + /** + * 浼佷笟鐢虫姤鏁版嵁鏄庣粏鏌ヨ + */ + public static final String GET_COMPANY_INCOMES = "gateway/iit/report/getCompanyIncomes"; /** diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index eeae5d130..5771dabf0 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -4,6 +4,7 @@ import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableOperate; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -49,6 +50,12 @@ public class AddUpSituation { */ 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 + @Deprecated private String addUpChildEducation; /** * 绱缁х画鏁欒偛 */ - @SalaryFormulaVar(defaultLabel = "绱缁х画鏁欒偛", labelId = 86323, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱缁х画鏁欒偛", labelId = 86323, dataType = "number") @Encrypt + @Deprecated private String addUpContinuingEducation; /** * 绱浣忔埧璐锋鍒╂伅 */ - @SalaryFormulaVar(defaultLabel = "绱浣忔埧璐锋鍒╂伅", labelId = 86324, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱浣忔埧璐锋鍒╂伅", labelId = 86324, dataType = "number") @Encrypt + @Deprecated private String addUpHousingLoanInterest; /** * 绱浣忔埧绉熼噾 */ - @SalaryFormulaVar(defaultLabel = "绱浣忔埧绉熼噾", labelId = 86325, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱浣忔埧绉熼噾", labelId = 86325, dataType = "number") @Encrypt + @Deprecated private String addUpHousingRent; /** * 绱璧″吇鑰佷汉 */ - @SalaryFormulaVar(defaultLabel = "绱璧″吇鑰佷汉", labelId = 86326, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱璧″吇鑰佷汉", labelId = 86326, dataType = "number") @Encrypt + @Deprecated private String addUpSupportElderly; /** * 绱澶х梾鍖荤枟 */ - @SalaryFormulaVar(defaultLabel = "绱澶х梾鍖荤枟", labelId = 105142, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱澶х梾鍖荤枟", labelId = 105142, dataType = "number") @Encrypt + @Deprecated private String addUpIllnessMedical; /** * 绱濠村辜鍎跨収鎶 */ - @SalaryFormulaVar(defaultLabel = "绱濠村辜鍎跨収鎶", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱濠村辜鍎跨収鎶", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpInfantCare; /** * 绱濠村辜鍎跨収鎶 */ - @SalaryFormulaVar(defaultLabel = "绱涓汉鍏昏侀噾", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱涓汉鍏昏侀噾", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpPrivatePension; /** @@ -175,6 +190,27 @@ public class AddUpSituation { @Encrypt private String addUpAdvanceTax; + /** + * 瀹為檯绱宸查鎵i缂寸◣棰 + */ + @SalaryFormulaVar(defaultLabel = "瀹為檯绱宸查鎵i缂寸◣棰", 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; + /** * 鍒涘缓鏃堕棿 */ diff --git a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index db9a2241d..46cd04e6d 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,15 +1,28 @@ 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.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.service.impl.AddUpDeductionServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import dm.jdbc.util.IdGenerator; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.HashMap; -import java.util.Map; +import java.util.*; /** * @Description: 鏁版嵁閲囬泦 @@ -318,79 +331,80 @@ public class DataCollectionBO { return requestParam; } -// public static List> getEmployeeList(List declarePOList) { -// List> employeeList = new ArrayList<>(); -// for (EmployeeDeclarePO employeeDeclarePO : declarePOList) { -// Map employeeMap = new HashMap<>(32); -// employeeMap.put("xm", employeeDeclarePO.getEmployeeName()); -// employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); -// employeeMap.put("zzhm", employeeDeclarePO.getCardNum()); -// employeeMap.put("lxdh", employeeDeclarePO.getMobile()); -// employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel()); -// employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel()); -// employeeMap.put("rzsgrq", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getEmploymentDate())); -// 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("gj", "涓浗"); -// employeeMap.put("rydq", "澧冨唴"); -// boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); -// boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); -// employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); -// employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); -// employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); -// employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); -// employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); -// employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); -// employeeList.add(employeeMap); -// } -// return employeeList; -// } -// -// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { -// return AddUpDeduction.builder() -// .id(IdGenerator.generate()) -// .addUpChildEducation(feedback.getLjznjyzc().toString()) -// .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) -// .addUpHousingRent(feedback.getLjzfzjzc().toString()) -// .addUpInfantCare(feedback.getLjyyezhzc().toString()) -// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) -// .addUpSupportElderly(feedback.getLjsylrzc().toString()) -// .addUpIllnessMedical("0") + public static List> getEmployeeList(List declarePOList) { + List> employeeList = new ArrayList<>(); + for (EmployeeDeclarePO employeeDeclarePO : declarePOList) { + Map employeeMap = new HashMap<>(32); + employeeMap.put("xm", employeeDeclarePO.getEmployeeName()); + employeeMap.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + employeeMap.put("zzhm", employeeDeclarePO.getCardNum()); + employeeMap.put("lxdh", employeeDeclarePO.getMobile()); + employeeMap.put("nsrzt", EmploymentStatusEnum.NORMAL.getDefaultLabel()); + employeeMap.put("sfgy", EmploymentTypeEnum.EMPLOYEE.getDefaultLabel()); + employeeMap.put("rzsgrq", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getEmploymentDate())); + employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel()); + employeeMap.put("csny", SalaryDateUtil.getFormatYYYYMM(employeeDeclarePO.getBirthday())); + employeeMap.put("gj", "涓浗"); + employeeMap.put("rydq", "澧冨唴"); + boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); + boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); + employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); + employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); + employeeMap.computeIfAbsent("sfls", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); + employeeMap.computeIfAbsent("lszh", e -> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); + employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); + employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); + employeeList.add(employeeMap); + } + return employeeList; + } + + public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { + return AddUpDeduction.builder() + .id(IdGenerator.generate()) + .addUpChildEducation(feedback.getLjznjyzc().toString()) + .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) + .addUpHousingRent(feedback.getLjzfzjzc().toString()) + .addUpInfantCare(feedback.getLjyyezhzc().toString()) + .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) + .addUpSupportElderly(feedback.getLjsylrzc().toString()) + .addUpIllnessMedical("0") // .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue()) // .lastUpdateTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .build(); -// } -// -// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, -// AddUpDeductionRequestPO requestPO, -// Long employeeId) { -// return AddUpDeductionRequestFailPO.builder() -// .id(IdGenerator.generate()) -// .requestId(requestPO.getRequestId()) -// .outerRequestId(requestPO.getOuterRequestId()) -// .taxYearMonth(requestPO.getTaxYearMonth()) -// .taxAgentId(requestPO.getTaxAgentId()) -// .employeeId(Optional.ofNullable(employeeId).orElse(0L)) -// .createTime(LocalDateTime.now()) -// .updateTime(LocalDateTime.now()) -// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) -// .creator(requestWrapper.getCurrentEmployeeId()) -// .tenantKey(requestPO.getTenantKey()) -// .build(); -// } -// -// public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { -// return AddUpDeductionRequestResultDTO.builder() -// .requestId(requestId.toString()) -// .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "鍏辨垚鍔熻幏鍙栨暟鎹%s鏉★紝澶辫触%s鏉"), -// requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), -// requestWrapper.getFailPOList().size())) -// .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") -// .finish(true) -// .build(); -// } -// + .updateTime(new Date()) + .build(); + } + + public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, + AddUpDeductionRequestPO requestPO, + Long employeeId) { + Date now = new Date(); + return AddUpDeductionRequestFailPO.builder() + .id(IdGenerator.generate()) + .requestId(requestPO.getRequestId()) + .outerRequestId(requestPO.getOuterRequestId()) + .taxYearMonth(requestPO.getTaxYearMonth()) + .taxAgentId(requestPO.getTaxAgentId()) + .employeeId(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .creator(requestWrapper.getCurrentEmployeeId()) + .tenantKey(requestPO.getTenantKey()) + .build(); + } + + public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { + return AddUpDeductionRequestResultDTO.builder() + .requestId(requestId.toString()) + .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "鍏辨垚鍔熻幏鍙栨暟鎹%s鏉★紝澶辫触%s鏉"), + requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), + requestWrapper.getFailPOList().size())) + .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") + .finish(true) + .build(); + } + // public static AddUpDeduction buildAddUpDeductionPO(AddUpDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { // return AddUpDeduction.builder() // .id(IdGenerator.generate()) diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java new file mode 100644 index 000000000..df82a8178 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestFailListDTO.java @@ -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; + + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇澶辫触鍒楄〃 + * + * @author chengliming + * @date 2022-11-07 15:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇澶辫触鍒楄〃") +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 = "涓◣鎵g即涔夊姟浜", labelId = 86184, width = "150") + @ApiModelProperty("涓◣鎵g即涔夊姟浜") + 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; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java new file mode 100644 index 000000000..5ef39f2e0 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRequestResultDTO.java @@ -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; + + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇缁撴灉 + * + * @author chengliming + * @date 2022-11-01 09:47:27 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ApiModel("鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇缁撴灉") +public class AddUpDeductionRequestResultDTO { + @ApiModelProperty("璇锋眰id") + private String requestId; + + @ApiModelProperty("鎻愮ず璇") + private String msg; + + @ApiModelProperty("澶勭悊缁撴灉") + private String result; + + @ApiModelProperty("鏄惁缁撴潫杞") + private Boolean finish; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java new file mode 100644 index 000000000..b22d0fd84 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java @@ -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; + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鏈堜唤+鎵g即涓讳綋鍙傛暟 + * + * @author : chengliming + * @Date: 2022-09-29 10:38:25 + */ +@Data +@ApiModel("鏁版嵁閲囬泦-绱涓撻」闄勫姞鏈堜唤+鎵g即涓讳綋鍙傛暟") +public class AddUpDeductionMonthTaxAgentParam { + + @ApiModelProperty("绋庢鎵灞炴湡") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date declareMonth; + + @ApiModelProperty("涓◣鎵g即涔夊姟浜虹殑涓婚敭id") + private Long taxAgentId; + +} diff --git a/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java new file mode 100644 index 000000000..2be0f746d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionRequestFailQueryParam.java @@ -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.*; + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇澶辫触璁板綍鏌ヨ鍙傛暟 + * + * @author chengliming + * @date 2022-11-01 14:40:36 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎-鍦ㄧ嚎鑾峰彇澶辫触璁板綍鏌ヨ鍙傛暟") +public class AddUpDeductionRequestFailQueryParam extends BaseQueryParam { + + @ApiModelProperty("璇锋眰ID") + private Long requestId; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java new file mode 100644 index 000000000..a5baf15ca --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestFailPO.java @@ -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; + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎鍦ㄧ嚎鏌ヨ澶辫触琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_add_up_deduction_req_fail") +//鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎鍦ㄧ嚎鏌ヨ澶辫触琛") +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; + + //鍒涘缓浜篿d", 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; + + //涓◣鎵g即涔夊姟浜篒D") + private Long taxAgentId; + + //澶辫触鍘熷洜") + private String reason; + + //绋庢鎵灞炴湡") + private Date taxYearMonth; + + /** + * @see EmployeeTypeEnum + */ + //浜哄憳绫诲瀷") + private Integer employeeType; + + + private Collection ids; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java new file mode 100644 index 000000000..6894a68ed --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/AddUpDeductionRequestPO.java @@ -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; + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎鍦ㄧ嚎鏌ヨ琛 + * + * @author chengliming + * @date: 2022-10-26 16:07:04 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_add_up_deduction_request +//鏁版嵁閲囬泦-绱涓撻」闄勫姞鎵i櫎鍦ㄧ嚎鏌ヨ琛 +public class AddUpDeductionRequestPO implements Serializable { + + private static final long serialVersionUID = 1452863635879051515L; + + //ID + private Long id; + + //鍒涘缓鏃堕棿" + private Date createTime; + + //淇敼鏃堕棿" + private Date updateTime; + + //鍒涘缓浜篿d" + 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; + + //涓◣鎵g即涔夊姟浜篒D + private Long taxAgentId; + + + + private Collection ids; + private Collection requestStatuss; + private Integer oldStatus; + private Integer oldLockVersion; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java b/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java new file mode 100644 index 000000000..c9ab8ac5a --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/DataCollectionBaseInfo.java @@ -0,0 +1,51 @@ +package com.engine.salary.entity.datacollection.po; + +import java.time.LocalDateTime; + +/** + * 鏁版嵁閲囬泦-鎶借薄鎺ュ彛-鏂逛究浣跨敤娉涘瀷灏佽鏂规硶(po缁ф壙绫讳細瀵艰嚧鍔犲瘑aop鎶ラ敊锛屽師鍥犱笉鐭ワ紝鎵浠ヨ繖閲屼娇鐢ㄦ帴鍙f娊璞) + * + * @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); +} diff --git a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java index 9aaaa7363..01c11be8e 100644 --- a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java @@ -17,6 +17,7 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +//hrsa_special_add_deduction public class SpecialAddDeductionPO { private Long id; diff --git a/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java b/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java new file mode 100644 index 000000000..0e71b0da8 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/GetCompanyIncomesResponse.java @@ -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; + +/** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉 + * + * @author chengliming + * @date 2022-10-27 10:00 AM + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class GetCompanyIncomesResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉body + **/ + @Data + public static class Body { + /** + * 鏄庣粏 + */ + private List 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; + /** + * 鍏佽鎵i櫎鐨勮垂鐢 + **/ + 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; + /** + * 鍏跺畠鎵i櫎 + **/ + private String qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 + **/ + private String zykcjze; + /** + * 绱鏀跺叆棰 + **/ + private String ljsre; + /** + * 绱鍑忛櫎璐圭敤 + **/ + private String ljjcfy; + /** + * 绱涓撻」鎵i櫎 + **/ + private String ljzxkc; + /** + * 绱瀛愬コ鏁欒偛 + **/ + private String ljznjy; + /** + * 绱璧″吇鑰佷汉 + **/ + private String ljsylr; + /** + * 绱浣忔埧璐锋鍒╂伅 + **/ + private String ljzfdklx; + /** + * 绱浣忔埧绉熼噾 + **/ + private String ljzfzj; + /** + * 绱缁х画鏁欒偛 + **/ + private String ljjxjy; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 + **/ + private String ljyyezhzc; + /** + * 绱鍏跺畠鎵i櫎 + **/ + private String ljqtkc; + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 + **/ + private String ljzykcjze; + /** + * 绱涓汉鍏昏侀噾 + **/ + private String ljgrylj; + /** + * 搴旂撼绋庢墍寰楅 + **/ + private String ynssde; + /** + * 绋庣巼 + **/ + private String sl; + /** + * 鍗忓畾绋庣巼 + **/ + private String xdsl; + /** + * 閫熺畻鎵i櫎鏁 + **/ + 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; + /** + * 鑲$エ浠g爜 + **/ + private String gpdm; + /** + * 鑲$エ鍚嶇О + **/ + private String gpmc; + /** + * 姣忚偂璁$◣浠锋牸 + **/ + private String mgjsjg; + /** + * 杞鑲℃暟 + **/ + private String zrgs; + /** + * 闄愬敭鑲″師鍊 + **/ + private String xsgyz; + /** + * 鍚堢悊绋庤垂 + **/ + private String hlsf; + /** + * 鎵i櫎鍙婂噺闄ら」鐩悎璁 + **/ + private String kcjjcxmhj; + } + + /** + * 鍚堣 + */ + @Data + public static class Sum { + /** + * 鏀跺叆棰濆悎璁 + */ + private String srehj; + /** + * 鍏嶇◣鏀跺叆鍚堣 + */ + private String mssrhj; + /** + * 璐骇鍘熷煎悎璁 + */ + private String ccyzhj; + /** + * 鎶曡祫鎶垫墸鍚堣 + */ + private String tzdkhj; + /** + * 鍏佽鎵i櫎鐨勭◣璐瑰悎璁 + */ + private String yxkcsfhj; + /** + * 鍩烘湰鍏昏佷繚闄╄垂鍚堣 + */ + private String jbylaobxfhj; + /** + * 鍩烘湰鍖荤枟淇濋櫓璐瑰悎璁 + */ + private String jbylbxfhj; + /** + * 澶变笟淇濋櫓璐瑰悎璁 + */ + private String sybxfhj; + /** + * 浣忔埧鍏Н閲戝悎璁 + */ + private String zfgjjhj; + /** + * 骞撮噾鍚堣 + */ + private String njhj; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓鍚堣 + */ + private String syjkbxhj; + /** + * 绋庡欢鍏昏佷繚闄╁悎璁 + */ + private String syylbxhj; + /** + * 鍏朵粬鎵i櫎鍚堣 + */ + private String qthj; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻鍚堣 + */ + private String zykcjzehj; + /** + * 绱鏀跺叆棰濆悎璁 + */ + private String ljsrehj; + /** + * 绱涓撻」鎵i櫎鍚堣 + */ + private String ljzxkchj; + /** + * 绱瀛愬コ鏁欒偛鍚堣 + */ + private String ljznjyhj; + /** + * 绱璧″吇鑰佷汉鍚堣 + */ + private String ljsylrhj; + /** + * 绱浣忔埧璐锋鍒╂伅鍚堣 + */ + private String ljzfdklxhj; + /** + * 绱浣忔埧绉熼噾鍚堣 + */ + private String ljzfzjhj; + /** + * 绱缁х画鏁欒偛鍚堣 + */ + private String ljjxjyhj; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭鍚堣 + */ + private String ljyyezhzchj; + /** + * 绱鍏朵粬鎵i櫎鍚堣 + */ + private String ljqtkchj; + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻鍚堣 + */ + private String ljzykcjzehj; + /** + * 绱涓汉鍏昏侀噾鍚堣 + */ + private String ljgryljhj; + /** + * 搴旂撼绋庢墍寰楅鍚堣 + */ + private String ynssdehj; + /** + * 搴旂撼绋庨鍚堣 + */ + private String ynsehj; + /** + * 鍑忓厤绋庨鍚堣 + */ + private String jmsehj; + /** + * 宸叉墸缂寸◣棰濆悎璁 + */ + private String ykjsehj; + /** + * 搴旇ˉ閫绋庨鍚堣 + */ + private String ybtsehj; + } + +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java index 4562612e1..fc5503724 100644 --- a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -2,28 +2,28 @@ package com.engine.salary.entity.datacollection.response; import com.engine.salary.entity.taxpayment.response.BaseResponse; import lombok.Data; +import lombok.EqualsAndHashCode; /** * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉 - *

Copyright: Copyright (c) 2023

- *

Company: 娉涘井杞欢

* * @author qiantao * @version 1.0 **/ @Data +@EqualsAndHashCode(callSuper = true) public class QuerySpecialAmountResponse extends BaseResponse { /** * 杩斿洖鏁版嵁 */ - private QuerySpecialAmountBody body; + private Body body; /** * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉body **/ @Data - public static class QuerySpecialAmountBody { + public static class Body { /** * 璇锋眰鏌ヨID */ diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index a8c23d03b..b589d29c5 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -219,4 +219,5 @@ public class EmployeeDeclarePO { private Collection ids; private Collection employeeIds; + private Collection taxAgentIds; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java index 4a7dd7da6..d12a5a5ac 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -1,9 +1,11 @@ package com.engine.salary.entity.salaryacct.po; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDateTime; import java.util.Date; /** @@ -15,7 +17,10 @@ import java.util.Date; * @version 1.0 **/ @Data +@Builder @Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor // "hrsa_acct_tax_agent") 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; } diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java index b338e53b6..717a5e960 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -145,6 +145,7 @@ public class TaxAgentTaxReturnPO implements Serializable { //鏌ヨ鏉′欢 + private Collection ids; private Collection taxAgentIds; private Collection taxCodes; } diff --git a/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java b/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java new file mode 100644 index 000000000..49cda3f90 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/EnumAddUpDeductionRequestStatus.java @@ -0,0 +1,52 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * 绱闄勫姞鎵i櫎璇锋眰澶栭儴鎺ュ彛澶勭悊鐘舵 + * + * @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 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); + } +} diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java new file mode 100644 index 000000000..1a2287833 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.java @@ -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 listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + AddUpDeductionRequestFailPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param addUpDeductionReqFail 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 鎵归噺鎻掑叆 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param addUpDeductionReqFail 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param addUpDeductionReqFail 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 鍒犻櫎璁板綍 + * + * @param addUpDeductionReqFail 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(AddUpDeductionRequestFailPO addUpDeductionReqFail); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml new file mode 100644 index 000000000..e0e740698 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestFailMapper.xml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + INSERT INTO hrsa_add_up_deduction_req_fail + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + id, + + + outer_request_id, + + + reason, + + + request_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{id}, + + + #{outerRequestId}, + + + #{reason}, + + + #{requestId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + 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 + + ( + #{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} + ) + + + + 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 + + ( + #{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} + ) + + + + 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) + + + 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 + + + + 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 + + ( + #{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} + ) + + + + + + UPDATE hrsa_add_up_deduction_req_fail + + 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}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_req_fail + + + 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}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_req_fail + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_add_up_deduction_req_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java new file mode 100644 index 000000000..5df335a15 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.java @@ -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 listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(AddUpDeductionRequestPO addUpDeductionRequest); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + AddUpDeductionRequestPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param addUpDeductionRequest 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 鎵归噺鎻掑叆 + * + * @param addUpDeductionRequest + */ + void batchInsert(@Param("collection") List addUpDeductionRequest); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param addUpDeductionRequest 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param addUpDeductionRequest 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 鍒犻櫎璁板綍 + * + * @param addUpDeductionRequest 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(AddUpDeductionRequestPO addUpDeductionRequest); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + int updateRequestStatusLockVersion(AddUpDeductionRequestPO build); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml new file mode 100644 index 000000000..b25dca50d --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AddUpDeductionRequestMapper.xml @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + 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, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{lockVersion}, + + + #{outerRequestId}, + + + #{requestId}, + + + #{requestStatus}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + 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} + + ) + + + + + 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 + ) + + 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 + + + + + + + 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} + ) + + + + + + UPDATE hrsa_add_up_deduction_request + + 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}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_request + + + 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}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_add_up_deduction_request + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_add_up_deduction_request + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_add_up_deduction_request + + request_status=#{requestStatus}, + lock_version=#{lockVersion}, + update_time=#{updateTime}, + + WHERE delete_type = 0 + AND request_status=#{oldStatus} + AND lock_version=#{oldLockVersion} + AND id = #{id} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index e137ec1ab..5f8eab4af 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -202,6 +202,12 @@ #{id} + + AND tax_agent_id IN + + #{taxAgentId} + + ORDER BY id DESC diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java new file mode 100644 index 000000000..ce3c104a4 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.java @@ -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 listAcctTaxAgent(@Param("salaryAcctRecordIds") Collection salaryAcctIds); + + List listByTaxCycleRange(SalaryAcctTaxAgentPO queryWrapper); +} diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml new file mode 100644 index 000000000..e9ed7eb66 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctTaxAgentMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 51498f653..126002890 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -3,10 +3,10 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +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.po.AddUpDeductionRequestFailPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -157,4 +157,43 @@ public interface AddUpDeductionService { * @author lfc */ String autoAddAll(Date yearMonth, Boolean isAdmin); + + /** + * 鍦ㄧ嚎鑾峰彇鏁版嵁 + * + * @param param + * @return + */ + Map onlineRequest(AddUpDeductionMonthTaxAgentParam param); + + /** + * 鍦ㄧ嚎鑾峰彇缁撴灉鏌ヨ + * + * @return + */ + AddUpDeductionRequestResultDTO onlineFeedback(); + + /** + * 鍦ㄧ嚎鑾峰彇澶辫触璁板綍 + * + * @param queryParam + * @return + */ + PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam); + + /** + * 鑾峰彇鍙嶉澶辫触璁板綍 + * + * @param requestId + * @return + */ + List getAddUpDeductionRequestFailPOList(Long requestId); + + /** + * 瀵煎嚭鍙嶉澶辫触璁板綍 + * + * @param requestId + */ + XSSFWorkbook exportOnlineFeedbackFail(Long requestId); + } diff --git a/src/com/engine/salary/service/AddUpSituationService.java b/src/com/engine/salary/service/AddUpSituationService.java index 2406e16be..ccfc26231 100644 --- a/src/com/engine/salary/service/AddUpSituationService.java +++ b/src/com/engine/salary/service/AddUpSituationService.java @@ -112,4 +112,12 @@ public interface AddUpSituationService { * @date 2022/10/31 14:00 */ AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam); + + /** + * 鍦ㄧ嚎鑾峰彇瀹為檯绱宸查鎵i缂寸◣棰 + * + * @param param + * @return + */ + Map onlineRequest(AddUpDeductionMonthTaxAgentParam param); } diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 4e7c8eb2e..51eb656e1 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -124,6 +124,13 @@ public interface SalaryAcctRecordService { */ Long save(SalaryAcctRecordSaveParam saveParam); + /** + * 淇濆瓨涔嬪墠妫鏌ヤ竴涓嬫槸鍚﹀彲浠ユ柊寤烘牳绠 + * + * @param salaryAcctTaxAgents + */ + void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents); + /** * 鏇存柊钖祫鏍哥畻璁板綍鐨勭姸鎬 * diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java index be75f76bf..e2796aa4a 100644 --- a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -1,7 +1,6 @@ package com.engine.salary.service; import com.engine.salary.common.YearMonthRange; -import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import java.util.Collection; @@ -33,25 +32,25 @@ public interface SalaryAcctTaxAgentService { */ List listByTaxCycleRange(YearMonthRange taxCycleRange); - /** - * 鏍规嵁钖祫鏍哥畻浜哄憳鍒濆鍖 - * - * @param salaryAcctEmployees - * @return - */ - List initBySalaryAcctEmployees(List salaryAcctEmployees); - - /** - * 鎵归噺淇濆瓨 - * - * @param salaryAcctTaxAgents - */ - void batchSave(List salaryAcctTaxAgents); - - /** - * 鏍规嵁钖祫鏍哥畻璁板綍id鍒犻櫎鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 - * - * @param salaryAcctRecordIds - */ - void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); +// /** +// * 鏍规嵁钖祫鏍哥畻浜哄憳鍒濆鍖 +// * +// * @param salaryAcctEmployees +// * @return +// */ +// List initBySalaryAcctEmployees(List salaryAcctEmployees); +// +// /** +// * 鎵归噺淇濆瓨 +// * +// * @param salaryAcctTaxAgents +// */ +// void batchSave(List salaryAcctTaxAgents); +// +// /** +// * 鏍规嵁钖祫鏍哥畻璁板綍id鍒犻櫎鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 +// * +// * @param salaryAcctRecordIds +// */ +// void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); } diff --git a/src/com/engine/salary/service/SalaryArchiveService.java b/src/com/engine/salary/service/SalaryArchiveService.java index c240adcf3..dbeb2d865 100644 --- a/src/com/engine/salary/service/SalaryArchiveService.java +++ b/src/com/engine/salary/service/SalaryArchiveService.java @@ -240,4 +240,6 @@ public interface SalaryArchiveService { * @return */ List listPayEndDateIsNull(List employeeIds); + + List listByRunStatus(List asList); } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 4e7d0e3ce..2731904a5 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; @@ -59,4 +60,14 @@ public interface TaxDeclarationService { void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); void saveBatch(List taxDeclarations); + + + /** + * 鏍规嵁绋庢鎵灞炴湡鏌ヨ涓◣鐢虫姤琛 + * + * @param yearMonthRange + * @return + */ + List listByTaxCycleRange(YearMonthRange yearMonthRange); + } diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index dfb4be9c4..2b001a10c 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -155,7 +155,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .orElse(null); String requestId = Optional.ofNullable(queryResponse) .map(QuerySpecialAmountResponse::getBody) - .map(QuerySpecialAmountResponse.QuerySpecialAmountBody::getRequestId) + .map(QuerySpecialAmountResponse.Body::getRequestId) .orElse(null); if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) { log.info("getAsyncQueryResponse4Payment code error锛歿}", JSON.toJSONString(queryResponse)); diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index bb0242cf4..d25f8f864 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; 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.salary.biz.AddUpDeductionBiz; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; 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.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +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.po.AddUpDeductionRequestFailPO; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; 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.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; 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.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.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.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.report.enums.EmployeeTypeEnum; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; 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.google.common.collect.Lists; 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.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -61,6 +87,8 @@ import java.io.InputStream; import java.text.SimpleDateFormat; import java.time.*; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; 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 * @version 1.0 **/ +@Slf4j public class AddUpDeductionServiceImpl extends Service implements AddUpDeductionService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -108,6 +137,38 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction 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 public Map getSearchCondition(Map params) { Map apidatas = new HashMap(); @@ -410,7 +471,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException("璇ユ暟鎹笉瀛樺湪锛"); } 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) { //娌℃湁缂栬緫鏉冮檺 throw new SalaryRunTimeException("璇ヤ釜绋庢墸缂翠箟鍔′汉鏃犳潈闄愮紪杈戞鏁版嵁锛"); @@ -440,7 +501,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //绋庢鎵灞炴湡 String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth(); - if (declareMonthStr .equals("")) { + if (declareMonthStr.equals("")) { throw new SalaryRunTimeException("绋庢鎵灞炴湡涓嶈兘涓虹┖锛"); } // 鑾峰彇鎵鏈変釜绋庢墸缂翠箟鍔′汉 @@ -468,7 +529,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .updateTime(now) .creator((long) user.getUID()) .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) { throw new SalaryRunTimeException("鍛樺伐淇℃伅涓嶅瓨鍦"); } @@ -552,7 +613,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException("鏁版嵁涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎锛"); } // 鍒ゆ柇鏄惁鍦ㄤ釜绋庢墸缂翠箟鍔′汉鑼冨洿鍐 - Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); if (!first.isPresent()) { throw new SalaryRunTimeException("涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); } @@ -587,7 +648,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) { // 璁剧疆浜嗕釜绋庢墸缂翠箟鍔′汉 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) { throw new SalaryRunTimeException("涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴!"); } @@ -636,12 +697,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public String autoAddAll(Date yearMonth, Boolean isAdmin) { String cacheKey = "addUpDeduction_autoAddAll_processing"; - Object objVal = Util_DataCache.getObjVal( cacheKey); - if(objVal != null){ + Object objVal = Util_DataCache.getObjVal(cacheKey); + if (objVal != null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "涓閿疮璁¤繃浜庨绻侊紝璇风◢鍚庡啀璇")); } try { - Util_DataCache.setObjVal(cacheKey,true ); + Util_DataCache.setObjVal(cacheKey, true); //濡傛灉鏄畾鏃朵换鍔$洿鎺ユ煡璇㈡墍鏈夛紝isAdmin浼爐rue boolean isChief = Boolean.TRUE.equals(isAdmin) || getTaxAgentService(user).isChief((long) user.getUID()); @@ -969,7 +1030,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction if (getTaxAgentService(user).isOpenDevolution() && !isChief) { List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); -// List lastList = getLastListByModifier(employeeId, tenantKey); +// List lastList = getLastListByModifier(employeeId); list = list.stream().filter(f -> // 浣滀负绠$悊鍛 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) @@ -1200,4 +1261,487 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return list; } + @Override + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "绋庢鎵灞炴湡蹇呬紶")); + // 鑾峰彇鎺ュ彛閰嶇疆 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 鑾峰彇鍖呰绫 + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig); + // 鑾峰彇鎶ョ◣淇℃伅 + List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet()); + List failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList()); + SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "浼佷笟鏈氳繃楠岃瘉锛屾殏鏃舵棤娉曡幏鍙栫疮璁′笓椤归檮鍔犳墸闄ゆ暟鎹紝璇峰厛鍦ㄣ愪釜绋庢墸缂翠箟鍔′汉銆戣彍鍗曢獙璇佷紒涓氭姤绋庝俊鎭")); + Map 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 requestPOList = getAddUpDeductionRequestPOS(); + SalaryAssert.isEmpty(requestPOList, SalaryI18nUtil.getI18nLabel(153341, "鑾峰彇涓紝绋嶅悗璇风偣鍑汇愯幏鍙栫粨鏋滀笅杞姐")); + // 鑾峰彇鎶ラ佹垚鍔熺殑浜哄憳鍚嶅崟 + Map> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth()); + // 寮濮嬭姹傛帴鍙h幏鍙栨暟鎹 + List querySpecialAmountBodies = getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList); + // 鎸佷箙鍖栨暟鎹 + persistFeedbackData(param, querySpecialAmountBodies); + return result; + } + + private AddUpDeductionOnlineRequestWrapper getAddUpDeductionOnlineRequestWrapper(List requestPOList, TaxDeclarationApiConfigPO apiConfig) { + boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution(); + long employeeId = (long) user.getUID(); + boolean isChief = getTaxAgentService(user).isChief(employeeId); + List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List) getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); + List taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); + // 鑾峰彇钖祫妗f + List 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> getEmpDeclareMap(Collection taxAgentIds, Date declareMonth) { + List employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth); + SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "鏆傛棤浜哄憳鎶ラ佺姸鎬佷负姝e父鐨勬暟鎹紝璇峰厛鎶ラ佸啀鑾峰彇绱涓撻」闄勫姞鎵i櫎鏁版嵁銆")); + return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId)); + } + + private List getEmployeeDeclarePOList(Collection taxAgentIds, Date declareMonth) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build()); + } + + private List getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param, + AddUpDeductionOnlineRequestWrapper requestWrapper, + Map> taxAgentEmployeeDeclareMap, + List taxReturnPOList) { + List queryResponseList = new ArrayList<>(); + for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) { + if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) { + continue; + } + // 鍙戣捣璇锋眰 + String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId()); + List 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 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 declarePOList, + AddUpDeductionMonthTaxAgentParam param, + TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_SPECIAL_AMOUNT; + Map 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 params = new HashMap<>(1); + Map 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 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); + // 鑾峰彇宸插瓨鍦ㄧ殑绱闄勫姞鎵i櫎鏁版嵁 + 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 onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) { + List addUpDeductionRequestFailPOS = getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(queryParam.getRequestId()).build()); + List list = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), addUpDeductionRequestFailPOS); + // 鑾峰彇钖祫妗f + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null); + this.getEmployeeInfoMap(requestWrapper); + + List listDTOList = list.stream().map(requestWrapper::buildAddUpDeductionRequestFailListDTO).collect(Collectors.toList()); + + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOList, AddUpDeductionRequestFailListDTO.class); + page.setTotal(addUpDeductionRequestFailPOS.size()); + return page; + } + + @Override + public List getAddUpDeductionRequestFailPOList(Long requestId) { + return getAddUpDeductionRequestFailMapper().listSome(AddUpDeductionRequestFailPO.builder().requestId(requestId).build()); + } + + @Override + public XSSFWorkbook exportOnlineFeedbackFail( Long requestId) { + List> rows = new ArrayList<>(); + // 琛ㄥご + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕")); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); + headers.add(SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿")); + headers.add(SalaryI18nUtil.getI18nLabel(86185, "閮ㄩ棬")); + headers.add(SalaryI18nUtil.getI18nLabel(106277, "韬唤璇佸彿鐮")); + headers.add(SalaryI18nUtil.getI18nLabel(144832, "澶辫触鍘熷洜")); + rows.add(headers); + // 鑾峰彇钖祫妗f + AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, null); + // 鑾峰彇韬唤淇℃伅map + this.getEmployeeInfoMap(requestWrapper); + // 鑾峰彇鏁版嵁 + List pos = getAddUpDeductionRequestFailPOList(requestId); + // 缁勮鏁版嵁 + for (AddUpDeductionRequestFailPO po : pos) { + AddUpDeductionRequestFailListDTO failListDTO = requestWrapper.buildAddUpDeductionRequestFailListDTO(po); + List 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, "鍦ㄧ嚎鑾峰彇涓撻」闄勫姞鎵i櫎澶辫触鏁版嵁"); + } + + + private void getEmployeeInfoMap(AddUpDeductionOnlineRequestWrapper wrapper) { + // 韬唤璇佸彿 + List employeeIds = SalaryEntityUtil.properties(wrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getEmployeeId); + wrapper.setUserInfoUserIdMap(simpleUserInfoMap); + // 浜哄憳淇℃伅 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + wrapper.setSimpleEmployeeMap(simpleEmployeeMap); + // 澶栭儴浜哄憳淇℃伅 + List extEmployeePOS = getExtEmpService(user).listAll(); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId, e -> e); + wrapper.setExtEmployeePOMap(extEmployeePOMap); + } + + private List 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 requestPOList) { + Map> statusRequestMap = SalaryEntityUtil.group2Map(requestPOList, AddUpDeductionRequestPO::getRequestStatus); + if (CollectionUtils.isEmpty(statusRequestMap.get(EnumAddUpDeductionRequestStatus.RUNNING.getValue()))) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153343, "璇峰厛鐐瑰嚮銆愬湪绾胯幏鍙栥戞寜閽紝閫夋嫨绋庢鎵灞炴湡杩涜鑾峰彇鏁版嵁銆")); + } + Set 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 simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + requestWrapper.setSimpleEmployeeMap(simpleEmployeeMap); + // 鍐呴儴鍛樺伐锛堣韩浠借瘉淇℃伅锛 + List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, DataCollectionEmployee::getIdNo); + requestWrapper.setUserInfoIdNoMap(simpleUserInfoMap); + // 澶栭儴鍛樺伐淇℃伅 + List extEmployeePOS = getExtEmpService(user).listAll(); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getIdNo, ExtEmpPO::getId); + requestWrapper.setExtEmployeeIdCardMap(extEmployeePOMap); + } + + private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) { + List taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList()); + List 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 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> insertPartition = Lists.partition(requestWrapper.getInsertList(), 100); + insertPartition.forEach(list -> { + list = encryptUtil.encryptList(list, AddUpDeduction.class); + getAddUpDeductionMapper().insertData(list); + }); + } + if (!requestWrapper.getUpdateList().isEmpty()) { + List> updatePartition = Lists.partition(requestWrapper.getUpdateList(), 100); + updatePartition.forEach(list -> { + list = encryptUtil.encryptList(list, AddUpDeduction.class); + getAddUpDeductionMapper().updateData(list); + }); + } + if (!requestWrapper.getFailPOList().isEmpty()) { + List> 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 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 params = new HashMap<>(1); + params.put("requestId", requestPO.getOuterRequestId()); + Map 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; + // 鍗曟璇锋眰瀵瑰簲鐨勫弽棣堟暟鎹甿ap + private Map> requestFeedBackMap; + private Map requestPoMap; + // 鏌ヨ钖祫妗f锛堝畾钖佸緟鍋滆柂銆佸仠钖級 + private List salaryArchiveList; + private Map taxAgentMap; + // 鍛樺伐淇℃伅map(韬唤璇佸彿 -> 鍛樺伐ID) + private Map userInfoIdNoMap; + // 鍛樺伐淇℃伅map(鍛樺伐ID -> 韬唤璇) + private Map userInfoUserIdMap; + // 鍛樺伐璇︾粏淇℃伅map(key = 鍛樺伐ID) + private Map simpleEmployeeMap; + // 鑾峰彇褰撳墠搴撲腑绱闄勫姞鎵i櫎鐨勬暟鎹 + private Map existedDataMap; + // 闇瑕佹柊澧炵殑鏁版嵁 + private List insertList; + // 闇瑕佹洿鏂扮殑鏁版嵁 + private List updateList; + // 澶辫触鏁版嵁锛堝垎椤碉級 + private List failDTOList; + // 澶辫触鏁版嵁锛堟寔涔呭寲锛 + private List failPOList; + // 璇锋眰璇︾粏淇℃伅鍒楄〃 + private List requestPOList; + // 澶栭儴浜哄憳(韬唤璇 -> id) + private Map extEmployeeIdCardMap; + // 澶栭儴浜哄憳(id -> 瀹炰綋) + private Map extEmployeePOMap; + // api閰嶇疆 + private TaxDeclarationApiConfigPO apiConfig; + + public AddUpDeductionOnlineRequestWrapper(List requestPOList, + List salaryArchiveList, + List 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; + } + } + } diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 5a81ad857..c0e108de2 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; 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.core.impl.Service; import com.engine.salary.biz.AddUpSituationBiz; +import com.engine.salary.constant.SzyhApiConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpSituation; 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.AddUpSituationRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam; -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.entity.datacollection.param.*; +import com.engine.salary.entity.datacollection.po.AddUpDeductionRequestPO; +import com.engine.salary.entity.datacollection.response.GetCompanyIncomesResponse; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; 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.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.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.mapper.datacollection.AddUpSituationMapper; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; -import com.engine.salary.service.AddUpDeductionService; -import com.engine.salary.service.AddUpSituationService; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; 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.google.common.collect.Lists; import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -61,6 +69,7 @@ import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; +@Slf4j public class AddUpSituationServiceImpl extends Service implements AddUpSituationService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -84,12 +93,28 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation 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(); private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + @Override public Map getSearchCondition() { Map apidatas = new HashMap(); @@ -274,7 +299,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // excel鏍囬 final List title = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鍏ヨ亴鏃ユ湡", "绱鏀跺叆棰", "绱鍑忛櫎璐圭敤", "绱绀句繚涓汉鍚堣", "绱鍏Н閲戜釜浜哄悎璁", "绱瀛愬コ鏁欒偛", "绱缁х画鏁欒偛", "绱浣忔埧璐锋鍒╂伅", "绱浣忔埧绉熼噾", "绱璧″吇鑰佷汉", - "绱澶х梾鍖荤枟", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶","绱涓汉鍏昏侀噾"); + "绱澶х梾鍖荤枟", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶", "绱涓汉鍏昏侀噾"); //鎺掑簭閰嶇疆 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -340,7 +365,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation //excel鏍囬 List title = Arrays.asList("濮撳悕", "绋庢鎵灞炴湡", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "绱鏀跺叆棰", "绱鍑忛櫎璐圭敤", "绱绀句繚涓汉鍚堣", "绱鍏Н閲戜釜浜哄悎璁", "绱瀛愬コ鏁欒偛", "绱缁х画鏁欒偛", "绱浣忔埧璐锋鍒╂伅", "绱浣忔埧绉熼噾", "绱璧″吇鑰佷汉", "绱澶х梾鍖荤枟", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", - "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶","绱涓汉鍏昏侀噾"); + "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶", "绱涓汉鍏昏侀噾"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //鏌ヨ璇︾粏淇℃伅 @@ -609,7 +634,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 鑾峰彇宸茬粡鏍哥畻鐨勬暟鎹(鑾峰彇绋庢鎵灞炴湡涓嬩竴涓湀鐨勬暟鎹) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } @@ -693,7 +718,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); errorData.add(errorMessageMap); errorSum += 1; - }else { + } else { Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; 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 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())); if (optionalAcctEmp.isPresent() && isExist) { @@ -846,8 +871,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } /** - * @description 缂栬緫鏁版嵁 * @return void + * @description 缂栬緫鏁版嵁 * @author Harryxzy * @date 2022/10/27 21:32 */ @@ -860,12 +885,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 鑾峰彇鎵鏈変釜绋庢墸缂翠箟鍔′汉 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); AddUpSituation byId = biz.getById(addUpSituationParam.getId()); - if(byId == null){ + if (byId == null) { throw new SalaryRunTimeException("璇ユ暟鎹笉瀛樺湪锛"); } Long taxAgentId = byId.getTaxAgentId(); - boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId)); - if(!canEdit){ + boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId)); + if (!canEdit) { //娌℃湁缂栬緫鏉冮檺 throw new SalaryRunTimeException("璇ヤ釜绋庢墸缂翠箟鍔′汉鏃犳潈闄愮紪杈戞鏁版嵁锛"); } @@ -873,14 +898,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 鑾峰彇宸茬粡鏍哥畻鐨勬暟鎹(鑾峰彇绋庢鎵灞炴湡涓嬩竴涓湀鐨勬暟鎹) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); String nextTaxYearMonthStr = taxYearMonthStr; - if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){ + if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) { nextTaxYearMonth = nextTaxYearMonth.plusMonths(1); nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER); } List 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 optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { throw new SalaryRunTimeException("璇ュ勾鏈堣繖鏉℃暟鎹凡缁忔牳绠楄繃,涓嶅彲杩涜缂栬緫锛"); @@ -903,8 +928,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } /** - * @description 鏂板缓鏁版嵁 * @return void + * @description 鏂板缓鏁版嵁 * @author Harryxzy * @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())); - if(!employeeSameId){ + boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpSituationParam.getEmployeeId())); + if (!employeeSameId) { throw new SalaryRunTimeException("鍛樺伐淇℃伅涓嶅瓨鍦"); } po.setEmployeeId(addUpSituationParam.getEmployeeId()); @@ -967,7 +992,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation } } - // fixme 鍒嗘潈鍒ゆ柇锛岃嫢鍛樺伐绂昏亴鍚庯紝涓嶅湪鎵g即涔夊姟浜鸿寖鍥村唴锛屼細鏈夊紓甯 + // fixme 鍒嗘潈鍒ゆ柇锛岃嫢鍛樺伐绂昏亴鍚庯紝涓嶅湪鎵g即涔夊姟浜鸿寖鍥村唴锛屼細鏈夊紓甯 // if (openDevolution) { // Optional optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst(); // if (!optionalTaxAgentEmp.isPresent()) { @@ -1055,15 +1080,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format); // 鍒ゆ柇鏄惁鏈夋牳绠楄繃 List deleteList = new ArrayList<>(); - for(int i=0; i first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst(); - if(!first.isPresent()){ + Optional first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst(); + if (!first.isPresent()) { throw new SalaryRunTimeException("涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); } // 鍒ゆ柇鐢ㄦ埛鏄惁瀛樺湪 @@ -1089,23 +1114,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation AddUpSituationBiz biz = new AddUpSituationBiz(); Date declareMonthDate = new Date(); try { - declareMonthDate = (sdf.parse(declareMonthStr+"-01")); - }catch (Exception e){ + declareMonthDate = (sdf.parse(declareMonthStr + "-01")); + } catch (Exception e) { throw new SalaryRunTimeException("鏃ユ湡寮傚父"); } AddUpSituation queryParam = null; - if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){ + if (deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()) { // 璁剧疆浜嗕釜绋庢墸缂翠箟鍔′汉 Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId()); - boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId)); - if(!canDelete){ + boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId)); + if (!canDelete) { throw new SalaryRunTimeException("涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴!"); } ArrayList tai = new ArrayList<>(); tai.add(taxAgentId); - queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); - }else { + queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build(); + } else { 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")); // 鑾峰彇宸茬粡鏍哥畻鐨勬暟鎹 List employees = getAddUpDeductionService(user).getAccountedEmployeeData(format); - for(AddUpSituation item : list){ + for (AddUpSituation item : list) { if (CollectionUtils.isNotEmpty(employees)) { Optional optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst(); if (optionalAcctEmp.isPresent()) { @@ -1137,11 +1162,11 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation ids.add(addUpSituationParam.getId()); AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build(); List list = biz.recordList(build); - if(list == null || list.size()==0){ + if (list == null || list.size() == 0) { throw new SalaryRunTimeException("璇ユ暟鎹笉瀛樺湪锛"); } String taxAgentName = list.get(0).getTaxAgentName(); - if(!taxAgentNames.contains(taxAgentName)){ + if (!taxAgentNames.contains(taxAgentName)) { throw new SalaryRunTimeException("鎮ㄦ棤鏉冩煡鐪嬭鏁版嵁!"); } return list.get(0); @@ -1150,10 +1175,182 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { - list = encryptUtil.encryptList(list,AddUpSituation.class); + list = encryptUtil.encryptList(list, AddUpSituation.class); List> partition = Lists.partition(list, 50); partition.forEach(getAddUpSituationMapper()::insertData); } } + + @Override + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + SalaryAssert.notNull(param.getDeclareMonth(), SalaryI18nUtil.getI18nLabel(100586, "绋庢鎵灞炴湡蹇呬紶")); + // 鑾峰彇鎺ュ彛閰嶇疆 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 鑾峰彇鍖呰绫 + AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper = getAddUpDeductionOnlineRequestWrapper(null, apiConfig); + // 鑾峰彇鎶ョ◣淇℃伅 + List taxReturnPOList = getTaxAgentTaxReturnService(user).getByTaxAgentIds(requestWrapper.getTaxAgentMap().keySet()); + List failReturnPOList = taxReturnPOList.stream().filter(e -> !TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(e.getCheckStatus())).collect(Collectors.toList()); + SalaryAssert.isFalse(taxReturnPOList.size() == failReturnPOList.size(), SalaryI18nUtil.getI18nLabel(183781, "浼佷笟鏈氳繃楠岃瘉锛屾殏鏃舵棤娉曡幏鍙栫疮璁′笓椤归檮鍔犳墸闄ゆ暟鎹紝璇峰厛鍦ㄣ愪釜绋庢墸缂翠箟鍔′汉銆戣彍鍗曢獙璇佷紒涓氭姤绋庝俊鎭")); + Map 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> taxAgentEmpDeclareMap = getEmpDeclareMap(requestWrapper.getTaxAgentMap().keySet(), param.getDeclareMonth()); + // 寮濮嬭姹傛帴鍙h幏鍙栨暟鎹 + getQuerySpecialAmountBodies(param, requestWrapper, taxAgentEmpDeclareMap, taxReturnPOList); + return result; + } + + private void getQuerySpecialAmountBodies(AddUpDeductionMonthTaxAgentParam param, + AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, + Map> taxAgentEmployeeDeclareMap, + List taxReturnPOList) { + List updateList = new ArrayList<>(); + List insertList = new ArrayList<>(); + for (TaxAgentTaxReturnPO returnPO : taxReturnPOList) { + if (!TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(returnPO.getCheckStatus())) { + continue; + } + // 鍙戣捣璇锋眰 + String taxAgentName = requestWrapper.getTaxAgentMap().get(returnPO.getTaxAgentId()); + List declarePOList = taxAgentEmployeeDeclareMap.getOrDefault(returnPO.getTaxAgentId(), new ArrayList<>()); + if (declarePOList.isEmpty()) { + log.info("璇ヤ富浣撲笅娌℃湁鎶ラ佹垚鍔熺殑浜哄憳锛屼富浣撳悕绉帮細{}", taxAgentName); + continue; + } + List poList = getAddUpSituationMapper().listSome((AddUpSituation.builder().taxYearMonth(param.getDeclareMonth()).taxAgentId(returnPO.getTaxAgentId()).build())); + Map poMap = SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + + // 鍐呴儴鍛樺伐锛堣韩浠借瘉淇℃伅锛 + List employeeIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getEmployeeId, Collectors.toList()); + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(employeeIds); + Map 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 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> insertPartition = Lists.partition(insertList, 50); + insertPartition.forEach(list -> { + list = encryptUtil.encryptList(list, AddUpSituation.class); + getAddUpSituationMapper().insertData(list); + }); + } + if (!updateList.isEmpty()) { + List> 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 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 params = new HashMap<>(1); + Map 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 requestPOList, TaxDeclarationApiConfigPO apiConfig) { + boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution(); + boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); + List taxAgents = !isOpenDevolution || isChief ? getTaxAgentService(user).listAll() : (List) getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + Set taxAgentIdSet = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); + // 鑾峰彇钖祫妗f + List 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> getEmpDeclareMap(Collection taxAgentIds, Date declareMonth) { + List employeeDeclarePOS = getEmployeeDeclarePOList(taxAgentIds, declareMonth); + SalaryAssert.notEmpty(employeeDeclarePOS, SalaryI18nUtil.getI18nLabel(183783, "鏆傛棤浜哄憳鎶ラ佺姸鎬佷负姝e父鐨勬暟鎹紝璇峰厛鎶ラ佸啀鑾峰彇绱涓撻」闄勫姞鎵i櫎鏁版嵁銆")); + return employeeDeclarePOS.stream().collect(Collectors.groupingBy(EmployeeDeclarePO::getTaxAgentId)); + } + + private List getEmployeeDeclarePOList(Collection taxAgentIds, Date declareMonth) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build()); + } } diff --git a/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java b/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java index ff08478b3..40edf009b 100644 --- a/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java +++ b/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java @@ -11,9 +11,7 @@ import com.engine.salary.formlua.entity.parameter.DataType; import com.engine.salary.formlua.entity.standard.ExcelResult; import com.engine.salary.service.FormulaRunService; import com.engine.salary.sys.enums.OpenEnum; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.engine.salary.util.JsonUtil; import com.ql.util.express.DefaultContext; import com.ql.util.express.ExpressRunner; 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 final ObjectMapper objectMapper = new ObjectMapper(); - private final BaseBean baseBean = new BaseBean(); private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log")); @@ -85,24 +81,25 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService String openDecrypt = ""; String result = ""; try { - JsonNode jsonNode = objectMapper.readTree(extendParam); + Map map = JsonUtil.parseMap(extendParam, String.class); //杩斿洖鍊奸厤缃 - JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey"); - if (sqlReturnKeyNode != null) { - sqlReturnKey = sqlReturnKeyNode.asText().trim(); + sqlReturnKey = map.getOrDefault("sqlReturnKey", ""); + if (StringUtils.isNotBlank(sqlReturnKey)) { + sqlReturnKey = sqlReturnKey.trim(); } //鏁版嵁婧愰厤缃 - JsonNode datasourceNode = jsonNode.get("datasource"); - if (datasourceNode != null) { - JsonNode datasourceIdNode = datasourceNode.get("datasourceId"); - if (datasourceIdNode != null) { - datasourceId = datasourceIdNode.asText(); + String datasourceJson = map.getOrDefault("datasource", ""); + if (StringUtils.isNotBlank(datasourceJson)) { + Map datasourceIdMap = JsonUtil.parseMap(datasourceJson, String.class); + String datasourceIdNode = datasourceIdMap.getOrDefault("datasourceId",""); + if (StringUtils.isNotBlank(datasourceIdNode)) { + datasourceId = datasourceIdNode; } } //鏄惁闇瑕佽В瀵 - JsonNode decrypt = jsonNode.get("openDecrypt"); - if (decrypt != null) { - openDecrypt = decrypt.asText().trim(); + String decrypt = map.get("openDecrypt"); + if (StringUtils.isNotBlank(decrypt)) { + openDecrypt = decrypt.trim(); } //瑙f瀽sql @@ -164,13 +161,13 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService String extendParam = expressFormula.getExtendParam(); try { - JsonNode jsonNode = objectMapper.readTree(extendParam); + Map map = JsonUtil.parseMap(extendParam, String.class); //杩斿洖鍊奸厤缃 - JsonNode isCustomFunctionNode = jsonNode.get("isCustomFunction"); - if (isCustomFunctionNode != null) { - isCustomFunction = StringUtils.equals(isCustomFunctionNode.asText().trim(), "1"); + String isCustomFunctionNode = map.getOrDefault("isCustomFunction", ""); + if (StringUtils.isNotBlank(isCustomFunctionNode)) { + isCustomFunction = StringUtils.equals(isCustomFunctionNode.trim(), "1"); } - } catch (JsonProcessingException e) { + } catch (Exception e) { log.error("express execute fail, extendParam parse fail {}", extendParam, e); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 9b4b123f6..94dd92579 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; 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.salaryacct.bo.SalaryAcctRecordBO; 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.salarysob.dto.SalarySobCycleDTO; 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.salarysob.IncomeCategoryEnum; 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.SalaryPageUtil; 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.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -78,6 +83,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } + // private SalaryCheckResultService salaryCheckResultService; // // private SalaryCheckResultDetailService salaryCheckResultDetailService; @@ -271,9 +280,11 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public Long save(SalaryAcctRecordSaveParam saveParam) { ValidUtil.doValidator(saveParam); //妫鏌 - checkBeforeSave(saveParam); +// checkBeforeSave(saveParam); + SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); + // 鏌ヨ绋庢鎵灞炴湡 SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth()); // 钖祫鎵灞炴湀鎵鍦ㄥ勾鐨勬棩鏈熻寖鍥达紙绗竴澶╋綖鏈鍚庝竴澶╋級 @@ -293,12 +304,20 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 杞崲鎴恜o 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 salaryAcctTaxAgents = new ArrayList<>(); + salaryAcctTaxAgents.add(build); + checkBeforeSave(salaryAcctRecordPO, salaryAcctTaxAgents); + // 淇濆瓨钖祫鏍哥畻璁板綍 getSalaryAcctRecordMapper().insertIgnoreNull(salaryAcctRecordPO); // 鍒濆鍖栬柂璧勬牳绠椾汉鍛 getSalaryAcctEmployeeService(user).initBySalaryAcctRecord(salaryAcctRecordPO); // 璁板綍鏃ュ織 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); // loggerContext.setTargetName(targetName); @@ -438,6 +457,136 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe } + + /** + * 淇濆瓨涔嬪墠妫鏌ヤ竴涓嬫槸鍚﹀彲浠ユ柊寤烘牳绠 + * + * @param salaryAcctTaxAgents + */ + @Override + public void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List 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 salaryAcctTaxAgents) { + salaryAcctTaxAgents = salaryAcctTaxAgents.stream() + .filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) { + return; + } + // 鏌ヨ鏈钖祫鏍哥畻璁板綍鐨勭◣娆炬墍灞炴湡鎵鍦ㄥ勾搴︾殑钖祫鏍哥畻璁板綍 + Set sameYearSet = Sets.newHashSet(); + List 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 salaryAcctTaxAgents) { + // 鎺掗櫎鎺夋墍寰楅」鐩负鍏ㄥ勾涓娆℃у閲戞敹鍏ョ殑钖祫鏍哥畻璁板綍 + salaryAcctTaxAgents = salaryAcctTaxAgents.stream() + .filter(e -> !Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) + .collect(Collectors.toList()); + Set sameYearSet = Sets.newHashSet(); + List sameYearTaxDeclarations = Lists.newArrayList(); + List 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()); + + // 鏌ヨ涓◣鎵g即涔夊姟浜 + Set taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + + Set declareTaxAgents = SalaryEntityUtil.properties(sameYearTaxDeclarations, e -> e.getTaxAgentId() + "-" + e.getTaxCycle()); + Map> sameYearSalaryAcctTaxAgentMap = SalaryEntityUtil + .group2Map(sameYearSalaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + List 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, "涓◣鎵g即涔夊姟浜恒寋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, "涓◣鎵g即涔夊姟浜恒寋0}銆嶅凡缁忓瓨鍦ㄨ柂璧勬墍灞炴湀銆寋1}銆嶇殑钖祫鏍哥畻璁板綍浜嗭紝鏃犳硶鏂板缓钖祫鎵灞炴湀銆寋2}銆嶇殑钖祫鏍哥畻") + .replace("{0}", taxAgentMap.get(calculatedSalaryAcctTaxAgent.getTaxAgentId())) + .replace("{1}", SalaryDateUtil.getFormatYYYYMM(calculatedSalaryAcctTaxAgent.getSalaryMonth())) + .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getSalaryMonth()))); + } + } + } + private List listByCreateDate(LocalDateRange taxCycleRebootYearRange, Set salarySobIds) { return getSalaryAcctRecordMapper().listByCreateDate(taxCycleRebootYearRange, salarySobIds); } @@ -594,7 +743,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setUpdateTime(new Date()); // getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); // 璁板綍鏃ュ織 -// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId()); // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); // loggerContext.setTargetName(targetName); diff --git a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java index 49acd5b52..8bd4fe4f1 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java @@ -1,65 +1,45 @@ -//package com.engine.salary.service.impl; -// -//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -//import com.baomidou.mybatisplus.core.toolkit.Wrappers; -//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; -//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; -//import com.engine.core.impl.Service; -//import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; -//import com.engine.salary.service.SalaryAcctTaxAgentService; -//import com.google.common.collect.Lists; -//import com.google.common.collect.Sets; -//import com.weaver.common.distribution.genid.IdGenerator; -//import com.weaver.common.hr.util.Util; -//import com.weaver.hrm.salary.common.YearMonthRange; -//import com.weaver.hrm.salary.dao.SalaryAcctTaxAgentMapper; -//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; -//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; -//import org.apache.commons.collections4.CollectionUtils; -//import org.springframework.transaction.annotation.Transactional; -// -//import java.time.LocalDateTime; -//import java.util.*; -// -///** -// * @description: -// * @author: xiajun -// * @modified By: xiajun -// * @date: 2022/7/29 9:45 -// * @version:v1.0 -// */ -//public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { -// -// private SalaryAcctTaxAgentMapper salaryAcctTaxAgentMapper; -// +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.mapper.salaryacct.SalaryAcctTaxAgentMapper; +import com.engine.salary.service.SalaryAcctTaxAgentService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { + + private SalaryAcctTaxAgentMapper getSalaryAcctTaxAgentMapper() { + return MapperProxyFactory.getProxy(SalaryAcctTaxAgentMapper.class); + } + @Override + public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { + if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { + return Collections.emptyList(); + } + return getSalaryAcctTaxAgentMapper().listAcctTaxAgent(salaryAcctRecordIds); + } + + @Override + public List listByTaxCycleRange(YearMonthRange taxCycleRange) { + SalaryAcctTaxAgentPO queryWrapper = new SalaryAcctTaxAgentPO(); + if (Objects.nonNull(taxCycleRange.getStartMonth())) { + queryWrapper.setStartMonth(taxCycleRange.getStartMonth()); + } + if (Objects.nonNull(taxCycleRange.getEndMonth())) { + queryWrapper.setEndMonth(taxCycleRange.getEndMonth()); + } + return getSalaryAcctTaxAgentMapper().listByTaxCycleRange(queryWrapper); + } + // @Override -// public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { -// 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 listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { -// LambdaQueryWrapper 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 initBySalaryAcctEmployees(List salaryAcctEmployees, Long employeeId, String tenantKey) { +// public List initBySalaryAcctEmployees(List salaryAcctEmployees) { // if (CollectionUtils.isEmpty(salaryAcctEmployees)) { // return Collections.emptyList(); // } @@ -89,19 +69,18 @@ // } // // @Override -// @Transactional(rollbackFor = Exception.class) -// public void batchSave(List salaryAcctTaxAgents, String tenantKey) { +// public void batchSave(List salaryAcctTaxAgents) { // if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) { // saveBatch(salaryAcctTaxAgents); // } // } // // @Override -// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { // if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { // return; // } -// new LambdaUpdateChainWrapper<>(salaryAcctTaxAgentMapper) +// new LambdaUpdateChainWrapper<>(getSalaryAcctTaxAgentMapper()) // .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) // .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) // .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) @@ -109,4 +88,4 @@ // .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now()) // .update(); // } -//} +} diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 29530bfb3..d055ca9b2 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -1292,4 +1292,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds); } + + @Override + public List listByRunStatus(List list) { + return getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().runStatusList(list).build()); + } } diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index 401a761d7..3e34a2715 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -18,11 +18,9 @@ import com.engine.salary.mapper.formula.FormulaVarMapper; import com.engine.salary.service.FormulaRunService; import com.engine.salary.service.RemoteExcelService; import com.engine.salary.service.SalaryFormulaService; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.db.MapperProxyFactory; 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 dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; @@ -47,7 +45,6 @@ import java.util.stream.Collectors; **/ @Slf4j public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaService { - private static final ObjectMapper objectMapper = new ObjectMapper(); private FormulaMapper getFormulaMapper() { return MapperProxyFactory.getProxy(FormulaMapper.class); @@ -171,12 +168,9 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe String sqlReturnKey = ""; try { - JsonNode jsonNode = objectMapper.readTree(extendParam); - JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey"); - if (sqlReturnKeyNode != null) { - sqlReturnKey = sqlReturnKeyNode.asText(); - } - } catch (JsonProcessingException e) { + Map map = JsonUtil.parseMap(extendParam, String.class); + sqlReturnKey = map.getOrDefault("sqlReturnKey", ""); + } catch (Exception e) { log.error("express execute fail, sql extendParam parse fail", e); } diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index d5414a8fe..d1ded8b46 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -335,6 +335,12 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { if (Objects.equals(declaredField.getName(), "addUpAdvanceTax")) { 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)) { continue; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 20ed01799..f778da6fd 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -3,6 +3,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; 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.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -357,4 +358,11 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration getTaxDeclarationMapper().batchInsert(taxDeclarations); } } + + @Override + public List listByTaxCycleRange(YearMonthRange yearMonthRange) { + return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder() + .salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) + .build()); + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 6991bdeea..efbd618c6 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -122,8 +122,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe 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) { return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index b153fd475..821d24e59 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -7,6 +7,8 @@ import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; 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.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; @@ -22,10 +24,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -271,8 +270,8 @@ public class AddUpDeductionController { } /** - * @description 鏂板缓绱涓撻」闄勫姞鎵i櫎 * @return String + * @description 鏂板缓绱涓撻」闄勫姞鎵i櫎 * @author Harryxzy * @date 2022/10/26 14:23 */ @@ -285,8 +284,8 @@ public class AddUpDeductionController { } /** - * @description 鑾峰彇绱涓撻」闄勫姞鎵i櫎淇℃伅 * @return String + * @description 鑾峰彇绱涓撻」闄勫姞鎵i櫎淇℃伅 * @author Harryxzy * @date 2022/10/31 11:23 */ @@ -300,8 +299,8 @@ public class AddUpDeductionController { /** - * @description 缂栬緫绱涓撻」闄勫姞鎵i櫎 * @return String + * @description 缂栬緫绱涓撻」闄勫姞鎵i櫎 * @author Harryxzy * @date 2022/10/25 14:08 */ @@ -314,8 +313,8 @@ public class AddUpDeductionController { } /** - * @description 绱涓撻」闄勫姞鎵i櫎-鍒犻櫎鎵閫 * @return String + * @description 绱涓撻」闄勫姞鎵i櫎-鍒犻櫎鎵閫 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -328,8 +327,8 @@ public class AddUpDeductionController { } /** - * @description 绱涓撻」闄勫姞鎵i櫎-涓閿竻绌 * @return String + * @description 绱涓撻」闄勫姞鎵i櫎-涓閿竻绌 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -353,6 +352,7 @@ public class AddUpDeductionController { /** * 涓閿嚜鍔ㄧ疮璁 + * * @return */ @POST @@ -374,4 +374,107 @@ public class AddUpDeductionController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(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>(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(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>(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 = "鍦ㄧ嚎鑾峰彇涓撻」闄勫姞鎵i櫎澶辫触鏁版嵁" + 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); +// } } diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index 0c31aa578..1823c81b3 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -354,4 +354,17 @@ public class AddUpSituationController { } + /** + * 鍦ㄧ嚎鑾峰彇瀹為檯绱宸查鎵i缂寸◣棰 + * + * @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>(user).run(getAddUpSituationWrapper(user)::onlineRequest, param); + } } diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index aa89c3c58..614763634 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -5,10 +5,10 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam; -import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam; +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.po.AddUpDeductionRequestFailPO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.SalaryEmployeeService; @@ -179,4 +179,36 @@ public class AddUpDeductionWrapper extends Service { } return getAddUpDeductionService(user).autoAddAll(yearMonth, null); } + + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + return getAddUpDeductionService(user).onlineRequest(param); + } + + public AddUpDeductionRequestResultDTO onlineFeedback() { + return getAddUpDeductionService(user).onlineFeedback(); + } + + public PageInfo onlineFeedbackFail(AddUpDeductionRequestFailQueryParam queryParam) { + if (queryParam.getRequestId() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153345, "鍦ㄧ嚎鑾峰彇鐨勮姹侷D涓嶅彲涓虹┖")); + } + PageInfo page = getAddUpDeductionService(user).onlineFeedbackFail(queryParam); + return page; + } + + public XSSFWorkbook exportOnlineFeedbackFail(Long requestId) { + List 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.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; +// } } diff --git a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java index 9e76f49b2..015dcb91f 100644 --- a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java @@ -5,10 +5,7 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.AddUpSituation; import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; -import com.engine.salary.entity.datacollection.param.AddUpSituationDeleteParam; -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.entity.datacollection.param.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.AddUpSituationService; import com.engine.salary.service.impl.AddUpSituationServiceImpl; @@ -169,4 +166,8 @@ public class AddUpSituationWrapper extends Service { public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) { return getAddUpSituationService(user).getAddUpSituation(addUpSituationParam); } + + public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { + return getAddUpSituationService(user).onlineRequest(param); + } }