diff --git a/resource/WEB-INF/salaryoptconfig.xml b/resource/WEB-INF/salaryoptconfig.xml index cc4c607b8..11ea398bc 100644 --- a/resource/WEB-INF/salaryoptconfig.xml +++ b/resource/WEB-INF/salaryoptconfig.xml @@ -39,6 +39,11 @@ + + + + + diff --git a/resource/sqlupgrade/DM/sql202307180103.sql b/resource/sqlupgrade/DM/sql202307180103.sql new file mode 100644 index 000000000..86cf943b7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/DM/sql202307180203.sql b/resource/sqlupgrade/DM/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/DM/sql202307180403.sql b/resource/sqlupgrade/DM/sql202307180403.sql new file mode 100644 index 000000000..fb5e8e455 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) , + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/DM/sql202308080603.sql b/resource/sqlupgrade/DM/sql202308080603.sql new file mode 100644 index 000000000..3fa4e6655 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202308090303.sql b/resource/sqlupgrade/DM/sql202308090303.sql new file mode 100644 index 000000000..0a9e21cc4 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month date, + tax_cycle date, + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/DM/sql202308100803.sql b/resource/sqlupgrade/DM/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110103.sql b/resource/sqlupgrade/DM/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110203.sql b/resource/sqlupgrade/DM/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/DM/sql202308110303.sql b/resource/sqlupgrade/DM/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/DM/sql202308140203.sql b/resource/sqlupgrade/DM/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/DM/sql202308150303.sql b/resource/sqlupgrade/DM/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/DM/sql202308150503.sql b/resource/sqlupgrade/DM/sql202308150503.sql new file mode 100644 index 000000000..e268c0264 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150503.sql @@ -0,0 +1,729 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz'); +/ + diff --git a/resource/sqlupgrade/DM/sql202308150603.sql b/resource/sqlupgrade/DM/sql202308150603.sql new file mode 100644 index 000000000..42973a3fa --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); +/ + diff --git a/resource/sqlupgrade/DM/sql202308170103.sql b/resource/sqlupgrade/DM/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/DM/sql202308230303.sql b/resource/sqlupgrade/DM/sql202308230303.sql new file mode 100644 index 000000000..4867c56aa --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308230303.sql @@ -0,0 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/DM/sql202308240201.sql b/resource/sqlupgrade/DM/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/DM/sql202308240302.sql b/resource/sqlupgrade/DM/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/DM/sql202308280203.sql b/resource/sqlupgrade/DM/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + 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/sql202309050203.sql b/resource/sqlupgrade/DM/sql202309050203.sql new file mode 100644 index 000000000..2b3f805e1 --- /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, 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'), 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, 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'), 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/DM/sql202312190103.sql b/resource/sqlupgrade/DM/sql202312190103.sql new file mode 100644 index 000000000..3956b4605 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/DM/sql202312270603.sql b/resource/sqlupgrade/DM/sql202312270603.sql new file mode 100644 index 000000000..d239eb43a --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE hrsa_tax_declare_record add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202312270703.sql b/resource/sqlupgrade/DM/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/DM/sql202403193303.sql b/resource/sqlupgrade/DM/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = '中国' where nationality is null; +/ + diff --git a/resource/sqlupgrade/DM/sql202404120303.sql b/resource/sqlupgrade/DM/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/DM/sql202406170103.sql b/resource/sqlupgrade/DM/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/DM/sql202406260403.sql b/resource/sqlupgrade/DM/sql202406260403.sql new file mode 100644 index 000000000..f27cbf3c4 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202406260403.sql @@ -0,0 +1,14 @@ +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202407170103.sql b/resource/sqlupgrade/DM/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202412160303.sql b/resource/sqlupgrade/DM/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202412160403.sql b/resource/sqlupgrade/DM/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/DM/sql202412230103.sql b/resource/sqlupgrade/DM/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/DM/sql202412240103.sql b/resource/sqlupgrade/DM/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/DM/sql202503190103.sql b/resource/sqlupgrade/DM/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202506190103.sql b/resource/sqlupgrade/DM/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/DM/sql202507010303.sql b/resource/sqlupgrade/DM/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/DM/sql202507010403.sql b/resource/sqlupgrade/DM/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/DM/sql202507110103.sql b/resource/sqlupgrade/DM/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/GS/sql202308080603.sql b/resource/sqlupgrade/GS/sql202308080603.sql new file mode 100644 index 000000000..3fa4e6655 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308090303.sql b/resource/sqlupgrade/GS/sql202308090303.sql new file mode 100644 index 000000000..0a9e21cc4 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month date, + tax_cycle date, + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/GS/sql202308100803.sql b/resource/sqlupgrade/GS/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110103.sql b/resource/sqlupgrade/GS/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110203.sql b/resource/sqlupgrade/GS/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/GS/sql202308110303.sql b/resource/sqlupgrade/GS/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/GS/sql202308140203.sql b/resource/sqlupgrade/GS/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150303.sql b/resource/sqlupgrade/GS/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150503.sql b/resource/sqlupgrade/GS/sql202308150503.sql new file mode 100644 index 000000000..e268c0264 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150503.sql @@ -0,0 +1,729 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz'); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150603.sql b/resource/sqlupgrade/GS/sql202308150603.sql new file mode 100644 index 000000000..42973a3fa --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); +/ + diff --git a/resource/sqlupgrade/GS/sql202308170103.sql b/resource/sqlupgrade/GS/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/GS/sql202308230303.sql b/resource/sqlupgrade/GS/sql202308230303.sql new file mode 100644 index 000000000..4867c56aa --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308230303.sql @@ -0,0 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/GS/sql202308240201.sql b/resource/sqlupgrade/GS/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202308240302.sql b/resource/sqlupgrade/GS/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/GS/sql202308280203.sql b/resource/sqlupgrade/GS/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + 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/sql202309050203.sql b/resource/sqlupgrade/GS/sql202309050203.sql new file mode 100644 index 000000000..2b3f805e1 --- /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, 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'), 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, 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'), 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/sql202312190103.sql b/resource/sqlupgrade/GS/sql202312190103.sql new file mode 100644 index 000000000..3956b4605 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202312270603.sql b/resource/sqlupgrade/GS/sql202312270603.sql new file mode 100644 index 000000000..d239eb43a --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE hrsa_tax_declare_record add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202312270703.sql b/resource/sqlupgrade/GS/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202403193303.sql b/resource/sqlupgrade/GS/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = '中国' where nationality is null; +/ + diff --git a/resource/sqlupgrade/GS/sql202404120303.sql b/resource/sqlupgrade/GS/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202406170103.sql b/resource/sqlupgrade/GS/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/GS/sql202406260403.sql b/resource/sqlupgrade/GS/sql202406260403.sql new file mode 100644 index 000000000..f27cbf3c4 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202406260403.sql @@ -0,0 +1,14 @@ +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202407170103.sql b/resource/sqlupgrade/GS/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412160303.sql b/resource/sqlupgrade/GS/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412160403.sql b/resource/sqlupgrade/GS/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/GS/sql202412230103.sql b/resource/sqlupgrade/GS/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412240103.sql b/resource/sqlupgrade/GS/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202503190103.sql b/resource/sqlupgrade/GS/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202506190103.sql b/resource/sqlupgrade/GS/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/GS/sql202507010303.sql b/resource/sqlupgrade/GS/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/GS/sql202507010403.sql b/resource/sqlupgrade/GS/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/GS/sql202507110103.sql b/resource/sqlupgrade/GS/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180103.sql b/resource/sqlupgrade/JC/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/JC/sql202307180203.sql b/resource/sqlupgrade/JC/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180403.sql b/resource/sqlupgrade/JC/sql202307180403.sql new file mode 100644 index 000000000..fb5e8e455 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) , + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/JC/sql202308080603.sql b/resource/sqlupgrade/JC/sql202308080603.sql new file mode 100644 index 000000000..3fa4e6655 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308090303.sql b/resource/sqlupgrade/JC/sql202308090303.sql new file mode 100644 index 000000000..0a9e21cc4 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month date, + tax_cycle date, + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/JC/sql202308100803.sql b/resource/sqlupgrade/JC/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110103.sql b/resource/sqlupgrade/JC/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110203.sql b/resource/sqlupgrade/JC/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/JC/sql202308110303.sql b/resource/sqlupgrade/JC/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/JC/sql202308140203.sql b/resource/sqlupgrade/JC/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150303.sql b/resource/sqlupgrade/JC/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150503.sql b/resource/sqlupgrade/JC/sql202308150503.sql new file mode 100644 index 000000000..e268c0264 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150503.sql @@ -0,0 +1,729 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz'); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150603.sql b/resource/sqlupgrade/JC/sql202308150603.sql new file mode 100644 index 000000000..42973a3fa --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); +/ + diff --git a/resource/sqlupgrade/JC/sql202308170103.sql b/resource/sqlupgrade/JC/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/JC/sql202308230303.sql b/resource/sqlupgrade/JC/sql202308230303.sql new file mode 100644 index 000000000..4867c56aa --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308230303.sql @@ -0,0 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/JC/sql202308240201.sql b/resource/sqlupgrade/JC/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/JC/sql202308240302.sql b/resource/sqlupgrade/JC/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/JC/sql202308280203.sql b/resource/sqlupgrade/JC/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + 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/sql202309050203.sql b/resource/sqlupgrade/JC/sql202309050203.sql new file mode 100644 index 000000000..2b3f805e1 --- /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, 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'), 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, 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'), 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/sql202312190103.sql b/resource/sqlupgrade/JC/sql202312190103.sql new file mode 100644 index 000000000..3956b4605 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202312270603.sql b/resource/sqlupgrade/JC/sql202312270603.sql new file mode 100644 index 000000000..d239eb43a --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE hrsa_tax_declare_record add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202312270703.sql b/resource/sqlupgrade/JC/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202403193303.sql b/resource/sqlupgrade/JC/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = '中国' where nationality is null; +/ + diff --git a/resource/sqlupgrade/JC/sql202404120303.sql b/resource/sqlupgrade/JC/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202406170103.sql b/resource/sqlupgrade/JC/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/JC/sql202406260403.sql b/resource/sqlupgrade/JC/sql202406260403.sql new file mode 100644 index 000000000..f27cbf3c4 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202406260403.sql @@ -0,0 +1,14 @@ +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202407170103.sql b/resource/sqlupgrade/JC/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412160303.sql b/resource/sqlupgrade/JC/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412160403.sql b/resource/sqlupgrade/JC/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/JC/sql202412230103.sql b/resource/sqlupgrade/JC/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412240103.sql b/resource/sqlupgrade/JC/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202503190103.sql b/resource/sqlupgrade/JC/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202506190103.sql b/resource/sqlupgrade/JC/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/JC/sql202507010303.sql b/resource/sqlupgrade/JC/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/JC/sql202507010403.sql b/resource/sqlupgrade/JC/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/JC/sql202507110103.sql b/resource/sqlupgrade/JC/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202307170503.sql b/resource/sqlupgrade/Mysql/sql202307170503.sql new file mode 100644 index 000000000..34a291882 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307170503.sql @@ -0,0 +1,8 @@ +alter table hrsa_tax_agent add tax_cycle_type int +; + +alter table hrsa_tax_agent modify column tax_cycle_type int default 3 +; + +update hrsa_tax_agent set tax_cycle_type = 3 where tax_cycle_type is null +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180103.sql b/resource/sqlupgrade/Mysql/sql202307180103.sql new file mode 100644 index 000000000..7464e0877 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + 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' , + api_profile int comment '接口环境' +) +; + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +; + +create table hrsa_tax_payment_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' , + tax_agent_id bigint not null comment '个税扣缴义务人ID' , + tax_declare_record_id bigint comment '个税申报记录' , + tax_year_month date not null comment '税款所属期' , + request_id varchar(50) not null comment '请求id' , + request_type int not null comment '请求类型' +) +; + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180203.sql b/resource/sqlupgrade/Mysql/sql202307180203.sql new file mode 100644 index 000000000..ee05310cf --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + 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' , + host varchar(255) comment '接口host' , + app_key varchar(255) comment 'appKey' , + app_secret varchar(255) comment 'appSecret' +) +; + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +; + +alter table hrsa_tax_declare_api_config modify host varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_key varchar(255) not null +; + +alter table hrsa_tax_declare_api_config modify app_secret varchar(255) not null +; + +alter table hrsa_tax_declare_api_config add enable_use int +; + +alter table hrsa_tax_declare_api_config add totality bigint +; + +alter table hrsa_tax_declare_api_config add remain bigint +; + +alter table hrsa_tax_declare_api_config add last_update_time datetime +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180403.sql b/resource/sqlupgrade/Mysql/sql202307180403.sql new file mode 100644 index 000000000..63e7d6274 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + 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' , + tax_agent_id bigint not null comment '锟斤拷税锟桔斤拷锟斤拷锟斤拷锟斤拷ID' , + tax_code varchar(50) not null comment '税锟斤拷' , + tax_registration_number varchar(50) comment '锟角硷拷锟斤拷锟' , + department_code varchar(50) comment '锟斤拷锟脚憋拷锟' , + department_name varchar(50) comment '锟斤拷锟斤拷锟斤拷锟斤拷' , + nation varchar(50) comment '锟斤拷锟斤拷' , + province varchar(50) comment '省锟斤拷' , + city varchar(50) comment '锟叫硷拷' , + area_code varchar(50) not null comment '锟斤拷锟斤拷锟斤拷锟斤拷' , + password_type int(2) not null comment '锟斤拷锟斤拷校锟斤拷锟斤拷锟斤拷' , + real_account varchar(50) comment '实锟斤拷锟剿猴拷' , + pwd varchar(50) not null comment '锟斤拷锟斤拷' , + check_status int(2) not null comment '锟斤拷税锟斤拷证状态' , + fail_reason varchar(255) comment '锟斤拷锟揭伙拷锟斤拷锟街なэ拷锟皆拷锟' +) +; + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +; + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308080603.sql b/resource/sqlupgrade/Mysql/sql202308080603.sql new file mode 100644 index 000000000..85c4d2db6 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + 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' , + tax_agent_id bigint comment '个税扣缴义务人' , + tax_cycle datetime comment '税款所属期' , + request_id varchar(100) comment '供应商第三方系统翻译的requestid' +) +; + +create table hrsa_employee_declare +( + 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' , + tax_agent_id bigint comment '个税扣缴义务人ID' , + tax_cycle datetime comment '税款所属期' , + employee_id bigint comment '人员id' , + employee_type tinyint comment '人员类型' , + employee_name varchar(100) comment '姓名' , + job_num varchar(100) comment '工号' , + card_type tinyint comment '证件类型' , + card_num varchar(100) comment '证件号码' , + gender varchar(100) comment '性别' , + birthday date comment '生日' , + employment_status tinyint comment '人员状态' , + mobile varchar(100) comment '手机号码' , + employment_type tinyint comment '任职受雇从业类型' , + employment_first_year varchar(100) comment '入职年度就业情形' , + employment_date date comment '任职受雇从业日期' , + dismiss_date date comment '离职日期' , + disability tinyint comment '是否残疾' , + disability_card_no varchar(100) comment '残疾证号码' , + lonely_old tinyint comment '是否孤老' , + martyr_dependents tinyint comment '是否烈属' , + martyr_dependents_card_no varchar(100) comment '烈属证号码' , + deduct_expenses tinyint comment '是否扣除减除费用' , + successfully_declared tinyint comment '是否成功报送过' , + new_employee_info tinyint comment '本月是否编辑过' , + declare_status tinyint comment '报送状态' , + declare_error_msg varchar(1000) comment '报送失败时的错误信息' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308090303.sql b/resource/sqlupgrade/Mysql/sql202308090303.sql new file mode 100644 index 000000000..4e6351529 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308090303.sql @@ -0,0 +1,32 @@ +create table hrsa_tax_declare_record +( + 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' , + tax_agent_id bigint comment '个税扣缴义务人id' , + salary_month datetime comment '薪资所属月' , + tax_cycle datetime comment '税款所属期' , + remark varchar(1000) comment '备注' , + request_id varchar(100) comment '供应商第三方系统返回的requestid' , + tax_declare_type tinyint comment '申报类型' , + tax_declare_status tinyint comment '申报状态' +) +; + +alter table hrsa_tax_declare_record add display_update_icon tinyint +; + +alter table hrsa_tax_declare_record add tax_pay_amount varchar(255) +; + +alter table hrsa_tax_declare_record add person_num int +; +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar(1000) +; +alter table hrsa_tax_declare_record add tax_paid_amount varchar(255) +; +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar(255) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308100803.sql b/resource/sqlupgrade/Mysql/sql202308100803.sql new file mode 100644 index 000000000..438670759 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_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' , + tax_declare_record_id bigint comment '个税申报记录id' , + employee_name varchar(100) comment '姓名' , + card_num varchar(100) comment '证件号码' , + error_msg varchar(1000) comment '失败原因' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308110103.sql b/resource/sqlupgrade/Mysql/sql202308110103.sql new file mode 100644 index 000000000..296d921a2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + 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' , + tax_report_type varchar(100) comment '报表类型' , + income_category varchar(100) comment '所得项目' , + report_column_name varchar(100) comment '列名' , + report_column_data_index varchar(100) comment '列索引' +) +; + +create table hrsa_sob_tax_report_rule +( + 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' , + salary_sob_id bigint comment '薪资账套的id' , + income_category varchar(100) comment '所得项目' , + report_column_data_index varchar(100) comment '个税申报表列索引' , + salary_item_id bigint comment '薪资项目id' +) +; + +alter table hrsa_tax_report_column add data_type varchar(100) +; + +alter table hrsa_tax_report_column add request_param_key varchar(100) +; + +alter table hrsa_tax_report_column add report_column_label varchar(100) +; diff --git a/resource/sqlupgrade/Mysql/sql202308110203.sql b/resource/sqlupgrade/Mysql/sql202308110203.sql new file mode 100644 index 000000000..35182319d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declare_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' , + tax_declare_record_id bigint comment '个税申报记录id' , + employee_name varchar(100) comment '姓名' , + card_num varchar(100) comment '证件号码' , + error_msg varchar(1000) comment '失败原因' +) +; +alter table hrsa_tax_declare_fail add income_category varchar(100) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308110303.sql b/resource/sqlupgrade/Mysql/sql202308110303.sql new file mode 100644 index 000000000..eaa08d8ae --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308110303.sql @@ -0,0 +1,16 @@ +alter table hrsa_tax_declaration add control_view int +; + +alter table hrsa_tax_declaration add tax_declare_record_id bigint +; + +alter table hrsa_salary_acct_emp add income_category varchar(100) +; + +alter table hrsa_salary_acct_record add control_view int +; + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +; +update hrsa_tax_declaration set control_view = 0 where control_view is null +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308140203.sql b/resource/sqlupgrade/Mysql/sql202308140203.sql new file mode 100644 index 000000000..b78034d4f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + 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' , + tax_declare_record_id bigint comment '个税申报记录id' , + tax_declaration_id bigint comment '个税申报表id' , + employee_type tinyint comment '人员类型' , + employee_id bigint comment '人员id' , + result_value_json text comment '个税申报表明细值' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308150303.sql b/resource/sqlupgrade/Mysql/sql202308150303.sql new file mode 100644 index 000000000..6b6d9b03f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150303.sql @@ -0,0 +1,25 @@ +alter table hrsa_salary_sob_item add income_category varchar(100) +; + +alter table hrsa_salary_sob_item modify column income_category varchar(100) default '1' +; + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +; + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +; + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +; + +alter table hrsa_salary_sob_item add salary_item_code varchar(100) +; + +update hrsa_salary_sob_item a, hrsa_salary_item b +set a.salary_item_code = b.code +where a.salary_item_id = b.id +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308150503.sql b/resource/sqlupgrade/Mysql/sql202308150503.sql new file mode 100644 index 000000000..6b97fb8f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150503.sql @@ -0,0 +1,619 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd') +; +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz') +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308150603.sql b/resource/sqlupgrade/Mysql/sql202308150603.sql new file mode 100644 index 000000000..d79395752 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150603.sql @@ -0,0 +1,58 @@ +create table hrsa_sob_add_up_rule +( + 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' , + salary_sob_id bigint comment '薪资账套的id' , + income_category varchar(100) comment '收入所得项目' , + salary_item_id bigint comment '薪资项目的id' , + add_up_column_data_index varchar(100) comment '往期累计情况的字段索引' +) +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +; + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +; + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +; +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308170103.sql b/resource/sqlupgrade/Mysql/sql202308170103.sql new file mode 100644 index 000000000..c97cc02f4 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308230303.sql b/resource/sqlupgrade/Mysql/sql202308230303.sql new file mode 100644 index 000000000..76f96bf71 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308230303.sql @@ -0,0 +1,4 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar(400) +; + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308240201.sql b/resource/sqlupgrade/Mysql/sql202308240201.sql new file mode 100644 index 000000000..990d9534d --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) +; +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=char_length(labelname) ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=char_length(labelname) )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 +; + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) +; +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=char_length(labelname) ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=char_length(labelname) )) limit 1 +; +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308240302.sql b/resource/sqlupgrade/Mysql/sql202308240302.sql new file mode 100644 index 000000000..1164be8d3 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +; +Delete from LeftMenuConfig where infoid=100191 +; +call LMConfig_U_ByInfoInsert (2,100181,1) +; +call LMInfo_Insert (100191,544827,'','',2,100181,1,18) +; +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +; + +Delete from LeftMenuInfo where id=100192 +; +Delete from LeftMenuConfig where infoid=100192 +; +call LMConfig_U_ByInfoInsert (2,100118,7) +; +call LMInfo_Insert (100192,544826,'','',2,100118,7,18) +; +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202308280203.sql b/resource/sqlupgrade/Mysql/sql202308280203.sql new file mode 100644 index 000000000..ef5d03136 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + 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' , + warn_config_id bigint not null comment '提醒配置的id' , + employee_id bigint not null comment '接收人id' , + email varchar(100) comment '邮箱' , + mobile varchar(50) comment '手机号' +) +; + +create table hrsa_tax_api_flow_record +( + 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' , + tax_agent_id bigint not null comment '个税扣缴义务人的主键id' , + tax_month datetime not null comment '税款所属期' , + use_time datetime not null comment '使用时间' , + deduct int comment '是否扣流量(暂时没用)' , + employee_id bigint not null comment '人员ID' , + business_type int not null comment '接口业务类型' , + result_status int not null comment '结果' +) +; + +create table hrsa_tax_api_flow_warn_config +( + 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' , + enable_warn int default 0 not null comment '是否提醒' , + threshold int default 0 not null comment '提醒阈值' , + business_id bigint default '0' not null comment '消息业务ID' +) +; 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/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/Mysql/sql202312190103.sql b/resource/sqlupgrade/Mysql/sql202312190103.sql new file mode 100644 index 000000000..006ea1239 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312190103.sql @@ -0,0 +1,46 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int(0) NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); + + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202312270603.sql b/resource/sqlupgrade/Mysql/sql202312270603.sql new file mode 100644 index 000000000..52d95fada --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int(0) NULL ; + +ALTER TABLE hrsa_tax_declare_record ADD COLUMN declare_request_id varchar(100) NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202312270703.sql b/resource/sqlupgrade/Mysql/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202403193303.sql b/resource/sqlupgrade/Mysql/sql202403193303.sql new file mode 100644 index 000000000..8a2735c24 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202403193303.sql @@ -0,0 +1,8 @@ +ALTER TABLE hrsa_employee_declare +ADD COLUMN nationality varchar(255) NULL, +ADD COLUMN birthplace varchar(255) NULL, +ADD COLUMN tax_reasons varchar(255) NULL, +ADD COLUMN entry_date date NULL, +ADD COLUMN departure_date date NULL ; + +update hrsa_employee_declare set nationality = '中国' where nationality is null; diff --git a/resource/sqlupgrade/Mysql/sql202404120303.sql b/resource/sqlupgrade/Mysql/sql202404120303.sql new file mode 100644 index 000000000..67da1a7d2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id bigint(0) NOT NULL , +tax_declare_record_id bigint(0) NULL , +report_type int(0) NULL , +request_id varchar(100) , +tax_declare_type tinyint(0) NULL , +tax_declare_status tinyint(0) NULL , +display_update_icon tinyint(0) NULL , +tax_declare_error_msg varchar(1000) , +person_num int(0) NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int(0) NULL, +PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202406170103.sql b/resource/sqlupgrade/Mysql/sql202406170103.sql new file mode 100644 index 000000000..be09a90f9 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( + id bigint(0) NOT NULL, + create_time datetime(0) , + update_time datetime(0) , + creator bigint(0) , + delete_type int(0) , + tenant_key varchar(10), + salary_sob_id bigint(0), + income_category varchar(100) , + tax_index varchar(100) , + salary_item_id bigint(0) , + PRIMARY KEY (id) +) ; diff --git a/resource/sqlupgrade/Mysql/sql202406260403.sql b/resource/sqlupgrade/Mysql/sql202406260403.sql new file mode 100644 index 000000000..4a8a4b313 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202406260403.sql @@ -0,0 +1,12 @@ +CREATE TABLE hrsa_api_task_record ( + id bigint(0) NOT NULL , + source varchar(500) , + api varchar(500), + param text , + response text, + tenant_key varchar(255) , + delete_type int(0) , + create_time datetime(0), + update_time datetime(0), + PRIMARY KEY (id) USING BTREE +); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202407170103.sql b/resource/sqlupgrade/Mysql/sql202407170103.sql new file mode 100644 index 000000000..10ccaaadd --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key comment 'ID' , + create_time datetime default now() comment '创建时间' , + update_time datetime default now() comment '修改时间' , + creator bigint comment '创建人id' , + delete_type int default 0 comment '是否删除' , + tenant_key varchar(10) comment '租户KEY' , + salary_acct_record_id bigint comment '薪资核算记录id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + request_id varchar(100) comment '请求requestId' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202412160303.sql b/resource/sqlupgrade/Mysql/sql202412160303.sql new file mode 100644 index 000000000..c10d7fee8 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412160303.sql @@ -0,0 +1,132 @@ +create table hrsa_other_derate_deduction +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + other_deduction varchar(50) comment '其他减免税额' , + remark varchar(255) comment '备注' +) +; + + +create table hrsa_health_insurance +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + identification_number varchar(255) comment '税优识别码' , + effective_date date comment '保单生效日期' , + year_premium varchar(50) comment '年度保费' , + month_premium varchar(50) comment '月度保费' , + current_deduction varchar(50) comment '本期扣除金额' +) +; + + +create table hrsa_grant_donation +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + recipient_name varchar(255) comment '受赠单位名称' , + tax_code varchar(255) comment '受赠单位纳税人识别号' , + donation_number varchar(255) comment '捐赠凭证号' , + donate_date date comment '捐赠日期' , + donate_amount varchar(50) comment '捐赠金额' , + deduction_proportion varchar(10) comment '扣除比例' , + actual_deduction varchar(50) comment '实际扣除金额' +) +; + + + +create table hrsa_endowment_insurance +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + account_number varchar(255) comment '税延养老账户编号' , + check_code varchar(255) comment '报税校验码' , + year_premium varchar(50) comment '年度保费' , + month_premium varchar(50) comment '月度保费' , + current_deduction varchar(50) comment '本期扣除金额' , + deduction_month date comment '申请扣除月份' +) +; + + +create table hrsa_derate_deduction +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + derate_item varchar(255) comment '减免事项' , + derate_property varchar(255) comment '减免性质' , + derate_amount varchar(255) comment '减免税额' +) +; + + + +create table hrsa_free_income +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + free_item varchar(255) comment '免税事项' , + free_property varchar(255) comment '免税性质' , + free_amount varchar(255) comment '免税金额' +) +; + + + + diff --git a/resource/sqlupgrade/Mysql/sql202412160403.sql b/resource/sqlupgrade/Mysql/sql202412160403.sql new file mode 100644 index 000000000..601430556 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +; +alter table hrsa_endowment_insurance add employee_type int +; +alter table hrsa_free_income add employee_type int +; +alter table hrsa_grant_donation add employee_type int +; +alter table hrsa_health_insurance add employee_type int +; +alter table hrsa_other_derate_deduction add employee_type int +; diff --git a/resource/sqlupgrade/Mysql/sql202412230103.sql b/resource/sqlupgrade/Mysql/sql202412230103.sql new file mode 100644 index 000000000..1905ea452 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + 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' , + main_id bigint comment '主表数据id' , + tax_year_month date comment '税款所属期' , + employee_id bigint comment '人员id' , + tax_agent_id bigint comment '个税扣缴义务人id' , + file_status int comment '归档状态 0未归档 1已归档' , + voucher_type varchar(255) comment '凭证类型' , + voucher_no varchar(255) comment '凭证编码' , + pay_amount varchar(255) comment '金额' , + data_source int comment '数据来源' , + collect_source varchar(50) comment '采集来源' , + pay_month date comment '缴费月度' , + eb_data_id bigint comment 'eb数据id' , + voucher_type_name varchar(50) comment '凭证类型' , + employee_type int comment '人员类型' +) +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202412240103.sql b/resource/sqlupgrade/Mysql/sql202412240103.sql new file mode 100644 index 000000000..fb1d84ef2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction +ADD COLUMN free_income varchar(255) , +ADD COLUMN derate_deduction varchar(255) ; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202503190103.sql b/resource/sqlupgrade/Mysql/sql202503190103.sql new file mode 100644 index 000000000..6c78f00ed --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202503190103.sql @@ -0,0 +1,37 @@ +CREATE TABLE hrsa_deduction_amount +( + id bigint(0), + create_time datetime(0), + update_time datetime(0), + creator bigint(0), + delete_type int(0), + tenant_key varchar(10), + tax_agent_id bigint(0), + year varchar(100), + employee_id bigint(0), + employee_type tinyint(0), + employee_name varchar(100), + job_num varchar(100), + card_type tinyint(0), + card_num varchar(100), + nationality varchar(200), + deduct_flag tinyint(0), + successfully_declared tinyint(0), + declare_status tinyint(0), + declare_error_msg varchar(3000), + PRIMARY KEY (id) USING BTREE +); + +CREATE TABLE hrsa_deduction_amount_record +( + id bigint(0), + create_time datetime(0), + update_time datetime(0), + creator bigint(0), + delete_type int(0), + tenant_key varchar(10), + tax_agent_id bigint(0), + year varchar(255), + request_id varchar(100), + PRIMARY KEY (id) USING BTREE +); diff --git a/resource/sqlupgrade/Mysql/sql202506190103.sql b/resource/sqlupgrade/Mysql/sql202506190103.sql new file mode 100644 index 000000000..2ee229b09 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202506190103.sql @@ -0,0 +1,10 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202507010303.sql b/resource/sqlupgrade/Mysql/sql202507010303.sql new file mode 100644 index 000000000..8b3a971e8 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507010303.sql @@ -0,0 +1,7 @@ +ALTER TABLE hrsa_free_income ADD COLUMN income_category int(0); +ALTER TABLE hrsa_derate_deduction ADD COLUMN income_category int(0); +ALTER TABLE hrsa_endowment_insurance ADD COLUMN income_category int(0); +ALTER TABLE hrsa_grant_donation ADD COLUMN income_category int(0); +ALTER TABLE hrsa_health_insurance ADD COLUMN income_category int(0); +ALTER TABLE hrsa_other_derate_deduction ADD COLUMN income_category int(0); +ALTER TABLE hrsa_personal_pension ADD COLUMN income_category int(0); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202507010403.sql b/resource/sqlupgrade/Mysql/sql202507010403.sql new file mode 100644 index 000000000..d6247eefc --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507010403.sql @@ -0,0 +1,7 @@ +update hrsa_free_income set income_category = 1; +update hrsa_derate_deduction set income_category = 1; +update hrsa_endowment_insurance set income_category = 1; +update hrsa_grant_donation set income_category = 1; +update hrsa_health_insurance set income_category = 1; +update hrsa_other_derate_deduction set income_category = 1; +update hrsa_personal_pension set income_category = 1; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202507110103.sql b/resource/sqlupgrade/Mysql/sql202507110103.sql new file mode 100644 index 000000000..ab9b6cb2e --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202507110103.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180103.sql b/resource/sqlupgrade/Oracle/sql202307180103.sql new file mode 100644 index 000000000..c0a1672eb --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +) +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +) +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180203.sql b/resource/sqlupgrade/Oracle/sql202307180203.sql new file mode 100644 index 000000000..6ab4e5d58 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +) +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +/ + +alter table hrsa_tax_declare_api_config modify host not null +/ + +alter table hrsa_tax_declare_api_config modify app_key not null +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null +/ + +alter table hrsa_tax_declare_api_config add enable_use int +/ + +alter table hrsa_tax_declare_api_config add totality number +/ + +alter table hrsa_tax_declare_api_config add remain number +/ + +alter table hrsa_tax_declare_api_config add last_update_time date +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180403.sql b/resource/sqlupgrade/Oracle/sql202307180403.sql new file mode 100644 index 000000000..c34456078 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) , + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +) +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308080603.sql b/resource/sqlupgrade/Oracle/sql202308080603.sql new file mode 100644 index 000000000..d41df5b05 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +) +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308090303.sql b/resource/sqlupgrade/Oracle/sql202308090303.sql new file mode 100644 index 000000000..7ce46cb95 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308090303.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month date, + tax_cycle date, + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +) +/ + +alter table hrsa_tax_declare_record add display_update_icon number +/ +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255) +/ + +alter table hrsa_tax_declare_record add person_num int +/ +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000) +/ +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255) +/ +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308100803.sql b/resource/sqlupgrade/Oracle/sql202308100803.sql new file mode 100644 index 000000000..e30e9aa15 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110103.sql b/resource/sqlupgrade/Oracle/sql202308110103.sql new file mode 100644 index 000000000..ee096466d --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +) +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +) +/ + +alter table hrsa_tax_report_column add data_type varchar2(100) +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100) +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110203.sql b/resource/sqlupgrade/Oracle/sql202308110203.sql new file mode 100644 index 000000000..751860966 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +) +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308110303.sql b/resource/sqlupgrade/Oracle/sql202308110303.sql new file mode 100644 index 000000000..31f781391 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308110303.sql @@ -0,0 +1,13 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number +/ +alter table hrsa_tax_declaration add control_view int +/ +alter table hrsa_salary_acct_emp add income_category varchar2(100) +/ +alter table hrsa_salary_acct_record add control_view int +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +/ +update hrsa_tax_declaration set control_view = 0 where control_view is null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308140203.sql b/resource/sqlupgrade/Oracle/sql202308140203.sql new file mode 100644 index 000000000..a04ffa126 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150303.sql b/resource/sqlupgrade/Oracle/sql202308150303.sql new file mode 100644 index 000000000..d73054258 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150303.sql @@ -0,0 +1,28 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100) +/ + +alter table hrsa_salary_sob_item modify income_category default '1' +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100) +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150503.sql b/resource/sqlupgrade/Oracle/sql202308150503.sql new file mode 100644 index 000000000..6de504e07 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150503.sql @@ -0,0 +1,619 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz') +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150603.sql b/resource/sqlupgrade/Oracle/sql202308150603.sql new file mode 100644 index 000000000..4f9868ff8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150603.sql @@ -0,0 +1,57 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +) +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +/ +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308170103.sql b/resource/sqlupgrade/Oracle/sql202308170103.sql new file mode 100644 index 000000000..040162f3a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308230303.sql b/resource/sqlupgrade/Oracle/sql202308230303.sql new file mode 100644 index 000000000..1f61a5c96 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308230303.sql @@ -0,0 +1,5 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400) +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308240201.sql b/resource/sqlupgrade/Oracle/sql202308240201.sql new file mode 100644 index 000000000..a0cf95fa0 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) +/ +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 +/ + + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) +/ +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308240302.sql b/resource/sqlupgrade/Oracle/sql202308240302.sql new file mode 100644 index 000000000..e2bb43cae --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +/ +Delete from LeftMenuConfig where infoid=100191 +/ +call LMConfig_U_ByInfoInsert (2,100181,1) +/ +call LMInfo_Insert (100191,544827,'','',2,100181,1,18) +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +/ + +Delete from LeftMenuInfo where id=100192 +/ +Delete from LeftMenuConfig where infoid=100192 +/ +call LMConfig_U_ByInfoInsert (2,100118,7) +/ +call LMInfo_Insert (100192,544826,'','',2,100118,7,18) +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308280203.sql b/resource/sqlupgrade/Oracle/sql202308280203.sql new file mode 100644 index 000000000..20bac3295 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308280203.sql @@ -0,0 +1,48 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +) +/ + + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +) +/ + + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +) +/ \ 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/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql new file mode 100644 index 000000000..3caa7ac50 --- /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, 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'), 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, 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'), 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/Oracle/sql202312190103.sql b/resource/sqlupgrade/Oracle/sql202312190103.sql new file mode 100644 index 000000000..033891dfd --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1) +/ + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1) +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出' +/ + +update hrsa_tax_report_column set contrast_type = 0 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270603.sql b/resource/sqlupgrade/Oracle/sql202312270603.sql new file mode 100644 index 000000000..8a7c248cf --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270603.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +) +/ + +ALTER TABLE hrsa_tax_declare_record add ( + declare_request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270703.sql b/resource/sqlupgrade/Oracle/sql202312270703.sql new file mode 100644 index 000000000..817e4ba00 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202403193303.sql b/resource/sqlupgrade/Oracle/sql202403193303.sql new file mode 100644 index 000000000..e12698cbc --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202403193303.sql @@ -0,0 +1,11 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +) +/ + +update hrsa_employee_declare set nationality = '中国' where nationality is null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202404120303.sql b/resource/sqlupgrade/Oracle/sql202404120303.sql new file mode 100644 index 000000000..c024ae2a7 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202406170103.sql b/resource/sqlupgrade/Oracle/sql202406170103.sql new file mode 100644 index 000000000..1abe248d6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202406260403.sql b/resource/sqlupgrade/Oracle/sql202406260403.sql new file mode 100644 index 000000000..610ce393c --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202406260403.sql @@ -0,0 +1,13 @@ +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202407170103.sql b/resource/sqlupgrade/Oracle/sql202407170103.sql new file mode 100644 index 000000000..906e14906 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412160303.sql b/resource/sqlupgrade/Oracle/sql202412160303.sql new file mode 100644 index 000000000..e5f509f83 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412160303.sql @@ -0,0 +1,127 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +) +/ + + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +) +/ + + + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +) +/ + + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +) +/ + + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +) +/ + + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412160403.sql b/resource/sqlupgrade/Oracle/sql202412160403.sql new file mode 100644 index 000000000..b17420382 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +/ +alter table hrsa_endowment_insurance add employee_type int +/ +alter table hrsa_free_income add employee_type int +/ +alter table hrsa_grant_donation add employee_type int +/ +alter table hrsa_health_insurance add employee_type int +/ +alter table hrsa_other_derate_deduction add employee_type int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412230103.sql b/resource/sqlupgrade/Oracle/sql202412230103.sql new file mode 100644 index 000000000..e84bbd88e --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412240103.sql b/resource/sqlupgrade/Oracle/sql202412240103.sql new file mode 100644 index 000000000..ca85eff16 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412240103.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +) +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202503190103.sql b/resource/sqlupgrade/Oracle/sql202503190103.sql new file mode 100644 index 000000000..172207806 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +) +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202506190103.sql b/resource/sqlupgrade/Oracle/sql202506190103.sql new file mode 100644 index 000000000..4196b1982 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202506190103.sql @@ -0,0 +1,18 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0) +/ + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0) +/ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507010303.sql b/resource/sqlupgrade/Oracle/sql202507010303.sql new file mode 100644 index 000000000..7cfc02c85 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507010403.sql b/resource/sqlupgrade/Oracle/sql202507010403.sql new file mode 100644 index 000000000..4eff5bab6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507010403.sql @@ -0,0 +1,14 @@ +update hrsa_free_income set income_category = 1 +/ +update hrsa_derate_deduction set income_category = 1 +/ +update hrsa_endowment_insurance set income_category = 1 +/ +update hrsa_grant_donation set income_category = 1 +/ +update hrsa_health_insurance set income_category = 1 +/ +update hrsa_other_derate_deduction set income_category = 1 +/ +update hrsa_personal_pension set income_category = 1 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202507110103.sql b/resource/sqlupgrade/Oracle/sql202507110103.sql new file mode 100644 index 000000000..40452d2a6 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202507110103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add report_type number(11) null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180103.sql b/resource/sqlupgrade/PG/sql202307180103.sql new file mode 100644 index 000000000..bae5ae375 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month date not null, + request_id varchar(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180203.sql b/resource/sqlupgrade/PG/sql202307180203.sql new file mode 100644 index 000000000..367cd19a4 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + host varchar(255), + app_key varchar(255), + app_secret varchar(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config alter column host set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_key set not null ; +/ + +alter table hrsa_tax_declare_api_config alter column app_secret set not null ; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality bigint; +/ + +alter table hrsa_tax_declare_api_config add remain bigint; +/ + +alter table hrsa_tax_declare_api_config add last_update_time timestamp; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180403.sql b/resource/sqlupgrade/PG/sql202307180403.sql new file mode 100644 index 000000000..d224c62a8 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_code varchar(50) not null, + tax_registration_number varchar(50) , + department_code varchar(50), + department_name varchar(50), + nation varchar(50), + province varchar(50), + city varchar(50), + area_code varchar(50) not null, + password_type int not null, + real_account varchar(50), + pwd varchar(50) not null, + check_status int not null, + fail_reason varchar(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308080603.sql b/resource/sqlupgrade/PG/sql202308080603.sql new file mode 100644 index 000000000..e1bd1f70a --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + tax_cycle timestamp, + request_id varchar(100) +); +/ + +create table hrsa_employee_declare +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + tax_cycle timestamp, + employee_id bigint, + employee_type smallint, + employee_name varchar(100), + job_num varchar(100), + card_type smallint, + card_num varchar(100), + gender varchar(100), + birthday date, + employment_status smallint, + mobile varchar(100), + employment_type smallint, + employment_first_year varchar(100), + employment_date date, + dismiss_date date, + disability smallint, + disability_card_no varchar(100), + lonely_old smallint, + martyr_dependents smallint, + martyr_dependents_card_no varchar(100), + deduct_expenses smallint, + successfully_declared smallint, + new_employee_info smallint, + declare_status smallint, + declare_error_msg varchar(1000) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308090303.sql b/resource/sqlupgrade/PG/sql202308090303.sql new file mode 100644 index 000000000..511123b31 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308090303.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_declare_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + salary_month timestamp, + tax_cycle timestamp, + remark varchar(1000), + request_id varchar(100), + tax_declare_type smallint, + tax_declare_status smallint +); +/ + +alter table hrsa_tax_declare_record add display_update_icon smallint; +/ +alter table hrsa_tax_declare_record add tax_pay_amount varchar(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar(1000); +/ +alter table hrsa_tax_declare_record add tax_paid_amount varchar(255); +/ +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar(255); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308100803.sql b/resource/sqlupgrade/PG/sql202308100803.sql new file mode 100644 index 000000000..b8e97e081 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + employee_name varchar(100), + card_num varchar(100), + error_msg varchar(1000) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110103.sql b/resource/sqlupgrade/PG/sql202308110103.sql new file mode 100644 index 000000000..fda879e38 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_report_type varchar(100), + income_category varchar(100), + report_column_name varchar(100), + report_column_data_index varchar(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_sob_id bigint, + income_category varchar(100), + report_column_data_index varchar(100), + salary_item_id bigint +); +/ + +alter table hrsa_tax_report_column add data_type varchar(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar(100); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110203.sql b/resource/sqlupgrade/PG/sql202308110203.sql new file mode 100644 index 000000000..c7335d809 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + employee_name varchar(100), + card_num varchar(100), + error_msg varchar(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar(100); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308110303.sql b/resource/sqlupgrade/PG/sql202308110303.sql new file mode 100644 index 000000000..e1bc1a983 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308110303.sql @@ -0,0 +1,15 @@ +alter table hrsa_tax_declaration add control_view int; +/ +alter table hrsa_tax_declaration add tax_declare_record_id bigint; +/ +alter table hrsa_salary_acct_emp add income_category varchar(100); +/ +alter table hrsa_salary_acct_record add control_view int; +/ + + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308140203.sql b/resource/sqlupgrade/PG/sql202308140203.sql new file mode 100644 index 000000000..54373d885 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_declare_record_id bigint, + tax_declaration_id bigint, + employee_type smallint, + employee_id bigint, + result_value_json text +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150303.sql b/resource/sqlupgrade/PG/sql202308150303.sql new file mode 100644 index 000000000..84a6d6a8c --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150303.sql @@ -0,0 +1,22 @@ +alter table hrsa_salary_sob_item add income_category varchar(100); +/ + +alter table hrsa_salary_sob_item alter column income_category set default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar(100); +/ + +update hrsa_salary_sob_item a set salary_item_code = b.code from hrsa_salary_item b where a.salary_item_id = b.id and a.delete_type = 0; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150503.sql b/resource/sqlupgrade/PG/sql202308150503.sql new file mode 100644 index 000000000..60602a663 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150503.sql @@ -0,0 +1,728 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150603.sql b/resource/sqlupgrade/PG/sql202308150603.sql new file mode 100644 index 000000000..357a806d0 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150603.sql @@ -0,0 +1,61 @@ +create table hrsa_sob_add_up_rule +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_sob_id bigint, + income_category varchar(100), + salary_item_id bigint, + add_up_column_data_index varchar(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308170103.sql b/resource/sqlupgrade/PG/sql202308170103.sql new file mode 100644 index 000000000..d313f1fb1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308230303.sql b/resource/sqlupgrade/PG/sql202308230303.sql new file mode 100644 index 000000000..9cd12b134 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308230303.sql @@ -0,0 +1,5 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308240201.sql b/resource/sqlupgrade/PG/sql202308240201.sql new file mode 100644 index 000000000..ed35e8a71 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) ; +/ +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=octet_length(labelname) ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=octet_length(labelname) )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) ; +/ +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=octet_length(labelname) ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=octet_length(labelname) )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308240302.sql b/resource/sqlupgrade/PG/sql202308240302.sql new file mode 100644 index 000000000..ed458429b --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191; +/ +Delete from LeftMenuConfig where infoid=100191; +/ +call LMConfig_U_ByInfoInsert (2,100181,1); +/ +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ +Delete from LeftMenuConfig where infoid=100192; +/ +call LMConfig_U_ByInfoInsert (2,100118,7); +/ +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308280203.sql b/resource/sqlupgrade/PG/sql202308280203.sql new file mode 100644 index 000000000..0f9b2c00b --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + warn_config_id bigint not null, + employee_id bigint not null, + email varchar(100), + mobile varchar(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint not null, + tax_month timestamp not null, + use_time timestamp not null, + deduct int, + employee_id bigint not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id bigint default '0' not null +); +/ \ 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/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/PG/sql202312190103.sql b/resource/sqlupgrade/PG/sql202312190103.sql new file mode 100644 index 000000000..9f472713c --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312190103.sql @@ -0,0 +1,46 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); + + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270603.sql b/resource/sqlupgrade/PG/sql202312270603.sql new file mode 100644 index 000000000..79861df5e --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; + +ALTER TABLE hrsa_tax_declare_record ADD COLUMN declare_request_id varchar(200) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270703.sql b/resource/sqlupgrade/PG/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202403193303.sql b/resource/sqlupgrade/PG/sql202403193303.sql new file mode 100644 index 000000000..2e000d661 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202403193303.sql @@ -0,0 +1,8 @@ +ALTER TABLE hrsa_employee_declare +ADD COLUMN nationality varchar(255) NULL , +ADD COLUMN birthplace varchar(255) NULL , +ADD COLUMN tax_reasons varchar(255) NULL , +ADD COLUMN entry_date timestamp NULL DEFAULT NULL , +ADD COLUMN departure_date timestamp NULL DEFAULT NULL ; + +update hrsa_employee_declare set nationality = '中国' where nationality is null; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202404120303.sql b/resource/sqlupgrade/PG/sql202404120303.sql new file mode 100644 index 000000000..6bad5c7fb --- /dev/null +++ b/resource/sqlupgrade/PG/sql202404120303.sql @@ -0,0 +1,17 @@ +CREATE TABLE hrsa_tax_declare_status ( +id bigserial NOT NULL , +tax_declare_record_id bigint NULL , +report_type int NULL , +request_id varchar(100) , +tax_declare_type int NULL , +tax_declare_status int NULL , +display_update_icon int NULL , +tax_declare_error_msg varchar(1000) , +person_num int NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int NULL, +PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202406170103.sql b/resource/sqlupgrade/PG/sql202406170103.sql new file mode 100644 index 000000000..848173fc6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202406170103.sql @@ -0,0 +1,13 @@ +CREATE TABLE hrsa_sob_tax_rule ( + id bigserial NOT NULL, + salary_sob_id bigint , + income_category varchar(100) , + tax_index varchar(100) , + salary_item_id bigint , + creator bigint NOT NULL DEFAULT 0 , + create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , + update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , + delete_type int NOT NULL DEFAULT 0 , + tenant_key varchar(10) NOT NULL DEFAULT '' , + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202406260403.sql b/resource/sqlupgrade/PG/sql202406260403.sql new file mode 100644 index 000000000..45102625b --- /dev/null +++ b/resource/sqlupgrade/PG/sql202406260403.sql @@ -0,0 +1,13 @@ +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param text , + response text, + create_time timestamp, + update_time timestamp, + delete_type int default 0, + tenant_key varchar(10) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202407170103.sql b/resource/sqlupgrade/PG/sql202407170103.sql new file mode 100644 index 000000000..47f27e07f --- /dev/null +++ b/resource/sqlupgrade/PG/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key , + create_time timestamp default now(), + update_time timestamp default now(), + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + request_id varchar(100) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412160303.sql b/resource/sqlupgrade/PG/sql202412160303.sql new file mode 100644 index 000000000..214e842a1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412160303.sql @@ -0,0 +1,125 @@ +create table hrsa_other_derate_deduction +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + other_deduction varchar(50), + remark varchar(255) +); +/ + +create table hrsa_health_insurance +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + identification_number varchar(255), + effective_date date, + year_premium varchar(50), + month_premium varchar(50), + current_deduction varchar(50) +); +/ + + +create table hrsa_grant_donation +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + recipient_name varchar(255), + tax_code varchar(255), + donation_number varchar(255), + donate_date date, + donate_amount varchar(50), + deduction_proportion varchar(10), + actual_deduction varchar(50) +); +/ + + +create table hrsa_endowment_insurance +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + account_number varchar(255), + check_code varchar(255), + year_premium varchar(50), + month_premium varchar(50), + current_deduction varchar(50), + deduction_month date +); +/ + + +create table hrsa_derate_deduction +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + derate_item varchar(255), + derate_property varchar(255), + derate_amount varchar(255) +); +/ + + +create table hrsa_free_income +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + free_item varchar(255), + free_property varchar(255), + free_amount varchar(255) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412160403.sql b/resource/sqlupgrade/PG/sql202412160403.sql new file mode 100644 index 000000000..89d123c70 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int; +/ +alter table hrsa_endowment_insurance add employee_type int; +/ +alter table hrsa_free_income add employee_type int; +/ +alter table hrsa_grant_donation add employee_type int; +/ +alter table hrsa_health_insurance add employee_type int; +/ +alter table hrsa_other_derate_deduction add employee_type int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412230103.sql b/resource/sqlupgrade/PG/sql202412230103.sql new file mode 100644 index 000000000..9e48e428d --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + main_id bigint, + tax_year_month date, + employee_id bigint, + tax_agent_id bigint, + file_status int, + voucher_type varchar(255), + voucher_no varchar(255), + pay_amount varchar(255), + data_source int, + collect_source varchar(50), + pay_month date, + eb_data_id bigint, + voucher_type_name varchar(50), + employee_type int +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412240103.sql b/resource/sqlupgrade/PG/sql202412240103.sql new file mode 100644 index 000000000..4820d7cee --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction ADD COLUMN free_income varchar(255) NULL; + +ALTER TABLE hrsa_other_deduction ADD COLUMN derate_deduction varchar(255) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202503190103.sql b/resource/sqlupgrade/PG/sql202503190103.sql new file mode 100644 index 000000000..7f39dcf84 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int, + tenant_key varchar(10), + tax_agent_id bigint, + year varchar(100), + employee_id bigint, + employee_type smallint, + employee_name varchar(100), + job_num varchar(100), + card_type smallint, + card_num varchar(100), + nationality varchar(200), + deduct_flag smallint, + successfully_declared smallint, + declare_status smallint, + declare_error_msg varchar(3000) +); +/ + +create table hrsa_deduction_amount_record +( + id bigint primary key , + create_time timestamp, + update_time timestamp, + creator bigint, + delete_type int default 0, + tenant_key varchar(10), + tax_agent_id bigint, + year varchar(100), + request_id varchar(100) +); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202506190103.sql b/resource/sqlupgrade/PG/sql202506190103.sql new file mode 100644 index 000000000..2ee229b09 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202506190103.sql @@ -0,0 +1,10 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507010303.sql b/resource/sqlupgrade/PG/sql202507010303.sql new file mode 100644 index 000000000..f54b534b9 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507010403.sql b/resource/sqlupgrade/PG/sql202507010403.sql new file mode 100644 index 000000000..f5ebbdb76 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507010403.sql @@ -0,0 +1,20 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202507110103.sql b/resource/sqlupgrade/PG/sql202507110103.sql new file mode 100644 index 000000000..b59e15941 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202507110103.sql @@ -0,0 +1 @@ +ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int ; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180103.sql b/resource/sqlupgrade/SQLServer/sql202307180103.sql new file mode 100644 index 000000000..d69852a1e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180103.sql @@ -0,0 +1,33 @@ +create table hrsa_tax_declare_api_profile +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + api_profile int +) +GO + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key) +GO + +create table hrsa_tax_payment_request +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_declare_record_id bigint, + tax_year_month datetime not null, + request_id nvarchar(50) not null, + request_type int not null +) +GO + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180203.sql b/resource/sqlupgrade/SQLServer/sql202307180203.sql new file mode 100644 index 000000000..06b82d4db --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180203.sql @@ -0,0 +1,37 @@ +create table hrsa_tax_declare_api_config +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + host nvarchar(255), + app_key nvarchar(255), + app_secret nvarchar(255) +) +GO + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key) +GO + +alter table hrsa_tax_declare_api_config alter column host nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_key nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config alter column app_secret nvarchar(255) not null +GO + +alter table hrsa_tax_declare_api_config add enable_use int +GO + +alter table hrsa_tax_declare_api_config add totality bigint +GO + +alter table hrsa_tax_declare_api_config add remain bigint +GO + +alter table hrsa_tax_declare_api_config add last_update_time datetime +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180403.sql b/resource/sqlupgrade/SQLServer/sql202307180403.sql new file mode 100644 index 000000000..5a9e63cb3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180403.sql @@ -0,0 +1,30 @@ +create table hrsa_tax_agent_tax_return +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_code nvarchar(50) not null, + tax_registration_number nvarchar(50), + department_code nvarchar(50), + department_name nvarchar(50), + nation nvarchar(50), + province nvarchar(50), + city nvarchar(50), + area_code nvarchar(50) not null, + password_type int not null, + real_account nvarchar(50) , + pwd nvarchar(50) not null, + check_status int not null, + fail_reason nvarchar(255) +) +GO + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key) +GO + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308080603.sql b/resource/sqlupgrade/SQLServer/sql202308080603.sql new file mode 100644 index 000000000..2947c492a --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308080603.sql @@ -0,0 +1,50 @@ +create table hrsa_employee_declare_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + tax_cycle datetime, + request_id nvarchar(100) +) +GO + +create table hrsa_employee_declare +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + tax_cycle datetime, + employee_id bigint, + employee_type tinyint, + employee_name nvarchar(100), + job_num nvarchar(100), + card_type tinyint, + card_num nvarchar(100), + gender nvarchar(100), + birthday datetime, + employment_status tinyint, + mobile nvarchar(100), + employment_type tinyint, + employment_first_year nvarchar(100), + employment_date datetime, + dismiss_date datetime, + disability tinyint, + disability_card_no nvarchar(100), + lonely_old tinyint, + martyr_dependents tinyint, + martyr_dependents_card_no nvarchar(100), + deduct_expenses tinyint, + successfully_declared tinyint, + new_employee_info tinyint, + declare_status tinyint, + declare_error_msg nvarchar(1000) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308090303.sql b/resource/sqlupgrade/SQLServer/sql202308090303.sql new file mode 100644 index 000000000..6757c6ad9 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308090303.sql @@ -0,0 +1,32 @@ +create table hrsa_tax_declare_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint, + salary_month datetime, + tax_cycle datetime, + remark nvarchar(1000), + request_id nvarchar(100), + tax_declare_type tinyint, + tax_declare_status tinyint +) +GO + + +alter table hrsa_tax_declare_record add display_update_icon tinyint +GO +alter table hrsa_tax_declare_record add tax_pay_amount nvarchar(255) +GO + +alter table hrsa_tax_declare_record add person_num int +GO +alter table hrsa_tax_declare_record add tax_declare_error_msg nvarchar(1000) +GO +alter table hrsa_tax_declare_record add tax_paid_amount nvarchar(255) +GO +alter table hrsa_tax_declare_record add tax_pure_paid_amount nvarchar(255) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308100803.sql b/resource/sqlupgrade/SQLServer/sql202308100803.sql new file mode 100644 index 000000000..2c58c6a3e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308100803.sql @@ -0,0 +1,14 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + employee_name nvarchar(100), + card_num nvarchar(100), + error_msg nvarchar(1000) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110103.sql b/resource/sqlupgrade/SQLServer/sql202308110103.sql new file mode 100644 index 000000000..d9d79670c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110103.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_report_column +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_report_type nvarchar(100), + income_category nvarchar(100), + report_column_name nvarchar(100), + report_column_data_index nvarchar(100) +) +GO + +create table hrsa_sob_tax_report_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category nvarchar(100), + report_column_data_index nvarchar(100), + salary_item_id bigint +) +GO + +alter table hrsa_tax_report_column add data_type nvarchar(100) +GO + +alter table hrsa_tax_report_column add request_param_key nvarchar(100) +GO + +alter table hrsa_tax_report_column add report_column_label nvarchar(100) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110203.sql b/resource/sqlupgrade/SQLServer/sql202308110203.sql new file mode 100644 index 000000000..d11b4913b --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110203.sql @@ -0,0 +1,17 @@ +create table hrsa_tax_declare_fail +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + employee_name nvarchar(100), + card_num nvarchar(100), + error_msg nvarchar(1000) +) +GO + +alter table hrsa_tax_declare_fail add income_category nvarchar(100) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308110303.sql b/resource/sqlupgrade/SQLServer/sql202308110303.sql new file mode 100644 index 000000000..54a64f52e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308110303.sql @@ -0,0 +1,14 @@ +alter table hrsa_tax_declaration add control_view int +GO +alter table hrsa_tax_declaration add tax_declare_record_id bigint +GO +alter table hrsa_salary_acct_emp add income_category nvarchar(100) +GO +alter table hrsa_salary_acct_record add control_view int +GO + + +update hrsa_salary_acct_record set control_view = 0 where control_view is null +GO +update hrsa_tax_declaration set control_view = 0 where control_view is null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308140203.sql b/resource/sqlupgrade/SQLServer/sql202308140203.sql new file mode 100644 index 000000000..a4b55a654 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308140203.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declaration_value +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_declare_record_id bigint, + tax_declaration_id bigint, + employee_type tinyint, + employee_id bigint, + result_value_json ntext +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150303.sql b/resource/sqlupgrade/SQLServer/sql202308150303.sql new file mode 100644 index 000000000..a57b1b4ac --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150303.sql @@ -0,0 +1,23 @@ +alter table hrsa_salary_sob_item add income_category nvarchar(100) +GO + +alter table hrsa_salary_sob_item add constraint hssi_income_category_default default '1' for income_category +GO + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1') +GO + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2') +GO + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4') +GO + +alter table hrsa_salary_sob_item add salary_item_code nvarchar(100) +GO + +update a set a.salary_item_code = b.code from hrsa_salary_sob_item a, hrsa_salary_item b where a.salary_item_id = b.id +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150503.sql b/resource/sqlupgrade/SQLServer/sql202308150503.sql new file mode 100644 index 000000000..49e43f18a --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150503.sql @@ -0,0 +1,619 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd') +GO +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz') +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150603.sql b/resource/sqlupgrade/SQLServer/sql202308150603.sql new file mode 100644 index 000000000..f6c058c12 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150603.sql @@ -0,0 +1,58 @@ +create table hrsa_sob_add_up_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category nvarchar(100), + salary_item_id bigint, + add_up_column_data_index nvarchar(100) +) +GO + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings') +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax' +GO + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax') +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable' +GO +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction') +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308170103.sql b/resource/sqlupgrade/SQLServer/sql202308170103.sql new file mode 100644 index 000000000..c29a44b44 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308170103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add feedback int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308230303.sql b/resource/sqlupgrade/SQLServer/sql202308230303.sql new file mode 100644 index 000000000..6cb8ed60b --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308230303.sql @@ -0,0 +1,5 @@ +alter table hrsa_tax_agent_tax_return add city_name nvarchar(400) +GO + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308240201.sql b/resource/sqlupgrade/SQLServer/sql202308240201.sql new file mode 100644 index 000000000..e1d0137c2 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308240201.sql @@ -0,0 +1,34 @@ +delete from HtmlLabelIndex where id = 544827 and ( indexdesc is null or indexdesc = '' ) +GO +insert into HtmlLabelIndex(id,indexdesc) select top 1 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( indexdesc is not null and indexdesc <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( labelname is not null and labelname <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is null or labelname = '' or labelname like '%[吖-座]%' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( labelname is not null and labelname <> '' and labelname not like '%[吖-座]%' )) +GO +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( labelname is not null and labelname <> '' )) +GO + + +delete from HtmlLabelIndex where id = 544826 and ( indexdesc is null or indexdesc = '' ) +GO +insert into HtmlLabelIndex(id,indexdesc) select top 1 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( indexdesc is not null and indexdesc <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( labelname is not null and labelname <> '' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is null or labelname = '' or labelname like '%[吖-座]%' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( labelname is not null and labelname <> '' and labelname not like '%[吖-座]%' )) +GO +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( labelname is not null and labelname <> '' )) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308240302.sql b/resource/sqlupgrade/SQLServer/sql202308240302.sql new file mode 100644 index 000000000..00621bbb7 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308240302.sql @@ -0,0 +1,21 @@ +Delete from LeftMenuInfo where id=100191 +GO +Delete from LeftMenuConfig where infoid=100191 +GO +EXECUTE LMConfig_U_ByInfoInsert 2,100181,1 +GO +EXECUTE LMInfo_Insert 100191,544827,'','',2,100181,1,18 +GO +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191 +GO + +Delete from LeftMenuInfo where id=100192 +GO +Delete from LeftMenuConfig where infoid=100192 +GO +EXECUTE LMConfig_U_ByInfoInsert 2,100118,7 +GO +EXECUTE LMInfo_Insert 100192,544826,'','',2,100118,7,18 +GO +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308280203.sql b/resource/sqlupgrade/SQLServer/sql202308280203.sql new file mode 100644 index 000000000..d5a06b580 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308280203.sql @@ -0,0 +1,46 @@ +create table hrsa_tax_api_flow_receiver +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + warn_config_id bigint not null, + employee_id bigint not null, + email nvarchar(100), + mobile nvarchar(50) +) +GO + +create table hrsa_tax_api_flow_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + tax_agent_id bigint not null, + tax_month datetime not null, + use_time datetime not null, + deduct int, + employee_id bigint not null, + business_type int not null, + result_status int not null +) +GO + +create table hrsa_tax_api_flow_warn_config +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id bigint default '0' not null +) +GO \ 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/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/SQLServer/sql202312190103.sql b/resource/sqlupgrade/SQLServer/sql202312190103.sql new file mode 100644 index 000000000..d2c020a34 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1) +GO + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1) +GO + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出' +GO + +update hrsa_tax_report_column set contrast_type = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270603.sql b/resource/sqlupgrade/SQLServer/sql202312270603.sql new file mode 100644 index 000000000..6955742ff --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value ADD source int NULL +GO + +ALTER TABLE hrsa_tax_declare_record ADD declare_request_id varchar(100) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270703.sql b/resource/sqlupgrade/SQLServer/sql202312270703.sql new file mode 100644 index 000000000..0384f9313 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202403193303.sql b/resource/sqlupgrade/SQLServer/sql202403193303.sql new file mode 100644 index 000000000..771e3b45f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202403193303.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_employee_declare ADD nationality varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD birthplace varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD tax_reasons varchar(255) NULL +GO + +ALTER TABLE hrsa_employee_declare ADD entry_date datetime NULL +GO + +ALTER TABLE hrsa_employee_declare ADD departure_date datetime NULL +GO + +update hrsa_employee_declare set nationality = '中国' where nationality is null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202404120303.sql b/resource/sqlupgrade/SQLServer/sql202404120303.sql new file mode 100644 index 000000000..2a9169a28 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202404120303.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_status +( +id bigint primary key , +tax_declare_record_id bigint NULL , +report_type int NULL , +request_id varchar(100) , +tax_declare_type tinyint NULL , +tax_declare_status tinyint NULL , +display_update_icon tinyint NULL , +tax_declare_error_msg varchar(1000) , +person_num int NULL , +tax_pay_amount varchar(255) , +tax_paid_amount varchar(255) , +tax_pure_paid_amount varchar(255) , +declare_request_id varchar(100) , +delete_type int NULL +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202406170103.sql b/resource/sqlupgrade/SQLServer/sql202406170103.sql new file mode 100644 index 000000000..c84a374f4 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202406170103.sql @@ -0,0 +1,14 @@ +create table hrsa_sob_tax_rule +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + salary_sob_id bigint, + income_category varchar(100), + tax_index varchar(100), + salary_item_id bigint +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202406260403.sql b/resource/sqlupgrade/SQLServer/sql202406260403.sql new file mode 100644 index 000000000..dd1b5701c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202406260403.sql @@ -0,0 +1,13 @@ +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param ntext , + response ntext, + create_time datetime, + update_time datetime, + delete_type int default 0, + tenant_key nvarchar(10) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202407170103.sql b/resource/sqlupgrade/SQLServer/sql202407170103.sql new file mode 100644 index 000000000..a8734ab0c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202407170103.sql @@ -0,0 +1,13 @@ +create table hrsa_acct_calc_tax_req +( + id bigint primary key , + create_time datetime default getdate(), + update_time datetime default getdate(), + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + salary_acct_record_id bigint, + tax_agent_id bigint, + request_id nvarchar(100) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412160303.sql b/resource/sqlupgrade/SQLServer/sql202412160303.sql new file mode 100644 index 000000000..de7f1091f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412160303.sql @@ -0,0 +1,126 @@ +create table hrsa_other_derate_deduction +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + other_deduction nvarchar(50), + remark nvarchar(255) +) +GO + + +create table hrsa_health_insurance +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + identification_number nvarchar(255), + effective_date datetime, + year_premium nvarchar(50), + month_premium nvarchar(50), + current_deduction nvarchar(50) +) +GO + + +create table hrsa_grant_donation +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + recipient_name nvarchar(255), + tax_code nvarchar(255), + donation_number nvarchar(255), + donate_date datetime, + donate_amount nvarchar(50), + deduction_proportion nvarchar(10), + actual_deduction nvarchar(50) +) +GO + + +create table hrsa_endowment_insurance +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + account_number nvarchar(255), + check_code nvarchar(255), + year_premium nvarchar(50), + month_premium nvarchar(50), + current_deduction nvarchar(50), + deduction_month datetime +) +GO + + +create table hrsa_derate_deduction +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + derate_item nvarchar(255), + derate_property nvarchar(255), + derate_amount nvarchar(255) +) +GO + + +create table hrsa_free_income +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + free_item nvarchar(255), + free_property nvarchar(255), + free_amount nvarchar(255) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412160403.sql b/resource/sqlupgrade/SQLServer/sql202412160403.sql new file mode 100644 index 000000000..1ebced6cb --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412160403.sql @@ -0,0 +1,12 @@ +alter table hrsa_derate_deduction add employee_type int +GO +alter table hrsa_endowment_insurance add employee_type int +GO +alter table hrsa_free_income add employee_type int +GO +alter table hrsa_grant_donation add employee_type int +GO +alter table hrsa_health_insurance add employee_type int +GO +alter table hrsa_other_derate_deduction add employee_type int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412230103.sql b/resource/sqlupgrade/SQLServer/sql202412230103.sql new file mode 100644 index 000000000..6fd85b259 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412230103.sql @@ -0,0 +1,24 @@ +create table hrsa_personal_pension +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int default 0, + tenant_key nvarchar(10), + main_id bigint, + tax_year_month datetime, + employee_id bigint, + tax_agent_id bigint, + file_status int, + voucher_type nvarchar(255), + voucher_no nvarchar(255), + pay_amount nvarchar(255), + data_source int, + collect_source nvarchar(50), + pay_month datetime, + eb_data_id bigint, + voucher_type_name nvarchar(50), + employee_type int +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412240103.sql b/resource/sqlupgrade/SQLServer/sql202412240103.sql new file mode 100644 index 000000000..cfb59073c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412240103.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_other_deduction ADD free_income varchar(255) NULL +GO + +ALTER TABLE hrsa_other_deduction ADD derate_deduction varchar(255) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202503190103.sql b/resource/sqlupgrade/SQLServer/sql202503190103.sql new file mode 100644 index 000000000..3aaee1960 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202503190103.sql @@ -0,0 +1,37 @@ +create table hrsa_deduction_amount +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + tax_agent_id bigint, + year nvarchar(100), + employee_id bigint, + employee_type tinyint, + employee_name nvarchar(100), + job_num nvarchar(100), + card_type tinyint, + card_num nvarchar(100), + nationality nvarchar(255), + deduct_flag tinyint, + successfully_declared tinyint, + declare_status tinyint, + declare_error_msg nvarchar(3000) +) +GO + +create table hrsa_deduction_amount_record +( + id bigint primary key , + create_time datetime, + update_time datetime, + creator bigint, + delete_type int, + tenant_key nvarchar(10), + tax_agent_id bigint, + year nvarchar(100), + request_id nvarchar(100) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202506190103.sql b/resource/sqlupgrade/SQLServer/sql202506190103.sql new file mode 100644 index 000000000..adfe5e358 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202506190103.sql @@ -0,0 +1,18 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0) +go + + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0) +go +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0) +go \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507010303.sql b/resource/sqlupgrade/SQLServer/sql202507010303.sql new file mode 100644 index 000000000..9ca6c463d --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507010303.sql @@ -0,0 +1,20 @@ +ALTER TABLE hrsa_free_income ADD income_category int +GO + +ALTER TABLE hrsa_derate_deduction ADD income_category int +GO + +ALTER TABLE hrsa_endowment_insurance ADD income_category int +GO + +ALTER TABLE hrsa_grant_donation ADD income_category int +GO + +ALTER TABLE hrsa_health_insurance ADD income_category int +GO + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int +GO + +ALTER TABLE hrsa_personal_pension ADD income_category int +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507010403.sql b/resource/sqlupgrade/SQLServer/sql202507010403.sql new file mode 100644 index 000000000..99fc8e409 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507010403.sql @@ -0,0 +1,14 @@ +update hrsa_free_income set income_category = 1 +GO +update hrsa_derate_deduction set income_category = 1 +GO +update hrsa_endowment_insurance set income_category = 1 +GO +update hrsa_grant_donation set income_category = 1 +GO +update hrsa_health_insurance set income_category = 1 +GO +update hrsa_other_derate_deduction set income_category = 1 +GO +update hrsa_personal_pension set income_category = 1 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202507110103.sql b/resource/sqlupgrade/SQLServer/sql202507110103.sql new file mode 100644 index 000000000..19d102aa7 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202507110103.sql @@ -0,0 +1,2 @@ +alter table hrsa_tax_payment_request add report_type int null +go \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202307180103.sql b/resource/sqlupgrade/ST/sql202307180103.sql new file mode 100644 index 000000000..b701b86e6 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180103.sql @@ -0,0 +1,34 @@ +create table hrsa_tax_declare_api_profile +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + api_profile int +); +/ + +create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key); +/ + +create table hrsa_tax_payment_request +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_declare_record_id number, + tax_year_month date not null, + request_id varchar2(50) not null, + request_type int not null +); +/ + +create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key); +/ + diff --git a/resource/sqlupgrade/ST/sql202307180203.sql b/resource/sqlupgrade/ST/sql202307180203.sql new file mode 100644 index 000000000..10aced290 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180203.sql @@ -0,0 +1,38 @@ +create table hrsa_tax_declare_api_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + host varchar2(255), + app_key varchar2(255), + app_secret varchar2(255) +); +/ + +create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key); +/ + +alter table hrsa_tax_declare_api_config modify host not null; +/ + +alter table hrsa_tax_declare_api_config modify app_key not null; +/ + +alter table hrsa_tax_declare_api_config modify app_secret not null; +/ + +alter table hrsa_tax_declare_api_config add enable_use int; +/ + +alter table hrsa_tax_declare_api_config add totality number; +/ + +alter table hrsa_tax_declare_api_config add remain number; +/ + +alter table hrsa_tax_declare_api_config add last_update_time date; +/ + diff --git a/resource/sqlupgrade/ST/sql202307180403.sql b/resource/sqlupgrade/ST/sql202307180403.sql new file mode 100644 index 000000000..fb5e8e455 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307180403.sql @@ -0,0 +1,31 @@ +create table hrsa_tax_agent_tax_return +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_code varchar2(50) not null, + tax_registration_number varchar2(50) , + department_code varchar2(50), + department_name varchar2(50), + nation varchar2(50), + province varchar2(50), + city varchar2(50), + area_code varchar2(50) not null, + password_type int not null, + real_account varchar2(50) , + pwd varchar2(50) not null, + check_status int not null, + fail_reason varchar2(255) +); +/ + +create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key); +/ + +create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id); +/ + diff --git a/resource/sqlupgrade/ST/sql202308080603.sql b/resource/sqlupgrade/ST/sql202308080603.sql new file mode 100644 index 000000000..3fa4e6655 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308080603.sql @@ -0,0 +1,51 @@ +create table hrsa_employee_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + request_id varchar2(100) +); +/ + +create table hrsa_employee_declare +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + tax_cycle date, + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + gender varchar2(100), + birthday date, + employment_status number, + mobile varchar2(100), + employment_type number, + employment_first_year varchar2(100), + employment_date date, + dismiss_date date, + disability number, + disability_card_no varchar2(100), + lonely_old number, + martyr_dependents number, + martyr_dependents_card_no varchar2(100), + deduct_expenses number, + successfully_declared number, + new_employee_info number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202308090303.sql b/resource/sqlupgrade/ST/sql202308090303.sql new file mode 100644 index 000000000..0a9e21cc4 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308090303.sql @@ -0,0 +1,36 @@ +create table hrsa_tax_declare_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number, + salary_month date, + tax_cycle date, + remark varchar2(1000), + request_id varchar2(100), + tax_declare_type number, + tax_declare_status number +); +/ + +alter table hrsa_tax_declare_record add display_update_icon number; +/ + +alter table hrsa_tax_declare_record add tax_pay_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add person_num int; +/ + +alter table hrsa_tax_declare_record add tax_declare_error_msg varchar2(1000); +/ + +alter table hrsa_tax_declare_record add tax_paid_amount varchar2(255); +/ + +alter table hrsa_tax_declare_record add tax_pure_paid_amount varchar2(255); +/ + diff --git a/resource/sqlupgrade/ST/sql202308100803.sql b/resource/sqlupgrade/ST/sql202308100803.sql new file mode 100644 index 000000000..fd9ce7f25 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308100803.sql @@ -0,0 +1,15 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110103.sql b/resource/sqlupgrade/ST/sql202308110103.sql new file mode 100644 index 000000000..dea9e8743 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110103.sql @@ -0,0 +1,39 @@ +create table hrsa_tax_report_column +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_report_type varchar2(100), + income_category varchar2(100), + report_column_name varchar2(100), + report_column_data_index varchar2(100) +); +/ + +create table hrsa_sob_tax_report_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + report_column_data_index varchar2(100), + salary_item_id number +); +/ + +alter table hrsa_tax_report_column add data_type varchar2(100); +/ + +alter table hrsa_tax_report_column add request_param_key varchar2(100); +/ + +alter table hrsa_tax_report_column add report_column_label varchar2(100); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110203.sql b/resource/sqlupgrade/ST/sql202308110203.sql new file mode 100644 index 000000000..d8ddbd9db --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110203.sql @@ -0,0 +1,18 @@ +create table hrsa_tax_declare_fail +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + employee_name varchar2(100), + card_num varchar2(100), + error_msg varchar2(1000) +); +/ + +alter table hrsa_tax_declare_fail add income_category varchar2(100); +/ + diff --git a/resource/sqlupgrade/ST/sql202308110303.sql b/resource/sqlupgrade/ST/sql202308110303.sql new file mode 100644 index 000000000..2a4ef5ef9 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308110303.sql @@ -0,0 +1,18 @@ +alter table hrsa_tax_declaration add tax_declare_record_id number; +/ + +alter table hrsa_tax_declaration add control_view int; +/ + +alter table hrsa_salary_acct_emp add income_category varchar2(100); +/ + +alter table hrsa_salary_acct_record add control_view int; +/ + +update hrsa_salary_acct_record set control_view = 0 where control_view is null; +/ + +update hrsa_tax_declaration set control_view = 0 where control_view is null; +/ + diff --git a/resource/sqlupgrade/ST/sql202308140203.sql b/resource/sqlupgrade/ST/sql202308140203.sql new file mode 100644 index 000000000..fbeca581b --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308140203.sql @@ -0,0 +1,16 @@ +create table hrsa_tax_declaration_value +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_declare_record_id number, + tax_declaration_id number, + employee_type number, + employee_id number, + result_value_json clob +); +/ + diff --git a/resource/sqlupgrade/ST/sql202308150303.sql b/resource/sqlupgrade/ST/sql202308150303.sql new file mode 100644 index 000000000..c8b267f97 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150303.sql @@ -0,0 +1,29 @@ +alter table hrsa_salary_sob_item add income_category varchar2(100); +/ + +alter table hrsa_salary_sob_item modify income_category default '1'; +/ + +update hrsa_salary_sob_item set income_category = '1' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '1'); +/ + +update hrsa_salary_sob_item set income_category = '2' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '2'); +/ + +update hrsa_salary_sob_item set income_category = '4' where salary_sob_id IN +(select id from hrsa_salary_sob where hrsa_salary_sob.income_category = '4'); +/ + +alter table hrsa_salary_sob_item add salary_item_code varchar2(100); +/ + +update hrsa_salary_sob_item a +set ( salary_item_code) = ( + select code as salary_item_code + from hrsa_salary_item b + where a.salary_item_id = b.id +); +/ + diff --git a/resource/sqlupgrade/ST/sql202308150503.sql b/resource/sqlupgrade/ST/sql202308150503.sql new file mode 100644 index 000000000..e268c0264 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150503.sql @@ -0,0 +1,729 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '当期收入额', 'annualIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '免税收入', 'annualTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '其他', 'annualOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '准予扣除的捐赠额', 'annualDonateTax', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '减免税额', 'annualTaxSavings', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', '备注', 'annualRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157068, null, null, null, 0, 'all_teams', '1', '4', '当期收入额', 'laborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157069, null, null, null, 0, 'all_teams', '1', '4', '免税收入', 'laborTaxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157070, null, null, null, 0, 'all_teams', '1', '4', '商业健康保险', 'commercialHealthInsurance4', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157071, null, null, null, 0, 'all_teams', '1', '4', '税延养老保险', 'taxDeferredEndowmentInsurance4', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157072, null, null, null, 0, 'all_teams', '1', '4', '允许扣除税费', 'allowedDeductTax4', 'number', + 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157073, null, null, null, 0, 'all_teams', '1', '4', '其他', 'other4', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157074, null, null, null, 0, 'all_teams', '1', '4', '减免税额', 'labor_tax_saving', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157075, null, null, null, 0, 'all_teams', '1', '4', '备注', 'description4', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157077, null, null, null, 0, 'all_teams', '1', '1', '本期收入', 'income', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157078, null, null, null, 0, 'all_teams', '1', '1', '本期免税收入', 'taxFreeIncome', 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157079, null, null, null, 0, 'all_teams', '1', '1', '基本养老保险费', 'endowmentInsurance', 'number', + 'jbylaobxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157080, null, null, null, 0, 'all_teams', '1', '1', '基本医疗保险费', 'medicalInsurance', 'number', + 'jbylbxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157081, null, null, null, 0, 'all_teams', '1', '1', '失业保险费', 'unemploymentInsurance', 'number', + 'sybxf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157082, null, null, null, 0, 'all_teams', '1', '1', '住房公积金', 'housingProvidentFund', 'number', + 'zfgjj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157083, null, null, null, 0, 'all_teams', '1', '1', '累计子女教育', 'addUpChildEducation', 'number', + 'ljznjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157084, null, null, null, 0, 'all_teams', '1', '1', '累计住房贷款利息', 'addUpHousingLoanInterest', + 'number', 'ljzfdklxzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157085, null, null, null, 0, 'all_teams', '1', '1', '累计住房租金', 'addUpHousingRent', 'number', + 'ljzfzjzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157086, null, null, null, 0, 'all_teams', '1', '1', '累计赡养老人', 'addUpSupportElderly', 'number', + 'ljsylrzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157087, null, null, null, 0, 'all_teams', '1', '1', '累计继续教育', 'addUpContinuingEducation', 'number', + 'ljjxjyzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157088, null, null, null, 0, 'all_teams', '1', '1', '累计3岁以下婴幼儿照护支出', 'addUpInfantCare', 'number', + 'ljyyezhzc'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157089, null, null, null, 0, 'all_teams', '1', '1', '企业(职业)年金', 'annuity', 'number', 'nj'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157090, null, null, null, 0, 'all_teams', '1', '1', '商业健康保险', 'commercialHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157091, null, null, null, 0, 'all_teams', '1', '1', '税延养老保险', 'taxDeferredEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157092, null, null, null, 0, 'all_teams', '1', '1', '其他', 'other', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157093, null, null, null, 0, 'all_teams', '1', '1', '准予扣除的捐赠额', 'allowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157094, null, null, null, 0, 'all_teams', '1', '1', '减免税额', 'taxDeduction', 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157095, null, null, null, 0, 'all_teams', '1', '1', '备注', 'description', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157096, null, null, null, 0, 'all_teams', '1', '107', '一次性补偿收入', 'retireCompensationIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157097, null, null, null, 0, 'all_teams', '1', '107', '本期工资收入', 'retireWageIncome', 'number', + 'bqgzs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157098, null, null, null, 0, 'all_teams', '1', '107', '免税收入', 'retireTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157099, null, null, null, 0, 'all_teams', '1', '107', '其他', 'retireOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157100, null, null, null, 0, 'all_teams', '1', '107', '准予扣除的捐赠额', 'retireAllowedDonation', 'number', + 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157101, null, null, null, 0, 'all_teams', '1', '107', '减免税额', 'retireTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157102, null, null, null, 0, 'all_teams', '1', '107', '备注', 'retireRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157103, null, null, null, 0, 'all_teams', '1', '107', '分摊月份数', 'retireSplitMonth', 'number', + 'ftyfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157104, null, null, null, 0, 'all_teams', '1', '108', '当期收入额', 'dismissIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157105, null, null, null, 0, 'all_teams', '1', '108', '免税收入', 'dismissTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157106, null, null, null, 0, 'all_teams', '1', '108', '其他', 'dismissOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157107, null, null, null, 0, 'all_teams', '1', '108', '备注', 'dismissRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157108, null, null, null, 0, 'all_teams', '1', '108', '准予扣除的捐赠额', 'dismissAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157109, null, null, null, 0, 'all_teams', '1', '108', '减免税额', 'dismissTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157110, null, null, null, 0, 'all_teams', '1', '110', '当期收入额', 'annuityIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157111, null, null, null, 0, 'all_teams', '1', '110', '已完税缴费额', 'annuityTaxPaidAmount', 'number', + 'ywsjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157112, null, null, null, 0, 'all_teams', '1', '110', '全部缴费额', 'annuityTotalPayment', 'number', + 'qbjfe'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157113, null, null, null, 0, 'all_teams', '1', '110', '是否一次性领取', 'annuityOneTimeReceive', 'string', + 'sfycxlq'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157114, null, null, null, 0, 'all_teams', '1', '110', '年金领取方式', 'annuityReceiveMethod', 'string', + 'njlqfs'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157115, null, null, null, 0, 'all_teams', '1', '110', '年金领取原因', 'annuityReceiveReason', 'string', + 'njlqyy'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157116, null, null, null, 0, 'all_teams', '1', '110', '免税收入', 'annuityTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157117, null, null, null, 0, 'all_teams', '1', '110', '减免税额', 'annuityTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157118, null, null, null, 0, 'all_teams', '1', '110', '商业健康保险', 'annuityHealthInsurance', 'number', + 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157119, null, null, null, 0, 'all_teams', '1', '110', '税延养老保险', 'annuityEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157120, null, null, null, 0, 'all_teams', '1', '110', '其他', 'annuityOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157121, null, null, null, 0, 'all_teams', '1', '110', '准予扣除的捐赠额', 'annuityAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157122, null, null, null, 0, 'all_teams', '1', '110', '备注', 'annuityRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157123, null, null, null, 0, 'all_teams', '1', '402', '当期收入额', 'insuranceIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157124, null, null, null, 0, 'all_teams', '1', '402', '免税收入', 'insuranceTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157125, null, null, null, 0, 'all_teams', '1', '402', '商业健康保险', 'insuranceHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157126, null, null, null, 0, 'all_teams', '1', '402', '税延养老保险', 'insuranceEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157127, null, null, null, 0, 'all_teams', '1', '402', '其他', 'insuranceOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157128, null, null, null, 0, 'all_teams', '1', '402', '备注', 'insuranceRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157129, null, null, null, 0, 'all_teams', '1', '402', '减免税额', 'insuranceTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157130, null, null, null, 0, 'all_teams', '1', '402', '允许扣除税费', 'insuranceAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157131, null, null, null, 0, 'all_teams', '1', '403', '当期收入额', 'securitiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157132, null, null, null, 0, 'all_teams', '1', '403', '免税收入', 'securitiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157133, null, null, null, 0, 'all_teams', '1', '403', '商业健康保险', 'securitiesHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157134, null, null, null, 0, 'all_teams', '1', '403', '税延养老保险', 'securitiesEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157135, null, null, null, 0, 'all_teams', '1', '403', '其他', 'securitiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157136, null, null, null, 0, 'all_teams', '1', '403', '备注', 'securitiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157137, null, null, null, 0, 'all_teams', '1', '403', '减免税额', 'securitiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157138, null, null, null, 0, 'all_teams', '1', '403', '允许扣除税费', 'securitiesAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157139, null, null, null, 0, 'all_teams', '1', '489', '当期收入额', 'otherContinuousLaborIncome', + 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157140, null, null, null, 0, 'all_teams', '1', '489', '免税收入', 'otherContinuousLaborTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157141, null, null, null, 0, 'all_teams', '1', '489', '商业健康保险', + 'otherContinuousLaborHealthInsurance', 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157142, null, null, null, 0, 'all_teams', '1', '489', '税延养老保险', + 'otherContinuousLaborEndowmentInsurance', 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157143, null, null, null, 0, 'all_teams', '1', '489', '其他', 'otherContinuousLaborOther', 'number', + 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157144, null, null, null, 0, 'all_teams', '1', '489', '备注', 'otherContinuousLaborRemark', 'string', + 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157145, null, null, null, 0, 'all_teams', '1', '489', '减免税额', 'otherContinuousLaborTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157146, null, null, null, 0, 'all_teams', '1', '489', '允许扣除税费', + 'otherContinuousLaborAllowedDeductTax', 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157147, null, null, null, 0, 'all_teams', '1', '499', '当期收入额', 'otherLaborIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157149, null, null, null, 0, 'all_teams', '1', '499', '免税收入', 'otherLaborTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157150, null, null, null, 0, 'all_teams', '1', '499', '商业健康保险', 'otherLaborHealthInsurance', + 'number', 'syjkbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157151, null, null, null, 0, 'all_teams', '1', '499', '税延养老保险', 'otherLaborEndowmentInsurance', + 'number', 'syylbx'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157152, null, null, null, 0, 'all_teams', '1', '499', '允许扣除税费', 'otherLaborAllowedDeductTax', + 'number', 'yxkcsf'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157153, null, null, null, 0, 'all_teams', '1', '499', '其他', 'otherLaborOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157154, null, null, null, 0, 'all_teams', '1', '499', '备注', 'otherLaborRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157155, null, null, null, 0, 'all_teams', '1', '499', '减免税额', 'otherLaborTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157156, null, null, null, 0, 'all_teams', '1', '500', '当期收入额', 'authorIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157157, null, null, null, 0, 'all_teams', '1', '500', '免税收入', 'authorTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157158, null, null, null, 0, 'all_teams', '1', '500', '其他', 'authorOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157159, null, null, null, 0, 'all_teams', '1', '500', '减免税额', 'authorTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157160, null, null, null, 0, 'all_teams', '1', '500', '备注', 'authorRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157161, null, null, null, 0, 'all_teams', '1', '600', '当期收入额', 'royaltiesIncome', 'number', 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157162, null, null, null, 0, 'all_teams', '1', '600', '免税收入', 'royaltiesTaxFreeIncome', 'number', + 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157163, null, null, null, 0, 'all_teams', '1', '600', '其他', 'royaltiesOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157164, null, null, null, 0, 'all_teams', '1', '600', '备注', 'royaltiesRemark', 'string', 'bz'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157165, null, null, null, 0, 'all_teams', '1', '600', '减免税额', 'royaltiesTaxDeduction', 'number', + 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157166, null, null, null, 0, 'all_teams', '1', '109', '本月股权激励收入', 'stockRightIncome', 'number', + 'sre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157167, null, null, null, 0, 'all_teams', '1', '109', '本年累计股权激励收入(不含本月)', 'stockRightAddUpIncome', + 'number', 'ljsre'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157168, null, null, null, 0, 'all_teams', '1', '109', '本年累计其他', 'stockRightOther', 'number', 'qt'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157169, null, null, null, 0, 'all_teams', '1', '109', '本年累计准予扣除的捐赠额', 'stockRightAllowedDonation', + 'number', 'zykcjze'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157170, null, null, null, 0, 'all_teams', '1', '109', '本年累计减免税额', 'stockRightTaxDeduction', + 'number', 'jmse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157171, null, null, null, 0, 'all_teams', '1', '109', '本年累计已扣缴税额', 'stockRightAddUpAdvanceTax', + 'number', 'ykjse'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157172, null, null, null, 0, 'all_teams', '1', '109', '本年累计免税收入', 'stockRightTaxFreeIncome', + 'number', 'mssd'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, + income_category, report_column_name, report_column_data_index, data_type, + request_param_key) +VALUES (805915446042157173, null, null, null, 0, 'all_teams', '1', '109', '备注', 'stockRightRemark', 'string', 'bz'); +/ + diff --git a/resource/sqlupgrade/ST/sql202308150603.sql b/resource/sqlupgrade/ST/sql202308150603.sql new file mode 100644 index 000000000..42973a3fa --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150603.sql @@ -0,0 +1,62 @@ +create table hrsa_sob_add_up_rule +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_sob_id number, + income_category varchar2(100), + salary_item_id number, + add_up_column_data_index varchar2(100) +); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal', + 'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome', + 'addUpAllowedDonation', 'addUpTaxSavings'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpAdvanceTax'; +/ + +delete from hrsa_sob_add_up_rule +where income_category = 1 + and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax'); +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code = 'addUpTaxPayable'; +/ + +insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, add_up_column_data_index) +select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id, + income_category, salary_item_id, salary_item_code as add_up_column_data_index +from hrsa_salary_sob_item +where delete_type = 0 + and income_category = 1 + and salary_item_code in ('addUpTaxableIncome','addUpTaxFreeIncome','addUpTaxDeduction'); +/ + diff --git a/resource/sqlupgrade/ST/sql202308170103.sql b/resource/sqlupgrade/ST/sql202308170103.sql new file mode 100644 index 000000000..d52249496 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308170103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add feedback int; +/ + diff --git a/resource/sqlupgrade/ST/sql202308230303.sql b/resource/sqlupgrade/ST/sql202308230303.sql new file mode 100644 index 000000000..4867c56aa --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308230303.sql @@ -0,0 +1,6 @@ +alter table hrsa_tax_agent_tax_return add city_name varchar2(400); +/ + +update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416; +/ + diff --git a/resource/sqlupgrade/ST/sql202308240201.sql b/resource/sqlupgrade/ST/sql202308240201.sql new file mode 100644 index 000000000..c8aa4e1b1 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308240201.sql @@ -0,0 +1,47 @@ +delete from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544827,'智能算薪' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544827 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'Intelligent salary calculation' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544827 as indexid ,'智能算薪' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544827 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 544826,'人员信息报送' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 544826 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人员信息报送' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'Personnel information submission' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 544826 as indexid ,'人員信息報送' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 544826 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308240302.sql b/resource/sqlupgrade/ST/sql202308240302.sql new file mode 100644 index 000000000..b1a7f7b0e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308240302.sql @@ -0,0 +1,29 @@ +Delete from LeftMenuInfo where id=100191; +/ + +Delete from LeftMenuConfig where infoid=100191; +/ + +call LMConfig_U_ByInfoInsert (2,100181,1); +/ + +call LMInfo_Insert (100191,544827,'','',2,100181,1,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/intelligentCalculateSalarySettings' where id = 100191; +/ + +Delete from LeftMenuInfo where id=100192; +/ + +Delete from LeftMenuConfig where infoid=100192; +/ + +call LMConfig_U_ByInfoInsert (2,100118,7); +/ + +call LMInfo_Insert (100192,544826,'','',2,100118,7,18); +/ + +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/employeedeclare' where id = 100192; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308280203.sql b/resource/sqlupgrade/ST/sql202308280203.sql new file mode 100644 index 000000000..77273e99e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308280203.sql @@ -0,0 +1,47 @@ +create table hrsa_tax_api_flow_receiver +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + warn_config_id number not null, + employee_id number not null, + email varchar2(100), + mobile varchar2(50) +); +/ + +create table hrsa_tax_api_flow_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + tax_agent_id number not null, + tax_month date not null, + use_time date not null, + deduct int, + employee_id number not null, + business_type int not null, + result_status int not null +); +/ + +create table hrsa_tax_api_flow_warn_config +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + enable_warn int default 0 not null, + threshold int default 0 not null, + business_id number default '0' not null +); +/ + 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/sql202309050203.sql b/resource/sqlupgrade/ST/sql202309050203.sql new file mode 100644 index 000000000..2b3f805e1 --- /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, 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'), 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, 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'), 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/ST/sql202312190103.sql b/resource/sqlupgrade/ST/sql202312190103.sql new file mode 100644 index 000000000..3956b4605 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312190103.sql @@ -0,0 +1,61 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/ST/sql202312270603.sql b/resource/sqlupgrade/ST/sql202312270603.sql new file mode 100644 index 000000000..d239eb43a --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE hrsa_tax_declare_record add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202312270703.sql b/resource/sqlupgrade/ST/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/ST/sql202403193303.sql b/resource/sqlupgrade/ST/sql202403193303.sql new file mode 100644 index 000000000..4238b2123 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202403193303.sql @@ -0,0 +1,12 @@ +ALTER TABLE hrsa_employee_declare ADD ( +nationality varchar2(255) NULL , +birthplace varchar2(255) NULL , +tax_reasons varchar2(255) NULL , +entry_date date NULL , +departure_date date NULL +); +/ + +update hrsa_employee_declare set nationality = '中国' where nationality is null; +/ + diff --git a/resource/sqlupgrade/ST/sql202404120303.sql b/resource/sqlupgrade/ST/sql202404120303.sql new file mode 100644 index 000000000..3ce4e54d0 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202404120303.sql @@ -0,0 +1,18 @@ +CREATE TABLE hrsa_tax_declare_status ( +id NUMBER(38,0) primary key NOT NULL, +tax_declare_record_id NUMBER(38,0) NULL , +report_type number NULL , +request_id varchar2(100) , +tax_declare_type number NULL , +tax_declare_status number NULL , +display_update_icon number NULL , +tax_declare_error_msg varchar2(1000) , +person_num number NULL , +tax_pay_amount varchar2(255) , +tax_paid_amount varchar2(255) , +tax_pure_paid_amount varchar2(255) , +declare_request_id varchar2(100) , +delete_type number NULL +); +/ + diff --git a/resource/sqlupgrade/ST/sql202406170103.sql b/resource/sqlupgrade/ST/sql202406170103.sql new file mode 100644 index 000000000..159a2e240 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202406170103.sql @@ -0,0 +1,14 @@ +CREATE TABLE hrsa_sob_tax_rule ( +id NUMBER(38,0) primary key NOT NULL, +salary_sob_id NUMBER(38,0) NULL , +income_category varchar2(100) , +tax_index varchar2(100) , +salary_item_id NUMBER(38,0) NULL , +creator NUMBER(38,0) DEFAULT 0, +create_time DATE DEFAULT sysdate, +update_time DATE DEFAULT sysdate, +delete_type number DEFAULT 0, +tenant_key varchar2(10) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/ST/sql202406260403.sql b/resource/sqlupgrade/ST/sql202406260403.sql new file mode 100644 index 000000000..f27cbf3c4 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202406260403.sql @@ -0,0 +1,14 @@ +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202407170103.sql b/resource/sqlupgrade/ST/sql202407170103.sql new file mode 100644 index 000000000..6326041b7 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202407170103.sql @@ -0,0 +1,14 @@ +create table hrsa_acct_calc_tax_req +( + id number primary key , + create_time date default sysdate, + update_time date default sysdate, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + salary_acct_record_id number, + tax_agent_id number, + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202412160303.sql b/resource/sqlupgrade/ST/sql202412160303.sql new file mode 100644 index 000000000..76dc4c94e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412160303.sql @@ -0,0 +1,122 @@ +create table hrsa_other_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + other_deduction varchar2(50), + remark varchar2(255) +); +/ + +create table hrsa_health_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + identification_number varchar2(255), + effective_date date, + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50) +); +/ + +create table hrsa_grant_donation +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + recipient_name varchar2(255), + tax_code varchar2(255), + donation_number varchar2(255), + donate_date date, + donate_amount varchar2(50), + deduction_proportion varchar2(10), + actual_deduction varchar2(50) +); +/ + +create table hrsa_endowment_insurance +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + account_number varchar2(255), + check_code varchar2(255), + year_premium varchar2(50), + month_premium varchar2(50), + current_deduction varchar2(50), + deduction_month date +); +/ + +create table hrsa_derate_deduction +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + derate_item varchar2(255), + derate_property varchar2(255), + derate_amount varchar2(255) +); +/ + +create table hrsa_free_income +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + free_item varchar2(255), + free_property varchar2(255), + free_amount varchar2(255) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202412160403.sql b/resource/sqlupgrade/ST/sql202412160403.sql new file mode 100644 index 000000000..07a4c3c3b --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412160403.sql @@ -0,0 +1,18 @@ +alter table hrsa_derate_deduction add employee_type int; +/ + +alter table hrsa_endowment_insurance add employee_type int; +/ + +alter table hrsa_free_income add employee_type int; +/ + +alter table hrsa_grant_donation add employee_type int; +/ + +alter table hrsa_health_insurance add employee_type int; +/ + +alter table hrsa_other_derate_deduction add employee_type int; +/ + diff --git a/resource/sqlupgrade/ST/sql202412230103.sql b/resource/sqlupgrade/ST/sql202412230103.sql new file mode 100644 index 000000000..7d3959666 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412230103.sql @@ -0,0 +1,25 @@ +create table hrsa_personal_pension +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int default 0, + tenant_key varchar2(10), + main_id number, + tax_year_month date, + employee_id number, + tax_agent_id number, + file_status int, + voucher_type varchar2(255), + voucher_no varchar2(255), + pay_amount varchar2(255), + data_source int, + collect_source varchar2(50), + pay_month date, + eb_data_id number, + voucher_type_name varchar2(50), + employee_type int +); +/ + diff --git a/resource/sqlupgrade/ST/sql202412240103.sql b/resource/sqlupgrade/ST/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/ST/sql202503190103.sql b/resource/sqlupgrade/ST/sql202503190103.sql new file mode 100644 index 000000000..9940e3121 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202503190103.sql @@ -0,0 +1,38 @@ +create table hrsa_deduction_amount +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + employee_id number, + employee_type number, + employee_name varchar2(100), + job_num varchar2(100), + card_type number, + card_num varchar2(100), + nationality varchar2(200), + deduct_flag number, + successfully_declared number, + declare_status number, + declare_error_msg varchar2(1000) +); +/ + +create table hrsa_deduction_amount_record +( + id number primary key , + create_time date, + update_time date, + creator number, + delete_type int, + tenant_key varchar2(10), + tax_agent_id number, + year varchar2(100), + request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202506190103.sql b/resource/sqlupgrade/ST/sql202506190103.sql new file mode 100644 index 000000000..952cd69b8 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202506190103.sql @@ -0,0 +1,24 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158200, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '当期收入额', 'dividendsIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158201, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '免税收入', 'dividendsFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158202, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '准予扣除的捐赠额', 'dividendsAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158203, NULL, NULL, NULL, 0, 'all_teams', '1', '800', '减免税额', 'dividendsTaxDeduction', 'string', 'jmse', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158204, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '本期收入', 'listedCompanyIncome', 'number', 'sre', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158206, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '免税收入', 'listedCompanyFreeIncome', 'number', 'mssd', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158207, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '准予扣除的捐赠额', 'listedCompanyAllowedDonation', 'number', 'zykcjze', NULL, 0); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (805915446042158208, NULL, NULL, NULL, 0, 'all_teams', '1', '810', '减免税额', 'listedCompanyTaxDeduction', 'string', 'jmse', NULL, 0); +/ + diff --git a/resource/sqlupgrade/ST/sql202507010303.sql b/resource/sqlupgrade/ST/sql202507010303.sql new file mode 100644 index 000000000..a25d13d65 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507010303.sql @@ -0,0 +1,21 @@ +ALTER TABLE hrsa_free_income ADD income_category int; +/ + +ALTER TABLE hrsa_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_endowment_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_grant_donation ADD income_category int; +/ + +ALTER TABLE hrsa_health_insurance ADD income_category int; +/ + +ALTER TABLE hrsa_other_derate_deduction ADD income_category int; +/ + +ALTER TABLE hrsa_personal_pension ADD income_category int; +/ + diff --git a/resource/sqlupgrade/ST/sql202507010403.sql b/resource/sqlupgrade/ST/sql202507010403.sql new file mode 100644 index 000000000..69d97a34e --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507010403.sql @@ -0,0 +1,21 @@ +update hrsa_free_income set income_category = 1; +/ + +update hrsa_derate_deduction set income_category = 1; +/ + +update hrsa_endowment_insurance set income_category = 1; +/ + +update hrsa_grant_donation set income_category = 1; +/ + +update hrsa_health_insurance set income_category = 1; +/ + +update hrsa_other_derate_deduction set income_category = 1; +/ + +update hrsa_personal_pension set income_category = 1; +/ + diff --git a/resource/sqlupgrade/ST/sql202507110103.sql b/resource/sqlupgrade/ST/sql202507110103.sql new file mode 100644 index 000000000..a942c94e6 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202507110103.sql @@ -0,0 +1,3 @@ +alter table hrsa_tax_payment_request add report_type number(11) null; +/ + diff --git a/resource/wiki/寰呮坊鍔爏ql b/resource/wiki/寰呮坊鍔爏ql new file mode 100644 index 000000000..8452d9a87 --- /dev/null +++ b/resource/wiki/寰呮坊鍔爏ql @@ -0,0 +1,61 @@ +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000001, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '褰撴湡鏀跺叆棰', 'royaltiesIncome', 'number', 'sre', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000002, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '鍏嶇◣鏀跺叆', 'royaltiesTaxFreeIncome', 'number', 'mssd', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000003, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '鍏朵粬', 'royaltiesOther', 'number', 'qt', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000004, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '澶囨敞', 'royaltiesRemark', 'string', 'bz', NULL, 0); +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label, contrast_type) VALUES (700000000000000005, NULL, NULL, NULL, 0, 'all_teams', '1', '700', '鍑忓厤绋庨', 'royaltiesTaxDeduction', 'number', 'jmse', NULL, 0); + + +CREATE TABLE hrsa_api_task_record ( + id bigint(0) NOT NULL , + source varchar(500) , + api varchar(500), + param text , + response text, + tenant_key varchar(255) , + delete_type int(0) , + create_time datetime(0), + update_time datetime(0), + PRIMARY KEY (id) USING BTREE +); + +create table hrsa_api_task_record +( + id number primary key , + source varchar2(500) , + api varchar2(500), + param clob , + response clob, + create_time date, + update_time date, + delete_type int default 0, + tenant_key varchar2(10) +) +/ + +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param ntext , + response ntext, + create_time datetime, + update_time datetime, + delete_type int default 0, + tenant_key nvarchar(10) +) +GO + +create table hrsa_api_task_record +( + id bigint primary key , + source varchar(500) , + api varchar(500), + param text , + response text, + create_time timestamp, + update_time timestamp, + delete_type int default 0, + tenant_key varchar(10) +); +/ \ No newline at end of file diff --git a/resource/wiki/鎵╁睍鍔熻兘/hrmSalaryCustom.properties b/resource/wiki/鎵╁睍鍔熻兘/hrmSalaryCustom.properties index e23e93c1f..9d6a1e623 100644 --- a/resource/wiki/鎵╁睍鍔熻兘/hrmSalaryCustom.properties +++ b/resource/wiki/鎵╁睍鍔熻兘/hrmSalaryCustom.properties @@ -1,2 +1,4 @@ -formulaRunOvertimeThreshold=100 -personNumberInOneThread = 100 \ No newline at end of file +formulaRunOvertimeThreshold=10 +personNumberInOneThread = 100 +flowNoticeMessageType=2022060951 +salaryDateFormat=yyyy-MM diff --git a/src/com/api/salary/web/DeductionAmountController.java b/src/com/api/salary/web/DeductionAmountController.java new file mode 100644 index 000000000..b18635031 --- /dev/null +++ b/src/com/api/salary/web/DeductionAmountController.java @@ -0,0 +1,15 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 骞存敹鍏ヤ笉瓒6涓囧厓鐨勭撼绋庝汉鏆備笉棰勬墸棰勭即绋庢鎵i櫎鍚嶅崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Path("/bs/hrmsalary/deductionAmount") +public class DeductionAmountController extends com.engine.salary.web.DeductionAmountController { +} diff --git a/src/com/api/salary/web/EmployeeDeclareController.java b/src/com/api/salary/web/EmployeeDeclareController.java new file mode 100644 index 000000000..a895f531f --- /dev/null +++ b/src/com/api/salary/web/EmployeeDeclareController.java @@ -0,0 +1,15 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 浜哄憳鎶ラ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Path("/bs/hrmsalary/employeedeclare") +public class EmployeeDeclareController extends com.engine.salary.web.EmployeeDeclareController { +} diff --git a/src/com/api/salary/web/TaxAgentTaxReturnController.java b/src/com/api/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..85af9c074 --- /dev/null +++ b/src/com/api/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,7 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/taxAgent/taxReturn") +public class TaxAgentTaxReturnController extends com.engine.salary.web.TaxAgentTaxReturnController{ +} diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowController.java b/src/com/api/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..14eff76b5 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowController.java @@ -0,0 +1,16 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 鏅鸿兘绠楄柂-璁¤垂 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Path("/bs/hrmsalary/taxdeclaration/apiflow") +public class TaxDeclarationApiFlowController extends com.engine.salary.web.TaxDeclarationApiFlowController{ + +} diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java b/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java new file mode 100644 index 000000000..9b28c4f32 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowStatisticController.java @@ -0,0 +1,13 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 鏅鸿兘绠楄柂-璁¤垂 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Path("/bs/hrmsalary/taxdeclaration/apiflow/statistics") +public class TaxDeclarationApiFlowStatisticController extends com.engine.salary.web.TaxDeclarationApiFlowStatisticController { +} diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java b/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java new file mode 100644 index 000000000..a873eaaa4 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowWarnController.java @@ -0,0 +1,13 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +/** + * 鏅鸿兘绠楄柂-娴侀噺涓嶈冻鎻愰啋 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Path("/bs/hrmsalary/taxdeclaration/apiflow/warn") +public class TaxDeclarationApiFlowWarnController extends com.engine.salary.web.TaxDeclarationApiFlowWarnController { +} diff --git a/src/com/api/salary/web/TaxPaymentController.java b/src/com/api/salary/web/TaxPaymentController.java new file mode 100644 index 000000000..d29574206 --- /dev/null +++ b/src/com/api/salary/web/TaxPaymentController.java @@ -0,0 +1,9 @@ +package com.api.salary.web; + + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/taxPayment") +public class TaxPaymentController extends com.engine.salary.web.TaxPaymentController{ + +} diff --git a/src/com/engine/salary/annotation/SalaryFormulaVar.java b/src/com/engine/salary/annotation/SalaryFormulaVar.java index 2e3077158..c5d10b7d7 100644 --- a/src/com/engine/salary/annotation/SalaryFormulaVar.java +++ b/src/com/engine/salary/annotation/SalaryFormulaVar.java @@ -24,4 +24,10 @@ public @interface SalaryFormulaVar { String dataType(); String fieldId() default ""; + + /** + * 鍒悕,鐢ㄤ簬灞炴у悕鍜岄」鐩悕涓嶅尮閰嶆椂鍦烘櫙 + * @return + */ + String alias() default ""; } diff --git a/src/com/engine/salary/annotation/TaxField.java b/src/com/engine/salary/annotation/TaxField.java new file mode 100644 index 000000000..57495febf --- /dev/null +++ b/src/com/engine/salary/annotation/TaxField.java @@ -0,0 +1,12 @@ +package com.engine.salary.annotation; + +import java.lang.annotation.*; + +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TaxField { + String name(); + + String taxIndex(); +} diff --git a/src/com/engine/salary/cache/SalaryCacheKey.java b/src/com/engine/salary/cache/SalaryCacheKey.java index 4d0d19280..f9799af59 100644 --- a/src/com/engine/salary/cache/SalaryCacheKey.java +++ b/src/com/engine/salary/cache/SalaryCacheKey.java @@ -15,6 +15,11 @@ public class SalaryCacheKey { */ public final static String ACCT_PROGRESS = "ACCT_PROGRESS_"; + /** + * 鏍哥畻绋庡悗宸ヨ祫杩涘害 + */ + public final static String AFTER_TAXA_CCT_PROGRESS = "AFTER_TAX_ACCT_PROGRESS_"; + /** * 钖祫鏍哥畻鐨勮处濂楅厤缃 */ diff --git a/src/com/engine/salary/cache/SalaryModuleKey.java b/src/com/engine/salary/cache/SalaryModuleKey.java index 9a400744d..2e56259fe 100644 --- a/src/com/engine/salary/cache/SalaryModuleKey.java +++ b/src/com/engine/salary/cache/SalaryModuleKey.java @@ -1,12 +1,13 @@ package com.engine.salary.cache; /** - * @description: 鐢ㄤ簬鎷疯礉瀹氫箟鎵鏈夌殑妯″潡key锛屾寜鐓фā鍧楀悕瑙勮寖琛ㄨ繘琛屽畾涔夛紝渚夸簬寮鍙戝紩鐢ㄣ傝姹傚彉閲忓悕鍜屽彉閲忓煎繀椤诲畬鍏ㄤ繚鎸佷竴鑷 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/13/21 11:24 AM - * @version:v1.0 - */ + * 鐢ㄤ簬鎷疯礉瀹氫箟鎵鏈夌殑妯″潡key锛屾寜鐓фā鍧楀悕瑙勮寖琛ㄨ繘琛屽畾涔夛紝渚夸簬寮鍙戝紩鐢ㄣ傝姹傚彉閲忓悕鍜屽彉閲忓煎繀椤诲畬鍏ㄤ繚鎸佷竴鑷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryModuleKey { /** diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java new file mode 100644 index 000000000..b8e126406 --- /dev/null +++ b/src/com/engine/salary/common/OptionDTO.java @@ -0,0 +1,27 @@ +package com.engine.salary.common; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 浜哄憳閫夐」 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("浜哄憳閫夐」") +public class OptionDTO { + + //浜哄憳ID") + private String id; + + //浜哄憳濮撳悕") + private String content; +} diff --git a/src/com/engine/salary/common/YearMonthRange.java b/src/com/engine/salary/common/YearMonthRange.java new file mode 100644 index 000000000..feba6b5e4 --- /dev/null +++ b/src/com/engine/salary/common/YearMonthRange.java @@ -0,0 +1,29 @@ +package com.engine.salary.common; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 鏈堜唤鑼冨洿 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class YearMonthRange { + + //寮濮嬫湀浠 + @JsonSerialize(using = ToStringSerializer.class) + private Date startMonth; + + //寮濮嬫湀浠 + @JsonSerialize(using = ToStringSerializer.class) + private Date endMonth; +} diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java new file mode 100644 index 000000000..d294062b1 --- /dev/null +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -0,0 +1,18 @@ +package com.engine.salary.common.taxdeclare; + +import lombok.Data; + +/** + * 寮傛鎺ュ彛涓殑requestId + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class AsyncRequestIdDTO { + + //寮傛鎺ュ彛涓殑requestId") + private String requestId; +} diff --git a/src/com/engine/salary/config/SalaryPermissionConfig.java b/src/com/engine/salary/config/SalaryPermissionConfig.java index 7703e9267..61abe6086 100644 --- a/src/com/engine/salary/config/SalaryPermissionConfig.java +++ b/src/com/engine/salary/config/SalaryPermissionConfig.java @@ -22,11 +22,11 @@ //@Configuration //public class SalaryPermissionConfig { // -// @Autowired +// // private PermissionConfig permissionConfig; -// @Autowired +// // private PermissionModuleSourceService permissionModuleSourceService; -// @Autowired +// // private PermissionModuleTargetService permissionModuleTargetService; // // public static final String TABLE_NAME = "hrsa"; diff --git a/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java index 2d5ca8a1b..a185dff62 100644 --- a/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java +++ b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java @@ -2,7 +2,7 @@ package com.engine.salary.constant; /** * 榛樿鐨勭鎴穔ey - *

Copyright: Copyright (c) 2024

+ *

Copyright: Copyright (c) 2023

*

Company: 娉涘井杞欢

* * @author qiantao diff --git a/src/com/engine/salary/constant/SalaryItemConstant.java b/src/com/engine/salary/constant/SalaryItemConstant.java index 58840b5f3..e54e684f7 100644 --- a/src/com/engine/salary/constant/SalaryItemConstant.java +++ b/src/com/engine/salary/constant/SalaryItemConstant.java @@ -40,5 +40,10 @@ public class SalaryItemConstant { */ public static final String RESULT_EXPORT_FIELD_SIGN="_salaryAcctResultExportFieldSign"; + /** + * 涓◣鐢虫姤鍦ㄧ嚎瀵规瘮缂撳瓨琛ㄥご瀛楁key + */ + public static final String TAX_DECLARE_CONTRAST_FIELD_SIGN="_taxDeclareContrastFieldSign"; + } diff --git a/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java b/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java index c2150c2dc..d438db46d 100644 --- a/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java +++ b/src/com/engine/salary/constant/SalaryItemDataTypeConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 钖祫椤圭洰鐨勫肩殑瀛楁绫诲瀷 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2/9/22 1:56 PM - * @version:v1.0 - */ + * 钖祫椤圭洰鐨勫肩殑瀛楁绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryItemDataTypeConstant { /** diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java new file mode 100644 index 000000000..7697a206a --- /dev/null +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -0,0 +1,230 @@ +package com.engine.salary.constant; + +/** + * 绁炲窞浜戝悎api甯搁噺 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SzyhApiConstant { + + /** + * 鎺ュ彛HOST + */ + public static final String HOST_URL = "https://ddapi.bigfintax.com/"; + + /** + * 娴嬭瘯鎺ュ彛host + */ + public static final String TEST_HOST_URL = "https://uat-ddapi.bigfintax.com/"; + + /** + * 浼佷笟娉ㄥ唽鎺ュ彛 + */ + public static final String GET_REGISTER_INFO_URL = "gateway/iit/service/getCompanyRegisterInfo"; + /** + * 浼佷笟娉ㄥ唽鍙嶉鎺ュ彛 + */ + public static final String GET_REGISTER_INFO_FEEDBACK_URL = "/gateway/iit/service/getCompanyRegisterInfoFeedback"; + + /** + * 鏍¢獙瀵嗙爜鎺ュ彛 + */ + public static final String CHECK_PASSWORD_URL = "gateway/iit/service/check/checkPassword"; + /** + * 鏍¢獙瀵嗙爜鍙嶉鎺ュ彛 + */ + public static final String CHECK_PASSWORD_FEEDBACK_URL = "gateway/iit/service/check/getCheckPasswordFeedback"; + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ + */ + public static final String QUERY_SPECIAL_AMOUNT = "gateway/iit/special/querySpecialAmount"; + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ鍙嶉 + */ + public static final String GET_QUERY_SPECIAL_AMOUNT_FEEDBACK = "gateway/iit/special/getQuerySpecialAmountFeedback"; + + /** + * 鎶ラ佷汉鍛樻帴鍙 + */ + public static final String DECLARE_EMPLOYEE_INFO = "gateway/iit/declare/declareEmployeeInfo"; + + /** + * 鎶ラ佷汉鍛樿幏鍙栧弽棣堟帴鍙 + */ + public static final String DECLARE_EMPLOYEE_INFO_FEEDBACK = "gateway/iit/declare/getEmployeeInfoFeedback"; + + /** + * 涓◣鐢虫姤 + */ + public static final String DECLARE_TAX = "gateway/iit/report/send"; + + /** + * 鑾峰彇涓◣鐢虫姤鍙嶉 + */ + public static final String DECLARE_TAX_FEEDBACK = "gateway/iit/report/getFeedback"; + + /** + * 浣滃簾鐢虫姤 + */ + public static final String CANCEL_DECLARE = "gateway/iit/report/cancel"; + + /** + * 鑾峰彇浣滃簾鐢虫姤鍙嶉 + */ + public static final String CANCEL_DECLARE_FEEDBACK = "gateway/iit/report/getCancelFeedback"; + + /** + * 鏇存鐢虫姤 + */ + public static final String UPDATE_DECLARE = "/gateway/iit/service/correct"; + + /** + * 鏇存鐢虫姤鍙嶉 + */ + public static final String UPDATE_DECLARE_FEEDBACK = "/gateway/iit/service/getCorrectFeedback"; + + /** + * 鎾ら攢鏇存鐢虫姤 + */ + public static final String CANCEL_CORRECT = "gateway/iit/report/cancelCorrect"; + + /** + * 浼佷笟鐢虫姤鏁版嵁鏄庣粏鏌ヨ + */ + public static final String GET_COMPANY_INCOMES = "gateway/iit/service/getCompanyIncomes"; + + /** + * 浼佷笟鐢虫姤鏁版嵁鏄庣粏鏌ヨ鍙嶉 + */ + public static final String GET_COMPANY_INCOMES_FEEDBACK = "gateway/iit/service/getCompanyIncomesFeedback"; + + /** + * 鑾峰彇娴侀噺缁熻鎯呭喌 + */ + public static final String QUERY_ACCOUNT_BALANCE = "gateway/iit/statistic/queryAccountBalance"; + + /** + * 鏌ヨ绋庡彿娴侀噺鏄庣粏 + */ + public static final String QUERY_DETAILS_BY_TAX_NUMBER = "gateway/iit/statistic/queryDetailsByTaxNumber"; + + /** + * 鑾峰彇浼佷笟涓夋柟淇℃伅 + */ + public static final String QUERY_AGREEMENT = "gateway/iit/payment/queryAgreement"; + + /** + * 鑾峰彇浼佷笟涓夋柟淇℃伅鏌ヨ鍙嶉 + */ + public static final String GET_AGREEMENT_QUERY_FEEDBACK = "gateway/iit/payment/getAgreementQueryFeedback"; + + /** + * 涓夋柟鍗忚缂存 + */ + public static final String DECLARE_WITH_HOLDING = "gateway/iit/payment/declareWithholding"; + + /** + * 涓夋柟鍗忚缂存鍙嶉 + */ + public static final String DECLARE_WITH_HOLDING_FEEDBACK = "gateway/iit/payment/getWithholdingFeedback"; + + /** + * 缂存鍑瘉 + */ + public static final String WITHHOLDING_VOUCHER = "gateway/iit/payment/withholdingVoucher"; + + /** + * 缂存鍑瘉鍙嶉 + */ + public static final String WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/payment/getWithholdingVoucherFeedback"; + + /** + * 缂存鍑瘉浣滃簾 + */ + public static final String CANCEL_WITHHOLDING_VOUCHER = "gateway/iit/service/cancelWithholdingVoucher"; + + /** + * 缂存鍑瘉浣滃簾鍙嶉 + */ + public static final String CANCEL_WITHHOLDING_VOUCHER_FEEDBACK = "gateway/iit/service/getCancelWithholdingVoucher"; + + + /** + * 瀹岀◣璇佹槑 + */ + public static final String GET_WITHHELD_VOUCHER = "gateway/iit/service/getWithheldVoucher"; + + /** + * 瀹岀◣璇佹槑鍙嶉 + */ + public static final String GET_WITHHELD_VOUCHER_FEEDBACK = "gateway/iit/service/getWithheldVoucherFeedback"; + + /** + * 鏌ヨ缂存鐘舵 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/service/getSyncWithholdingFeedback"; + + /** + * 鏌ヨ缂存鐘舵佸弽棣 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK_FEEDBACK = "gateway/iit/service/getSyncWithholding"; + + + /** + * 涓汉鍏昏侀噾涓嬭浇 + */ + public static final String DOWNLOAD_PERSONAL_PENSION = "gateway/iit/personalPension/download"; + /** + * 鑾峰彇涓汉鍏昏侀噾涓嬭浇鍙嶉 + */ + public static final String DOWNLOAD_PERSONAL_PENSION_FEEDBACK = "gateway/iit/personalPension/getDownloadFeedback"; + /** + * 寮傛璁$畻涓◣ + */ + public static final String CALCULATE_ASYN_INDIVIDUAL_INCOME_TAX = "gateway/iit/calculateTax/calculateASynIndividualIncomeTax"; + /** + * 鏌ヨ绠楃◣鍙嶉缁撴灉 + */ + public static final String ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK = "gateway/iit/calculateTax/getASynIndividualIncomeTaxFeedback"; + + + + + /** + * 璇锋眰鎴愬姛鐘舵佺爜 + */ + public static final String SUCCESS_CODE = "00000000"; + + /** + * 澶勭悊涓姸鎬佺爜 + */ + public static final String HANDLING_CODE = "000004"; + + /** + * 寮傛璁$畻浠诲姟杩樻湭缁撴潫 + */ + public static final String TASK_HANDLING_CODE = "100004"; + + /** + * 浼佷笟鏈嶅姟涓嶅彲鐢 + */ + public static final String APP_DISABLED_CODE = "990006"; + + /** + * 浼佷笟鏈嶅姟宸插仠鐢 + */ + public static final String APP_PAUSED_CODE = "990007"; + /** + * 閿欒鐮 + */ + public static final String ERROR_CODE = "ITGCUS0002"; + /** + * 鏃犵即娆惧嚟璇 + */ + public static final String NONE_VOUCHER_CODE = "200028"; +} diff --git a/src/com/engine/salary/constant/TaxRateDataIndexConstant.java b/src/com/engine/salary/constant/TaxRateDataIndexConstant.java index f77d025d6..632b95e5c 100644 --- a/src/com/engine/salary/constant/TaxRateDataIndexConstant.java +++ b/src/com/engine/salary/constant/TaxRateDataIndexConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 涓◣绋庣巼琛ㄦ槑缁嗚〃鐨刣ataIndex - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 1:58 PM - * @version:v1.0 - */ + * 涓◣绋庣巼琛ㄦ槑缁嗚〃鐨刣ataIndex + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxRateDataIndexConstant { /** diff --git a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java index 25956b123..54ec34211 100644 --- a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java +++ b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java @@ -7,8 +7,8 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.util.db.IdGenerator; import org.apache.commons.collections4.CollectionUtils; -import java.time.LocalDateTime; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -43,14 +43,15 @@ public class PaymentAgencyBO { } public static PaymentAgencyPO buildPaymentAgencyPO(PaymentAgencyFormDTO paymentAgencyFormDTO, Long employeeId, String tenantKey) { + Date now = new Date(); return PaymentAgencyPO.builder() .id(IdGenerator.generate()) .agencyName(paymentAgencyFormDTO.getAgencyName()) - .createTime(LocalDateTime.now()) + .createTime(now) .creator(employeeId) .tenantKey(tenantKey) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) - .updateTime(LocalDateTime.now()) + .updateTime(now) .remarks(paymentAgencyFormDTO.getRemarks()) .build(); } diff --git a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java index 93045f86e..87626962b 100644 --- a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java +++ b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java @@ -5,7 +5,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; @Data @Builder @@ -32,12 +32,12 @@ public class PaymentAgencyPO { /** * 鍒涘缓鏃堕棿 */ - private LocalDateTime createTime; + private Date createTime; /** * 鏇存柊鏃堕棿 */ - private LocalDateTime updateTime; + private Date updateTime; /** * 鍒涘缓浜 diff --git a/src/com/engine/salary/entity/api/ApiTaskRecordPO.java b/src/com/engine/salary/entity/api/ApiTaskRecordPO.java new file mode 100644 index 000000000..dbb45bf9d --- /dev/null +++ b/src/com/engine/salary/entity/api/ApiTaskRecordPO.java @@ -0,0 +1,63 @@ +package com.engine.salary.entity.api; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ApiTaskRecordPO { + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 鏉ユ簮 + */ + private String source; + + /** + * api鎿嶄綔 + */ + private String api; + + /** + * 鍙傛暟 + */ + private String param; + /** + * 鍙嶉 + */ + private String response; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 绉熸埛key + */ + private String tenantKey; + + //涓婚敭id闆嗗悎 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java b/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java new file mode 100644 index 000000000..193876e79 --- /dev/null +++ b/src/com/engine/salary/entity/browser/dto/BrowserDataDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.browser.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 娴忚鎸夐挳 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class BrowserDataDTO { + + private Long id; + + @TableTitle(title = "鍚嶇О", dataIndex = "name", key = "name") + private String name; + +} diff --git a/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java b/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java new file mode 100644 index 000000000..d23be6e5f --- /dev/null +++ b/src/com/engine/salary/entity/browser/param/BrowserDataQueryParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.browser.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 娴忚鎸夐挳 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BrowserDataQueryParam extends BaseQueryParam { + private String type; + private String jsonParam; +} diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index b9d7278c6..7d0e46a76 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection; import com.engine.salary.annotation.*; import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,7 +20,7 @@ import java.util.Set; @Builder @NoArgsConstructor @AllArgsConstructor -@SalaryTable(pageId = "a4f83287-e3f9-4275-9527-7d06e54y6238", fields = "id,addUpSubtraction", operates = {@SalaryTableOperate(text = "鍒犻櫎",index = "0")}) +@SalaryTable(pageId = "a4f83287-e3f9-4275-9527-7d06e54y6238", fields = "id,addUpSubtraction", operates = {@SalaryTableOperate(text = "鍒犻櫎", index = "0")}) //hrsa_add_up_situation @ElogTransform(name = "寰鏈熺疮璁℃儏鍐") @Auth(page = "addUpSituation") @@ -55,6 +56,13 @@ public class AddUpSituation { @ElogTransform(name = "骞翠唤") private Integer year; + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 绱鏀跺叆棰 */ @@ -82,123 +90,147 @@ public class AddUpSituation { /** * 绱鍏Н閲戜釜浜哄悎璁 */ - @ElogTransform(name = "绱鍏Н閲戜釜浜哄悎璁") @SalaryFormulaVar(defaultLabel = "绱鍏Н閲戜釜浜哄悎璁", labelId = 86709, dataType = "number") + @ElogTransform(name = "绱鍏Н閲戜釜浜哄悎璁") @Encrypt private String addUpAccumulationFundTotal; /** * 绱瀛愬コ鏁欒偛 */ - @ElogTransform(name = "绱瀛愬コ鏁欒偛") - @SalaryFormulaVar(defaultLabel = "绱瀛愬コ鏁欒偛", labelId = 86321, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱瀛愬コ鏁欒偛", labelId = 86321, dataType = "number") @Encrypt + @Deprecated private String addUpChildEducation; /** * 绱缁х画鏁欒偛 */ - @ElogTransform(name = "绱缁х画鏁欒偛") - @SalaryFormulaVar(defaultLabel = "绱缁х画鏁欒偛", labelId = 86323, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱缁х画鏁欒偛", labelId = 86323, dataType = "number") @Encrypt + @Deprecated private String addUpContinuingEducation; /** * 绱浣忔埧璐锋鍒╂伅 */ - @ElogTransform(name = "绱浣忔埧璐锋鍒╂伅") - @SalaryFormulaVar(defaultLabel = "绱浣忔埧璐锋鍒╂伅", labelId = 86324, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱浣忔埧璐锋鍒╂伅", labelId = 86324, dataType = "number") @Encrypt + @Deprecated private String addUpHousingLoanInterest; /** * 绱浣忔埧绉熼噾 */ - @ElogTransform(name = "绱浣忔埧绉熼噾") - @SalaryFormulaVar(defaultLabel = "绱浣忔埧绉熼噾", labelId = 86325, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱浣忔埧绉熼噾", labelId = 86325, dataType = "number") @Encrypt + @Deprecated private String addUpHousingRent; /** * 绱璧″吇鑰佷汉 */ - @ElogTransform(name = "绱璧″吇鑰佷汉") - @SalaryFormulaVar(defaultLabel = "绱璧″吇鑰佷汉", labelId = 86326, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱璧″吇鑰佷汉", labelId = 86326, dataType = "number") @Encrypt + @Deprecated private String addUpSupportElderly; /** * 绱澶х梾鍖荤枟 */ - @ElogTransform(name = "绱澶х梾鍖荤枟") - @SalaryFormulaVar(defaultLabel = "绱澶х梾鍖荤枟", labelId = 105142, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱澶х梾鍖荤枟", labelId = 105142, dataType = "number") @Encrypt + @Deprecated private String addUpIllnessMedical; /** * 绱濠村辜鍎跨収鎶 */ - @ElogTransform(name = "绱濠村辜鍎跨収鎶") - @SalaryFormulaVar(defaultLabel = "绱濠村辜鍎跨収鎶", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱濠村辜鍎跨収鎶", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpInfantCare; /** * 绱濠村辜鍎跨収鎶 */ - @ElogTransform(name = "绱涓汉鍏昏侀噾") - @SalaryFormulaVar(defaultLabel = "绱涓汉鍏昏侀噾", labelId = 117732, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "绱涓汉鍏昏侀噾", labelId = 117732, dataType = "number") @Encrypt + @Deprecated private String addUpPrivatePension; /** * 绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒 */ - @ElogTransform(name = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒") @SalaryFormulaVar(defaultLabel = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", labelId = 90567, dataType = "number") + @ElogTransform(name = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒") @Encrypt private String addUpEnterpriseAndOther; /** * 绱鍏朵粬鍏嶇◣鎵i櫎 */ - @ElogTransform(name = "绱鍏朵粬鍏嶇◣鎵i櫎") @SalaryFormulaVar(defaultLabel = "绱鍏朵粬鍏嶇◣鎵i櫎", labelId = 93902, dataType = "number") + @ElogTransform(name = "绱鍏朵粬鍏嶇◣鎵i櫎") @Encrypt private String addUpOtherDeduction; /** * 绱鍏嶇◣鏀跺叆 */ + @SalaryFormulaVar(defaultLabel = "绱鍏嶇◣鏀跺叆", labelId = 86704, dataType = "number",alias = "addUpTaxFreeIncome") @ElogTransform(name = "绱鍏嶇◣鏀跺叆") - @SalaryFormulaVar(defaultLabel = "绱鍏嶇◣鏀跺叆", labelId = 86704, dataType = "number") @Encrypt private String addUpTaxExemptIncome; /** * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 */ - @ElogTransform(name = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻") @SalaryFormulaVar(defaultLabel = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", labelId = 86703, dataType = "number") + @ElogTransform(name = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻") @Encrypt private String addUpAllowedDonation; /** * 绱鍑忓厤绋庨 */ + @SalaryFormulaVar(defaultLabel = "绱鍑忓厤绋庨", labelId = 105478, dataType = "number", alias = "addUpTaxDeduction") @ElogTransform(name = "绱鍑忓厤绋庨") - @SalaryFormulaVar(defaultLabel = "绱鍑忓厤绋庨", labelId = 105478, dataType = "number") @Encrypt private String addUpTaxSavings; /** * 绱宸查鎵i缂寸◣棰 */ - @ElogTransform(name = "绱宸查鎵i缂寸◣棰") @SalaryFormulaVar(defaultLabel = "绱宸查鎵i缂寸◣棰", labelId = 86702, dataType = "number") + @ElogTransform(name = "绱宸查鎵i缂寸◣棰") @Encrypt private String addUpAdvanceTax; + /** + * 瀹為檯绱宸查鎵i缂寸◣棰 + */ + @SalaryFormulaVar(defaultLabel = "瀹為檯绱宸查鎵i缂寸◣棰", labelId = 233557, dataType = "number") + @ElogTransform(name = "瀹為檯绱宸查鎵i缂寸◣棰") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 涓◣璋冨樊 + */ + @ElogTransform(name = "涓◣璋冨樊") + @SalaryFormulaVar(defaultLabel = "涓◣璋冨樊", labelId = 233559, dataType = "number") + @Encrypt + private String taxAdjustment; + + /** + * 绱搴旂撼绋庢墍寰楅 + */ + @ElogTransform(name = "绱搴旂撼绋庢墍寰楅") + @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 e216ddc7d..107780888 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,17 +1,138 @@ 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 com.engine.salary.util.db.IdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + /** * @Description: 鏁版嵁閲囬泦 * @Author: wangxiangzhong * @Date: 2021/11/29 13:28 */ public class DataCollectionBO { + private static final Logger logger = LoggerFactory.getLogger(DataCollectionBO.class); - @Override - public String toString() { - return "DataCollectionBO{}"; - } - +// @Override +// public String toString() { +// return "DataCollectionBO{}"; +// } +// +// /** +// * PO杞珼TO:绱涓撻」闄勫姞鎵i櫎鍔犲瘑瀛楁璧嬪 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4AddUpDeduction(AddUpDeduction po, AddUpDeductionListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpChildEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpChildEducation())); +// dto.setAddUpContinuingEducation(SalaryEntityUtil.thousandthConvert(po.getAddUpContinuingEducation())); +// dto.setAddUpHousingLoanInterest(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingLoanInterest())); +// dto.setAddUpHousingRent(SalaryEntityUtil.thousandthConvert(po.getAddUpHousingRent())); +// dto.setAddUpSupportElderly(SalaryEntityUtil.thousandthConvert(po.getAddUpSupportElderly())); +// dto.setAddUpIllnessMedical(SalaryEntityUtil.thousandthConvert(po.getAddUpIllnessMedical())); +// dto.setAddUpInfantCare(SalaryEntityUtil.thousandthConvert(po.getAddUpInfantCare())); +// dto.setLastUpdateTime(po.getLastUpdateTime()); +// dto.setDataSource(Optional.ofNullable(EnumAddUpDeductionDataSource.parseByValue(po.getDataSource())) +// .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())) +// .orElse(SalaryI18nUtil.getI18nLabel(EnumAddUpDeductionDataSource.MANUAL.getLabelId(), EnumAddUpDeductionDataSource.MANUAL.getDefaultLabel()))); +// } +// +// /** +// * PO杞珼TO:寰鏈熺疮璁℃儏鍐靛姞瀵嗗瓧娈佃祴鍊 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4AddUpSituationPOVal(AddUpSituationPO po, AddUpSituationListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome())); +// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction())); +// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal())); +// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal())); +// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther())); +// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction())); +// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome())); +// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation())); +// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings())); +// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax())); +// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome())); +// } +// +// public static void poToDTO4AddUpSituationRecordPOVal(AddUpSituationPO po, AddUpSituationRecordDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setAddUpIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpIncome())); +// dto.setAddUpSubtraction(SalaryEntityUtil.thousandthConvert(po.getAddUpSubtraction())); +// dto.setAddUpSocialSecurityTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpSocialSecurityTotal())); +// dto.setAddUpAccumulationFundTotal(SalaryEntityUtil.thousandthConvert(po.getAddUpAccumulationFundTotal())); +// dto.setAddUpEnterpriseAndOther(SalaryEntityUtil.thousandthConvert(po.getAddUpEnterpriseAndOther())); +// dto.setAddUpOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getAddUpOtherDeduction())); +// dto.setAddUpTaxExemptIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxExemptIncome())); +// dto.setAddUpAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getAddUpAllowedDonation())); +// dto.setAddUpTaxSavings(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxSavings())); +// dto.setAddUpAdvanceTax(SalaryEntityUtil.thousandthConvert(po.getAddUpAdvanceTax())); +// dto.setAddUpTaxableIncome(SalaryEntityUtil.thousandthConvert(po.getAddUpTaxableIncome())); +// } +// +// public static void convert2Po4UpdateSituation(AddUpSituationPO po, AddUpSituationUpdateParam param) { +// if (param == null || po == null) { +// return; +// } +// po.setAddUpIncome(param.getAddUpIncome()); +// po.setAddUpSubtraction(param.getAddUpSubtraction()); +// po.setAddUpSocialSecurityTotal(param.getAddUpSocialSecurityTotal()); +// po.setAddUpAccumulationFundTotal(param.getAddUpAccumulationFundTotal()); +// po.setAddUpEnterpriseAndOther(param.getAddUpEnterpriseAndOther()); +// po.setAddUpOtherDeduction(param.getAddUpOtherDeduction()); +// po.setAddUpTaxExemptIncome(param.getAddUpTaxExemptIncome()); +// po.setAddUpAllowedDonation(param.getAddUpAllowedDonation()); +// po.setAddUpTaxSavings(param.getAddUpTaxSavings()); +// po.setAddUpAdvanceTax(param.getAddUpAdvanceTax()); +// po.setAddUpTaxableIncome(param.getAddUpTaxableIncome()); +// } +// +// /** +// * PO杞珼TO:鍏朵粬鍏嶇◣鎵i櫎鍔犲瘑瀛楁璧嬪 +// * +// * @param po +// * @param dto +// */ +// public static void poToDTO4OtherDeductionPOVal(OtherDeductionPO po, OtherDeductionListDTO dto) { +// if (po == null || dto == null) { +// return; +// } +// dto.setBusinessHealthyInsurance(SalaryEntityUtil.thousandthConvert(po.getBusinessHealthyInsurance())); +// dto.setTaxDelayEndowmentInsurance(SalaryEntityUtil.thousandthConvert(po.getTaxDelayEndowmentInsurance())); +// dto.setOtherDeduction(SalaryEntityUtil.thousandthConvert(po.getOtherDeduction())); +// dto.setDeductionAllowedDonation(SalaryEntityUtil.thousandthConvert(po.getDeductionAllowedDonation())); +// } +// // /** // * 娣诲姞鏃ユ湡鑼冨洿 // * @@ -31,22 +152,297 @@ public class DataCollectionBO { // } // // /** -// * 鑾峰彇韬唤璇佸彿 +// * 蹇界暐韬唤璇佸彿鐮佹悳绱㈡潯浠 // * -// * @param employeeId -// * @param simpleUserInfos +// * @param clazz // */ -// public static String getIdNo(Long employeeId, List simpleUserInfos) { -// if (employeeId == null || CollectionUtils.isEmpty(simpleUserInfos)) { -// return StringUtils.EMPTY; +// public static void ingoreIdNoSearchCondition(Class clazz) { +// try { +// Field idNoField = clazz.getDeclaredField("idNo"); +// SalarySearchCondition targetAnnotation = idNoField.getAnnotation(SalarySearchCondition.class); +//// boolean oldValue = targetAnnotation.ignore(); +//// System.out.println("淇敼涔嬪墠鐨勬敞瑙e硷細" + oldValue); +// //鑾峰彇 targetAnnotation 杩欎釜浠g悊瀹炰緥鎵鎸佹湁鐨 InvocationHandler +// InvocationHandler invocationHandler = Proxy.getInvocationHandler(targetAnnotation); +// // 鑾峰彇 AnnotationInvocationHandler 鐨 memberValues 瀛楁 +// Field declaredField = invocationHandler.getClass().getDeclaredField("memberValues"); +// // 鍥犱负杩欎釜瀛楁浜 private final 淇グ锛屾墍浠ヨ鎵撳紑鏉冮檺 +// declaredField.setAccessible(true); +// // 鑾峰彇 memberValues +// Map memberValues = (Map) declaredField.get(invocationHandler); +// // 淇敼 ignore 灞炴у +// memberValues.put("ignore", true); +//// boolean newValue = targetAnnotation.ignore(); +//// System.out.println("淇敼涔嬪悗鐨勬敞瑙e硷細" + newValue); +// } catch (Exception e) { +// logger.error("蹇界暐idNo澶辫触锛歿}", e.getMessage(), e); // } -// Optional optionalSimpleUserInfo = simpleUserInfos.stream() -// .filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser())).findFirst(); -// String idNo = StringUtils.EMPTY; -// if (optionalSimpleUserInfo.isPresent()) { -// SimpleUserInfo simpleUserInfo = optionalSimpleUserInfo.get(); -// idNo = Optional.of(simpleUserInfo).map(SimpleUserInfo::getIdNo).orElse(StringUtils.EMPTY); +// } +// +// /** +// * 鏋勫缓鏂板缓鍩虹琛ㄥ崟 +// * +// * @param taxAgentList +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public static WeaForm buildBaseInfoAddForm(Collection taxAgentList, Long employeeId, String tenantKey) { +// // 鏋勫缓琛ㄥ崟 +// WeaForm baseInfoForm = new WeaForm(); +// // 鎺т欢椤圭洰 +// Map items = baseInfoForm.getItems(); +// +// WeaFormItem declareMonthItem = new WeaFormItem(WeaFormItemType.DATEPICKER); +// declareMonthItem.setRequired(true); +// Map otherParams = new HashMap<>(); +// otherParams.put("type", "month"); +// declareMonthItem.setOtherParams(otherParams); +// items.put("declareMonth", declareMonthItem); +// +// WeaFormItem taxAgentItem = new WeaFormItem(WeaFormItemType.SELECT); +// taxAgentItem.setRequired(true); +// taxAgentItem.setOptions(taxAgentList.stream() +// .map(t -> { +// WeaFormOption weaFormOption = new WeaFormOption(); +// weaFormOption.setId("" + t.getId()); +// weaFormOption.setContent(t.getName()); +// return weaFormOption; +// }).collect(Collectors.toList())); +// items.put("taxAgent", taxAgentItem); +// +// WeaFormItem employeeItem = new WeaFormItem(WeaFormItemType.BROWSER); +// employeeItem.setRequired(true); +// employeeItem.setBrowserBean(new WeaBrowserBean("hrmsalary", "dataCollectionEmployeeBrowser")); +// items.put("employee", employeeItem); +// +// // 鎺т欢甯冨眬 +// String groupId = "baseInfo"; +// List> layout = baseInfoForm.getLayout(); +// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "绋庢鎵灞炴湡"), groupId, new String[]{"declareMonth"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "涓◣鎵g即涔夊姟浜"), groupId, new String[]{"taxAgent"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100133, "浜哄憳"), groupId, new String[]{"employee"}))); +// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8))); +// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "鍩虹淇℃伅")))); +// return baseInfoForm; +// } +// +// /** +// * 鏋勫缓鍩虹淇℃伅琛ㄥ崟 +// * +// * @param employee +// * @param taxAgent +// * @param enableHr +// * @param declareMonth +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public static WeaForm buildBaseInfoForm(SimpleEmployee employee, String taxAgent, boolean enableHr, String idNo, LocalDate declareMonth, Long employeeId, String tenantKey) { +// // 鏋勫缓琛ㄥ崟 +// WeaForm baseInfoForm = new WeaForm(); +// // 鎺т欢椤圭洰 +// Map items = baseInfoForm.getItems(); +// +// List itemNames = Arrays.asList("username", "taxAgent", "declareMonth", "department", "position", "hiredate", "mobile", "jobNum", "employeeStatus"); +// itemNames.forEach(itemName -> { +// WeaFormItem item = new WeaFormItem(WeaFormItemType.INPUT); +// item.setReadOnly(true); +// items.put(itemName, item); +// }); +// +// if (enableHr) { +// WeaFormItem idNoItem = new WeaFormItem(WeaFormItemType.INPUT); +// idNoItem.setReadOnly(true); +// items.put("idNo", idNoItem); +// } else { +// WeaFormItem emptyItem = new WeaFormItem(WeaFormItemType.INPUT); +// emptyItem.setReadOnly(true); +// items.put("empty", emptyItem); // } -// return idNo; +// +// // 鎺т欢甯冨眬 +// List> layout = baseInfoForm.getLayout(); +// String groupId = "baseInfo"; +// layout.add(Lists.newArrayList(new WeaFormLayout("1", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 85429, "濮撳悕"), groupId, new String[]{"username"}), new WeaFormLayout("2", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "涓◣鎵g即涔夊姟浜"), groupId, new String[]{"taxAgent"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("3", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86176, "绋庢鎵灞炴湡"), groupId, new String[]{"declareMonth"}), new WeaFormLayout("4", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86185, "閮ㄩ棬"), groupId, new String[]{"department"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("5", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 90633, "宀椾綅"), groupId, new String[]{"position"}), new WeaFormLayout("6", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86319, "鍏ヨ亴鏃ユ湡"), groupId, new String[]{"hiredate"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("7", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86186, "鎵嬫満鍙"), groupId, new String[]{"mobile"}), new WeaFormLayout("8", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86317, "宸ュ彿"), groupId, new String[]{"jobNum"}))); +// layout.add(Lists.newArrayList(new WeaFormLayout("9", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 109332, "浜轰簨鐘舵"), groupId, new String[]{"employeeStatus"}), enableHr ? new WeaFormLayout("10", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 106277, "韬唤璇佸彿鐮"), groupId, new String[]{"idNo"}) : new WeaFormLayout("10", " ", new String[]{"empty"}))); +// +// layout.forEach(ll-> ll.forEach(wl-> wl.setLabelSpan(8))); +// // 鎺т欢鏁版嵁 +// Map data = baseInfoForm.getData(); +// data.put("username", employee.getUsername()); +// data.put("taxAgent", taxAgent); +// data.put("declareMonth", declareMonth == null ? "" : declareMonth + ""); +// data.put("department", employee.getDepartment() == null ? "" : employee.getDepartment().getName()); +// data.put("position", employee.getPosition() == null ? "" : employee.getPosition().getName()); +// data.put("hiredate", SalaryDateUtil.getFormatLocalDate(employee.getHiredate())); +// data.put("mobile", employee.getMobile()); +// data.put("jobNum", employee.getJobNum()); +// data.put("idNo", idNo); +// data.put("employeeStatus", employee.getPersonnelStatus()); +// baseInfoForm.setData(data); +// baseInfoForm.setGroups(Collections.singletonList(new WeaFormGroup(groupId, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86124, "鍩虹淇℃伅")))); +// +// return baseInfoForm; +// } +// +// +// public static AddUpSituationFormDTO po2AddUpSituationFormDTO(AddUpSituationPO situationPO) { +// return AddUpSituationFormDTO.builder() +// .addUpAdvanceTax(situationPO.getAddUpAdvanceTax()) +// .addUpTaxableIncome(situationPO.getAddUpTaxableIncome()) +// .addUpAllowedDonation(situationPO.getAddUpAllowedDonation()) +// .addUpAccumulationFundTotal(situationPO.getAddUpAccumulationFundTotal()) +// .addUpIncome(situationPO.getAddUpIncome()) +// .addUpSubtraction(situationPO.getAddUpSubtraction()) +// .addUpOtherDeduction(situationPO.getAddUpOtherDeduction()) +// .addUpTaxSavings(situationPO.getAddUpTaxSavings()) +// .addUpTaxExemptIncome(situationPO.getAddUpTaxExemptIncome()) +// .addUpEnterpriseAndOther(situationPO.getAddUpEnterpriseAndOther()) +// .addUpSocialSecurityTotal(situationPO.getAddUpSocialSecurityTotal()) +// .id(situationPO.getId()) +// .taxYearMonth(situationPO.getTaxYearMonth()) +// .taxAgent(situationPO.getTaxAgentId()) +// .employeeType(EmployeeTypeEnum.parseByValue(situationPO.getEmployeeType()).toString()) +// .build(); +// } + + public static Map getApiBaseQueryParams(TaxAgentTaxReturnPO returnPO, String taxAgentName, String taxMonth) { + Map requestParam = new HashMap<>(32); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentName); + requestParam.put("nsrsbh", returnPO.getTaxCode()); + requestParam.put("areaid", returnPO.getAreaCode()); + requestParam.put("skssq", taxMonth); + requestParam.put("sfrysb", SalaryOnOffEnum.OFF.getValue()); + requestParam.put("mmlx", returnPO.getPasswordType()); + requestParam.put("jmsbmm", 1); + requestParam.put("jmsmmm", 1); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + requestParam.computeIfAbsent("smzh", e -> realNamePwd ? returnPO.getRealAccount() : null); + requestParam.computeIfAbsent("smmm", e -> realNamePwd ? returnPO.getPwd() : null); + requestParam.computeIfAbsent("sbmm", e -> realNamePwd ? null : returnPO.getPwd()); + requestParam.computeIfAbsent("djxhid", e -> StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + requestParam.computeIfAbsent("bmbh", e -> StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + requestParam.computeIfAbsent("bmmc", e -> StringUtils.isNotEmpty(returnPO.getDepartmentName()) ? returnPO.getDepartmentName() : null); + 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.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(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 == null ? 0L : 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()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(NumberUtils.INTEGER_ZERO) +// .tenantKey(currentTenantKey) +// .dataSource(EnumAddUpDeductionDataSource.MANUAL.getValue()) +// .lastUpdateTime(LocalDateTime.now()) +// .declareMonth(saveParam.getDeclareMonth().atDay(1)) +// .taxAgentId(saveParam.getTaxAgentId()) +// .employeeId(saveParam.getEmployeeId()) +// .addUpChildEducation(saveParam.getAddUpChildEducation()) +// .addUpInfantCare(saveParam.getAddUpInfantCare()) +// .addUpHousingRent(saveParam.getAddUpHousingRent()) +// .addUpIllnessMedical(saveParam.getAddUpIllnessMedical()) +// .addUpSupportElderly(saveParam.getAddUpSupportElderly()) +// .addUpHousingLoanInterest(saveParam.getAddUpHousingLoanInterest()) +// .addUpContinuingEducation(saveParam.getAddUpContinuingEducation()) +// .build(); +// } +// +// public static OtherDeductionPO buildOtherDeductionPO(OtherDeductionSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { +// return OtherDeductionPO.builder() +// .id(IdGenerator.generate()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .deleteType(NumberUtils.INTEGER_ZERO) +// .tenantKey(currentTenantKey) +// .declareMonth(saveParam.getDeclareMonth().atDay(1)) +// .taxAgentId(saveParam.getTaxAgentId()) +// .employeeId(saveParam.getEmployeeId()) +// .businessHealthyInsurance(saveParam.getBusinessHealthyInsurance()) +// .taxDelayEndowmentInsurance(saveParam.getTaxDelayEndowmentInsurance()) +// .otherDeduction(saveParam.getOtherDeduction()) +// .deductionAllowedDonation(saveParam.getDeductionAllowedDonation()) +// .build(); // } } 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/dto/AddUpSituationDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java index e4aac1565..0a743b876 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java @@ -26,7 +26,6 @@ import java.util.Set; public class AddUpSituationDTO { //涓婚敭id @JsonSerialize(using = ToStringSerializer.class) - @SalaryTableColumn(column = "id", display = false) private Long id; //鍛樺伐id @@ -39,7 +38,6 @@ public class AddUpSituationDTO { private Integer month; //濮撳悕 - @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "username") @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") @ExcelProperty(index = 0) @I18n @@ -49,7 +47,6 @@ public class AddUpSituationDTO { // private String taxYearMonth; //涓◣鎵g即涔夊姟浜 - @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") @ExcelProperty(index = 1) private String taxAgentName; @@ -60,163 +57,155 @@ public class AddUpSituationDTO { private Long taxAgentId; //閮ㄩ棬 - @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") @ExcelProperty(index = 2) @I18n private String departmentName; //鎵嬫満鍙 - @SalaryTableColumn(text = "鎵嬫満鍙", width = "10%", column = "mobile") @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") @ExcelProperty(index = 3) private String mobile; //宸ュ彿 - @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") @ExcelProperty(index = 4) private String jobNum; //璇佷欢鍙风爜 - @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "idNo") @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") @ExcelProperty(index = 5) private String idNo; //鍏ヨ亴鏃ユ湡 - @SalaryTableColumn(text = "鍏ヨ亴鏃ユ湡", width = "10%", column = "hiredate") @TableTitle(title = "鍏ヨ亴鏃ユ湡", dataIndex = "hiredate", key = "hiredate") @ExcelProperty(index = 6) private String hiredate; //绱鏀跺叆棰 - @SalaryTableColumn(text = "绱鏀跺叆棰", width = "10%", column = "addUpIncome") @TableTitle(title = "绱鏀跺叆棰", dataIndex = "addUpIncome", key = "addUpIncome") @ExcelProperty(index = 7) @Encrypt private String addUpIncome; //绱鍑忛櫎璐圭敤 - @SalaryTableColumn(text = "绱鍑忛櫎璐圭敤", width = "10%", column = "addUpSubtraction") @TableTitle(title = "绱鍑忛櫎璐圭敤", dataIndex = "addUpSubtraction", key = "addUpSubtraction") @ExcelProperty(index = 8) @Encrypt private String addUpSubtraction; //绱绀句繚涓汉鍚堣 - @SalaryTableColumn(text = "绱绀句繚涓汉鍚堣", width = "10%", column = "addUpSocialSecurityTotal") @TableTitle(title = "绱绀句繚涓汉鍚堣", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") @ExcelProperty(index = 9) @Encrypt private String addUpSocialSecurityTotal; //绱鍏Н閲戜釜浜哄悎璁 - @SalaryTableColumn(text = "绱鍏Н閲戜釜浜哄悎璁", width = "10%", column = "addUpAccumulationFundTotal") @TableTitle(title = "绱鍏Н閲戜釜浜哄悎璁", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") @ExcelProperty(index = 10) @Encrypt private String addUpAccumulationFundTotal; //绱瀛愬コ鏁欒偛 - @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "addUpChildEducation") - @TableTitle(title = "绱瀛愬コ鏁欒偛", dataIndex = "addUpChildEducation", key = "addUpChildEducation") - @ExcelProperty(index = 11) @Encrypt + @Deprecated private String addUpChildEducation; //绱缁х画鏁欒偛 - @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "addUpContinuingEducation") - @TableTitle(title = "绱缁х画鏁欒偛", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") - @ExcelProperty(index = 12) @Encrypt + @Deprecated private String addUpContinuingEducation; //绱浣忔埧璐锋鍒╂伅 - @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "addUpHousingLoanInterest") - @TableTitle(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") - @ExcelProperty(index = 13) @Encrypt + @Deprecated private String addUpHousingLoanInterest; //绱浣忔埧绉熼噾 - @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "addUpHousingRent") - @TableTitle(title = "绱浣忔埧绉熼噾", dataIndex = "addUpHousingRent", key = "addUpHousingRent") - @ExcelProperty(index = 14) @Encrypt + @Deprecated private String addUpHousingRent; //绱璧″吇鑰佷汉 - @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "addUpSupportElderly") - @TableTitle(title = "绱璧″吇鑰佷汉", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") - @ExcelProperty(index = 15) @Encrypt + @Deprecated private String addUpSupportElderly; //绱澶х梾鍖荤枟 - @SalaryTableColumn(text = "绱澶х梾鍖荤枟", width = "10%", column = "addUpIllnessMedical") - @TableTitle(title = "绱澶х梾鍖荤枟", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") - @ExcelProperty(index = 16) @Encrypt + @Deprecated private String addUpIllnessMedical; //绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒 - @SalaryTableColumn(text = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", width = "10%", column = "addUpEnterpriseAndOther") @TableTitle(title = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", dataIndex = "addUpEnterpriseAndOther", key = "addUpEnterpriseAndOther") - @ExcelProperty(index = 17) + @ExcelProperty(index = 11) @Encrypt private String addUpEnterpriseAndOther; //绱鍏朵粬鎵i櫎 - @SalaryTableColumn(text = "绱鍏朵粬鎵i櫎", width = "10%", column = "addUpOtherDeduction") - @TableTitle(title = "绱鍏朵粬鎵i櫎", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") - @ExcelProperty(index = 18) + @TableTitle(title = "绱鍏朵粬鍏嶇◣鎵i櫎", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + @ExcelProperty(index = 12) @Encrypt private String addUpOtherDeduction; //绱鍏嶇◣鏀跺叆 - @SalaryTableColumn(text = "绱鍏嶇◣鏀跺叆", width = "10%", column = "addUpTaxExemptIncome") @TableTitle(title = "绱鍏嶇◣鏀跺叆", dataIndex = "addUpTaxExemptIncome", key = "addUpTaxExemptIncome") - @ExcelProperty(index = 19) + @ExcelProperty(index = 13) @Encrypt private String addUpTaxExemptIncome; //绱鍑嗕簣鎵i櫎鐨勬崘璧犻 - @SalaryTableColumn(text = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "addUpAllowedDonation") @TableTitle(title = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") - @ExcelProperty(index = 20) + @ExcelProperty(index = 14) @Encrypt private String addUpAllowedDonation; //绱鍑忓厤绋庨 - @SalaryTableColumn(text = "绱鍑忓厤绋庨", width = "10%", column = "addUpTaxSavings") @TableTitle(title = "绱鍑忓厤绋庨", dataIndex = "addUpTaxSavings", key = "addUpTaxSavings") - @ExcelProperty(index = 21) + @ExcelProperty(index = 15) @Encrypt private String addUpTaxSavings; //绱宸查鎵i缂寸◣棰 - @SalaryTableColumn(text = "绱宸查鎵i缂寸◣棰", width = "10%", column = "addUpAdvanceTax") @TableTitle(title = "绱宸查鎵i缂寸◣棰", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") - @ExcelProperty(index = 22) + @ExcelProperty(index = 16) @Encrypt private String addUpAdvanceTax; //绱濠村辜鍎跨収鎶 - @ExcelProperty(index = 23) - @SalaryTableColumn(text = "绱濠村辜鍎跨収鎶", width = "10%", column = "addUpInfantCare") - @TableTitle(title = "绱濠村辜鍎跨収鎶", dataIndex = "addUpInfantCare", key = "addUpInfantCare") @Encrypt + @Deprecated private String addUpInfantCare; //绱涓汉鍏昏侀噾 - @ExcelProperty(index = 24) - @SalaryTableColumn(text = "绱涓汉鍏昏侀噾", width = "10%", column = "addUpPrivatePension") - @TableTitle(title = "绱涓汉鍏昏侀噾", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") @Encrypt + @Deprecated private String addUpPrivatePension; - @SalaryTableColumn(text = "鎿嶄綔", width = "20%", column = "operate") + /** + * 瀹為檯绱宸查鎵i缂寸◣棰 + */ + @ExcelProperty(index = 17) + @TableTitle(title = "瀹為檯绱宸查鎵i缂寸◣棰", dataIndex = "actualAddUpAdvanceTax", key = "actualAddUpAdvanceTax") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 涓◣璋冨樊 + */ + @ExcelProperty(index = 18) + @TableTitle(title = "涓◣璋冨樊", dataIndex = "taxAdjustment", key = "taxAdjustment") + @Encrypt + private String taxAdjustment; + + /** + * 绱搴旂撼绋庢墍寰楅 + */ + @ExcelProperty(index = 19) + @TableTitle(title = "绱搴旂撼绋庢墍寰楅", dataIndex = "addUpTaxableIncome", key = "addUpTaxableIncome") + @Encrypt + private String addUpTaxableIncome; + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") private Set opts; } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java index 5a9686b89..6cc636f6f 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java @@ -67,111 +67,128 @@ public class AddUpSituationRecordDTO { @ExcelProperty(index = 5) private String jobNum; - @SalaryTableColumn(text = "绱鏀跺叆棰", width = "10%", column = "addUpIncome") + //绱鏀跺叆棰 @TableTitle(title = "绱鏀跺叆棰", dataIndex = "addUpIncome", key = "addUpIncome") - @ExcelProperty(index = 6) + @ExcelProperty(index = 7) @Encrypt private String addUpIncome; - @SalaryTableColumn(text = "绱鍑忛櫎璐圭敤", width = "10%", column = "addUpSubtraction") + //绱鍑忛櫎璐圭敤 @TableTitle(title = "绱鍑忛櫎璐圭敤", dataIndex = "addUpSubtraction", key = "addUpSubtraction") - @ExcelProperty(index = 7) + @ExcelProperty(index = 8) @Encrypt private String addUpSubtraction; - @SalaryTableColumn(text = "绱绀句繚涓汉鍚堣", width = "10%", column = "addUpSocialSecurityTotal") + //绱绀句繚涓汉鍚堣 @TableTitle(title = "绱绀句繚涓汉鍚堣", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @Encrypt private String addUpSocialSecurityTotal; - @SalaryTableColumn(text = "绱鍏Н閲戜釜浜哄悎璁", width = "10%", column = "addUpAccumulationFundTotal") + //绱鍏Н閲戜釜浜哄悎璁 @TableTitle(title = "绱鍏Н閲戜釜浜哄悎璁", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") - @ExcelProperty(index = 9) + @ExcelProperty(index = 10) @Encrypt private String addUpAccumulationFundTotal; - @ExcelProperty(index = 10) - @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "addUpChildEducation") - @TableTitle(title = "绱瀛愬コ鏁欒偛", dataIndex = "addUpChildEducation", key = "addUpChildEducation") + //绱瀛愬コ鏁欒偛 @Encrypt + @Deprecated private String addUpChildEducation; - @ExcelProperty(index = 11) - @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "addUpContinuingEducation") - @TableTitle(title = "绱缁х画鏁欒偛", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") + //绱缁х画鏁欒偛 @Encrypt + @Deprecated private String addUpContinuingEducation; - @ExcelProperty(index = 12) - @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "addUpHousingLoanInterest") - @TableTitle(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") + //绱浣忔埧璐锋鍒╂伅 @Encrypt + @Deprecated private String addUpHousingLoanInterest; - @ExcelProperty(index = 13) - @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "addUpHousingRent") - @TableTitle(title = "绱浣忔埧绉熼噾", dataIndex = "addUpHousingRent", key = "addUpHousingRent") + //绱浣忔埧绉熼噾 @Encrypt + @Deprecated private String addUpHousingRent; - @ExcelProperty(index = 14) - @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "addUpSupportElderly") - @TableTitle(title = "绱璧″吇鑰佷汉", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") + //绱璧″吇鑰佷汉 @Encrypt + @Deprecated private String addUpSupportElderly; - @ExcelProperty(index = 15) - @SalaryTableColumn(text = "绱澶х梾鍖荤枟", width = "10%", column = "addUpIllnessMedical") - @TableTitle(title = "绱澶х梾鍖荤枟", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") + //绱澶х梾鍖荤枟 @Encrypt + @Deprecated private String addUpIllnessMedical; - @ExcelProperty(index = 16) - @SalaryTableColumn(text = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", width = "10%", column = "addUpEnterpriseAndOther") + //绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒 @TableTitle(title = "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", dataIndex = "addUpEnterpriseAndOther", key = "addUpEnterpriseAndOther") + @ExcelProperty(index = 11) @Encrypt private String addUpEnterpriseAndOther; - @ExcelProperty(index = 17) - @SalaryTableColumn(text = "绱鍏朵粬鎵i櫎", width = "10%", column = "addUpOtherDeduction") - @TableTitle(title = "绱鍏朵粬鎵i櫎", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + //绱鍏朵粬鎵i櫎 + @TableTitle(title = "绱鍏朵粬鍏嶇◣鎵i櫎", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + @ExcelProperty(index = 12) @Encrypt private String addUpOtherDeduction; - @ExcelProperty(index = 18) - @SalaryTableColumn(text = "绱鍏嶇◣鏀跺叆", width = "10%", column = "addUpTaxExemptIncome") + //绱鍏嶇◣鏀跺叆 @TableTitle(title = "绱鍏嶇◣鏀跺叆", dataIndex = "addUpTaxExemptIncome", key = "addUpTaxExemptIncome") + @ExcelProperty(index = 13) @Encrypt private String addUpTaxExemptIncome; - @ExcelProperty(index = 19) - @SalaryTableColumn(text = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "addUpAllowedDonation") + //绱鍑嗕簣鎵i櫎鐨勬崘璧犻 @TableTitle(title = "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") + @ExcelProperty(index = 14) @Encrypt private String addUpAllowedDonation; - @ExcelProperty(index = 20) - @SalaryTableColumn(text = "绱鍑忓厤绋庨", width = "10%", column = "addUpTaxSavings") + //绱鍑忓厤绋庨 @TableTitle(title = "绱鍑忓厤绋庨", dataIndex = "addUpTaxSavings", key = "addUpTaxSavings") + @ExcelProperty(index = 15) @Encrypt private String addUpTaxSavings; - @ExcelProperty(index = 21) - @SalaryTableColumn(text = "绱宸查鎵i缂寸◣棰", width = "10%", column = "addUpAdvanceTax") + //绱宸查鎵i缂寸◣棰 @TableTitle(title = "绱宸查鎵i缂寸◣棰", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") + @ExcelProperty(index = 16) @Encrypt private String addUpAdvanceTax; - @ExcelProperty(index = 22) - @SalaryTableColumn(text = "绱濠村辜鍎跨収鎶", width = "10%", column = "addUpInfantCare") - @TableTitle(title = "绱濠村辜鍎跨収鎶", dataIndex = "addUpInfantCare", key = "addUpInfantCare") + //绱濠村辜鍎跨収鎶 @Encrypt + @Deprecated private String addUpInfantCare; - @ExcelProperty(index = 23) - @SalaryTableColumn(text = "绱涓汉鍏昏侀噾", width = "10%", column = "addUpPrivatePension") - @TableTitle(title = "绱涓汉鍏昏侀噾", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") + //绱涓汉鍏昏侀噾 @Encrypt + @Deprecated private String addUpPrivatePension; + + /** + * 瀹為檯绱宸查鎵i缂寸◣棰 + */ + @ExcelProperty(index = 17) + @TableTitle(title = "瀹為檯绱宸查鎵i缂寸◣棰", dataIndex = "actualAddUpAdvanceTax", key = "actualAddUpAdvanceTax") + @Encrypt + private String actualAddUpAdvanceTax; + + /** + * 涓◣璋冨樊 + */ + @ExcelProperty(index = 18) + @TableTitle(title = "涓◣璋冨樊", dataIndex = "taxAdjustment", key = "taxAdjustment") + @Encrypt + private String taxAdjustment; + + /** + * 绱搴旂撼绋庢墍寰楅 + */ + @ExcelProperty(index = 19) + @TableTitle(title = "绱搴旂撼绋庢墍寰楅", dataIndex = "addUpTaxableIncome", key = "addUpTaxableIncome") + @Encrypt + private String addUpTaxableIncome; + } diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java new file mode 100644 index 000000000..dc2ec8f44 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -0,0 +1,109 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍑忓厤绋庨 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @ExcelProperty(index = 5) + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + + @ExcelProperty(index = 7) + @TableTitle(title = "鍑忓厤浜嬮」", dataIndex = "derateItem", key = "derateItem") + private String derateItem; + + @ExcelProperty(index = 8) + @TableTitle(title = "鍑忓厤鎬ц川", dataIndex = "derateProperty", key = "derateProperty") + @ElogTransform(name = "鍑忓厤鎬ц川") + private String derateProperty; + + @ExcelProperty(index = 9) + @TableTitle(title = "鍑忓厤閲戦", dataIndex = "derateAmount", key = "derateAmount") + @ElogTransform(name = "鍑忓厤閲戦") + private String derateAmount; + + + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java new file mode 100644 index 000000000..1a9919d01 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -0,0 +1,117 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 绋庡欢鍏昏佷繚闄 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class EndowmentInsuranceListDTO { + + private Long id; + + private Long mainId; + + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @ExcelProperty(index = 5) + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) + @TableTitle(title = "鐢虫姤鎵i櫎鏈堜唤", dataIndex = "deductionMonth", key = "deductionMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date deductionMonth; + + @ExcelProperty(index = 8) + @TableTitle(title = "绋庡欢鍏昏佽处鎴风紪鍙", dataIndex = "accountNumber", key = "accountNumber") + private String accountNumber; + + @ExcelProperty(index = 9) + @TableTitle(title = "鎶ョ◣鏍¢獙鐮", dataIndex = "checkCode", key = "checkCode") + private String checkCode; + + @ExcelProperty(index = 10) + @TableTitle(title = "骞村害淇濊垂", dataIndex = "yearPremium", key = "yearPremium") + private String yearPremium; + + @ExcelProperty(index = 11) + @TableTitle(title = "鏈堝害淇濊垂", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 12) + @TableTitle(title = "鏈湡鎵i櫎閲戦", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java new file mode 100644 index 000000000..d6ae1ada7 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java @@ -0,0 +1,107 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.Encrypt; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏嶇◣鏀跺叆 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FreeIncomeListDTO { + + private Long id; + + private Long mainId; + + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @ExcelProperty(index = 5) + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) + @TableTitle(title = "鍏嶇◣浜嬮」", dataIndex = "freeItem", key = "freeItem") + private String freeItem; + + @ExcelProperty(index = 8) + @TableTitle(title = "鍏嶇◣鎬ц川", dataIndex = "freeProperty", key = "freeProperty") + private String freeProperty; + + @ExcelProperty(index = 9) + @TableTitle(title = "鍏嶇◣閲戦", dataIndex = "freeAmount", key = "freeAmount") + @Encrypt + private String freeAmount; + + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java new file mode 100644 index 000000000..a6a26aaf1 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java @@ -0,0 +1,129 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class GrantDonationListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "username") + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + //閮ㄩ棬 + @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @SalaryTableColumn(text = "鎵嬫満鍙", width = "10%", column = "mobile") + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "idNo") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + + @ExcelProperty(index = 7) + @TableTitle(title = "鍙楄禒鍗曚綅鍚嶇О", dataIndex = "recipientName", key = "recipientName") + private String recipientName; + + @ExcelProperty(index = 8) + @TableTitle(title = "鍙楄禒鍗曚綅绾崇◣浜鸿瘑鍒彿", dataIndex = "taxCode", key = "taxCode") + private String taxCode; + + @ExcelProperty(index = 9) + @TableTitle(title = "鎹愯禒鍑瘉鍙", dataIndex = "donationNumber", key = "donationNumber") + private String donationNumber; + + @ExcelProperty(index = 10) + @TableTitle(title = "鎹愯禒鏃ユ湡", dataIndex = "donateDate", key = "donateDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date donateDate; + + @ExcelProperty(index = 11) + @TableTitle(title = "鎹愯禒閲戦", dataIndex = "donateAmount", key = "donateAmount") + private String donateAmount; + + @ExcelProperty(index = 12) + @TableTitle(title = "鎵i櫎姣斾緥", dataIndex = "deductionProportion", key = "deductionProportion") + private String deductionProportion; + + @ExcelProperty(index = 13) + @TableTitle(title = "瀹為檯鎵i櫎閲戦", dataIndex = "actualDeduction", key = "actualDeduction") + private String actualDeduction; + + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java new file mode 100644 index 000000000..6f2393a9e --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java @@ -0,0 +1,115 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍟嗕笟鍋ュ悍淇濋櫓 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HealthInsuranceListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "idNo") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) + @TableTitle(title = "绋庝紭璇嗗埆鐮", dataIndex = "identificationNumber", key = "identificationNumber") + private String identificationNumber; + + @ExcelProperty(index = 8) + @TableTitle(title = "淇濆崟鐢熸晥鏃ユ湡", dataIndex = "effectiveDate", key = "effectiveDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date effectiveDate; + + @ExcelProperty(index = 9) + @TableTitle(title = "骞村害淇濊垂", dataIndex = "yearPremium", key = "yearPremium") + private String yearPremium; + + @ExcelProperty(index = 10) + @TableTitle(title = "鏈堝害淇濊垂", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 11) + @TableTitle(title = "鏈湡鎵i櫎閲戦", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java index a3c68530c..641b70c16 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java @@ -86,27 +86,31 @@ public class OtherDeductionListDTO { @TableTitle(title = "鍏ヨ亴鏃ユ湡", dataIndex = "hiredate", key = "hiredate") private String hiredate; - //鍟嗕笟鍋ュ悍淇濋櫓 + /** + * 鍏嶇◣鏀跺叆 + */ @ExcelProperty(index = 7) + @SalaryTableColumn(text = "鍏嶇◣鏀跺叆", width = "10%", column = "freeIncome") + @TableTitle(title = "鍏嶇◣鏀跺叆", dataIndex = "freeIncome", key = "freeIncome") + @Encrypt + private String freeIncome; + + + + //鍟嗕笟鍋ュ悍淇濋櫓 + @ExcelProperty(index = 8) @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") @Encrypt private String businessHealthyInsurance; //绋庡欢鍏昏佷繚闄 - @ExcelProperty(index = 8) + @ExcelProperty(index = 9) @SalaryTableColumn(text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "taxDelayEndowmentInsurance") @TableTitle(title = "绋庡欢鍏昏佷繚闄", dataIndex = "taxDelayEndowmentInsurance", key = "taxDelayEndowmentInsurance") @Encrypt private String taxDelayEndowmentInsurance; - //鍏朵粬 - @ExcelProperty(index = 9) - @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "otherDeduction") - @TableTitle(title = "鍏朵粬", dataIndex = "otherDeduction", key = "otherDeduction") - @Encrypt - private String otherDeduction; - //鍑嗕簣鎵i櫎鐨勬崘璧犻 @ExcelProperty(index = 10) @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "deductionAllowedDonation") @@ -114,7 +118,23 @@ public class OtherDeductionListDTO { @Encrypt private String deductionAllowedDonation; + /** + * 鍑忓厤绋庨 + */ @ExcelProperty(index = 11) + @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "derateDeduction") + @TableTitle(title = "鍑忓厤绋庨", dataIndex = "derateDeduction", key = "derateDeduction") + @Encrypt + private String derateDeduction; + + //鍏朵粬 + @ExcelProperty(index = 12) + @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "otherDeduction") + @TableTitle(title = "鍏朵粬", dataIndex = "otherDeduction", key = "otherDeduction") + @Encrypt + private String otherDeduction; + + @ExcelProperty(index = 13) @SalaryTableColumn(text = "涓汉鍏昏侀噾", width = "10%", column = "privatePension") @TableTitle(title = "涓汉鍏昏侀噾", dataIndex = "privatePension", key = "privatePension") @Encrypt diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java index 5cdbec166..7f5290520 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionRecordDTO.java @@ -47,6 +47,7 @@ public class OtherDeductionRecordDTO { @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") private String taxAgentName; + /** * 涓◣鎵g即涔夊姟浜篿d */ @@ -70,6 +71,18 @@ public class OtherDeductionRecordDTO { @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") private String jobNum; + //鍏嶇◣鏀跺叆 + @SalaryTableColumn(text = "鍏嶇◣鏀跺叆", width = "10%", column = "freeIncome") + @TableTitle(title = "鍏嶇◣鏀跺叆", dataIndex = "freeIncome", key = "freeIncome") + @Encrypt + private String freeIncome; + + //鍑忓厤绋庨 + @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "derateDeduction") + @TableTitle(title = "鍑忓厤绋庨", dataIndex = "derateDeduction", key = "derateDeduction") + @Encrypt + private String derateDeduction; + //鍟嗕笟鍋ュ悍淇濋櫓 @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java new file mode 100644 index 000000000..216b5ab7a --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -0,0 +1,102 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "idNo") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + @ExcelProperty(index = 7) + @TableTitle(title = "鍑忓厤绋庨", dataIndex = "otherDeduction", key = "otherDeduction") + private String otherDeduction; + + @ExcelProperty(index = 8) + @TableTitle(title = "澶囨敞", dataIndex = "remark", key = "remark") + private String remark; + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java new file mode 100644 index 000000000..eafeae03e --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/PersonalPensionListDTO.java @@ -0,0 +1,138 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.util.excel.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension +//鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾 +public class PersonalPensionListDTO { + + private Long id; + + private Long mainId; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "绋庢鎵灞炴湡", dataIndex = "taxYearMonth", key = "taxYearMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxYearMonth; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //閮ㄩ棬 + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //璇佷欢鍙风爜 + @ExcelProperty(index = 5) + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "idNo", key = "idNo") + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategoryName", key = "incomeCategoryName") + private String incomeCategoryName; + private Integer incomeCategory; + + + //缂磋垂鏈堝害 + private Date payMonth; + + //鍑瘉绫诲埆 + private Integer voucherType; + + //鍑瘉绫诲埆鍚嶇О + @ExcelProperty(index = 7) + @TableTitle(title = "鍑瘉绫诲瀷", dataIndex = "voucherTypeName", key = "voucherTypeName") + private String voucherTypeName; + + //鍑瘉缂栫爜 + @ExcelProperty(index = 8) + @TableTitle(title = "鍑瘉缂栫爜", dataIndex = "voucherNo", key = "voucherNo") + private String voucherNo; + + //缂磋垂閲戦 + @ExcelProperty(index = 9) + @TableTitle(title = "缂磋垂閲戦", dataIndex = "payAmount", key = "payAmount") + private String payAmount; + + //褰掓。鐘舵 0鏈綊妗 1宸插綊妗 + private Integer fileStatus; + + /** + * @see EnumDeductionDataSource + */ + //鏁版嵁鏉ユ簮 + private Integer dataSource; + + //閲囬泦鏉ユ簮 + private String collectSource; + + //鍒涘缓鏃堕棿 + private Date createTime; + + //鏇存柊鏃堕棿 + private Date updateTime; + + //鍒涘缓浜 + private Long creator; + + + @TableTitle(title = "鎿嶄綔", dataIndex = "operate", key = "operate") + private String operate; + +} 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..e09c0a7e1 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AddUpDeductionMonthTaxAgentParam.java @@ -0,0 +1,30 @@ +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; +import java.util.List; + +/** + * 鏁版嵁閲囬泦-绱涓撻」闄勫姞鏈堜唤+鎵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; + + @ApiModelProperty("涓◣鎵g即涔夊姟浜虹殑涓婚敭id") + private List taxAgentIds; +} 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/param/AddUpSituationParam.java b/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java index d50184b2f..2fc47acd9 100644 --- a/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java +++ b/src/com/engine/salary/entity/datacollection/param/AddUpSituationParam.java @@ -98,4 +98,13 @@ public class AddUpSituationParam { //绱涓汉鍏昏侀噾 private String addUpPrivatePension; + //瀹為檯绱宸查鎵i缂寸◣棰 + private String actualAddUpAdvanceTax; + + //涓◣璋冨樊 + private String taxAdjustment; + + //绱搴旂撼绋庢墍寰楅 + private String addUpTaxableIncome; + } diff --git a/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java new file mode 100644 index 000000000..196da93c3 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/DerateDeductionSaveParam.java @@ -0,0 +1,44 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鍑忓厤绋庨 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_derate_deduction +//鍏朵粬鍏嶇◣鎵i櫎-鍑忓厤绋庨 +public class DerateDeductionSaveParam { + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + //鍑忓厤浜嬮」 + private String derateItem; + + //鍑忓厤鎬ц川 + private String derateProperty; + + //鍑忓厤閲戦 + private String derateAmount; +} diff --git a/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java new file mode 100644 index 000000000..044e92295 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/EndowmentInsuranceSaveParam.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 绋庡欢鍏昏佷繚闄 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_endowment_insurance +//鍏朵粬鍏嶇◣鎵i櫎-绋庡欢鍏昏佷繚闄 +public class EndowmentInsuranceSaveParam { + + //涓婚敭 + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + + //鐢虫姤鎵i櫎鏈堜唤 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date deductionMonth; + + //绋庡欢鍏昏佽处鎴风紪鍙 + private String accountNumber; + + //鎶ョ◣鏍¢獙鐮 + private String checkCode; + + //骞村害淇濊垂 + private String yearPremium; + + //鏈堝害淇濊垂 + private String monthPremium; + + //鏈湡鎵i櫎閲戦 + private String currentDeduction; + + +} diff --git a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java new file mode 100644 index 000000000..213a3391d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java @@ -0,0 +1,44 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍏嶇◣鏀跺叆琛ㄥ崟 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_free_income +//鍏朵粬鍏嶇◣鎵i櫎-鍏嶇◣鏀跺叆 +public class FreeIncomeSaveParam { + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + //鍏嶇◣浜嬮」 + private String freeItem; + + //鍏嶇◣鎬ц川 + private String freeProperty; + + //鍏嶇◣閲戦 + private String freeAmount; +} diff --git a/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java new file mode 100644 index 000000000..47ef897ca --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/GrantDonationSaveParam.java @@ -0,0 +1,58 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍑嗕簣鎵i櫎鐨勬崘璧犻 + * + * @author chengliming + * @date 2023-06-09 15:03:45 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_grant_donation +//鍏朵粬鍏嶇◣鎵i櫎-鍑嗕簣鎵i櫎鐨勬崘璧犻 +public class GrantDonationSaveParam { + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + + //鍙楄禒鍗曚綅鍚嶇О + private String recipientName; + + //鍙楄禒鍗曚綅绾崇◣浜鸿瘑鍒彿 + private String taxCode; + + //鎹愯禒鍑瘉鍙 + private String donationNumber; + + //鎹愯禒鏃ユ湡 + private Date donateDate; + + //鎹愯禒閲戦 + private String donateAmount; + + //鎵i櫎姣斾緥 + private String deductionProportion; + + //瀹為檯鎵i櫎閲戦 + private String actualDeduction; + +} diff --git a/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java new file mode 100644 index 000000000..971fc5ccb --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/HealthInsuranceSaveParam.java @@ -0,0 +1,53 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍟嗕笟鍋ュ悍淇濋櫓 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_health_insurance +//鍏朵粬鍏嶇◣鎵i櫎-鍟嗕笟鍋ュ悍淇濋櫓琛ㄥ崟 +public class HealthInsuranceSaveParam { + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + + //绋庝紭璇嗗埆鐮 + private String identificationNumber; + + //淇濆崟鐢熸晥鏃ユ湡 + private Date effectiveDate; + + //骞村害淇濊垂 + private String yearPremium; + + //鏈堝害淇濊垂 + private String monthPremium; + + //鏈湡鎵i櫎閲戦 + private String currentDeduction; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java new file mode 100644 index 000000000..c97a0b9a7 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailDeleteParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 鍒犻櫎鍙傛暟 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionDetailDeleteParam { + + // 涓婚敭id + private List ids; + + private Long mainId; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java new file mode 100644 index 000000000..e849daaa9 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎锛岄檮琛ㄦ煡璇㈠垪琛 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionDetailQueryParam extends BaseQueryParam { + + private Long id; + + + private Long employeeId; + private Long taxAgentId; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionFreeListQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionFreeListQueryParam.java new file mode 100644 index 000000000..9b0a07212 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionFreeListQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎锛岄檮琛ㄦ煡璇㈠垪琛 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionFreeListQueryParam{ + + @DataCheck(require = true, message = "鎵g即涔夊姟浜篿d涓虹┖") + private Long taxAgentId; + + @DataCheck(require = true, message = "绋庢鎵灞炴湡涓虹┖") + private Date taxCycle; + +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java index 3ac3a98c9..509f3f7cc 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java @@ -24,8 +24,4 @@ public class OtherDeductionImportParam { //绋庢鎵灞炴湡 String declareMonth; - - //涓◣鎵g即涔夊姟浜 - String taxAgentId; - } diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java index 06311ed20..d615856f7 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionParam.java @@ -44,6 +44,16 @@ public class OtherDeductionParam { // 宸ュ彿 private String jobNum; + /** + * 鍏嶇◣鏀跺叆 + */ + private String freeIncome; + + /** + * 鍑忓厤绋庨 + */ + private String derateDeduction; + // 鍟嗕笟鍋ュ悍淇濋櫓 private String businessHealthyInsurance; diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java new file mode 100644 index 000000000..8aa1c17d9 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDerateDeductionSaveParam.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍏朵粬 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_other_derate_deduction +//鍏朵粬鍏嶇◣鎵i櫎-鍏朵粬 +public class OtherDerateDeductionSaveParam { + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + + //鍑忓厤绋庨 + private String otherDeduction; + + //澶囨敞 + private String remark; +} diff --git a/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java new file mode 100644 index 000000000..ad7ceea3f --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/PersonalPensionSaveParam.java @@ -0,0 +1,72 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension +//鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾 +public class PersonalPensionSaveParam { + + //涓婚敭id + private Long id; + + //涓昏〃鏁版嵁Id + private Long mainId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + //缂磋垂鏈堝害 + private Date payMonth; + + //鍑瘉绫诲埆 + private Integer voucherType; + + //鍑瘉绫诲埆鍚嶇О + private String voucherTypeName; + + //鍑瘉缂栫爜 + private String voucherNo; + + //缂磋垂閲戦 + private String payAmount; + + + /** + * 浜哄憳绫诲瀷 + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + /** + * 鏁版嵁鏉ユ簮 + * @see EnumDeductionDataSource + */ + private Integer dataSource; + + //閲囬泦鏉ユ簮 + private String collectSource; + +} 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/DerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java new file mode 100644 index 000000000..226f05848 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java @@ -0,0 +1,88 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍑忓厤绋庨 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鍏朵粬鍏嶇◣鎵i櫎-鍑忓厤绋庨") +//hrsa_derate_deduction +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-鍑忓厤绋庨") +public class DerateDeductionPO{ + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "鍑忓厤浜嬮」") + private String derateItem; + + @ElogTransform(name = "鍑忓厤鎬ц川") + private String derateProperty; + + @ElogTransform(name = "鍑忓厤閲戦") + private String derateAmount; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java new file mode 100644 index 000000000..6718ee753 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java @@ -0,0 +1,97 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-绋庡欢鍏昏佷繚闄 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_endowment_insurance") +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-绋庡欢鍏昏佷繚闄") +public class EndowmentInsurancePO { + + @ElogTransform(name = "涓婚敭") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳id") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜篒D") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "鐢虫姤鎵i櫎鏈堜唤") + private Date deductionMonth; + + @ElogTransform(name = "绋庡欢鍏昏佽处鎴风紪鍙") + private String accountNumber; + + @ElogTransform(name = "鎶ョ◣鏍¢獙鐮") + private String checkCode; + + @ElogTransform(name = "骞村害淇濊垂") + private String yearPremium; + + @ElogTransform(name = "鏈堝害淇濊垂") + private String monthPremium; + + @ElogTransform(name = "鏈湡鎵i櫎閲戦") + private String currentDeduction; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java new file mode 100644 index 000000000..96c39dfc6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍏嶇◣鏀跺叆琛ㄥ崟 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_free_income +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-鍏嶇◣鏀跺叆") +public class FreeIncomePO { + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + @ElogTransform(name = "鍏嶇◣浜嬮」") + private String freeItem; + + @ElogTransform(name = "鍏嶇◣鎬ц川") + private String freeProperty; + + @ElogTransform(name = "鍏嶇◣閲戦") + private String freeAmount; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java new file mode 100644 index 000000000..6cce0fb66 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java @@ -0,0 +1,98 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍑嗕簣鎵i櫎鐨勬崘璧犻 + * + * @author chengliming + * @date 2023-06-09 15:03:45 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_grant_donation") +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-鍑嗕簣鎵i櫎鐨勬崘璧犻") +public class GrantDonationPO { + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "鍙楄禒鍗曚綅鍚嶇О") + private String recipientName; + + @ElogTransform(name = "鍙楄禒鍗曚綅绾崇◣浜鸿瘑鍒彿") + private String taxCode; + + @ElogTransform(name = "鎹愯禒鍑瘉鍙") + private String donationNumber; + + @ElogTransform(name = "鎹愯禒鏃ユ湡") + private Date donateDate; + + @ElogTransform(name = "鎹愯禒閲戦") + private String donateAmount; + + @ElogTransform(name = "鎵i櫎姣斾緥") + private String deductionProportion; + + @ElogTransform(name = "瀹為檯鎵i櫎閲戦") + private String actualDeduction; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java new file mode 100644 index 000000000..7ecad5ab7 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java @@ -0,0 +1,92 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍟嗕笟鍋ュ悍淇濋櫓琛ㄥ崟 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_health_insurance") +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-鍟嗕笟鍋ュ悍淇濋櫓琛ㄥ崟") +public class HealthInsurancePO { + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "绋庝紭璇嗗埆鐮") + private String identificationNumber; + + @ElogTransform(name = "淇濆崟鐢熸晥鏃ユ湡") + private Date effectiveDate; + + @ElogTransform(name = "骞村害淇濊垂") + private String yearPremium; + + @ElogTransform(name = "鏈堝害淇濊垂") + private String monthPremium; + + @ElogTransform(name = "鏈湡鎵i櫎閲戦") + private String currentDeduction; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 033c82842..f4dabce21 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -2,6 +2,8 @@ package com.engine.salary.entity.datacollection.po; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.annotation.Auth; +import cn.hutool.core.util.NumberUtil; +import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.annotation.Encrypt; import com.engine.salary.annotation.SalaryFormulaVar; import lombok.AllArgsConstructor; @@ -27,31 +29,47 @@ public class OtherDeductionPO { /** * 涓婚敭 */ - @ElogTransform( name="涓婚敭id" ) + @ElogTransform(name = "涓婚敭id") private Long id; /** * 浜哄憳淇℃伅琛ㄧ殑涓婚敭id */ - @ElogTransform( name ="浜哄憳id") + @ElogTransform(name = "浜哄憳id") private Long employeeId; /** * 涓◣鎵g即涔夊姟浜虹殑涓婚敭id */ - @ElogTransform( name ="涓◣鎵g即涔夊姟浜篿d") + @ElogTransform(name = "涓◣鎵g即涔夊姟浜篿d") private Long taxAgentId; /** * 鐢虫姤鏈堜唤 */ - @ElogTransform( name ="绋庢鎵灞炴湡") + @ElogTransform(name = "绋庢鎵灞炴湡") private Date declareMonth; + /** + * 鍏嶇◣鏀跺叆 + */ + @ElogTransform(name = "鍏嶇◣鏀跺叆") + @SalaryFormulaVar(defaultLabel = "鍏嶇◣鏀跺叆", labelId = 91238, dataType = "number") + @Encrypt + private String freeIncome; + + /** + * 鍑忓厤绋庨 + */ + @ElogTransform(name = "鍑忓厤绋庨") + @SalaryFormulaVar(defaultLabel = "鍑忓厤绋庨", labelId = 102810, dataType = "number") + @Encrypt + private String derateDeduction; + /** * 鍟嗕笟鍋ュ悍淇濋櫓 */ - @ElogTransform( name ="鍟嗕笟鍋ュ悍淇濋櫓") + @ElogTransform(name = "鍟嗕笟鍋ュ悍淇濋櫓") @SalaryFormulaVar(defaultLabel = "鍟嗕笟鍋ュ悍淇濋櫓", labelId = 91238, dataType = "number") @Encrypt private String businessHealthyInsurance; @@ -59,15 +77,16 @@ public class OtherDeductionPO { /** * 绋庡欢鍏昏佷繚闄 */ - @ElogTransform( name ="绋庡欢鍏昏佷繚闄") + @ElogTransform(name = "绋庡欢鍏昏佷繚闄") @SalaryFormulaVar(defaultLabel = "绋庡欢鍏昏佷繚闄", labelId = 91239, dataType = "number") @Encrypt private String taxDelayEndowmentInsurance; + /** * 鍏朵粬 */ - @ElogTransform( name ="鍏朵粬") + @ElogTransform(name = "鍏朵粬") @SalaryFormulaVar(defaultLabel = "鍏朵粬", labelId = 84500, dataType = "number") @Encrypt private String otherDeduction; @@ -75,7 +94,7 @@ public class OtherDeductionPO { /** * 鍑嗕簣鎵i櫎鐨勬崘璧犻 */ - @ElogTransform( name ="鍑嗕簣鎵i櫎鐨勬崘璧犻") + @ElogTransform(name = "鍑嗕簣鎵i櫎鐨勬崘璧犻") @SalaryFormulaVar(defaultLabel = "鍑嗕簣鎵i櫎鐨勬崘璧犻", labelId = 91240, dataType = "number") @Encrypt private String deductionAllowedDonation; @@ -83,7 +102,7 @@ public class OtherDeductionPO { /** * 涓汉鍏昏侀噾 */ - @ElogTransform( name ="涓汉鍏昏侀噾") + @ElogTransform(name = "涓汉鍏昏侀噾") @SalaryFormulaVar(defaultLabel = "涓汉鍏昏侀噾", labelId = 91240, dataType = "number") @Encrypt private String privatePension; @@ -91,19 +110,19 @@ public class OtherDeductionPO { /** * 鍒涘缓鏃堕棿 */ - @ElogTransform( name ="鍒涘缓鏃堕棿") + @ElogTransform(name = "鍒涘缓鏃堕棿") private Date createTime; /** * 鏇存柊鏃堕棿 */ - @ElogTransform( name ="鏇存柊鏃堕棿") + @ElogTransform(name = "鏇存柊鏃堕棿") private Date updateTime; /** * 鍒涘缓浜 */ - @ElogTransform( name ="鍒涘缓浜篿d") + @ElogTransform(name = "鍒涘缓浜篿d") private Long creator; /** @@ -114,10 +133,73 @@ public class OtherDeductionPO { /** * 绉熸埛ID */ - @ElogTransform( name ="绉熸埛") + @ElogTransform(name = "绉熸埛") private String tenantKey; private List employeeIds; private Collection taxAgentIds; + private Integer incomeCategory; + + + private List freeIncomeList; + private List healthInsuranceList; + private List endowmentInsuranceList; + private List grantDonationList; + private List derateDeductionList; + private List otherDerateDeductionList; + private List personalPensionList; + + + public void handleList() { + freeIncome = freeIncomeList + .stream() + .map(FreeIncomePO::getFreeAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + derateDeduction = derateDeductionList + .stream() + .map(DerateDeductionPO::getDerateAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + taxDelayEndowmentInsurance = endowmentInsuranceList + .stream() + .map(EndowmentInsurancePO::getCurrentDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + deductionAllowedDonation = grantDonationList + .stream() + .map(GrantDonationPO::getActualDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + businessHealthyInsurance = healthInsuranceList + .stream() + .map(HealthInsurancePO::getCurrentDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + otherDeduction = otherDerateDeductionList + .stream() + .map(OtherDerateDeductionPO::getOtherDeduction) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + privatePension = personalPensionList + .stream() + .map(PersonalPensionPO::getPayAmount) + .filter(NumberUtil::isNumber) + .mapToDouble(Double::valueOf) + .sum() + ""; + + } } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java new file mode 100644 index 000000000..c0ff75f42 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -0,0 +1,84 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-鍏朵粬 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_other_derate_deduction +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-鍏朵粬") +public class OtherDerateDeductionPO { + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "鍑忓厤绋庨") + private String otherDeduction; + + @ElogTransform(name = "澶囨敞") + private String remark; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java new file mode 100644 index 000000000..b60bda6fd --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -0,0 +1,105 @@ +package com.engine.salary.entity.datacollection.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.EnumDeductionDataSource; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_personal_pension") +@ElogTransform(name = "鍏朵粬鍏嶇◣鎵i櫎-涓汉鍏昏侀噾") +public class PersonalPensionPO{ + + @ElogTransform(name = "涓婚敭id") + private Long id; + + @ElogTransform(name = "涓昏〃鏁版嵁Id") + private Long mainId; + + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxYearMonth; + + @ElogTransform(name = "缂磋垂鏈堝害") + private Date payMonth; + + @ElogTransform(name = "浜哄憳") + private Long employeeId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 鎵寰楅」鐩 + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + + @ElogTransform(name = "鍑瘉绫诲埆") + private Integer voucherType; + + @ElogTransform(name = "鍑瘉绫诲埆鍚嶇О") + private String voucherTypeName; + + @ElogTransform(name = "鍑瘉缂栫爜") + private String voucherNo; + + @ElogTransform(name = "缂磋垂閲戦") + private String payAmount; + + @ElogTransform(name = "褰掓。鐘舵 0鏈綊妗 1宸插綊妗") + private Integer fileStatus; + + /** + * 浜哄憳绫诲瀷 + * @see DataCollectionEmployeeTypeEnum + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + /** + * @see EnumDeductionDataSource + */ + @ElogTransform(name = "鏁版嵁鏉ユ簮") + private Integer dataSource; + + @ElogTransform(name = "閲囬泦鏉ユ簮") + private String collectSource; + + private Long ebDataId; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + @ElogTransform(name = "鍒涘缓浜", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + //涓婚敭id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java index ce5f49f8a..1fbc59823 100644 --- a/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/SpecialAddDeductionPO.java @@ -19,6 +19,7 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +//hrsa_special_add_deduction @ElogTransform( name = "涓撻」闄勫姞鎵i櫎" ) public class SpecialAddDeductionPO { @ElogTransform( name="涓婚敭" ) 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/QuerySpecialAmountFeedbackResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java new file mode 100644 index 000000000..8ac88752e --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountFeedbackResponse.java @@ -0,0 +1,142 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class QuerySpecialAmountFeedbackResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ鍙嶉缁撴灉body + */ + @Data + public static class Body { + /** + * 缁撴灉鍒楄〃 + */ + private List ryxxlb; + } + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ鍙嶉缁撴灉 + **/ + @Data + public static class Feedback { + /** + * 鍛樺伐濮撳悕 + */ + private String xm; + + /** + * 璇佷欢绫诲瀷 + */ + private String zzlx; + + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + + /** + * 浠f姤鐘舵 + */ + private String sbzt; + + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + + /** + * 绱瀛愬コ鏁欒偛鏀嚭 + */ + private BigDecimal ljznjyzc; + + /** + * 绱绉熸埧绉熼噾鏀嚭 + */ + private BigDecimal ljzfzjzc; + + /** + * 绱浣忔埧璐锋鍒╂伅鏀嚭 + */ + private BigDecimal ljzfdklxzc; + + /** + * 绱璧″吇鑰佷汉鏀嚭 + */ + private BigDecimal ljsylrzc; + + /** + * 绱缁х画鏁欒偛鏀嚭 + */ + private BigDecimal ljjxjyzc; + + /** + * 绱闈炲鍘嗙户缁暀鑲叉敮鍑 + */ + private BigDecimal ljfxljxjyzc; + + /** + * 绱瀛﹀巻缁х画鏁欒偛鏀嚭 + */ + private BigDecimal ljxljxjyzc; + + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 + */ + private BigDecimal ljyyezhzc; + + /** + * 瀛愬コ鏁欒偛鏀嚭 + */ + private BigDecimal znjyzc; + + /** + * 璧″吇鑰佷汉鏀嚭 + */ + private BigDecimal sylrzc; + + /** + * 浣忔埧璐锋鍒╂伅鏀嚭 + */ + private BigDecimal zfdklxzc; + + /** + * 浣忔埧绉熼噾鏀嚭 + */ + private BigDecimal zfzjzc; + + /** + * 缁х画鏁欒偛鏀嚭 + */ + private BigDecimal jxjyzc; + + /** + * 闈炲鍘嗙户缁暀鑲叉敮鍑 + */ + private BigDecimal fxljxjyzc; + + /** + * 3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 + */ + private BigDecimal yyezhzc; + } +} diff --git a/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java new file mode 100644 index 000000000..fc5503724 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/response/QuerySpecialAmountResponse.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.datacollection.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉 + * + * @author qiantao + * @version 1.0 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class QuerySpecialAmountResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉body + **/ + @Data + public static class Body { + /** + * 璇锋眰鏌ヨID + */ + private String requestId; + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + } +} diff --git a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java new file mode 100644 index 000000000..234ec01cd --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java @@ -0,0 +1,126 @@ +package com.engine.salary.entity.deductionamount.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 浜哄憳鎶ラ佽褰 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_deduction_amount +public class DeductionAmountDTO { + + /** + * ID + */ + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜篒D + */ + private Long taxAgentId; + + + /** + * 绋庢鎵灞炲勾搴 + */ + @TableTitle(title = "绋庢鎵灞炲勾搴", dataIndex = "year", key = "year") + private String year; + /** + * 浜哄憳id + */ + private Long employeeId; + + /** + * 濮撳悕 + */ + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + /** + * 浜哄憳绫诲瀷 + */ + private Integer employeeType; + + /** + * 宸ュ彿 + */ + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + /** + * 璇佷欢鍙风爜 + */ + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + /** + * 璇佷欢绫诲瀷 + */ + private Integer cardType; + + /** + * 鍥界睄 + */ + @TableTitle(title = "鍥界睄", dataIndex = "nationality", key = "nationality") + private String nationality; + + /** + * 鏄惁鎵i櫎 + */ + @TableTitle(title = "鏄惁鎵i櫎", dataIndex = "deductFlag", key = "deductFlag") + private Integer deductFlag; + + /** + * 鎶ラ佺姸鎬 + */ + @TableTitle(title = "鎶ラ佺姸鎬", dataIndex = "declareStatusName", key = "declareStatusName") + private String declareStatusName; + private Integer declareStatus; + + private String declareErrorMsg; + + + /** + * 鏄惁鎴愬姛鎶ラ佽繃 + */ + private Integer successfullyDeclared; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 淇敼鏃堕棿 + */ + private Date updateTime; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 绉熸埛KEY + */ + private String tenantKey; + + //涓婚敭id闆嗗悎 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java new file mode 100644 index 000000000..0deb8966f --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountAddParam { + /** + * ID + */ + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 绋庢鎵灞炲勾搴 + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; + + /** + * 鎶ラ佷汉鍛榠ds + */ + private List employeeDeclareIds; +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java new file mode 100644 index 000000000..e5fe93593 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountConfirmParam { + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炲勾搴 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java new file mode 100644 index 000000000..922884a44 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.deductionamount.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountDeleteParam { + /** + * ID + */ + private List ids; +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java new file mode 100644 index 000000000..f0e2a2412 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountEditParam { + /** + * ID + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛宨d涓嶈兘涓虹┖") + private Long id; + + @DataCheck(require = true, message = "璇烽夋嫨鏄惁鎵i櫎") + private Integer deductFlag; +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java new file mode 100644 index 000000000..111c7011e --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountFeedBackParam { + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炲勾搴 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java new file mode 100644 index 000000000..0ce30402b --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountListParam extends BaseQueryParam { + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 绋庢鎵灞炲勾搴 + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java new file mode 100644 index 000000000..cd5c8f2ee --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountOnlineQueryParam { + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炲勾搴 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java new file mode 100644 index 000000000..d6b87fb23 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.deductionamount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鎵i櫎鍚嶅崟鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeductionAmountQueryParam { + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炲勾搴 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炲勾搴﹀弬鏁版牸寮忛敊璇") + private String year; + +} diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java new file mode 100644 index 000000000..24bd438a2 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java @@ -0,0 +1,140 @@ +package com.engine.salary.entity.deductionamount.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鎵i櫎鍚嶅崟 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_deduction_amount +public class DeductionAmountPO { + + /** + * ID + */ + @ElogTransform(name = "ID") + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜篒D + */ + @ElogTransform(name = "涓◣鎵g即涔夊姟浜篒D") + private Long taxAgentId; + + + /** + * 绋庢鎵灞炲勾搴 + */ + @ElogTransform(name = "绋庢鎵灞炲勾搴") + private String year; + /** + * 浜哄憳id + */ + @ElogTransform(name = "浜哄憳id") + private Long employeeId; + + /** + * 濮撳悕 + */ + @ElogTransform(name = "濮撳悕") + private String employeeName; + + /** + * 浜哄憳绫诲瀷 + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + /** + * 宸ュ彿 + */ + @ElogTransform(name = "宸ュ彿") + private String jobNum; + + /** + * 鍥界睄 + */ + @ElogTransform(name = "鍥界睄") + private String nationality; + + /** + * 璇佷欢鍙风爜 + */ + @ElogTransform(name = "璇佷欢鍙风爜") + private String cardNum; + + /** + * 璇佷欢绫诲瀷 + */ + @ElogTransform(name = "璇佷欢绫诲瀷") + private Integer cardType; + + /** + * 鏄惁鎵i櫎 + */ + @ElogTransform(name = "鏄惁鎵i櫎") + private Integer deductFlag; + /** + * 鏄惁鎴愬姛鎶ラ佽繃 + */ + @ElogTransform(name = "鏄惁鎴愬姛鎶ラ佽繃") + private Integer successfullyDeclared; + + /** + * 鎶ラ佺姸鎬 + */ + @ElogTransform(name = "鎶ラ佺姸鎬") + private Integer declareStatus; + + /** + * 鐢虫姤澶辫触鐨勯敊璇俊鎭 + */ + @ElogTransform(name = "澶辫触鐨勯敊璇俊鎭") + private String declareErrorMsg; + + + /** + * 鍒涘缓鏃堕棿 + */ + @ElogTransform(name = "鍒涘缓鏃堕棿") + private Date createTime; + + + /** + * 淇敼鏃堕棿 + */ + @ElogTransform(name = "淇敼鏃堕棿") + private Date updateTime; + + /** + * 鍒涘缓浜篿d + */ + @ElogTransform(name = "鍒涘缓浜篿d") + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + @ElogTransform(name = "鏄惁鍒犻櫎") + private Integer deleteType; + + /** + * 绉熸埛KEY + */ + @ElogTransform(name = "绉熸埛KEY") + private String tenantKey; + + //涓婚敭id闆嗗悎 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java new file mode 100644 index 000000000..f476627f1 --- /dev/null +++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.deductionamount.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + +/** + * 鎵e噺鎶ラ佽褰 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//"hrsa_employee_declare_record") +public class DeductionAmountRecordPO { + + /** + * 涓婚敭id + */ + private Long id; + /** + * 涓◣鎵g即涔夊姟浜 + */ + private Long taxAgentId; + /** + * 绋庢鎵灞炲勾 + */ + private String year; + /** + * 璇锋眰鐨剅equestId + */ + private String requestId; + /** + * 绉熸埛key + */ + private String tenantKey; + /** + * 鍒涘缓浜篿d + */ + private Long creator; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + private Collection ids; +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java new file mode 100644 index 000000000..1e3b7243c --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryI18nUtil; + +/** + * @author Harryxzy + * @ClassName EmployeeDeclareBO + * @date 2023/12/27 14:13 + * @description + */ +public class EmployeeDeclareBO { + + public static EmployeeDeclarePO convert2PO(EmployeeDeclareExcelDTO dto) { + if (dto == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鍙傛暟閿欒")); + } + EmployeeDeclarePO po = EmployeeDeclarePO.builder() + .jobNum(dto.getJobNum()) + .employeeName(dto.getEmployeeName()) + .cardType(dto.getCardType()) + .cardNum(dto.getCardNum()) + .nationality(dto.getNationality()) + .employmentStatus(dto.getEmploymentStatus()) + .employmentType(dto.getEmploymentType()) + .employmentFirstYear(dto.getEmploymentFirstYear()) + .mobile(dto.getMobile()) + .employmentDate(dto.getEmploymentDate()) + .dismissDate(dto.getDismissDate()) + .disability(dto.getDisability()) + .disabilityCardNo(dto.getDisabilityCardNo()) + .martyrDependents(dto.getMartyrDependents()) + .martyrDependentsCardNo(dto.getMartyrDependentsCardNo()) + .lonelyOld(dto.getLonelyOld()) + .deductExpenses(dto.getDeductExpenses()) + .entryDate(dto.getEntryDate()) + .departureDate(dto.getDepartureDate()) + .gender(dto.getGender()) + .birthplace(dto.getBirthplace()) + .birthday(dto.getBirthday()) + .taxReasons(dto.getTaxReasons()) + .build(); + return po; + } + +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java new file mode 100644 index 000000000..84cdfddff --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java @@ -0,0 +1,153 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class EmployeeDeclareList { + + /** + * 杞崲鎴愪汉鍛樻姤閫侊紙浜哄憳锛夊垪琛╠to + * + * @param employeeDeclares + * @param taxAgents + * @return + */ + public static List convert(List employeeDeclares, + List taxAgents) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + List dtoList = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); + EmployeeDeclareListDTO dto = new EmployeeDeclareListDTO() + .setId(employeeDeclare.getId()) + .setEmployeeId(employeeDeclare.getEmployeeId()) + .setEmployeeType(EmployeeTypeEnum.parseByValue(employeeDeclare.getEmployeeType())) + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setTaxAgentName(taxAgentNameMap.get(employeeDeclare.getTaxAgentId())) + .setNationality(employeeDeclare.getNationality()) + .setCardType(cardTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(cardTypeEnum.getLabelId(), cardTypeEnum.getDefaultLabel())) + .setCardNum(employeeDeclare.getCardNum()) + .setGender(genderEnum == null ? "" : genderEnum.getDefaultLabel()) + .setBirthday(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday())) + .setEmploymentStatus(employmentStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentStatusEnum.getLabelId(), employmentStatusEnum.getDefaultLabel())) + .setMobile(employeeDeclare.getMobile()) + .setEmploymentType(employmentTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(employmentTypeEnum.getLabelId(), employmentTypeEnum.getDefaultLabel())) + .setEmploymentDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate())) + .setDismissDate(SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate())) + .setDeclareStatus(declareStatusEnum) + .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())) + .setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg()); + dtoList.add(dto); + } + return dtoList; + } + + public static List convert2FailListDTO(List employeeDeclares, + Map employeeInfoMap) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + + + List dtos = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(employeeDeclare.getEmployeeType()) == 0; + DataCollectionEmployee employee = employeeInfoMap.get(employeeDeclare.getEmployeeId() + "-" + isExtEmp); + + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + EmployeeDeclareFailListDTO dto = new EmployeeDeclareFailListDTO() + .setId(employeeDeclare.getId()) + .setEmployeeId(employeeDeclare.getEmployeeId()) + .setEmployeeType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.class)) + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setDepartmentName(employee == null ? "" : employee.getDepartmentName()) + .setCardType(cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel()) + .setCardNum(employeeDeclare.getCardNum()) + .setDeclareErrorMsg(employeeDeclare.getDeclareErrorMsg()); + dtos.add(dto); + } + return dtos; + } + + public static Map> getUpdatedField(List employeeDeclares, List originEmployeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares) || CollectionUtils.isEmpty(originEmployeeDeclares)) { + return Collections.emptyMap(); + } + Map> updatedFieldMap = Maps.newHashMap(); + Map originEmployeeDeclareMap = SalaryEntityUtil.convert2Map(originEmployeeDeclares, EmployeeDeclarePO::getEmployeeId); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + Set dataIndexSet = Sets.newHashSet(); + EmployeeDeclarePO originEmployeeDeclare = originEmployeeDeclareMap.get(employeeDeclare.getEmployeeId()); + if (originEmployeeDeclare == null) { + continue; + } + if (!Objects.equals(employeeDeclare.getEmployeeName(), originEmployeeDeclare.getEmployeeName())) { + dataIndexSet.add("employeeName"); + } + if (!Objects.equals(employeeDeclare.getJobNum(), originEmployeeDeclare.getJobNum())) { + dataIndexSet.add("jobNum"); + } + if (!Objects.equals(employeeDeclare.getCardType(), originEmployeeDeclare.getCardType())) { + dataIndexSet.add("cardType"); + } + if (!Objects.equals(employeeDeclare.getCardNum(), originEmployeeDeclare.getCardNum())) { + dataIndexSet.add("cardNum"); + } + if (!Objects.equals(employeeDeclare.getGender(), originEmployeeDeclare.getGender())) { + dataIndexSet.add("gender"); + } + if (!Objects.equals(employeeDeclare.getBirthday(), originEmployeeDeclare.getBirthday())) { + dataIndexSet.add("birthday"); + } + if (!Objects.equals(employeeDeclare.getEmploymentStatus(), originEmployeeDeclare.getEmploymentStatus())) { + dataIndexSet.add("employmentStatus"); + } + if (!Objects.equals(employeeDeclare.getMobile(), originEmployeeDeclare.getMobile())) { + dataIndexSet.add("mobile"); + } + if (!Objects.equals(employeeDeclare.getEmploymentType(), originEmployeeDeclare.getEmploymentType())) { + dataIndexSet.add("employmentType"); + } + if (!Objects.equals(employeeDeclare.getEmploymentDate(), originEmployeeDeclare.getEmploymentDate())) { + dataIndexSet.add("employmentDate"); + } + if (!Objects.equals(employeeDeclare.getDismissDate(), originEmployeeDeclare.getDismissDate())) { + dataIndexSet.add("dismissDate"); + } + updatedFieldMap.put(employeeDeclare.getEmployeeId(), dataIndexSet); + } + return updatedFieldMap; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java new file mode 100644 index 000000000..72191b404 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -0,0 +1,227 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.api.formmode.page.util.Util; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.valid.SalaryCardUtil; +import com.google.common.collect.Lists; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; + +import java.util.*; + +public class EmployeeDeclareRefresh { + + public static Result refresh(EmployeeDeclareRefreshDTO dto, Long employeeId) { + Result result = new Result(); + // 鏈湀宸叉湁鐨勯渶瑕佹姤閫佺殑浜哄憳 + Set employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); + // 钖祫妗f鐨勬暟鎹紙浠昏亴鍙楅泧浠庝笟绫诲瀷銆佽捣濮嬪彂钖棩鏈熴佹渶鍚庡彂钖棩鏈燂級 + Map salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId); + // 闈炵郴缁熶汉鍛樼殑鏁版嵁锛堜换鑱屽彈闆囦粠涓氱被鍨嬶級 + Map extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmpPO::getId); + Date now = new Date(); + // 瀵瑰凡鏈変汉鍛樺鐞嗐屼汉鍛樼姸鎬併嶃併岀鑱屾棩鏈熴嶃併屼换鑱屽彈闆囦粠涓氱被鍨嬨 + for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) { + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null + && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + if (Objects.equals(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue()) + || Objects.equals(Util.null2String(employeeDeclare.getDismissDate()), Util.null2String(salaryArchive.getPayEndDate()))) { + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setUpdateTime(now); + result.getEmployeeDeclares().add(employeeDeclare); + } + } +// if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); +// employeeDeclare.setNewEmployeeInfo(1); +// } +// ExtEmpPO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); +// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); +// employeeDeclare.setNewEmployeeInfo(1); +// } + } + // 鑷姩淇濆瓨涓婁釜鏈堟姤閫佹垚鍔熺殑浜哄憳 + for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) { + if (!employeeIds.contains(preTaxCycleEmployeeDeclare.getEmployeeId())) { + EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(preTaxCycleEmployeeDeclare, employeeDeclare); + employeeDeclare.setId(IdGenerator.generate()); + employeeDeclare.setTaxCycle(dto.getTaxCycle()); + employeeDeclare.setNewEmployeeInfo(0); + employeeDeclare.setCreateTime(now); + employeeDeclare.setUpdateTime(now); + // 瀵逛汉鍛樺鐞嗐屼汉鍛樼姸鎬併嶃併岀鑱屾棩鏈熴嶃併屼换鑱屽彈闆囦粠涓氱被鍨嬨 + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null && (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()))) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + employeeDeclare.setNewEmployeeInfo(1); + } +// if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); +// employeeDeclare.setNewEmployeeInfo(1); +// } +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId()); +// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType()); +// employeeDeclare.setNewEmployeeInfo(1); +// } + employeeIds.add(employeeDeclare.getEmployeeId()); + result.getNewEmployeeDeclares().add(employeeDeclare); + } + } + // 钖祫妗f涓柊澧炵殑闇鎶ラ佺殑浜哄憳 + for (DataCollectionEmployee hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { + if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) { + continue; + } + //鏄惁涓哄绫嶄汉鍛橈紝閫氳繃璇佷欢鍙风爜鍒ゆ柇 + String idNum = hrmEmployeeComInfo.getIdNo() != null ? hrmEmployeeComInfo.getIdNo().toUpperCase() : ""; + CardTypeEnum cardType = CardTypeEnum.RESIDENT_IDENTITY_CARDS; + if (!SalaryCardUtil.checkIdNum(idNum)) { + //榛樿澶栧浗鎶ょ収 + cardType = CardTypeEnum.FOREIGN_PASSPORT; + + //娓境閫氳璇 + if (SalaryCardUtil.checkHMPassportIdNum(idNum)) { + cardType = CardTypeEnum.HM_PASSPORT; + } + + //鍙版咕閫氳璇 + if (SalaryCardUtil.checkTPassportIdNum(idNum)) { + cardType = CardTypeEnum.T_PASSPORT; + } + } + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), employeeId); + employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); + employeeDeclare.setJobNum(hrmEmployeeComInfo.getWorkcode()); + employeeDeclare.setCardType(cardType.getValue()); + employeeDeclare.setCardNum(idNum); + employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.getValue().toString()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()); + employeeDeclare.setBirthday(hrmEmployeeComInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(hrmEmployeeComInfo.getBirthday())); + employeeDeclare.setMobile(hrmEmployeeComInfo.getMobile()); + if (StringUtils.isEmpty(idNum)) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "璇佷欢鍙风爜涓嶈兘涓虹┖")); + } + if (cardType == CardTypeEnum.RESIDENT_IDENTITY_CARDS) { + employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum))); + employeeDeclare.setNationality("涓浗"); + } + // 瀵逛汉鍛樺鐞嗐屼汉鍛樼姸鎬併嶃併岀鑱屾棩鏈熴 + SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId()); + if (salaryArchive != null) { +// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType())); + employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate()); + if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) + || Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { + employeeDeclare.setEmploymentStatus(EmploymentStatusEnum.ABNORMAL.getValue()); + employeeDeclare.setDismissDate(salaryArchive.getPayEndDate()); + } + } + employeeIds.add(employeeDeclare.getEmployeeId()); + result.getNewEmployeeDeclares().add(employeeDeclare); + } + // 闈炵郴缁熶汉鍛樹腑鏂板鐨勯渶鎶ラ佺殑浜哄憳 +// for (ExtEmployeePO extEmployee : dto.getExtEmployees()) { +// if (employeeIds.contains(extEmployee.getId())) { +// continue; +// } +// EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey); +// employeeDeclare.setEmployeeId(extEmployee.getId()) +// .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) +// .setEmployeeName(extEmployee.getUsername()) +// .setCardNum(extEmployee.getCardNum()) +// .setMobile(extEmployee.getMobile()) +// .setEmploymentType(extEmployee.getEmploymentType()) +// .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1)); +// if (StringUtils.isEmpty(extEmployee.getCardNum())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); +// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "韬唤璇佸彿涓嶈兘涓虹┖")); +// } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) { +// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); +// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "韬唤璇佸彿鏍煎紡閿欒")); +// } else { +// employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue()); +// employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum())); +// } +// employeeIds.add(employeeDeclare.getEmployeeId()); +// result.getNewEmployeeDeclares().add(employeeDeclare); +// } + return result; + } + + private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, Date taxCycle, Long employeeId) { + EmployeeDeclarePO employeeDeclarePO = new EmployeeDeclarePO(); + employeeDeclarePO.setId(IdGenerator.generate()); + employeeDeclarePO.setTaxAgentId(taxAgentId); + employeeDeclarePO.setTaxCycle(taxCycle); + employeeDeclarePO.setEmploymentStatus(EmploymentStatusEnum.NORMAL.getValue()); + employeeDeclarePO.setEmploymentType(EmploymentTypeEnum.EMPLOYEE.getValue()); + employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclarePO.setDeclareErrorMsg(""); + employeeDeclarePO.setDisability(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setDisabilityCardNo(""); + employeeDeclarePO.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); + employeeDeclarePO.setMartyrDependentsCardNo(""); + employeeDeclarePO.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); + employeeDeclarePO.setSuccessfullyDeclared(0); + employeeDeclarePO.setNewEmployeeInfo(0); + employeeDeclarePO.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclarePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + employeeDeclarePO.setCreator(employeeId); + employeeDeclarePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclarePO.setCreateTime(new Date()); + employeeDeclarePO.setUpdateTime(new Date()); + return employeeDeclarePO; + } + + @Data + public static class Result { + + /** + * 宸叉湁鐨勯渶瑕佹洿鏂扮殑鎶ラ佷汉鍛 + */ + private List employeeDeclares; + + /** + * 鏂板鐨勬姤閫佷汉鍛 + */ + private List newEmployeeDeclares; + + public Result() { + this.employeeDeclares = Lists.newArrayList(); + this.newEmployeeDeclares = Lists.newArrayList(); + } + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java new file mode 100644 index 000000000..d45c35b79 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -0,0 +1,150 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +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.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEnumUtil; +import lombok.Data; +import org.apache.commons.compress.utils.Lists; +import weaver.general.Util; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 涓◣瀵规帴锛堜汉鍛樻姤閫侊級 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class EmployeeDeclareRequest { + + /** + * 杞崲鎴愯姹傚弬鏁 + * + * @param employeeDeclares + * @return + */ + public static List> convert2RequestParam(List employeeDeclares) { + List> employeeInfoMapList = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + Map employeeInfoMap = new HashMap<>(); + // 宸ュ彿 + employeeInfoMap.put("gh", employeeDeclare.getJobNum()); + // *濮撳悕 + employeeInfoMap.put("xm", employeeDeclare.getEmployeeName()); + // *璇佷欢绫诲瀷 + CardTypeEnum cardTypeEnum = CardTypeEnum.getByValue(employeeDeclare.getCardType()); + employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel()); + // *璇佷欢鍙风爜 + employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); + // *鍥界睄 + String nationality = employeeDeclare.getNationality(); + employeeInfoMap.put("gj", nationality); + // 浜哄憳鍦板尯 + employeeInfoMap.put("rydq", cardTypeEnum == CardTypeEnum.RESIDENT_IDENTITY_CARDS ? "澧冨唴" : "澧冨"); + // *鎬у埆 + GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); + employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel()); + // *鍑虹敓鏃ユ湡 + employeeInfoMap.put("csny", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getBirthday())); + // *浜哄憳鐘舵 + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); + // *浠昏亴鍙楅泧绫诲瀷 + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + employeeInfoMap.put("sfgy", employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); + //鍏朵粬鎯呭喌璇存槑鈥渜tqksm鈥濓紝鏈3涓夋嫨鐨勫硷紝鍙夋嫨"鎵g即鐢虫姤鍒╂伅鑲℃伅绾㈠埄鎵寰椻濄佲滄墸缂寸敵鎶ュ伓鐒舵墍寰椻濄佲濈敵鎶ュ叾浠栨墍寰椻 + //涓鑸姵鍔℃墍寰楀鐞嗭紝鍙互缁熶竴鐢ㄢ濈敵鎶ュ叾浠栨墍寰椻濅綔涓洪粯璁ゅ氨濂 + if (employmentTypeEnum == EmploymentTypeEnum.OTHER) { + employeeInfoMap.put("qtqksm", "鐢虫姤鍏朵粬鎵寰"); + } + // 鍏ヨ亴骞村害灏变笟鎯呭舰 + employeeInfoMap.put("rzndjyqk", employeeDeclare.getEmploymentFirstYear()); + // *鎵嬫満鍙风爜 + employeeInfoMap.put("lxdh", employeeDeclare.getMobile()); + // *鍏ヨ亴鍙楅泧鏃ユ湡 + employeeInfoMap.put("rzsgrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate())); + // 绂昏亴鏃ユ湡 + employeeInfoMap.put("lzrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate())); + // 鏄惁娈嬬柧 + SalaryOnOffEnum disability = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfcj", disability == null ? "" : disability.getDefaultLabel()); + // 娈嬬柧璇佸彿 + employeeInfoMap.put("cjzh", employeeDeclare.getDisabilityCardNo()); + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + SalaryOnOffEnum deductExpenses = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfzdw", deductExpenses == null ? "鏄" : deductExpenses.getDefaultLabel()); + // 鏄惁鐑堝睘 + SalaryOnOffEnum martyrDependents = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfls", martyrDependents == null ? "" : martyrDependents.getDefaultLabel()); + // 鐑堝睘璇佸彿 + employeeInfoMap.put("lszh", employeeDeclare.getMartyrDependentsCardNo()); + // 鏄惁瀛よ + SalaryOnOffEnum lonelyOld = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class); + employeeInfoMap.put("sfgl", lonelyOld == null ? "" : lonelyOld.getDefaultLabel()); + // 涓汉鎶曡祫鎬婚 + employeeInfoMap.put("grgbze", ""); + // 涓汉鎶曡祫姣斾緥 + employeeInfoMap.put("grgbbl", ""); + // 澶囨敞 + employeeInfoMap.put("bz", ""); + // 涓枃鍚 + employeeInfoMap.put("xmzw", ""); + // 鍑虹敓鍦帮細 + employeeInfoMap.put("csd", Util.null2String(employeeDeclare.getBirthplace())); + // 娑夌◣浜嬬敱 + employeeInfoMap.put("sssx", Util.null2String(employeeDeclare.getTaxReasons())); + // 棣栨鍏ュ鏃堕棿 + employeeInfoMap.put("scrjsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEntryDate())); + // 棰勮绂诲鏃堕棿 + employeeInfoMap.put("yjljsj", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDepartureDate())); + // 鍏朵粬璇佷欢绫诲瀷 + employeeInfoMap.put("qtzzlx", ""); + // 鍏朵粬璇佷欢鍙风爜 + employeeInfoMap.put("qtzzhm", ""); + // 鎴风睄鍦板潃锛氱渷浠姐佸煄甯傘佸尯鍘裤佽閬撱佽缁嗗湴鍧 + employeeInfoMap.put("hjszd_sheng", ""); + employeeInfoMap.put("hjszd_shi", ""); + employeeInfoMap.put("hjszd_qx", ""); + employeeInfoMap.put("hjszd_jd", ""); + employeeInfoMap.put("hjszd_xxdz", ""); + // 灞呬綇鍦板潃锛氱渷浠姐佸煄甯傘佸尯鍘裤佽閬撱佽缁嗗湴鍧 + employeeInfoMap.put("lxdz_sheng", ""); + employeeInfoMap.put("lxdz_shi", ""); + employeeInfoMap.put("lxdz_qx", ""); + employeeInfoMap.put("lxdz_jd", ""); + employeeInfoMap.put("lxdz", ""); + // 鑱旂郴鍦 + employeeInfoMap.put("wjrlxdz_sheng", ""); + employeeInfoMap.put("wjrlxdz_shi", ""); + employeeInfoMap.put("wjrlxdz_qx", ""); + employeeInfoMap.put("wjrlxdz_jd", ""); + employeeInfoMap.put("wjrlxdz_xxdz", ""); + // 閭 + employeeInfoMap.put("dzyx", ""); + // 瀛﹀巻 + employeeInfoMap.put("xl", ""); + // 寮鎴烽摱琛 + employeeInfoMap.put("khyh", ""); + // 寮鎴烽摱琛岀渷浠 + employeeInfoMap.put("khyhsfmz", ""); + // 閾惰璐﹀彿 + employeeInfoMap.put("yhzh", ""); + // 鑱屽姟 + employeeInfoMap.put("zw", ""); + // 閮ㄩ棬缂栧彿 + employeeInfoMap.put("bmbh", ""); + employeeInfoMapList.add(employeeInfoMap); + } + return employeeInfoMapList; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java new file mode 100644 index 000000000..0da6dea75 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -0,0 +1,186 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.SalaryTable; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.Set; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@SalaryTable(pageId = "a4f89287-289scf07669d7a23de0ef8u8s2710oe7") +public class EmployeeDeclareExcelDTO { + + // 涓婚敭id + private Long id; + + // 浜哄憳ID + private Long employeeId; + + // 浜哄憳绫诲瀷 + private EmployeeTypeEnum employeeType; + + + // 濮撳悕 + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "employeeName") + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + // 鍒嗛儴 + @SalaryTableColumn(text = "鍒嗛儴", width = "10%", column = "subCompanyName") + @TableTitle(title = "鍒嗛儴", dataIndex = "subCompanyName", key = "subCompanyName") + private String subCompanyName; + + // 閮ㄩ棬 + @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + + // 涓◣鎵g即涔夊姟浜 + @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + private String taxAgentName; + + // 宸ュ彿 + @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 璇佷欢绫诲瀷 + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "cardType") + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + private Integer cardType; + + // 璇佷欢鍙风爜 + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "cardNum") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + // 鎬у埆 + @SalaryTableColumn(text = "鍥界睄", width = "10%", column = "nationality") + @TableTitle(title = "鍥界睄", dataIndex = "nationality", key = "nationality") + private String nationality; + + // 鎬у埆 + @SalaryTableColumn(text = "鎬у埆", width = "10%", column = "gender") + @TableTitle(title = "鎬у埆", dataIndex = "gender", key = "gender") + private Integer gender; + + /** + * 鍑虹敓鍦 + */ + @SalaryTableColumn(text = "鍑虹敓鍦", width = "10%", column = "birthplace") + @TableTitle(title = "鍑虹敓鍦", dataIndex = "birthplace", key = "birthplace") + private String birthplace; + + // 鍑虹敓鏃ユ湡 + @SalaryTableColumn(text = "鍑虹敓鏃ユ湡", width = "10%", column = "birthday") + @TableTitle(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday", key = "birthday") + private Date birthday; + + // 浜哄憳鐘舵 + @SalaryTableColumn(text = "浜哄憳鐘舵", width = "10%", column = "employmentStatus") + @TableTitle(title = "浜哄憳鐘舵", dataIndex = "employmentStatus", key = "employmentStatus") + private Integer employmentStatus; + + // 鎵嬫満鍙风爜 + @SalaryTableColumn(text = "鎵嬫満鍙风爜", width = "10%", column = "mobile") + @TableTitle(title = "鎵嬫満鍙风爜", dataIndex = "mobile", key = "mobile") + private String mobile; + + // 浠昏亴鍙楅泧浠庝笟绫诲瀷 + @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟绫诲瀷", width = "10%", column = "employmentType") + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType", key = "employmentType") + private Integer employmentType; + + // 浠昏亴鍙楅泧浠庝笟鏃ユ湡 + @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", width = "10%", column = "employmentDate") + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate", key = "employmentDate") + private Date employmentDate; + + // 鍏ヨ亴骞村害灏变笟鎯呭舰 + private String employmentFirstYear; + + + // 绂昏亴鏃ユ湡 + @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "dismissDate") + @TableTitle(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate", key = "dismissDate") + private Date dismissDate; + + /** + * 棣栨鍏ュ鏃堕棿 + */ + @SalaryTableColumn(text = "棣栨鍏ュ鏃堕棿", width = "10%", column = "entryDate") + @TableTitle(title = "棣栨鍏ュ鏃堕棿", dataIndex = "entryDate", key = "entryDate") + private Date entryDate; + + /** + * 棰勮绂诲鏃堕棿 + */ + @SalaryTableColumn(text = "棰勮绂诲鏃堕棿", width = "10%", column = "departureDate") + @TableTitle(title = "棰勮绂诲鏃堕棿", dataIndex = "departureDate", key = "departureDate") + private Date departureDate; + + /** + * 娑夌◣浜嬬敱锛 + * 浠昏亴鍙楅泧 + * 鎻愪緵涓存椂鍔冲姟 + * 杞璐骇 + * 浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔 + * 鍏朵粬 + */ + @SalaryTableColumn(text = "娑夌◣浜嬬敱", width = "10%", column = "taxReasons") + @TableTitle(title = "娑夌◣浜嬬敱", dataIndex = "taxReasons", key = "taxReasons") + private String taxReasons; + + // 鏄惁娈嬬柧 + private Integer disability; + + // 娈嬬柧璇佸彿 + private String disabilityCardNo; + + // 鏄惁瀛よ + private Integer lonelyOld; + + // 鏄惁鏄儓灞 + private Integer martyrDependents; + + // 鐑堝睘璇佸彿 + private String martyrDependentsCardNo; + + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + private Integer deductExpenses; + + // 鐢虫姤鐘舵 + private DeclareStatusEnum declareStatus; + + // 鐢虫姤鐘舵 + @SalaryTableColumn(text = "鐢虫姤鐘舵", width = "10%", column = "declareStatusDesc") + @TableTitle(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + private String declareStatusDesc; + + // 鐢虫姤澶辫触鍘熷洜 + private String declareErrorMsg; + + // 缂栬緫杩囩殑瀛楁 + private Set updatedDataIndexSet; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java new file mode 100644 index 000000000..7bf9f9d76 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFailListDTO.java @@ -0,0 +1,85 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 鎶ラ佷汉鍛樺け璐ュ垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareFailListDTO { + + // 涓婚敭id + private Long id; + + // 浜哄憳id + private Long employeeId; + + // 浜哄憳绫诲瀷 + private EmployeeTypeEnum employeeType; + +// @SalaryTableColumn( +// label = "濮撳悕", +// labelId = 85429, +// width = "10%" +// ) + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + +// @SalaryTableColumn( +// label = "宸ュ彿", +// labelId = 86317, +// width = "10%" +// ) + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 閮ㄩ棬id + private String departmentId; + +// @SalaryTableColumn( +// label = "閮ㄩ棬", +// labelId = 86185, +// width = "10%" +// ) + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + +// @SalaryTableColumn( +// label = "璇佷欢绫诲瀷", +// labelId = 105139, +// width = "10%" +// ) + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + private String cardType; + +// @SalaryTableColumn( +// label = "璇佷欢鍙风爜", +// labelId = 86318, +// width = "20%" +// ) + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + +// @SalaryTableColumn( +// label = "澶辫触鍘熷洜", +// labelId = 156405, +// width = "40%" +// ) + @TableTitle(title = "澶辫触鍘熷洜", dataIndex = "declareErrorMsg", key = "declareErrorMsg") + private String declareErrorMsg; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java new file mode 100644 index 000000000..3abbb76d7 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -0,0 +1,150 @@ +package com.engine.salary.entity.employeedeclare.dto; + + +import com.engine.salary.annotation.TableTitle; +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.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夎〃鍗 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareFromDTO { + + // 浜哄憳id + private Long id; + + // 涓◣鎵g即涔夊姟浜篿d + private Long taxAgentId; + + // 绯荤粺鍚嶇О + @TableTitle(title = "绯荤粺鍚嶇О", dataIndex = "employee", key = "employee") + private List> employee; + + // 璇佷欢濮撳悕 + @TableTitle(title = "璇佷欢濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + // 宸ュ彿 + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 鍥界睄 + @TableTitle(title = "鍥界睄", dataIndex = "nationality", key = "nationality") + private String nationality; + + // 璇佷欢绫诲瀷 + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + private CardTypeEnum cardType; + + // 璇佷欢鍙风爜 + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + // 鎬у埆 + @TableTitle(title = "鎬у埆", dataIndex = "gender", key = "gender") + private GenderEnum gender; + + /** + * 娑夌◣浜嬬敱锛 + * 浠昏亴鍙楅泧 + * 鎻愪緵涓存椂鍔冲姟 + * 杞璐骇 + * 浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔 + * 鍏朵粬 + */ + @TableTitle(title = "娑夌◣浜嬬敱", dataIndex = "taxReasons", key = "taxReasons") + private String taxReasons; + + /** + * 鍑虹敓鍦 + */ + @TableTitle(title = "鍑虹敓鍦", dataIndex = "birthplace", key = "birthplace") + private String birthplace; + + // 鍑虹敓鏃ユ湡 + @TableTitle(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday", key = "birthday") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date birthday; + + // 鐘舵 + @TableTitle(title = "鐘舵", dataIndex = "employmentStatus", key = "employmentStatus") + private EmploymentStatusEnum employmentStatus; + + // 鎵嬫満鍙风爜 + @TableTitle(title = "鎵嬫満鍙风爜", dataIndex = "mobile", key = "mobile") + private String mobile; + + // 浠昏亴鍙楅泧浠庝笟绫诲瀷 + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType", key = "employmentType") + private EmploymentTypeEnum employmentType; + + // 浠昏亴鍙楅泧浠庝笟鏃ユ湡 + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate", key = "employmentDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date employmentDate; + + // 绂昏亴鏃ユ湡 + @TableTitle(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate", key = "dismissDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date dismissDate; + + + // 棣栨鍏ュ鏃堕棿 + @TableTitle(title = "棣栨鍏ュ鏃堕棿", dataIndex = "entryDate", key = "entryDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date entryDate; + + // 棰勮绂诲鏃堕棿 + @TableTitle(title = "棰勮绂诲鏃堕棿", dataIndex = "departureDate", key = "departureDate") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date departureDate; + + + + // 鏄惁娈嬬柧 + @TableTitle(title = "鏄惁娈嬬柧", dataIndex = "disability", key = "disability") + private SalaryOnOffEnum disability; + + // 娈嬬柧璇佸彿 + @TableTitle(title = "娈嬬柧璇佸彿", dataIndex = "disabilityCardNo", key = "disabilityCardNo") + private String disabilityCardNo; + + // 鏄惁瀛よ + @TableTitle(title = "鏄惁瀛よ", dataIndex = "lonelyOld", key = "lonelyOld") + private SalaryOnOffEnum lonelyOld; + + // 鏄惁鏄儓灞 + @TableTitle(title = "鏄惁鏄儓灞", dataIndex = "martyrDependents", key = "martyrDependents") + private SalaryOnOffEnum martyrDependents; + + // 鐑堝睘璇佸彿 + @TableTitle(title = "鐑堝睘璇佸彿", dataIndex = "martyrDependentsCardNo", key = "martyrDependentsCardNo") + private String martyrDependentsCardNo; + + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + @TableTitle(title = "鏄惁鎵i櫎鍑忛櫎璐圭敤", dataIndex = "deductExpenses", key = "deductExpenses") + private SalaryOnOffEnum deductExpenses; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java new file mode 100644 index 000000000..ac7cbc0af --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareInfoDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 鎶ラ佷汉鍛樹俊鎭 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareInfoDTO { + + // 鏄惁淇敼杩囧憳宸ヤ俊鎭 + private boolean showUpdate; + + // 鎶ラ佹垚鍔熺殑浜烘暟 + private Integer declareSuccessSize; + + // 鏈姤閫佺殑浜烘暟 + private Integer notDeclareSize; + + // 鎶ラ佸け璐ョ殑浜烘暟 + private Integer declareFailSize; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java new file mode 100644 index 000000000..c56d8db93 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -0,0 +1,148 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import com.engine.salary.annotation.SalaryTable; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelHead; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Set; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +@SalaryTable(pageId = "a4f89287-289scf07669d7a23de0ef8u8s2710oe7") +public class EmployeeDeclareListDTO { + + // 涓婚敭id + private Long id; + + // 浜哄憳ID + private Long employeeId; + + // 浜哄憳绫诲瀷 + private EmployeeTypeEnum employeeType; + + + // 濮撳悕 + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "employeeName") + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "濮撳悕", dataIndex = "employeeName") + private String employeeName; + + // 鍒嗛儴 + @SalaryTableColumn(text = "鍒嗛儴", width = "10%", column = "subCompanyName") + @TableTitle(title = "鍒嗛儴", dataIndex = "subCompanyName", key = "subCompanyName") + @ExcelHead(title = "鍒嗛儴", dataIndex = "subCompanyName") + private String subCompanyName; + + // 閮ㄩ棬 + @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelHead(title = "閮ㄩ棬", dataIndex = "departmentName") + private String departmentName; + + // 涓◣鎵g即涔夊姟浜 + @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName") + private String taxAgentName; + + // 宸ュ彿 + @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "宸ュ彿", dataIndex = "jobNum") + private String jobNum; + + // 鍥界睄 + @SalaryTableColumn(text = "鍥界睄", width = "10%", column = "nationality") + @TableTitle(title = "鍥界睄", dataIndex = "nationality", key = "nationality") + @ExcelHead(title = "鍥界睄", dataIndex = "nationality") + private String nationality; + + // 璇佷欢绫诲瀷 + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "cardType") + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "cardType") + private String cardType; + + // 璇佷欢鍙风爜 + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "cardNum") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") + private String cardNum; + + // 鎬у埆 + @SalaryTableColumn(text = "鎬у埆", width = "10%", column = "gender") + @TableTitle(title = "鎬у埆", dataIndex = "gender", key = "gender") + @ExcelHead(title = "鎬у埆", dataIndex = "gender") + private String gender; + + // 鍑虹敓鏃ユ湡 + @SalaryTableColumn(text = "鍑虹敓鏃ユ湡", width = "10%", column = "birthday") + @TableTitle(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday", key = "birthday") + @ExcelHead(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday") + private String birthday; + + // 浜哄憳鐘舵 + @SalaryTableColumn(text = "浜哄憳鐘舵", width = "10%", column = "employmentStatus") + @TableTitle(title = "浜哄憳鐘舵", dataIndex = "employmentStatus", key = "employmentStatus") + @ExcelHead(title = "浜哄憳鐘舵", dataIndex = "employmentStatus") + private String employmentStatus; + + // 鎵嬫満鍙风爜 + @SalaryTableColumn(text = "鎵嬫満鍙风爜", width = "10%", column = "mobile") + @TableTitle(title = "鎵嬫満鍙风爜", dataIndex = "mobile", key = "mobile") + @ExcelHead(title = "鎵嬫満鍙风爜", dataIndex = "mobile") + private String mobile; + + // 浠昏亴鍙楅泧浠庝笟绫诲瀷 + @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟绫诲瀷", width = "10%", column = "employmentType") + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType", key = "employmentType") + @ExcelHead(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType") + private String employmentType; + + // 浠昏亴鍙楅泧浠庝笟鏃ユ湡 + @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", width = "10%", column = "employmentDate") + @TableTitle(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate", key = "employmentDate") + @ExcelHead(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate") + private String employmentDate; + + + // 绂昏亴鏃ユ湡 + @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "dismissDate") + @TableTitle(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate", key = "dismissDate") + @ExcelHead(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate") + private String dismissDate; + + // 鐢虫姤鐘舵 + private DeclareStatusEnum declareStatus; + + // 鐢虫姤鐘舵 + @SalaryTableColumn(text = "鐢虫姤鐘舵", width = "10%", column = "declareStatusDesc") + @TableTitle(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + @ExcelHead(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc") + private String declareStatusDesc; + + // 鐢虫姤澶辫触鍘熷洜 + private String declareErrorMsg; + + // 缂栬緫杩囩殑瀛楁 + private Set updatedDataIndexSet; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java new file mode 100644 index 000000000..44924bd74 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 浜哄憳杩涘害 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class EmployeeDeclareRateDTO implements Serializable { + + private static final long serialVersionUID = 6096347310269090985L; + + //缂撳瓨绱㈠紩") + private String index; + //鎻愮ず淇℃伅") + private String msg; + //鐘舵") + private boolean status; + //鏄惁宸茬粡瀹屾垚") + private boolean finish; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java new file mode 100644 index 000000000..56f88e0ff --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.employeedeclare.dto; + + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +/** + * 浜哄憳鎶ラ侊紝鍒锋柊鏁版嵁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class EmployeeDeclareRefreshDTO { + // 涓◣鎵g即涔夊姟浜 + private Long taxAgentId; + + // 绋庢鎵灞炴湡 + private Date taxCycle; + + // 宸叉湁鐨勬姤閫佷汉鍛 + private List employeeDeclares; + + // 涓婁釜绋庢鎵灞炴湡鐨勬姤閫佷汉鍛 + private List preTaxCycleEmployeeDeclare; + + // 钖祫妗f涓殑浜哄憳 + private List salaryArchives; + + // 鍛樺伐鍩烘湰淇℃伅 + private List hrmEmployeeComInfos; +// +// // 鍛樺伐涓汉淇℃伅 +// private List simpleUserInfos; + + // 闈炵郴缁熶汉鍛 + private List extEmployees; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java new file mode 100644 index 000000000..a241b008e --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.employeedeclare.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Set; + +/** + * 浜哄憳鎶ラ侊紙涓◣鎵g即涔夊姟浜猴級鍒楄〃 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = true) +public class TaxAgentDeclareListDTO { + + // 涓婚敭id + private Long id; + + // 涓◣鎵g即涔夊姟浜 + private String taxAgentName; + + Set opts; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java new file mode 100644 index 000000000..7847ea4f5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -0,0 +1,103 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛ㄦ煡璇㈠弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareAddListQueryParam extends BaseQueryParam { + + // 鍒楄〃id + private Collection ids; + + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true,message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒 + */ + // 绋庢鎵灞炴湡 + @DataCheck(require = true,message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; + + // 鎶ラ佺姸鎬 + private DeclareStatusEnum declareStatus; + + // 鍛樺伐濮撳悕/缂栧彿 + private String keyword; + + private Long employeeId; + + // 閮ㄩ棬 + private Collection departmentIds; + + // 宀椾綅 + private Collection positionIds; + + // 浜哄憳鐘舵 + private EmploymentStatusEnum employmentStatus; + + // 浠昏亴鍙楅泧浠庝笟绫诲瀷 + private EmploymentTypeEnum employmentType; + + // 浠昏亴鍙楅泧鏃ユ湡寮濮 + private LocalDate fromEmploymentDate; + + // 浠昏亴鍙楅泧鏃ユ湡缁撴潫 + private LocalDate endEmploymentDate; + + // 绂昏亴鏃ユ湡寮濮 + private LocalDate fromDismissDate; + + // 绂昏亴鏃ユ湡缁撴潫 + private LocalDate endDismissDate; + + // 鏄惁娈嬬柧 + private SalaryOnOffEnum disability; + + // 鏄惁瀛よ + private SalaryOnOffEnum lonelyOld; + + // 鏄惁鏄儓灞 + private SalaryOnOffEnum martyrDependents; + + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + private SalaryOnOffEnum deductExpenses; + + // 绋庢鎵灞炴湡锛堜笂鏈堬級 + @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date preTaxCycle; + + @ApiModelProperty + private List customColumns; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java new file mode 100644 index 000000000..df5bf960c --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareBatchUpdateParam.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.employeedeclare.param; + +import lombok.Data; + +import java.util.Collection; + +/** + * 浜哄憳鎶ラ-鎵归噺缂栬緫淇濆瓨鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class EmployeeDeclareBatchUpdateParam extends EmployeeDeclareListQueryParam { + + //鎶ラ佷汉鍛樼殑id + private Collection ids; + + //鎵归噺缂栬緫鐨勯」鐩 + private String batchUpdateItem; + + //鎵归噺缂栬緫涓 + private String itemValue; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java new file mode 100644 index 000000000..8b9c7c202 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareFailListQueryParam.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 鎶ラ佷汉鍛樺け璐ユ煡璇㈠弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareFailListQueryParam extends BaseQueryParam { + + /** + * 鍒楄〃id + */ + private Collection ids; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 绋庢鎵灞炴湡 + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java new file mode 100644 index 000000000..16f994ee5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.employeedeclare.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareImportEmployeeParam { + //涓婁紶鏂囦欢id + String imageId; + + Long taxAgentId; + + Date taxCycle; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java new file mode 100644 index 000000000..114013a90 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.employeedeclare.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 浜哄憳鎶ラ佸鍏ュ弬鏁 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/21 4:58 PM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareImportParam extends EmployeeDeclareListQueryParam { + + @ApiModelProperty("鏄惁瀵煎嚭鐜版湁鏁版嵁") + private String exportData; + + //涓婁紶鏂囦欢id + String imageId; + + // 鏍¢獙瀛楁 + private String checkType; + + // 涓◣鎵d箟鍔′汉id + private Long taxAgentId; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java new file mode 100644 index 000000000..27222c08f --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -0,0 +1,91 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛ㄦ煡璇㈠弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareListQueryParam extends BaseQueryParam { + + // 鍒楄〃id + private Collection ids; + + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炴湡 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; + + // 鎶ラ佺姸鎬 + private DeclareStatusEnum declareStatus; + + // 鍛樺伐濮撳悕/缂栧彿 + private String keyword; + private Long employeeId; + + // 閮ㄩ棬 + private Collection departmentIds; + + // 宀椾綅 + private Collection positionIds; + + // 浜哄憳鐘舵 + private EmploymentStatusEnum employmentStatus; + + // 浠昏亴鍙楅泧浠庝笟绫诲瀷 + private EmploymentTypeEnum employmentType; + + // 浠昏亴鍙楅泧鏃ユ湡寮濮 + private LocalDate fromEmploymentDate; + + // 浠昏亴鍙楅泧鏃ユ湡缁撴潫 + private LocalDate endEmploymentDate; + + // 绂昏亴鏃ユ湡寮濮 + private LocalDate fromDismissDate; + + // 绂昏亴鏃ユ湡缁撴潫 + private LocalDate endDismissDate; + + // 鏄惁娈嬬柧 + private SalaryOnOffEnum disability; + + // 鏄惁瀛よ + private SalaryOnOffEnum lonelyOld; + + // 鏄惁鏄儓灞 + private SalaryOnOffEnum martyrDependents; + + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + private SalaryOnOffEnum deductExpenses; + + + private List customColumns; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java new file mode 100644 index 000000000..036a3ad7a --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -0,0 +1,44 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +/** + * 浜哄憳鎶ラ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareParam extends BaseQueryParam { + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 绋庢鎵灞炴湡 + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + private Date taxCycle; + + /** + * 鎵归噺鎶ラ侊紝涓◣鎵g即涔夊姟浜篿d闆嗗悎 + */ + private List taxAgentIds; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java new file mode 100644 index 000000000..073dd793a --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +/** + * 鍒锋柊鎶ラ佷汉鍛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareRefreshParam { + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + /** + * 绋庢鎵灞炴湡 + */ + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + private Date taxCycle; + + + /** + * 鎵归噺鎿嶄綔锛屼釜绋庢墸缂翠箟鍔′汉id闆嗗悎 + */ + private List taxAgentIds; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java new file mode 100644 index 000000000..02df109dd --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -0,0 +1,120 @@ +package com.engine.salary.entity.employeedeclare.param; + +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.salaryaccounting.EmployeeTypeEnum; +import lombok.Data; + +import java.time.LocalDate; +import java.util.Date; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛変繚瀛樺弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class EmployeeDeclareSaveParam { + + //涓婚敭id + private Long id; + + /** + * 鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖ + */ + //涓◣鎵g即涔夊姟浜篿d + private Long taxAgentId; + + /** + * 鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒 + */ + //绋庢鎵灞炴湡 + private Date taxCycle; + + //鍛樺伐id + private Long employeeId; + + //鍛樺伐绫诲瀷 + private EmployeeTypeEnum employeeType; + + //濮撳悕 + private String employeeName; + + //宸ュ彿 + private String jobNum; + + //鍥界睄 + private String nationality; + + /** + * 鍑虹敓鍦 + */ + private String birthplace; + + /** + * 娑夌◣浜嬬敱锛 + * 浠昏亴鍙楅泧 + * 鎻愪緵涓存椂鍔冲姟 + * 杞璐骇 + * 浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔 + * 鍏朵粬 + */ + private String taxReasons; + + //璇佷欢绫诲瀷 + private CardTypeEnum cardType; + + //璇佷欢鍙风爜 + private String cardNum; + + //鎬у埆 + private GenderEnum gender; + + //鍑虹敓鏃ユ湡 + private LocalDate birthday; + + //鐘舵 + private EmploymentStatusEnum employmentStatus; + + //鎵嬫満鍙风爜 + private String mobile; + + //浠昏亴鍙楅泧浠庝笟绫诲瀷 + private EmploymentTypeEnum employmentType; + + //浠昏亴鍙楅泧浠庝笟鏃ユ湡 + private LocalDate employmentDate; + + //绂昏亴鏃ユ湡 + private LocalDate dismissDate; + + //棣栨鍏ュ鏃堕棿 + private LocalDate entryDate; + + //棰勮绂诲鏃堕棿 + private LocalDate departureDate; + + //鏄惁娈嬬柧 + private SalaryOnOffEnum disability; + + //娈嬬柧璇佸彿 + private String disabilityCardNo; + + //鏄惁瀛よ + private SalaryOnOffEnum lonelyOld; + + //鏄惁鏄儓灞 + private SalaryOnOffEnum martyrDependents; + + //鐑堝睘璇佸彿 + private String martyrDependentsCardNo; + + //鏄惁鎵i櫎鍑忛櫎璐圭敤 + private SalaryOnOffEnum deductExpenses; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java new file mode 100644 index 000000000..c4410c28a --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSyncStartDateParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鍚屾鍏ヨ亴鏃ユ湡鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareSyncStartDateParam { + // 涓◣鎵g即涔夊姟浜篿d + @DataCheck(require = true, message = "鍙傛暟閿欒锛屼釜绋庢墸缂翠箟鍔′汉id涓嶈兘涓虹┖") + private Long taxAgentId; + + // 绋庢鎵灞炴湡 + @DataCheck(require = true, message = "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java new file mode 100644 index 000000000..7809661f7 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInformationChangeParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 浜哄憳鎶ラ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeInformationChangeParam extends BaseQueryParam { + + /** + * 浜哄憳璁板綍id + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛宨d涓嶈兘涓虹┖") + private Long id; + + /** + * + */ + private String name; + + //璇佷欢绫诲瀷 + private CardTypeEnum cardType; + + //璇佷欢鍙风爜 + private String cardNum; + + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java new file mode 100644 index 000000000..fa67731ce --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeInvalidParam.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 浜哄憳鎶ラ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeInvalidParam extends BaseQueryParam { + + /** + * 浜哄憳璁板綍id + */ + @DataCheck(require = true,message = "鍙傛暟閿欒锛宨d涓嶈兘涓虹┖") + private Long id; + + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java new file mode 100644 index 000000000..6daffceb3 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/TaxAgentDeclareListQueryParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.employeedeclare.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 浜哄憳鎶ラ侊紙涓◣鎵g即涔夊姟浜猴級鏌ヨ鏉′欢 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaxAgentDeclareListQueryParam extends BaseQueryParam { + + // "涓◣鎵g即涔夊姟浜哄悕绉" + private String taxAgentName; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java new file mode 100644 index 000000000..b282f68a8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -0,0 +1,315 @@ +package com.engine.salary.entity.employeedeclare.po; + + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.GenderEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ElogTransform(name = "浜哄憳淇℃伅鎶ラ") +//hrsa_employee_declare +public class EmployeeDeclarePO { + + /** + * 涓婚敭id + */ + @ElogTransform(name = "涓婚敭id") + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜 + */ + @ElogTransform(name = "涓◣鎵g即涔夊姟浜") + private Long taxAgentId; + + /** + * 绋庢鎵灞炴湡 + */ + @ElogTransform(name = "绋庢鎵灞炴湡") + private Date taxCycle; + + /** + * 浜哄憳id + */ + @ElogTransform(name = "浜哄憳id") + private Long employeeId; + + /** + * 浜哄憳绫诲瀷 + */ + @ElogTransform(name = "浜哄憳绫诲瀷") + private Integer employeeType; + + /** + * 浜哄憳鍚嶇О + */ + @ElogTransform(name = "浜哄憳鍚嶇О") + private String employeeName; + + /** + * 鍥界睄 + */ + @ElogTransform(name = "鍥界睄") + private String nationality; + + + /** + * 宸ュ彿 + */ + @ElogTransform(name = "宸ュ彿") + private String jobNum; + + /** + * 璇佷欢绫诲瀷 + * @see CardTypeEnum + */ + @ElogTransform(name = "璇佷欢绫诲瀷") + private Integer cardType; + + /** + * 璇佷欢鍙风爜 + */ + @ElogTransform(name = "璇佷欢鍙风爜") + private String cardNum; +// +// /** +// * 鍏朵粬璇佷欢绫诲瀷 +// */ +// @ElogTransform(name = "鍏朵粬璇佷欢绫诲瀷") +// private Integer otherCardType; +// +// /** +// * 鍏朵粬璇佷欢鍙风爜 +// */ +// @ElogTransform(name = "鍏朵粬璇佷欢鍙风爜") +// private String otherCardNum; + + /** + * 鎬у埆 + * @see GenderEnum + */ + @ElogTransform(name = "鎬у埆") + private Integer gender; + + /** + * 鍑虹敓鏃ユ湡 + */ + @ElogTransform(name = "鍑虹敓鏃ユ湡") + private Date birthday; + + /** + * 鍑虹敓鍦 + */ + @ElogTransform(name = "鍑虹敓鍦") + private String birthplace; + + /** + * 娑夌◣浜嬬敱锛 + * 浠昏亴鍙楅泧 + * 鎻愪緵涓存椂鍔冲姟 + * 杞璐骇 + * 浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔 + * 鍏朵粬 + */ + @ElogTransform(name = "娑夌◣浜嬬敱") + private String taxReasons; + + /** + * 鐘舵 + */ + @ElogTransform(name = "鐘舵") + private Integer employmentStatus; + + /** + * 鎵嬫満鍙风爜 + */ + @ElogTransform(name = "鎵嬫満鍙风爜") + private String mobile; + + /** + * 浠昏亴鍙楅泧浠庝笟绫诲瀷 + */ + @ElogTransform(name = "浠昏亴鍙楅泧浠庝笟绫诲瀷") + private Integer employmentType; + + /** + * 鍏ヨ亴骞村害灏变笟鎯呭舰 + */ + @ElogTransform(name = "鍏ヨ亴骞村害灏变笟鎯呭舰") + private String employmentFirstYear; + + /** + * 浠昏亴鍙楅泧浠庝笟鏃ユ湡 + */ + @ElogTransform(name = "浠昏亴鍙楅泧浠庝笟鏃ユ湡") + private Date employmentDate; + + /** + * 绂昏亴鏃ユ湡 + */ + @ElogTransform(name = "绂昏亴鏃ユ湡") + private Date dismissDate; + + + /** + * 棣栨鍏ュ鏃堕棿 + */ + @ElogTransform(name = "棣栨鍏ュ鏃堕棿") + private Date entryDate; + + /** + * 棰勮绂诲鏃堕棿 + */ + @ElogTransform(name = "棰勮绂诲鏃堕棿") + private Date departureDate; + + /** + * 鏄惁娈嬬柧 + */ + @ElogTransform(name = "鏄惁娈嬬柧") + private Integer disability; + + /** + * 娈嬬柧璇佸彿 + */ + @ElogTransform(name = "娈嬬柧璇佸彿") + private String disabilityCardNo; + + /** + * 鏄惁瀛よ + */ + @ElogTransform(name = "鏄惁瀛よ") + private Integer lonelyOld; + + /** + * 鏄惁鏄儓灞 + */ + @ElogTransform(name = "鏄惁鏄儓灞") + private Integer martyrDependents; + + /** + * 鐑堝睘璇佸彿 + */ + @ElogTransform(name = "鐑堝睘璇佸彿") + private String martyrDependentsCardNo; + + /** + * 鏄惁鎵i櫎鍑忛櫎璐圭敤 + */ + @ElogTransform(name = "鏄惁鎵i櫎鍑忛櫎璐圭敤") + private Integer deductExpenses; + + /** + * 鏄惁鎴愬姛鎶ラ佽繃 + * 娉ㄦ剰锛氫笉浠呬粎鏄拡瀵规煇涓涓湀 + * 0锛氫粠鏈姤閫佹垚鍔熻繃銆1锛氭姤閫佹垚鍔熻繃 + */ + @ElogTransform(name = "鏄惁鎴愬姛鎶ラ佽繃") + private Integer successfullyDeclared; + + /** + * 鍛樺伐淇℃伅鏄惁鍙戠敓鍙樺姩锛 + * 0锛氭湰鏈堟湭鏀瑰姩銆1锛氭湰鏈堟湁鏀瑰姩 + */ + @ElogTransform(name = "鍛樺伐淇℃伅鏄惁鍙戠敓鍙樺姩") + private Integer newEmployeeInfo; + + /** + * 鐢虫姤鐘舵 + */ + @ElogTransform(name = "鐢虫姤鐘舵") + private Integer declareStatus; + + /** + * 鐢虫姤澶辫触鐨勯敊璇俊鎭 + */ + @ElogTransform(name = "鐢虫姤澶辫触鐨勯敊璇俊鎭") + private String declareErrorMsg; + + /** + * 绉熸埛key + */ + @ElogTransform(name = "绉熸埛key") + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + @ElogTransform(name = "鍒涘缓浜篿d") + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + @ElogTransform(name = "鏄惁鍒犻櫎") + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + @ElogTransform(name = "鍒涘缓鏃堕棿") + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + @ElogTransform(name = "鏇存柊鏃堕棿") + private Date updateTime; + + + public String toCompareString() { + return "EmployeeDeclarePO{" + + "id=" + id + + ", taxAgentId=" + taxAgentId + + ", taxCycle='" + taxCycle + '\'' + + ", employeeId=" + employeeId + + ", employeeType=" + employeeType + + ", employeeName='" + employeeName + '\'' + + ", nationality='" + nationality + '\'' + + ", jobNum='" + jobNum + '\'' + + ", cardType=" + cardType + + ", cardNum='" + cardNum + '\'' + + ", gender=" + gender + + ", birthday=" + birthday + + ", birthplace='" + birthplace + '\'' + + ", taxReasons='" + taxReasons + '\'' + + ", employmentStatus=" + employmentStatus + + ", mobile='" + mobile + '\'' + + ", employmentType=" + employmentType + + ", employmentFirstYear='" + employmentFirstYear + '\'' + + ", employmentDate=" + employmentDate + + ", dismissDate=" + dismissDate + + ", entryDate=" + entryDate + + ", departureDate=" + departureDate + + ", disability=" + disability + + ", disabilityCardNo='" + disabilityCardNo + '\'' + + ", lonelyOld=" + lonelyOld + + ", martyrDependents=" + martyrDependents + + ", martyrDependentsCardNo='" + martyrDependentsCardNo + '\'' + + ", deductExpenses=" + deductExpenses + + '}'; + } + + private Collection ids; + private Collection employeeIds; + private Collection taxAgentIds; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java new file mode 100644 index 000000000..fb31b0a85 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.employeedeclare.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + +/** + * 鍛樺伐鎶ラ佽褰 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//"hrsa_employee_declare_record") +public class EmployeeDeclareRecordPO { + + /** + * 涓婚敭id + */ + private Long id; + /** + * 涓◣鎵g即涔夊姟浜 + */ + private Long taxAgentId; + /** + * 绋庢鎵灞炴湡 + */ + private Date taxCycle; + /** + * 璇锋眰鐨剅equestId + */ + private String requestId; + /** + * 绉熸埛key + */ + private String tenantKey; + /** + * 鍒涘缓浜篿d + */ + private Long creator; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + private Collection ids; +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java new file mode 100644 index 000000000..899a2e394 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.employeedeclare.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 鎶ラ佷汉鍛樼殑鍙嶉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class DeclareEmployeeFeedbackResponse { + + @ApiModelProperty("鎺ュ彛鐘舵") + private SzyhResponseHead head; + + @ApiModelProperty("杩斿洖鏁版嵁") + private DeclareEmployeeFeedbackResponseBody body; + + @Data + public static class DeclareEmployeeFeedbackResponseBody { + + @ApiModelProperty("浜哄憳鏁版嵁") + private List> bsjg; + + @ApiModelProperty("requestId") + private String requestId; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java new file mode 100644 index 000000000..bc99c9df6 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.employeedeclare.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 鎶ラ佷汉鍛樼殑杩斿洖鏁版嵁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class DeclareEmployeeInfoResponse { + + @ApiModelProperty("鎺ュ彛鐘舵") + private SzyhResponseHead head; + + @ApiModelProperty("鎺ュ彛鏁版嵁") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java index aa32a8829..a1f9c65ef 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java @@ -204,7 +204,7 @@ public class SalaryBillBO { // * @param currentTenantKey // * @return // */ -// public static SendMessageEntity buildSendMessage(Map e, Map allEmployeeMap, SalaryBillSendDTO salaryBillSendParam, Long currentEmployeeId, String currentTenantKey) { +// public static SendMessageEntity buildSendMessage(Map e, Map allEmployeeMap, SalaryBillSendDTO salaryBillSendParam) { // // 鏋勫缓鐢ㄦ埛鍩烘湰淇℃伅 // SalaryBillBO.buildEmployeeInfo(salaryBillSendParam.getEmployeeInformation(), allEmployeeMap.get(e.get("employeeId").toString()), salaryBillSendParam.getEmployeeField()); // // 娑堟伅鎺ユ敹鑰 @@ -503,7 +503,7 @@ public class SalaryBillBO { // * @param currentTenantKey // * @return // */ -// public static CancleMessageEntity buildCancleMessageEntity(long msgId, String text, String title, Long currentEmployeeId, String currentTenantKey) { +// public static CancleMessageEntity buildCancleMessageEntity(long msgId, String text, String title) { // CancleMessageEntity cme = new CancleMessageEntity(); // cme.setMsgId(msgId); // // 妯″潡 diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index c2b863aaa..518f21a3e 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -35,6 +35,7 @@ import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import weaver.general.BaseBean; import weaver.general.Util; import java.lang.reflect.Field; @@ -57,6 +58,8 @@ import static com.engine.salary.util.SalaryDateUtil.DATE_TIME_FORMATTER_PATTERN; @Accessors(chain = true) @Slf4j public class CalculateFormulaVarBO { + BaseBean bb = new BaseBean(); + String salaryDateFormat = bb.getPropValue("hrmSalaryCustom", "salaryDateFormat"); /** * 鍛樺伐淇℃伅 diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java index e0a777bcd..c0ec071e1 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java @@ -61,7 +61,7 @@ public class SalaryAcctCalculateBO { /** * 鏈杩愮畻鐨勮柂璧勯」鐩紙宸叉帓濂借繍绠椾紭鍏堢骇锛 */ - private List> salaryItemIdWithPriorityList; + private List salaryItemIdWithPriorityList; /** * 鏈杩愮畻娑夊強鐨勬墍鏈夊叕寮 @@ -113,6 +113,11 @@ public class SalaryAcctCalculateBO { */ private BlockingDeque results; + /** + * 涓◣椤圭洰 + */ + private List taxIds; + /** * 绯荤粺绠楃◣鍚敤鐘舵 */ diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java index 197ad1245..2296b157e 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.salaryacct.bo; -import com.engine.salary.constant.SalaryFormulaFieldConstant; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -21,9 +20,10 @@ import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 钖祫鏍哥畻-钖祫椤圭洰杩愮畻浼樺厛绾 *

Copyright: Copyright (c) 2022

@@ -34,16 +34,6 @@ import java.util.stream.Collectors; **/ public class SalaryAcctCalculatePriorityBO { - /** - * 鍏紡涓彉閲忕殑fieldId鐨勬鍒欒〃杈惧紡 - */ - private static final String SALARY_REGEX = "(\\w+)" + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + "(\\w+)"; - - /** - * 瑙f瀽鍏紡涓彉閲忕殑fieldId鐨勬鍒欒〃杈惧紡 - */ - private static final Pattern SALARY_PATTERN = Pattern.compile(SALARY_REGEX); - /** * 璁$畻浼樺厛绾 * @@ -195,7 +185,7 @@ public class SalaryAcctCalculatePriorityBO { if (Objects.equals(pre.getSalaryItemId(), current.getSalaryItemId())) { SalaryItemPO preSalaryItemPO = salaryItemPOMap.get(pre.getSalaryItemId()); SalaryItemPO currentSalaryItemPO = salaryItemPOMap.get(current.getSalaryItemId()); - String errMsg = SalaryI18nUtil.getI18nLabel(101426, "{0}鍜寋1}鐨勫叕寮忎腑瀛樺湪鐩镐簰寮曠敤") + String errMsg = SalaryI18nUtil.getI18nLabel(101426, "{0} {1}鐨勫叕寮忎腑瀛樺湪鐩镐簰寮曠敤") .replace("{0}", Optional.ofNullable(preSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) .replace("{1}", Optional.ofNullable(currentSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)); throw new SalaryRunTimeException(errMsg); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java index c1a88ba6a..02e7032b7 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcContext.java @@ -10,12 +10,13 @@ import java.util.List; import java.util.Map; /** - * @description: 钖祫鏍哥畻涓婁笅鏂 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/22/22 3:26 PM - * @version:v1.0 - */ + * 钖祫鏍哥畻涓婁笅鏂 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryCalcContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java index fa07e673e..3295a6b03 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcEmployeeContext.java @@ -8,13 +8,6 @@ import lombok.Data; import java.util.List; import java.util.Map; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/23/22 3:45 PM - * @version:v1.0 - */ @Data public class SalaryCalcEmployeeContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java index 937bffdc7..39a04b518 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormula.java @@ -6,12 +6,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 钖祫鏍哥畻璁$畻浼樺厛绾 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/23/22 11:52 AM - * @version:v1.0 - */ + * 钖祫鏍哥畻璁$畻浼樺厛绾 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class SalaryCalcFormula { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java index bd8a60387..bfa1be309 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcFormulaContext.java @@ -8,12 +8,13 @@ import lombok.Data; import java.util.*; /** - * @description: 钖祫鏍哥畻鍏紡 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 8/22/22 3:33 PM - * @version:v1.0 - */ + * 钖祫鏍哥畻鍏紡 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryCalcFormulaContext { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java new file mode 100644 index 000000000..42df567df --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItem.java @@ -0,0 +1,59 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.enums.SalaryRoundingModeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 钖祫鏍哥畻娑夊強鐨勮柂璧勯」鐩 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class SalaryCalcItem { + + /** + * 钖祫椤圭洰id + */ + private Long salaryItemId; + /** + * 钖祫椤圭洰缂栧彿 + */ + private String salaryItemCode; + /** + * 鎵寰楅」鐩 + */ + private String incomeCategory; + /** + * 钖祫妗f寮曠敤銆0锛氳柂璧勬。妗堟湭寮曠敤銆1锛氳柂璧勬。妗堝紩鐢 + * 涓哄鐞嗗巻鍙叉暟鎹岀暀锛屼笉鍐嶄娇鐢 + */ + @Deprecated + private Integer useInEmployeeSalary; + /** + * 瀛楁绫诲瀷 + * @see SalaryDataTypeEnum + */ + private String dataType; + /** + * 鑸嶅叆瑙勫垯 + * @see SalaryRoundingModeEnum + */ + private Integer roundingMode; + /** + * 灏忔暟浣嶆暟 + */ + private Integer pattern; + /** + * 鍏紡 + */ + private ExpressFormula expressFormula; + + +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java new file mode 100644 index 000000000..ecfad44da --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcItemGraph.java @@ -0,0 +1,192 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.report.common.constant.SalaryConstant; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.concurrent.LinkedTransferQueue; +import java.util.stream.Collectors; + +/** + * 瀵硅柂璧勬牳绠楁椂娑夊強鐨勮柂璧勯」鐩繘琛屾帓搴 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryCalcItemGraph { + + private List nodes; + private Map items; + + /** + * 鏍规嵁钖祫璐﹀鐨勮柂璧勯」鐩佸叕寮忚鎯呮瀯寤哄疄渚 + * + * @param salarySobItems 钖祫璐﹀鐨勮柂璧勯」鐩 + * @param expressFormulas 鍏紡璇︽儏 + */ + public SalaryCalcItemGraph(List salarySobItems, List salaryItemPOS, List expressFormulas) { + Map salarySobItemMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItemPOS, SalaryItemPO::getCode); + Map expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); + Map> formulaVarMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); + + Map nodeMap = new HashMap<>(); + for (SalarySobItemPO salarySobItem : salarySobItems) { + ExpressFormula expressFormula = expressFormulaMap.get(salarySobItem.getFormulaId()); + SalaryCalcItemGraphNode node = nodeMap.computeIfAbsent(salarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(salarySobItem, expressFormula)); + List formulaVars = expressFormula == null ? Collections.emptyList() : formulaVarMap.getOrDefault(expressFormula.getId(), Collections.emptyList()); + for (FormulaVar formulaVar : formulaVars) { + if (StringUtils.isNotEmpty(formulaVar.getFieldId()) && StringUtils.startsWith(formulaVar.getFieldId(), SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryConstant.FORMULA_VAR_SEPARATOR)) { + String salaryItemCode = formulaVar.getFieldId().split(SalaryConstant.FORMULA_VAR_SEPARATOR)[1]; + SalarySobItemPO subSalarySobItem = salarySobItemMap.get(salaryItemCode); + if (subSalarySobItem == null) { + SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemCode); + if (salaryItemPO == null) { + continue; + } else { + subSalarySobItem = SalarySobItemPO.builder().salaryItemId(salaryItemPO.getId()).salaryItemCode(salaryItemPO.getCode()).build(); + } + } + ExpressFormula subExpressFormula = expressFormulaMap.get(subSalarySobItem.getFormulaId()); + SalarySobItemPO finalSubSalarySobItem = subSalarySobItem; + SalaryCalcItemGraphNode destNode = nodeMap.computeIfAbsent(subSalarySobItem.getSalaryItemId(), key -> new SalaryCalcItemGraphNode(finalSubSalarySobItem, subExpressFormula)); + node.getDestNodes().add(destNode); + } + } + } + this.nodes = Lists.newArrayList(nodeMap.values()); + this.items = SalaryEntityUtil.convert2Map(salaryItemPOS, SalaryItemPO::getId, SalaryItemPO::getName); + } + + /** + * 瀵硅柂璧勬牳绠楁椂娑夊強鐨勮柂璧勯」鐩繘琛屾帓搴 + * 瀵逛簬涓娆¤柂璧勬牳绠楄岃█锛屼笉鍚岀殑钖祫椤圭洰涔嬮棿鍙兘浼氬瓨鍦ㄥ紩鐢ㄣ + * 渚嬪銆岀哗鏁堝伐璧=缁╂晥姣斾緥*(鍩烘湰宸ヨ祫+宀椾綅宸ヨ祫)銆嶏紝鍦ㄨ绠椼岀哗鏁堝伐璧勩嶅墠闇瑕佸厛璁$畻鍑恒岀哗鏁堟瘮渚嬨嶃併屽熀鏈伐璧勩嶃併屽矖浣嶅伐璧勩 + * 鎵浠ヨ柂璧勬牳绠楀墠闇瑕佸鎵娑夊強鐨勬墍鏈夎柂璧勯」鐩繘琛屼竴涓绠楁帓搴 + * 瀵硅柂璧勯」鐩殑鎺掑簭灏辩浉褰撲簬鏄涓涓屾湁鍚戞棤鐜殑鍥俱嶈繘琛屾嫇鎵戞帓搴忥紝涓涓柂璧勯」鐩氨鐩稿綋浜庡浘涓殑涓涓岄《鐐广 + * 鍏蜂綋绠楁硶濡備笅锛 + * 1銆佹牴鎹岃柂璧勮处濂楃殑钖祫椤圭洰銆嶃併屽叕寮忚鎯呫嶆瀯寤哄嚭鎵鏈夌殑銆岄《鐐广 + * 2銆佸皢鎵鏈夐《鐐圭殑鍏ュ害閮藉垵濮嬪寲涓0 + * 3銆侀亶鍘嗘墍鏈夌殑椤剁偣锛岃绠楁瘡涓《鐐圭殑鍏ュ害 + * 4銆佸垱寤轰竴涓槦鍒楋紝灏嗘墍鏈夊叆搴︿负0鐨勯《鐐归兘瀛樺叆闃熷垪 + * 5銆佹瘡娆′粠闃熷垪涓彇鍑轰竴涓偣锛屽皢璇ョ偣瀛樺叆缁撴灉闆嗗悎涓紝骞跺皢璇ラ《鐐圭殑鎵鏈夐偦鎺ョ偣鐨勫叆搴﹀噺1銆傚鏋滈偦鎺ョ偣鐨勫叆搴﹀彉涓轰簡0锛屽皢鍏跺姞鍏ラ槦鍒椾腑 + * 6銆侀噸澶嶆楠5锛岀洿鍒伴槦鍒楃┖浜 + * + * @return 鎺掑ソ搴忕殑钖祫椤圭洰id + */ + public List sort() { + // 寰幆閬嶅巻鎵鏈夐《鐐 + for (SalaryCalcItemGraphNode node : nodes) { + // 寰幆閬嶅巻姣忎釜椤剁偣鐨勯偦灞 + for (SalaryCalcItemGraphNode destNode : node.getDestNodes()) { + // 缁存姢姣忎釜椤剁偣鐨勫叆搴 + destNode.setInDegree(destNode.getInDegree() + 1); + } + } + + // 鍒涘缓涓涓槦鍒 + LinkedTransferQueue queue = new LinkedTransferQueue<>(); + + // 鍐嶆寰幆鎵鏈夐《鐐 + for (SalaryCalcItemGraphNode node : nodes) { + // 鑻ヨ椤剁偣鍏ュ害涓0锛屽垯鍔犲叆闃熷垪 + if (node.getInDegree() == 0) { + queue.offer(node); + } + } + + // 瀛樺偍缁撴灉鐨勫垪琛 + List result = new ArrayList<>(); + // 寰幆鐩村埌闃熷垪涓虹┖ + while (!queue.isEmpty()) { + // 鍙栧嚭闃熷垪澶撮儴鐨勯《鐐圭紪鍙 + SalaryCalcItemGraphNode node = queue.poll(); + // 灏嗚椤剁偣鍔犲叆鍒扮粨鏋滃垪琛ㄤ腑 + result.add(node.getSalaryCalcItem()); + // 鏍囪璇ラ《鐐瑰凡琚闂 + node.setVisited(true); + + // 閬嶅巻璇ラ《鐐圭殑閭诲眳 + for (SalaryCalcItemGraphNode destNode : node.getDestNodes()) { + // 鑻ヨ閭诲眳鏈璁块棶杩 + if (!destNode.isVisited()) { + // 灏嗚閭诲眳鐨勫叆搴﹀噺涓 + destNode.setInDegree(destNode.getInDegree() - 1); + // 鑻ヨ閭诲眳鍏ュ害宸茬粡鍙樹负0 + if (destNode.getInDegree() == 0) { + // 灏嗚閭诲眳鍔犲叆鍒伴槦鍒椾腑 + queue.offer(destNode); + } + } + } + } + + // 鍊掑簭 + Collections.reverse(result); + if (!Objects.equals(result.size(), nodes.size())) { + + List resultIds = SalaryEntityUtil.properties(result, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + String errItemName = nodes.stream() + .map(SalaryCalcItemGraphNode::getSalaryCalcItem) + .map(SalaryCalcItem::getSalaryItemId) + .filter(itemId -> !resultIds.contains(itemId)) + .map(itemId -> items.getOrDefault(itemId, "")) + .collect((Collectors.joining(",", "[", "]"))); + + throw new SalaryRunTimeException("钖祫椤圭洰:" + errItemName + "瀛樺湪闂幆锛"); + } + // 杩斿洖缁撴灉鍒楄〃 + return result; + } + + @Data + private static class SalaryCalcItemGraphNode { + + /** + * 钖祫椤圭洰鐨刬d + */ + private SalaryCalcItem salaryCalcItem; + + /** + * 鍏ュ害 + */ + private int inDegree; + + /** + * 鏄惁宸茶璁块棶 + */ + private boolean visited; + + /** + * 褰撳墠椤剁偣鐨勯偦灞 + */ + private List destNodes; + + public SalaryCalcItemGraphNode(SalarySobItemPO salarySobItem, ExpressFormula expressFormula) { + SalaryCalcItem salaryCalcItem = new SalaryCalcItem(); + salaryCalcItem.setSalaryItemId(salarySobItem.getSalaryItemId()); + salaryCalcItem.setSalaryItemCode(salarySobItem.getSalaryItemCode()); + salaryCalcItem.setIncomeCategory(salarySobItem.getIncomeCategory()); +// salaryCalcItem.setUseInEmployeeSalary(salarySobItem.getUseInEmployeeSalary()); +// salaryCalcItem.setDataType(salarySobItem.getDataType()); + salaryCalcItem.setRoundingMode(salarySobItem.getRoundingMode()); + salaryCalcItem.setPattern(salarySobItem.getPattern()); + salaryCalcItem.setExpressFormula(expressFormula); + this.salaryCalcItem = salaryCalcItem; + this.inDegree = 0; + this.visited = false; + this.destNodes = new ArrayList<>(); + } + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java index 3b658c769..95365eb1b 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcResult.java @@ -6,13 +6,7 @@ import lombok.Data; import java.util.List; -/** - * @description: - * @author: xiajun - * @modified By: xiajun - * @date: 2022/8/22 20:45 - * @version:v1.0 - */ + @Data @AllArgsConstructor public class SalaryCalcResult { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java new file mode 100644 index 000000000..8be3d2ed9 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTax.java @@ -0,0 +1,241 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 钖祫鏍哥畻璁$畻涓◣ + * + * @author xiajun + */ +@Data +@AllArgsConstructor +public class SalaryCalcTax { + + /** + * 钖祫鏍哥畻璁板綍 + */ + private SalaryAcctRecordPO salaryAcctRecord; + + /** + * 钖祫鏍哥畻鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + */ + private List salaryAcctTaxAgents; + + /** + * 钖祫鏍哥畻鍏宠仈鐨勮柂璧勬牳绠椾汉鍛 + */ + private List salaryAcctEmployees; + + /** + * 钖祫鏍哥畻鍏宠仈鐨勮柂璧勬牳绠楃粨鏋 + */ + private List salaryAcctResultValues; + + /** + * 涓◣鎵g即涔夊姟浜 + */ + private List taxAgents; + + /** + * 涓◣鎵g即涔夊姟浜虹殑涓◣淇℃伅 + */ + private List taxAgentTaxReturns; + + /** + * 涓◣鐢虫姤琛ㄥ瓧娈 + */ + private List taxReportColumns; + + /** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲 + */ + private List salarySobTaxReportRules; + + /** + * 鎶ラ佷汉鍛 + */ + private List employeeDeclares; + + public Map> buildCalcTaxRequestParam() { + // 钖祫鏍哥畻鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + Map> salaryAcctAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + // 钖祫鏍哥畻鍏宠仈鐨勮柂璧勬牳绠椾汉鍛 + Map> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxAgentId); + // 钖祫鏍哥畻鍏宠仈鐨勮柂璧勬牳绠楃粨鏋 + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); + // 涓◣鎵f涔夊姟浜 + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId); + // 涓◣鎵f涔夊姟浜虹殑涓◣淇℃伅 + Map taxAgentTaxReturnMap = SalaryEntityUtil.convert2Map(taxAgentTaxReturns, TaxAgentTaxReturnPO::getTaxAgentId); + // 涓◣鐢虫姤琛ㄥ瓧娈 + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + // 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲 + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex); + // 鎶ラ佷汉鍛 + Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + + Map> resultMap = new HashMap<>(); + + for (Map.Entry> entry : salaryAcctAgentMap.entrySet()) { + TaxAgentPO taxAgent = taxAgentMap.get(entry.getKey()); + if (taxAgent == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栧凡琚垹闄")); + } + TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnMap.get(taxAgent.getId()); + if (taxAgentTaxReturn == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜烘病鏈夌淮鎶や釜绋庝俊鎭")); + } + List salaryAcctEmployees = salaryAcctEmployeeMap.get(taxAgent.getId()); + if (CollectionUtils.isEmpty(salaryAcctEmployees)) { + continue; + } + List employeeDeclares = employeeDeclareMap.get(taxAgent.getId()); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "璇ヤ釜绋庢墸缂翠箟鍔′汉鏃犵敵鎶ヤ汉鍛")); + } + + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(entry.getValue().get(0).getTaxCycle())); + // 缁煎悎鎵寰 + requestParam.put("zhsd", buildZHSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees, + salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares)); + // 缁煎悎鎵寰 + requestParam.put("flsd", buildFLSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees, + salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares)); + + resultMap.put(taxAgent.getId(), requestParam); + } + return resultMap; + } + + private Map buildZHSDRequestParam(List salaryAcctTaxAgents, + List salaryAcctEmployees, + Map> salaryAcctResultValueMap, + Map> taxReportColumnMap, + Map salarySobTaxReportRuleMap, + List employeeDeclares) { + Map> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil + .group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + + Map requestParam = new HashMap<>(); + + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum + .parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + List taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString()); + List subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString()); + Map salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(subSalaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId); + + SalaryCalcTaxRequest salaryCalcTaxRequest = new SalaryCalcTaxRequest(salaryAcctEmployeeMap, + salaryAcctResultValueMap, taxReportColumns, salarySobTaxReportRuleMap, employeeDeclares); + + switch (incomeCategoryEnum) { + case WAGES_AND_SALARIES: + requestParam.put("zcgzxj", salaryCalcTaxRequest.buildZCGZXJRequestParam()); + break; + case ONETIME_ANNUAL_BONUS: + requestParam.put("qnycxjjsslb", salaryCalcTaxRequest.buildQNYCXJJSSLBRequestParam()); + break; + case COMPENSATION_FOR_RETIRE: + requestParam.put("ntycxbcjlb", salaryCalcTaxRequest.buildNTYCXBCJLBRequestParam()); + break; + case COMPENSATION_FOR_DISMISS: + requestParam.put("jcldhtycxbcjlb", salaryCalcTaxRequest.buildJCLDHTYCXBCJLBRequestParam()); + break; + case INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE: + requestParam.put("grgqjl", salaryCalcTaxRequest.buildGRGQJLRequestParam()); + break; + case ANNUITY_RECEIPT: + requestParam.put("qynj", salaryCalcTaxRequest.buildQYNJRequestParam()); + break; + case REMUNERATION_FOR_LABOR: + requestParam.put("lwbclb", salaryCalcTaxRequest.buildLWBCLBRequestParam()); + break; + case INCOME_FOR_INSURANCE_SALESMAN: + requestParam.put("bxyxy", salaryCalcTaxRequest.buildBXYXYRequestParam()); + break; + case INCOME_FOR_SECURITIES_BROKER: + requestParam.put("zqjjr", salaryCalcTaxRequest.buildZQJJRRequestParam()); + break; + case REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR: + requestParam.put("qtlxlwbc", salaryCalcTaxRequest.buildQTLXLWBCRequestParam()); + break; + case REMUNERATION_FOR_OTHER_LABOR: + requestParam.put("qtflxlwbc", salaryCalcTaxRequest.buildQTFLXLWBCRequestParam()); + break; + case REMUNERATION_FOR_AUTHOR: + requestParam.put("gcsdlb", salaryCalcTaxRequest.buildGCSDLBRequestParam()); + break; + case ROYALTIES: + requestParam.put("txq", salaryCalcTaxRequest.buildTXQRequestParam()); + break; + default: + break; + + } + } + return requestParam; + } + + private Map buildFLSDRequestParam(List salaryAcctTaxAgents, + List salaryAcctEmployees, + Map> salaryAcctResultValueMap, + Map> taxReportColumnMap, + Map salarySobTaxReportRuleMap, + List employeeDeclares) { + Map> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil + .group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + + Map requestParam = new HashMap<>(); + + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum + .parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + List taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString()); + List subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString()); + Map salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(subSalaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId); + + SalaryCalcTaxRequest salaryCalcTaxRequest = new SalaryCalcTaxRequest(salaryAcctEmployeeMap, + salaryAcctResultValueMap, taxReportColumns, salarySobTaxReportRuleMap, employeeDeclares); + + switch (incomeCategoryEnum) { + case CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES: + List> ssgsgxhllb = salaryCalcTaxRequest.buildRequestParams(IncomeCategoryEnum.CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + requestParam.put("ssgsgxhllb", ssgsgxhllb); + break; + case CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES: + List> lxgxhllb = salaryCalcTaxRequest.buildRequestParams(IncomeCategoryEnum.CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + requestParam.put("lxgxhllb", lxgxhllb); + break; + default: + break; + } + } + return requestParam; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java new file mode 100644 index 000000000..70963b916 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxFeedback.java @@ -0,0 +1,62 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.util.JsonUtil; +import lombok.Data; +import weaver.general.Util; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 寮傛绠楃◣鐨勫弽棣堢粨鏋 + */ +@Data +public class SalaryCalcTaxFeedback { + + private Map dataMap; + + private List employeeDeclares; + + public SalaryCalcTaxFeedback(Map dataMap, List employeeDeclares) { + this.dataMap = dataMap; + this.employeeDeclares = employeeDeclares; + } + + public Map buildZCGZXJFeedback() { + Map successDataMap = new HashMap<>(); + List successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class); + for (Map map : successList) { + // 璇佷欢鍙风爜 + String zzhm = Util.null2String(map.get("zzhm")); + // 搴旇ˉ閫绋庨 + String ybtse = Util.null2String(map.get("ybtse")); + + successDataMap.put(zzhm, ybtse); + } + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum())); + } + return resultMap; + } + + public Map buildOtherFeedback() { + Map successDataMap = new HashMap<>(); + List successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class); + for (Map map : successList) { + // 璇佷欢鍙风爜 + String zzhm = Util.null2String(map.get("zzhm")); + // 搴旇ˉ閫绋庨 + String ybtse = Util.null2String(map.get("yingkjse")); + + successDataMap.put(zzhm, ybtse); + } + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum())); + } + return resultMap; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java new file mode 100644 index 000000000..39eb225c0 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCalcTaxRequest.java @@ -0,0 +1,258 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.wbi.util.Util; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; + +@Data +@AllArgsConstructor +public class SalaryCalcTaxRequest { + + private Map salaryAcctEmployeeMap; + private Map> salaryAcctResultValueMap; + private List taxReportColumns; + private Map salarySobTaxReportRuleMap; + private List employeeDeclares; + + /** + * 姝e父宸ヨ祫钖噾 + * + * @return + */ + public Map buildZCGZXJRequestParam() { + // 浜哄憳鍒楄〃 + List> RYLBRequestParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + // 姝e父宸ヨ祫钖噾鍒楄〃 + List> ZCGZXJLBRequestParams = buildRequestParams(IncomeCategoryEnum.WAGES_AND_SALARIES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + // 浜哄憳鍒楄〃 + param.put("rylb", RYLBRequestParam); + // 姝e父宸ヨ祫钖噾鍒楄〃 + param.put("zcgzxjlb", ZCGZXJLBRequestParams); + // 姝e父宸ヨ祫钖噾鏄惁闇瑕佷笓椤 + param.put("zcgzxjsfxyzx", 1); + // 姝e父宸ヨ祫钖噾鏄惁浼犲叆涓撻」绱 + param.put("zcgzxjsfcrlj", 0); + // 鏄惁浼犲叆绱涓汉鍏昏侀噾锛2浣跨敤浼犲叆鏁版嵁 + param.put("gryljcl", 2); + + return param; + } + + /** + * 鍏ㄥ勾涓娆℃у閲戞敹鍏 + * + * @return + */ + public List> buildQNYCXJJSSLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ONETIME_ANNUAL_BONUS, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 绋块叕鎵寰 + * + * @return + */ + public List> buildGCSDLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 涓鑸姵鍔℃姤閰墍寰 + * + * @return + */ + public List> buildLWBCLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾 + * + * @return + */ + public List> buildJCLDHTYCXBCJLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_DISMISS, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 淇濋櫓钀ラ攢鍛樹剑閲戞敹鍏 + * + * @return + */ + public Map buildBXYXYRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + // 淇濋櫓钀ラ攢鍛樿柂閲戝垪琛 + param.put("bxyxylwbclb", requestParams); + // 鏄惁浼犲叆绱涓汉鍏昏侀噾锛2浣跨敤浼犲叆鏁版嵁 + param.put("gryljcl", 2); + return param; + } + + /** + * 璇佸埜缁忕邯浜轰剑閲戞敹鍏 + * + * @return + */ + public Map buildZQJJRRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + // 璇佸埜缁忕邯浜鸿柂閲戝垪琛 + param.put("zqjjrsdlb", requestParams); + // 鏄惁浼犲叆绱涓汉鍏昏侀噾锛2浣跨敤浼犲叆鏁版嵁 + param.put("gryljcl", 2); + return param; + } + + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰 + * + * @return + */ + public Map buildQTLXLWBCRequestParam() { + List> requestParams = buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + + Map param = new HashMap<>(); + param.put("qtlxlwbclb", Lists.newArrayList()); + // 鏄惁浼犲叆绱涓汉鍏昏侀噾锛2浣跨敤浼犲叆鏁版嵁 + param.put("gryljcl", 2); + return param; + } + + /** + * 鐗硅鏉冧娇鐢ㄨ垂鎵寰 + * + * @return + */ + public List> buildTXQRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ROYALTIES, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 涓汉鑲℃潈婵鍔辨敹鍏 + * + * @return + */ + public List> buildGRGQJLRequestParam() { + return buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 骞撮噾棰嗗彇 + * + * @return + */ + public List> buildQYNJRequestParam() { + return buildRequestParams(IncomeCategoryEnum.ANNUITY_RECEIPT, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 鍐呴涓娆℃цˉ鍋块噾 + * + * @return + */ + public List> buildNTYCXBCJLBRequestParam() { + return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_RETIRE, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + /** + * 鍏朵粬闈炶繛缁姵鍔℃姤閰墍寰 + * + * @return + */ + public List> buildQTFLXLWBCRequestParam() { + return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR, + employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap); + } + + public List> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum, + List employeeDeclares, + Map salaryAcctEmployeeMap, + Map> salaryAcctResultValueMap) { + List> requestParams = Lists.newArrayListWithExpectedSize(salaryAcctResultValueMap.size()); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeDeclare.getEmployeeId()); + if (salaryAcctEmployee == null) { + continue; + } + List salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId()); + if (salaryAcctResultValue == null) { + continue; + } + Map map = SalaryEntityUtil.convert2Map(salaryAcctResultValue, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); + Map requestParam = buildRequestParam(incomeCategoryEnum, employeeDeclare, map); + if (MapUtils.isNotEmpty(requestParam)) { + requestParams.add(requestParam); + } + } + return requestParams; + } + + private Map buildRequestParam(IncomeCategoryEnum incomeCategoryEnum, + EmployeeDeclarePO employeeDeclare, + Map salaryAcctResultValue) { + if (CollectionUtils.isEmpty(taxReportColumns)) { + return Collections.emptyMap(); + } + Map requestParam = Maps.newHashMap(); + // 濮撳悕 + requestParam.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); + // 璇佷欢鍙风爜 + requestParam.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + requestParam.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + Long dataKey = null; + SalarySobTaxReportRulePO salarySobTaxReportRule = salarySobTaxReportRuleMap.get(taxReportColumn.getReportColumnDataIndex()); + if (salarySobTaxReportRule != null && salarySobTaxReportRule.getSalaryItemId() != null) { + dataKey = salarySobTaxReportRule.getSalaryItemId(); + } + String value = salaryAcctResultValue.getOrDefault(dataKey, StringUtils.EMPTY); + if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { + value = Util.getBigDecimalValue(value, BigDecimal.ZERO).toPlainString(); + } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { + value = Util.getBigDecimalValue(value, BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString(); + } + requestParam.put(taxReportColumn.getRequestParamKey(), value); + } + return requestParam; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java new file mode 100644 index 000000000..f6292f980 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.dto; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏈姤閫佷汉鍛樺垪琛 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AbnormalEmployeeListDTO { + + //涓婚敭id + private Long id; + + //浜哄憳id + private Long employeeId; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + //宸ュ彿") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 8fadd2670..031b979db 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 钖祫鏍哥畻缁撴灉璇︽儏 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/9/21 5:13 PM - * @version:v1.0 - */ + * 钖祫鏍哥畻缁撴灉璇︽儏 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java index 57bbd85ad..89d196545 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java @@ -5,12 +5,13 @@ import com.engine.salary.common.LocalDateRange; import java.util.Collection; /** - * @description: 钖祫鏍哥畻缁撴灉楂樼骇鎼滅储 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/9/21 5:06 PM - * @version:v1.0 - */ + * 钖祫鏍哥畻缁撴灉楂樼骇鎼滅储 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryAcctResultSearchConditionDTO { // @SalarySearchCondition( diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java new file mode 100644 index 000000000..ff19dd7ec --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCalcTaxInfoDTO.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.Data; + +/** + * 钖祫鏍哥畻璁$畻涓◣ + * + * @author xiajun + */ +@Data +public class SalaryCalcTaxInfoDTO { + + /** + * 鏄惁鏄剧ず璁$畻涓◣鎸夐挳 + */ + private boolean showCalcTaxButton; + + /** + * 鏄惁鏄剧ず鑾峰彇涓◣璁$畻鍙嶉鎸夐挳 + */ + private boolean showCalcTaxFeedbackButton; + + /** + * 鏄惁鏄剧ず鏍哥畻绋庡悗钖祫鎸夐挳 + */ + private boolean showCalcAfterTaxButton; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java new file mode 100644 index 000000000..0e129b8c9 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/AbnormalEmployeeListQueryParam.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鏈姤閫佷汉鍛樺垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AbnormalEmployeeListQueryParam extends BaseQueryParam { + + //宸ュ彿銆佸鍚嶃佽韩浠借瘉鍙风爜") + private String keyword; + + //涓◣鐢虫姤璁板綍id") + private Long recordId; + + @JsonIgnore + //涓◣鎵g即涔夊姟浜篿d") + private Long taxAgentId; + + @JsonIgnore + //绋庢鎵灞炴湡") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java index 15bf4c09c..6821d3cc1 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java @@ -6,12 +6,13 @@ import lombok.Data; import java.util.Collection; /** - * @description: 钖祫鏍哥畻浜哄憳-浠庣幆姣斾笂鏈堝噺灏戞坊鍔 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/26/22 3:39 PM - * @version:v1.0 - */ + * 钖祫鏍哥畻浜哄憳-浠庣幆姣斾笂鏈堝噺灏戞坊鍔 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class SalaryAcctEmployeeAddParam { diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java index f0437b8d0..8f0ce99fa 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -33,8 +33,14 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { //浜哄憳濮撳悕") private String employeeName; + /** + * 绋庢鎵灞炴湡 + */ + private Date taxCycle; + //涓◣鎵g即涔夊姟浜") private Long taxAgentId; + private List taxAgentIds; //鍒嗛儴 private List subcompanyIds; @@ -51,6 +57,7 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { * @see SalaryEmployeeStatusEnum */ private SalaryEmployeeStatusEnum status; + //鐘舵(澶氶) private List statuses; @@ -62,7 +69,6 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { private String workcode; - private List taxAgentIds; private Set salaryMonths; diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java new file mode 100644 index 000000000..55fd34a0c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAfterTaxAcctCalculateParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 绋庡悗钖祫鏍哥畻鐨勫弬鏁 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAfterTaxAcctCalculateParam { + @DataCheck(require = true,message = "鍙傛暟閿欒锛岃柂璧勬牳绠楄褰旾D涓嶈兘涓虹┖") + private Long salaryAcctRecordId; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java new file mode 100644 index 000000000..d4745f149 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryCalcTaxParam.java @@ -0,0 +1,19 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +/** + * 钖祫鏍哥畻璁$畻涓◣ + * + * @author xiajun + */ +@Data +public class SalaryCalcTaxParam { + + /** + * 鍙傛暟閿欒锛岃柂璧勬牳绠楄褰旾D涓嶈兘涓虹┖ + */ + @DataCheck(require = true,message = "钖祫鏍哥畻璁板綍ID涓嶈兘涓虹┖") + private Long salaryAcctRecordId; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java new file mode 100644 index 000000000..a325a71a1 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctCalcTaxReqPO.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.salaryacct.po; + +import com.engine.hrmelog.annotation.ElogTransform; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ElogTransform(name = "钖祫鏍哥畻鍦ㄧ嚎璁$畻涓◣璇锋眰") +//hrsa_acct_calc_tax_req +public class SalaryAcctCalcTaxReqPO { + + @ElogTransform(name = "涓婚敭id", ignore = true) + private Long id; + + @ElogTransform(name = "钖祫鏍哥畻璁板綍", ignore = true) + private Long salaryAcctRecordId; + + @ElogTransform(name = "涓◣鎵g即涔夊姟浜篿d", ignore = true) + private Long taxAgentId; + + @ElogTransform(name = "璇锋眰requestId", ignore = true) + private String requestId; + + @ElogTransform(name = "绉熸埛key", ignore = true) + private String tenantKey; + + @ElogTransform(name = "鍒涘缓浜篿d", ignore = true) + private Long creator; + + @ElogTransform(name = "鏄惁鍒犻櫎", ignore = true) + private Integer deleteType; + + @ElogTransform(name = "鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + @ElogTransform(name = "鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + //--------鏉′欢---------- + //涓婚敭id闆嗗悎 + private Collection ids; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index c456e80da..4fcc8dce1 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -82,6 +82,17 @@ public class SalaryAcctEmployeePO { @SalaryFormulaVar(defaultLabel = "钖祫鎵灞炴湀", labelId = 86321, dataType = "string") private Date salaryMonth; + /** + * 绋庢鎵灞炴湡 + */ + private Date taxCycle; + + /** + * 鎵寰楅」鐩 + */ + private String incomeCategory; + + /** * 绉熸埛key */ diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java index a17ecf398..ad062d7ff 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java @@ -95,6 +95,11 @@ public class SalaryAcctRecordPO { @ElogTransform( name = "澶囨敞" ) private String description; + /** + * 鎺у埗鏌ョ湅 + */ + private Integer controlView; + /** * 绉熸埛key */ diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java index 3e985265e..187e38d0e 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java @@ -10,12 +10,13 @@ import java.util.Collection; import java.util.Date; /** - * @description: 钖祫鏍哥畻缁撴灉涓存椂瀛樺偍 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/27/21 10:05 AM - * @version:v1.0 - */ + * 钖祫鏍哥畻缁撴灉涓存椂瀛樺偍 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @Accessors(chain = true) diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java new file mode 100644 index 000000000..19444573f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultValuePO.java @@ -0,0 +1,100 @@ +//package com.engine.salary.entity.salaryacct.po; +// +//import com.baomidou.mybatisplus.annotation.TableField; +//import com.baomidou.mybatisplus.annotation.TableName; +//import com.weaver.hrm.salary.annotation.DecryptField; +//import com.weaver.hrm.salary.annotation.EncryptField; +//import com.weaver.hrm.salary.annotation.SecurityConfig; +//import com.weaver.hrm.salary.handle.SalaryJsonTypeHandler; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.time.LocalDateTime; +//import java.util.Map; +//import java.util.Set; +// +///** +// * @description: 钖祫鏍哥畻缁撴灉 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 8/19/22 4:50 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//@TableName(value = "hrsa_acct_result_value", autoResultMap = true) +//public class SalaryAcctResultValuePO { +// +// /** +// * 涓婚敭id +// */ +// private Long id; +// +// /** +// * 钖祫鏍哥畻璁板綍id +// */ +// private Long salaryAcctRecordId; +// +// /** +// * 钖祫鏍哥畻浜哄憳id +// */ +// private Long SalaryAcctEmployeeId; +// +// /** +// * 钖祫鏍哥畻缁撴灉 +// */ +// @TableField(exist = false) +// private Map resultValue; +// +// /** +// * 鍥炵畻鍓嶇殑钖祫鏍哥畻 +// */ +// @TableField(exist = false) +// private Map originResultValue; +// +// /** +// * 钖祫鏍哥畻缁撴灉锛堝彧鍦ㄥ姞瀵嗚В瀵嗕腑浣跨敤锛 +// */ +// @EncryptField +// @DecryptField +// @SecurityConfig(tableName = "hrsa_acct_result_value", filedName = "result_value_json", dataTableName = "hrsa_acct_result_encdata") +// private String resultValueJson; +// +// /** +// * 鍥炵畻鍓嶇殑钖祫鏍哥畻锛堝彧鍦ㄥ姞瀵嗚В瀵嗕腑浣跨敤锛 +// */ +// @DecryptField +// @SecurityConfig(tableName = "hrsa_acct_result_value", filedName = "origin_result_value_json", dataTableName = "hrsa_acct_result_encdata") +// private String originResultValueJson; +// +// /** +// * 閿佸畾鐨勮柂璧勯」鐩 +// */ +// @TableField(typeHandler = SalaryJsonTypeHandler.class) +// private Set lockSalaryItemIds; +// +// /** +// * 绉熸埛key +// */ +// private String tenantKey; +// +// /** +// * 鍒涘缓浜篿d +// */ +// private Long creator; +// +// /** +// * 鏄惁鍒犻櫎 +// */ +// private Integer deleteType; +// +// /** +// * 鍒涘缓鏃堕棿 +// */ +// private LocalDateTime createTime; +// +// /** +// * 鏇存柊鏃堕棿 +// */ +// private LocalDateTime updateTime; +//} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java new file mode 100644 index 000000000..d12a5a5ac --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -0,0 +1,86 @@ +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.util.Date; + +/** + * 钖祫鏍哥畻璁板綍瀵瑰簲鐨勪釜绋庢墸缂翠箟鍔′汉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +// "hrsa_acct_tax_agent") +public class SalaryAcctTaxAgentPO { + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 钖祫鏍哥畻璁板綍鐨刬d + */ + private Long salaryAcctRecordId; + + /** + * 鏀跺叆鎵寰楅」鐩 + */ + private Integer incomeCategory; + + /** + * 涓◣鎵g即涔夊姟浜虹殑id + */ + private Long taxAgentId; + + /** + * 钖祫鎵灞炴湀 + */ + private Date salaryMonth; + + /** + * 绋庢鎵灞炴湡 + */ + private Date taxCycle; + + /** + * 绉熸埛key + */ + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + + + private Date startMonth; + private Date endMonth; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java index 08d73b41d..71e5926d8 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java @@ -6,15 +6,16 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -import java.time.LocalDateTime; +import java.util.Date; /** - * @description: 鏍哥畻缁撴灉鐨勬牎楠岀粨鏋滄槑缁嗕复鏃跺瓨鍌 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/27/21 3:41 PM - * @version:v1.0 - */ + * 鏍哥畻缁撴灉鐨勬牎楠岀粨鏋滄槑缁嗕复鏃跺瓨鍌 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @Accessors(chain = true) @@ -76,10 +77,10 @@ public class SalaryCheckResultDetailTempPO { /** * 鍒涘缓鏃堕棿 */ - private LocalDateTime createTime; + private Date createTime; /** * 鏇存柊鏃堕棿 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java index f8f8da978..bb0ae78e3 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java @@ -5,15 +5,16 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; /** - * @description: 钖祫鏍哥畻鏍¢獙寮傚父缁撴灉 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/7/21 10:44 AM - * @version:v1.0 - */ + * 钖祫鏍哥畻鏍¢獙寮傚父缁撴灉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor @@ -64,10 +65,10 @@ public class SalaryCheckResultPO { /** * 鍒涘缓鏃堕棿 */ - private LocalDateTime createTime; + private Date createTime; /** * 鏇存柊鏃堕棿 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java index b57210197..8120e68ee 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java @@ -5,15 +5,16 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.LocalDateTime; +import java.util.Date; /** - * @description: 钖祫鏍哥畻鏍¢獙寮傚父缁撴灉鏄庣粏 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/7/21 10:47 AM - * @version:v1.0 - */ + * 钖祫鏍哥畻鏍¢獙寮傚父缁撴灉鏄庣粏 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor @@ -74,10 +75,10 @@ public class SalaryCheckResultRecordPO { /** * 鍒涘缓鏃堕棿 */ - private LocalDateTime createTime; + private Date createTime; /** * 鏇存柊鏃堕棿 */ - private LocalDateTime updateTime; + private Date updateTime; } diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index 6defd200c..e137fb1eb 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -158,4 +158,41 @@ public class SysSalaryItemBO { .sharedType(sysSalaryItemPO.getSharedType()) .build(); } + + /** + * 绯荤粺钖祫椤圭洰杞崲鎴愯嚜瀹氫箟钖祫椤圭洰 + * + * @param sysSalaryItemPO 绯荤粺钖祫椤圭洰 + * @param employeeId 浜哄憳id + * @return + */ + public static SalaryItemPO convert2SalaryItemPO(SysSalaryItemPO sysSalaryItemPO, Date now, Long employeeId) { + if (sysSalaryItemPO == null) { + return null; + } + long id = IdGenerator.generate(); + return SalaryItemPO.builder() + .id(id) + .code(sysSalaryItemPO.getCode()) + .name(sysSalaryItemPO.getName()) + .systemType(SalarySystemTypeEnum.SYSTEM.getValue()) + .sysSalaryItemId(sysSalaryItemPO.getId()) + .useDefault(sysSalaryItemPO.getUseDefault()) + .useInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary()) + .roundingMode(sysSalaryItemPO.getRoundingMode()) + .pattern(sysSalaryItemPO.getPattern()) + .valueType(sysSalaryItemPO.getValueType()) + .dataType(sysSalaryItemPO.getDataType()) + .formulaId(sysSalaryItemPO.getFormulaId()) + .description(sysSalaryItemPO.getDescription()) + .canEdit(sysSalaryItemPO.getCanEdit()) + .creator(employeeId) + .deleteType(NumberUtils.INTEGER_ZERO) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .taxAgentIds(sysSalaryItemPO.getTaxAgentIds()) + .sharedType(sysSalaryItemPO.getSharedType()) + .build(); + } } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java new file mode 100644 index 000000000..bf5708fe5 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobInitEnv.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.salarysob.bo; + +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import lombok.Data; +import weaver.hrm.User; + +import java.util.List; + +/** + * 鍒濆鍖栬柂璧勮处濂 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobInitEnv { + + private User currentUser; + private SalarySobBasicSaveParam saveParam; + private SalarySobPO salarySob; + private List salarySobItems; +} diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 3dfde99ef..bc8aa4ecb 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -101,6 +101,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salarySobItemGroupId(salarySobItemGroupIdMap.getOrDefault(salarySobDefaultItemPO.getSobDefaultItemGroupId(), NumberUtils.LONG_ZERO)) .salaryItemId(salaryItemPO.getId()) + .salaryItemCode(salaryItemPO.getCode()) .formulaId(salaryItemPO.getFormulaId()) .sortedIndex(salarySobDefaultItemPO.getSortedIndex()) .description(salaryItemPO.getDescription()) @@ -127,6 +128,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salarySobItemGroupId(NumberUtils.LONG_ZERO) .salaryItemId(salaryItemPO.getId()) + .salaryItemCode(salaryItemPO.getCode()) .formulaId(salaryItemPO.getFormulaId()) .sortedIndex(i) .description(salaryItemPO.getDescription()) diff --git a/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java new file mode 100644 index 000000000..22a1a7a37 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalaryItemTopologyDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.engine.salary.entity.salaryformula.ExpressFormula; +import lombok.Data; + +import java.util.List; + +@Data +public class SalaryItemTopologyDTO { + + /** + * 钖祫椤圭洰id + */ + private Long salaryItemId; + + /** + * 钖祫椤圭洰鍚嶇О + */ + private String salaryItemName; + + /** + * 鍏紡 + */ + ExpressFormula formula; + + /** + * 鏍哥畻鍊 + */ + private String result; + + private List children; + +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java new file mode 100644 index 000000000..a64d9f7a7 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobAddUpRuleDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobAddUpRuleDTO { + + //鎵寰楅」鐩殑id") + private String incomeCategoryId; + + //鎵寰楅」鐩殑鍚嶇О") + private String incomeCategoryName; + + //寰鏈熺疮璁℃儏鍐电殑瀛楁瀵瑰簲鍏崇郴") + private List addUpRules; + + @Data + public static class AddUpRuleDTO { + + //鎵寰楅」鐩殑id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //寰鏈熺疮璁℃儏鍐电殑瀛楁鍚嶇О") + private String addUpColumnName; + + //寰鏈熺疮璁℃儏鍐电殑瀛楁绱㈠紩") + private String addUpColumnDataIndex; + + //寰鏈熺疮璁℃儏鍐电殑瀛楁鍜岃柂璧勯」鐩殑瀵瑰簲鍏崇郴") + private List> salaryItem; + + //瀵瑰簲鍏崇郴鏄惁鍙互缂栬緫") + private boolean canEdit; + } +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java index 70a688b10..5a1f4ed2b 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java @@ -65,4 +65,8 @@ public class SalarySobCycleDTO { private Date attendCycleFromDate; @SalaryFormulaVar(defaultLabel = "鑰冨嫟鍛ㄦ湡缁撴潫鏃ユ湡", labelId = 86321, dataType = "string") private Date attendCycleEndDate; + + + //瀛樺湪寮傚父浜哄憳鏁伴噺 + private Integer abnormalEmployeeNum; } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java new file mode 100644 index 000000000..b1c6e2330 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxReportRuleDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.salarysob.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobTaxReportRuleDTO { + + //鎵寰楅」鐩殑id + private String incomeCategoryId; + + //鎵寰楅」鐩殑鍚嶇О + private String incomeCategoryName; + + //涓◣鐢虫姤琛ㄧ殑瀵瑰簲鍏崇郴 + private List taxReportRules; + + @Data + public static class TaxReportRuleDTO { + + //鎵寰楅」鐩殑id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //涓◣鐢虫姤琛ㄥ瓧娈 + private String reportColumnName; + + //涓◣鐢虫姤琛ㄧ储寮 + private String reportColumnDataIndex; + + //涓◣鐢虫姤琛ㄥ瓧娈靛拰钖祫椤圭洰鐨勫搴斿叧绯 + private List> salaryItem; + + //瀵瑰簲鍏崇郴鏄惁鍙互缂栬緫 + private boolean canEdit; + } +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java new file mode 100644 index 000000000..787d71271 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobTaxRuleDTO.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.salarysob.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庤鍒 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SalarySobTaxRuleDTO { + + //鎵寰楅」鐩殑id + private String incomeCategoryId; + + //鎵寰楅」鐩殑鍚嶇О + private String incomeCategoryName; + + //涓◣鐨勫搴斿叧绯 + private List taxRules; + + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class TaxRuleDTO { + + //涓◣瀛楁 + private String name; + + //涓◣绱㈠紩 + private String taxIndex; + + //涓◣瀛楁鍜岃柂璧勯」鐩殑瀵瑰簲鍏崇郴 + private Long salaryItemId; + private String salaryItemName; + + //涓◣瀛楁鐨勫 + private String value; + + //瀵瑰簲鍏崇郴鏄惁鍙互缂栬緫 + private boolean canEdit; + + + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java new file mode 100644 index 000000000..2db5e982e --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalaryItemTopologyQueryParam.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.salarysob.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 钖祫椤圭洰鎷撴墤鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryItemTopologyQueryParam { + + /** + * 钖祫璐﹀id + */ + @DataCheck(require = true, message = "钖祫璐﹀鐨処D涓嶅厑璁镐负绌") + private Long salarySobId; + + /** + * 钖祫椤圭洰id + */ + private Long salaryItemId; + + /** + * 钖祫鏍哥畻浜哄憳id + */ + private Long acctEmpId; +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java new file mode 100644 index 000000000..7e069c556 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAddUpRuleSaveParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴斾繚瀛樺弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobAddUpRuleSaveParam { + + //钖祫璐﹀鐨刬d") + private Long salarySobId; + + //寰鏈熺疮璁℃儏鍐电殑瀵瑰簲鍏崇郴") + private List incomeCategoryParams; + + @Data + public static class AddUpRuleIncomeCategoryParam { + + //鎵寰楅」鐩") + private String incomeCategory; + + //寰鏈熺疮璁℃儏鍐电殑瀵瑰簲鍏崇郴") + private List addUpRuleParams; + } + + @Data + public static class AddUpRuleParam { + + //钖祫椤圭洰鐨刬d") + private Long salaryItemId; + + //寰鏈熺疮璁℃儏鍐电殑瀛楁绱㈠紩") + private String addUpColumnDataIndex; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java index 1b77845cc..8b47120d0 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleQueryParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 璋冭柂璁¤柂瑙勫垯鏌ヨ鍙傛暟 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/31/21 1:52 PM - * @version:v1.0 - */ + * 璋冭柂璁¤柂瑙勫垯鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java index 58a39981f..3d98644fd 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobAdjustRuleSaveParam.java @@ -10,12 +10,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 璋冭柂璁¤柂瑙勫垯淇濆瓨鍙傛暟 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/31/21 11:03 AM - * @version:v1.0 - */ + * 璋冭柂璁¤柂瑙勫垯淇濆瓨鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java index f8fcfd5fe..ddaf3f41b 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java @@ -41,11 +41,11 @@ public class SalarySobBasicSaveParam { private List taxAgentIds; /** - * 钖祫绫诲瀷涓嶅厑璁镐负绌 + * 鎵寰楅」鐩笉鍏佽涓虹┖ * * @see IncomeCategoryEnum */ - @DataCheck(require = true, message = "钖祫绫诲瀷涓嶅厑璁镐负绌") + @DataCheck(require = true, message = "鎵寰楅」鐩笉鍏佽涓虹┖") private Integer taxableItems; /** diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java index 76095c62b..9f55e873c 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobCheckRuleSaveParam.java @@ -6,12 +6,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * @description: 钖祫璐﹀鐨勬牎楠岃鍒欎繚瀛樺弬鏁 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/20/22 10:31 AM - * @version:v1.0 - */ + * 钖祫璐﹀鐨勬牎楠岃鍒欎繚瀛樺弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Accessors(chain = true) public class SalarySobCheckRuleSaveParam { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java index f0e9c4004..c5944e9b8 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobItemSaveParam.java @@ -9,12 +9,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 钖祫璐﹀钖祫椤圭洰淇濆瓨鍙傛暟 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/25/21 2:43 PM - * @version:v1.0 - */ + * 钖祫璐﹀钖祫椤圭洰淇濆瓨鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java index e71a6e449..ed5f39c96 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java @@ -5,8 +5,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; /** - * 璐﹀鏌ヨ - *

Copyright: Copyright (c) 2024

+ * 钖祫璐﹀鍒楄〃鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

*

Company: 娉涘井杞欢

* * @author qiantao diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java index fc202ee92..8790d8550 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java @@ -8,12 +8,13 @@ import lombok.NoArgsConstructor; import java.util.Collection; /** - * @description: 钖祫璐﹀浜哄憳鑼冨洿-鐩存帴鏌ヨ - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/3/21 1:24 PM - * @version:v1.0 - */ + * 钖祫璐﹀浜哄憳鑼冨洿-鐩存帴鏌ヨ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java index 41f66ec6b..1f60695c5 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeQueryParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 钖祫璐﹀浜哄憳鑼冨洿鏌ヨ鏉′欢 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/22/21 11:10 AM - * @version:v1.0 - */ + * 钖祫璐﹀浜哄憳鑼冨洿鏌ヨ鏉′欢 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java new file mode 100644 index 000000000..1b1212d04 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxReportRuleSaveParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobTaxReportRuleSaveParam { + + //钖祫璐﹀鐨刬d + private Long salarySobId; + + //涓嶅悓鎵寰楅」鐩殑涓◣鐢虫姤琛ㄧ殑瀵瑰簲鍏崇郴 + private List incomeCategoryParams; + + @Data + public static class TaxReportRuleIncomeCategoryParam { + + //鎵寰楅」鐩 + private String incomeCategory; + + //涓◣鐢虫姤琛ㄧ殑瀵瑰簲鍏崇郴 + private List taxReportRuleParams; + } + + @Data + public static class TaxReportRuleParam { + + //涓◣鐢虫姤琛ㄧ殑鍒楃储寮 + private String reportColumnDataIndex; + + //钖祫椤圭洰鐨刬d + private Long salaryItemId; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java new file mode 100644 index 000000000..bf3be6fc6 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobTaxRuleSaveParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.salarysob.param; + +import lombok.Data; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庤鍒 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobTaxRuleSaveParam { + + //钖祫璐﹀鐨刬d + private Long salarySobId; + + //涓嶅悓鎵寰楅」鐩殑涓◣鐨勫搴斿叧绯 + private List incomeCategoryParams; + + @Data + public static class TaxReportRuleIncomeCategoryParam { + + //鎵寰楅」鐩 + private String incomeCategory; + + //涓◣鐨勫搴斿叧绯 + private List taxRuleParams; + } + + @Data + public static class TaxRuleParam { + + //涓◣鐨勫垪绱㈠紩 + private String taxIndex; + + //钖祫椤圭洰鐨刬d + private Long salaryItemId; + } +} diff --git a/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java b/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java index 16ef28ccd..c358a2776 100644 --- a/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java +++ b/src/com/engine/salary/entity/salarysob/param/UpdateCheckRuleFormulaParam.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 鏇存柊鏍¢獙瑙勫垯鐨勫叕寮忔牎楠岃鍒欐洿鏂板弬鏁 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/8/21 10:35 AM - * @version:v1.0 - */ + * 鏇存柊鏍¢獙瑙勫垯鐨勫叕寮忔牎楠岃鍒欐洿鏂板弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java new file mode 100644 index 000000000..68be3de77 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_sob_add_up_rule +public class SalarySobAddUpRulePO { + + //涓婚敭id + private Long id; + //钖祫璐﹀id + private Long salarySobId; + //鏀跺叆鎵寰楅」鐩 + private String incomeCategory; + //钖祫椤圭洰id + private Long salaryItemId; + //寰鏈熺疮璁℃儏鍐电殑瀛楁绱㈠紩 + private String addUpColumnDataIndex; + //绉熸埛key + private String tenantKey; + //鍒涘缓浜篿d + private Long creator; + //鏄惁鍒犻櫎 + private Integer deleteType; + //鍒涘缓鏃堕棿 + private Date createTime; + //鏇存柊鏃堕棿 + private Date updateTime; + + private Collection ids; + private Collection salarySobIds; +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java index bca70753e..58c0b1473 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobDefaultItemGroupPO.java @@ -76,4 +76,5 @@ public class SalarySobDefaultItemGroupPO { private Date updateTime; Collection ids; + Collection incomeCategorys; } diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java index 011f992c4..7ba0c73fc 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -50,6 +50,11 @@ public class SalarySobItemPO { @XStreamAsAttribute private Long salarySobId; + /** + * 鎵寰楅」鐩 + */ + private String incomeCategory; + /** * 钖祫椤圭洰鐨刬d */ @@ -57,6 +62,13 @@ public class SalarySobItemPO { @XStreamAsAttribute private Long salaryItemId; + /** + * 钖祫椤圭洰鐨刢ode + */ + private String salaryItemCode; + + + /** * 钖祫璐﹀钖祫椤圭洰鍒嗙粍id */ diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java index a24fd7b06..e2c2e177e 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salarysob.po; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.hrmelog.annotation.ElogTransform; import com.engine.salary.annotation.Auth; import com.engine.salary.enums.auth.AuthCheckTypeEnum; @@ -63,6 +64,7 @@ public class SalarySobPO { /** * 搴旂◣椤圭洰銆1:姝e父宸ヨ祫钖噾鎵寰 + * @see IncomeCategoryEnum */ @ElogTransform( name="钖祫绫诲瀷" ) @Compare diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java new file mode 100644 index 000000000..05ec43f5c --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_sob_tax_report_rule +public class SalarySobTaxReportRulePO { + + //涓婚敭id + private Long id; + //钖祫璐﹀id + private Long salarySobId; + //鏀跺叆鎵寰楅」鐩 + private String incomeCategory; + //涓◣鐢虫姤琛ㄥ搴斿瓧娈 + private String reportColumnDataIndex; + //钖祫椤圭洰id + private Long salaryItemId; + //绉熸埛key", ignore = true) + private String tenantKey; + //鍒涘缓浜篿d", ignore = true) + private Long creator; + //鏄惁鍒犻櫎", ignore = true) + private Integer deleteType; + //鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + //鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + + private Collection ids; + private Collection salarySobIds; +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java new file mode 100644 index 000000000..4bd4c0613 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxRulePO.java @@ -0,0 +1,60 @@ +package com.engine.salary.entity.salarysob.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobTaxRulePO { + /** + * ID + */ + private Long id; + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + /** + * 淇敼鏃堕棿 + */ + private Date updateTime; + /** + * 鍒涘缓浜篿d + */ + private Long creator; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + /** + * 绉熸埛KEY + */ + private String tenantKey; + /** + * 钖祫璐﹀鐨刬d + */ + private Long salarySobId; + /** + * 鎵寰楅」鐩 + */ + private String incomeCategory; + /** + * 涓◣鍒楃储寮 + */ + private String taxIndex; + /** + * 钖祫椤圭洰id + */ + private Long salaryItemId; + + //涓婚敭id闆嗗悎 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java new file mode 100644 index 000000000..e49e5bef2 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -0,0 +1,108 @@ +package com.engine.salary.entity.taxagent.bo; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.db.IdGenerator; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * 鎶ョ◣淇℃伅BO + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxAgentTaxReturnBO { + + public static TaxAgentTaxReturnMainFormDTO convertPo2FormDto(TaxAgentTaxReturnPO taxReturnPO) { + TaxAgentTaxReturnMainFormDTO dto = new TaxAgentTaxReturnMainFormDTO(); + dto.setId(taxReturnPO.getId()); + dto.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.parseByValue(taxReturnPO.getPasswordType())); + dto.setCity(taxReturnPO.getCity()); + dto.setCityName(taxReturnPO.getCityName()); + dto.setProvince(taxReturnPO.getProvince()); + dto.setNation(taxReturnPO.getNation()); + dto.setAreaCode(taxReturnPO.getAreaCode()); + dto.setTaxCode(taxReturnPO.getTaxCode()); + dto.setAccount(taxReturnPO.getRealAccount()); + dto.setNetPassword(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null); + dto.setRealNamePassword(TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(taxReturnPO.getPasswordType()) ? taxReturnPO.getPwd() : null); + dto.setTaxRegistrationNumber(taxReturnPO.getTaxRegistrationNumber()); + dto.setDepartmentCode(taxReturnPO.getDepartmentCode()); + dto.setCheckStatus(TaxAgentTaxReturnStatusEnum.parseByValue(taxReturnPO.getCheckStatus())); + dto.setFailReason(taxReturnPO.getFailReason()); + return dto; + } + + public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + Date now = new Date(); + return TaxAgentTaxReturnPO.builder() + .taxAgentId(saveParam.getTaxAgentId()) + .taxCode(saveParam.getTaxCode()) + .nation(saveParam.getNation()) + .city(saveParam.getCity()) + .cityName(saveParam.getCityName()) + .province(saveParam.getProvince()) + .areaCode(saveParam.getAreaCode()) + .realAccount(saveParam.getAccount()) + .passwordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + .pwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + .failReason("") + .id(IdGenerator.generate()) + .checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + } + + public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + Date now = new Date(); + po.setTaxCode(saveParam.getTaxCode()); + po.setNation(saveParam.getNation()); + po.setCity(saveParam.getCity()); + po.setCityName(saveParam.getCityName()); + po.setProvince(saveParam.getProvince()); + po.setAreaCode(saveParam.getAreaCode()); + po.setRealAccount(saveParam.getAccount()); + po.setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())); + po.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()); + po.setTaxAgentId(saveParam.getTaxAgentId()); + po.setUpdateTime(now); + } + + public static Map convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { + Map requestMap = new HashMap<>(); + requestMap.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestMap.put("qymc", taxAgent.getName()); + requestMap.put("mmlx", taxAgentTaxReturn.getPasswordType()); + requestMap.put("smzh", taxAgentTaxReturn.getRealAccount()); + requestMap.put("smmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsmmm", "1"); + requestMap.put("sbmm", taxAgentTaxReturn.getPwd()); + requestMap.put("jmsbmm", "1"); + requestMap.put("djxhid", taxAgentTaxReturn.getTaxRegistrationNumber()); + requestMap.put("nsrsbh", taxAgentTaxReturn.getTaxCode()); + requestMap.put("areaid", taxAgentTaxReturn.getAreaCode()); + requestMap.put("bmbh", taxAgentTaxReturn.getDepartmentCode()); + requestMap.put("bmmc", taxAgentTaxReturn.getDepartmentName()); + return requestMap; + } + + @Override + public String toString() { + return super.toString(); + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java new file mode 100644 index 000000000..eba6c9768 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.SalaryI18nUtil; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 绋庡弸楠岃瘉鎴愬姛淇℃伅 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@ApiModel("绋庡弸楠岃瘉鎴愬姛淇℃伅") +public class TaxAgentTaxReturnCheckDTO { + /** + * 楠岃瘉鐘舵 + * @see TaxAgentTaxReturnStatusEnum + */ + //楠岃瘉鐘舵") + private Integer status; + + //鐧昏搴忓彿") + private String taxRegistrationNumber; + + //閮ㄩ棬缂栧彿") + private String departmentCode; + + //楠岃瘉鎻愮ず淇℃伅") + private String message; + + //璇︾粏鏁版嵁") + private List records; + + public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { + this.message = message; + if (TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(status) || TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue().equals(status)) { + this.message = SalaryI18nUtil.getI18nLabel( 153350, "楠岃瘉鎴愬姛锛屾姤绋庝富浣撲俊鎭凡涓庣◣灞绯荤粺杩涜璁よ瘉纭"); + } + } +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java new file mode 100644 index 000000000..cf6ca11da --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -0,0 +1,75 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 绋庡弸楠岃瘉淇℃伅琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ApiModel("绋庡弸楠岃瘉淇℃伅") +public class TaxAgentTaxReturnCheckFormDTO { + + //绋庡彿") + private String taxCode; + + //楠岃瘉淇℃伅id") + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + //涓◣鎵g即涔夊姟浜篿d") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //涓◣鎵g即涔夊姟浜") + private String taxAgentName; + + //鐧昏搴忓彿") + private String taxRegistrationNumber; + + //绾崇◣浜虹姸鎬") + private String taxpayerStatus; + + //娉曚汉濮撳悕") + private String legalPersonName; + + //鑱旂郴鐢佃瘽") + private String mobile; + + //鐢熶骇缁忚惀鍦板潃") + private String businessAddress; + + //琛屼笟鍚嶇О") + private String industryName; + + //涓荤绋庡姟鏈哄叧") + private String taxAuthorities; + + //涓荤绋庡姟绉戞墍") + private String taxBranch; + + + //鏄惁鍒嗛儴闂ㄥ妗") + private SalaryOnOffEnum divideFiling; + + //閮ㄩ棬鍚嶇О") + private String departmentName; + + //閮ㄩ棬缂栫爜") + private String departmentCode; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java new file mode 100644 index 000000000..67f1c5360 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnListDTO.java @@ -0,0 +1,58 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 绋庡弸鎶ョ◣淇℃伅鍒楄〃 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//绋庡弸鎶ョ◣淇℃伅鍒楄〃 +public class TaxAgentTaxReturnListDTO { + + //搴忓彿 + @JsonSerialize(using = ToStringSerializer.class) + private Long index; + + //绋庡彿 + private String taxCode; + + //涓◣鎵g即涔夊姟浜 + private String taxAgentName; + + //鐧昏搴忓彿 + private String taxRegistrationNumber; + + //绾崇◣浜虹姸鎬 + private String taxpayerStatus; + + //涓荤绋庡姟鏈哄叧 + private String taxAuthorities; + + //涓荤绋庡姟绉戞墍 + private String taxBranch; + + //鐢熶骇缁忚惀鍦板潃 + private String businessAddress; + + //琛屼笟鍚嶇О + private String industryName; + + //娉曚汉濮撳悕 + private String legalPersonName; + + //鑱旂郴鐢佃瘽 + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java new file mode 100644 index 000000000..0438e01b5 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -0,0 +1,75 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 鎶ョ◣淇℃伅琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鎶ョ◣淇℃伅琛ㄥ崟") +public class TaxAgentTaxReturnMainFormDTO { + + //涓婚敭id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //鍚嶇О") + private String name; + + //绋庡彿") + private String taxCode; + + //鎶ョ◣鎵灞炲尯鍩") + private String city; + private String cityName; + + //鐪佷唤") + private String province; + + //鍥藉") + private String nation; + + //琛屾斂鍖哄垝浠g爜") + private String areaCode; + + //瀵嗙爜鏍¢獙绫诲瀷") + private TaxAgentTaxReturnPasswordTypeEnum passwordType; + + //涓◣缃戞姤瀵嗙爜") + private String netPassword; + + //瀹炲悕璐﹀彿") + private String account; + + //瀹炲悕璐﹀彿瀵嗙爜") + private String realNamePassword; + + //鐧昏搴忓彿") + private String taxRegistrationNumber; + + //閮ㄩ棬缂栫爜") + private String departmentCode; + + //鎶ョ◣淇℃伅楠岃瘉鐘舵") + private TaxAgentTaxReturnStatusEnum checkStatus; + + //澶辫触鍘熷洜") + private String failReason; + +} diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java new file mode 100644 index 000000000..76b51acf5 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnResultDTO.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.taxagent.dto; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.page.PageInfo; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.Accessors; + + +/** + * 绋庡弸楠岃瘉鎴愬姛淇℃伅 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +//绋庡弸楠岃瘉鎴愬姛淇℃伅") +public class TaxAgentTaxReturnResultDTO { + + //灞曠ず绫诲瀷锛1銆佸睍绀鸿〃鍗 2銆佸睍绀哄垪琛 3銆佸叧闂墍鏈塼ab") + private Integer compType; + + //楠岃瘉鐘舵") + private TaxAgentTaxReturnStatusEnum checkStatus; + + //澶辫触鍘熷洜") + private String failReason; + + //楠岃瘉鎻愮ず淇℃伅") + private String message; + + //涓◣鎵g即涔夊姟浜篒D") + private String taxAgentId; + + //鐧昏搴忓彿") + private String taxRegistrationNumber; + + //閮ㄩ棬缂栧彿") + private String departmentCode; + + //琛ㄥ崟") + private TaxAgentTaxReturnListDTO form; + + //鍒楄〃") + private PageInfo table; +} diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java new file mode 100644 index 000000000..9cd0f2c01 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -0,0 +1,98 @@ +package com.engine.salary.entity.taxagent.param; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅-淇濆瓨鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅-淇濆瓨鍙傛暟") +public class TaxAgentTaxReturnSaveParam { + + //涓◣鎵g即涔夊姟浜篿d + private Long taxAgentId; + + //绋庡彿 + private String taxCode; + + //鐧昏搴忓彿 + private String taxRegistrationNumber; + + //鐪佺骇 + private String province; + + //甯傜骇 + private String city; + + //娴忚鎸夐挳鏄剧ず + private String cityName; + + //鍥藉 + private String nation; + + //瀵嗙爜鏍¢獙绫诲瀷 + private String passwordType; + + //瀵嗙爜 + private String password; + + //瀹炲悕璐﹀彿 + private String account; + + //閮ㄩ棬缂栫爜锛屽垎閮ㄩ棬澶囨鏃跺~鍏 + private String departmentCode; + + //閮ㄩ棬鍚嶇О锛屽垎閮ㄩ棬澶囨鏃跺~鍏 + private String departmentName; + + //璇锋眰绫诲瀷 1.淇濆瓨骞堕獙璇 2.浠呬繚瀛 + private Integer requestType = 1; + + //楠岃瘉绫诲瀷 1.璇锋眰绋庡弸楠岃瘉鎶ョ◣淇℃伅 2.璇锋眰绋庡弸楠岃瘉鐧昏搴忓彿+绋庡彿 3.璇锋眰绋庡弸楠岃瘉閮ㄩ棬缂栫爜 + @JsonIgnore + private Integer type; + + //鍦板尯缂栫爜") + private String areaCode; + + public void checkParam() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "涓嶈兘涓虹┖"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "涓◣鎵g即涔夊姟浜篿d涓嶈兘涓虹┖")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "绋庡彿") + notEmpty); + SalaryAssert.notBlank(this.nation, SalaryI18nUtil.getI18nLabel(144408, "鍥藉") + notEmpty); + SalaryAssert.notBlank(this.province, SalaryI18nUtil.getI18nLabel(144407, "鐪佷唤") + notEmpty); + SalaryAssert.notBlank(this.city, SalaryI18nUtil.getI18nLabel(144388, "鍩庡競") + notEmpty); + SalaryAssert.notNull(this.passwordType, SalaryI18nUtil.getI18nLabel(144390, "瀵嗙爜鏍¢獙绫诲瀷") + notEmpty); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144391, "涓◣缃戞姤瀵嗙爜") + notEmpty); + } + if (TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.toString().equals(this.passwordType)) { + SalaryAssert.notBlank(this.password, SalaryI18nUtil.getI18nLabel(144392, "瀹炲悕璐﹀彿瀵嗙爜") + notEmpty); + } + } + + public void checkParam4Registration() { + String notEmpty = SalaryI18nUtil.getI18nLabel(100577, "涓嶈兘涓虹┖"); + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "涓◣鎵g即涔夊姟浜篿d涓嶈兘涓虹┖")); + SalaryAssert.notBlank(this.taxCode, SalaryI18nUtil.getI18nLabel(144388, "绋庡彿") + notEmpty); + SalaryAssert.notBlank(this.taxRegistrationNumber, SalaryI18nUtil.getI18nLabel(144400, "鐧昏搴忓彿") + notEmpty); + } + + public void checkParam4Department() { + SalaryAssert.notNull(this.taxAgentId, SalaryI18nUtil.getI18nLabel(121717, "涓◣鎵g即涔夊姟浜篿d涓嶈兘涓虹┖")); + } +} diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java new file mode 100644 index 000000000..ccbf1716c --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -0,0 +1,156 @@ +package com.engine.salary.entity.taxagent.po; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_agent_tax_return +public class TaxAgentTaxReturnPO implements Serializable { + + private static final long serialVersionUID = -5077833887846911337L; + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜篒D + */ + private Long taxAgentId; + + /** + * 浼佷笟鍚嶇О + */ + private String taxAgentName; + + /** + * 绋庡彿 + */ + private String taxCode; + + /** + * 鐧昏搴忓彿 + */ + private String taxRegistrationNumber; + + /** + * 閮ㄩ棬缂栧彿 + */ + private String departmentCode; + + /** + * 閮ㄩ棬鍚嶇О + */ + private String departmentName; + + /** + * 鍥藉 + */ + private String nation; + + /** + * 鐪佷唤 + */ + private String province; + + /** + * 鐪佺骇琛屾斂缂栫爜 + */ + private String provinceCode; + + /** + * 甯傜骇 + */ + private String city; + private String cityName; + + /** + * 甯傜骇 + */ + private String cityCode; + + /** + * 琛屾斂鍖哄垝浠g爜 + */ + private String areaCode; + + /** + * 瀵嗙爜鏍¢獙绫诲瀷 + * + * @see TaxAgentTaxReturnPasswordTypeEnum + */ + private Integer passwordType; + + /** + * 瀹炲悕璐﹀彿 + */ + private String realAccount; + + /** + * 瀵嗙爜 + */ + private String pwd; + + /** + * 绋庡弸楠岃瘉鐘舵 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer checkStatus; + + /** + * 鏈杩戜竴娆¢獙璇佸け璐ュ師鍥 + */ + private String failReason; + + /** + * 绉熸埛key + */ + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + + //鏌ヨ鏉′欢 + private Collection ids; + private Collection taxAgentIds; + private Collection taxCodes; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java new file mode 100644 index 000000000..a58fa44e5 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java @@ -0,0 +1,20 @@ +package com.engine.salary.entity.taxagent.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +/** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CheckPasswordResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private boolean body; +} diff --git a/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java new file mode 100644 index 000000000..4081c546e --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java @@ -0,0 +1,66 @@ +package com.engine.salary.entity.taxagent.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +import java.util.List; + +/** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CompanyRegisterInfoResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private List body; + + /** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣撶被 + **/ + @Data + public static class CompanyRegisterInfo { + /** + * 鐧昏搴忓彿 + */ + private String djxhid; + /** + * 浼佷笟鍚嶇О + */ + private String qymc; + /** + * 娉曚汉濮撳悕 + */ + private String frxm; + /** + * 鑱旂郴鐢佃瘽 + */ + private String lxdh; + /** + * 鐢熶骇缁忚惀鍦板潃 + */ + private String scjydz; + /** + * 琛屼笟鍚嶇О + */ + private String hymc; + /** + * 涓荤绋庡姟鏈哄叧鍚嶇О + */ + private String zgswjgmc; + /** + * 涓荤绋庡姟鍒嗗眬鎵绉戝悕绉 + */ + private String zgswjgskmc; + /** + * 鏄惁鍒嗛儴闂ㄥ妗 + */ + private String fbmba; + } +} diff --git a/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java new file mode 100644 index 000000000..90ba9fc96 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/SzyhResponseHead.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SzyhResponseHead { + private String code; + private String desc; + private String msg; + private String time; + private String status; + + public SzyhResponseHead() { + } + + public SzyhResponseHead(String code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java new file mode 100644 index 000000000..0c17d73e1 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -0,0 +1,143 @@ +package com.engine.salary.entity.taxapiflow.bo; + +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +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.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.db.IdGenerator; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @author chengliming + * @date 2022-11-16 1:41 PM + **/ +public class TaxApiFlowBO { + + /** + * 娴侀噺浣跨敤鎯呭喌 + * + * @param wrapper 鍖呰绫 + * @param taxAgentId + * @param employeeId + * @return + */ + public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper, + Long taxAgentId, + Long employeeId) { + Date now = new Date(); + return TaxDeclarationApiFlowRecordPO.builder() + .id(IdGenerator.generate()) + .deduct(null) + .businessType(wrapper.getBusinessType().getValue()) + .taxMonth(wrapper.getTaxYearMonth()) + .useTime(now) + .createTime(now) + .updateTime(now) + .employeeId(employeeId) + .taxAgentId(taxAgentId) + .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(wrapper.getTenantKey()) + .creator(wrapper.getCurrentEmployeeId()) + .build(); + } + + public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) { + String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId()); + String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId()); + String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getUsername(); + String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getIdNo(); + String creator = propertiesWrapper.getCreatorNameMap().get(e.getCreator()); + String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId()); + + boolean isInternal = StringUtils.isNotEmpty(internalUsername); + return TaxDeclarationApiFlowRecordListDTO.builder() + .id(e.getId()) + .indexNum(indexNum.getAndIncrement()) + .createTime(SalaryDateUtil.getFormatLocalDate(e.getCreateTime())) + .taxAgentName(taxAgentName) + .employeeName(isInternal ? internalUsername : externalUsername) + .employeeType(isInternal ? "inside" : "external") + .idCardNo(isInternal ? idNo : externalIdNo) + .employeeId(e.getEmployeeId()) + .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel()) + .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel()) + .creator(creator) + .creatorId(e.getCreator()) + .build(); + } + +// public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { +// String title = SalaryI18nUtil.getI18nLabel(111, "鏅鸿兘绠楄柂娴侀噺涓嶈冻鎻愰啋"); +// String desc = String.format(SalaryI18nUtil.getI18nLabel(111, "鏅鸿兘绠楄柂娴侀噺宸蹭笉瓒%s锛岃鍙婃椂閲囪喘缁垂锛岄伩鍏嶆鏈堟棤娉曚娇鐢ㄣ"), warnConfig.getThreshold()); +// Entity entity = new Entity() +// .setId(IdGenerator.generate() + "") +// .setModule(EntityType.hrmsalary.name()) +// .setName(title) +// .setCreatorId(updateWrapper.getCurrentEmployeeId()) +// .setCreateTime(new Date()); +// +// SendMessageEntity smg = new SendMessageEntity(); +// // 妯″潡 +// smg.setModule(MessageModule.HRSA); +// // 浜嬩欢 +// smg.setEvent(MessageEvent.PAYROLL); +// // 涓氬姟id +// smg.setBusinessId(warnConfig.getBusinessId().toString()); +// // 鍙戦佽 +// smg.setSender(UserEntity.SYSTEM_USER); +// // 鎺ユ敹鑰 +// smg.setReceivers(receivers); +// // 鍙戦佸唴瀹(鐭俊&IM鐨勮嚜瀹氫箟鍙橀噺) +// Map params = new HashMap<>(); +// params.put("flowThreshold", warnConfig.getThreshold().toString()); +// smg.setDynamicParams(params); +// smg.setTitle(title); +// smg.setEntity(entity); +// smg.setText(desc); +// smg.setContent(desc); +// // 閭 +// EmailEntity emailEntity = new EmailEntity(); +// emailEntity.setEmailSubject(title); +// emailEntity.setEmailContent(desc); +// emailEntity.setMailUserAccountId(0); +// smg.setEmailInfo(emailEntity); +// return smg; +// } + + public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam, + Long currentEmployeeId) { + Date now = new Date(); + saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" ")); + saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" ")); + return TaxDeclarationApiConfigPO.builder() + .id(IdGenerator.generate()) + .appKey(saveParam.getAppKey()) + .appSecret(saveParam.getAppSecret()) + .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .createTime(now) + .updateTime(now) + .creator(currentEmployeeId) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .build(); + } + + @Override + public String toString() { + return "TaxApiFlowBO{}"; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java new file mode 100644 index 000000000..527a7e2cf --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺鎻愰啋-鍒涘缓瑙勫垯鍙傛暟 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺鎻愰啋-鍒涘缓瑙勫垯鍙傛暟") +public class CreateMessageRuleParamDTO { + //妯″潡") + @JsonSerialize(using = ToStringSerializer.class) + private Integer moduleId; + + //浜嬩欢") + @JsonSerialize(using = ToStringSerializer.class) + private Integer eventId; + + //涓氬姟") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java new file mode 100644 index 000000000..33b2a72f4 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -0,0 +1,69 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.annotation.TableTitle; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺浣跨敤璁板綍 + * + * @author chengliming + * @date 2022-11-21 16:51:10 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺浣跨敤璁板綍") +public class TaxDeclarationApiFlowRecordListDTO { + //id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //搴忓彿 + @TableTitle(title = "搴忓彿", key = "indexNum", dataIndex = "indexNum") + private Integer indexNum; + + //浣跨敤鏃堕棿 + private String createTime; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜", key = "taxAgentName", dataIndex = "taxAgentName") + private String taxAgentName; + + //浜哄憳 + @TableTitle(title = "浜哄憳", key = "employeeName", dataIndex = "employeeName") + private String employeeName; + + //浜哄憳绫诲瀷 + private String employeeType; + + //浜哄憳id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + //鍒涘缓浜篿d + @JsonSerialize(using = ToStringSerializer.class) + private Long creatorId; + + //韬唤璇佸彿鐮 + @TableTitle(title = "韬唤璇佸彿鐮", key = "idCardNo", dataIndex = "idCardNo") + private String idCardNo; + + //鎺ュ彛涓氬姟 + @TableTitle(title = "鎺ュ彛涓氬姟", key = "businessTypeName", dataIndex = "businessTypeName") + private String businessTypeName; + + //鎿嶄綔浜 + @TableTitle(title = "鎿嶄綔浜", key = "creator", dataIndex = "creator") + private String creator; + + //缁撴灉 + @TableTitle(title = "缁撴灉", key = "result", dataIndex = "result") + private String result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java new file mode 100644 index 000000000..cf4d4ee9f --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.annotation.TableTitle; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺缁熻-鏈堝害璇︽儏 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺缁熻-鏈堝害璇︽儏") +public class TaxDeclarationApiFlowStatisticDetailListDTO { + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @JsonIgnore + private Long taxAgentId; + + @JsonIgnore + @TableTitle(title = "涓◣鎵g即涔夊姟浜",key = "taxAgentName",dataIndex = "taxAgentName") + private String taxAgentName; + + //绋庢鎵灞炴湡 + @TableTitle(title = "",key = "",dataIndex = "") + private String taxMonth; + + //鏈堜娇鐢ㄦ祦閲忔暟 + @TableTitle(title = "鏈堜娇鐢ㄦ祦閲忔暟",key = "used",dataIndex = "used") + private Integer used; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java new file mode 100644 index 000000000..ac37af2c3 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -0,0 +1,44 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.annotation.TableTitle; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺缁熻 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺缁熻") +public class TaxDeclarationApiFlowStatisticListDTO { + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //搴忓彿 + @TableTitle(title = "搴忓彿",key = "indexNum",dataIndex = "indexNum") + private Integer indexNum; + + //涓◣鎵g即涔夊姟浜 + @TableTitle(title = "涓◣鎵g即涔夊姟浜",key = "taxAgentName",dataIndex = "taxAgentName") + private String taxAgentName; + + //涓◣鎵g即涔夊姟浜篒D + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //宸蹭娇鐢 + @TableTitle(title = "宸蹭娇鐢",key = "used",dataIndex = "used") + private Integer used; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java new file mode 100644 index 000000000..467bc6eae --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺缁熻 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺缁熻") +public class TaxDeclarationApiFlowTotalDTO { + //鎬绘祦閲") + @JsonSerialize(using = ToStringSerializer.class) + private Long total; + + //鍓╀綑娴侀噺") + @JsonSerialize(using = ToStringSerializer.class) + private Long remain; + + //宸蹭娇鐢ㄦ祦閲") + @JsonSerialize(using = ToStringSerializer.class) + private Long used; + + //鏈鍚庢洿鏂版椂闂") + private String lastUpdateTime; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java new file mode 100644 index 000000000..0ce847aeb --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-娴侀噺涓嶈冻鎻愰啋-琛ㄥ崟 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺涓嶈冻鎻愰啋-琛ㄥ崟") +public class TaxDeclarationApiFlowWarnConfigFormDTO { + + //涓婚敭id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //鎻愰啋寮鍏") + private Boolean enable; + + //鎻愰啋瑙勫垯") + private Integer threshold; + + //鎻愰啋鎺ㄩ佹柟寮") + private String config; + + //涓氬姟ID") + @JsonSerialize(using = ToStringSerializer.class) + private Long businessId; + + //妯″潡") + @JsonSerialize(using = ToStringSerializer.class) + private String moduleId; + + //浜嬩欢") + @JsonSerialize(using = ToStringSerializer.class) + private String eventId; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java new file mode 100644 index 000000000..3ce0a8212 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.common.OptionDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 鏅鸿兘绠楃◣-娴侀噺涓嶈冻鎻愰啋瀵硅薄-琛ㄥ崟 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺涓嶈冻鎻愰啋瀵硅薄-琛ㄥ崟") +public class TaxDeclarationApiFlowWarnReceiverFormDTO { + + //涓婚敭id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //鎻愰啋瀵硅薄") + private List employee; + + //鎵嬫満鍙") + private String mobile; + + //閭鍒楄〃") + private String email; + + //閭鍒楄〃涓嬫媺妗") + @JsonIgnore + private List emailOptions; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java new file mode 100644 index 000000000..c00fcc7a8 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.engine.salary.annotation.TableTitle; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.minidev.json.annotate.JsonIgnore; + +/** + * 鏅鸿兘绠楃◣-娴侀噺鎻愰啋瀵硅薄 + * + * @author chengliming + * @date 2022-11-22 11:25:48 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-娴侀噺鎻愰啋瀵硅薄") + +public class TaxDeclarationApiFlowWarnReceiverListDTO { + //id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //鎻愰啋瀵硅薄 + @TableTitle(title = "鎻愰啋瀵硅薄",key = "employeeName",dataIndex = "employeeName") + private String employeeName; + + @JsonIgnore + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + //鎵嬫満鍙 + @TableTitle(title = "鎵嬫満鍙",key = "mobile",dataIndex = "mobile") + private String mobile; + + //閭 + @TableTitle(title = "閭",key = "email",dataIndex = "email") + private String email; +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java new file mode 100644 index 000000000..93502a5a6 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.taxapiflow.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楃◣-鍚敤璁剧疆-琛ㄥ崟 + * + * @author chengliming + * @date 2022-11-11 17:01:25 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楃◣-鍚敤璁剧疆-琛ㄥ崟") +public class TaxDeclarationBillingConfigFormDTO { + + //涓婚敭id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //appKey") + private String appKey; + + //appSecret") + private String appSecret; + + //鏅鸿兘绠楄柂寮鍏") + private Boolean enable; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java new file mode 100644 index 000000000..6a512da74 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 鍒涘缓鎺ㄩ佽鍒 + * + * @author chengliming + * @date 2022-11-24 10:50 AM + **/ +@Data +public class CreateMessageRuleParam { + //涓氬姟ID") + @NotNull(message = "涓氬姟ID涓嶈兘涓虹┖") + private String businessId; + + //璇︾粏瑙勫垯") + @NotNull(message = "璇︾粏瑙勫垯涓嶈兘涓虹┖") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java new file mode 100644 index 000000000..69fa8b8fa --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -0,0 +1,50 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.util.SalaryDateUtil; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 娴侀噺鏈堝害璇︽儏鏌ヨ鍙傛暟 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("娴侀噺鏈堝害璇︽儏鏌ヨ鍙傛暟") +public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam { + + //涓◣鎵g即涔夊姟浜篿d") + @NotNull(message = "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌") + private Long taxAgentId; + + //绋庢鎵灞炴湡寮濮嬫椂闂") + private Date startTaxMonth; + + //绋庢鎵灞炴湡缁撴潫鏃堕棿") + private Date endTaxMonth; + + public Integer getStartTaxMonth() { + if (startTaxMonth == null) { + return 0; + } + return Integer.parseInt(SalaryDateUtil.getFormatYYYYMM(startTaxMonth).replace("-", "")); + } + + public Integer getEndTaxMonth() { + if (endTaxMonth == null) { + return Integer.MAX_VALUE; + } + return Integer.parseInt(SalaryDateUtil.getFormatYYYYMM(endTaxMonth).replace("-", "")); + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java new file mode 100644 index 000000000..ef66fa4f4 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import com.engine.salary.common.BaseQueryParam; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.util.Date; + +/** + * 娴侀噺鏈堝害璇︽儏鏌ヨ鍙傛暟 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("娴侀噺鏈堝害璇︽儏鏌ヨ鍙傛暟") +public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam { + + //涓◣鎵g即涔夊姟浜篿d") + private Long taxAgentId; + + //寮濮嬫椂闂") + private Date startDate; + + //缁撴潫鏃堕棿") + private Date endDate; + + //涓氬姟鎺ュ彛绫诲瀷") + private Integer businessType; + + //缁撴灉") + private Integer result; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java new file mode 100644 index 000000000..1dbf4be53 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +/** + * 娴侀噺涓嶈冻鎻愰啋瑙勫垯鍒涘缓 + * + * @author chengliming + * @date 2022-11-24 11:17:31 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("娴侀噺涓嶈冻鎻愰啋瑙勫垯鍒涘缓") +public class TaxDeclarationApiFlowWarnConfigSaveParam { + //鎻愰啋瀵硅薄Id") + private Long id; + + //鎻愰啋闃堝") + @NotNull(message = "鎻愰啋瑙勫垯涓嶈兘涓虹┖") + private Long threshold; + + //鎻愰啋寮鍏虫槸鍚︽墦寮") + private Boolean enable; + + //涓氬姟ID") + @NotNull(message = "鎺ㄩ佹柟寮忎笉鑳戒负绌") + private Long businessId; + + //瑙勫垯") + private String config; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java new file mode 100644 index 000000000..c6b953632 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 娴侀噺涓嶈冻鎻愰啋瀵硅薄 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("娴侀噺涓嶈冻鎻愰啋瀵硅薄") +public class TaxDeclarationApiFlowWarnReceiverSaveParam { + //鎻愰啋瀵硅薄Id") + private Long id; + + //鎻愰啋閰嶇疆Id") + private Long warnConfigId; + + //浜哄憳Id") + private Long employeeId; + + //閭") + private String email; + + //鎵嬫満鍙") + private String mobile; +} diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java new file mode 100644 index 000000000..843a04a81 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxapiflow.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏅鸿兘绠楄柂閰嶇疆鍙傛暟 + * + * @author chengliming + * @date 2022-11-11 15:28:27 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏅鸿兘绠楄柂閰嶇疆鍙傛暟") +public class TaxDeclarationBillingConfigSaveParam { + + //appKey") + private String appKey; + + //appSecret") + private String appSecret; + + //enable") + private String enable; + + //閰嶇疆ID") + private Long configId; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java new file mode 100644 index 000000000..a4fd29999 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowRecordPO.java @@ -0,0 +1,106 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鐢虫姤-鎺ュ彛娴侀噺浣跨敤璁板綍 + * + * @author chengliming + * @date 2022-11-11 17:36:16 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_record") +//"涓◣鐢虫姤-鎺ュ彛娴侀噺浣跨敤璁板綍") +public class TaxDeclarationApiFlowRecordPO implements Serializable { + + private static final long serialVersionUID = 5899885019997144301L; + /** + * 涓婚敭 + */ + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜虹殑涓婚敭id + */ + private Long taxAgentId; + + /** + * 绋庢鎵灞炴湡 + */ + private Date taxMonth; + + /** + * 浣跨敤鏃堕棿 + */ + private Date useTime; + + /** + * 鏄惁鎵f祦閲 + * + * @see SalaryOnOffEnum + */ + private Integer deduct; + + /** + * 浜哄憳ID + */ + private Long employeeId; + + /** + * 鎺ュ彛涓氬姟绫诲瀷 + * + * @see EnumDeclareApiBusinessType + */ + private Integer businessType; + + /** + * 缁撴灉 + * + * @see TaxAgentTaxReturnStatusEnum + */ + private Integer resultStatus; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + /** + * 鍒涘缓浜 + */ + private Long creator; + + /** + * 鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎 + */ + private Integer deleteType; + + /** + * 绉熸埛ID + */ + private String tenantKey; + + + private Collection ids; + private Date useTimeStartDate; + private Date useTimeEndDate; + +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java new file mode 100644 index 000000000..ca12c4476 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnConfigPO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.taxapiflow.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 涓◣鐢虫姤瀵规帴 - 娴侀噺涓嶈冻鎻愰啋 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_warn_config") +//涓◣鐢虫姤瀵规帴娴侀噺涓嶈冻鎻愰啋") +public class TaxDeclarationApiFlowWarnConfigPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 涓婚敭 + */ + private Long id; + + /** + * 鏄惁鎻愰啋 + * @see SalaryOnOffEnum + */ + private Integer enableWarn; + + /** + * 鎻愰啋闃堝 + */ + private Long threshold; + + /** + * 涓氬姟ID + */ + private Long businessId; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + /** + * 鍒涘缓浜 + */ + private Long creator; + + /** + * 鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎 + */ + private Integer deleteType; + + /** + * 绉熸埛ID + */ + private String tenantKey; +} diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java new file mode 100644 index 000000000..350a88160 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -0,0 +1,81 @@ +package com.engine.salary.entity.taxapiflow.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 娴侀噺涓嶈冻鎻愰啋瀵硅薄 + * + * @author chengliming + * @date 2022-11-14 11:26:02 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_api_flow_receiver") +//娴侀噺涓嶈冻鎻愰啋瀵硅薄") +public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable { + + private static final long serialVersionUID = -5502227652635855096L; + + /** + * 涓婚敭 + */ + private Long id; + + + /** + * 鎻愰啋閰嶇疆鐨刬d + */ + private Long warnConfigId; + + /** + * 鎺ュ彈浜篿d + */ + private Long employeeId; + + /** + * 閭 + */ + private String email; + + /** + * 鎵嬫満鍙 + */ + private String mobile; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + /** + * 鍒涘缓浜 + */ + private Long creator; + + /** + * 鏄惁宸插垹闄ゃ0锛氭湭鍒犻櫎銆1锛氬凡鍒犻櫎 + */ + private Integer deleteType; + + /** + * 绉熸埛ID + */ + private String tenantKey; + + + private Collection ids; +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java new file mode 100644 index 000000000..584244e09 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 鏌ヨ娴侀噺缁熻 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryAccountBalanceResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 宸茶喘涔版绘祦閲 + */ + private String total; + /** + * 宸蹭娇鐢ㄦ祦閲 + */ + private String used; + /** + * 鍓╀綑娴侀噺 + */ + private String surplus; + /** + * 浣跨敤鏄庣粏 + */ + private List taxList; + } + + @Data + public static class Detail { + /** + * 绋庡彿 + */ + private String taxNum; + /** + * 宸蹭娇鐢ㄦ祦閲 + */ + private String used; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java new file mode 100644 index 000000000..413f7e546 --- /dev/null +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryDetailsByTaxNumberResponse.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.taxapiflow.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.List; + +/** + * 鏌ヨ娴侀噺缁熻 + * + * @author chengliming + * @date 2022-11-16 3:17 PM + **/ +@Data +public class QueryDetailsByTaxNumberResponse { + + private SzyhResponseHead head; + + private Body body; + + @Data + public static class Body { + /** + * 绋庡彿 + **/ + private String taxNumber; + /** + * 宸蹭娇鐢ㄦ祦閲 + **/ + private String used; + /** + * 浣跨敤鏄庣粏 + */ + private List detail; + } + + @Data + public static class Detail { + /** + * 鏈堜唤 + */ + private String month; + /** + * 宸蹭娇鐢ㄦ祦閲 + */ + private String used; + + public Integer getMonthValue() { + return Integer.parseInt(month); + } + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java index 66aec4865..73385423c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationBO.java @@ -44,7 +44,6 @@ import java.util.stream.Collectors; * @version 1.0 **/ public class TaxDeclarationBO { - private static EncryptUtil encryptUtil = new EncryptUtil(); public static List convert2ListDTO(List taxDeclarations, List simpleEmployees, @@ -470,7 +469,6 @@ public class TaxDeclarationBO { .tenantKey(taxDeclaration.getTenantKey()) .deleteType(NumberUtils.INTEGER_ZERO) .build(); - encryptUtil.encrypt(accumulatedSituation, AddUpSituation.class); result.getNeedInsertAddUpSituations().add(accumulatedSituation); }); } @@ -662,7 +660,7 @@ public class TaxDeclarationBO { .id(IdGenerator.generate()) .incomeCategory(incomeCategory) .taxAgentId(taxAgentId) - .salaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) + .salaryMonth(saveParam.getSalaryMonth()) .taxCycle(taxCycle) .description(saveParam.getDescription()) .creator((long) user.getUID()) diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java new file mode 100644 index 000000000..19d0e742f --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -0,0 +1,266 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.IdGenerator; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 閫氱敤锛氫竴鑸姵鍔℃姤閰墍寰椼佸叏骞翠竴娆℃у閲 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclarationCommon implements TaxDeclarationStrategy { + + @Override + public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId) { + Date now = new Date(); + // 钖祫鏍哥畻缁撴灉鎸夌収钖祫鏍哥畻浜哄憳id鑱氬悎鍒嗙被 + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); + // 钖祫鏍哥畻浜哄憳鎸夌収浜哄憳id鑱氬悎鍒嗙被 + Map> employeeIdKeyMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); + + List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); + for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { + + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { + String value = ""; + + List firstValueList = Lists.newArrayList( + "taxFreeIncome", + "endowmentInsurance", + "medicalInsurance", + "unemploymentInsurance", + "housingProvidentFund", + "addUpChildEducation", + "addUpHousingLoanInterest", + "addUpHousingRent", + "addUpSupportElderly", + "addUpContinuingEducation", + "addUpInfantCare", + "annuity", + "commercialHealthInsurance", + "taxDeferredEndowmentInsurance", + "other", + "allowedDonation", + "taxDeduction", + "description", + "addUpAdvanceTax"); + + List lastValueList = Lists.newArrayList( + "addUpIncome", + "addUpTaxFreeIncome", + "addUpSubtraction", + "addUpSpecialDeduction", + "addUpOtherDeduction", + "addUpAllowedDonation", + "addUpTaxableIncome", + "taxRate", + "quickDeductionFactor", + "addUpTaxPayable", + "addUpTaxDeduction" + ); + + List mergeValueList = Lists.newArrayList( + "income", + "refundedOrSupplementedTax" + ); + + //鍙栫涓娆″ + if (firstValueList.contains(taxReportColumn.getReportColumnDataIndex())) { + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) < 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + } + //鍙栧娆$疮璁″ + else if (mergeValueList.contains(taxReportColumn.getReportColumnDataIndex()) && Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { + List employeePOS = employeeIdEntry.getValue(); + BigDecimal income = new BigDecimal("0.00"); + for (SalaryAcctEmployeePO salaryAcctEmployeePO : employeePOS) { + SalarySobTaxReportRulePO incomeRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(salaryAcctEmployeePO.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployeePO.getId()); + if (incomeRule != null && salaryAcctResultValue != null) { + String incomeValue = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(incomeRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + if (StrUtil.isNotBlank(incomeValue) && NumberUtil.isNumber(incomeValue)) { + income = income.add(new BigDecimal(incomeValue)); + } + } + } + value = income.toPlainString(); + } + //鍙栨渶鍚庝竴娆″ + else { + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + } + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); + } + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareContext.getTaxDeclaration().getTaxDeclareRecordId()) + .taxDeclarationId(taxDeclareContext.getTaxDeclaration().getId()) + .employeeType(employeeIdEntry.getValue().get(0).getEmployeeType()) + .employeeId(employeeIdEntry.getKey()) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .source(SourceEnum.ACCT.getValue()) + .build(); + taxDeclarationValues.add(taxDeclarationValue); + } + // 鐢熸垚绱鏁版嵁 + List addUpSituations = generateAddUpSituation(taxDeclareContext, salaryAcctResultValueMap, employeeIdKeyMap); + return new TaxDeclarationGenerateResult() + .setTaxDeclarationValues(taxDeclarationValues) + .setAddUpSituations(addUpSituations); + } + + /** + * 鐢熸垚寰鏈熺疮璁℃暟鎹 + * + * @param taxDeclareContext + * @param salaryAcctResultValueMap + * @param employeeIdKeyMap + * @return + */ + private List generateAddUpSituation(TaxDeclareContext taxDeclareContext, + Map> salaryAcctResultValueMap, + Map> employeeIdKeyMap) { + List addUpSituations = Lists.newArrayList(); + // 鍙湁銆屽伐璧勫伐璧勮柂閲戙嶃併屼繚闄╄惀閿鍛樹剑閲戞敹鍏ャ嶃併岃瘉鍒哥粡绾汉浣i噾鏀跺叆銆嶃併屽叾浠栬繛缁姵鍔℃姤閰墍寰椼嶉渶瑕佺疮璁¤绋 + TaxDeclarationPO taxDeclaration = taxDeclareContext.getTaxDeclaration(); + if (!Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER.getValue()) + && !Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR.getValue())) { + return addUpSituations; + } + for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { + // 鍙栨渶鍚庝竴娆¤柂璧勬牳绠楄褰曠殑鏍哥畻缁撴灉浣滀负涓◣鐢虫姤琛ㄧ殑鏁版嵁鏉ユ簮 + SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue()); + for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) { + SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId()); + SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId()); + if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) { + lastSalaryAcctEmployee = salaryAcctEmployee; + } + } + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + Map valueMap = Maps.newHashMap(); + for (Field declaredField : AddUpSituation.class.getDeclaredFields()) { + if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { + continue; + } + SalarySobAddUpRulePO salarySobAddUpRule = taxDeclareContext.getSalarySobAddUpRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + declaredField.getName()); + String value = BigDecimal.ZERO.toPlainString(); + if (Objects.nonNull(salarySobAddUpRule) && Objects.nonNull(salaryAcctResultValue)) { + value = salaryAcctResultValue.stream() + .filter(e -> e.getSalaryItemId().equals(salarySobAddUpRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + valueMap.put(declaredField.getName(), value); + } + AddUpSituation addUpSituation = AddUpSituation.builder() + .id(IdGenerator.generate()) + .employeeId(lastSalaryAcctEmployee.getEmployeeId()) +// .employeeType(lastSalaryAcctEmployee.getEmployeeType()) + .taxAgentId(lastSalaryAcctEmployee.getTaxAgentId()) + .taxYearMonth(taxDeclaration.getTaxCycle()) + .year(SalaryDateUtil.date2Year(taxDeclaration.getTaxCycle())) + .addUpIncome(valueMap.get("addUpIncome")) + .addUpSocialSecurityTotal(valueMap.get("addUpSocialSecurityTotal")) + .addUpAccumulationFundTotal(valueMap.get("addUpAccumulationFundTotal")) + .addUpEnterpriseAndOther(valueMap.get("addUpEnterpriseAndOther")) + .addUpSubtraction(valueMap.get("addUpSubtraction")) + .addUpOtherDeduction(valueMap.get("addUpOtherDeduction")) + .addUpTaxExemptIncome(valueMap.get("addUpTaxExemptIncome")) + .addUpAllowedDonation(valueMap.get("addUpAllowedDonation")) + .addUpTaxSavings(valueMap.get("addUpTaxSavings")) + .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) + .taxAdjustment(valueMap.get("taxAdjustment")) + .addUpTaxableIncome(valueMap.get("addUpTaxableIncome")) +// .modifier(taxDeclaration.getCreator()) + .creator(taxDeclaration.getCreator()) + .createTime(taxDeclaration.getCreateTime()) + .updateTime(taxDeclaration.getUpdateTime()) + .tenantKey(taxDeclaration.getTenantKey()) + .deleteType(taxDeclaration.getDeleteType()) + .build(); + addUpSituations.add(addUpSituation); + } + return addUpSituations; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java index 0fe5a0815..db03aa27a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java @@ -2,11 +2,9 @@ package com.engine.salary.entity.taxdeclaration.bo; import com.engine.salary.constant.TaxDeclarationDataIndexConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationEmployeeDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; +import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -16,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; import weaver.general.Util; import java.util.*; +import java.util.stream.Collectors; /** * 涓◣鐢虫姤琛ㄨ鎯 @@ -178,4 +177,23 @@ public class TaxDeclarationDetailBO { } return taxDeclarationLaborListDTOS; } + + + public static List convert2ListTaxReportColumn(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return Collections.emptyList(); + } + + List collect = pos.stream().map(po -> { + TaxDeclareRecordDetailFormDTO.TaxReportColumn taxReportColumn = new TaxDeclareRecordDetailFormDTO.TaxReportColumn(); + taxReportColumn.setReportColumnName(po.getReportColumnName()); + taxReportColumn.setReportColumnDataIndex(po.getReportColumnDataIndex()); + taxReportColumn.setTaxReportType(po.getTaxReportType()); + taxReportColumn.setIncomeCategory(po.getIncomeCategory()); + taxReportColumn.setDataType(po.getDataType()); + return taxReportColumn; + }).collect(Collectors.toList()); + + return collect; + } } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java index 0664942dc..d9fe331fe 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailListColumn.java @@ -7,12 +7,13 @@ import com.google.common.collect.Lists; import java.util.List; /** - * @description: 涓◣鐢虫姤琛ㄦ槑缁嗙殑琛ㄥご - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 11:31 AM - * @version:v1.0 - */ + * 涓◣鐢虫姤琛ㄦ槑缁嗙殑琛ㄥご + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class TaxDeclarationDetailListColumn { private static final String COLUMN = " [\n" + diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java new file mode 100644 index 000000000..42ca6ac21 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationGenerateResult.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 涓◣鐢虫姤琛ㄨ绠楄繃绋嬩腑浜х敓鐨勭粨鏋 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclarationGenerateResult { + + /** + * 寰鏈熺疮璁℃竻绌 + */ + private List addUpSituations; + /** + * 涓◣鐢虫姤鏄庣粏 + */ + private List taxDeclarationValues; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java new file mode 100644 index 000000000..284b5a010 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -0,0 +1,431 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import cn.hutool.core.util.NumberUtil; +import com.engine.salary.entity.datacollection.po.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.datacollection.TaxFreeTypeEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclarationRequest { + + public static Map convert2RequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares, + Map> taxFreeMap) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.COMPREHENSIVE_INCOME) + .collect(Collectors.toList()); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) { + Map paramMap = objRequestParam.computeIfAbsent("zcgzxj", k -> { + Map param = new HashMap<>(); + // 姝e父宸ヨ祫钖噾鍒楄〃 + param.put("zcgzxjlb", Lists.newArrayList()); + // 姝e父宸ヨ祫钖噾鏄惁闇瑕佷笓椤 + param.put("zcgzxjsfxyzx", 0); + // 姝e父宸ヨ祫钖噾鏄惁浼犲叆涓撻」绱 + param.put("zcgzxjsfcrlj", 1); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zcgzxjlb", K -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + // 鍏ㄥ勾涓娆℃у閲戞敹鍏 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qnycxjjsslb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_RETIRE) { + // 鍐呴涓娆℃цˉ鍋块噾 + List> employeeRequestParams = listRequestParam.computeIfAbsent("ntycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.COMPENSATION_FOR_DISMISS) { + // 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾 + List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParam.put("sfzdscmsfb", "鏄"); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE) { + // 涓汉鑲℃潈婵鍔辨敹鍏 + List> employeeRequestParams = listRequestParam.computeIfAbsent("grgqjl", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ANNUITY_RECEIPT) { + // 澶勭悊"鏄惁涓娆℃ч鍙"(鎺ュ彛鍙兘浼0鍜1浣嗘槸鎺ュ彛鐨勯敊璇繑鍥炰俊鎭憡鐭ュ彧鑳藉~鍐欐槸鍜屽惁锛屾墍浠ラ渶瑕佽浆涓涓) + String sfycxlq = Util.null2String(employeeRequestParam.get("sfycxlq")); + employeeRequestParam.put("sfycxlq", Objects.equals("鏄", sfycxlq) ? "1" : "0"); + // 骞撮噾棰嗗彇 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qynj", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_LABOR) { + // 涓鑸姵鍔℃姤閰墍寰 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN) { + // 淇濋櫓钀ラ攢鍛樹剑閲戞敹鍏 + Map paramMap = objRequestParam.computeIfAbsent("bxyxy", k -> { + Map param = new HashMap<>(); + param.put("bxyxylwbclb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("bxyxylwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER) { + // 璇佸埜缁忕邯浜轰剑閲戞敹鍏 + Map paramMap = objRequestParam.computeIfAbsent("zqjjr", k -> { + Map param = new HashMap<>(); + param.put("zqjjrsdlb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("zqjjrsdlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { + // 鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰 + Map paramMap = objRequestParam.computeIfAbsent("qtlxlwbc", k -> { + Map param = new HashMap<>(); + param.put("qtlxlwbclb", Lists.newArrayList()); + return param; + }); + List> employeeRequestParams = (List>) paramMap.computeIfAbsent("qtlxlwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR) { + // 鍏朵粬闈炶繛缁姵鍔℃姤閰墍寰 + List> employeeRequestParams = listRequestParam.computeIfAbsent("qtflxlwbc", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR) { + // 绋块叕鎵寰 + List> employeeRequestParams = listRequestParam.computeIfAbsent("gcsdlb", k -> Lists.newArrayList()); + employeeRequestParam.put("sfzdscmsfb", "鏄"); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { + // 鐗硅鏉冧娇鐢ㄨ垂鎵寰 + List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + // 鍏朵粬鍏嶇◣鎵i櫎闄勮〃 + buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam); + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } + + private static void buildOtherDeductionDetailParams(Map> taxFreeMap, Map>> listRequestParam, EmployeeDeclarePO employeeDeclare, IncomeCategoryEnum incomeCategoryEnum, Map employeeRequestParam) { + String mssd = employeeRequestParam.getOrDefault("mssd", "0").toString(); + if (NumberUtil.isNumber(mssd) && new BigDecimal(mssd).compareTo(new BigDecimal("0")) > 0) { + Map freeIncomeMap = taxFreeMap.get(TaxFreeTypeEnum.FREE_INCOME); + List poList = (List) freeIncomeMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(poList)) { + poList = poList.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("msfblb",new ArrayList<>()); + for (FreeIncomePO po : poList) { + Map map = new HashMap<>(); + // 濮撳悕 + map.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 璇佷欢鍙风爜 + map.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + map.put("jmsx", po.getFreeItem()); + map.put("jmxz", po.getFreeProperty()); + map.put("sjkcje", po.getFreeAmount()); + paramMaps.add(map); + } + listRequestParam.put("msfblb", paramMaps); + } + } + + String syjkbx = employeeRequestParam.getOrDefault("syjkbx", "0").toString(); + if (NumberUtil.isNumber(syjkbx) && new BigDecimal(syjkbx).compareTo(new BigDecimal("0")) > 0) { + Map healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE); + List pos = (List) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("syjkbxfblb",new ArrayList<>()); + for (HealthInsurancePO healthInsurancePO : pos) { + Map map = new HashMap<>(); + // 濮撳悕 + map.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 璇佷欢鍙风爜 + map.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + map.put("bdsxrq", SalaryDateUtil.getFormatLocalDate(healthInsurancePO.getEffectiveDate())); + map.put("sysbm", healthInsurancePO.getIdentificationNumber()); + map.put("ndbf", healthInsurancePO.getYearPremium()); + map.put("ydbf", healthInsurancePO.getMonthPremium()); + map.put("sjkcje", healthInsurancePO.getCurrentDeduction()); + paramMaps.add(map); + } + listRequestParam.put("syjkbxfblb", paramMaps); + } + } + + String syylbx = employeeRequestParam.getOrDefault("syylbx", "0").toString(); + if (NumberUtil.isNumber(syylbx) && new BigDecimal(syylbx).compareTo(new BigDecimal("0")) > 0) { + Map posMap = taxFreeMap.get(TaxFreeTypeEnum.ENDOWMENT_INSURANCE); + List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("syylbxfblb",new ArrayList<>()); + for (EndowmentInsurancePO po : pos) { + Map map = new HashMap<>(); + // 濮撳悕 + map.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 璇佷欢鍙风爜 + map.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + map.put("sbkcyf", SalaryDateUtil.getFormatYearMonth((po.getDeductionMonth()))); + map.put("syylzhbh", po.getAccountNumber()); + map.put("bsjym", po.getCheckCode()); + map.put("ndbf", po.getYearPremium()); + map.put("ydbf", po.getMonthPremium()); + map.put("sjkcje", po.getCurrentDeduction()); + paramMaps.add(map); + } + listRequestParam.put("syylbxfblb", paramMaps); + } + } + + String zykcjze = employeeRequestParam.getOrDefault("zykcjze", "0").toString(); + if (NumberUtil.isNumber(zykcjze) && new BigDecimal(zykcjze).compareTo(new BigDecimal("0")) > 0) { + Map posMap = taxFreeMap.get(TaxFreeTypeEnum.GRANT_DONATION); + List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("zykcjzefb",new ArrayList<>()); + for (GrantDonationPO po : pos) { + Map map = new HashMap<>(); + // 濮撳悕 + map.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 璇佷欢鍙风爜 + map.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + map.put("szdwmc", po.getRecipientName()); + map.put("szdwnsrsbh", po.getTaxCode()); + map.put("jzpzh", po.getDonationNumber()); + if (po.getDonateDate() != null) { + map.put("jzrq", SalaryDateUtil.getFormatLocalDate(po.getDonateDate())); + } + map.put("jzje", po.getDonateAmount()); + map.put("kcbl", po.getDeductionProportion()); + map.put("sjkcje", po.getActualDeduction()); + paramMaps.add(map); + } + listRequestParam.put("zykcjzefb", paramMaps); + } + } + + String jmse = employeeRequestParam.getOrDefault("jmse", "0").toString(); + if (NumberUtil.isNumber(jmse) && new BigDecimal(jmse).compareTo(new BigDecimal("0")) > 0) { + Map posMap = taxFreeMap.get(TaxFreeTypeEnum.DERATE_DEDUCTION); + List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + List> paramMaps = listRequestParam.getOrDefault("jmfblb",new ArrayList<>()); + for (DerateDeductionPO po : pos) { + Map map = new HashMap<>(); + // 濮撳悕 + map.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + // 璇佷欢鍙风爜 + map.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + map.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + map.put("jmsx", po.getDerateItem()); + map.put("jmxz", po.getDerateProperty()); + map.put("sjkcje", po.getDerateAmount()); + paramMaps.add(map); + } + listRequestParam.put("jmfblb", paramMaps); + } + } + + String qt = employeeRequestParam.getOrDefault("qt", "0").toString(); + if (NumberUtil.isNumber(qt) && new BigDecimal(qt).compareTo(new BigDecimal("0")) > 0) { + Map posMap = taxFreeMap.get(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION); + List pos = (List) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle())); + if (CollectionUtils.isNotEmpty(pos)) { + pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList()); + employeeRequestParam.put("bz", pos.get(0).getRemark()); + } + } + } + + private static Map convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum, + List taxReportColumns, + TaxDeclarationValuePO taxDeclarationValue, + EmployeeDeclarePO employeeDeclare) { + if (CollectionUtils.isEmpty(taxReportColumns)) { + return Collections.emptyMap(); + } + Map requestParam = Maps.newHashMap(); + // 濮撳悕 + requestParam.put("xm", employeeDeclare.getEmployeeName()); + // 璇佷欢绫诲瀷 + requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); + // 璇佷欢鍙风爜 + requestParam.put("zzhm", employeeDeclare.getCardNum()); + // 鎵寰楅」鐩 + requestParam.put("sdxm", incomeCategoryEnum.getDefaultLabel()); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + String value = taxDeclarationValue.getResultValue().getOrDefault(taxReportColumn.getReportColumnDataIndex(), StringUtils.EMPTY); + if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) { + value = SalaryEntityUtil.string2BigDecimalDefault0(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())).toPlainString(); + } else if (Objects.equals(taxReportColumn.getDataType(), "integer")) { + value = SalaryEntityUtil.string2BigDecimalDefault0(taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())).setScale(0, RoundingMode.HALF_UP).toPlainString(); + } + requestParam.put(taxReportColumn.getRequestParamKey(), value); + } + return requestParam; + } + + + public static Map convert2flsdRequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares, + Map> taxFreeMap) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.CLASSIFIED_INCOME) + .collect(Collectors.toList()); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES) { + // 涓婂競鍏徃鑲℃伅绾㈠埄鎵寰楋紙娌競銆佹繁甯傘佸垱涓氭澘锛 + List> employeeRequestParams = listRequestParam.computeIfAbsent("ssgsgxhllb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + if (incomeCategoryEnum == IncomeCategoryEnum.CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES) { + // 鍏朵粬鍒╂伅鑲℃伅绾㈠埄鎵寰 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lxgxhllb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + // 鍏朵粬鍏嶇◣鎵i櫎闄勮〃 + buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam); + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } + + + public static Map convert2fjmsdRequestParam(List taxReportColumns, + List taxDeclarations, + List taxDeclarationValues, + List employeeDeclares, + Map> taxFreeMap) { + Map> objRequestParam = Maps.newHashMap(); + Map>> listRequestParam = Maps.newHashMap(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId); + taxDeclarations = taxDeclarations.stream() + .filter(taxDeclaration -> IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()) != null + && IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType()== DeclareReportTypeEnum.NONRESIDENT_INCOME) + .collect(Collectors.toList()); + for (TaxDeclarationPO taxDeclaration : taxDeclarations) { + List values = taxDeclarationValueMap.get(taxDeclaration.getId()); + for (TaxDeclarationValuePO taxDeclarationValue : values) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()); + if (employeeDeclare == null || incomeCategoryEnum == null) { + continue; + } + List taxReportColumnList = taxReportColumnMap.get(Util.null2String(incomeCategoryEnum.getValue())); + Map employeeRequestParam = convert2RequestParam(incomeCategoryEnum, taxReportColumnList, taxDeclarationValue, employeeDeclare); + if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_WAGES_AND_SALARIES) { + // 鏃犱綇鎵涓汉姝e父宸ヨ祫钖噾 + List> employeeRequestParams = listRequestParam.computeIfAbsent("wjgzxjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_MONTHLY_BONUS) { + // 鍏ㄥ勾涓娆℃у閲戞敹鍏 + List> employeeRequestParams = listRequestParam.computeIfAbsent("wjrysyjjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR) { + // 鍐呴涓娆℃цˉ鍋块噾 + List> employeeRequestParams = listRequestParam.computeIfAbsent("lwbclb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS) { + // 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾 + List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java new file mode 100644 index 000000000..900ca5fa9 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationResult.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 鐢熸垚涓◣鐢虫姤琛ㄦ渶鍚庤澶勭悊鐨勬暟鎹 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclarationResult { + + /** + * 涓◣鐢虫姤琛 + */ + private List taxDeclarations; + /** + * 涓◣鐢虫姤鏄庣粏 + */ + private List taxDeclarationValues; + /** + * 寰鏈熺疮璁℃儏鍐 + */ + private List addUpSituations; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java new file mode 100644 index 000000000..74d79ca7d --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationStrategy.java @@ -0,0 +1,20 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +/** + * 鐢熸垚涓◣鐢虫姤琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationStrategy { + + /** + * 鐢熸垚涓◣鐢虫姤琛 + * + * @param taxDeclareContext + * @return + */ + TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId); +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java new file mode 100644 index 000000000..e99e15650 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -0,0 +1,120 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.Data; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 涓◣鐢虫姤琛ㄨ鎯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclarationValueList { + + /** + * 涓◣鐢虫姤琛ㄧ殑琛ㄥご + * + * @param taxReportColumns + * @return + */ + public static List buildTableColumns(List taxReportColumns) { + List weaTableColumns = Lists.newArrayList(); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"), "jobNum")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), "username")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(105139, "璇佷欢绫诲瀷"), "cardType")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(86318, "璇佷欢鍙风爜"), "cardNum")); + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(102786, "鎵寰楅」鐩"), "incomeCategory")); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + weaTableColumns.add(new WeaTableColumn("120", SalaryI18nUtil.getI18nLabel(taxReportColumn.getReportColumnLabel(), taxReportColumn.getReportColumnName()), taxReportColumn.getReportColumnDataIndex())); + } + return weaTableColumns; + } + + /** + * 涓◣鐢虫姤琛ㄧ殑鏁版嵁 + * + * @param taxReportColumns + * @param taxDeclarationValues + * @param simpleEmployees + * @param extEmployees + * @return + */ + public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, + List taxReportColumns, + List taxDeclarationValues, + List employeeDeclares, + List simpleEmployees, + List extEmployees, boolean cnKey) { + if (CollectionUtils.isEmpty(simpleEmployees)) { + return Collections.emptyList(); + } + List> tableDataList = Lists.newArrayList(); + // 鍛樺伐鍩烘湰淇℃伅鎸夌収浜哄憳id鑱氬悎鍒嗙被 + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + // 鍛樺伐鎶ラ佷俊鎭寜鐓т汉鍛榠d鑱氬悎鍒嗙被 + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + // 闈炵郴缁熷憳宸ユ寜鐓т汉鍛榠d鑱氬悎鍒嗙被 + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmpPO::getId); + for (TaxDeclarationValuePO taxDeclarationValue : taxDeclarationValues) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", taxDeclarationValue.getId().toString()); + dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); + dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + dataMap.put(cnKey ? taxReportColumn.getReportColumnName() : taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); + } + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + if (employeeDeclare != null) { + DataCollectionEmployee simpleUserInfo = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put(cnKey ? "宸ュ彿" : "jobNum", employeeDeclare.getJobNum()); + dataMap.put(cnKey ? "濮撳悕" : "username", employeeDeclare.getEmployeeName()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType",CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel() ); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", employeeDeclare.getCardNum()); + dataMap.put(cnKey ? "閮ㄩ棬" : "departmentName", simpleUserInfo == null ? "" : simpleUserInfo.getDepartmentName()); + dataMap.put(cnKey ? "鎵嬫満鍙" : "mobile", simpleUserInfo == null ? "" : simpleUserInfo.getMobile()); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "idNo", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); + } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put(cnKey ? "宸ュ彿" : "jobNum", simpleEmployee.getWorkcode()); + dataMap.put(cnKey ? "濮撳悕" : "username", simpleEmployee.getUsername()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", simpleEmployee.getIdNo()); + dataMap.put(cnKey ? "閮ㄩ棬" : "departmentName", simpleEmployee.getDepartmentName()); + dataMap.put(cnKey ? "鎵嬫満鍙" : "mobile", simpleEmployee.getMobile()); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "idNo", simpleEmployee.getIdNo()); + } else { + ExtEmpPO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put(cnKey ? "宸ュ彿" : "jobNum", extEmployee.getWorkcode()); + dataMap.put(cnKey ? "濮撳悕" : "username", extEmployee.getUsername()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", extEmployee.getIdNo()); + dataMap.put(cnKey ? "閮ㄩ棬" : "departmentName", extEmployee == null ? "" : extEmployee.getDepartmentName()); + dataMap.put(cnKey ? "鎵嬫満鍙" : "mobile", extEmployee == null ? "" : extEmployee.getMobile()); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "idNo", extEmployee == null ? "" : extEmployee.getIdNo()); + } + tableDataList.add(dataMap); + } + return tableDataList; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java new file mode 100644 index 000000000..f5fdc19ad --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareContext.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * 鐢熸垚涓◣鐢虫姤琛ㄦ墍闇鐨勬暟鎹 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclareContext { + + /** + * 钖祫鏍哥畻璁板綍 + */ + private Map salaryAcctRecordMap; + /** + * 钖祫鏍哥畻浜哄憳 + */ + private List salaryAcctEmployees; + /** + * 钖祫鏍哥畻缁撴灉 + */ + private List salaryAcctResultValues; + /** + * 涓◣鐢虫姤琛 + */ + private TaxDeclarationPO taxDeclaration; + /** + * 涓◣鐢虫姤琛ㄥ瓧娈 + */ + private List taxReportColumns; + /** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯銆俴ey锛氳柂璧勮处濂梚d-涓◣鐢虫姤琛ㄥ瓧娈电储寮曘乿alue锛氳柂璧勮处濂楃殑涓◣鐢虫姤琛ㄨ鍒 + */ + private Map salarySobTaxReportRuleMap; + /** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯汇俴ey锛氳柂璧勮处濂梚d-寰鏈熺疮璁℃儏鍐电殑瀛楁绱㈠紩銆乿alue锛氳柂璧勮处濂楃殑绱瀛楁瀵瑰簲鍏崇郴 + */ + private Map salarySobAddUpRuleMap; + /** + * 钖祫椤圭洰 + */ + private List salaryItems; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java new file mode 100644 index 000000000..1765ddc65 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareEmployeeBO.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 涓◣鐢虫姤鏄庣粏琛ㄤ腑鐨勪汉鍛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclareEmployeeBO { + + public static List convert2AbnormalEmployee(List taxDeclareEmployees, + List employeeDeclares, + List simpleEmployees, + List simpleUserInfos, + List extEmployees) { + if (CollectionUtils.isEmpty(taxDeclareEmployees)) { + return Collections.emptyList(); + } + List abnormalEmployeeList = Lists.newArrayList(); + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + Map simpleUserInfoMap = simpleUserInfos.stream() + .collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity(), (a, b) -> a)); + Map extEmployeePOMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmpPO::getId); + for (TaxDeclareEmployeePO taxDeclareEmployee : taxDeclareEmployees) { + AbnormalEmployeeListDTO abnormalEmployeeListDTO = new AbnormalEmployeeListDTO() + .setId(taxDeclareEmployee.getEmployeeId()) + .setEmployeeId(taxDeclareEmployee.getEmployeeId()) + .setEmployeeType(taxDeclareEmployee.getEmployeeType()); + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclareEmployee.getEmployeeId()); + if (employeeDeclare != null) { + DeclareStatusEnum declareStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.class); + abnormalEmployeeListDTO + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()) + .setCardNum(employeeDeclare.getCardNum()) + .setDeclareStatus(declareStatusEnum) + .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); + } else if (taxDeclareEmployee.getEmployeeType() == null || Objects.equals(taxDeclareEmployee.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclareEmployee.getEmployeeId()); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclareEmployee.getEmployeeId()); + abnormalEmployeeListDTO + .setEmployeeName(simpleEmployee.getUsername()) + .setJobNum(simpleEmployee.getWorkcode()) + .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()) + .setDeclareStatus(null) + .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "鎶ラ佷汉鍛樺垪琛ㄤ腑鏃犳浜哄憳")); + } else { + ExtEmpPO extEmployee = extEmployeePOMap.get(taxDeclareEmployee.getEmployeeId()); + abnormalEmployeeListDTO + .setEmployeeName(extEmployee.getUsername()) + .setJobNum("") + .setCardType(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(extEmployee.getIdNo()) + .setDeclareStatus(null) + .setDeclareStatusDesc(SalaryI18nUtil.getI18nLabel(177863, "鎶ラ佷汉鍛樺垪琛ㄤ腑鏃犳浜哄憳")); + } + abnormalEmployeeList.add(abnormalEmployeeListDTO); + } + return abnormalEmployeeList; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java new file mode 100644 index 000000000..2b8e7ecf3 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclareRequest.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Map; + +/** + * 涓◣鐢虫姤鐩稿叧鎺ュ彛鐨勮姹傚弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclareRequest { + + /** + * 渚涘簲鍟嗕俊鎭 + */ + private TaxDeclarationApiConfigPO taxDeclarationApiConfig; + + /** + * 涓◣鎵g即涔夊姟浜 + */ + private TaxAgentPO taxAgent; + + /** + * 涓◣鐢虫姤璁板綍 + */ + private TaxDeclareRecordPO taxDeclareRecord; + + /** + * 璇锋眰鍙傛暟 + */ + private Map requestParam; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java new file mode 100644 index 000000000..88f0400cd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.util.excel.ExcelHead; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 涓◣鐢虫姤-鏍¢獙寮傚父鐨勪汉鍛樺垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class AbnormalEmployeeListDTO { + + //涓婚敭id") + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //鍏宠仈浜哄憳绫诲瀷") + private Integer employeeType; + + //鍏宠仈浜哄憳id") + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + + //濮撳悕") + @TableTitle(title = "濮撳悕",dataIndex = "employeeName",key = "employeeName") + @ExcelHead(title = "濮撳悕",dataIndex = "employeeName") + private String employeeName; + + //宸ュ彿") + @TableTitle(title = "宸ュ彿",dataIndex = "jobNum",key = "jobNum") + @ExcelHead(title = "宸ュ彿",dataIndex = "jobNum") + private String jobNum; + + //璇佷欢绫诲瀷") + @TableTitle(title = "璇佷欢绫诲瀷",dataIndex = "cardType",key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷",dataIndex = "cardType") + private String cardType; + + //璇佷欢鍙风爜") + @TableTitle(title = "璇佷欢鍙风爜",dataIndex = "cardNum",key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜",dataIndex = "cardNum") + private String cardNum; + + //鎶ラ佺姸鎬") + private DeclareStatusEnum declareStatus; + + //鎶ラ佺姸鎬") + @TableTitle(title = "鎶ラ佺姸鎬",dataIndex = "declareStatusDesc",key = "declareStatusDesc") + @ExcelHead(title = "鎶ラ佺姸鎬",dataIndex = "declareStatusDesc") + private String declareStatusDesc; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java new file mode 100644 index 000000000..0d8fa7f8b --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java @@ -0,0 +1,20 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.Data; + +/** + * 涓◣鐢虫姤琛ㄨ鎯呭垪琛紙鍔冲姟鎶ラ叕鎵寰楋級 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastListDTO { + private String local; + + private String online; + + private Object diff; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java new file mode 100644 index 000000000..a5d1ef376 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -0,0 +1,54 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 涓◣鐢虫姤-鐢虫姤澶辫触鐨勪汉鍛樺垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class FailEmployeeListDTO { + + //涓婚敭id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //濮撳悕 + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "濮撳悕", dataIndex = "employeeName") + private String employeeName; + + //涓◣鎵g即涔夊姟浜篿d + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //涓◣鎵g即涔夊姟浜哄悕绉 + @TableTitle(title = "涓◣鎵g即涔夊姟浜哄悕绉", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "涓◣鎵g即涔夊姟浜哄悕绉", dataIndex = "taxAgentName") + private String taxAgentName; + + //璇佷欢鍙风爜 + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") + private String cardNum; + + //澶辫触鍘熷洜 + @TableTitle(title = "澶辫触鍘熷洜", dataIndex = "errorMsg", key = "errorMsg") + @ExcelHead(title = "澶辫触鍘熷洜", dataIndex = "errorMsg") + private String errorMsg; + + //鎵寰楅」鐩 +// @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategory", key = "incomeCategory") +// @ExcelHead(title = "鎵寰楅」鐩", dataIndex = "incomeCategory") + private String incomeCategory; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java index 9f690c6c1..11bf92716 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationDetailListDTO.java @@ -7,12 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 涓◣鐢虫姤琛ㄨ鎯呭垪琛 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 10:31 AM - * @version:v1.0 - */ + * 涓◣鐢虫姤琛ㄨ鎯呭垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java index b8b120063..d61314504 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationFormDTO.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import java.time.YearMonth; /** - * @description: 涓◣鐢虫姤璁板綍琛ㄥ崟 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 9:40 AM - * @version:v1.0 - */ + * 涓◣鐢虫姤璁板綍琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index 11900c619..c3d48af5b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -1,34 +1,72 @@ package com.engine.salary.entity.taxdeclaration.dto; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** - * @description: 涓◣鐢虫姤琛ㄤ俊鎭 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/16/21 3:22 PM - * @version:v1.0 - */ + * 涓◣鐢虫姤琛ㄤ俊鎭 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class TaxDeclarationInfoDTO { - //钖祫鎵灞炴湀") - @JsonSerialize(using = ToStringSerializer.class) - private YearMonth salaryMonth; - //涓◣鎵g即涔夊姟浜篿d") + @ApiModelProperty("钖祫鎵灞炴湀") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date salaryMonth; + + @ApiModelProperty("绋庢鎵灞炴湡") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxCycle; + + @ApiModelProperty("涓◣鎵g即涔夊姟浜篿d") + @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //涓◣鎵g即涔夊姟浜哄悕绉") + @ApiModelProperty("涓◣鎵g即涔夊姟浜哄悕绉") private String taxAgentName; + + @ApiModelProperty("鐢虫姤绫诲瀷") + private TaxDeclareTypeEnum declareType; + + @ApiModelProperty("鐢虫姤绫诲瀷鎻忚堪") + private String declareTypeDesc; + + @ApiModelProperty("鐢虫姤鐘舵") + private TaxDeclareStatusEnum declareStatus; + + @ApiModelProperty("鐢虫姤鐘舵佹弿杩") + private String declareStatusDesc; + + @ApiModelProperty("鐢虫姤澶辫触鐨勯敊璇俊鎭") + private String declareErrorMsg; + + @ApiModelProperty("鏄惁灞曠ず鍥炬爣") + private boolean displayIcon; + + @ApiModelProperty("鐢虫姤澶辫触鐨勪汉鏁") + private Integer declareFailSize; + + @ApiModelProperty("鏍¢獙寮傚父鐨勪汉鏁") + private Integer abnormalSize; + + @ApiModelProperty("宸茬即閲戦") + private String taxPaidAmount; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java new file mode 100644 index 000000000..2d3f285b7 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +@Data +@Accessors(chain = true) +public class TaxDeclarationRateDTO implements Serializable { + + private static final long serialVersionUID = 8478996890743085394L; + + //缂撳瓨绱㈠紩") + private String index; + //鎻愮ず淇℃伅") + private String msg; + //鐘舵") + private boolean status; + //鏄惁宸茬粡瀹屾垚") + private boolean finish; + //鎻愮ず淇℃伅鏄惁鑷姩娑堝け") + private boolean msgPersist; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java new file mode 100644 index 000000000..dbebb32bb --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationReportDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 涓◣鐢虫姤绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationReportDTO { + + private DeclareReportTypeEnum reportType; + + private TaxDeclareStatusPO status; + + private List taxDeclarations; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java new file mode 100644 index 000000000..c30f4cae2 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 涓◣鐢虫姤琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclarationTabDTO { + + //Tab椤电鐨勫悕绉") + private String tabName; + + //鏀跺叆鎵寰楃被鍨") + private IncomeCategoryEnum incomeCategory; + + //涓◣鐢虫姤琛╥d") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxDeclarationId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java new file mode 100644 index 000000000..a546652f1 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.salary.annotation.SalaryTable; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤琛ㄨ鎯呭垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@SalaryTable(pageId = "34h8e2r7-9ee6-4d11-adn9-7t0ge54d6rj8", tableType = WeaTableType.CHECKBOX) +public class TaxDeclarationValueListDTO { + + /** + * 涓◣鐢虫姤琛ㄨ〃澶 + */ + private List columns; + + /** + * 涓◣鐢虫姤琛ㄦ暟鎹 + */ + private List> data; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java new file mode 100644 index 000000000..04e7d0bff --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤鏄庣粏鏂板琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclareRecordDetailFormDTO { + + /** + * 涓◣鐢虫姤琛╥d + */ + private Long taxDeclarationId; + + //涓婚敭id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //浜哄憳id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + private Integer employeeType; + + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + private String username; + + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + private String cardType; + + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + /** + * 鏀跺叆鎵寰楅」鐩 + */ + private String incomeCategory; + + /** + * 浜哄憳鎶ラ佷笅鎷夐夋嫨 + */ + private List employeeDeclares; + + /** + * 褰撳墠鐢虫姤绫诲瀷鍙紪杈戝瓧娈 + */ + private List taxReportColumns; + private Map resultValue; + + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class TaxReportColumn { + //鎶ヨ〃绫诲瀷 + private String taxReportType; + //鎵寰楅」鐩 + private String incomeCategory; + //鐢虫姤琛ㄥ垪绱㈠紩 + private String reportColumnDataIndex ; + //鐢虫姤琛ㄧ殑鍒楀悕 + private String reportColumnName; + //鏁板肩被鍨 + private String dataType; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java new file mode 100644 index 000000000..455e973ea --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤璁板綍琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("涓◣鐢虫姤璁板綍琛ㄥ崟") +public class TaxDeclareRecordFormDTO { + + //钖祫鎵灞炴湀") + private Date salaryMonth; + + //涓◣鎵g即涔夊姟浜鸿寖鍥") + private TaxAgentRangeEnum taxAgentRange; + + //涓◣鎵g即涔夊姟浜篿d") + private List> taxAgentIds; + + //澶囨敞") + private String description; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java new file mode 100644 index 000000000..4af1295f8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -0,0 +1,83 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 涓◣鐢虫姤璁板綍鍒楄〃 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class TaxDeclareRecordListDTO { + + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //涓◣鎵g即涔夊姟浜 + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //涓◣鎵g即涔夊姟浜哄悕绉 + @TableTitle(title = "涓◣鎵g即涔夊姟浜哄悕绉",dataIndex = "taxAgentName",key = "taxAgentName") + private String taxAgentName; + + //钖祫鎵灞炴湀 + @TableTitle(title = "钖祫鎵灞炴湀",dataIndex = "salaryMonth",key = "salaryMonth") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date salaryMonth; + + //绋庢鎵灞炴湡 + @TableTitle(title = "绋庢鎵灞炴湡",dataIndex = "taxCycle",key = "taxCycle") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date taxCycle; + + //鐢虫姤绫诲瀷 + private TaxDeclareTypeEnum taxDeclareType; + + //鐢虫姤绫诲瀷 + @TableTitle(title = "鐢虫姤绫诲瀷",dataIndex = "taxDeclareTypeDesc",key = "taxDeclareTypeDesc") + private String taxDeclareTypeDesc; + + //鐢虫姤鐘舵 + private TaxDeclareStatusEnum taxDeclareStatus; + + //鐢虫姤鐘 + @TableTitle(title = "鐢虫姤鐘舵",dataIndex = "taxDeclareStatusDesc",key = "taxDeclareStatusDesc") + private String taxDeclareStatusDesc; + + //宸茬即閲戦 + @TableTitle(title = "宸茬即閲戦",dataIndex = "taxPaidAmount",key = "taxPaidAmount") + private String taxPaidAmount; + + //鎿嶄綔浜篿d + @JsonSerialize(using = ToStringSerializer.class) + private Long operateEmployeeId; + + //鎿嶄綔浜哄悕绉 + @TableTitle(title = "鎿嶄綔浜哄悕绉",dataIndex = "operateEmployeeName",key = "operateEmployeeName") + private String operateEmployeeName; + + //鎿嶄綔鏃堕棿 + @TableTitle(title = "鎿嶄綔鏃堕棿",dataIndex = "operateTime",key = "operateTime") + private String operateTime; + + //澶囨敞 + @TableTitle(title = "澶囨敞",dataIndex = "description",key = "description") + private String description; + + //鏄惁灞曠ず鍥炬爣 + private boolean displayIcon; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java new file mode 100644 index 000000000..aa55a89f0 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxReportColumnDTO.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 涓◣鐢虫姤琛ㄨ〃澶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaxReportColumnDTO { + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 鐢虫姤琛ㄧ殑鍒楀悕 + */ + private String reportColumnName; + + /** + * 鐢虫姤琛ㄧ殑鍒楃储寮 + */ + private String reportColumnDataIndex; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java new file mode 100644 index 000000000..55f552c6d --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 涓◣鐢虫姤-寮傚父鏁版嵁-鏈姤閫佷汉鍛樺垪琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class AbnormalEmployeeListQueryParam extends BaseQueryParam { + + //宸ュ彿銆佸鍚嶃佽韩浠借瘉鍙风爜") + private String keyword; + + //涓◣鐢虫姤璁板綍id") + private Long taxDeclareRecordId; + + @JsonIgnore + //涓◣鎵g即涔夊姟浜篿d") + private Long taxAgentId; + + @JsonIgnore + //绋庢鎵灞炴湡") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java new file mode 100644 index 000000000..7fa470450 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/ContrastQueryParam.java @@ -0,0 +1,38 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.Data; + +import java.util.List; + +/** + * 瀵规瘮鏌ヨ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastQueryParam extends BaseQueryParam { + + /** + * 鐢虫姤琛╥d + */ + private Long taxDeclarationId; + + /** + * 鏄惁鍙樉绀哄樊寮備汉鍛 + */ + private boolean onlyShowDiffEmp; + + /** + * 鏄惁鍙樉绀哄樊寮傞」 + */ + private boolean onlyShowDiffItem; + + /** + * 绛涢夊姣旈」鐩 + */ + private List columns; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java new file mode 100644 index 000000000..dbcdfccc8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class DeclareTaxResultFeedbackQueryParam { + + @DataCheck(require = true, message = "涓◣鐢虫姤璁板綍id涓嶈兘涓虹┖锛") + Long id; + + @DataCheck(require = true, message = "鐢虫姤绫诲瀷涓嶈兘涓虹┖锛") + Integer reportType; + + String requestId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java new file mode 100644 index 000000000..7037ae964 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DownloadTemplateParam { + /** + * 鐢虫姤琛╥d锛屼笅杞芥ā鏉 + */ + @DataCheck(require = true,message = "imageId涓虹┖") + Long taxDeclarationId; + + + + /** + * 瀵煎叆鏂囦欢id + */ + String imageId; + + + //涓嬭浇妯℃澘鏃舵槸鍚﹀甫鍑虹幇鏈夋暟鎹 + private boolean hasData; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java new file mode 100644 index 000000000..09af485df --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/GetCompanyIncomesQueryParam.java @@ -0,0 +1,22 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class GetCompanyIncomesQueryParam { + + @DataCheck(require = true, message = "涓◣鐢虫姤璁板綍id涓嶈兘涓虹┖锛") + Long id; + + @DataCheck(require = true, message = "鐢虫姤绫诲瀷涓嶈兘涓虹┖锛") + Integer reportType; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java new file mode 100644 index 000000000..7104856ff --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏂板涓◣鐢虫姤琛ㄥ弬鏁 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationAddParam { + + /** + * 涓◣鐢虫姤璁板綍id + */ + @DataCheck(require = true, message = "涓◣鐢虫姤璁板綍id涓虹┖") + private Long taxDeclareRecordId; + + /** + * 钖祫绫诲瀷 + */ + @DataCheck(require = true, message = "钖祫绫诲瀷涓虹┖") + private IncomeCategoryEnum incomeCategory; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java index 0168f9c89..0b309e9c4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationBatParam.java @@ -6,7 +6,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; import java.util.Date; import java.util.List; @@ -32,7 +31,7 @@ public class TaxDeclarationBatParam { /** * 钖祫鎵灞炴湀 */ - private YearMonth salaryMonth; + private Date salaryMonth; /** * 涓◣鎵g即涔夊姟浜 diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java new file mode 100644 index 000000000..aac346fb1 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鍒犻櫎涓◣鐢虫姤琛ㄥ弬鏁 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationDeleteParam { + + /** + * 涓◣鐢虫姤琛╥d + */ + @DataCheck(require = true, message = "涓◣鐢虫姤琛╥d涓虹┖") + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java index 8fffb93cc..0c9439b27 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java @@ -1,11 +1,15 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; +import java.util.List; import java.time.YearMonth; import java.util.Date; @@ -31,13 +35,24 @@ public class TaxDeclarationSaveParam { /** * 钖祫鎵灞炴湀 */ - private YearMonth salaryMonth; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date salaryMonth; /** * 涓◣鎵g即涔夊姟浜 */ private Long taxAgentId; + /** + * 涓◣鎵g即涔夊姟浜鸿寖鍥 + */ + private TaxAgentRangeEnum taxAgentRange; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private List taxAgentIds; + /** * 澶囨敞 */ diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java new file mode 100644 index 000000000..ff40cf181 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import lombok.Data; + +/** + * 涓◣鐢虫姤璁板綍璇︽儏鍒楄〃鏌ヨ鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclarationValueListQueryParam extends BaseQueryParam { + + //涓◣鐢虫姤璁板綍id") + private Long taxDeclareRecordId; + + //涓◣鐢虫姤琛╥d") + private Long taxDeclarationId; + + //鏀跺叆鎵寰楅」鐩") + private IncomeCategoryEnum incomeCategory; + + //瀵煎嚭excel鏃跺姞瀵嗙殑瀵嗙爜") + private String sharePassword; + + /** + * 濮撳悕鎴栬呭伐鍙 + */ + private String keyword; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java new file mode 100644 index 000000000..3386119bf --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.Data; + +/** + * 涓◣鐢虫姤鏄庣粏淇濆瓨 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordDetailFormParam { + + /** + * 涓◣鐢虫姤琛╥d + */ + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java new file mode 100644 index 000000000..0f60decd9 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailSaveParam.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.Map; + +/** + * 涓◣鐢虫姤鏄庣粏淇濆瓨 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordDetailSaveParam { + + //涓婚敭id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //涓◣鐢虫姤琛╥d + private Long taxDeclarationId; + + //浜哄憳id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + private Integer employeeType; + + private Map taxReportColumnValues; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java new file mode 100644 index 000000000..54b1ee11a --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordParam { + + /** + * 涓◣鐢虫姤璁板綍id + */ + @DataCheck(require = true,message = "涓◣鐢虫姤璁板綍id涓嶈兘涓虹┖锛") + private Long taxDeclareRecordId; + + /** + * 鐢虫姤绫诲瀷 + * @see DeclareReportTypeEnum + */ + @DataCheck(require = true,message = "鐢虫姤绫诲瀷涓嶈兘涓虹┖锛") + private Integer reportType; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java new file mode 100644 index 000000000..e89c94530 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -0,0 +1,94 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鐢虫姤鐩稿叧api閰嶇疆 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_config") +public class TaxDeclarationApiConfigPO implements Serializable { + + private static final long serialVersionUID = 2287550079146871129L; + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 鎺ュ彛host + */ + private String host; + /** + * app key + */ + private String appKey; + /** + * 瀵嗛挜 + */ + private String appSecret; + + /** + * 鏄惁寮鍚娇鐢 + */ + private Integer enableUse; + + /** + * 鎬绘祦閲 + */ + private Long totality; + + /** + * 鍓╀綑娴侀噺 + */ + private Long remain; + + /** + * 娴侀噺鏈鍚庢洿鏂版椂闂 + */ + private Date lastUpdateTime; + + /** + * 绉熸埛key + */ + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + //鏌ヨ鏉′欢 + Collection ids; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java new file mode 100644 index 000000000..d726a2ca6 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 涓◣鐢虫姤鐩稿叧api閰嶇疆 + * + * @author chengliming + * @date 2022-11-09 09:49:08 + */ +@Data +@Accessors(chain = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_declare_api_profile") +public class TaxDeclarationApiProfilePO implements Serializable { + + private static final long serialVersionUID = 8281861662866222040L; + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 鎺ュ彛鐜 + * + * @see TaxDeclareApiProfileEnum + */ + private Integer apiProfile; + + /** + * 绉熸埛key + */ + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java index b667fb071..6de2b37df 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -34,6 +34,18 @@ public class TaxDeclarationPO { */ private Long id; + /** + * 涓◣鐢虫姤璁板綍id + */ + private Long taxDeclareRecordId; + + /** + * 钖祫绫诲瀷 + * + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + /** * 钖祫鎵灞炴湀 */ @@ -49,12 +61,6 @@ public class TaxDeclarationPO { */ private Long taxAgentId; - /** - * 钖祫绫诲瀷 - * - * @see IncomeCategoryEnum - */ - private Integer incomeCategory; /** * 澶囨敞 @@ -86,10 +92,24 @@ public class TaxDeclarationPO { */ private Date updateTime; - //绋庢鎵灞炴湡 + + /** + * 鏌ョ湅鎺у埗 + */ + private Integer controlView; + + /** + * 钖祫鎵灞炴湀 + */ LocalDateRange salaryMonths; + /** + * 绋庢鎵灞炴湡 + */ + LocalDateRange taxMonths; + + //"寮濮嬫棩鏈 private Date taxCycleFromDate; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java new file mode 100644 index 000000000..c2d08e3c3 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -0,0 +1,114 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.annotation.Encrypt; +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; +import java.util.Map; + +/** + * 涓◣鐢虫姤琛ㄧ殑鍊 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_tax_declaration_value") +@ElogTransform( name ="涓◣鐢虫姤琛ㄧ殑鍊" ) +public class TaxDeclarationValuePO implements Serializable { + /** + * 涓婚敭id + */ + @ElogTransform( name ="涓婚敭id" ) + private Long id; + + /** + * 涓◣鐢虫姤琛╥d + */ + @ElogTransform( name ="涓◣鐢虫姤琛╥d" ) + private Long taxDeclarationId; + + /** + * 涓◣鐢虫姤璁板綍id + */ + @ElogTransform( name ="涓◣鐢虫姤璁板綍id" ) + private Long taxDeclareRecordId; + + /** + * 浜哄憳绫诲瀷 + */ + @ElogTransform( name ="浜哄憳绫诲瀷" ) + private Integer employeeType; + + /** + * 浜哄憳id + */ + @ElogTransform( name ="浜哄憳id" ) + private Long employeeId; + + /** + * 钖祫鏍哥畻缁撴灉 + */ + @ElogTransform( name ="钖祫鏍哥畻缁撴灉" ) + private Map resultValue; + + /** + * 钖祫鏍哥畻缁撴灉锛堝彧鍦ㄥ姞瀵嗚В瀵嗕腑浣跨敤锛 + */ + @Encrypt + @ElogTransform( name ="钖祫鏍哥畻缁撴灉" ) + private String resultValueJson; + + /** + * 绉熸埛key + */ + @ElogTransform( name ="绉熸埛key" ) + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + @ElogTransform( name ="鍒涘缓浜篿d" ) + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + @ElogTransform( name ="鏄惁鍒犻櫎" ) + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + @ElogTransform( name ="鍒涘缓鏃堕棿" ) + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + @ElogTransform( name ="鏇存柊鏃堕棿" ) + private Date updateTime; + + /** + * 鏁版嵁鏉ユ簮 + * @see SourceEnum + */ + @ElogTransform( name ="鏁版嵁鏉ユ簮" ) + private Integer source; + + private Collection ids; + private Collection taxDeclarationIds; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java new file mode 100644 index 000000000..82aabe994 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 涓◣鐢虫姤涓殑浜哄憳 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TaxDeclareEmployeePO { + + //浜哄憳id") + private Long employeeId; + + //浜哄憳绫诲瀷") + private Integer employeeType; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java new file mode 100644 index 000000000..8192b5acd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareFailPO.java @@ -0,0 +1,69 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.report.enums.IncomeCategoryEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鐢虫姤澶辫触鏁版嵁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_tax_declare_fail") +public class TaxDeclareFailPO implements Serializable { + + private static final long serialVersionUID = -7908151391741544058L; + + private Long id; + + private Long taxDeclareRecordId; + + /** + * @see IncomeCategoryEnum + */ + //鎵寰楅」鐩") + private String incomeCategory; + + //濮撳悕") + private String employeeName; + + //璇佷欢鍙风爜") + private String cardNum; + + //澶辫触鍘熷洜") + private String errorMsg; + + //绉熸埛key", ignore = true) + private String tenantKey; + + //鍒涘缓浜篿d", ignore = true) + private Long creator; + + //鏄惁鍒犻櫎", ignore = true) + private Integer deleteType; + + //鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + //鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + private Collection ids; + private Collection taxDeclareRecordIds; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java new file mode 100644 index 000000000..d25ee490c --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -0,0 +1,131 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_tax_declare_record") +//涓◣鐢虫姤璁板綍") +public class TaxDeclareRecordPO implements Serializable { + + private static final long serialVersionUID = -1891927328401341853L; + /** + * 涓婚敭id + */ + private Long id; + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + private Long taxAgentId; + /** + * 钖祫鎵灞炴湀 + */ + private Date salaryMonth; + /** + * 绋庢鎵灞炴湡 + */ + private Date taxCycle; + /** + * 鐢虫姤绫诲瀷 + * + * @see TaxDeclareTypeEnum + */ + @Deprecated + private Integer taxDeclareType; + /** + * 鐢虫姤鐘舵 + * + * @see TaxDeclareStatusEnum + */ + @Deprecated + private Integer taxDeclareStatus; + /** + * 鐢虫姤澶辫触鐨勯敊璇俊鎭 + */ + @Deprecated + private String taxDeclareErrorMsg; + /** + * 璇锋眰鐨剅equestId + */ + @Deprecated + private String requestId; + /** + * 鐢虫姤鐨剅equestId锛岀敤浜庝笅杞界敵鎶ヨ繃绋 + */ + @Deprecated + private String declareRequestId; + /** + * 澶囨敞 + */ + private String remark; + + //搴旂即閲戦 + @Deprecated + private String taxPayAmount; + + //瀹炵即鎬婚 + @Deprecated + private String taxPaidAmount; + + //瀹炵即绋庨锛堜笉鍚粸绾抽噾绛夛級 + @Deprecated + private String taxPurePaidAmount; + + //鐢虫姤浜烘暟 + @Deprecated + private Integer personNum; + + /** + * 涓◣鐢虫姤琛ㄧ殑寰呭埛鏂版暟鎹殑鏍囪瘑 + */ + private Integer displayUpdateIcon; + /** + * 绉熸埛key + */ + private String tenantKey; + /** + * 鍒涘缓浜篿d + */ + private Long creator; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + + private Collection ids; + private Collection taxAgentIds; + private Date startDate; + private Date endDate; + private Date salaryMonthStartDate; + private Date salaryMonthEndDate; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java new file mode 100644 index 000000000..8919ed2f1 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareStatusPO.java @@ -0,0 +1,79 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclareStatusPO { + /** + * ID + */ + private Long id; + /** + * 鐢虫姤璁板綍id + */ + private Long taxDeclareRecordId; + /** + * 鐢虫姤绫诲瀷 1锛氱患鍚堟墍寰; 2: 鍒嗙被鎵寰楋紱3锛氶潪灞呮皯鎵寰;4:闄愬敭鑲℃墍寰 + * @see DeclareReportTypeEnum + */ + private Integer reportType; + /** + * 渚涘簲鍟嗙涓夋柟绯荤粺杩斿洖鐨剅equestid + */ + private String requestId; + /** + * 鐢虫姤绫诲瀷 + */ + private Integer taxDeclareType; + /** + * 鐢虫姤鐘舵 + * @see TaxDeclareStatusEnum + */ + private Integer taxDeclareStatus; + /** + * 鍒锋柊鏍囪瘑 + */ + private Integer displayUpdateIcon; + /** + * 閿欒淇℃伅 + */ + private String taxDeclareErrorMsg; + /** + * 鐢虫姤浜烘暟 + */ + private Integer personNum; + /** + * 搴旂即 + */ + private String taxPayAmount; + /** + * 瀹炵即鎬婚 + */ + private String taxPaidAmount; + /** + * 瀹炵即锛堜笉鍚粸绾抽噾锛 + */ + private String taxPurePaidAmount; + /** + * 璁板綍鐢虫姤涓氬姟id锛岀敤浜庝笅杞藉唴缃畻绋庤繃绋 + */ + private String declareRequestId; + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + //涓婚敭id闆嗗悎 + private Collection ids; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java new file mode 100644 index 000000000..f2b61a35e --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -0,0 +1,98 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣鐢虫姤琛ㄨ〃澶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_tax_report_column +public class TaxReportColumnPO { + + /** + * 涓婚敭id + */ + private Long id; + + /** + * 鎶ヨ〃绫诲瀷 + */ + private String taxReportType; + + /** + * 鎵寰楅」鐩 + */ + private String incomeCategory; + + /** + * 鐢虫姤琛ㄧ殑鍒楀悕 + */ + private String reportColumnName; + + /** + * 鐢虫姤琛ㄧ殑鍒楀悕澶氳瑷鏍囩 + */ + private Integer reportColumnLabel; + + /** + * 鐢虫姤琛ㄧ殑鍒楃储寮 + */ + private String reportColumnDataIndex; + + /** + * 鏁板肩被鍨 + */ + private String dataType; + + /** + * 涓◣瀵规帴鏃剁殑鍙傛暟key + */ + private String requestParamKey; + + /** + * 鏄惁鏄姣斿瓧娈碉紝1鏄0鍚 + */ + private Integer contrastType; + + /** + * 绉熸埛key + */ + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + private Date updateTime; + + Collection ids; + Collection contrastTypes; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java new file mode 100644 index 000000000..d22edac56 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +import java.util.Map; + +/** + * 浣滃簾鐢虫姤鐨勫弽棣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CancelDeclareFeedbackResponse extends BaseResponse { + + //鎺ュ彛鐘舵") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java new file mode 100644 index 000000000..3d2e1bbc3 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 浣滃簾鐢虫姤鐨勮繑鍥炴暟鎹 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CancelDeclareResponse { + + //鎺ュ彛鐘舵") + private SzyhResponseHead head; + + //鎺ュ彛鏁版嵁") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java new file mode 100644 index 000000000..c97fb1451 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -0,0 +1,24 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +import java.util.Map; + +/** + * 鐢虫姤涓◣鐨勫弽棣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class DeclareTaxFeedbackResponse { + + //鎺ュ彛鐘舵") + private SzyhResponseHead head; + + //鎺ュ彛鐘舵") + private Map body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java new file mode 100644 index 000000000..9cbb66495 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 涓◣鐢虫姤鐨勮繑鍥炴暟鎹 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class DeclareTaxResponse { + + //鎺ュ彛鐘舵") + private SzyhResponseHead head; + + //鎺ュ彛鏁版嵁") + private AsyncRequestIdDTO body; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java new file mode 100644 index 000000000..7c586658c --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -0,0 +1,16 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; + +/** + * 鏇存鐢虫姤鐨勮繑鍥炴暟鎹 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class UpdateDeclareResponse extends BaseResponse { +} diff --git a/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java new file mode 100644 index 000000000..c1ac514d8 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/bo/TaxPaymentBO.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.taxpayment.bo; + +import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; +import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; + +/** + * @author chengliming + * @date 2022-12-07 2:16 PM + **/ +public class TaxPaymentBO { + public static TaxWithholdingVoucherFeedbackDTO buildTaxWithholdingVoucherFeedbackDTO(WithholdingVoucherFeedbackResponse.Feedback synthesize) { + return TaxWithholdingVoucherFeedbackDTO.builder() + .taxDeclareCode(synthesize.getSblxdm()) + .taxDeclareName(synthesize.getSblxmc()) + .voucherNo(synthesize.getJkpzxh()) + .firstPrintDate(synthesize.getDysj()) + .taxCode(synthesize.getNsrsbh()) + .taxAgentName(synthesize.getNsrxm()) + .taxAuthoritiesNo(synthesize.getSwjgdm()) + .taxAuthoritiesName(synthesize.getSwjgmc()) + .deadline(synthesize.getXjrq()) + .lowerFormatAmount(synthesize.getXxjehj()) + .upperFormatAmount(synthesize.getDxjehj()) + .remark(synthesize.getBz()) + .printNum(synthesize.getDycs()) + .build(); + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java new file mode 100644 index 000000000..59b4903ca --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏌ヨ缂磋垂淇℃伅 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ缂磋垂淇℃伅") +public class TaxAgreementBankFormDTO { + + + //寮鎴疯") + private String bank; + + //寮鎴疯处鍙") + private String bankNo; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java new file mode 100644 index 000000000..04bde84da --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 鑾峰彇涓夋柟鏌ヨ鍙嶉缁撴灉 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鑾峰彇涓夋柟鏌ヨ鍙嶉缁撴灉") +public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO { + //瀹炵即閲戦") + private String payAmount; + + //婊炵撼閲戠瓑閲戦") + private String otherAmount; + + //鐢虫姤浜烘暟") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java new file mode 100644 index 000000000..c4d42ef2f --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFormDTO.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +/** + * 鏌ヨ缂磋垂淇℃伅 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ缂磋垂淇℃伅") +public class TaxAgreementFormDTO extends TaxFeedbackResultDTO { + + private Map form; + + private Map count; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java new file mode 100644 index 000000000..9da6b4793 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏌ヨ缂磋垂淇℃伅 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ缂磋垂淇℃伅") +public class TaxAmountFormDTO { + + //涓◣鎵g即涔夊姟浜") + private String taxAgent; + + //搴旂即閲戦") + private String amount; + + //鐢虫姤浜烘暟") + private String personNum; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java new file mode 100644 index 000000000..4ea43c7f4 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java @@ -0,0 +1,34 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + + +/** + * 鑾峰彇涓夋柟鏌ヨ鍙嶉缁撴灉 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鑾峰彇鍙嶉缁撴灉") +public class TaxFeedbackResultDTO { + //璇锋眰id") + private String requestId; + + //鎻愮ず璇") + private String msg; + + //澶勭悊缁撴灉") + private String result; + + //鏄惁缁撴潫杞") + private Boolean finish; +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java new file mode 100644 index 000000000..6a5582e4e --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏌ヨ缂磋垂淇℃伅 + * + * @author chengliming + * @date 2022-12-27 13:25:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ缂磋垂淇℃伅") +public class TaxPayTypeFormDTO { + + //缂存鏂瑰紡") + private String type; + +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java new file mode 100644 index 000000000..66718e6e3 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.List; + + +/** + * 鑾峰彇瀹岀◣璇佹槑 + * + * @author chengliming + * @date 2022-12-06 17:25:21 + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鑾峰彇瀹岀◣璇佹槑") +public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { + //瀹岀◣璇佹槑") + private List vouchers; + + @Data + @AllArgsConstructor + public static class Voucher { + //鍚嶇О") + private String name; + + //鍐呭") + private String content; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java new file mode 100644 index 000000000..36b234da2 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithholdingVoucherFeedbackDTO.java @@ -0,0 +1,89 @@ +package com.engine.salary.entity.taxpayment.dto; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ缂磋垂鍑瘉") +public class TaxWithholdingVoucherFeedbackDTO extends TaxFeedbackResultDTO { + /** + * 鐢虫姤绫诲瀷浠g爜 + */ + private String taxDeclareCode; + /** + * 鐢虫姤绫诲瀷鍚嶇О + */ + private String taxDeclareName; + /** + * 缂存鍑瘉搴忓彿 + */ + private String voucherNo; + /** + * 棣栨鎵撳嵃鏃堕棿 + */ + private String firstPrintDate; + /** + * 绾崇◣浜鸿瘑鍒彿 + */ + private String taxCode; + /** + * 绾崇◣浜哄悕绉 + */ + private String taxAgentName; + /** + * 绋庡姟鏈哄叧浠g爜 + */ + private String taxAuthoritiesNo; + /** + * 绋庡姟鏈哄叧鍚嶇О + */ + private String taxAuthoritiesName; + /** + * 绋庢闄愮即鏃ユ湡 + */ + private String deadline; + /** + * 閲戦鍚堣锛堝皬鍐欙級 + */ + private String lowerFormatAmount; + /** + * 閲戦鍚堣锛堝ぇ鍐欙級 + */ + private String upperFormatAmount; + /** + * 澶囨敞 + */ + private String remark; + /** + * 鎵撳嵃娆℃暟 + */ + private String printNum; + /** + * 缂存鍑瘉鏄庣粏鍒楄〃 + */ + private List details; + + @Data + public static class Detail { + /** + * 鎵f鍙嶉浠g爜 + */ + private String paymentCode; + /** + * 鎵f鍚嶇О + */ + private String paymentItem; + /** + * 瀹炵即绋庨 + */ + private String payAmount; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java new file mode 100644 index 000000000..11d145388 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -0,0 +1,58 @@ +package com.engine.salary.entity.taxpayment.param; + +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 鏌ヨ浼佷笟涓夋柟淇℃伅 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("鏌ヨ浼佷笟涓夋柟淇℃伅") +public class TaxPaymentQueryParam { + + //涓◣鎵g即涔夊姟浜篿d") + private Long taxAgentId; + + //绋庢鎵灞炴湡") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxYearMonth; + + //涓◣鐢虫姤璁板綍id") + private Long taxDeclareRecordId; + + /** + * @see TaxPaymentServiceTypeEnum + */ + //涓氬姟绫诲瀷") + private Integer type; + + //涓夋柟鍗忚鍙") + private String protocolNumber; + + /** + * 缂存甯愬彿 + */ + private String paymentNumber; + + //搴旂即绋庨") + private String taxAmount; + + //鏄惁涓哄弽棣堟牎楠 0鍚 1鏄") + private Integer checkFeedback; + + //鐢虫姤琛ㄧ被鍨 + private Integer reportType; +} diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java new file mode 100644 index 000000000..55e0c69c5 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -0,0 +1,110 @@ +package com.engine.salary.entity.taxpayment.po; + +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +/** + * 涓◣杈呭姪缂存-涓夋柟缂存璇锋眰 + * + * @author chengliming + * @date 2022-12-07 13:41:30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_tax_payment_request") +//涓◣杈呭姪缂存-璇锋眰淇℃伅") +public class TaxPaymentRequestPO implements Serializable { + + private static final long serialVersionUID = -203732044881927518L; + /** + * 涓婚敭id + */ + //涓婚敭id") + private Long id; + + /** + * 涓◣鎵g即涔夊姟浜虹殑涓婚敭id + */ + //涓◣鎵g即涔夊姟浜虹殑涓婚敭id") + private Long taxAgentId; + + /** + * 涓◣鐢虫姤璁板綍ID + */ + //涓◣鐢虫姤璁板綍id") + private Long taxDeclareRecordId; + + /** + * 绋庢鎵灞炴湡 + */ + //绋庢鎵灞炴湡") + private Date taxYearMonth; + + /** + * 寮傛璇锋眰ID + */ + //寮傛璇锋眰ID") + private String requestId; + + + /** + * 璇锋眰绫诲瀷 + * + * @see TaxPaymentServiceTypeEnum + */ + //寮傛璇锋眰ID") + private Integer requestType; + + /** + * 鏄惁宸茶幏鍙栧弽棣 + * + *@see SalaryOnOffEnum + */ + //鏄惁宸茶幏鍙栧弽棣") + private Integer feedback; + + private Integer reportType; + + /** + * 绉熸埛key + */ + //绉熸埛key", ignore = true) + private String tenantKey; + + /** + * 鍒涘缓浜篿d + */ + //鍒涘缓浜篿d", ignore = true) + private Long creator; + + /** + * 鏄惁鍒犻櫎 + */ + //鏄惁鍒犻櫎", ignore = true) + private Integer deleteType; + + /** + * 鍒涘缓鏃堕棿 + */ + //鍒涘缓鏃堕棿", ignore = true) + private Date createTime; + + /** + * 鏇存柊鏃堕棿 + */ + //鏇存柊鏃堕棿", ignore = true) + private Date updateTime; + + //鏌ヨ鏉′欢 + Collection ids; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java new file mode 100644 index 000000000..b1766074b --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/AgreementQueryFeedbackResponse.java @@ -0,0 +1,86 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 鑾峰彇浼佷笟娆犺垂淇℃伅鏌ヨ鍙嶉缁撴灉 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class AgreementQueryFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + + /** + * 鍙嶉缁撴灉body + */ + @Data + public static class Body { + /** + * 涓夋柟鏌ヨ鐘舵 0: 璇锋眰鎴愬姛锛1: 鏍¢獙澶辫触锛2锛氳姹傚け璐 + */ + private String sfzt; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + /** + * 涓夋柟鍒楄〃 + */ + private List sflb; + } + + /** + * 鍙嶉缁撴灉 + **/ + @Data + public static class Feedback { + /** + * 涓夋柟鍗忚鍙 + **/ + private String sfxyh; + /** + * 閾惰琛屽埆浠g爜 + **/ + private String yhhbdm; + /** + * 閾惰琛屽埆鍚嶇О + **/ + private String yhhbmc; + /** + * 閾惰钀ヤ笟缃戠偣浠g爜 + **/ + private String yywddm; + /** + * 閾惰钀ヤ笟缃戠偣鍚嶇О + **/ + private String yywdmc; + /** + * 娓呯畻琛岃鍙 + **/ + private String qshhh; + /** + * 寮鎴疯琛屽彿 + **/ + private String khhhh; + /** + * 缂存甯愬彿 + **/ + private String jkzh; + /** + * 缂存璐︽埛鍚嶇О + **/ + private String jkmc; + /** + * 绋庢鎵灞炵◣鍔℃満鏋勪唬鐮 + **/ + private String zgswjgdm; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java new file mode 100644 index 000000000..382c546c2 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/BaseResponse.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxpayment.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 鎺ュ彛鍝嶅簲鍊 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class BaseResponse { + /** + * 鎺ュ彛鐘舵 + */ + private SzyhResponseHead head; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java new file mode 100644 index 000000000..de5d979ee --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/SyncWithholdingFeedbackResponse.java @@ -0,0 +1,19 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 瀹岀◣璇佹槑 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class SyncWithholdingFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private WithholdingFeedbackResponse.Feedback body; +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java new file mode 100644 index 000000000..98401e525 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithheldVoucherResponse.java @@ -0,0 +1,61 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 瀹岀◣璇佹槑 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithheldVoucherResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 鍙嶉缁撴灉body + */ + @Data + public static class Body { + /** + * 缁煎悎鎵寰 + **/ + private Feedback zhsd; + /** + * 鍒嗙被鎵寰 + **/ + private Feedback flsd; + /** + * 闈炲眳姘戞墍寰 + **/ + private Feedback fjmsd; + /** + * 闄愬敭鑲℃墍寰 + **/ + private Feedback xsgsd; + } + + /** + * 鍙嶉缁撴灉 + **/ + @Data + public static class Feedback { + /** + * 缂存鍙嶉鐘舵 0鎴愬姛 1澶辫触 + */ + private String jkzt; + /** + * 鎵f澶辫触鍘熷洜 + */ + private String jksbyy; + /** + * 瀹岀◣璇佹槑鍒楄〃 + */ + private List wszmlb; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java new file mode 100644 index 000000000..de1f72221 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingFeedbackResponse.java @@ -0,0 +1,85 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 涓夋柟鍗忚缂存鍙嶉 + * + * @author chengliming + * @date 2022-12-06 17:25:32 + **/ +@Data +public class WithholdingFeedbackResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 鍙嶉缁撴灉body + */ + @Data + public static class Body { + /** + * 缁煎悎鎵寰 + **/ + private Feedback zhsdjk; + /** + * 鍒嗙被鎵寰 + **/ + private Feedback flsdjk; + /** + * 闈炲眳姘戞墍寰 + **/ + private Feedback fjmsdjk; + /** + * 闄愬敭鑲℃墍寰 + **/ + private Feedback xsgsdjk; + } + + /** + * 鍙嶉缁撴灉 + **/ + @Data + public static class Feedback { + /** + * 鐢虫姤鐘舵 + **/ + private String sbzt; + + /** + * 鎵f鐘舵 0锛氭墸娆炬垚鍔燂細1锛氫俊鎭牎楠屽け璐ワ紱2锛氭棤娆犺垂璁板綍锛3锛氭墸娆惧け璐 + **/ + private String jkzt; + + /** + * 鎵f澶辫触鍘熷洜 + **/ + private String jksbyy; + + /** + * 鎵f璇︽儏鍒楄〃 + **/ + private List kkfhlb; + } + + @Data + public static class Detail { + /** + * 鎵f鍙嶉浠g爜 + */ + private String kkfhDm; + /** + * 鎵f鍚嶇О + */ + private String kkfhmc; + /** + * 瀹炵即绋庨 + */ + private String sjse; + } +} diff --git a/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java new file mode 100644 index 000000000..abb5e585d --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/response/WithholdingVoucherFeedbackResponse.java @@ -0,0 +1,131 @@ +package com.engine.salary.entity.taxpayment.response; + +import lombok.Data; + +import java.util.List; + +/** + * 缂存鍑瘉鍙嶉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class WithholdingVoucherFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 鍙嶉缁撴灉body + */ + @Data + public static class Body { + /** + * 缁煎悎鎵寰 + **/ + private Feedback zhsd; + /** + * 鍒嗙被鎵寰 + **/ + private Feedback flsd; + /** + * 闈炲眳姘戞墍寰 + **/ + private Feedback fjmsd; + /** + * 闄愬敭鑲℃墍寰 + **/ + private Feedback xsgsd; + } + + /** + * 鍙嶉缁撴灉 + **/ + @Data + public static class Feedback { + /** + * 鐢虫姤绫诲瀷浠g爜 + */ + private String sblxdm; + /** + * 鐢虫姤绫诲瀷鍚嶇О + */ + private String sblxmc; + /** + * 缂存鍑瘉搴忓彿 + */ + private String jkpzxh; + /** + * 棣栨鎵撳嵃鏃堕棿 + */ + private String dysj; + /** + * 绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 绾崇◣浜哄悕绉 + */ + private String nsrxm; + /** + * 绋庡姟鏈哄叧浠g爜 + */ + private String swjgdm; + /** + * 绋庡姟鏈哄叧鍚嶇О + */ + private String swjgmc; + /** + * 绋庢闄愮即鏃ユ湡 + */ + private String xjrq; + /** + * 閲戦鍚堣锛堝皬鍐欙級 + */ + private String xxjehj; + /** + * 閲戦鍚堣锛堝ぇ鍐欙級 + */ + private String dxjehj; + /** + * 澶囨敞 + */ + private String bz; + /** + * 鎵撳嵃娆℃暟 + */ + private String dycs; + /** + * 缂存鍑瘉鏄庣粏鍒楄〃 + */ + private List jkpzmxlb; + /** + * 鍙嶉鐘舵 0锛氭垚鍔 1:澶辫触 + */ + private String fkzt; + /** + * 鍙嶉鎻忚堪 + */ + private String fkms; + } + + @Data + public static class Detail { + /** + * 鎵f鍙嶉浠g爜 + */ + private String zsxmmc; + /** + * 鎵f鍚嶇О + */ + private String zspmmc; + /** + * 瀹炵即绋庨 + */ + private String yjse; + } +} diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java index 73b3bc6f1..1403f9e4c 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateBaseSaveParam.java @@ -4,12 +4,13 @@ import lombok.Data; /** - * @description: 涓◣绋庣巼琛ㄤ富琛ㄤ繚瀛樺弬鏁 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 3:19 PM - * @version:v1.0 - */ + * 涓◣绋庣巼琛ㄤ富琛ㄤ繚瀛樺弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxRateBaseSaveParam { diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java index 3ac2c6a3b..6bffa9f85 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateDetailSaveParam.java @@ -5,12 +5,13 @@ import lombok.Data; import java.math.BigDecimal; /** - * @description: 涓◣绋庣巼琛ㄦ槑缁嗚〃淇濆瓨鍙傛暟 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 3:22 PM - * @version:v1.0 - */ + * 涓◣绋庣巼琛ㄦ槑缁嗚〃淇濆瓨鍙傛暟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data public class TaxRateDetailSaveParam { diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java index a9107beee..c0a0c1840 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java @@ -7,12 +7,13 @@ import lombok.NoArgsConstructor; import java.util.List; /** - * @description: 绋庣巼琛ㄤ繚瀛 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/20/21 1:59 PM - * @version:v1.0 - */ + * 绋庣巼琛ㄤ繚瀛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @NoArgsConstructor @AllArgsConstructor diff --git a/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java b/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java index 6da2aab85..caf333b7e 100644 --- a/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java +++ b/src/com/engine/salary/entity/taxrate/vo/TaxDeclarationListVO.java @@ -9,12 +9,13 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * @description: 涓◣鐢虫姤璁板綍鍒楄〃 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/15/21 9:31 AM - * @version:v1.0 - */ + * 涓◣鐢虫姤璁板綍鍒楄〃 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Data @Builder @NoArgsConstructor diff --git a/src/com/engine/salary/enums/SalaryItemCategoryEnum.java b/src/com/engine/salary/enums/SalaryItemCategoryEnum.java index 84585d22a..dc6a5417e 100644 --- a/src/com/engine/salary/enums/SalaryItemCategoryEnum.java +++ b/src/com/engine/salary/enums/SalaryItemCategoryEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 钖祫椤圭洰灞炴 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/25/21 2:23 PM - * @version:v1.0 - */ + * 钖祫椤圭洰灞炴 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryItemCategoryEnum implements BaseEnum { PRE_TAX_ADD(1, "绋庡墠鍔犻」", 84492), diff --git a/src/com/engine/salary/enums/SalaryItemTypeEnum.java b/src/com/engine/salary/enums/SalaryItemTypeEnum.java index ba446b447..1de0dc1d2 100644 --- a/src/com/engine/salary/enums/SalaryItemTypeEnum.java +++ b/src/com/engine/salary/enums/SalaryItemTypeEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 钖祫椤圭洰绫诲瀷 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/25/21 2:34 PM - * @version:v1.0 - */ + * 钖祫椤圭洰绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryItemTypeEnum implements BaseEnum { SALARY(1, SalaryItemCategoryEnum.PRE_TAX_ADD, "宸ヨ祫钖噾", 85818), diff --git a/src/com/engine/salary/enums/SalaryOnOffEnum.java b/src/com/engine/salary/enums/SalaryOnOffEnum.java index 99b31eb4d..a6af803ca 100644 --- a/src/com/engine/salary/enums/SalaryOnOffEnum.java +++ b/src/com/engine/salary/enums/SalaryOnOffEnum.java @@ -1,6 +1,7 @@ package com.engine.salary.enums; +import java.util.Objects; /** * 寮鍏虫灇涓 diff --git a/src/com/engine/salary/enums/SalarySobStatusEnum.java b/src/com/engine/salary/enums/SalarySobStatusEnum.java index 31557f24f..a6bb40e94 100644 --- a/src/com/engine/salary/enums/SalarySobStatusEnum.java +++ b/src/com/engine/salary/enums/SalarySobStatusEnum.java @@ -3,12 +3,13 @@ package com.engine.salary.enums; /** - * @description: 钖祫璐﹀璁剧疆姝ラ鐘舵 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 11/9/21 3:09 PM - * @version:v1.0 - */ + * 钖祫璐﹀璁剧疆姝ラ鐘舵 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalarySobStatusEnum implements BaseEnum { START(0, "寮濮", 86123), diff --git a/src/com/engine/salary/enums/SalarySystemTypeEnum.java b/src/com/engine/salary/enums/SalarySystemTypeEnum.java index 8ce14a0dc..54abde8a1 100644 --- a/src/com/engine/salary/enums/SalarySystemTypeEnum.java +++ b/src/com/engine/salary/enums/SalarySystemTypeEnum.java @@ -4,12 +4,13 @@ package com.engine.salary.enums; import java.util.Objects; /** - * @description: 绋庣巼琛ㄨ〃鍗曠被鍨 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/19/21 4:05 PM - * @version:v1.0 - */ + * 绋庣巼琛ㄨ〃鍗曠被鍨 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalarySystemTypeEnum implements BaseEnum { CUSTOM(0, "鑷畾涔夎〃鍗", 83993), diff --git a/src/com/engine/salary/enums/common/SalaryLogGroupTypeEnum.java b/src/com/engine/salary/enums/common/SalaryLogGroupTypeEnum.java new file mode 100644 index 000000000..5f4f684f6 --- /dev/null +++ b/src/com/engine/salary/enums/common/SalaryLogGroupTypeEnum.java @@ -0,0 +1,52 @@ +package com.engine.salary.enums.common; + +import com.engine.salary.enums.BaseEnum; +import lombok.AllArgsConstructor; + +/** + * 钖叕鏃ュ織鐨勯」鐩 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@AllArgsConstructor +public enum SalaryLogGroupTypeEnum implements BaseEnum { + + // 鍏朵粬涓氬姟鏁版嵁鐩稿叧 + CUS_BIZ_SETTING_FORM("1", "鑷畾涔変笟鍔℃暟鎹〃", 254950), + CUS_BIZ_SETTING_FIELD("2", "鑷畾涔変笟鍔℃暟鎹〃瀛楁", 254951), + // 骞寸粓濂栭噾鐩稿叧 + ANNUAL_BONUS_PLAN("3","鏈浼樺勾缁堝璁$◣鏂规", 247010), + ANNUAL_BONUS_ADDUP("4","鍚堝苟璁$◣鍩虹鏁版嵁",250255), + ANNUAL_BONUS_STRATEGY("5","浼樺寲鏂规璇︽儏",250256), + // 钖祫鏍哥畻鐩稿叧 + SALARY_ACCT_RECORD("6","钖祫鏍哥畻", 95783), + SALARY_ACCT_EMPLOYEE("7", "钖祫鏍哥畻浜哄憳", 203828), + SALARY_ACCT_RESULT_VALUE("8","钖祫鏍哥畻缁撴灉",187411), + SALARY_ACCT_CHECK_RESULT("9","钖祫鏍哥畻缁撴灉鏍¢獙寮傚父", 268617), + SALARY_ACCT_COMPARISON_RESULT("10","钖祫鏍哥畻绾夸笅瀵规瘮缁撴灉", 268616), + ; + + private final String value; + + private final String defaultLabel; + + private final Integer labelId; + + @Override + public String getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } +} diff --git a/src/com/engine/salary/enums/common/SalaryLogOperateTypeEnum.java b/src/com/engine/salary/enums/common/SalaryLogOperateTypeEnum.java new file mode 100644 index 000000000..b42cf2a9d --- /dev/null +++ b/src/com/engine/salary/enums/common/SalaryLogOperateTypeEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.common; + +import com.engine.salary.enums.BaseEnum; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 钖叕妯″潡鏃ュ織鐨勬搷浣滅被鍨 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Getter +@AllArgsConstructor +public enum SalaryLogOperateTypeEnum implements BaseEnum { + + VIEW("0","鏌ョ湅",90821), + ADD("1", "鏂板缓", 94607), + UPDATE("2", "鏇存柊", 249295), + DELETE("3", "鍒犻櫎", 87061), + FILE("4", "褰掓。", 92144), + CANCEL_FILE("5", "鍙栨秷褰掓。", 145989), + CLEAR("6", "涓閿竻绌", 158473), + CALCULATE("7", "鏍哥畻", 94146), + SYNC("8", "鍚屾", 93950), + EXCEL_IMPORT("9", "瀵煎叆", 87622), + RE_CALCULATE("10", "閲嶆柊鏍哥畻", 98820), + BATCH_EDIT("11","鎵归噺缂栬緫", 158819), + CHECK("12","鏍¢獙", 95786), + CALC_TAX_ONLINE("13","鍦ㄧ嚎璁$畻涓◣", 268191), + GET_CALC_TAX_FEEDBACK("14","鑾峰彇涓◣璁$畻鍙嶉", 267984), + EXCEL_EXPORT("15","瀵煎嚭",17416) + ; + + private final String value; + + private final String defaultLabel; + + private final Integer labelId; + + @Override + public String getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } +} 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/enums/datacollection/EnumDeductionDataSource.java b/src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java new file mode 100644 index 000000000..cbec3e616 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/EnumDeductionDataSource.java @@ -0,0 +1,70 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + + +/** + * 鍚勭被涓撻」鎵i櫎鏁版嵁鏉ユ簮 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum EnumDeductionDataSource { + /** + * 浜哄伐杈撳叆 + */ + MANUAL(1, "浜哄伐杈撳叆", 153339), + /** + * 鍦ㄧ嚎鑾峰彇 + */ + ONLINE(2, "鍦ㄧ嚎鑾峰彇", 153340), + /** + * 鑷姩璁$畻 + */ + AUTO_CALC(3, "鑷姩璁$畻", 233727), + ; + + private int value; + + private String defaultLabel; + + private int labelId; + + EnumDeductionDataSource(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private static final Map VALUE_NAME_MAP; + + static { + final EnumDeductionDataSource[] values = EnumDeductionDataSource.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (EnumDeductionDataSource value : values) { + VALUE_NAME_MAP.put(value.getValue(), value); + } + } + + public Integer getValue() { + return value; + } + + public Integer getLabelId() { + return labelId; + } + + public static EnumDeductionDataSource parseByValue(Integer index) { + if (index == null) { + return null; + } + return VALUE_NAME_MAP.get(index); + } + + public String getDefaultLabel() { + return defaultLabel; + } +} diff --git a/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java b/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java new file mode 100644 index 000000000..7646c3246 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/PersonalPensionVoucherTypeEnum.java @@ -0,0 +1,52 @@ +package com.engine.salary.enums.datacollection; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Optional; + +/** + * 涓汉鍏昏侀噾鍑瘉绫诲埆 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum PersonalPensionVoucherTypeEnum implements BaseEnum { + YEAR(1, "鏈堝害", 173218), + MONTH(2, "骞村害", 157163); + + private int value; + + private String defaultLabel; + + private int labelId; + + PersonalPensionVoucherTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public Integer getLabelId() { + return labelId; + } + + public static String getDefaultLabelByValue(Integer value) { + Optional optional = Arrays.stream(PersonalPensionVoucherTypeEnum.values()).filter(r -> Integer.valueOf(r.getValue()).equals(value)).findFirst(); + return optional.isPresent() ? optional.get().getDefaultLabel() : ""; + } + + public static PersonalPensionVoucherTypeEnum parseByValue(int value) { + return Arrays.stream(values()).filter(e -> e.getValue() == value).findFirst().orElse(null); + } +} diff --git a/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java new file mode 100644 index 000000000..1edf03f98 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java @@ -0,0 +1,62 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * 鍏嶇◣褰掓。鐘舵 + *

Copyright: Copyright (c) 2024

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxFreeTypeEnum { + + FREE_INCOME(32, "鍏嶇◣鏀跺叆", 105147), + HEALTH_INSURANCE(16, "鍟嗕笟鍋ュ悍淇濋櫓", 91238), + ENDOWMENT_INSURANCE(8, "绋庡欢鍏昏佷繚闄", 91239), + GRANT_DONATION(4, "鍑嗕簣鎵i櫎鐨勬崘璧犻", 91240), + DERATE_DEDUCTION(2, "鍑忓厤绋庨", 102810), + OTHER_DERATE_DEDUCTION(1, "鍏朵粬", 84500), + PERSONAL_PENSION(64, "涓汉鍏昏侀噾", 252256), + ; + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + private static final Map VALUE_NAME_MAP; + + static { + final TaxFreeTypeEnum[] values = TaxFreeTypeEnum.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (TaxFreeTypeEnum value : values) { + VALUE_NAME_MAP.put(value.name(), value); + } + } + + TaxFreeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public Integer getValue() { + return value; + } + + public Integer getLabelId() { + return labelId; + } + + public static TaxFreeTypeEnum parse(String defaultLabel) { + return VALUE_NAME_MAP.get(defaultLabel); + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java new file mode 100644 index 000000000..095d3b155 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -0,0 +1,71 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Objects; + +/** + * 璇佷欢绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum CardTypeEnum implements BaseEnum { + + RESIDENT_IDENTITY_CARDS(0, "灞呮皯韬唤璇", 105564), + FOREIGN_PASSPORT(1, "澶栧浗鎶ょ収", 105564), + HM_PASSPORT(2, "娓境灞呮皯鏉ュ線鍐呭湴閫氳璇", 105564), + T_PASSPORT(3, "鍙版咕灞呮皯鏉ュ線澶ч檰閫氳璇", 105564); + + CardTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static CardTypeEnum getByValue(Integer value) { + for (CardTypeEnum e : CardTypeEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return RESIDENT_IDENTITY_CARDS; + } + + public static CardTypeEnum getByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + CardTypeEnum[] enumAry = CardTypeEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i]; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java new file mode 100644 index 000000000..e0d759613 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 浜哄憳鎶ラ佺姸鎬 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum DeclareStatusEnum implements BaseEnum { + + NOT_DECLARE(1, "寰呮姤閫", 158772), + DECLARING(2, "鎶ラ佷腑", 158773), + DECLARE_FAIL(3, "鎶ラ佸け璐", 158770), + DECLARE_SUCCESS(4, "鎶ラ佹垚鍔", 158774); + + DeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static DeclareStatusEnum getByValue(Integer value) { + for (DeclareStatusEnum e : DeclareStatusEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return NOT_DECLARE; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java new file mode 100644 index 000000000..88e40e0de --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; + +/** + * 浜哄憳鐘舵 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum EmploymentStatusEnum implements BaseEnum { + + NORMAL(0, "姝e父", 160477), + ABNORMAL(1, "闈炴甯", 160478); + + EmploymentStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentStatusEnum[] enumAry = EmploymentStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java new file mode 100644 index 000000000..08941637d --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -0,0 +1,62 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; + +/** + * 浠昏亴鍙楅泧浠庝笟绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum EmploymentTypeEnum implements BaseEnum { + + EMPLOYEE(0, "闆囧憳", 160479), + INSURANCE_SALESMAN(1, "淇濋櫓钀ラ攢鍛", 160480), + SECURITIES_BROKER(2, "璇佸埜缁忕邯浜", 160481), + INTERNSHIP_STUDENTS(3, "瀹炰範瀛︾敓锛堝叏鏃ュ埗瀛﹀巻鏁欒偛锛", 181935), + OTHER(4, "鍏朵粬", 102799); + + EmploymentTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentTypeEnum[] enumAry = EmploymentTypeEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java new file mode 100644 index 000000000..f6590e131 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -0,0 +1,69 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Objects; + +/** + * 鎬у埆 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum GenderEnum implements BaseEnum { + + MALE(0, "鐢", 102440), + FEMALE(1, "濂", 102442); + + GenderEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + GenderEnum[] enumAry = GenderEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } + + public static GenderEnum getDefaultLabelByValue(Integer value) { + for (GenderEnum e : GenderEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return MALE; + } +} diff --git a/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java b/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java new file mode 100644 index 000000000..26dc055d8 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/TaxReasonEnum.java @@ -0,0 +1,58 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 娑夌◣浜嬬敱 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxReasonEnum implements BaseEnum { + + Employment("浠昏亴鍙楅泧", "浠昏亴鍙楅泧", 105564), + PROVIDE_TEMPORARY_LABOR_SERVICES("鎻愪緵涓存椂鍔冲姟", "鎻愪緵涓存椂鍔冲姟", 105564), + TRANSFER_OF_PROPERTY("杞璐骇", "杞璐骇", 105564), + ENGAGE_IN_INVESTMENT_AND_BUSINESS_ACTIVITIES("浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔", "浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔", 105564), + OTHER("鍏朵粬", "鍏朵粬", 105564); + + TaxReasonEnum(String value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private String value; + + private String defaultLabel; + + private int labelId; + + @Override + public String getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static TaxReasonEnum getDefaultLabelByValue(Integer value) { + for (TaxReasonEnum e : TaxReasonEnum.values()) { + if (Objects.equals(e.getValue(), value)) { + return e; + } + } + return Employment; + } +} diff --git a/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java b/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java index c110eba77..8c6155dcd 100644 --- a/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java +++ b/src/com/engine/salary/enums/salaryaccounting/EmployeeTypeEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.salaryaccounting; import com.engine.salary.enums.BaseEnum; +import java.util.Objects; + /** * 浜哄憳绫诲瀷 */ @@ -37,4 +39,13 @@ public enum EmployeeTypeEnum implements BaseEnum { public String getDefaultLabel() { return defaultLabel; } + + public static EmployeeTypeEnum parseByValue(Integer value) { + for (EmployeeTypeEnum typeEnum : EmployeeTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java new file mode 100644 index 000000000..f54e7bc86 --- /dev/null +++ b/src/com/engine/salary/enums/salarysob/DeclareReportTypeEnum.java @@ -0,0 +1,106 @@ +package com.engine.salary.enums.salarysob; + + +import com.engine.salary.annotation.TaxField; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.enums.BaseEnum; +import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 鐢虫姤绫诲瀷 1锛氱患鍚堟墍寰; 2: 鍒嗙被鎵寰楋紱3锛氶潪灞呮皯鎵寰;4:闄愬敭鑲℃墍寰 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum DeclareReportTypeEnum implements BaseEnum { + COMPREHENSIVE_INCOME(1, "缁煎悎鎵寰", 100133) { + @Override + public List getTaxRules() { + return buildRules(GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result.class); + } + }, + CLASSIFIED_INCOME(2, "鍒嗙被鎵寰", 86185) { + @Override + public List getTaxRules() { + return buildRules(null); + } + }, + NONRESIDENT_INCOME(3, "闈炲眳姘戞墍寰", 107369) { + @Override + public List getTaxRules() { + return buildRules(GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result.class); + } + }, + RESTRICTED_SHARES_INCOME(4, "闄愬敭鑲℃墍寰", 90633) { + @Override + public List getTaxRules() { + return buildRules(null); + } + }; + + private int value; + + private String defaultLabel; + + private int labelId; + + DeclareReportTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + + @Override + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + public abstract List getTaxRules(); + + public static List buildRules(Class clazz) { + if (clazz == null) { + return new ArrayList<>(); + } + List rules = new ArrayList<>(); + Field[] fields = clazz.getDeclaredFields(); + for (Field f : fields) { + boolean isanno = f.isAnnotationPresent(TaxField.class); + if (isanno) { + TaxField annotation = f.getAnnotation(TaxField.class); + String name = annotation.name(); + String taxIndex = annotation.taxIndex(); + SalarySobTaxRuleDTO.TaxRuleDTO taxRuleDTO = SalarySobTaxRuleDTO.TaxRuleDTO.builder().name(name).taxIndex(taxIndex).build(); + rules.add(taxRuleDTO); + } + } + return rules; + } + + + public static DeclareReportTypeEnum parseByValue(Integer value) { + for (DeclareReportTypeEnum targetTypeEnum : DeclareReportTypeEnum.values()) { + if (Objects.equals(targetTypeEnum.getValue(), value)) { + return targetTypeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 6fc084f52..0fec5bc83 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,8 +1,30 @@ package com.engine.salary.enums.salarysob; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; import com.engine.salary.enums.BaseEnum; +import com.engine.salary.exception.OnlineCalculateTaxException; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; +import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.excel.ExcelUtil; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import weaver.general.Util; -import java.util.Objects; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.util.*; +import java.util.stream.Collectors; /** * 搴旂◣椤圭洰 @@ -12,35 +34,800 @@ import java.util.Objects; * @author qiantao * @version 1.0 **/ +@Slf4j public enum IncomeCategoryEnum implements BaseEnum { - WAGES_AND_SALARIES(1, "姝e父宸ヨ祫钖噾鎵寰", 98656), + // todo 澶氳瑷 + WAGES_AND_SALARIES(1, "0101", "姝e父宸ヨ祫钖噾", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } - REMUNERATION_FOR_LABOR(4, "鍔冲姟鎶ラ叕鎵寰", 105218), + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sssbyylb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSssbyylb(); + if (CollectionUtil.isNotEmpty(sssbyylb)) { + String err = sssbyylb.stream().map(yy -> yy.getXm() + "" + yy.getCwxx()).collect(Collectors.joining(";")); + throw new OnlineCalculateTaxException(err); + } + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + REMUNERATION_FOR_LABOR(4, "0400", "涓鑸姵鍔℃姤閰墍寰", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + ONETIME_ANNUAL_BONUS(2, "0103", "鍏ㄥ勾涓娆℃у閲戞敹鍏", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + COMPENSATION_FOR_RETIRE(107, "0107", "鍐呴涓娆℃цˉ鍋块噾", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + COMPENSATION_FOR_DISMISS(108, "0108", "瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "涓汉鑲℃潈婵鍔辨敹鍏", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + ANNUITY_RECEIPT(110, "0110", "骞撮噾棰嗗彇", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "淇濋櫓钀ラ攢鍛樹剑閲戞敹鍏", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + INCOME_FOR_SECURITIES_BROKER(403, "0403", "璇佸埜缁忕邯浜轰剑閲戞敹鍏", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "鍏朵粬闈炶繛缁姵鍔℃姤閰墍寰", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + REMUNERATION_FOR_AUTHOR(500, "0500", "绋块叕鎵寰", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + ROYALTIES(600, "0600", "鐗硅鏉冧娇鐢ㄨ垂鎵寰", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "鏃犱綇鎵涓汉姝e父宸ヨ祫钖噾", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "鏃犱綇鎵涓汉鏁版湀濂栭噾", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + }, + NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "涓鑸姵鍔℃姤閰墍寰", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + + }, + NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.fjmsd.ssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + + }, + CLASSIFIED_INCOME_LISTED_COMPANY_DIVIDENDS_BONUSES(810, "0810", "涓婂競鍏徃鑲℃伅绾㈠埄鎵寰(娌競銆佹繁甯傘佸垱涓氭澘)", DeclareReportTypeEnum.CLASSIFIED_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List flsd = declareTaxResultFeedbackResponse.getBody().getFlsd().getSsgsgxhllb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.flsd.flsdssjgdx.flsdscbw.class, flsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx ssgsgxhllb = declareTaxResultFeedbackResponse.getBody().getFlsd().getSsgsgxhllb(); + checkSSSBYYLBResponse(ssgsgxhllb.getSssbyylb()); + + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = ssgsgxhllb.getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + + }, + CLASSIFIED_INCOME_OTHER_INTEREST_DIVIDENDS_BONUSES(800, "0800", "鍏朵粬鍒╂伅鑲℃伅绾㈠埄鎵寰", DeclareReportTypeEnum.CLASSIFIED_INCOME, 181945) { + @Override + public void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List flsd = declareTaxResultFeedbackResponse.getBody().getFlsd().getLxgxhllb().getSscglb(); + List> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.flsd.flsdssjgdx.flsdscbw.class, flsd); + result.put(this.getDefaultLabel(), sheetData); + } + + @Override + public Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) { + checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse); + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx ssgsgxhllb = declareTaxResultFeedbackResponse.getBody().getFlsd().getLxgxhllb(); + checkSSSBYYLBResponse(ssgsgxhllb.getSssbyylb()); + + Gson gs = new Gson(); + List taxRules = taxRuleDTO.getTaxRules(); + + List sscglb = ssgsgxhllb.getSscglb(); + Map idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result::getZzhm); + Map resultMap = new HashMap<>(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + GetASynIndividualIncomeTaxFeedbackResponse.Body.flsd.flsdssjgdx.result result = idNoResultMap.get(employeeDeclare.getCardNum()); + if (result == null) { + continue; + } + taxRules.forEach(rule -> { + String getter = "get" + rule.getTaxIndex().substring(0, 1).toUpperCase() + rule.getTaxIndex().substring(1); + try { + Method method = result.getClass().getMethod(getter); + Object invoke = method.invoke(result); + rule.setValue(Util.null2String(invoke)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + log.error("getTaxErr no such method {}", getter, ex); + } + }); + resultMap.put(employeeDeclare.getEmployeeId(), gs.fromJson(gs.toJson(taxRuleDTO), (Type) SalarySobTaxRuleDTO.class)); + } + return resultMap; + } + + }; - // 鏆傛椂娉ㄩ噴鎺夛紝鍚庣画浼氬紑鏀 - ONETIME_ANNUAL_BONUS(2,"鍏ㄥ勾涓娆℃у閲戞敹鍏", 0) -// -// OTHER(11, "鍏朵粬鎵寰", 0), - ; private int value; + private String code; + + private DeclareReportTypeEnum reportType; + private String defaultLabel; private int labelId; - IncomeCategoryEnum(int value, String defaultLabel, int labelId) { + IncomeCategoryEnum(int value, String code, String defaultLabel, DeclareReportTypeEnum reportType, int labelId) { this.value = value; + this.code = code; this.defaultLabel = defaultLabel; + this.reportType = reportType; this.labelId = labelId; } + public abstract void parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + + public abstract Map parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO); + + private static void checkGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse) { + + if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) { + throw new OnlineCalculateTaxException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.HANDLING_CODE) || Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.TASK_HANDLING_CODE)) { + throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg()); + } + if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new OnlineCalculateTaxException(feedbackResponse.getHead().getMsg()); + } + List rysbsblb = feedbackResponse.getBody().getRysbsblb(); + if (CollectionUtil.isNotEmpty(rysbsblb)) { + String err = rysbsblb.stream().map(sb -> Util.null2String(sb.getXm()) + Util.null2String(sb.getSbyy())).collect(Collectors.joining(";")); + throw new OnlineCalculateTaxException(err); + } + } + + private static void checkSSSBYYLBResponse(List sssbyylb) { + if (CollUtil.isNotEmpty(sssbyylb)) { + String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(",")); + throw new OnlineCalculateTaxException(err); + } + } + + + public Map>> parseGetCompanyIncomesResponse(Map>> result, GetCompanyIncomesResponse response) { + List sfmx = Optional.ofNullable(response.getBody().getSfmx()) + .orElse(new ArrayList<>()) + .stream() + .filter(mx -> this.getDefaultLabel().equals(mx.getSdxmmc())) + .collect(Collectors.toList()); + List> sheetData = ExcelUtil.getExcelSheetData(GetCompanyIncomesResponse.sfmx.class, sfmx); + result.put(this.getDefaultLabel(), sheetData); + return result; + } + + @Override public Integer getValue() { return value; } + public String getCode() { + return code; + } + @Override public Integer getLabelId() { return labelId; @@ -51,6 +838,11 @@ public enum IncomeCategoryEnum implements BaseEnum { return defaultLabel; } + public DeclareReportTypeEnum getReportType() { + return reportType; + } + + public static IncomeCategoryEnum parseByValue(Integer value) { for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { if (Objects.equals(incomeCategoryEnum.getValue(), value)) { @@ -59,4 +851,29 @@ public enum IncomeCategoryEnum implements BaseEnum { } return null; } + + public static IncomeCategoryEnum parseByDefaultLabel(String defaultLabel) { + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + if (incomeCategoryEnum.getDefaultLabel().equals(defaultLabel)) { + return incomeCategoryEnum; + } + } + return null; + } + + public static List parseByValue(Collection values) { + if (CollectionUtils.isEmpty(values)) { + return Collections.emptyList(); + } + List incomeCategoryEnums = Lists.newArrayListWithExpectedSize(values.size()); + for (Integer value : values) { + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + if (Objects.equals(incomeCategoryEnum.getValue(), value)) { + incomeCategoryEnums.add(incomeCategoryEnum); + } + } + } + return incomeCategoryEnums; + } + } diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java new file mode 100644 index 000000000..d0f20caa1 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnCheckTypeEnum.java @@ -0,0 +1,51 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 涓汉鎵g即涔夊姟浜-鎶ョ◣淇℃伅-楠岃瘉绫诲瀷 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnCheckTypeEnum { + + /** + * 鎶ョ◣淇℃伅楠岃瘉 + */ + MAIN_CHECK(1, "鎶ョ◣淇℃伅楠岃瘉"), + /** + * 鐧昏搴忓彿+绋庡彿楠岃瘉 + */ + REGISTRATION_CHECK(2, "鐧昏搴忓彿+绋庡彿楠岃瘉"), + /** + * 閮ㄩ棬缂栫爜楠岃瘉 + */ + DEPARTMENT_CHECK(3, "閮ㄩ棬缂栫爜楠岃瘉"); + + private final int value; + + private final String defaultLabel; + + TaxAgentTaxReturnCheckTypeEnum(int value, String defaultLabel) { + this.value = value; + this.defaultLabel = defaultLabel; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxAgentTaxReturnCheckTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnCheckTypeEnum typeEnum : TaxAgentTaxReturnCheckTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java new file mode 100644 index 000000000..710265f77 --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnPasswordTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxagent; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 涓汉鎵g即涔夊姟浜-鎶ョ◣淇℃伅-瀵嗙爜鏍¢獙绫诲瀷 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnPasswordTypeEnum implements BaseEnum { + + /** + * 涓◣缃戞姤瀵嗙爜 + */ + TAX_NET_PASSWORD(0, "涓◣缃戞姤瀵嗙爜", 144391), + /** + * 瀹炲悕璐﹀彿瀵嗙爜 + */ + REAL_NAME_PASSWORD(2, "瀹炲悕璐﹀彿瀵嗙爜", 144392); + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxAgentTaxReturnPasswordTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static TaxAgentTaxReturnPasswordTypeEnum parseByValue(int value) { + for (TaxAgentTaxReturnPasswordTypeEnum typeEnum : TaxAgentTaxReturnPasswordTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java new file mode 100644 index 000000000..8f576d7ed --- /dev/null +++ b/src/com/engine/salary/enums/taxagent/TaxAgentTaxReturnStatusEnum.java @@ -0,0 +1,57 @@ +package com.engine.salary.enums.taxagent; + +import java.util.Objects; + +/** + * 涓汉鎵g即涔夊姟浜-鎶ョ◣淇℃伅-楠岃瘉鐘舵 + * + * @author chengliming + * @date 2022-08-31 10:51:19 + */ +public enum TaxAgentTaxReturnStatusEnum { + + /** + * 鏈獙璇 + */ + NOT_COMMIT(10, "鏈獙璇", 154753), + /** + * 鎴愬姛 + */ + SUCCESS(20, "鎴愬姛", 154751), + /** + * 澶辫触 + */ + FAIL(30, "澶辫触", 154752); + + private final Integer value; + + private final String desc; + + private final Integer labelId; + + TaxAgentTaxReturnStatusEnum(Integer value, String desc, Integer labelId) { + this.value = value; + this.desc = desc; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return desc; + } + + public static TaxAgentTaxReturnStatusEnum parseByValue(Integer value) { + if (value == null) { + return TaxAgentTaxReturnStatusEnum.NOT_COMMIT; + } + for (TaxAgentTaxReturnStatusEnum statusEnum : TaxAgentTaxReturnStatusEnum.values()) { + if (Objects.equals(statusEnum.getValue(), value)) { + return statusEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java new file mode 100644 index 000000000..dbc1c2e7f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/CancelDeclareStatusEnum.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 浣滃簾鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum CancelDeclareStatusEnum implements BaseEnum { + + CANCEL_SUCCESS(8, "浣滃簾鎴愬姛", 160490), + CANCEL_FAIL(10, "浣滃簾澶辫触", 160491); + + + CancelDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java new file mode 100644 index 000000000..cc9c0434d --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/DeclareFeedBackStatusEnum.java @@ -0,0 +1,47 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 鐢虫姤鍙嶉鐘舵 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum DeclareFeedBackStatusEnum implements BaseEnum { + + DECLARE_SUCCESS_NO_PAY(1, "鐢虫姤鎴愬姛锛屾棤闇缂存", 160492), + DECLARE_SUCCESS_UNPAID(2, "鐢虫姤鎴愬姛锛屾湭缂存", 160493), + DECLARE_FAIL(4, "鐢虫姤澶辫触", 160494), + DECLARE_SUCCESS_PAID(5, "宸茬即娆", 160498), + ; + + DeclareFeedBackStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java new file mode 100644 index 000000000..b4d6d3128 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/EnumDeclareApiBusinessType.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 涓◣鐢虫姤瀵规帴 - 鎺ュ彛涓氬姟绫诲瀷 + * + * @author chengliming + * @date 2022-11-22 10:39:39 + */ +@SuppressWarnings("squid:S00115") +public enum EnumDeclareApiBusinessType implements BaseEnum { + + ADD_UP_DEDUCTION(1, "绱涓撻」闄勫姞鎵i櫎", 85380), + EMPLOYEE_DECLARATION(2, "浜哄憳淇℃伅鎶ラ", 158769), + TAX_DECLARATION(3, "涓◣鐢虫姤", 95835); + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + EnumDeclareApiBusinessType(Integer value, String defaultLabel, Integer labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public Integer getValue() { + return value; + } + +} diff --git a/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java new file mode 100644 index 000000000..999720d3f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java @@ -0,0 +1,48 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 浣滃簾鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum SourceEnum implements BaseEnum { + + ACCT(0, "钖祫鏍哥畻", 160490), + AUTO(1, "鑷姩琛ュ厖", 160490), + ADD(2, "鐣岄潰鏂板", 160491), + EDIT(3, "鐣岄潰鏂板", 160491), + IMP(4, "鐣岄潰瀵煎叆", 160491); + + + SourceEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java new file mode 100644 index 000000000..9015c3ce8 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxAgentRangeEnum.java @@ -0,0 +1,45 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 涓◣鎵g即涔夊姟浜鸿寖鍥 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxAgentRangeEnum implements BaseEnum { + + ALL_TAX_AGENT(1, "鎵鏈変釜绋庢墸缂翠箟鍔′汉", 107731), + ADMIN_TAX_AGENT(2, "浣滀负绠$悊鍛樼殑涓◣鎵g即涔夊姟浜", 177858), + SELECT_TAX_AGENT(3, "閫夋嫨涓◣鎵g即涔夊姟浜", 177859); + + TaxAgentRangeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java new file mode 100644 index 000000000..ba892090a --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareApiProfileEnum.java @@ -0,0 +1,42 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 涓◣瀵规帴鎺ュ彛鐜 + * + * @author chengliming + * @date 2023-01-04 14:18:36 + */ +public enum TaxDeclareApiProfileEnum implements BaseEnum { + + TEST(0, "娴嬭瘯鍦板潃", 0), + PROD(1, "姝e紡鍦板潃", 0); + + TaxDeclareApiProfileEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java new file mode 100644 index 000000000..1335ff349 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -0,0 +1,51 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 鐢虫姤鐘舵 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxDeclareStatusEnum implements BaseEnum { + + DECLARE_FAIL_UNFILLED(0, "鏈~鍐", 160495), + NOT_DECLARE(1, "鏈敵鎶", 160495), + DECLARING(2, "鐢虫姤涓", 160496), + DECLARE_FAIL(3, "鐢虫姤澶辫触", 160494), + DECLARE_CANCELLING(4, "浣滃簾涓", 160497), + DECLARE_SUCCESS_NO_PAY(5, "鐢虫姤鎴愬姛锛屾棤闇缂存", 160492), + DECLARE_SUCCESS_UNPAID(6, "鐢虫姤鎴愬姛锛屾湭缂存", 160493), + DECLARE_SUCCESS_PAID(7, "宸茬即娆", 160498), + DECLARE_SUCCESS_PAYING(8, "缂存涓", 160499); + + TaxDeclareStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java new file mode 100644 index 000000000..a0ee77c69 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareTypeEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 鐢虫姤绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxDeclareTypeEnum implements BaseEnum { + + NORMAL_DECLARE(0, "姝e父鐢虫姤", 177857), + UPDATE_DECLARE(1, "鏇存鐢虫姤", 177637); + + TaxDeclareTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java new file mode 100644 index 000000000..58662abc7 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentServiceTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxdeclaration; + +import java.util.Objects; + +/** + * 涓◣杈呭姪缂存-璇锋眰绫诲瀷 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentServiceTypeEnum { + + /** + * 鑾峰彇浼佷笟鐨勪笁鏂逛俊鎭 + */ + QUERY_AGREEMENT(1, "浼佷笟涓夋柟淇℃伅", 174411), + /** + * 涓夋柟鍗忚缂存鍙嶉 + */ + WITHHOLDING_PAY(2, "涓夋柟缂存", 174411), + /** + * 缂存鍑瘉鍙嶉 + */ + WITHHOLDING_VOUCHER(3, "閾惰绔即娆惧嚟璇", 192313), + /** + * 瀹岀◣璇佹槑 + */ + WITHHELD_VOUCHER(4, "瀹岀◣璇佹槑", 184013), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentServiceTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentServiceTypeEnum parseByValue(int value) { + for (TaxPaymentServiceTypeEnum typeEnum : TaxPaymentServiceTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java new file mode 100644 index 000000000..32872d0a6 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentStatusEnum.java @@ -0,0 +1,53 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 涓◣杈呭姪缂存鐘舵 + * + * @author chengliming + * @date 2022-12-08 19:08:17 + */ +public enum TaxPaymentStatusEnum implements BaseEnum { + SUCCESS(0, "鎵f鎴愬姛", 0), + VERIFY_INFO_FAIL(1, "淇℃伅鏍¢獙澶辫触", 0), + DONT_NEED(2, "鏃犳瑺璐硅褰", 0), + FAIL(3, "鎵f澶辫触", 0), + ; + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + TaxPaymentStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentStatusEnum parseByValue(int value) { + for (TaxPaymentStatusEnum typeEnum : TaxPaymentStatusEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java new file mode 100644 index 000000000..2ffa4958f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxPaymentTypeEnum.java @@ -0,0 +1,59 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Objects; + +/** + * 涓◣杈呭姪缂存-璇锋眰绫诲瀷 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxPaymentTypeEnum implements BaseEnum { + /** + * 涓夋柟鍗忚缂存鍙嶉 + */ + WITHHOLDING_PAY(1, "涓夋柟缂存", 174411), + /** + * 缂存鍑瘉鍙嶉 + */ + WITHHOLDING_VOUCHER(2, "缂存鍑瘉鎵撳嵃", 192313), + ; + + private final int value; + + private final String defaultLabel; + + private int labelId; + + TaxPaymentTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return this.labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public static TaxPaymentTypeEnum parseByValue(int value) { + for (TaxPaymentTypeEnum typeEnum : TaxPaymentTypeEnum.values()) { + if (Objects.equals(typeEnum.getValue(), value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/src/com/engine/salary/exception/OnlineCalculateTaxException.java b/src/com/engine/salary/exception/OnlineCalculateTaxException.java new file mode 100644 index 000000000..3719f0ce5 --- /dev/null +++ b/src/com/engine/salary/exception/OnlineCalculateTaxException.java @@ -0,0 +1,15 @@ +package com.engine.salary.exception; + +public class OnlineCalculateTaxException extends RuntimeException { + public OnlineCalculateTaxException(String message) { + super(message); + } + + public OnlineCalculateTaxException(Throwable cause) { + super(cause); + } + + public OnlineCalculateTaxException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java index 6ba9cb7bd..821cbfbf4 100644 --- a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java +++ b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java @@ -6,47 +6,46 @@ import com.engine.salary.util.SalaryI18nUtil; import org.apache.commons.compress.utils.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; import java.util.LinkedList; import java.util.List; - public class ExcelFuncs { protected final Logger logger = LoggerFactory.getLogger(getClass()); - final static private String ALLFORM="all"; - final static private String CURRENTDATA="current_data"; - static String normalStr="{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; - static public JSONObject normalJson= JSON.parseObject(normalStr); - static private String[] nullParamDatas=new String[]{}; - static private String[] paramDatas=new String[]{}; - static private String[] allParamDatas=new String[]{"{}","[]"}; - static private String[] moduleList=new String[]{"biaoge","workflow"}; + final static private String ALLFORM = "all"; + final static private String CURRENTDATA = "current_data"; + static String normalStr = "{\"key\":\"\",\"fieldId\":\"\",\"componentKey\":\"\",\"term\":\"\",\"formId\":\"\",\"content\":\"\",\"fieldType\":\"\"}"; + static public JSONObject normalJson = JSON.parseObject(normalStr); + static private String[] nullParamDatas = new String[]{}; + static private String[] paramDatas = new String[]{}; + static private String[] allParamDatas = new String[]{"{}", "[]"}; + static private String[] moduleList = new String[]{"biaoge", "workflow"}; private FuncDescUtil funcDescUtil; - public List getCompList(){ + + public List getCompList() { //姣旇緝鎿嶄綔绗 - List compList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc(">",SalaryI18nUtil.getI18nLabel(12132,"澶т簬"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + List compList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc(">", SalaryI18nUtil.getI18nLabel(12132, "澶т簬"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); - excelFunc=new ExcelFunc(">=",SalaryI18nUtil.getI18nLabel(27694,"澶т簬绛変簬"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + excelFunc = new ExcelFunc(">=", SalaryI18nUtil.getI18nLabel(27694, "澶т簬绛変簬"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); - excelFunc=new ExcelFunc("<",SalaryI18nUtil.getI18nLabel(20009,"灏忎簬"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + excelFunc = new ExcelFunc("<", SalaryI18nUtil.getI18nLabel(20009, "灏忎簬"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); - excelFunc=new ExcelFunc("<=",SalaryI18nUtil.getI18nLabel(15251,"灏忎簬绛変簬"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + excelFunc = new ExcelFunc("<=", SalaryI18nUtil.getI18nLabel(15251, "灏忎簬绛変簬"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("=",SalaryI18nUtil.getI18nLabel(15112,"绛変簬"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("=", SalaryI18nUtil.getI18nLabel(15112, "绛変簬"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897,"涓嶇瓑浜"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897, "涓嶇瓑浜"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); compList.add(excelFunc); return compList; @@ -54,231 +53,233 @@ public class ExcelFuncs { /** * 鏃ユ湡鍑芥暟鐨勫垪琛 + * * @return */ - public List getDateList(){ + public List getDateList() { //鏃ユ湡鍑芥暟 - List dateList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("TODAY",SalaryI18nUtil.getI18nLabel(94924,"褰撳墠鏃ユ湡"), funcDescUtil.get("TODAY"),"TODAY()",paramArray,nullParamDatas,"String",CURRENTDATA); + List dateList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("TODAY", SalaryI18nUtil.getI18nLabel(94924, "褰撳墠鏃ユ湡"), funcDescUtil.get("TODAY"), "TODAY()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOW",SalaryI18nUtil.getI18nLabel(94925,"褰撳墠鏃ユ湡鏃堕棿"), funcDescUtil.get("NOW"),"NOW()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOW", SalaryI18nUtil.getI18nLabel(94925, "褰撳墠鏃ユ湡鏃堕棿"), funcDescUtil.get("NOW"), "NOW()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEADD",SalaryI18nUtil.getI18nLabel(94926,"瀵规棩鏈熷姞鍑忓勾銆佹湀銆佹棩"), funcDescUtil.get("DATEADD"),"DATEADD(鏃ユ湡, 鏁板, ['鍗曚綅'])",nullParamDatas,paramArray,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEADD", SalaryI18nUtil.getI18nLabel(94926, "瀵规棩鏈熷姞鍑忓勾銆佹湀銆佹棩"), funcDescUtil.get("DATEADD"), "DATEADD(鏃ユ湡, 鏁板, ['鍗曚綅'])", nullParamDatas, paramArray, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEDIFF",SalaryI18nUtil.getI18nLabel(94927,"杩斿洖涓や釜鏃ユ湡鐨勫樊鍊"), funcDescUtil.get("DATEDIFF"),"DATEDIFF(鏃ユ湡1, 鏃ユ湡2, ['鍗曚綅'])",nullParamDatas,paramArray,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEDIFF", SalaryI18nUtil.getI18nLabel(94927, "杩斿洖涓や釜鏃ユ湡鐨勫樊鍊"), funcDescUtil.get("DATEDIFF"), "DATEDIFF(鏃ユ湡1, 鏃ユ湡2, ['鍗曚綅'])", nullParamDatas, paramArray, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DATEFORMAT",SalaryI18nUtil.getI18nLabel(94928,"杩斿洖鎸囧畾鏍煎紡鐨勬棩鏈"), funcDescUtil.get("DATEFORMAT"),"DATEFORMAT(鏃ユ湡, '鍙夋牸寮')",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEFORMAT", SalaryI18nUtil.getI18nLabel(94928, "杩斿洖鎸囧畾鏍煎紡鐨勬棩鏈"), funcDescUtil.get("DATEFORMAT"), "DATEFORMAT(鏃ユ湡, '鍙夋牸寮')", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("YEAR",SalaryI18nUtil.getI18nLabel(94929,"杩斿洖鏃ユ湡涓殑骞"), funcDescUtil.get("YEAR"),"YEAR(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("YEAR", SalaryI18nUtil.getI18nLabel(94929, "杩斿洖鏃ユ湡涓殑骞"), funcDescUtil.get("YEAR"), "YEAR(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{"String"}; - excelFunc=new ExcelFunc("MONTH",SalaryI18nUtil.getI18nLabel(94930,"杩斿洖鏃ユ湡涓殑鏈"), funcDescUtil.get("MONTH"),"MONTH(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{"String"}; + excelFunc = new ExcelFunc("MONTH", SalaryI18nUtil.getI18nLabel(94930, "杩斿洖鏃ユ湡涓殑鏈"), funcDescUtil.get("MONTH"), "MONTH(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("DAY",SalaryI18nUtil.getI18nLabel(94931,"杩斿洖鏃ユ湡涓殑鏃"), funcDescUtil.get("DAY"),"DAY(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DAY", SalaryI18nUtil.getI18nLabel(94931, "杩斿洖鏃ユ湡涓殑鏃"), funcDescUtil.get("DAY"), "DAY(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("HOUR",SalaryI18nUtil.getI18nLabel(94932,"杩斿洖鏃ユ湡涓殑灏忔椂"), funcDescUtil.get("HOUR"),"HOUR(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("HOUR", SalaryI18nUtil.getI18nLabel(94932, "杩斿洖鏃ユ湡涓殑灏忔椂"), funcDescUtil.get("HOUR"), "HOUR(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINUTE",SalaryI18nUtil.getI18nLabel(94933,"杩斿洖鏃ユ湡涓殑鍒嗛挓"), funcDescUtil.get("MINUTE"),"MINUTE(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINUTE", SalaryI18nUtil.getI18nLabel(94933, "杩斿洖鏃ユ湡涓殑鍒嗛挓"), funcDescUtil.get("MINUTE"), "MINUTE(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SECOND",SalaryI18nUtil.getI18nLabel(94934,"杩斿洖鏃ユ湡涓殑绉"), funcDescUtil.get("SECOND"),"SECOND(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SECOND", SalaryI18nUtil.getI18nLabel(94934, "杩斿洖鏃ユ湡涓殑绉"), funcDescUtil.get("SECOND"), "SECOND(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKNUM",SalaryI18nUtil.getI18nLabel(94936,"杩斿洖鏃ユ湡涓虹鍑犲懆"), funcDescUtil.get("WEEKNUM"),"WEEKNUM(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKNUM", SalaryI18nUtil.getI18nLabel(94936, "杩斿洖鏃ユ湡涓虹鍑犲懆"), funcDescUtil.get("WEEKNUM"), "WEEKNUM(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("WEEKDAY",SalaryI18nUtil.getI18nLabel(94937,"杩斿洖鏃ユ湡涓烘槦鏈熷嚑"), funcDescUtil.get("WEEKDAY"),"WEEKDAY(鏃ユ湡)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("WEEKDAY", SalaryI18nUtil.getI18nLabel(94937, "杩斿洖鏃ユ湡涓烘槦鏈熷嚑"), funcDescUtil.get("WEEKDAY"), "WEEKDAY(鏃ユ湡)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NETWORKDAYSPI",SalaryI18nUtil.getI18nLabel(94938,"杩斿洖鎸囧畾鏃ユ湡涔嬮棿鍖呭惈鐨勫伐浣滄棩澶╂暟锛堜粎闄愮殑杩囧幓鏃堕棿锛"), funcDescUtil.get("NETWORKDAYSPI"),"NETWORKDAYSPI(鏃ユ湡1, 鏃ユ湡2, 鎴愬憳)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NETWORKDAYSPI", SalaryI18nUtil.getI18nLabel(94938, "杩斿洖鎸囧畾鏃ユ湡涔嬮棿鍖呭惈鐨勫伐浣滄棩澶╂暟锛堜粎闄愮殑杩囧幓鏃堕棿锛"), funcDescUtil.get("NETWORKDAYSPI"), "NETWORKDAYSPI(鏃ユ湡1, 鏃ユ湡2, 鎴愬憳)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("EOMONTH",SalaryI18nUtil.getI18nLabel(94939,"杩斿洖鏌愭湀鏈鍚庝竴澶╂棩鏈"), funcDescUtil.get("EOMONTH"),"EOMONTH(鏃ユ湡锛屾寚瀹氭棩鏈熶箣鍓嶆垨涔嬪悗鐨勬湀鏁)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("EOMONTH", SalaryI18nUtil.getI18nLabel(94939, "杩斿洖鏌愭湀鏈鍚庝竴澶╂棩鏈"), funcDescUtil.get("EOMONTH"), "EOMONTH(鏃ユ湡锛屾寚瀹氭棩鏈熶箣鍓嶆垨涔嬪悗鐨勬湀鏁)", paramArray, nullParamDatas, "Number", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRYEAR",SalaryI18nUtil.getI18nLabel(101059,"杩斿洖褰撳墠骞翠唤"), funcDescUtil.get("CURRYEAR"),"CURRYEAR()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRYEAR", SalaryI18nUtil.getI18nLabel(101059, "杩斿洖褰撳墠骞翠唤"), funcDescUtil.get("CURRYEAR"), "CURRYEAR()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMONTH",SalaryI18nUtil.getI18nLabel(101060,"杩斿洖褰撳墠鏈堜唤"), funcDescUtil.get("CURRMONTH"),"CURRMONTH()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMONTH", SalaryI18nUtil.getI18nLabel(101060, "杩斿洖褰撳墠鏈堜唤"), funcDescUtil.get("CURRMONTH"), "CURRMONTH()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRDAY",SalaryI18nUtil.getI18nLabel(101061,"杩斿洖褰撳墠绗嚑鏃ワ紙褰撴湀锛"), funcDescUtil.get("CURRDAY"),"CURRDAY()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRDAY", SalaryI18nUtil.getI18nLabel(101061, "杩斿洖褰撳墠绗嚑鏃ワ紙褰撴湀锛"), funcDescUtil.get("CURRDAY"), "CURRDAY()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRWEEK",SalaryI18nUtil.getI18nLabel(101062,"杩斿洖褰撳墠鏄懆鍑"), funcDescUtil.get("CURRWEEK"),"CURRWEEK()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRWEEK", SalaryI18nUtil.getI18nLabel(101062, "杩斿洖褰撳墠鏄懆鍑"), funcDescUtil.get("CURRWEEK"), "CURRWEEK()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRHOUR",SalaryI18nUtil.getI18nLabel(101063,"杩斿洖褰撳墠灏忔椂"), funcDescUtil.get("CURRHOUR"),"CURRHOUR()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRHOUR", SalaryI18nUtil.getI18nLabel(101063, "杩斿洖褰撳墠灏忔椂"), funcDescUtil.get("CURRHOUR"), "CURRHOUR()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRMINUTE",SalaryI18nUtil.getI18nLabel(101064,"杩斿洖褰撳墠鍒"), funcDescUtil.get("CURRMINUTE"),"CURRMINUTE()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRMINUTE", SalaryI18nUtil.getI18nLabel(101064, "杩斿洖褰撳墠鍒"), funcDescUtil.get("CURRMINUTE"), "CURRMINUTE()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("CURRSECOND",SalaryI18nUtil.getI18nLabel(101065,"杩斿洖褰撳墠绉"), funcDescUtil.get("CURRSECOND"),"CURRSECOND()",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("CURRSECOND", SalaryI18nUtil.getI18nLabel(101065, "杩斿洖褰撳墠绉"), funcDescUtil.get("CURRSECOND"), "CURRSECOND()", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MAXDATE",SalaryI18nUtil.getI18nLabel(100803,"杩斿洖涓缁勬棩鏈熶腑鐨勬渶澶у"), funcDescUtil.get("MAXDATE"),"MAXDATE(鏃ユ湡1锛屾棩鏈2锛屸︹)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MAXDATE", SalaryI18nUtil.getI18nLabel(100803, "杩斿洖涓缁勬棩鏈熶腑鐨勬渶澶у"), funcDescUtil.get("MAXDATE"), "MAXDATE(鏃ユ湡1锛屾棩鏈2锛屸︹)", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MINDATE",SalaryI18nUtil.getI18nLabel(100805,"杩斿洖涓缁勬棩鏈熶腑鐨勬渶灏忓"), funcDescUtil.get("MINDATE"),"MINDATE(鏃ユ湡1锛屾棩鏈2锛屸︹)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MINDATE", SalaryI18nUtil.getI18nLabel(100805, "杩斿洖涓缁勬棩鏈熶腑鐨勬渶灏忓"), funcDescUtil.get("MINDATE"), "MINDATE(鏃ユ湡1锛屾棩鏈2锛屸︹)", paramArray, nullParamDatas, "String", CURRENTDATA); dateList.add(excelFunc); return dateList; } /** * 閫昏緫鍑芥暟鐨勫垪琛 + * * @return */ - public List getLogicList(){ + public List getLogicList() { //閫昏緫鍑芥暟 - List logicList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("IF",SalaryI18nUtil.getI18nLabel(94940,"濡傛灉鏉′欢涓虹湡锛屽垯...鍚﹀垯..."), funcDescUtil.get("IF"),"IF(鏉′欢, 琛ㄨ揪寮1, 琛ㄨ揪寮2)",paramArray,nullParamDatas,"Object",CURRENTDATA); + List logicList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("IF", SalaryI18nUtil.getI18nLabel(94940, "濡傛灉鏉′欢涓虹湡锛屽垯...鍚﹀垯..."), funcDescUtil.get("IF"), "IF(鏉′欢, 琛ㄨ揪寮1, 琛ㄨ揪寮2)", paramArray, nullParamDatas, "Object", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AND",SalaryI18nUtil.getI18nLabel(51100,"涓"), funcDescUtil.get("AND"),"AND(鏉′欢1, 鏉′欢2, [鏉′欢3, 鈥)",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AND", SalaryI18nUtil.getI18nLabel(51100, "涓"), funcDescUtil.get("AND"), "AND(鏉′欢1, 鏉′欢2, [鏉′欢3, 鈥)", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("OR",SalaryI18nUtil.getI18nLabel(35824,"鎴"), funcDescUtil.get("OR"),"OR(鏉′欢1, 鏉′欢2, [鏉′欢3, 鈥)",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("OR", SalaryI18nUtil.getI18nLabel(35824, "鎴"), funcDescUtil.get("OR"), "OR(鏉′欢1, 鏉′欢2, [鏉′欢3, 鈥)", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOT",SalaryI18nUtil.getI18nLabel(94942,"鍙嶈浆鐪熷亣缁撴灉"), funcDescUtil.get("NOT"),"NOT(閫昏緫缁撴灉)",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("NOT", SalaryI18nUtil.getI18nLabel(94942, "鍙嶈浆鐪熷亣缁撴灉"), funcDescUtil.get("NOT"), "NOT(閫昏緫缁撴灉)", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IN",SalaryI18nUtil.getI18nLabel(94943,"鍙橀噺鏄惁鍖呭惈鍦ㄤ竴缁勭粨鏋滀腑"), funcDescUtil.get("IN"),"IN(鍙橀噺, [鍙橀噺1, 鍙橀噺2, 鈥)",paramArray,allParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IN", SalaryI18nUtil.getI18nLabel(94943, "鍙橀噺鏄惁鍖呭惈鍦ㄤ竴缁勭粨鏋滀腑"), funcDescUtil.get("IN"), "IN(鍙橀噺, [鍙橀噺1, 鍙橀噺2, 鈥)", paramArray, allParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LIKE",SalaryI18nUtil.getI18nLabel(94944,"鏂囨湰鏄惁鍖呭惈浠绘剰涓涓叧閿瓧"), funcDescUtil.get("LIKE"),"LIKE(鏂囨湰, [鏂囨湰1, 鏂囨湰2, 鈥)",paramArray,allParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LIKE", SalaryI18nUtil.getI18nLabel(94944, "鏂囨湰鏄惁鍖呭惈浠绘剰涓涓叧閿瓧"), funcDescUtil.get("LIKE"), "LIKE(鏂囨湰, [鏂囨湰1, 鏂囨湰2, 鈥)", paramArray, allParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISEMPTY",SalaryI18nUtil.getI18nLabel(94945,"鏄惁涓虹┖"), funcDescUtil.get("ISEMPTY"),"ISEMPTY(鍙橀噺)",paramArray,paramDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISEMPTY", SalaryI18nUtil.getI18nLabel(94945, "鏄惁涓虹┖"), funcDescUtil.get("ISEMPTY"), "ISEMPTY(鍙橀噺)", paramArray, paramDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUE",SalaryI18nUtil.getI18nLabel(94946,"杩斿洖鐪"), funcDescUtil.get("TRUE"),"TRUE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUE", SalaryI18nUtil.getI18nLabel(94946, "杩斿洖鐪"), funcDescUtil.get("TRUE"), "TRUE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FALSE",SalaryI18nUtil.getI18nLabel(94947,"杩斿洖鍋"), funcDescUtil.get("FALSE"),"FALSE()",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FALSE", SalaryI18nUtil.getI18nLabel(94947, "杩斿洖鍋"), funcDescUtil.get("FALSE"), "FALSE()", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IFS",SalaryI18nUtil.getI18nLabel(94948,"澶氭潯浠"), funcDescUtil.get("IFS"),"IFS({鏉′欢1},{缁撴灉1},{鏉′欢2},{缁撴灉2}...{榛樿缁撴灉})",paramArray,nullParamDatas,"Object",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IFS", SalaryI18nUtil.getI18nLabel(94948, "澶氭潯浠"), funcDescUtil.get("IFS"), "IFS({鏉′欢1},{缁撴灉1},{鏉′欢2},{缁撴灉2}...{榛樿缁撴灉})", paramArray, nullParamDatas, "Object", CURRENTDATA); logicList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("FIND",SalaryI18nUtil.getI18nLabel(31835,"鏌ユ壘"), funcDescUtil.get("FIND"),"FIND([{鏌ユ壘鍊1},{鏌ユ壘鍊2}...{鏌ユ壘鍊糔}],[{鏌ユ壘鐩爣1},{鏌ユ壘鐩爣2}...{鏌ユ壘鐩爣N}])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FIND", SalaryI18nUtil.getI18nLabel(31835, "鏌ユ壘"), funcDescUtil.get("FIND"), "FIND([{鏌ユ壘鍊1},{鏌ユ壘鍊2}...{鏌ユ壘鍊糔}],[{鏌ユ壘鐩爣1},{鏌ユ壘鐩爣2}...{鏌ユ壘鐩爣N}])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); logicList.add(excelFunc); return logicList; } /** * 瀛楃鍑芥暟鐨勫垪琛 + * * @return */ - public List getStringList(){ + public List getStringList() { //瀛楃鍑芥暟 - List stringList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CONCAT",SalaryI18nUtil.getI18nLabel(94949,"閾炬帴澶氫釜鏂囨湰"), funcDescUtil.get("CONCAT"),"CONCAT(鏂囨湰1, 鏂囨湰2, [鏂囨湰3, 鈥)",paramArray,nullParamDatas,"String",CURRENTDATA); + List stringList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CONCAT", SalaryI18nUtil.getI18nLabel(94949, "閾炬帴澶氫釜鏂囨湰"), funcDescUtil.get("CONCAT"), "CONCAT(鏂囨湰1, 鏂囨湰2, [鏂囨湰3, 鈥)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TEXT",SalaryI18nUtil.getI18nLabel(94950,"灏嗗彉閲忚浆涓烘枃鏈"), funcDescUtil.get("TEXT"),"TEXT(鍙橀噺)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TEXT", SalaryI18nUtil.getI18nLabel(94950, "灏嗗彉閲忚浆涓烘枃鏈"), funcDescUtil.get("TEXT"), "TEXT(鍙橀噺)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VALUE",SalaryI18nUtil.getI18nLabel(94951,"灏嗘枃鏈浆涓烘暟瀛"), funcDescUtil.get("VALUE"),"VALUE(鏂囨湰)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VALUE", SalaryI18nUtil.getI18nLabel(94951, "灏嗘枃鏈浆涓烘暟瀛"), funcDescUtil.get("VALUE"), "VALUE(鏂囨湰)", paramArray, nullParamDatas, "Number", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEN",SalaryI18nUtil.getI18nLabel(94952,"杩斿洖鏂囨湰闀垮害"), funcDescUtil.get("LEN"),"LEN(鏂囨湰)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEN", SalaryI18nUtil.getI18nLabel(94952, "杩斿洖鏂囨湰闀垮害"), funcDescUtil.get("LEN"), "LEN(鏂囨湰)", paramArray, nullParamDatas, "Number", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SEARCH",SalaryI18nUtil.getI18nLabel(94953,"鍦ㄦ枃鏈腑鏌ユ壘鍏抽敭瀛"), funcDescUtil.get("SEARCH"),"SEARCH(鍏抽敭瀛, 鏂囨湰, [鎼滅储寮濮嬩綅缃甝)",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SEARCH", SalaryI18nUtil.getI18nLabel(94953, "鍦ㄦ枃鏈腑鏌ユ壘鍏抽敭瀛"), funcDescUtil.get("SEARCH"), "SEARCH(鍏抽敭瀛, 鏂囨湰, [鎼滅储寮濮嬩綅缃甝)", paramArray, nullParamDatas, "Number", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPLACE",SalaryI18nUtil.getI18nLabel(94954,"鏇挎崲鏂囨湰涓殑瀛"), funcDescUtil.get("REPLACE"),"REPLACE(鍘熸枃鏈, 鏇挎崲寮濮嬩綅缃, 鏇挎崲瀛楃鏁, 鏂版枃鏈)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPLACE", SalaryI18nUtil.getI18nLabel(94954, "鏇挎崲鏂囨湰涓殑瀛"), funcDescUtil.get("REPLACE"), "REPLACE(鍘熸枃鏈, 鏇挎崲寮濮嬩綅缃, 鏇挎崲瀛楃鏁, 鏂版枃鏈)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("REPT",SalaryI18nUtil.getI18nLabel(94955,"灏嗘枃鏈噸澶嶆寚瀹氭鏁"), funcDescUtil.get("REPT"),"REPT(鏂囨湰, 閲嶅娆℃暟)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("REPT", SalaryI18nUtil.getI18nLabel(94955, "灏嗘枃鏈噸澶嶆寚瀹氭鏁"), funcDescUtil.get("REPT"), "REPT(鏂囨湰, 閲嶅娆℃暟)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("PAD",SalaryI18nUtil.getI18nLabel(94956,"灏嗘枃鏈~鍏呰嚦鎸囧畾闀垮害"), funcDescUtil.get("PAD"),"PAD(鍘熸枃鏈, 闀垮害, 濉厖鐢ㄧ殑鏂囨湰, ['濉厖浣嶇疆'])",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("PAD", SalaryI18nUtil.getI18nLabel(94956, "灏嗘枃鏈~鍏呰嚦鎸囧畾闀垮害"), funcDescUtil.get("PAD"), "PAD(鍘熸枃鏈, 闀垮害, 濉厖鐢ㄧ殑鏂囨湰, ['濉厖浣嶇疆'])", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRIM",SalaryI18nUtil.getI18nLabel(94957,"娓呴櫎鍓嶅悗绌烘牸"), funcDescUtil.get("TRIM"),"TRIM(鏂囨湰)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRIM", SalaryI18nUtil.getI18nLabel(94957, "娓呴櫎鍓嶅悗绌烘牸"), funcDescUtil.get("TRIM"), "TRIM(鏂囨湰)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("LEFT",SalaryI18nUtil.getI18nLabel(94958,"杩斿洖鏂囨湰宸︿晶寮濮嬬殑鏂囧瓧"), funcDescUtil.get("LEFT"),"LEFT(鏂囨湰, 鎴彇瀛楃鏁)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("LEFT", SalaryI18nUtil.getI18nLabel(94958, "杩斿洖鏂囨湰宸︿晶寮濮嬬殑鏂囧瓧"), funcDescUtil.get("LEFT"), "LEFT(鏂囨湰, 鎴彇瀛楃鏁)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("RIGHT",SalaryI18nUtil.getI18nLabel(94959,"杩斿洖鏂囨湰鍙充晶寮濮嬬殑鏂囧瓧"), funcDescUtil.get("RIGHT"),"RIGHT(鏂囨湰, 鎴彇瀛楃鏁)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("RIGHT", SalaryI18nUtil.getI18nLabel(94959, "杩斿洖鏂囨湰鍙充晶寮濮嬬殑鏂囧瓧"), funcDescUtil.get("RIGHT"), "RIGHT(鏂囨湰, 鎴彇瀛楃鏁)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MID",SalaryI18nUtil.getI18nLabel(94960,"杩斿洖鏂囨湰鎸囧畾浣嶇疆寮濮嬬殑鏂囧瓧"), funcDescUtil.get("MID"),"MID(鏂囨湰, 鎸囧畾浣嶇疆, 鎴彇瀛楃鏁)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MID", SalaryI18nUtil.getI18nLabel(94960, "杩斿洖鏂囨湰鎸囧畾浣嶇疆寮濮嬬殑鏂囧瓧"), funcDescUtil.get("MID"), "MID(鏂囨湰, 鎸囧畾浣嶇疆, 鎴彇瀛楃鏁)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("SCORE",SalaryI18nUtil.getI18nLabel(94961,"鑾峰彇閫夐」鍨嬫帶浠跺垎鏁"), funcDescUtil.get("SCORE"),"SCORE({閫夐」鍨嬫帶浠秨)",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("SCORE", SalaryI18nUtil.getI18nLabel(94961, "鑾峰彇閫夐」鍨嬫帶浠跺垎鏁"), funcDescUtil.get("SCORE"), "SCORE({閫夐」鍨嬫帶浠秨)", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("IDCARD",SalaryI18nUtil.getI18nLabel(94962,"韬唤璇佸嚱鏁"), funcDescUtil.get("IDCARD"),"IDCARD({韬唤璇佸彿鐮亇, {鏌ユ壘绫诲瀷})",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("IDCARD", SalaryI18nUtil.getI18nLabel(94962, "韬唤璇佸嚱鏁"), funcDescUtil.get("IDCARD"), "IDCARD({韬唤璇佸彿鐮亇, {鏌ユ壘绫诲瀷})", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); - - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISSTRING",SalaryI18nUtil.getI18nLabel(0,"鏄惁鏄瓧绗︿覆"), funcDescUtil.get("ISSTRING"),"ISSTRING({浠绘剰鎺т欢})",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISSTRING", SalaryI18nUtil.getI18nLabel(0, "鏄惁鏄瓧绗︿覆"), funcDescUtil.get("ISSTRING"), "ISSTRING({浠绘剰鎺т欢})", paramArray, nullParamDatas, "String", CURRENTDATA); stringList.add(excelFunc); // paramArray=new String[]{}; @@ -301,42 +302,43 @@ public class ExcelFuncs { /** * 鏁板鍑芥暟鐨勫垪琛 + * * @return */ - public List getMathList(){ - List mathList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDUP",SalaryI18nUtil.getI18nLabel(94963,"鍚戜笂鑸嶅叆"), funcDescUtil.get("ROUNDUP"),"ROUNDUP(鏁板, [灏忔暟浣嶇簿纭害])",paramArray,nullParamDatas,"Number",CURRENTDATA); + public List getMathList() { + List mathList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDUP", SalaryI18nUtil.getI18nLabel(94963, "鍚戜笂鑸嶅叆"), funcDescUtil.get("ROUNDUP"), "ROUNDUP(鏁板, [灏忔暟浣嶇簿纭害])", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUND",SalaryI18nUtil.getI18nLabel(17392,"鍥涜垗浜斿叆"), funcDescUtil.get("ROUND"),"ROUND(鏁板, [灏忔暟浣嶇簿纭害])",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUND", SalaryI18nUtil.getI18nLabel(17392, "鍥涜垗浜斿叆"), funcDescUtil.get("ROUND"), "ROUND(鏁板, [灏忔暟浣嶇簿纭害])", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ROUNDDOWN",SalaryI18nUtil.getI18nLabel(94964,"鍚戜笅鑸嶅叆"), funcDescUtil.get("ROUNDDOWN"),"ROUNDDOWN(鏁板, [灏忔暟浣嶇簿纭害])",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ROUNDDOWN", SalaryI18nUtil.getI18nLabel(94964, "鍚戜笅鑸嶅叆"), funcDescUtil.get("ROUNDDOWN"), "ROUNDDOWN(鏁板, [灏忔暟浣嶇簿纭害])", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AGGREGATION",SalaryI18nUtil.getI18nLabel(94965,"鑱氬悎杩愮畻"), funcDescUtil.get("AGGREGATION"),"AGGREGATION({鏁板瓧}...,{鑱氬悎杩愮畻绫诲瀷})",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("AGGREGATION", SalaryI18nUtil.getI18nLabel(94965, "鑱氬悎杩愮畻"), funcDescUtil.get("AGGREGATION"), "AGGREGATION({鏁板瓧}...,{鑱氬悎杩愮畻绫诲瀷})", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MOD",SalaryI18nUtil.getI18nLabel(94966,"姹備綑"), funcDescUtil.get("MOD"),"ROUNDDOWN({鏁板瓧},{鏁板瓧})",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MOD", SalaryI18nUtil.getI18nLabel(94966, "姹備綑"), funcDescUtil.get("MOD"), "ROUNDDOWN({鏁板瓧},{鏁板瓧})", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TRUNC",SalaryI18nUtil.getI18nLabel(94967,"鏁板瓧鏍煎紡鍖"), funcDescUtil.get("TRUNC"),"ROUNDDOWN({鏁板瓧},{绮惧害})",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("TRUNC", SalaryI18nUtil.getI18nLabel(94967, "鏁板瓧鏍煎紡鍖"), funcDescUtil.get("TRUNC"), "ROUNDDOWN({鏁板瓧},{绮惧害})", paramArray, nullParamDatas, "Number", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISINT",SalaryI18nUtil.getI18nLabel(0,"瀛楃鍐呭鏄惁鏄暣鏁"), funcDescUtil.get("ISINT"),"ISINT({瀛楃})",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISINT", SalaryI18nUtil.getI18nLabel(0, "瀛楃鍐呭鏄惁鏄暣鏁"), funcDescUtil.get("ISINT"), "ISINT({瀛楃})", paramArray, nullParamDatas, "String", CURRENTDATA); mathList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("ISNUMBER",SalaryI18nUtil.getI18nLabel(0,"瀛楃鍐呭鏄惁鏄暟瀛"), funcDescUtil.get("ISNUMBER"),"ISNUMBER({瀛楃})",paramArray,nullParamDatas,"String",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISNUMBER", SalaryI18nUtil.getI18nLabel(0, "瀛楃鍐呭鏄惁鏄暟瀛"), funcDescUtil.get("ISNUMBER"), "ISNUMBER({瀛楃})", paramArray, nullParamDatas, "String", CURRENTDATA); mathList.add(excelFunc); return mathList; @@ -345,69 +347,74 @@ public class ExcelFuncs { /** * 鏌ユ壘鍑芥暟鐨勫垪琛 + * * @return */ - public List getFindList(){ - List findList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc("CHOOSE",SalaryI18nUtil.getI18nLabel(94968,"杩斿洖绱㈠紩鑼冨洿鍐呮寚瀹氱殑鍊"), funcDescUtil.get("CHOOSE"),"CHOOSE(鏁版嵁婧愶紝[鏉′欢])",paramArray,nullParamDatas,"Array",CURRENTDATA); + public List getFindList() { + List findList = new LinkedList<>(); + ExcelFunc excelFunc = null; + String[] paramArray = new String[]{}; + excelFunc = new ExcelFunc("CHOOSE", SalaryI18nUtil.getI18nLabel(94968, "杩斿洖绱㈠紩鑼冨洿鍐呮寚瀹氱殑鍊"), funcDescUtil.get("CHOOSE"), "CHOOSE(鏁版嵁婧愶紝[鏉′欢])", paramArray, nullParamDatas, "Array", CURRENTDATA); findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("VLOOKUPS",SalaryI18nUtil.getI18nLabel(94969,"鎸夊垪鏌ユ壘锛岃繑鍥炴墍闇鍊"), funcDescUtil.get("VLOOKUPS"),"VLOOKUPS锛堣〃锛孾鏉′欢]锛孾杩斿洖鍙傛暟]锛",paramArray,nullParamDatas,"Array",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("VLOOKUPS", SalaryI18nUtil.getI18nLabel(94969, "鎸夊垪鏌ユ壘锛岃繑鍥炴墍闇鍊"), funcDescUtil.get("VLOOKUPS"), "VLOOKUPS锛堣〃锛孾鏉′欢]锛孾杩斿洖鍙傛暟]锛", paramArray, nullParamDatas, "Array", CURRENTDATA); findList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("MATCH",SalaryI18nUtil.getI18nLabel(94970,"杩斿洖鎸囧畾鏁板煎湪鎸囧畾鏁扮粍鍖哄煙涓殑浣嶇疆"), funcDescUtil.get("MATCH"),"MATCH锛堝硷紝[鏁扮粍])",paramArray,nullParamDatas,"Number",CURRENTDATA); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("MATCH", SalaryI18nUtil.getI18nLabel(94970, "杩斿洖鎸囧畾鏁板煎湪鎸囧畾鏁扮粍鍖哄煙涓殑浣嶇疆"), funcDescUtil.get("MATCH"), "MATCH锛堝硷紝[鏁扮粍])", paramArray, nullParamDatas, "Number", CURRENTDATA); findList.add(excelFunc); return findList; } /** * 鑱氬悎鍑芥暟 COUNT(琛ㄦ牸, [缁熻鏉′欢]) + * * @return */ - public List getAggList(){ - List aggList=new LinkedList<>(); - ExcelFunc excelFunc=null; + public List getAggList() { + List aggList = new LinkedList<>(); + ExcelFunc excelFunc = null; - String [] paramArray=new String[]{"Form","Number","Boolean"}; - excelFunc=new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654,"璁℃暟"), funcDescUtil.get("COUNT"),"COUNT(琛ㄦ牸)",paramArray,paramDatas,"Number",ALLFORM); + String[] paramArray = new String[]{"Form", "Number", "Boolean"}; + excelFunc = new ExcelFunc("COUNT", SalaryI18nUtil.getI18nLabel(16654, "璁℃暟"), funcDescUtil.get("COUNT"), "COUNT(琛ㄦ牸)", paramArray, paramDatas, "Number", ALLFORM); aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("SUM",SalaryI18nUtil.getI18nLabel(95012,"姹傚拰") , funcDescUtil.get("SUM"),"SUM(鏁板瓧瀛楁)",paramArray,paramDatas,"Number",ALLFORM); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("SUM", SalaryI18nUtil.getI18nLabel(95012, "姹傚拰"), funcDescUtil.get("SUM"), "SUM(鏁板瓧瀛楁)", paramArray, paramDatas, "Number", ALLFORM); aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("AVG",SalaryI18nUtil.getI18nLabel(19550,"骞冲潎鍊"), funcDescUtil.get("AVG"),"AVG(鏁板瓧瀛楁)",paramArray,paramDatas,"Number",ALLFORM); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("AVG", SalaryI18nUtil.getI18nLabel(19550, "骞冲潎鍊"), funcDescUtil.get("AVG"), "AVG(鏁板瓧瀛楁)", paramArray, paramDatas, "Number", ALLFORM); aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MIN",SalaryI18nUtil.getI18nLabel(12318,"鏈灏忓"), funcDescUtil.get("MIN"),"MIN(琛ㄦ牸)",paramArray,paramDatas,"Number",ALLFORM); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MIN", SalaryI18nUtil.getI18nLabel(12318, "鏈灏忓"), funcDescUtil.get("MIN"), "MIN(琛ㄦ牸)", paramArray, paramDatas, "Number", ALLFORM); aggList.add(excelFunc); - paramArray=new String[]{"Number","Number","Boolean"}; - excelFunc=new ExcelFunc("MAX",SalaryI18nUtil.getI18nLabel(66750,"鏈澶у"), funcDescUtil.get("MAX"),"MAX(琛ㄦ牸)",paramArray,paramDatas,"Number",ALLFORM); + paramArray = new String[]{"Number", "Number", "Boolean"}; + excelFunc = new ExcelFunc("MAX", SalaryI18nUtil.getI18nLabel(66750, "鏈澶у"), funcDescUtil.get("MAX"), "MAX(琛ㄦ牸)", paramArray, paramDatas, "Number", ALLFORM); aggList.add(excelFunc); return aggList; } /** * 璐㈠姟绫诲嚱鏁板垪琛 + * * @return */ - public Object getFinanceList(){ + public Object getFinanceList() { ExcelFunc excelFunc = null; List funcs = Lists.newArrayList(); - excelFunc = new ExcelFunc("GETMONEY",SalaryI18nUtil.getI18nLabel(0,"鑾峰彇閿佺粰瀹氭暟瀛楃殑閲戦澶у啓"), funcDescUtil.get("GETMONEY"),"GETMONEY({鏁板瓧})",null,nullParamDatas,"",CURRENTDATA); + excelFunc = new ExcelFunc("GETMONEY", SalaryI18nUtil.getI18nLabel(0, "鑾峰彇閿佺粰瀹氭暟瀛楃殑閲戦澶у啓"), funcDescUtil.get("GETMONEY"), "GETMONEY({鏁板瓧})", null, nullParamDatas, "", CURRENTDATA); funcs.add(excelFunc); return funcs; } + /** * 鏁版嵁搴撳嚱鏁板垪琛 + * * @return */ public Object getDataBaseList() { @@ -456,10 +463,10 @@ public class ExcelFuncs { // excelFunc = new ExcelFunc("GETALLSUPERSUBCOMPANY",SalaryI18nUtil.getI18nLabel(100833,"杩斿洖鎸囧畾鍒嗛儴鎵鏈変笂绾у垎閮"), funcDescUtil.get("GETALLSUPERSUBCOMPANY"),"GETALLSUPERSUBCOMPANY({琛ㄥ崟.鍒嗛儴})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMNAME",SalaryI18nUtil.getI18nLabel(100833,"鑾峰彇浜哄憳鍚嶇О"), funcDescUtil.get("GETHRMNAME"),"GETHRMNAME({浜哄憳})",null,nullParamDatas,"",CURRENTDATA); + excelFunc = new ExcelFunc("GETHRMNAME", SalaryI18nUtil.getI18nLabel(100833, "鑾峰彇浜哄憳鍚嶇О"), funcDescUtil.get("GETHRMNAME"), "GETHRMNAME({浜哄憳})", null, nullParamDatas, "", CURRENTDATA); funcs.add(excelFunc); - excelFunc = new ExcelFunc("GETHRMMOBILE",SalaryI18nUtil.getI18nLabel(100833,"鑾峰彇浜哄憳鎵嬫満鍙风爜"), funcDescUtil.get("GETHRMMOBILE"),"GETHRMMOBILE({浜哄憳})",null,nullParamDatas,"",CURRENTDATA); + excelFunc = new ExcelFunc("GETHRMMOBILE", SalaryI18nUtil.getI18nLabel(100833, "鑾峰彇浜哄憳鎵嬫満鍙风爜"), funcDescUtil.get("GETHRMMOBILE"), "GETHRMMOBILE({浜哄憳})", null, nullParamDatas, "", CURRENTDATA); funcs.add(excelFunc); return funcs; diff --git a/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java b/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java index 5f2ffedd0..d081615e5 100644 --- a/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java +++ b/src/com/engine/salary/formlua/func/date/DateTimeServiceImpl.java @@ -571,7 +571,6 @@ public class DateTimeServiceImpl implements DateTimeService { cale.set(cale.get(Calendar.YEAR), month, 1); String lastday = formatTemp.format(cale.getTime()); - System.out.println(lastday); return new DataType(DataType.STRING, lastday); } diff --git a/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java b/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java new file mode 100644 index 000000000..8cbfc06ba --- /dev/null +++ b/src/com/engine/salary/maintainer/EmployeeDeclare/EmployeeDeclareManager.java @@ -0,0 +1,44 @@ +package com.engine.salary.maintainer.EmployeeDeclare; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareSyncStartDateParam; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; +import com.engine.salary.util.valid.ValidUtil; +import weaver.hrm.User; + +public class EmployeeDeclareManager extends Service { + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + + + /** + * 鍚屾浠昏亴鍙楅泧鏃ユ湡涓哄叆鑱屾棩鏈 + * + * @return + */ + public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { + ValidUtil.doValidator(param); + + return getEmployeeDeclareService(user).syncEmploymentDate(param); + } + +} diff --git a/src/com/engine/salary/maintainer/MaintainerController.java b/src/com/engine/salary/maintainer/MaintainerController.java index c184a6082..9bffd7681 100644 --- a/src/com/engine/salary/maintainer/MaintainerController.java +++ b/src/com/engine/salary/maintainer/MaintainerController.java @@ -1,11 +1,14 @@ package com.engine.salary.maintainer; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareSyncStartDateParam; +import com.engine.salary.maintainer.EmployeeDeclare.EmployeeDeclareManager; import com.engine.salary.maintainer.datacollection.AddUpSituationManager; import com.engine.salary.maintainer.salaryacct.SalaryAcctManager; import com.engine.salary.maintainer.salaryacct.SalaryAcctSupplementParam; import com.engine.salary.maintainer.salaryarchive.SalaryArchiveManager; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import weaver.hrm.HrmUserVarify; @@ -16,6 +19,7 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.Arrays; @@ -45,6 +49,10 @@ public class MaintainerController { return ServiceUtil.getService(SalaryArchiveManager.class, user); } + private EmployeeDeclareManager getEmployeeDeclareManager(User user) { + return ServiceUtil.getService(EmployeeDeclareManager.class, user); + } + //---------------------------钖祫鏍哥畻 start ------------------------------------ /** @@ -108,4 +116,32 @@ public class MaintainerController { return new ResponseResult(user).run(getSalaryArchiveManager(user)::initPayStartDate); } + /** + * 鍚屾鎵鏈夋。妗堣捣濮嬪彂钖棩鏈熷彉涓哄叆鑱屾棩鏈 + * + * @return + */ + @GET + @Path("/salaryArchive/syncPayStartDate") + @Produces(MediaType.APPLICATION_JSON) + public String syncPayStartDate(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryArchiveManager(user)::syncPayStartDate); + } + + /** + * 鍚屾浠昏亴鍙楅泧鏃ユ湡涓哄叆鑱屾棩鏈 + * + * @return + */ + @GET + @Path("/employeedeclare/syncEmploymentDate") + @Produces(MediaType.APPLICATION_JSON) + public String syncEmploymentDate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxAgentId") Long taxAgentId, @QueryParam(value = "taxCycle")String taxCycle) { + User user = HrmUserVarify.getUser(request, response); + EmployeeDeclareSyncStartDateParam param = EmployeeDeclareSyncStartDateParam.builder().taxAgentId(taxAgentId).taxCycle(SalaryDateUtil.stringToDate(taxCycle)).build(); + return new ResponseResult(user).run(getEmployeeDeclareManager(user)::syncEmploymentDate,param); + } + + } diff --git a/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java b/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java index 8a9ca719a..f0dc04731 100644 --- a/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java +++ b/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java @@ -7,14 +7,11 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationMapper; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; -import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; import weaver.general.BaseBean; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.YearMonth; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -50,11 +47,9 @@ public class AddUpSituationManager extends Service { bb.writeLog("寮濮嬪垹闄ょ敓鎴:" + po.getTaxAgentId() + "-" + po.getSalaryMonth()); // 鍒犻櫎璁板綍 int delete = getTaxDeclarationMapper().deleteByIdZj(po.getId()); - LocalDate localDate = SalaryDateUtil.dateToLocalDate(po.getSalaryMonth()); // 璋冪敤鐢熸垚鐢虫姤鍗曟帴鍙 - YearMonth yearMonth = YearMonth.of(localDate.getYear(), localDate.getMonth()); try { - getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(yearMonth).salaryDate(po.getSalaryMonth()).taxCycle(po.getTaxCycle()).taxAgentId(po.getTaxAgentId()).build()); + getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(po.getSalaryMonth()).salaryDate(po.getSalaryMonth()).taxCycle(po.getTaxCycle()).taxAgentId(po.getTaxAgentId()).build()); } catch (Exception e) { bb.writeLog("閿欒:" + e); result = false; diff --git a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java index 289b898bd..193f83c8e 100644 --- a/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java +++ b/src/com/engine/salary/maintainer/salaryacct/SalaryAcctManager.java @@ -4,20 +4,23 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; -import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; -import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.progress.ProgressDTO; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItem; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcItemGraph; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTempPO; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper; import com.engine.salary.service.*; @@ -38,6 +41,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.BeanUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import weaver.hrm.User; @@ -47,8 +51,11 @@ import java.util.*; import java.util.concurrent.BlockingDeque; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingDeque; +import java.util.regex.Matcher; import java.util.stream.Collectors; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 钖祫鏍哥畻缁存姢绫 *

Copyright: Copyright (c) 2022

@@ -283,9 +290,10 @@ public class SalaryAcctManager extends Service { formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); // 鏈杩愮畻鐨勫洖绠楄柂璧勯」鐩墍娑夊強鐨勫彉閲 - Set issuedFieldIds = new HashSet<>(); + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); // 9銆佽绠楄柂璧勯」鐩殑杩愮畻浼樺厛绾 - List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); +// List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); // 10銆佹牴鎹甶d鏌ヨ鍏朵粬鍚堝苟璁$◣鐨勮柂璧勬牳绠楄褰 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); // 11銆佹煡璇㈡湰娆℃牳绠椾汉鍛 @@ -383,5 +391,43 @@ public class SalaryAcctManager extends Service { getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); } + @NotNull + private List sortItems(List salarySobItemPOS, List salarySobBackItems, List salaryItemPOS, List expressFormulas) { + List temp = salarySobBackItems.stream() + .map(e -> { + SalarySobItemPO salarySobItem = new SalarySobItemPO(); + BeanUtils.copyProperties(e, salarySobItem); + return salarySobItem; + }).collect(Collectors.toList()); + salarySobItemPOS.addAll(temp); + + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + return SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + } + + /** + * 鑾峰彇鍥炵畻鍙橀噺 + * + * @param salarySobBackItems + * @return + */ + @NotNull + private Set getIssuedFieldIds(List salarySobBackItems) { + Set issuedFieldIds; + Set issuedFormulaIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId); + List expressFormulas1 = getSalaryFormulaService(user).listExpressFormula(issuedFormulaIds); + List issuedFormulaVars = new ArrayList<>(); + expressFormulas1.forEach(f -> issuedFormulaVars.addAll(f.getParameters())); + issuedFieldIds = issuedFormulaVars.stream() + .map(FormulaVar::getFieldId) + .filter(StringUtils::isNotBlank) + .filter(v -> v.startsWith(SalaryFormulaReferenceEnum.ISSUED.getValue() + "_")) + .map(SALARY_PATTERN::matcher) + .filter(Matcher::find) + .map(m -> m.group(2)) + .collect(Collectors.toSet()); + return issuedFieldIds; + } } diff --git a/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java b/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java index cbd52a6ca..751088d46 100644 --- a/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java +++ b/src/com/engine/salary/maintainer/salaryarchive/SalaryArchiveManager.java @@ -61,4 +61,15 @@ public class SalaryArchiveManager extends Service { return null; } + + + /** + * 鍚屾鎵鏈夋。妗堣捣濮嬪彂钖棩鏈熷彉涓哄叆鑱屾棩鏈 + * + * @return + */ + public String syncPayStartDate() { + return getSalaryArchiveService(user).syncPayStartDate(); + } + } diff --git a/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.java b/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.java new file mode 100644 index 000000000..efb1db4d7 --- /dev/null +++ b/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.java @@ -0,0 +1,72 @@ +package com.engine.salary.mapper.api; + +import com.engine.salary.entity.api.ApiTaskRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface ApiTaskRecordMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(ApiTaskRecordPO apiTaskRecord); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + ApiTaskRecordPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param apiTaskRecord 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(ApiTaskRecordPO apiTaskRecord); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param apiTaskRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(ApiTaskRecordPO apiTaskRecord); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param apiTaskRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(ApiTaskRecordPO apiTaskRecord); + + /** + * 鍒犻櫎璁板綍 + * + * @param apiTaskRecord 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(ApiTaskRecordPO apiTaskRecord); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.xml b/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.xml new file mode 100644 index 000000000..55eb613d8 --- /dev/null +++ b/src/com/engine/salary/mapper/api/ApiTaskRecordMapper.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + t + . + api + , t.create_time + , t.delete_type + , t.id + , t.param + , t.response + , t.source + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_api_task_record + + + + api, + + + create_time, + + + delete_type, + + + id, + + + param, + + + response, + + + source, + + + tenant_key, + + + update_time, + + + + + #{api}, + + + #{createTime}, + + + #{deleteType}, + + + #{id}, + + + #{param}, + + + #{response}, + + + #{source}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_api_task_record + + api=#{api}, + create_time=#{createTime}, + delete_type=#{deleteType}, + param=#{param}, + response=#{response}, + source=#{source}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_api_task_record + + + api=#{api}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + param=#{param}, + + + response=#{response}, + + + source=#{source}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_api_task_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_api_task_record + 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/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/datacollection/AddUpSituationMapper.xml b/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml index 2b5c45519..6a516eed7 100644 --- a/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/AddUpSituationMapper.xml @@ -20,6 +20,9 @@ + + + @@ -64,6 +67,9 @@ , t.add_up_tax_savings , t.add_up_infant_care , t.add_up_private_pension + , t.actual_add_up_advance_tax + , t.tax_adjustment + , t.add_up_taxable_income @@ -126,7 +132,10 @@ t1.add_up_tax_exempt_income, t1.add_up_allowed_donation, t1.add_up_tax_savings, - t1.add_up_advance_tax + t1.add_up_advance_tax, + t1.actual_add_up_advance_tax, + t1.tax_adjustment, + t1.add_up_taxable_income @@ -438,7 +447,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) VALUES @@ -468,7 +480,10 @@ #{item.addUpTaxSavings}, #{item.addUpIllnessMedical}, #{item.addUpInfantCare}, - #{item.addUpPrivatePension} + #{item.addUpPrivatePension}, + #{item.actualAddUpAdvanceTax}, + #{item.taxAdjustment}, + #{item.addUpTaxableIncome} ) @@ -499,7 +514,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) @@ -529,7 +547,10 @@ #{item.addUpTaxSavings,jdbcType=VARCHAR}, #{item.addUpIllnessMedical,jdbcType=VARCHAR}, #{item.addUpInfantCare,jdbcType=VARCHAR}, - #{item.addUpPrivatePension,jdbcType=VARCHAR} + #{item.addUpPrivatePension,jdbcType=VARCHAR}, + #{item.actualAddUpAdvanceTax,jdbcType=VARCHAR}, + #{item.taxAdjustment,jdbcType=VARCHAR}, + #{item.addUpTaxableIncome,jdbcType=VARCHAR} from dual @@ -561,7 +582,10 @@ add_up_tax_savings, add_up_illness_medical, add_up_infant_care, - add_up_private_pension + add_up_private_pension, + actual_add_up_advance_tax, + tax_adjustment, + add_up_taxable_income ) VALUES ( @@ -590,7 +614,10 @@ #{item.addUpTaxSavings}, #{item.addUpIllnessMedical}, #{item.addUpInfantCare}, - #{item.addUpPrivatePension} + #{item.addUpPrivatePension}, + #{item.actualAddUpAdvanceTax}, + #{item.taxAdjustment}, + #{item.addUpTaxableIncome} ) @@ -724,6 +751,27 @@ + + + + when id=#{item.id} then #{item.actualAddUpAdvanceTax} + + + + + + + when id=#{item.id} then #{item.taxAdjustment} + + + + + + + when id=#{item.id} then #{item.addUpTaxableIncome} + + + where id in diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java new file mode 100644 index 000000000..0fbb3b143 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java @@ -0,0 +1,76 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.DerateDeductionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DerateDeductionMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(DerateDeductionPO derateDeduction); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + DerateDeductionPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param derateDeduction 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(DerateDeductionPO derateDeduction); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param derateDeduction 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(DerateDeductionPO derateDeduction); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param derateDeduction 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(DerateDeductionPO derateDeduction); + + /** + * 鍒犻櫎璁板綍 + * + * @param derateDeduction 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(DerateDeductionPO derateDeduction); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + + void deleteByMainId(Long mainId); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml new file mode 100644 index 000000000..824c2466e --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.derate_amount + , t.derate_item + , t.derate_property + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_derate_deduction + + + + create_time, + + + creator, + + + delete_type, + + + derate_amount, + + + derate_item, + + + derate_property, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + income_category, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{derateAmount}, + + + #{derateItem}, + + + #{derateProperty}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + derate_amount=#{derateAmount}, + derate_item=#{derateItem}, + derate_property=#{derateProperty}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + derate_amount=#{derateAmount}, + + + derate_item=#{derateItem}, + + + derate_property=#{derateProperty}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.java b/src/com/engine/salary/mapper/datacollection/EmployMapper.java index 120c7a352..73cb03b9d 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.java @@ -181,4 +181,11 @@ public interface EmployMapper { List listByDepartment(@Param("departmentIds") List departmentIds); List listByJob(@Param("jobIds") List jobIds); + + /** + * 鏍规嵁鐢ㄦ埛鍚嶅拰宸ュ彿妯$硦鏌ヨ + * @param keyword + * @return + */ + List listByKeyword(@Param("keyword") String keyword); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index 39adedca3..cfb6a45de 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -666,6 +666,55 @@ + + + + + + + AND + ( + e.lastname like CONCAT('%',#{keyword},'%') + OR + e.workcode like CONCAT('%',#{keyword},'%') + ) + + + + + AND + ( + e.lastname like '%'||#{keyword}||'%' + OR + e.workcode like '%'||#{keyword}||'%' + ) + + + + + AND + ( + e.lastname like '%'+#{keyword}+'%' + OR + e.workcode like '%'+#{keyword}+'%' + ) + + + + + SELECT + + FROM hrsa_endowment_insurance t + WHERE delete_type = 0 + + + + + + + + + + + + INSERT INTO hrsa_endowment_insurance + + + + account_number, + + + check_code, + + + create_time, + + + creator, + + + current_deduction, + + + deduction_month, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + month_premium, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + year_premium, + + + income_category, + + + + + #{accountNumber}, + + + #{checkCode}, + + + #{createTime}, + + + #{creator}, + + + #{currentDeduction}, + + + #{deductionMonth}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{monthPremium}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{yearPremium}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_endowment_insurance + + account_number=#{accountNumber}, + check_code=#{checkCode}, + create_time=#{createTime}, + creator=#{creator}, + current_deduction=#{currentDeduction}, + deduction_month=#{deductionMonth}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + month_premium=#{monthPremium}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year_premium=#{yearPremium}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_endowment_insurance + + + account_number=#{accountNumber}, + + + check_code=#{checkCode}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + current_deduction=#{currentDeduction}, + + + deduction_month=#{deductionMonth}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + month_premium=#{monthPremium}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year_premium=#{yearPremium}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_endowment_insurance + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_endowment_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_endowment_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java new file mode 100644 index 000000000..a977ee060 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.FreeIncomePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface FreeIncomeMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(FreeIncomePO freeIncome); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + FreeIncomePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param freeIncome 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(FreeIncomePO freeIncome); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param freeIncome 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(FreeIncomePO freeIncome); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param freeIncome 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(FreeIncomePO freeIncome); + + /** + * 鍒犻櫎璁板綍 + * + * @param freeIncome 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(FreeIncomePO freeIncome); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByMainId(Long mainId); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml new file mode 100644 index 000000000..6f1f5b3f6 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/FreeIncomeMapper.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.employee_id + , t.employee_type + , t.file_status + , t.free_amount + , t.free_item + , t.free_property + , t.id + , t.main_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_free_income + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + free_amount, + + + free_item, + + + free_property, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + income_category, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{freeAmount}, + + + #{freeItem}, + + + #{freeProperty}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_free_income + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + free_amount=#{freeAmount}, + free_item=#{freeItem}, + free_property=#{freeProperty}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_free_income + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + free_amount=#{freeAmount}, + + + free_item=#{freeItem}, + + + free_property=#{freeProperty}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_free_income + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_free_income + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_free_income + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java new file mode 100644 index 000000000..b5df0a8e1 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.GrantDonationPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface GrantDonationMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(GrantDonationPO grantDonation); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + GrantDonationPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param grantDonation 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(GrantDonationPO grantDonation); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param grantDonation 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(GrantDonationPO grantDonation); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param grantDonation 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(GrantDonationPO grantDonation); + + /** + * 鍒犻櫎璁板綍 + * + * @param grantDonation 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(GrantDonationPO grantDonation); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByMainId(Long mainId); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml new file mode 100644 index 000000000..96a5dab18 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/GrantDonationMapper.xml @@ -0,0 +1,397 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + actual_deduction + , t.create_time + , t.creator + , t.deduction_proportion + , t.delete_type + , t.donate_amount + , t.donate_date + , t.donation_number + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.recipient_name + , t.tax_agent_id + , t.tax_code + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_grant_donation + + + + actual_deduction, + + + create_time, + + + creator, + + + deduction_proportion, + + + delete_type, + + + donate_amount, + + + donate_date, + + + donation_number, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + recipient_name, + + + tax_agent_id, + + + tax_code, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + income_category, + + + + + #{actualDeduction}, + + + #{createTime}, + + + #{creator}, + + + #{deductionProportion}, + + + #{deleteType}, + + + #{donateAmount}, + + + #{donateDate}, + + + #{donationNumber}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{recipientName}, + + + #{taxAgentId}, + + + #{taxCode}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_grant_donation + + actual_deduction=#{actualDeduction}, + create_time=#{createTime}, + creator=#{creator}, + deduction_proportion=#{deductionProportion}, + delete_type=#{deleteType}, + donate_amount=#{donateAmount}, + donate_date=#{donateDate}, + donation_number=#{donationNumber}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + recipient_name=#{recipientName}, + tax_agent_id=#{taxAgentId}, + tax_code=#{taxCode}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_grant_donation + + + actual_deduction=#{actualDeduction}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + deduction_proportion=#{deductionProportion}, + + + delete_type=#{deleteType}, + + + donate_amount=#{donateAmount}, + + + donate_date=#{donateDate}, + + + donation_number=#{donationNumber}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + recipient_name=#{recipientName}, + + + tax_agent_id=#{taxAgentId}, + + + tax_code=#{taxCode}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_grant_donation + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_grant_donation + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_grant_donation + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java new file mode 100644 index 000000000..2bd55f7b9 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.HealthInsurancePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface HealthInsuranceMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(HealthInsurancePO healthInsurance); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + HealthInsurancePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param healthInsurance 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(HealthInsurancePO healthInsurance); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param healthInsurance 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(HealthInsurancePO healthInsurance); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param healthInsurance 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(HealthInsurancePO healthInsurance); + + /** + * 鍒犻櫎璁板綍 + * + * @param healthInsurance 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(HealthInsurancePO healthInsurance); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByMainId(Long mainId); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml new file mode 100644 index 000000000..a071f7426 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/HealthInsuranceMapper.xml @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.current_deduction + , t.delete_type + , t.effective_date + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.identification_number + , t.main_id + , t.month_premium + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.year_premium + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_health_insurance + + + + create_time, + + + creator, + + + current_deduction, + + + delete_type, + + + effective_date, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + identification_number, + + + main_id, + + + month_premium, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + year_premium, + + + income_category, + + + + + #{createTime}, + + + #{creator}, + + + #{currentDeduction}, + + + #{deleteType}, + + + #{effectiveDate}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{identificationNumber}, + + + #{mainId}, + + + #{monthPremium}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{yearPremium}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_health_insurance + + create_time=#{createTime}, + creator=#{creator}, + current_deduction=#{currentDeduction}, + delete_type=#{deleteType}, + effective_date=#{effectiveDate}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + identification_number=#{identificationNumber}, + main_id=#{mainId}, + month_premium=#{monthPremium}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year_premium=#{yearPremium}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_health_insurance + + + create_time=#{createTime}, + + + creator=#{creator}, + + + current_deduction=#{currentDeduction}, + + + delete_type=#{deleteType}, + + + effective_date=#{effectiveDate}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + identification_number=#{identificationNumber}, + + + main_id=#{mainId}, + + + month_premium=#{monthPremium}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year_premium=#{yearPremium}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_health_insurance + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_health_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_health_insurance + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java index 7638a60cc..073363001 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java @@ -6,47 +6,72 @@ import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; public interface OtherDeductionMapper { - /** + /** * 鏍规嵁涓婚敭鏌ヨ * * @param id 涓婚敭 * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull */ - OtherDeductionPO getById(Long id); + OtherDeductionPO getById(Long id); - /** - * 鏌ヨ鏁版嵁閲囬泦-鍏朵粬鍏嶇◣鎵i櫎鍒楄〃 - * @param param - * @return - */ - List list(@Param("param") OtherDeductionQueryParam param); + /** + * 鏌ヨ鏁版嵁閲囬泦-鍏朵粬鍏嶇◣鎵i櫎鍒楄〃 + * + * @param param + * @return + */ + List list(@Param("param") OtherDeductionQueryParam param); - List recordList(@Param("param") OtherDeductionQueryParam param); + List recordList(@Param("param") OtherDeductionQueryParam param); - List listSome(@Param("param") OtherDeductionPO param); + List listSome(@Param("param") OtherDeductionPO param); - /** - * 鎵归噺鎻掑叆 - * @param pos - */ - void insertData(@Param("collection") List pos); + /** + * 鎵归噺鎻掑叆 + * + * @param pos + */ + void insertData(@Param("collection") List pos); - /** - * 鎵归噺淇敼 - * @param pos - */ - void updateData(@Param("collection") List pos); + /** + * 鎵归噺淇敼 + * + * @param pos + */ + void updateData(@Param("collection") List pos); - /** - * 鎵归噺鍒犻櫎 - * @param longs - */ + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param otherDeduction 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(OtherDeductionPO otherDeduction); + + /** + * 鎵归噺鍒犻櫎 + * + * @param longs + */ void deleteData(List longs); + + /** + * 鍒犻櫎璁板綍 + * + * @param otherDeduction 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(OtherDeductionPO otherDeduction); + + OtherDeductionPO getByTaxAgentIdAndEmployeeIdAndDeclareMonth(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId, @Param("declareMonth") Date declareMonth); + + List listDetails(@Param("param") OtherDeductionPO param); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index f21fed4a1..ef566fdd7 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -16,6 +16,8 @@ + + @@ -36,6 +38,8 @@ , t.delete_type , t.tenant_key , t.private_pension + , t.free_income + , t.derate_deduction @@ -49,6 +53,23 @@ + + UPDATE hrsa_other_deduction + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + + - - t1 . @@ -80,7 +99,9 @@ t1.tax_delay_endowment_insurance, t1.other_deduction, t1.deduction_allowed_donation, - t1.private_pension + t1.private_pension, + t1.free_income, + t1.derate_deduction @@ -284,7 +305,7 @@ - ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -310,7 +331,7 @@ FROM hrsa_other_deduction t WHERE delete_type = 0 - and declare_month = #{param.declareMonth} + and declare_month = #{param.declareMonth} AND t.employee_id IN @@ -336,6 +357,8 @@ other_deduction, deduction_allowed_donation, private_pension, + free_income, + derate_deduction, create_time, update_time, creator, @@ -352,6 +375,8 @@ #{item.otherDeduction}, #{item.deductionAllowedDonation}, #{item.privatePension}, + #{item.freeIncome}, + #{item.derateDeduction}, #{item.createTime}, #{item.updateTime}, #{item.creator}, @@ -369,6 +394,8 @@ other_deduction, deduction_allowed_donation, private_pension, + free_income, + derate_deduction, create_time, update_time, creator, @@ -385,6 +412,8 @@ #{item.otherDeduction,jdbcType=VARCHAR}, #{item.deductionAllowedDonation,jdbcType=VARCHAR}, #{item.privatePension,jdbcType=VARCHAR}, + #{item.freeIncome,jdbcType=VARCHAR}, + #{item.derateDeduction,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.updateTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -394,21 +423,23 @@ - INSERT INTO hrsa_other_deduction( - employee_id, - tax_agent_id, - declare_month, - business_healthy_insurance, - tax_delay_endowment_insurance, - other_deduction, - deduction_allowed_donation, - private_pension, - create_time, - update_time, - creator, - tenant_key - ) - VALUES + INSERT INTO hrsa_other_deduction( + employee_id, + tax_agent_id, + declare_month, + business_healthy_insurance, + tax_delay_endowment_insurance, + other_deduction, + deduction_allowed_donation, + private_pension, + free_income, + derate_deduction, + create_time, + update_time, + creator, + tenant_key + ) + VALUES ( #{item.employeeId}, #{item.taxAgentId}, @@ -418,6 +449,8 @@ #{item.otherDeduction}, #{item.deductionAllowedDonation}, #{item.privatePension}, + #{item.freeIncome}, + #{item.derateDeduction}, #{item.createTime}, #{item.updateTime}, #{item.creator}, @@ -464,6 +497,20 @@ + + + + when id=#{item.id} then #{item.freeIncome} + + + + + + + when id=#{item.id} then #{item.derateDeduction} + + + @@ -480,4 +527,308 @@ + + + INSERT INTO hrsa_other_deduction + + + + business_healthy_insurance, + + + create_time, + + + creator, + + + declare_month, + + + deduction_allowed_donation, + + + delete_type, + + + derate_deduction, + + + employee_id, + + + free_income, + + + other_deduction, + + + private_pension, + + + tax_agent_id, + + + tax_delay_endowment_insurance, + + + tenant_key, + + + update_time, + + + + + #{businessHealthyInsurance}, + + + #{createTime}, + + + #{creator}, + + + #{declareMonth}, + + + #{deductionAllowedDonation}, + + + #{deleteType}, + + + #{derateDeduction}, + + + #{employeeId}, + + + #{freeIncome}, + + + #{otherDeduction}, + + + #{privatePension}, + + + #{taxAgentId}, + + + #{taxDelayEndowmentInsurance}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + select hrsa_other_deduction_id.currval from dual + + + INSERT INTO hrsa_other_deduction + + + + business_healthy_insurance, + + + create_time, + + + creator, + + + declare_month, + + + deduction_allowed_donation, + + + delete_type, + + + derate_deduction, + + + employee_id, + + + free_income, + + + other_deduction, + + + private_pension, + + + tax_agent_id, + + + tax_delay_endowment_insurance, + + + tenant_key, + + + update_time, + + + + + #{businessHealthyInsurance}, + + + #{createTime}, + + + #{creator}, + + + #{declareMonth}, + + + #{deductionAllowedDonation}, + + + #{deleteType}, + + + #{derateDeduction}, + + + #{employeeId}, + + + #{freeIncome}, + + + #{otherDeduction}, + + + #{privatePension}, + + + #{taxAgentId}, + + + #{taxDelayEndowmentInsurance}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java new file mode 100644 index 000000000..2db1ab3f1 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.java @@ -0,0 +1,81 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.OtherDerateDeductionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface OtherDerateDeductionMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(OtherDerateDeductionPO otherDerateDeduction); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + OtherDerateDeductionPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param otherDerateDeduction 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 鎵归噺鎻掑叆 + * + * @param otherDerateDeduction + */ + void batchInsert(@Param("collection") List otherDerateDeduction); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param otherDerateDeduction 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param otherDerateDeduction 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 鍒犻櫎璁板綍 + * + * @param otherDerateDeduction 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(OtherDerateDeductionPO otherDerateDeduction); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByMainId(Long mainId); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml new file mode 100644 index 000000000..397b091c0 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/OtherDerateDeductionMapper.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.other_deduction + , t.remark + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_other_derate_deduction + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + other_deduction, + + + remark, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + income_category, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{otherDeduction}, + + + #{remark}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_other_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + other_deduction=#{otherDeduction}, + remark=#{remark}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_other_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + other_deduction=#{otherDeduction}, + + + remark=#{remark}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_other_derate_deduction + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_other_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_other_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java new file mode 100644 index 000000000..a880e983d --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.java @@ -0,0 +1,75 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.PersonalPensionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface PersonalPensionMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(PersonalPensionPO personalPension); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + PersonalPensionPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param personalPension 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(PersonalPensionPO personalPension); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param personalPension 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(PersonalPensionPO personalPension); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param personalPension 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(PersonalPensionPO personalPension); + + /** + * 鍒犻櫎璁板綍 + * + * @param personalPension 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(PersonalPensionPO personalPension); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByMainId(Long mainId); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml new file mode 100644 index 000000000..1db068c24 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/PersonalPensionMapper.xml @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + collect_source + , t.create_time + , t.creator + , t.data_source + , t.delete_type + , t.eb_data_id + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.pay_amount + , t.pay_month + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.voucher_no + , t.voucher_type + , t.voucher_type_name + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_personal_pension + + + + collect_source, + + + create_time, + + + creator, + + + data_source, + + + delete_type, + + + eb_data_id, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + pay_amount, + + + pay_month, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + voucher_no, + + + voucher_type, + + + voucher_type_name, + + + income_category, + + + + + #{collectSource}, + + + #{createTime}, + + + #{creator}, + + + #{dataSource}, + + + #{deleteType}, + + + #{ebDataId}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{payAmount}, + + + #{payMonth}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{voucherNo}, + + + #{voucherType}, + + + #{voucherTypeName}, + + + #{incomeCategory}, + + + + + + + + UPDATE hrsa_personal_pension + + collect_source=#{collectSource}, + create_time=#{createTime}, + creator=#{creator}, + data_source=#{dataSource}, + delete_type=#{deleteType}, + eb_data_id=#{ebDataId}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + pay_amount=#{payAmount}, + pay_month=#{payMonth}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + voucher_no=#{voucherNo}, + voucher_type=#{voucherType}, + voucher_type_name=#{voucherTypeName}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_personal_pension + + + collect_source=#{collectSource}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + data_source=#{dataSource}, + + + delete_type=#{deleteType}, + + + eb_data_id=#{ebDataId}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + pay_amount=#{payAmount}, + + + pay_month=#{payMonth}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + voucher_no=#{voucherNo}, + + + voucher_type=#{voucherType}, + + + voucher_type_name=#{voucherTypeName}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_personal_pension + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_personal_pension + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_personal_pension + SET delete_type = 1 + WHERE delete_type = 0 + AND main_id = #{mainId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java new file mode 100644 index 000000000..352d00a2e --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.deductionamount; + +import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DeductionAmountMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(DeductionAmountPO deductionAmount); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + DeductionAmountPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param deductionAmount 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(DeductionAmountPO deductionAmount); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param deductionAmount 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(DeductionAmountPO deductionAmount); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param deductionAmount 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(DeductionAmountPO deductionAmount); + + /** + * 鍒犻櫎璁板綍 + * + * @param deductionAmount 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(DeductionAmountPO deductionAmount); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml new file mode 100644 index 000000000..023a41f81 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + card_num + , t.card_type + , t.create_time + , t.creator + , t.declare_status + , t.deduct_flag + , t.delete_type + , t.employee_id + , t.employee_name + , t.employee_type + , t.id + , t.job_num + , t.successfully_declared + , t.declare_error_msg + , t.tax_agent_id + , t.tenant_key + , t.update_time + , t.year + , t.nationality + + + + + + + + + + + + + + + INSERT INTO hrsa_deduction_amount + + + + card_num, + + + card_type, + + + create_time, + + + creator, + + + declare_status, + + + deduct_flag, + + + delete_type, + + + employee_id, + + + employee_name, + + + employee_type, + + + id, + + + job_num, + + + successfully_declared, + + + declare_error_msg, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + year, + + + nationality, + + + + + #{cardNum}, + + + #{cardType}, + + + #{createTime}, + + + #{creator}, + + + #{declareStatus}, + + + #{deductFlag}, + + + #{deleteType}, + + + #{employeeId}, + + + #{employeeName}, + + + #{employeeType}, + + + #{id}, + + + #{jobNum}, + + + #{successfullyDeclared}, + + + #{declareErrorMsg}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{year}, + + + #{nationality}, + + + + + + + + UPDATE hrsa_deduction_amount + + card_num=#{cardNum}, + card_type=#{cardType}, + create_time=#{createTime}, + creator=#{creator}, + declare_status=#{declareStatus}, + deduct_flag=#{deductFlag}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + employee_name=#{employeeName}, + employee_type=#{employeeType}, + job_num=#{jobNum}, + successfully_declared=#{successfullyDeclared}, + declare_error_msg=#{declareErrorMsg}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year=#{year}, + nationality=#{nationality}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount + + + card_num=#{cardNum}, + + + card_type=#{cardType}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + declare_status=#{declareStatus}, + + + deduct_flag=#{deductFlag}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + employee_name=#{employeeName}, + + + employee_type=#{employeeType}, + + + job_num=#{jobNum}, + + + successfully_declared=#{successfullyDeclared}, + + + declare_error_msg=#{declareErrorMsg}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year=#{year}, + + + nationality=#{nationality}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_deduction_amount + 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/deductionamount/DeductionAmountRecordMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java new file mode 100644 index 000000000..ca2815680 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java @@ -0,0 +1,77 @@ +package com.engine.salary.mapper.deductionamount; + +import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DeductionAmountRecordMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(DeductionAmountRecordPO deductionAmountRecord); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + DeductionAmountRecordPO getById(Long id); + + + DeductionAmountRecordPO getByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param deductionAmountRecord 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param deductionAmountRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param deductionAmountRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 鍒犻櫎璁板綍 + * + * @param deductionAmountRecord 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(DeductionAmountRecordPO deductionAmountRecord); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml new file mode 100644 index 000000000..930371420 --- /dev/null +++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.id + , t.request_id + , t.tax_agent_id + , t.tenant_key + , t.update_time + , t.year + + + + + + + + + + + + + + + + + INSERT INTO hrsa_deduction_amount_record + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + request_id, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + year, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{requestId}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{year}, + + + + + + + UPDATE hrsa_deduction_amount_record + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + request_id=#{requestId}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + year=#{year}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount_record + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + request_id=#{requestId}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + year=#{year}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_deduction_amount_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_deduction_amount_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_deduction_amount_record + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_agent_id=#{taxAgentId} + AND year=#{year} + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java new file mode 100644 index 000000000..ce04c325a --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.java @@ -0,0 +1,116 @@ +package com.engine.salary.mapper.employeedeclare; + +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareAddListQueryParam; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * @author Harryxzy + * @ClassName EmployeeDeclareMapper + * @date 2023/08/03 13:26 + * @description + */ +public interface EmployeeDeclareMapper { + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(EmployeeDeclarePO employeeDeclare); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + EmployeeDeclarePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param employeeDeclare 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(EmployeeDeclarePO employeeDeclare); + + + + /** + * 鎵归噺鎻掑叆 + * + * @param employeeDeclare + */ + void batchInsert(@Param("collection") List employeeDeclare); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param employeeDeclare 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(EmployeeDeclarePO employeeDeclare); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param employeeDeclare 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(EmployeeDeclarePO employeeDeclare); + + /** + * 鍒犻櫎璁板綍 + * + * @param employeeDeclare 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(EmployeeDeclarePO employeeDeclare); + + + /** + * 鏌ヨ鎶ラ佺殑浜哄憳 + * + * @param queryParam + * @return + */ + List listByParam(@Param("param") EmployeeDeclareListQueryParam queryParam ); + + /** + * 鏌ヨ鏈湀鏂板鐨勪汉鍛 + * + * @param queryParam + * @return + */ + List list4AddByParam(@Param("param") EmployeeDeclareAddListQueryParam queryParam); + + + + /** + * 鏌ヨ鏈湀鍙樺姩鐨勪汉鍛 + * + * @param queryParam + * @return + */ + List list4UpdateByParam(@Param("param") EmployeeDeclareListQueryParam queryParam); + + /** + * 鏍规嵁idList鍒犻櫎 + * @param ids + * @param date 鍒犻櫎鏃堕棿 + */ + void deleteByIds(@Param("ids") Collection ids, @Param("date") Date date); +} diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml new file mode 100644 index 000000000..c5d985ffc --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -0,0 +1,1009 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.tax_agent_id + , t.tax_cycle + , t.employee_id + , t.employee_type + , t.employee_name + , t.job_num + , t.nationality + , t.card_type + , t.card_num + , t.gender + , t.birthday + , t.employment_status + , t.mobile + , t.employment_type + , t.employment_first_year + , t.employment_date + , t.dismiss_date + , t.entry_date + , t.departure_date + , t.disability + , t.disability_card_no + , t.lonely_old + , t.martyr_dependents + , t.martyr_dependents_card_no + , t.deduct_expenses + , t.successfully_declared + , t.new_employee_info + , t.declare_status + , t.declare_error_msg + , t.tenant_key + , t.creator + , t.delete_type + , t.create_time + , t.update_time + , t.birthplace + , t.tax_reasons + + + + + + + + + + + + + + + INSERT INTO hrsa_employee_declare + + + + id, + + + tax_agent_id, + + + tax_cycle, + + + employee_id, + + + employee_type, + + + employee_name, + + + job_num, + + + nationality, + + + card_type, + + + card_num, + + + gender, + + + birthday, + + + employment_status, + + + mobile, + + + employment_type, + + + employment_first_year, + + + employment_date, + + + dismiss_date, + + + entry_date, + + + departure_date, + + + disability, + + + disability_card_no, + + + lonely_old, + + + martyr_dependents, + + + martyr_dependents_card_no, + + + deduct_expenses, + + + successfully_declared, + + + new_employee_info, + + + declare_status, + + + declare_error_msg, + + + tenant_key, + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + birthplace, + + + tax_reasons, + + + + + #{id}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{employeeId}, + + + #{employeeType}, + + + #{employeeName}, + + + #{jobNum}, + + + #{nationality}, + + + #{cardType}, + + + #{cardNum}, + + + #{gender}, + + + #{birthday}, + + + #{employmentStatus}, + + + #{mobile}, + + + #{employmentType}, + + + #{employmentFirstYear}, + + + #{employmentDate}, + + + #{dismissDate}, + + + #{entryDate}, + + + #{departureDate}, + + + #{disability}, + + + #{disabilityCardNo}, + + + #{lonelyOld}, + + + #{martyrDependents}, + + + #{martyrDependentsCardNo}, + + + #{deductExpenses}, + + + #{successfullyDeclared}, + + + #{newEmployeeInfo}, + + + #{declareStatus}, + + + #{declareErrorMsg}, + + + #{tenantKey}, + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + #{birthplace}, + + + #{taxReasons}, + + + + + + + INSERT INTO hrsa_employee_declare + ( + birthday, + card_num, + nationality, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + entry_date, + departure_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time, + birthplace, + tax_reasons + ) + VALUES + ( + #{item.birthday}, + #{item.cardNum}, + #{item.nationality}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{item.entryDate}, + #{item.departureDate}, + #{item.employeeId}, + #{item.employeeName}, + #{item.employeeType}, + #{item.employmentDate}, + #{item.employmentFirstYear}, + #{item.employmentStatus}, + #{item.employmentType}, + #{item.gender}, + #{item.id}, + #{item.jobNum}, + #{item.lonelyOld}, + #{item.martyrDependents}, + #{item.martyrDependentsCardNo}, + #{item.mobile}, + #{item.newEmployeeInfo}, + #{item.successfullyDeclared}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.birthplace}, + #{item.taxReasons} + ) + + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + nationality, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + entry_date, + departure_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time, + birthplace, + tax_reasons + ) + + + select + #{item.birthday,jdbcType=DATE}, + #{item.cardNum,jdbcType=VARCHAR}, + #{item.nationality,jdbcType=VARCHAR}, + #{item.cardType,jdbcType=INTEGER}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.declareErrorMsg,jdbcType=VARCHAR}, + #{item.declareStatus,jdbcType=INTEGER}, + #{item.deductExpenses,jdbcType=INTEGER}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.disability,jdbcType=INTEGER}, + #{item.disabilityCardNo,jdbcType=VARCHAR}, + #{item.dismissDate,jdbcType=DATE}, + #{item.entryDate,jdbcType=DATE}, + #{item.departureDate,jdbcType=DATE}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.employeeName,jdbcType=VARCHAR}, + #{item.employeeType,jdbcType=INTEGER}, + #{item.employmentDate,jdbcType=DATE}, + #{item.employmentFirstYear,jdbcType=VARCHAR}, + #{item.employmentStatus,jdbcType=INTEGER}, + #{item.employmentType,jdbcType=INTEGER}, + #{item.gender,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.jobNum,jdbcType=VARCHAR}, + #{item.lonelyOld,jdbcType=INTEGER}, + #{item.martyrDependents,jdbcType=INTEGER}, + #{item.martyrDependentsCardNo,jdbcType=VARCHAR}, + #{item.mobile,jdbcType=VARCHAR}, + #{item.newEmployeeInfo,jdbcType=INTEGER}, + #{item.successfullyDeclared,jdbcType=INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxCycle,jdbcType=DATE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE}, + #{item.birthplace,jdbcType=VARCHAR}, + #{item.taxReasons,jdbcType=VARCHAR} + from dual + + + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + nationality, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_date, + entry_date, + departure_date, + employee_id, + employee_name, + employee_type, + employment_date, + employment_first_year, + employment_status, + employment_type, + gender, + id, + job_Num, + lonely_old, + martyr_dependents, + martyr_dependents_card_no, + mobile, + new_employee_info, + successfully_declared, + tax_agent_id, + tax_cycle, + tenant_key, + update_time, + birthplace, + tax_reasons + ) + VALUES + ( + #{item.birthday}, + #{item.cardNum}, + #{item.nationality}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{item.entryDate}, + #{item.departureDate}, + #{item.employeeId}, + #{item.employeeName}, + #{item.employeeType}, + #{item.employmentDate}, + #{item.employmentFirstYear}, + #{item.employmentStatus}, + #{item.employmentType}, + #{item.gender}, + #{item.id}, + #{item.jobNum}, + #{item.lonelyOld}, + #{item.martyrDependents}, + #{item.martyrDependentsCardNo}, + #{item.mobile}, + #{item.newEmployeeInfo}, + #{item.successfullyDeclared}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.birthplace}, + #{item.taxReasons} + ) + + + + + + + UPDATE hrsa_employee_declare + + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + employee_name=#{employeeName}, + job_num=#{jobNum}, + nationality=#{nationality}, + card_type=#{cardType}, + card_num=#{cardNum}, + gender=#{gender}, + birthday=#{birthday}, + employment_status=#{employmentStatus}, + mobile=#{mobile}, + employment_type=#{employmentType}, + employment_first_year=#{employmentFirstYear}, + employment_date=#{employmentDate}, + dismiss_date=#{dismissDate}, + entry_date=#{entryDate}, + departure_date=#{departureDate}, + disability=#{disability}, + disability_card_no=#{disabilityCardNo}, + lonely_old=#{lonelyOld}, + martyr_dependents=#{martyrDependents}, + martyr_dependents_card_no=#{martyrDependentsCardNo}, + deduct_expenses=#{deductExpenses}, + successfully_declared=#{successfullyDeclared}, + new_employee_info=#{newEmployeeInfo}, + declare_status=#{declareStatus}, + declare_error_msg=#{declareErrorMsg}, + tenant_key=#{tenantKey}, + creator=#{creator}, + delete_type=#{deleteType}, + create_time=#{createTime}, + update_time=#{updateTime}, + birthplace=#{birthplace}, + tax_reasons=#{taxReasons}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + employee_name=#{employeeName}, + + + job_num=#{jobNum}, + + + nationality=#{nationality}, + + + card_type=#{cardType}, + + + card_num=#{cardNum}, + + + gender=#{gender}, + + + birthday=#{birthday}, + + + employment_status=#{employmentStatus}, + + + mobile=#{mobile}, + + + employment_type=#{employmentType}, + + + employment_first_year=#{employmentFirstYear}, + + + employment_date=#{employmentDate}, + + dismiss_date=#{dismissDate}, + entry_date=#{entryDate}, + departure_date=#{departureDate}, + birthplace=#{birthplace}, + tax_reasons=#{taxReasons}, + + disability=#{disability}, + + + disability_card_no=#{disabilityCardNo}, + + + lonely_old=#{lonelyOld}, + + + martyr_dependents=#{martyrDependents}, + + + martyr_dependents_card_no=#{martyrDependentsCardNo}, + + + deduct_expenses=#{deductExpenses}, + + + successfully_declared=#{successfullyDeclared}, + + + new_employee_info=#{newEmployeeInfo}, + + + declare_status=#{declareStatus}, + + + declare_error_msg=#{declareErrorMsg}, + + + tenant_key=#{tenantKey}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + UPDATE hrsa_employee_declare + SET delete_type=1, + update_time = #{date} + WHERE delete_type = 0 + + AND id IN + + #{id} + + + + + + + + AND (employee_name LIKE CONCAT('%',#{param.keyword},'%') OR job_num LIKE CONCAT('%',#{param.keyword},'%')) + + + + + + AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%') + + + + + + AND (employee_name LIKE '%'||#{param.keyword}||'%' OR job_num LIKE '%'||#{param.keyword}||'%') + + + + + + AND (employee_name LIKE '%'+#{param.keyword}+'%' OR job_num LIKE '%'+#{param.keyword}+'%') + + + + + AND tax_agent_id = #{param.taxAgentId} + AND tax_cycle = #{param.taxCycle} + + AND id IN + + #{id} + + + + AND declare_status = #{param.declareStatus.value} + + + AND employee_id=#{param.employeeId} + + + AND employment_status = #{param.employmentStatus.value} + + + AND employment_type = #{param.employmentType.value} + + + AND employment_date >= #{param.fromEmploymentDate} + + + AND #{param.endEmploymentDate} >= employment_date + + + AND dismiss_date >= #{param.fromDismissDate} + + + AND #{param.endDismissDate} >= dismiss_date + + + AND disability = #{param.disability.value} + + + AND lonely_old = #{param.lonelyOld.value} + + + AND martyr_dependents = #{param.martyrDependents.value} + + + AND deduct_expenses = #{param.deductExpenses.value} + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java new file mode 100644 index 000000000..88a771f4e --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.java @@ -0,0 +1,82 @@ +package com.engine.salary.mapper.employeedeclare; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +public interface EmployeeDeclareRecordMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(EmployeeDeclareRecordPO employeeDeclareRecord); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + EmployeeDeclareRecordPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param employeeDeclareRecord 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 鎵归噺鎻掑叆 + * + * @param employeeDeclareRecord + */ + void batchInsert(@Param("collection") List employeeDeclareRecord); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param employeeDeclareRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param employeeDeclareRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 鍒犻櫎璁板綍 + * + * @param employeeDeclareRecord 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByTaxCycleAndTaxAgentId(@Param("taxCycle")Date taxCycle,@Param("taxAgentId") Long taxAgentId); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml new file mode 100644 index 000000000..8e3da7cdd --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareRecordMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_agent_id + , t.tax_cycle + , t.request_id + + + + + + + + + + + + + + + INSERT INTO hrsa_employee_declare_record + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_agent_id, + + + tax_cycle, + + + request_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{requestId}, + + + + + + + + INSERT INTO hrsa_employee_declare_record + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.requestId}, + + ) + + + + + INSERT INTO hrsa_employee_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxCycle,jdbcType=DATE}, + #{item.requestId,jdbcType=DOUBLE}, + from dual + + + + + + + INSERT INTO hrsa_employee_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + tax_cycle, + request_id, + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxCycle}, + #{item.requestId}, + ) + + + + + + UPDATE hrsa_employee_declare_record + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + request_id=#{requestId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare_record + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + request_id=#{requestId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_employee_declare_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_employee_declare_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_employee_declare_record + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_cycle = #{taxCycle} + AND tax_agent_id = #{taxAgentId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java index 010241611..2ad7d01b9 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java @@ -87,6 +87,13 @@ public interface ExternalEmployeeMapper { */ Collection listAllForReport(); + /** + * 鏍规嵁濮撳悕銆佸伐鍙锋ā绯婃煡璇 + * @param keyword + * @return + */ + List listByKeyword(@Param("keyword") String keyword); + List listSomeDataCollectionEmployee(ExtEmpPO po); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index f09431009..f044f9561 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -427,6 +427,52 @@ ORDER BY e.id DESC + + + + + + AND + ( + e.username like CONCAT('%',#{keyword},'%') + OR + e.workcode like CONCAT('%',#{keyword},'%') + ) + + + + + AND + ( + e.username like '%'||#{keyword}||'%' + OR + e.workcode like '%'||#{keyword}||'%' + ) + + + + + AND + ( + e.username like '%'+#{keyword}+'%' + OR + e.workcode like '%'+#{keyword}+'%' + ) + + diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java new file mode 100644 index 000000000..badcde3d7 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.salaryacct; + +import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalaryAcctCalcTaxReqMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(SalaryAcctCalcTaxReqPO acctCalcTaxReq); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + SalaryAcctCalcTaxReqPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param acctCalcTaxReq 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(SalaryAcctCalcTaxReqPO acctCalcTaxReq); + + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param acctCalcTaxReq 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(SalaryAcctCalcTaxReqPO acctCalcTaxReq); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param acctCalcTaxReq 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(SalaryAcctCalcTaxReqPO acctCalcTaxReq); + + /** + * 鍒犻櫎璁板綍 + * + * @param acctCalcTaxReq 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(SalaryAcctCalcTaxReqPO acctCalcTaxReq); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteByRecordId(Long salaryAcctRecordId); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml new file mode 100644 index 000000000..ced6e5276 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctCalcTaxReqMapper.xml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.salary_acct_record_id + , t.tax_agent_id + , t.request_id + , t.tenant_key + , t.creator + , t.delete_type + , t.create_time + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_acct_calc_tax_req + + + + id, + + + salary_acct_record_id, + + + tax_agent_id, + + + request_id, + + + tenant_key, + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + + + #{id}, + + + #{salaryAcctRecordId}, + + + #{taxAgentId}, + + + #{requestId}, + + + #{tenantKey}, + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + + + + + + UPDATE hrsa_acct_calc_tax_req + + salary_acct_record_id=#{salaryAcctRecordId}, + tax_agent_id=#{taxAgentId}, + request_id=#{requestId}, + tenant_key=#{tenantKey}, + creator=#{creator}, + delete_type=#{deleteType}, + create_time=#{createTime}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_acct_calc_tax_req + + + salary_acct_record_id=#{salaryAcctRecordId}, + + + tax_agent_id=#{taxAgentId}, + + + request_id=#{requestId}, + + + tenant_key=#{tenantKey}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_acct_calc_tax_req + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_acct_record_id = #{salaryAcctRecordId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java index a7f66818a..b8c12c273 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java @@ -1,6 +1,8 @@ package com.engine.salary.mapper.salaryacct; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import org.apache.ibatis.annotations.Param; @@ -123,6 +125,10 @@ public interface SalaryAcctEmployeeMapper { void lockByRecordId(@Param("lockStatus") Integer lockStatus, @Param("recordId") Long recordId); + List listPage4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + int countNotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + void updateIgnoreNull(@Param("salaryAcctEmployeePO")SalaryAcctEmployeePO salaryAcctEmployeePO); void lock(SalaryAcctEmployeePO salaryAcctEmployeePO); diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 9aeca4df9..17377b967 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1016,6 +1016,7 @@ + @@ -1071,78 +1072,84 @@ parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO"> SELECT + ,r.tax_cycle,b.income_category FROM hrsa_salary_acct_emp t - WHERE delete_type = 0 + left join hrsa_salary_acct_record r on t.salary_acct_record_id = r.id + left join hrsa_salary_sob b on r.salary_sob_id = b.id + WHERE t.delete_type = 0 and r.delete_type = 0 and b.delete_type = 0 - AND id = #{id} + AND t.id = #{id} - AND salary_acct_record_id = #{salaryAcctRecordId} + AND t.salary_acct_record_id = #{salaryAcctRecordId} - AND salary_sob_id = #{salarySobId} + AND t.salary_sob_id = #{salarySobId} - AND employee_id = #{employeeId} + AND t.employee_id = #{employeeId} - AND tax_agent_id = #{taxAgentId} + AND t.tax_agent_id = #{taxAgentId} - AND salary_month = #{salaryMonth} + AND t.salary_month = #{salaryMonth} + + + AND r.tax_cycle = #{taxCycle} - AND creator = #{creator} + AND t.creator = #{creator} - AND create_time = #{createTime} + AND t.create_time = #{createTime} - AND update_time = #{updateTime} + AND t.update_time = #{updateTime} - AND delete_type = #{deleteType} + AND t.delete_type = #{deleteType} - AND tenant_key = #{tenantKey} + AND t.tenant_key = #{tenantKey} - AND id IN + AND t.id IN #{id} - AND salary_acct_record_id IN + AND t.salary_acct_record_id IN #{salaryAcctRecordId} - AND employee_id IN + AND t.employee_id IN #{employeeId} - AND tax_agent_id IN + AND t.tax_agent_id IN #{taxAgentId} - AND salary_sob_id IN + AND t.salary_sob_id IN #{salarySobId} - AND salary_month IN + AND t.salary_month IN #{salaryMonth} - ORDER BY id DESC + ORDER BY t.id DESC @@ -1171,6 +1178,47 @@ AND salary_acct_record_id = #{recordId} + + + + + UPDATE hrsa_salary_acct_emp diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java index 83110f1e6..465834b7e 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java @@ -2,6 +2,7 @@ package com.engine.salary.mapper.salaryacct; import com.engine.salary.common.LocalDateRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -81,4 +82,12 @@ public interface SalaryAcctRecordMapper { List getBackCalcRecordByIds(@Param("collection") Set salaryAcctIds); void updateDate(@Param("id")Long id, @Param("updateTime")Date updateTime); + + + /** + * 鑾峰彇鏍哥畻璁板綍鍜屾墸缂翠箟鍔′汉瀵瑰簲鍏崇郴 + * @param salaryAcctIds + * @return + */ + List listAcctTaxAgent(@Param("salaryAcctRecordIds")Collection salaryAcctIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml index 12d7e6c4a..519af2c54 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml @@ -460,4 +460,24 @@ AND id = #{id} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java index 545b5a81b..bbc727459 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultMapper.java @@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; +import java.util.Set; public interface SalaryAcctResultMapper { 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/mapper/salarysob/SalarySobAddUpRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java new file mode 100644 index 000000000..f13fd838e --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobAddUpRuleMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(SalarySobAddUpRulePO sobAddUpRule); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + SalarySobAddUpRulePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param sobAddUpRule 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 鎵归噺鎻掑叆 + * + * @param sobAddUpRule + */ + void batchInsert(@Param("collection") List sobAddUpRule); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param sobAddUpRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param sobAddUpRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 鍒犻櫎璁板綍 + * + * @param sobAddUpRule 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(@Param("salarySobIds")Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml new file mode 100644 index 000000000..34eefce6a --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobAddUpRuleMapper.xml @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + t + . + add_up_column_data_index + , t.create_time + , t.creator + , t.delete_type + , t.id + , t.income_category + , t.salary_item_id + , t.salary_sob_id + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_add_up_rule + + + + add_up_column_data_index, + + + create_time, + + + creator, + + + delete_type, + + + id, + + + income_category, + + + salary_item_id, + + + salary_sob_id, + + + tenant_key, + + + update_time, + + + + + #{addUpColumnDataIndex}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{incomeCategory}, + + + #{salaryItemId}, + + + #{salarySobId}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_sob_add_up_rule + ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time + ) + VALUES + ( + + #{item.addUpColumnDataIndex}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.incomeCategory}, + #{item.salaryItemId}, + #{item.salarySobId}, + #{item.tenantKey}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_sob_add_up_rule ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time + ) + + + select + #{item.addUpColumnDataIndex,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR}, + #{item.salaryItemId,jdbcType=DOUBLE}, + #{item.salarySobId,jdbcType=DOUBLE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_sob_add_up_rule ( + add_up_column_data_index, + create_time, + creator, + delete_type, + id, + income_category, + salary_item_id, + salary_sob_id, + tenant_key, + update_time + ) + VALUES + ( + #{item.addUpColumnDataIndex}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.id}, + #{item.incomeCategory}, + #{item.salaryItemId}, + #{item.salarySobId}, + #{item.tenantKey}, + #{item.updateTime} + ) + + + + + + UPDATE hrsa_sob_add_up_rule + + add_up_column_data_index=#{addUpColumnDataIndex}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + income_category=#{incomeCategory}, + salary_item_id=#{salaryItemId}, + salary_sob_id=#{salarySobId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_add_up_rule + + + add_up_column_data_index=#{addUpColumnDataIndex}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + income_category=#{incomeCategory}, + + + salary_item_id=#{salaryItemId}, + + + salary_sob_id=#{salarySobId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_sob_add_up_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml index 81e68abdd..10a98cf87 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobDefaultItemGroupMapper.xml @@ -89,6 +89,12 @@ #{id} + + AND income_category IN + + #{incomeCategory} + + ORDER BY id DESC diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml index 03b5a240f..62a3ca7ae 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -15,8 +15,10 @@ + + @@ -35,12 +37,14 @@ , t.sorted_index , t.tenant_key , t.update_time - , t.can_delete + ,t.can_delete + ,t.salary_item_code , t.rounding_mode , t.pattern , t.value_type , t.default_value , t.item_hide + , t.income_category @@ -171,6 +175,7 @@ pattern=#{pattern}, value_type=#{valueType}, item_hide=#{itemHide}, + income_category=#{incomeCategory}, default_value=#{defaultValue}, WHERE id = #{id} AND delete_type = 0 @@ -232,6 +237,9 @@ item_hide=#{itemHide}, + + income_category=#{incomeCategory}, + WHERE id = #{id} AND delete_type = 0 @@ -278,7 +286,7 @@ INSERT INTO hrsa_salary_sob_item(salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,item_hide,default_value) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category,default_value) VALUES ( @@ -297,14 +305,16 @@ #{item.roundingMode}, #{item.pattern}, #{item.valueType}, + #{item.salaryItemCode}, #{item.itemHide}, + #{item.incomeCategory}, #{item.defaultValue} ) INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,item_hide,default_value) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category,default_value) select @@ -323,7 +333,9 @@ #{item.roundingMode,jdbcType=INTEGER}, #{item.pattern,jdbcType=INTEGER}, #{item.valueType,jdbcType=INTEGER}, + #{item.salaryItemCode,jdbcType=INTEGER}, #{item.itemHide,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR}, #{item.defaultValue,jdbcType=VARCHAR} from dual @@ -331,7 +343,7 @@ INSERT INTO hrsa_salary_sob_item( salary_sob_id, salary_item_id, salary_sob_item_group_id, formula_id, - sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,item_hide,default_value) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code,item_hide,income_category,default_value) VALUES ( #{item.salarySobId}, @@ -349,13 +361,14 @@ #{item.roundingMode}, #{item.pattern}, #{item.valueType}, + #{item.salaryItemCode}, #{item.itemHide}, + #{item.incomeCategory}, #{item.defaultValue} ) - UPDATE hrsa_salary_sob_item SET delete_type = 1 diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java new file mode 100644 index 000000000..cf737d731 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobTaxReportRuleMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(SalarySobTaxReportRulePO sobTaxReportRule); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + SalarySobTaxReportRulePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param sobTaxReportRule 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 鎵归噺鎻掑叆 + * + * @param sobTaxReportRule + */ + void batchInsert(@Param("collection") List sobTaxReportRule); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param sobTaxReportRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param sobTaxReportRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 鍒犻櫎璁板綍 + * + * @param sobTaxReportRule 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(@Param("salarySobIds")Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml new file mode 100644 index 000000000..d49f3cdfe --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxReportRuleMapper.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.salary_sob_id + , t.income_category + , t.report_column_data_index + , t.salary_item_id + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_tax_report_rule + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + salary_sob_id, + + + income_category, + + + report_column_data_index, + + + salary_item_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{salarySobId}, + + + #{incomeCategory}, + + + #{reportColumnDataIndex}, + + + #{salaryItemId}, + + + + + + + + INSERT INTO hrsa_sob_tax_report_rule + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.salarySobId}, + #{item.incomeCategory}, + #{item.reportColumnDataIndex}, + #{item.salaryItemId} + + ) + + + + + INSERT INTO hrsa_sob_tax_report_rule ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.salarySobId,jdbcType=DOUBLE}, + #{item.incomeCategory,jdbcType=VARCHAR}, + #{item.reportColumnDataIndex,jdbcType=VARCHAR}, + #{item.salaryItemId,jdbcType=DOUBLE} + from dual + + + + + + + INSERT INTO hrsa_sob_tax_report_rule ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + salary_sob_id, + income_category, + report_column_data_index, + salary_item_id + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.salarySobId}, + #{item.incomeCategory}, + #{item.reportColumnDataIndex}, + #{item.salaryItemId} + ) + + + + + + UPDATE hrsa_sob_tax_report_rule + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + salary_sob_id=#{salarySobId}, + income_category=#{incomeCategory}, + report_column_data_index=#{reportColumnDataIndex}, + salary_item_id=#{salaryItemId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_report_rule + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + salary_sob_id=#{salarySobId}, + + + income_category=#{incomeCategory}, + + + report_column_data_index=#{reportColumnDataIndex}, + + + salary_item_id=#{salaryItemId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_sob_tax_report_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java new file mode 100644 index 000000000..cd2db6677 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobTaxRuleMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(SalarySobTaxRulePO sobTaxRule); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + SalarySobTaxRulePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param sobTaxRule 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(SalarySobTaxRulePO sobTaxRule); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param sobTaxRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(SalarySobTaxRulePO sobTaxRule); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param sobTaxRule 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(SalarySobTaxRulePO sobTaxRule); + + /** + * 鍒犻櫎璁板綍 + * + * @param sobTaxRule 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(SalarySobTaxRulePO sobTaxRule); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBySalarySobIds(@Param("salarySobIds") Collection salarySobIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml new file mode 100644 index 000000000..53277c457 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobTaxRuleMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.salary_sob_id + , t.income_category + , t.tax_index + , t.salary_item_id + + + + + + + + + + + + + + + INSERT INTO hrsa_sob_tax_rule + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + salary_sob_id, + + + income_category, + + + tax_index, + + + salary_item_id, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{salarySobId}, + + + #{incomeCategory}, + + + #{taxIndex}, + + + #{salaryItemId}, + + + + + + + UPDATE hrsa_sob_tax_rule + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + salary_sob_id=#{salarySobId}, + income_category=#{incomeCategory}, + tax_index=#{taxIndex}, + salary_item_id=#{salaryItemId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_rule + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + salary_sob_id=#{salarySobId}, + + + income_category=#{incomeCategory}, + + + tax_index=#{taxIndex}, + + + salary_item_id=#{salaryItemId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_sob_tax_rule + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_sob_tax_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + UPDATE hrsa_sob_tax_rule + SET delete_type = 1 + WHERE delete_type = 0 + AND salary_sob_id IN + + #{salarySobId} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java index 865e47591..635111b29 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java @@ -72,4 +72,10 @@ public interface TaxAgentMapper { List getAllConfig(); + /** + * 鏌ヨ鍖呭惈鍒犻櫎鐘舵佺殑鏁版嵁 + * @param taxAgentIds + * @return + */ + List listByIdsIncludeDel(@Param("taxAgentIds") Collection taxAgentIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml index 20d164b94..0761d3e7f 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml @@ -277,5 +277,17 @@ where t.delete_type=0 + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java new file mode 100644 index 000000000..ec4492aae --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.taxagent; + +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.List; + +/** + * 涓◣鎵g即涔夊姟浜烘姤绋庝俊鎭 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxAgentTaxReturnMapper { + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxAgentTaxReturnPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param TaxAgentTaxReturnPO 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param TaxAgentTaxReturnPO 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param TaxAgentTaxReturnPO 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 鍒犻櫎璁板綍 + * + * @param TaxAgentTaxReturnPO 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + TaxAgentTaxReturnPO selectOneByTaxAgentId(Long taxAgentId); + + void updateByTaxAgentId(TaxAgentTaxReturnPO po); +} diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml new file mode 100644 index 000000000..da28243a6 --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + area_code + , t.check_status + , t.city + , t.create_time + , t.creator + , t.delete_type + , t.department_code + , t.department_name + , t.fail_reason + , t.id + , t.nation + , t.password_type + , t.province + , t.pwd + , t.real_account + , t.tax_agent_id + , t.tax_code + , t.tax_registration_number + , t.tenant_key + , t.update_time + , t.city_name + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_agent_tax_return + + + + area_code, + + + check_status, + + + city, + + + create_time, + + + creator, + + + delete_type, + + + department_code, + + + department_name, + + + fail_reason, + + + id, + + + nation, + + + password_type, + + + province, + + + pwd, + + + real_account, + + + tax_agent_id, + + + tax_code, + + + tax_registration_number, + + + tenant_key, + + + update_time, + + + city_name, + + + + + #{areaCode}, + + + #{checkStatus}, + + + #{city}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{departmentCode}, + + + #{departmentName}, + + + #{failReason}, + + + #{id}, + + + #{nation}, + + + #{passwordType}, + + + #{province}, + + + #{pwd}, + + + #{realAccount}, + + + #{taxAgentId}, + + + #{taxCode}, + + + #{taxRegistrationNumber}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{cityName}, + + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + city_name=#{cityName}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_agent_id=#{taxAgentId}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + + area_code=#{areaCode}, + + + check_status=#{checkStatus}, + + + city=#{city}, + + + city_name=#{cityName}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + department_code=#{departmentCode}, + + + department_name=#{departmentName}, + + + fail_reason=#{failReason}, + + + nation=#{nation}, + + + password_type=#{passwordType}, + + + province=#{province}, + + + pwd=#{pwd}, + + + real_account=#{realAccount}, + + + tax_agent_id=#{taxAgentId}, + + + tax_code=#{taxCode}, + + + tax_registration_number=#{taxRegistrationNumber}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_tax_return + + area_code=#{areaCode}, + check_status=#{checkStatus}, + city=#{city}, + city_name=#{cityName}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + department_code=#{departmentCode}, + department_name=#{departmentName}, + fail_reason=#{failReason}, + nation=#{nation}, + password_type=#{passwordType}, + province=#{province}, + pwd=#{pwd}, + real_account=#{realAccount}, + tax_code=#{taxCode}, + tax_registration_number=#{taxRegistrationNumber}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE tax_agent_id=#{taxAgentId} AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..46df17a51 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,23 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; + +/** + * 涓◣鐢虫姤-鎺ュ彛娴侀噺浣跨敤璁板綍 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationApiFlowRecordMapper { + /** + * 鎵归噺鎻掑叆 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..146c5b5e5 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,92 @@ + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java new file mode 100644 index 000000000..c72078fe6 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.java @@ -0,0 +1,81 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationApiFlowWarnConfigMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationApiFlowWarnConfigPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowWarnConfig 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxApiFlowWarnConfig + */ + void batchInsert(@Param("collection") List taxApiFlowWarnConfig); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxApiFlowWarnConfig 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowWarnConfig 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxApiFlowWarnConfig 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + TaxDeclarationApiFlowWarnConfigPO getOne(); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml new file mode 100644 index 000000000..190783ccb --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnConfigMapper.xml @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + t + . + business_id + , t.create_time + , t.creator + , t.delete_type + , t.enable_warn + , t.id + , t.tenant_key + , t.threshold + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config + + + + business_id, + + + create_time, + + + creator, + + + delete_type, + + + enable_warn, + + + id, + + + tenant_key, + + + threshold, + + + update_time, + + + + + #{businessId}, + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{enableWarn}, + + + #{id}, + + + #{tenantKey}, + + + #{threshold}, + + + #{updateTime}, + + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config + ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + VALUES + ( + + #{item.businessId}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.enableWarn}, + #{item.id}, + #{item.tenantKey}, + #{item.threshold}, + #{item.updateTime} + + ) + + + + + INSERT INTO hrsa_tax_api_flow_warn_config ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + + + select + #{item.businessId,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.enableWarn,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.threshold,jdbcType=DOUBLE}, + #{item.updateTime,jdbcType=DATE} + from dual + + + + + + + INSERT INTO hrsa_tax_api_flow_warn_config ( + business_id, + create_time, + creator, + delete_type, + enable_warn, + id, + tenant_key, + threshold, + update_time + ) + VALUES + ( + #{item.businessId}, + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.enableWarn}, + #{item.id}, + #{item.tenantKey}, + #{item.threshold}, + #{item.updateTime} + ) + + + + + + UPDATE hrsa_tax_api_flow_warn_config + + business_id=#{businessId}, + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + enable_warn=#{enableWarn}, + tenant_key=#{tenantKey}, + threshold=#{threshold}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_warn_config + + + business_id=#{businessId}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + enable_warn=#{enableWarn}, + + + tenant_key=#{tenantKey}, + + + threshold=#{threshold}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_warn_config + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_warn_config + 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/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java new file mode 100644 index 000000000..26384e3b4 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.java @@ -0,0 +1,82 @@ +package com.engine.salary.mapper.taxapiflow; + +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationApiFlowWarnReceiverMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationApiFlowWarnReceiverPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowReceiver 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxApiFlowReceiver + */ + void batchInsert(@Param("collection") List taxApiFlowReceiver); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxApiFlowReceiver 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowReceiver 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxApiFlowReceiver 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + List filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml new file mode 100644 index 000000000..5c9942e40 --- /dev/null +++ b/src/com/engine/salary/mapper/taxapiflow/TaxDeclarationApiFlowWarnReceiverMapper.xml @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.email + , t.employee_id + , t.id + , t.mobile + , t.tenant_key + , t.update_time + , t.warn_config_id + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver + + + + create_time, + + + creator, + + + delete_type, + + + email, + + + employee_id, + + + id, + + + mobile, + + + tenant_key, + + + update_time, + + + warn_config_id, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{email}, + + + #{employeeId}, + + + #{id}, + + + #{mobile}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{warnConfigId}, + + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver + ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + VALUES + ( + + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.email}, + #{item.employeeId}, + #{item.id}, + #{item.mobile}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.warnConfigId} + + ) + + + + + INSERT INTO hrsa_tax_api_flow_receiver ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + + + select + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.email,jdbcType=VARCHAR}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.id,jdbcType=DOUBLE}, + #{item.mobile,jdbcType=VARCHAR}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE}, + #{item.warnConfigId,jdbcType=DOUBLE} + from dual + + + + + + + INSERT INTO hrsa_tax_api_flow_receiver ( + create_time, + creator, + delete_type, + email, + employee_id, + id, + mobile, + tenant_key, + update_time, + warn_config_id + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.email}, + #{item.employeeId}, + #{item.id}, + #{item.mobile}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.warnConfigId} + ) + + + + + + UPDATE hrsa_tax_api_flow_receiver + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + email=#{email}, + employee_id=#{employeeId}, + mobile=#{mobile}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + warn_config_id=#{warnConfigId}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_receiver + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + email=#{email}, + + + employee_id=#{employeeId}, + + + mobile=#{mobile}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + warn_config_id=#{warnConfigId}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_receiver + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_receiver + 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/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java new file mode 100644 index 000000000..f430e1eb2 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.java @@ -0,0 +1,89 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +/** + * 涓◣鐢虫姤-鎺ュ彛娴侀噺浣跨敤璁板綍 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Mapper +public interface TaxDeclarationApiFlowRecordMapper { + + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationApiFlowRecordPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowRecord 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxApiFlowRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxApiFlowRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxApiFlowRecord 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + /** + * 鎵归噺鎻掑叆 + * + * @param list + */ + void batchInsert(@Param("collection") Collection list); +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml new file mode 100644 index 000000000..6dbe947bb --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiFlowRecordMapper.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + t + . + business_type + , t.create_time + , t.creator + , t.deduct + , t.delete_type + , t.employee_id + , t.id + , t.result_status + , t.tax_agent_id + , t.tax_month + , t.tenant_key + , t.update_time + , t.use_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_api_flow_record + + + + business_type, + + + create_time, + + + creator, + + + deduct, + + + delete_type, + + + employee_id, + + + id, + + + result_status, + + + tax_agent_id, + + + tax_month, + + + tenant_key, + + + update_time, + + + use_time, + + + + + #{businessType}, + + + #{createTime}, + + + #{creator}, + + + #{deduct}, + + + #{deleteType}, + + + #{employeeId}, + + + #{id}, + + + #{resultStatus}, + + + #{taxAgentId}, + + + #{taxMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{useTime}, + + + + + + + + UPDATE hrsa_tax_api_flow_record + + business_type=#{businessType}, + create_time=#{createTime}, + creator=#{creator}, + deduct=#{deduct}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + result_status=#{resultStatus}, + tax_agent_id=#{taxAgentId}, + tax_month=#{taxMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + use_time=#{useTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_record + + + business_type=#{businessType}, + + + create_time=#{createTime}, + + + creator=#{creator}, + + + deduct=#{deduct}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + result_status=#{resultStatus}, + + + tax_agent_id=#{taxAgentId}, + + + tax_month=#{taxMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + use_time=#{useTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_api_flow_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_api_flow_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + (#{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + + + select + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + from dual + + + + INSERT INTO hrsa_tax_api_flow_record (id, create_time, update_time, creator, delete_type, tenant_key, + tax_agent_id, + tax_month, use_time, deduct, employee_id, business_type, result_status) + VALUES + + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.taxMonth}, + #{item.useTime}, + #{item.deduct}, + #{item.employeeId}, + #{item.businessType}, + #{item.resultStatus} + ) + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java new file mode 100644 index 000000000..893cd22db --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.java @@ -0,0 +1,67 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; + +import java.util.List; + +public interface TaxDeclarationApiProfileMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationApiProfilePO getById(Long id); + + /** + * 鏂板锛屾彃鍏ユ墍鏈夊瓧娈 + * + * @param taxDeclareApiProfile 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insert(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclareApiProfile 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclareApiProfile 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclareApiProfile 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclareApiProfile 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + TaxDeclarationApiProfilePO getOne(); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml new file mode 100644 index 000000000..0dffb4ff8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationApiProfileMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.api_profile + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_profile + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + api_profile, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{apiProfile}, + + + + + + + UPDATE hrsa_tax_declare_api_profile + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + api_profile=#{apiProfile}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + api_profile=#{apiProfile}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_profile + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_profile + 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/taxdeclaration/TaxDeclarationMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java index 5785ed794..cbdf9a2ae 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java @@ -41,4 +41,6 @@ public interface TaxDeclarationMapper { void deleteByIds(@Param("ids") Collection ids); int deleteByIdZj(Long id); + + void deleteByTaxDeclareRecordIds(@Param("taxDeclareRecordIds") Collection taxDeclareRecordIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml index b034b00ff..3b12becbf 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.tenant_key , t.update_time ,t.income_category + ,t.tax_declare_record_id @@ -61,6 +63,12 @@ AND salary_month #{salaryMonths.endDate} + + AND tax_cycle = ]]> #{taxMonths.fromDate} + + + AND tax_cycle #{taxMonths.endDate} + AND tax_cycle = ]]> #{taxCycleFromDate} @@ -79,11 +87,17 @@ AND tax_cycle = #{taxCycle} + + AND tax_declare_record_id = #{taxDeclareRecordId} + + + AND income_category = #{incomeCategory} + ORDER BY id DESC INSERT INTO hrsa_tax_declaration(id, salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) VALUES ( @@ -97,13 +111,14 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.incomeCategory} + #{item.incomeCategory}, + #{item.taxDeclareRecordId} ) INSERT INTO hrsa_tax_declaration(id,salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) select @@ -117,14 +132,15 @@ #{item.updateTime,jdbcType=DATE}, #{item.deleteType,jdbcType=INTEGER}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.incomeCategory,jdbcType=INTEGER} + #{item.incomeCategory,jdbcType=INTEGER}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE} from dual INSERT INTO hrsa_tax_declaration(id,salary_month, tax_cycle, tax_agent_id, description, - creator, create_time, update_time, delete_type, tenant_key ,income_category) + creator, create_time, update_time, delete_type, tenant_key ,income_category,tax_declare_record_id) VALUES ( #{item.id}, @@ -137,7 +153,8 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.incomeCategory} + #{item.incomeCategory}, + #{item.taxDeclareRecordId} ) @@ -153,4 +170,14 @@ + + UPDATE hrsa_tax_declaration + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java new file mode 100644 index 000000000..fc5d0415f --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -0,0 +1,128 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclarationValueMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclarationValuePO taxDeclarationValue); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationValuePO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclarationValue 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxDeclarationValue + */ + void batchInsert(@Param("collection") List taxDeclarationValue); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclarationValue 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclarationValue 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclarationValue 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void deleteBytaxDeclareRecordIds(@Param("taxDeclareRecordIds")Collection taxDeclareRecordIds); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + List listPage4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + List list4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + List listPage4NoValueByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + List list4NoValueByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxDeclarationValues + */ + void batchInsert(@Param("collection") Collection taxDeclarationValues); + + + List queryNotWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + + List queryWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml new file mode 100644 index 000000000..5eba618cb --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_declare_record_id + , t.tax_declaration_id + , t.employee_type + , t.employee_id + , t.result_value_json + , t.source + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declaration_value + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_declare_record_id, + + + tax_declaration_id, + + + employee_type, + + + employee_id, + + + result_value_json, + + + source, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxDeclareRecordId}, + + + #{taxDeclarationId}, + + + #{employeeType}, + + + #{employeeId}, + + + #{resultValueJson}, + + + #{source}, + + + + + + + + INSERT INTO hrsa_tax_declaration_value + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + source + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson}, + #{item.source} + + ) + + + + + INSERT INTO hrsa_tax_declaration_value ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + source + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.taxDeclarationId,jdbcType=DOUBLE}, + #{item.employeeType,jdbcType=INTEGER}, + #{item.employeeId,jdbcType=DOUBLE}, + #{item.resultValueJson,jdbcType=VARCHAR}, + #{item.source,jdbcType=INTEGER} + from dual + + + + + + + INSERT INTO hrsa_tax_declaration_value ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + tax_declaration_id, + employee_type, + employee_id, + result_value_json, + source + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson}, + #{item.source} + ) + + + + + + UPDATE hrsa_tax_declaration_value + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_declare_record_id=#{taxDeclareRecordId}, + tax_declaration_id=#{taxDeclarationId}, + employee_type=#{employeeType}, + employee_id=#{employeeId}, + result_value_json=#{resultValueJson}, + source=#{source}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_value + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + tax_declaration_id=#{taxDeclarationId}, + + + employee_type=#{employeeType}, + + + employee_id=#{employeeId}, + + + result_value_json=#{resultValueJson}, + + + source=#{source}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_value + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declaration_value + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_declaration_value + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + + + + + + + + employee_id + , employee_type + + + + SELECT DISTINCT + + FROM hrsa_tax_declaration_value + WHERE delete_type = 0 + AND tax_declare_record_id = #{param.taxDeclareRecordId} + AND employee_id NOT IN ( + SELECT employee_id + FROM hrsa_employee_declare hed + WHERE hed.delete_type = 0 + AND hed.tax_agent_id = #{param.taxAgentId} + AND hed.tax_cycle = #{param.taxCycle} + AND hed.successfully_declared = 1 + AND hed.employment_status = 0 + AND hed.declare_status IN (4) + ) + + + + + + + + SELECT + + FROM hrsa_employee_declare + WHERE delete_type = 0 + AND tax_agent_id = #{param.taxAgentId} + AND tax_cycle = #{param.taxCycle} + AND successfully_declared = 1 + AND employment_status = 0 + AND employee_id NOT IN ( + SELECT employee_id + FROM hrsa_tax_declaration_value htdv + WHERE htdv.delete_type = 0 + AND htdv.tax_declare_record_id = #{param.taxDeclareRecordId} + ) + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java new file mode 100644 index 000000000..0848295ab --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.java @@ -0,0 +1,75 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareApiConfigMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclarationApiConfigPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclareApiConfig 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclareApiConfig 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclareApiConfig 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclareApiConfig 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + TaxDeclarationApiConfigPO getOne(); + +} diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml new file mode 100644 index 000000000..5ae5a4680 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareApiConfigMapper.xml @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.host + , t.app_key + , t.app_secret + , t.enable_use + , t.totality + , t.remain + , t.last_update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_api_config + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + host, + + + app_key, + + + app_secret, + + + enable_use, + + + totality, + + + remain, + + + last_update_time, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{host}, + + + #{appKey}, + + + #{appSecret}, + + + #{enableUse}, + + + #{totality}, + + + #{remain}, + + + #{lastUpdateTime}, + + + + + + + UPDATE hrsa_tax_declare_api_config + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + host=#{host}, + app_key=#{appKey}, + app_secret=#{appSecret}, + enable_use=#{enableUse}, + totality=#{totality}, + remain=#{remain}, + last_update_time=#{lastUpdateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + host=#{host}, + + + app_key=#{appKey}, + + + app_secret=#{appSecret}, + + + enable_use=#{enableUse}, + + + totality=#{totality}, + + + remain=#{remain}, + + + last_update_time=#{lastUpdateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_api_config + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_api_config + 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/taxdeclaration/TaxDeclareFailMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java new file mode 100644 index 000000000..74e39e44e --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.java @@ -0,0 +1,84 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareFailMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclareFailPO taxDeclareFail); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclareFailPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclareFail 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclareFailPO taxDeclareFail); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxDeclareFail + */ + void batchInsert(@Param("collection") List taxDeclareFail); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclareFail 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclareFailPO taxDeclareFail); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclareFail 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclareFailPO taxDeclareFail); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclareFail 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclareFailPO taxDeclareFail); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + /** + * 鏍规嵁鐢虫姤璁板綍id鍒犻櫎 + * @param taxDeclareRecordIds + */ + void deleteBytaxDeclareRecordIds(@Param("taxDeclareRecordIds")Collection taxDeclareRecordIds); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml new file mode 100644 index 000000000..7276a0948 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareFailMapper.xml @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_declare_record_id + , t.employee_name + , t.card_num + , t.error_msg + , t.income_category + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_fail + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_declare_record_id, + + + employee_name, + + + card_num, + + + error_msg, + + + income_category, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxDeclareRecordId}, + + + #{employeeName}, + + + #{cardNum}, + + + #{errorMsg}, + + + #{incomeCategory}, + + + + + + + + INSERT INTO hrsa_tax_declare_fail + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.employeeName}, + #{item.cardNum}, + #{item.errorMsg}, + #{item.incomeCategory} + + ) + + + + + INSERT INTO hrsa_tax_declare_fail ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.employeeName,jdbcType=VARCHAR}, + #{item.cardNum,jdbcType=VARCHAR}, + #{item.errorMsg,jdbcType=VARCHAR}, + #{item.incomeCategory,jdbcType=VARCHAR} + from dual + + + + + + + INSERT INTO hrsa_tax_declare_fail ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_declare_record_id, + employee_name, + card_num, + error_msg, + income_category + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.employeeName}, + #{item.cardNum}, + #{item.errorMsg}, + #{item.incomeCategory} + ) + + + + + + UPDATE hrsa_tax_declare_fail + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_declare_record_id=#{taxDeclareRecordId}, + employee_name=#{employeeName}, + card_num=#{cardNum}, + error_msg=#{errorMsg}, + income_category=#{incomeCategory}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_fail + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + employee_name=#{employeeName}, + + + card_num=#{cardNum}, + + + error_msg=#{errorMsg}, + + + income_category=#{incomeCategory}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_fail + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_declare_fail + SET delete_type = 1 + WHERE delete_type = 0 + AND tax_declare_record_id IN + + #{taxDeclareRecordId} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java new file mode 100644 index 000000000..e8cedfc93 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.java @@ -0,0 +1,79 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareRecordMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclareRecordPO taxDeclareRecord); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclareRecordPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclareRecord 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxDeclareRecord + */ + void batchInsert(@Param("collection") List taxDeclareRecord); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclareRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclareRecord 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclareRecord 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml new file mode 100644 index 000000000..79b47b6fd --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -0,0 +1,563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_agent_id + , t.salary_month + , t.tax_cycle + , t.remark + , t.request_id + , t.declare_request_id + , t.tax_declare_type + , t.tax_declare_status + , t.display_update_icon + , t.tax_pay_amount + , t.person_num + , t.tax_declare_error_msg + , t.tax_paid_amount + , t.tax_pure_paid_amount + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_record + + + + id, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + tax_agent_id, + + + salary_month, + + + tax_cycle, + + + remark, + + + request_id, + + + declare_request_id, + + + tax_declare_type, + + + tax_declare_status, + + + display_update_icon, + + + tax_pay_amount, + + + person_num, + + + tax_declare_error_msg, + + + tax_paid_amount, + + + tax_pure_paid_amount, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxAgentId}, + + + #{salaryMonth}, + + + #{taxCycle}, + + + #{remark}, + + + #{requestId}, + + + #{declareRequestId}, + + + #{taxDeclareType}, + + + #{taxDeclareStatus}, + + + #{displayUpdateIcon}, + + + #{taxPayAmount}, + + + #{personNum}, + + + #{taxDeclareErrorMsg}, + + + #{taxPaidAmount}, + + + #{taxPurePaidAmount}, + + + + + + + + INSERT INTO hrsa_tax_declare_record + ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + declare_request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.salaryMonth}, + #{item.taxCycle}, + #{item.remark}, + #{item.requestId}, + #{item.declareRequestId}, + #{item.taxDeclareType}, + #{item.taxDeclareStatus}, + #{item.displayUpdateIcon}, + #{item.taxPayAmount}, + #{item.personNum}, + #{item.taxDeclareErrorMsg}, + #{item.taxPaidAmount}, + #{item.taxPurePaidAmount} + + ) + + + + + INSERT INTO hrsa_tax_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + declare_request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount + ) + + + select + #{item.id,jdbcType=DOUBLE}, + #{item.createTime,jdbcType=DATE}, + #{item.updateTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.salaryMonth,jdbcType=DATE}, + #{item.taxCycle,jdbcType=DATE}, + #{item.remark,jdbcType=VARCHAR}, + #{item.requestId,jdbcType=DOUBLE}, + #{item.declareRequestId,jdbcType=VARCHAR}, + #{item.taxDeclareType,jdbcType=INTEGER}, + #{item.taxDeclareStatus,jdbcType=INTEGER}, + #{item.displayUpdateIcon,jdbcType=INTEGER}, + #{item.taxPayAmount,jdbcType=VARCHAR}, + #{item.personNum,jdbcType=INTEGER}, + #{item.taxDeclareErrorMsg,jdbcType=VARCHAR}, + #{item.taxPaidAmount,jdbcType=VARCHAR}, + #{item.taxPurePaidAmount,jdbcType=VARCHAR} + from dual + + + + + + + INSERT INTO hrsa_tax_declare_record ( + id, + create_time, + update_time, + creator, + delete_type, + tenant_key, + tax_agent_id, + salary_month, + tax_cycle, + remark, + request_id, + declare_request_id, + tax_declare_type, + tax_declare_status, + display_update_icon, + tax_pay_amount, + person_num, + tax_declare_error_msg, + tax_paid_amount, + tax_pure_paid_amount + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxAgentId}, + #{item.salaryMonth}, + #{item.taxCycle}, + #{item.remark}, + #{item.requestId}, + #{item.declareRequestId}, + #{item.taxDeclareType}, + #{item.taxDeclareStatus}, + #{item.displayUpdateIcon}, + #{item.taxPayAmount}, + #{item.personNum}, + #{item.taxDeclareErrorMsg}, + #{item.taxPaidAmount}, + #{item.taxPurePaidAmount} + ) + + + + + + UPDATE hrsa_tax_declare_record + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_agent_id=#{taxAgentId}, + salary_month=#{salaryMonth}, + tax_cycle=#{taxCycle}, + remark=#{remark}, + request_id=#{requestId}, + declare_request_id=#{declareRequestId}, + tax_declare_type=#{taxDeclareType}, + tax_declare_status=#{taxDeclareStatus}, + display_update_icon=#{displayUpdateIcon}, + tax_pay_amount=#{taxPayAmount}, + person_num=#{personNum}, + tax_declare_error_msg=#{taxDeclareErrorMsg}, + tax_paid_amount=#{taxPaidAmount}, + tax_pure_paid_amount=#{taxPurePaidAmount}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_record + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_agent_id=#{taxAgentId}, + + + salary_month=#{salaryMonth}, + + + tax_cycle=#{taxCycle}, + + + remark=#{remark}, + + + request_id=#{requestId}, + + + declare_request_id=#{declareRequestId}, + + + tax_declare_type=#{taxDeclareType}, + + + tax_declare_status=#{taxDeclareStatus}, + + + display_update_icon=#{displayUpdateIcon}, + + + tax_pay_amount=#{taxPayAmount}, + + + person_num=#{personNum}, + + + tax_declare_error_msg=#{taxDeclareErrorMsg}, + + + tax_paid_amount=#{taxPaidAmount}, + + + tax_pure_paid_amount=#{taxPurePaidAmount}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_record + 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/taxdeclaration/TaxDeclareStatusMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java new file mode 100644 index 000000000..21c269d52 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.java @@ -0,0 +1,74 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxDeclareStatusMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxDeclareStatusPO taxDeclareStatus); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxDeclareStatusPO getById(Long id); + + TaxDeclareStatusPO getDeclareStatus(@Param("taxDeclareRecordId")Long taxDeclareRecordId,@Param("reportType")Integer reportType); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxDeclareStatus 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxDeclareStatus 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxDeclareStatus 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxDeclareStatus 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxDeclareStatusPO taxDeclareStatus); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml new file mode 100644 index 000000000..8257acf88 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareStatusMapper.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.tax_declare_record_id + , t.report_type + , t.request_id + , t.tax_declare_type + , t.tax_declare_status + , t.display_update_icon + , t.tax_declare_error_msg + , t.person_num + , t.tax_pay_amount + , t.tax_paid_amount + , t.tax_pure_paid_amount + , t.declare_request_id + , t.delete_type + + + + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_declare_status + + + + id, + + + tax_declare_record_id, + + + report_type, + + + request_id, + + + tax_declare_type, + + + tax_declare_status, + + + display_update_icon, + + + tax_declare_error_msg, + + + person_num, + + + tax_pay_amount, + + + tax_paid_amount, + + + tax_pure_paid_amount, + + + declare_request_id, + + + delete_type, + + + + + #{id}, + + + #{taxDeclareRecordId}, + + + #{reportType}, + + + #{requestId}, + + + #{taxDeclareType}, + + + #{taxDeclareStatus}, + + + #{displayUpdateIcon}, + + + #{taxDeclareErrorMsg}, + + + #{personNum}, + + + #{taxPayAmount}, + + + #{taxPaidAmount}, + + + #{taxPurePaidAmount}, + + + #{declareRequestId}, + + + #{deleteType}, + + + + + + + + + UPDATE hrsa_tax_declare_status + + tax_declare_record_id=#{taxDeclareRecordId}, + report_type=#{reportType}, + request_id=#{requestId}, + tax_declare_type=#{taxDeclareType}, + tax_declare_status=#{taxDeclareStatus}, + display_update_icon=#{displayUpdateIcon}, + tax_declare_error_msg=#{taxDeclareErrorMsg}, + person_num=#{personNum}, + tax_pay_amount=#{taxPayAmount}, + tax_paid_amount=#{taxPaidAmount}, + tax_pure_paid_amount=#{taxPurePaidAmount}, + declare_request_id=#{declareRequestId}, + delete_type=#{deleteType}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_status + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + report_type=#{reportType}, + + + request_id=#{requestId}, + + + tax_declare_type=#{taxDeclareType}, + + + tax_declare_status=#{taxDeclareStatus}, + + + display_update_icon=#{displayUpdateIcon}, + + + tax_declare_error_msg=#{taxDeclareErrorMsg}, + + + person_num=#{personNum}, + + + tax_pay_amount=#{taxPayAmount}, + + + tax_paid_amount=#{taxPaidAmount}, + + + tax_pure_paid_amount=#{taxPurePaidAmount}, + + + declare_request_id=#{declareRequestId}, + + + delete_type=#{deleteType}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declare_status + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_declare_status + 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/taxdeclaration/TaxReportColumnMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java new file mode 100644 index 000000000..1f767ca48 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java @@ -0,0 +1,22 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; + +import java.util.List; + +public interface TaxReportColumnMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxReportColumnPO taxReportColumn); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml new file mode 100644 index 000000000..7ce9c9fae --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + , t.tax_report_type + , t.income_category + , t.report_column_name + , t.report_column_data_index + , t.data_type + , t.request_param_key + , t.report_column_label + , t.contrast_type + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java new file mode 100644 index 000000000..d33063ed7 --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java @@ -0,0 +1,84 @@ +package com.engine.salary.mapper.taxpayment; + +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxPaymentRequestMapper { + + /** + * 鏌ヨ鎵鏈夎褰 + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listAll(); + + /** + * 鏉′欢鏌ヨ + * + * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List + */ + List listSome(TaxPaymentRequestPO taxPaymentRequest); + + + /** + * 鏍规嵁涓婚敭鏌ヨ + * + * @param id 涓婚敭 + * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull + */ + TaxPaymentRequestPO getById(Long id); + + /** + * 鏂板锛屽拷鐣ull瀛楁 + * + * @param taxPaymentRequest 鏂板鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int insertIgnoreNull(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 鎵归噺鎻掑叆 + * + * @param taxPaymentRequest + */ + void batchInsert(@Param("collection") List taxPaymentRequest); + + /** + * 淇敼锛屼慨鏀规墍鏈夊瓧娈 + * + * @param taxPaymentRequest 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int update(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 淇敼锛屽拷鐣ull瀛楁 + * + * @param taxPaymentRequest 淇敼鐨勮褰 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int updateIgnoreNull(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 鍒犻櫎璁板綍 + * + * @param taxPaymentRequest 寰呭垹闄ょ殑璁板綍 + * @return 杩斿洖褰卞搷琛屾暟 + */ + int delete(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 鎵归噺鍒犻櫎璁板綍 + * + * @param ids 涓婚敭id闆嗗悎 + */ + void deleteByIds(@Param("ids") Collection ids); + + void updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO build); + + TaxPaymentRequestPO getOne(TaxPaymentRequestPO build); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml new file mode 100644 index 000000000..6d84c59b8 --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.feedback + , t.id + , t.request_id + , t.request_type + , t.tax_agent_id + , t.tax_declare_record_id + , t.tax_year_month + , t.tenant_key + , t.update_time + , t.report_type + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_payment_request + + + + create_time, + + + creator, + + + delete_type, + + + feedback, + + + id, + + + request_id, + + + request_type, + + + tax_agent_id, + + + tax_declare_record_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + report_type + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{feedback}, + + + #{id}, + + + #{requestId}, + + + #{requestType}, + + + #{taxAgentId}, + + + #{taxDeclareRecordId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + #{reportType} + + + + + + + + INSERT INTO hrsa_tax_payment_request + ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time, + report_type + ) + VALUES + ( + + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.feedback}, + #{item.id}, + #{item.requestId}, + #{item.requestType}, + #{item.taxAgentId}, + #{item.taxDeclareRecordId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.reportType} + + ) + + + + + INSERT INTO hrsa_tax_payment_request ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time, + report_type + ) + + + select + #{item.createTime,jdbcType=DATE}, + #{item.creator,jdbcType=DOUBLE}, + #{item.deleteType,jdbcType=INTEGER}, + #{item.feedback,jdbcType=INTEGER}, + #{item.id,jdbcType=DOUBLE}, + #{item.requestId,jdbcType=DOUBLE}, + #{item.requestType,jdbcType=INTEGER}, + #{item.taxAgentId,jdbcType=DOUBLE}, + #{item.taxDeclareRecordId,jdbcType=DOUBLE}, + #{item.taxYearMonth,jdbcType=DATE}, + #{item.tenantKey,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=DATE}, + #{item.reportType,jdbcType=INTEGER} + from dual + + + + + + + INSERT INTO hrsa_tax_payment_request ( + create_time, + creator, + delete_type, + feedback, + id, + request_id, + request_type, + tax_agent_id, + tax_declare_record_id, + tax_year_month, + tenant_key, + update_time, + report_type + ) + VALUES + ( + #{item.createTime}, + #{item.creator}, + #{item.deleteType}, + #{item.feedback}, + #{item.id}, + #{item.requestId}, + #{item.requestType}, + #{item.taxAgentId}, + #{item.taxDeclareRecordId}, + #{item.taxYearMonth}, + #{item.tenantKey}, + #{item.updateTime}, + #{item.reportType} + ) + + + + + + UPDATE hrsa_tax_payment_request + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + feedback=#{feedback}, + request_id=#{requestId}, + request_type=#{requestType}, + tax_agent_id=#{taxAgentId}, + tax_declare_record_id=#{taxDeclareRecordId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + report_type=#{reportType}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_payment_request + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + feedback=#{feedback}, + + + request_id=#{requestId}, + + + request_type=#{requestType}, + + + tax_agent_id=#{taxAgentId}, + + + tax_declare_record_id=#{taxDeclareRecordId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + report_type=#{reportType}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_payment_request + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_payment_request + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + UPDATE hrsa_tax_payment_request + + + request_id=#{requestId}, + + feedback=#{feedback} + + WHERE delete_type = 0 + AND request_type=#{requestType} + AND tax_agent_id=#{taxAgentId} + AND tax_year_month=#{taxYearMonth} + AND report_type=#{reportType} + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/remote/tax/client/CalculateClient.java b/src/com/engine/salary/remote/tax/client/CalculateClient.java new file mode 100644 index 000000000..0cfa8e933 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/CalculateClient.java @@ -0,0 +1,33 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import com.engine.salary.util.TaskUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class CalculateClient extends TaxBaseClient{ + + public CalculateClient(Long taxAgentId) { + super(taxAgentId); + } + + public GetASynIndividualIncomeTaxFeedbackResponse getASynIndividualIncomeTaxFeedback(String requestId){ + String url = super.apiConfig.getHost() + "/gateway/iit/calculateTax/getASynIndividualIncomeTaxFeedback"; + Map params = new HashMap<>(1); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(requestId, url, requestId, res); + log.info("getASynIndividualIncomeTaxFeedback res --- {}", res); + return JsonUtil.parseObject(res, GetASynIndividualIncomeTaxFeedbackResponse.class); + + } +} diff --git a/src/com/engine/salary/remote/tax/client/CompanyClient.java b/src/com/engine/salary/remote/tax/client/CompanyClient.java new file mode 100644 index 000000000..3ebf962e9 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/CompanyClient.java @@ -0,0 +1,39 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class CompanyClient extends TaxBaseClient { + + + public CompanyClient(Long taxAgentId) { + super(taxAgentId); + } + + public CompanyRegisterInfoResponse getCompanyRegisterInfo(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; + String requestId = request(url, requestParam); + + String getRegisterInfoFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_FEEDBACK_URL; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(getRegisterInfoFeedbackUrl, responseParam, CompanyRegisterInfoResponse.class); + } + + public CheckPasswordResponse checkPassword(Map requestParam) { + + String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + String requestId = request(url, requestParam); + + String checkPasswordFeedbackUrl = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_FEEDBACK_URL; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(checkPasswordFeedbackUrl, responseParam, CheckPasswordResponse.class); + } +} diff --git a/src/com/engine/salary/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java new file mode 100644 index 000000000..28cb0c92d --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -0,0 +1,97 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; +import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * 涓◣鐢虫姤瀹㈡埛绔 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeclareClient extends TaxBaseClient { + public DeclareClient(Long taxAgentId) { + super(taxAgentId); + } + + /** + * 鏌ヨ浼佷笟鐢虫姤鏁版嵁鏄庣粏 + * + * + * @param requestId + * @return + */ + public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){ + // 渚涘簲鍟嗕俊鎭 + String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; + Map params = new HashMap<>(1); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + + log.info("getDeclareTaxResultFeedback res --- {}", res); + return JsonUtil.parseObject(res, GetDeclareTaxResultFeedbackResponse.class); + } + + + /** + * 浣滃簾鐢虫姤 + * @param requestParam + * @param responseParam + * @return + */ + public CancelDeclareFeedbackResponse cancel(Map requestParam, Map responseParam) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; + String requestId = request(url, requestParam); + + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, CancelDeclareFeedbackResponse.class); + } + + /** + * 鏇存鐢虫姤 + * + * @param requestParam + */ + public UpdateDeclareResponse correct(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE; + String requestId = request(url, requestParam); + + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, UpdateDeclareResponse.class); + } + + + /** + * 浼佷笟鐢虫姤鏁版嵁鏄庣粏 + * @param requestParam + * @return + */ + public GetCompanyIncomesResponse getCompanyIncomes(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES; + String requestId = request(url, requestParam); + + String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.GET_COMPANY_INCOMES_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(feedbackUrl, responseParam, GetCompanyIncomesResponse.class); + } + +} diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java new file mode 100644 index 000000000..05c3d3482 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java @@ -0,0 +1,101 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; +import com.engine.salary.remote.tax.request.deductionAmount.QueryDeductionAmountRequest; +import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import com.engine.salary.util.TaskUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; + +import java.util.*; + +/** + * 鐢虫姤鎵e噺瀹㈡埛绔 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountClient extends TaxBaseClient { + + public DeductionAmountClient(Long taxAgentId) { + super(taxAgentId); + } + + public String query(String taxYear) { + + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct"; + QueryDeductionAmountRequest queryDeductionAmountRequest = new QueryDeductionAmountRequest(); + queryDeductionAmountRequest.setNsrsbh(returnPO.getTaxCode()); + queryDeductionAmountRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + queryDeductionAmountRequest.setQymc(returnPO.getTaxAgentName()); + queryDeductionAmountRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + queryDeductionAmountRequest.setAreaid(returnPO.getAreaCode()); + queryDeductionAmountRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + queryDeductionAmountRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + queryDeductionAmountRequest.setJmsbmm("1"); + queryDeductionAmountRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + queryDeductionAmountRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + queryDeductionAmountRequest.setJmsmmm("1"); + queryDeductionAmountRequest.setMmlx("" + returnPO.getPasswordType()); + queryDeductionAmountRequest.setSkssnd(taxYear); + + String reqJson = JsonUtil.toJsonString(queryDeductionAmountRequest); + log.info("queryDeductionAmountRequest 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("queryDeductionAmountRequest res --- {}", res); + return res; + } + + + public String confirm(String year, List kczglb) { + + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/confirmPreDeduct"; + ConfirmPreDeductRequest request = new ConfirmPreDeductRequest(); + request.setNsrsbh(returnPO.getTaxCode()); + request.setBizNo(UUID.randomUUID().toString().replace("-", "")); + request.setQymc(returnPO.getTaxAgentName()); + request.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + request.setAreaid(returnPO.getAreaCode()); + request.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + request.setSbmm(realNamePwd ? null : returnPO.getPwd()); + request.setJmsbmm("1"); + request.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + request.setSmmm(realNamePwd ? returnPO.getPwd() : null); + request.setJmsmmm("1"); + request.setMmlx("" + returnPO.getPasswordType()); + request.setSkssnd(year); + request.setKczglb(kczglb); + + String requestId = request(url, JsonUtil.parseMap(request, Object.class)); + return requestId; + } + + public ConfirmFeedbackResponse feedback(String requestId) { + TaskUtil taskUtil = new TaskUtil(); + + String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/getPreDeductConfirmFeedback"; + + Map param = new HashMap<>(1); + param.put("requestId", requestId); + + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, param); + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + ConfirmFeedbackResponse response = JsonUtil.parseBean(res, ConfirmFeedbackResponse.class); + return response; + } +} diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java new file mode 100644 index 000000000..5a246b398 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -0,0 +1,73 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.remote.tax.request.employee.MergedEmployeeArchivesRequest; +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * 浜哄憳淇℃伅鐧昏鎶ラ佸鎴风 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeClient extends TaxBaseClient { + + public EmployeeClient(Long taxAgentId) { + super(taxAgentId); + } + + public String mergedEmployeeArchives(MergedEmployeeArchivesRequest mergedEmployeeArchivesRequest) { + + String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/query"; + mergedEmployeeArchivesRequest.setNsrsbh(returnPO.getTaxCode()); + mergedEmployeeArchivesRequest.setBizNo(UUID.randomUUID().toString().replace("-", "")); + mergedEmployeeArchivesRequest.setQymc(returnPO.getTaxAgentName()); + mergedEmployeeArchivesRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null); + mergedEmployeeArchivesRequest.setAreaid(returnPO.getAreaCode()); + mergedEmployeeArchivesRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null); + boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType()); + mergedEmployeeArchivesRequest.setSbmm(realNamePwd ? null : returnPO.getPwd()); + mergedEmployeeArchivesRequest.setJmsbmm("1"); + mergedEmployeeArchivesRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null); + mergedEmployeeArchivesRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null); + mergedEmployeeArchivesRequest.setJmsmmm("1"); + mergedEmployeeArchivesRequest.setMmlx("" + returnPO.getPasswordType()); + + + String reqJson = JsonUtil.toJsonString(mergedEmployeeArchivesRequest); + log.info("mergedEmployeeArchivesRequest 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("mergedEmployeeArchivesRequest res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } + + public String mergedEmployeeArchivesFeedback(String requestId) { + + String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/getFeedback"; + Map params = new HashMap<>(1); + params.put("requestId", requestId); + log.info("mergedEmployeeArchivesFeedback requestId --- \n{}\n", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("mergedEmployeeArchivesFeedback res --- {}", res); +// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class); + return res; + } +} diff --git a/src/com/engine/salary/remote/tax/client/PaymentClient.java b/src/com/engine/salary/remote/tax/client/PaymentClient.java new file mode 100644 index 000000000..bb64bfe58 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/PaymentClient.java @@ -0,0 +1,13 @@ +package com.engine.salary.remote.tax.client; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class PaymentClient extends TaxBaseClient { + public PaymentClient(Long taxAgentId) { + super(taxAgentId); + } + + + +} diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java new file mode 100644 index 000000000..686676a39 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -0,0 +1,164 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.remote.tax.response.RequestIdResponse; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import weaver.general.Util; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@Slf4j +public class TaxBaseClient { + private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class); + } + + private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + public Long taxAgentId; + public TaxDeclarationApiConfigPO apiConfig; + public TaxAgentTaxReturnPO returnPO; + public TaxAgentPO taxAgent; + + public static final int threshold = 600; + + public TaxBaseClient(Long taxAgentId) { + this.taxAgentId = taxAgentId; + this.apiConfig = getTaxDeclareApiConfigMapper().getOne(); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); +// try { +// // 瀵嗙爜瑙e瘑 +// taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); +// } catch (Exception e) { +// log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); +// } + this.returnPO = taxReturnPO; + this.taxAgent = getTaxAgentMapper().getById(taxAgentId); + } + + public Map initRequestMap() { + Map requestMap = new HashMap<>(); + requestMap.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestMap.put("qymc", taxAgent.getName()); + requestMap.put("mmlx", returnPO.getPasswordType()); + requestMap.put("smzh", returnPO.getRealAccount()); + requestMap.put("smmm", returnPO.getPwd()); + requestMap.put("jmsmmm", "1"); + requestMap.put("sbmm", returnPO.getPwd()); + requestMap.put("jmsbmm", "1"); + requestMap.put("djxhid", returnPO.getTaxRegistrationNumber()); + requestMap.put("nsrsbh", returnPO.getTaxCode()); + requestMap.put("areaid", returnPO.getAreaCode()); + requestMap.put("bmbh", returnPO.getDepartmentCode()); + requestMap.put("bmmc", returnPO.getDepartmentName()); + return requestMap; + } + + public String request(String url, Map requestParam) { + String reqJson = JsonUtil.toJsonString(requestParam); + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + //璁板綍鎺ュ彛 + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, reqJson, res); + + RequestIdResponse response = JsonUtil.parseObject(res, RequestIdResponse.class); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || response.getBody() == null) { + // 濡傛灉杩斿洖閿欒 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); + } + return response.getBody().getRequestId(); + } + + public T response(String url, Map param, Class clazz) { + TaskUtil taskUtil = new TaskUtil(); + T response = null; + for (int i = 0; i <= threshold; ++i) { + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, param); + //璁板綍鎺ュ彛 + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + response = JsonUtil.parseBean(res, clazz); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + // 濡傛灉绋庡弸杩斿洖閿欒淇℃伅 + String code = response.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { + //杩涜涓殑浠诲姟锛岄噸璇 + try { + Thread.sleep(6 * 1000); + } catch (InterruptedException e) { + log.error("", e); + } + if (threshold == i) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈湪棰勬湡鏃堕棿鍐呭畬鎴愪换鍔★紝璇风◢鍚庨噸璇曪紒闃鍊硷細" + threshold)); + } + } else if (SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode())) { + //鎴愬姛鐨勪换鍔★紝杩斿洖缁撴灉 + break; + } else { + //閿欒浠诲姟锛屾彁绀 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); + } + } + return response; + } + + public T postResponse(String url, Map param, Class clazz) { + String reqJson = JsonUtil.toJsonString(param); + TaskUtil taskUtil = new TaskUtil(); + T response = null; + for (int i = 0; i <= threshold; ++i) { + Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + response = JsonUtil.parseBean(res, clazz); + //璁板綍鎺ュ彛 + taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res); + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + // 濡傛灉绋庡弸杩斿洖閿欒淇℃伅 + String code = response.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { + //杩涜涓殑浠诲姟锛岄噸璇 + try { + Thread.sleep(6 * 1000); + } catch (InterruptedException e) { + log.error("", e); + } + if (threshold == i) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈湪棰勬湡鏃堕棿鍐呭畬鎴愪换鍔★紝璇风◢鍚庨噸璇曪紒闃鍊硷細" + threshold)); + } + } else if (SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode())) { + //鎴愬姛鐨勪换鍔★紝杩斿洖缁撴灉 + break; + } else { + //閿欒浠诲姟锛屾彁绀 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, response.getHead().getMsg())); + } + } + return response; + } +} diff --git a/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java new file mode 100644 index 000000000..2f80692b1 --- /dev/null +++ b/src/com/engine/salary/remote/tax/client/TaxPaymentClient.java @@ -0,0 +1,70 @@ +package com.engine.salary.remote.tax.client; + +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +import com.engine.salary.entity.taxpayment.response.SyncWithholdingFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class TaxPaymentClient extends TaxBaseClient { + public TaxPaymentClient(Long taxAgentId) { + super(taxAgentId); + } + + + /** + * 浣滃簾缂存鍑瘉 + * + * @param requestParam + * @return + */ + public QuerySpecialAmountResponse cancelWithholdingVoucher(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(url, responseParam, QuerySpecialAmountResponse.class); + + } + + /** + * 鍒锋柊缂存鐘舵 + * @param requestParam + * @return + */ + public SyncWithholdingFeedbackResponse getSyncWithholding(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(url, responseParam, SyncWithholdingFeedbackResponse.class); + + } + + + /** + * 寮鍏峰畬绋庤瘉鏄 + * + * @param requestParam + * @return + */ + public WithheldVoucherResponse getWithheldVoucher(Map requestParam) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; + String requestId = request(url, requestParam); + + url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER_FEEDBACK; + Map responseParam = new HashMap<>(1); + responseParam.put("requestId", requestId); + return response(url, responseParam, WithheldVoucherResponse.class); + + } + +} diff --git a/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java b/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java new file mode 100644 index 000000000..408dec81f --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/calculate/CalculateASynIndividualIncomeTaxRequest.java @@ -0,0 +1,1442 @@ +package com.engine.salary.remote.tax.request.calculate; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class CalculateASynIndividualIncomeTaxRequest { + /** + * 澶栭儴涓氬姟缂栧彿 蹇呭~锛氭槸 澶栭儴涓氬姟缂栧彿锛屽敮涓锛屽箓绛夐渶瑕侊紝鏈闀64浣,寤鸿浣跨敤UUID,寤鸿浣跨敤UUID + */ + private String bizNo; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇暶熺鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氬惁 0琛ㄧず鐢虫姤瀵嗙爜锛2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵,1琛ㄧず鍔犲瘑 + */ + private String jmsmmm; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑鐢虫姤瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmmc; + /** + * 鎵灞炴湡 蹇呭~锛氭槸 鏍煎紡YYYYMM骞存湀 + */ + private String skssq; + /** + * 澶氭壒娆$畻绋庯紝鏄惁鏍¢獙浜哄憳涔嬪墠鎵规绠楃◣鐘舵 蹇呭~锛氬惁 搴旂敤鍦烘櫙: 濡傛灉濉啓鈥滄槸鈥濓紝鍦ㄥ鎵规绠楃◣涓細鏍¢獙褰撳墠鎵规涓殑浜哄憳鍦ㄤ箣鍓嶆壒娆$畻绋庝腑鏄惁瀛樺湪鏈嬁鍙嶉鐨勮姹傦紝濡傛灉瀛樺湪灏遍樆鏂綋鍓嶆壒娆$畻绋庛 + * 濡傛灉涓嶅~鍐欐垨鑰呭~鍐欌滃惁鈥濓紝涓嶆牎楠岃閫昏緫銆 + */ + private String sfjyrysszt; + /** + * 缁煎悎鎵寰 蹇呭~锛氭槸 瑙佺患鍚堟墍寰 + */ + private zhsd zhsd; +// /** +// * 鍒嗙被鎵寰 蹇呭~锛氭槸 瑙佸垎绫绘墍寰 +// */ +// private 瀵硅薄 flsd; +// /** +// * 闈炲眳姘戞墍寰 蹇呭~锛氭槸 瑙侀潪灞呮皯鎵寰 +// */ +// private 瀵硅薄 fjmsd; +// /** +// * 闄愬敭鑲℃墍寰 蹇呭~锛氭槸 瑙侀檺鍞偂鎵寰 +// */ +// private 瀵硅薄 xsgsd; + + @Data + public static class zhsd { + /** + * 鏄惁绂荤嚎绠楄柂 蹇呭~锛氬惁 鍙夈愭槸銆戞垨銆愬惁銆戯紝闈炲繀浼狅紝涓嶄紶鐨勬儏鍐典笅榛樿涓恒愬惁銆戯紝褰撲负绂荤嚎绠楄柂鏃讹紝涓撻」涓嬭浇銆佷汉鍛樻姤閫侀兘澶辨晥锛 + * sfrysb=1 鏃朵篃涓嶄細鎶ラ佷汉鍛橈紝 + * zcgzxjsfcrlj=0鏃朵細缁熶竴浣跨敤鏈湴鏁版嵁杩涜璁$畻 + */ + private String sflxsx; + /** + * 鍑忓厤鏂瑰紡 蹇呭~锛氬惁 1:"姣斾緥鍑忓厤鏂瑰紡" 2:"闄愰鍑忓厤鏂瑰紡" 鍏朵粬鏂瑰紡涓嶄紶鍊硷紝鎸夌収褰撳湴鏀跨瓥閫夋嫨鍑忓厤鏂瑰紡 + */ + private String jmfs; + /** + * 鍑忓厤姣斾緥 蹇呭~锛氭潯浠跺繀濉 jmfs涓1鏃跺繀濉紝绀轰緥锛10% 浼0.1 + */ + private BigDecimal jmbl; + /** + * 鍑忓厤闄愰 蹇呭~锛氭潯浠跺繀濉 jmfs涓2鏃跺繀濉紝鍑忓厤闄愰澶т簬0 + */ + private BigDecimal jmxe; + /** + * 姝e父宸ヨ祫钖噾瀵硅薄 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-姝e父宸ヨ祫钖噾瀵硅薄 + */ + private zcgzxj zcgzxj; + /** + * 鍏ㄥ勾涓娆℃у閲戞敹鍏ュ垪琛 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鍏ㄥ勾涓娆℃у閲戞敹鍏 + */ + private List qnycxjjsslb; + /** + * 绋块叕鎵寰楀垪琛 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-绋块叕鎵寰 + */ + private List gcsdlb; + /** + * 涓鑸姵鍔℃姤閰墍寰楀垪琛 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-涓鑸姵鍔℃姤閰墍寰 + */ + private List lwbclb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾 + */ + private List jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-淇濋櫓钀ラ攢鍛樿柂閲戝璞 + */ + private bxyxy bxyxy; + /** + * 璇佸埜缁忕邯浜 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-璇佸埜缁忕邯浜鸿柂閲戝璞 + */ + private zqjjr zqjjr; + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰 + */ + private qtlxlwbc qtlxlwbc; + /** + * 鐗硅鏉冩墍寰 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鐗硅鏉冩墍寰 + */ + private List txq; + /** + * 涓汉鑲℃潈婵鍔辨墍寰 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-涓汉鑲℃潈婵鍔辨墍寰 + */ + private List grgqjl; + /** + * 浼佷笟骞撮噾 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-浼佷笟骞撮噾 + */ + private List qynj; + /** + * 鍐呴涓娆℃цˉ鍋块噾 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鍐呴涓娆℃цˉ鍋块噾 + */ + private List ntycxbcjlb; + /** + * 鍏朵粬闈炶繛缁姵鍔℃姤閰 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鍏朵粬闈炶繛缁姵鍔℃姤閰 + */ + private List qtflxlwbc; +// /** +// * 鎻愬墠閫浼戜竴娆℃цˉ璐 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-鎻愬墠閫浼戜竴娆℃цˉ璐 +// */ +// private List tqtxycxbt; +// /** +// * 澶紒璐熻矗浜虹哗鏁堣柂閲戝欢鏈熷厬鐜版敹鍏ュ拰浠绘湡濂栧姳 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-澶紒璐熻矗浜虹哗鏁堣柂閲戝欢鏈熷厬鐜版敹鍏ュ拰浠绘湡濂栧姳 +// */ +// private 鏁扮粍 yqfzrsrhjl; +// /** +// * 娉曞緥鎻村姪鍔冲姟鎶ラ叕鎵寰楀垪琛 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-娉曞緥鎻村姪鍔冲姟鎶ラ叕鎵寰楀垪琛 +// */ +// private 鏁扮粍 flyzlwbclb; +// /** +// * 闈炲眳姘戞墍寰 蹇呭~锛氭槸 瑙侀潪灞呮皯鎵寰 +// */ +// private 瀵硅薄 fjmsd; +// /** +// * 闄愬敭鑲℃墍寰 蹇呭~锛氭槸 瑙侀檺鍞偂鎵寰 +// */ +// private 瀵硅薄 xsgsd; + + @Data + public static class ry { + /** + * 濮撳悕 蹇呭~锛氭槸 绾崇◣浜哄鍚 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 璇佷欢鍙风爜闇瑕佸ぇ鍐 + */ + private String zzhm; + /** + * 鍏朵粬璇佷欢绫诲瀷 蹇呭~锛氭潯浠跺繀濉 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String qtzzlx; + /** + * 鍏朵粬璇佷欢鍙风爜 蹇呭~锛氭潯浠跺繀濉 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String qtzzhm; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氬惁 閮ㄩ棬缂栧彿 + */ + private String bmbh; + /** + * 浜哄憳鎶ラ佺瓥鐣 蹇呭~锛氬惁 1. 榛樿閫昏緫鈥滄槸鈥濓紝浠呭綋淇℃伅鍙樺寲鏃舵墠浼氭姤閫佷俊鎭埌绋庡眬 2. 鑻ヤ紒涓氭兂瑕佹敮鎸佷汉鍛樹俊鎭笉鍙樺寲鐨勬儏鍐典笅锛屼篃鑳介噸鏂板彂璧锋姤閫侊紝瑕嗙洊灞绔俊鎭紝鍙慨鏀逛紶鍙備负鈥滃惁鈥 + */ + private String rybscl; + /** + * 宸ュ彿 蹇呭~锛氬惁 + */ + private String gh; + /** + * 鎵灞炴湡 蹇呭~锛氬惁 鏍煎紡YYYYMM骞存湀 + */ + private String skssq; + /** + * 鐢佃瘽鍙风爜 蹇呭~锛氭槸 11浣嶄腑鍥藉ぇ闄嗘墜鏈哄彿鐮 + */ + private String lxdh; + /** + * 浜哄憳鐘舵 蹇呭~锛氭槸 榛樿涓烘甯革紝鍙夋嫨姝e父/闈炴甯 + */ + private String nsrzt; + /** + * 浠昏亴鍙楅泧绫诲瀷 蹇呭~锛氭槸 鍙夋嫨闆囧憳銆佷繚闄╄惀閿鍛樸佽瘉鍒哥粡绾汉銆佸叾浠栥佸疄涔犲鐢燂紙鍏ㄦ棩鍒跺鍘嗘暀鑲诧級 + */ + private String sfgy; + /** + * 鍏ヨ亴骞村害灏变笟鎯呭舰 蹇呭~锛氬惁 褰撻泧鍛樸佷繚闄╄惀閿鍛樸佽瘉鍒哥粡绾汉鏃跺彲閫夋嫨锛氬綋骞撮娆″叆鑱屽鐢熴佸綋骞撮娆″叆鑱屽叾浠栦汉鍛樸傚叾浠栨儏鍐典笅濉啓榛樿涓虹┖ + */ + private String rzndjyqk; + /** + * 鍙楅泧鏃ユ湡 蹇呭~锛氭潯浠跺繀濉 鏍煎紡:YYYY-MM-DD,涓嶈兘澶т簬褰撳墠鏃堕棿 浠昏亴鍙楅泧绫诲瀷閫夋嫨:闆囧憳銆佷繚闄╄惀閿鍛樸佽瘉鍒哥粡绾汉銆佸疄涔犲鐢燂紙鍏ㄦ棩鍒跺鍘嗘暀鑲诧級鏃跺繀褰 + */ + private String rzsgrq; + /** + * 鎬у埆 蹇呭~锛氭槸 鐢/濂 + */ + private String xb; + /** + * 鍑虹敓鏃ユ湡 蹇呭~锛氭槸 YYYY-MM-DD 闇瑕佸拰韬唤璇佷笂淇濇寔涓鑷 + */ + private String csny; + /** + * 鍥界睄 蹇呭~锛氭槸 瑙佸浗绫嶅瓧鍏 + */ + private String gj; + /** + * 浜哄憳鍦板尯 蹇呭~锛氭槸 澧冨唴/澧冨 + */ + private String rydq; + /** + * 绂昏亴鏃ユ湡 蹇呭~锛氬惁 鏍煎紡锛歒YYY-MM-DD,涓嶈兘澶т簬褰撳墠鏃堕棿锛岀鑱屾棩鏈熶笉鑳藉ぇ浜庡叆鑱屾棩鏈 浜哄憳鐘舵侀潪姝e父鏃跺繀濉 娉細娓呯┖绂昏亴鏃堕棿浼犲叆绌哄瓧绗︿覆锛屼笉鑳芥槸null + */ + private String lzrq; + /** + * 涓汉鎶曡祫鎬婚 蹇呭~锛氭潯浠跺繀濉 褰撲负鑲′笢鎶曡祫鑰呮椂蹇呭~锛屾姇璧勯澶т簬0 + */ + private BigDecimal grgbze; + /** + * 涓汉鎶曡祫姣斾緥 蹇呭~锛氬惁 鎶曡祫棰濆~鍐欐椂蹇呭~锛岃寖鍥翠负0~100锛屼笉鍖呭惈0 + */ + private BigDecimal grgbbl; + /** + * 鏄惁娈嬬柧 蹇呭~锛氬惁 榛樿涓哄惁锛屽彲閫夋嫨鏄/鍚 + */ + private String sfcj; + /** + * 鏄惁鐑堝睘 蹇呭~锛氬惁 榛樿涓哄惁锛屽彲閫夋嫨鏄/鍚 + */ + private String sfls; + /** + * 鏄惁瀛よ 蹇呭~锛氬惁 榛樿涓哄惁锛屽彲閫夋嫨鏄/鍚 + */ + private String sfgl; + /** + * 鏄惁鎵i櫎鍑忛櫎璐圭敤 蹇呭~锛氬惁 榛樿涓烘槸锛屽彲閫夋嫨鏄/鍚︼紝浼爊ull鎴栬呯┖鍊奸兘浼氶粯璁や负鏄紝褰撳~浜嗗惁鍚, 濡傛灉鍚庣画杩橀渶瑕佷繚鎸佸惁鐨勭姸鎬佽繕闇浼犲惁锛屼笉濉垯浼氶粯璁や负鏄 + */ + private String sfzdw; + /** + * 娈嬬柧璇佸彿 蹇呭~锛氭潯浠跺繀濉 褰撲负娈嬬柧鏃跺繀濉 + */ + private String cjzh; + /** + * 鐑堝睘璇佸彿 蹇呭~锛氭潯浠跺繀濉 褰撲负鐑堝睘鏃跺繀濉 + */ + private String lszh; + /** + * 閭 蹇呭~锛氬惁 + */ + private String dzyx; + /** + * 瀛﹀巻 蹇呭~锛氬惁 + * 榛樿涓虹┖锛屽ぇ瀛︽湰绉戜互涓 澶у鏈 鐮旂┒鐢 + */ + private String xl; + /** + * 鑱屽姟 蹇呭~锛氬惁 楂樺眰 鏅 + */ + private String zw; + /** + * 寮鎴烽摱琛 蹇呭~锛氬惁 瑙侀摱琛屽瓧鍏 + */ + private String khyh; + /** + * 寮鎴烽摱琛岀渷浠 蹇呭~锛氬惁 瑙佸紑鎴烽摱琛岀渷浠藉瓧鍏 + */ + private String khyhsfmz; + /** + * 閾惰璐﹀彿 蹇呭~锛氬惁 濡傛灉khyh锛宬hyhsfmz,yhzh 鏈変竴椤归夋嫨濉啓浜嗛偅涔堝叾浠栦袱椤逛篃闇瑕佸~鍐 + */ + private String yhzh; + /** + * 灞呬綇鐪佷唤 蹇呭~锛氬惁 涓枃锛屼緥濡傛禉姹熺渷 + */ + private String lxdz_sheng; + /** + * 灞呬綇鍩庡競 蹇呭~锛氬惁 涓枃锛屼緥濡傛澀宸炲競 + */ + private String lxdz_shi; + /** + * 灞呬綇鍖哄幙 蹇呭~锛氬惁 涓枃锛屼緥濡傛花姹熷尯 + */ + private String lxdz_qx; + /** + * 灞呬綇琛楅亾 蹇呭~锛氬惁 涓枃锛屾郸娌胯閬 + */ + private String lxdz_jd; + /** + * 灞呬綇璇︾粏鍦板潃 蹇呭~锛氬惁 + */ + private String lxdz; + /** + * 鎴风睄鐪佷唤 蹇呭~锛氬惁 涓枃锛屼緥濡傛禉姹熺渷 + */ + private String hjszd_sheng; + /** + * 鎴风睄鍩庡競 蹇呭~锛氬惁 涓枃锛屼緥濡傛澀宸炲競 + */ + private String hjszd_shi; + /** + * 鎴风睄鍖哄幙 蹇呭~锛氬惁 涓枃锛屼緥濡傛花姹熷尯 + */ + private String hjszd_qx; + /** + * 鎴风睄琛楅亾 蹇呭~锛氬惁 涓枃锛屾郸娌胯閬 + */ + private String hjszd_jd; + /** + * 鎴风睄璇︾粏鍦板潃 蹇呭~锛氬惁 + */ + private String hjszd_xxdz; + /** + * 澶囨敞 蹇呭~锛氬惁 + */ + private String bz; + /** + * 鍑虹敓鍦 蹇呭~锛氭潯浠跺繀濉 澶栫睄浜哄憳蹇呭~锛屽~鍐欏嚭鐢熷湴鍥藉锛堝湴鍖猴級锛岃鍥界睄瀛楀吀 + */ + private String csd; + /** + * 娑夌◣浜嬬敱 蹇呭~锛氭潯浠跺繀濉 澶栫睄浜哄憳蹇呭~锛屽涓椂鐢ㄩ楀彿鍒嗗壊; + * 浠昏亴鍙楅泧 鎻愪緵涓存椂鍔冲姟 杞璐骇 浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔 鍏朵粬 + */ + private String sssx; + /** + * 棣栨鍏ュ鏃堕棿 蹇呭~锛氭潯浠跺繀濉 璇佷欢绫诲瀷涓烘腐婢冲眳姘戞潵寰鍐呭湴閫氳璇併佹腐婢冲眳姘戝眳浣忚瘉銆佸彴婀惧眳姘戞潵寰澶ч檰閫氳璇併佸彴婀惧眳姘戝眳浣忚瘉銆佸鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丄銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丅銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丆鏃讹紝涓斾换鑱屽彈闆囩被鍨嬮夋嫨闆囧憳鏃跺繀濉紝鏍煎紡YYYY-MM-DD + */ + private String scrjsj; + /** + * 棰勮绂诲鏃堕棿 蹇呭~锛氭潯浠跺繀濉 璇佷欢绫诲瀷涓烘腐婢冲眳姘戞潵寰鍐呭湴閫氳璇併佹腐婢冲眳姘戝眳浣忚瘉銆佸彴婀惧眳姘戞潵寰澶ч檰閫氳璇併佸彴婀惧眳姘戝眳浣忚瘉銆佸鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丄銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丅銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丆鏃讹紝涓斾换鑱屽彈闆囩被鍨嬮夋嫨闆囧憳鏃跺繀濉紝鏍煎紡YYYY-MM-DD + */ + private String yjljsj; + /** + * 鑱旂郴鍦扮渷浠 蹇呭~锛氬惁 + */ + private String wjrlxdz_sheng; + /** + * 鑱旂郴鍦板煄甯 蹇呭~锛氬惁 + */ + private String wjrlxdz_shi; + /** + * 鑱旂郴鍦板尯鍘 蹇呭~锛氬惁 + */ + private String wjrlxdz_qx; + /** + * 鑱旂郴鍦拌閬 蹇呭~锛氬惁 + */ + private String wjrlxdz_jd; + /** + * 鑱旂郴鍦拌缁嗗湴鍧 蹇呭~锛氬惁 + */ + private String wjrlxdz_xxdz; + /** + * 涓枃鍚 蹇呭~锛氬惁 璇佷欢绫诲瀷涓哄鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉宸ヤ綔璁稿彲璇侊紙A绫伙級銆佸鍥戒汉宸ヤ綔璁稿彲璇侊紙B绫伙級銆佸鍥戒汉宸ヤ綔璁稿彲璇侊紙C绫伙級鏃朵笉鍙~鍐欙紝鍏朵粬璇佷欢绫诲瀷鍙~鍐欍傚鏋滄湁濉啓蹇呴』涓轰腑鏂囥 + */ + private String xmzw; + + } + + @Data + public static class zcgzxj { + /** + * 姝e父宸ヨ祫钖噾鍒楄〃 蹇呭~锛氭槸 鍙傝冪患鍚堟墍寰-姝e父宸ヨ祫钖噾 + */ + private List zcgzxjlb; + /** + * 涓婃湀姝e父宸ヨ祫钖噾鍒楄〃 蹇呭~锛氬惁 鍙傝冪患鍚堟墍寰-姝e父宸ヨ祫钖噾 + * 1銆佽嫢褰撴湀宸茬粡浠f姤瀹屾瘯锛堝綋鏈堜唬鎶ヤ笂鏈堟墍寰楋級锛岄偅涔堣兘浠庡鎴风涓嬪彂绱鍒颁笂鏈堢殑鎵寰楁暟鎹紝姝ゆ椂浼犵粰瀹㈡埛绔殑鎵寰楁湀浠戒负褰撳墠鏈堜唤 + * 2銆佽嫢褰撴湀鏈唬鎶ュ畬姣曪紙褰撴湀浠f姤涓婃湀鎵寰楋級锛岄偅涔堣兘浠庡鎴风涓嬪彂绱鍒颁笂鏈-1鐨勬墍灞炴暟鎹紝姝ゆ椂浼犵粰瀹㈡埛绔殑鎵寰楁湀浠戒负褰撴湀鏈堜唤-1 + * 3銆佷笂鏈堟甯稿伐璧勮柂閲戝垪琛ㄤ笌鏈湀姝e父宸ヨ祫钖噾鍒楄〃闇瑕佷竴涓瀵瑰簲 + */ + private List syzcgzxjlb; + /** + * 浜哄憳鍒楄〃 蹇呭~锛氭槸 瑙佷汉鍛樺垪琛 + */ + private List rylb; + /** + * 姝e父宸ヨ祫钖噾鏄惁闇瑕佷笅杞戒笓椤 蹇呭~锛氭槸 + * 1:闇瑕佷笓椤规槑缁嗚繘琛屼笓椤硅绠 + * 0:涓嶉渶瑕佷笓椤规槑缁嗚繘琛屼笓椤硅绠 + * 瑙侀檮褰曚笓椤逛紶鍊肩瓥鐣 + */ + private String zcgzxjsfxyzx; + /** + * 鏄惁宸蹭唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲 蹇呭~锛氬惁 + * 浠呭闇瑕佽绠楁甯稿伐璧勬墍寰楃敓鏁堬紝锛堥粯璁や负1锛 + * 1: 宸蹭唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲 + * 0: 鏈唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲戯紙涓や釜鏈堢畻绋庝紶鍏0锛 + */ + private String syysfsyzcgzxj; + /** + * 鏀寔浼犲叆涓撻」 蹇呭~锛氬惁 + * 浠呭湪syysfsyzcgzxj=0鏃跺欑敓鏁堬紝榛樿鍊=0 + * 0: 涓嶆敮鎸佺敤鎴蜂紶涓撻」锛屼娇鐢ㄥ疄鏃朵笅杞界殑涓撻」锛岄粯璁ゅ + * 1: 鏀寔浼犱笂鏈堝綋鏈堢殑涓撻」 + * 2锛氭敮鎸佷紶鎴鑷充笂鏈堜负姝㈢殑绱涓撻」 + */ + private String zcgzxjsfcrzx; + /** + * 褰撳墠绠楃◣鏈堟甯稿伐璧勮柂閲戞槸鍚︿紶鍏ヤ笓椤圭疮璁 蹇呭~锛氬惁 + * 浠呭褰撳墠绠楃◣鏈堟暟鎹敓鏁堬紝榛樿涓0 + * 锛堝鏋滄槸绂荤嚎绠楄柂锛寊cgzxjsfcrlj=1鏃朵細寮哄埗浣跨敤鏈湴鏁版嵁杩涜璁$畻锛 + * 0锛氫娇鐢ㄤ笅杞借绠椾笓椤圭疮璁 + * 1锛氫娇鐢ㄤ紶鍏ョ殑涓撻」绱鍊 + * 2: 涓嶅疄鏃朵笅杞戒笓椤癸紝浣跨敤鏈湴鏁版嵁杩涜璁$畻 + * 瑙侀檮褰曚笓椤逛紶鍊肩瓥鐣 + */ + private String zcgzxjsfcrlj; + + /** + * 鎵规鍙 蹇呭~锛氬惁 + * 榛樿涓嶅~涓篘ull,琛ㄧず涓鏈堜竴娆$畻钖紱 + * 鍏朵粬鏁存暟鍊硷紙濡1銆2銆3绛夛級涓轰竴鏈堝娆″彂钖畻钖殑鎵规 + */ + private Integer pch; + /** + * 鏄惁瀵煎叆涓婃湀姝e父宸ヨ祫钖噾(涓鏈堝娆″彂钖) 蹇呭~锛氬惁 + * 浠呭湪涓鏈堝娆$畻绋庡満鏅腑浣跨敤 0锛氫笉瀵煎叆涓婃湀钖噾 1锛氬鍏ヤ笂鏈堣柂璧勶紙榛樿涓1锛屽鍏ヤ笂鏈堣柂璧勶級 + */ + private String sfdrsyzcgzxj; + /** + * 鏄惁鍚屾椂浜哄憳鎶ラ 蹇呭~锛氬惁 0锛 浜哄憳涓嶆姤閫侊紱 + */ + private String sfrysb; + /** + * 骞撮噾/浣忔埧鍏Н閲戜笂闄愰夐」 蹇呭~锛氬惁 + * 1:涓嶅鐞嗭紙榛樿锛 + * 2:浣跨敤骞撮噾/鍏Н閲戜笂闄愶紙瓒呰繃涓婇檺浣跨敤涓婇檺鍊硷紝涓嶈秴杩 鍒欎娇鐢ㄥ師鏉ョ殑鍊硷級 + * 3:骞撮噾浣跨敤涓婇檺锛屽叕绉噾鎴彇瓒呬笂闄愰儴鍒嗙撼鍏ユ敹鍏ラ + * 4.骞撮噾浣跨敤涓婇檺锛屾埅鍙栧叕绉噾瓒呰繃涓婇檺鐨勯儴鍒嗗噺灏戞敹鍏ラ + */ + private String njzfgjjsxxx; + /** + * 浼佷笟涓嬭浇寰鏈熸爣蹇 蹇呭~锛氬惁 + * 1:鎸夌収浼佷笟缁村害涓嬭浇锛堥粯璁わ級 0:鎸夌収閮ㄩ棬缁村害涓嬭浇(浼佷笟鍦ㄥ眬绔妗堝垎閮ㄩ棬,闇瑕佷紶鍏0) + */ + private String qyxzwqbz; + + /** + * 澶氭湀绠楃◣锛屾槸鍚︿娇鐢ㄤ笂鏈堜紶鍏ョ殑搴旇ˉ閫绋庨 蹇呭~锛氬惁 + * 1. 涓嶄紶鎴栦紶绌(榛樿涓哄惁)鎴栬呬紶鈥滃惁鈥,涓庡綋鍓嶅鏈堢畻绋庨昏緫涓鑷淬2. 浼犫滄槸鈥,澶氭湀绠楃◣鏃跺彇涓婃湀钖祫鏁版嵁浼犲叆鐨勫簲琛ラ绋庨鍙備笌绠楃◣銆 + */ + private String sfsysyybtse; + + /** + * 涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 + * 0: 涓嶄紶鎴栦紶绌烘垨鑰呬紶鈥0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String gryljcl; + + /** + * 涓婃湀涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 + * 涓嶄紶鎴栦紶绌鸿祴鍊奸粯璁ゅ硷紝榛樿鍊间负1 + * 0:浼犫0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String sygryljcl; + + @Data + public static class zcgz { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭潯浠跺繀濉 褰搒ygs涓虹┖鎴栬呯瓑浜庡叕寮5鏃跺繀濉 + */ + private BigDecimal sre; + /** + * 閫傜敤鍏紡 蹇呭~锛氬惁 瑙併婂伐璧勬敹鍏ュ叕寮忓瓧鍏搞 + * 閲嶇偣璇存槑锛氫竴鑸甯稿伐璧勮柂閲戞墍寰椾笉鐢ㄤ紶閫傜敤鍏紡锛屽彧闇瑕佷紶鍏ユ敹鍏ラ锛屽氨鍙互杩涜璁$畻锛涗篃鍙互浼犻傜敤鍏紡锛岀郴缁熷氨浼氭寜鐓ч傜敤鍏紡杩涜璁$畻 褰撹瘉浠剁被鍨嬩负灞呮皯韬唤璇佹椂锛岄傜敤鍏紡榛樿涓虹┖ + */ + private String sygs; + /** + * 澧冨唴宸ヤ綔澶╂暟 蹇呭~锛氭潯浠跺繀濉 姝e父宸ヨ祫钖噾浼犱簡閫傜敤鍏紡鎵嶉渶瑕佹潯浠跺繀褰曘傚綋sygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉,鍙互涓哄皬鏁 灏忔暟浣0.5澶 涓嶈兘涓や綅灏忔暟锛屽彧鑳芥槸1鎴栬1.0涓嶈兘1.00 + */ + private BigDecimal jngzts; + /** + * 澧冨宸ヤ綔澶╂暟 蹇呭~锛氭潯浠跺繀濉 姝e父宸ヨ祫钖噾浼犱簡閫傜敤鍏紡鎵嶉渶瑕佹潯浠跺繀褰曘傚綋sygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉,鍙互涓哄皬鏁 灏忔暟浣0.5澶 涓嶈兘涓や綅灏忔暟锛屽彧鑳芥槸1鎴栬1.0涓嶈兘1.00 + */ + private BigDecimal jwgzts; + /** + * 澧冨唴鏀粯 蹇呭~锛氭潯浠跺繀濉 姝e父宸ヨ祫钖噾浼犱簡閫傜敤鍏紡鎵嶉渶瑕佹潯浠跺繀褰曘傚綋sygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 + */ + private BigDecimal jnzf; + /** + * 澧冨鏀粯 蹇呭~锛氭潯浠跺繀濉 姝e父宸ヨ祫钖噾浼犱簡閫傜敤鍏紡鎵嶉渶瑕佹潯浠跺繀褰曘傚綋sygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 + */ + private BigDecimal jwzf; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍩烘湰鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jbylaobxf; + /** + * 鍩烘湰鍖荤枟淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jbylbxf; + /** + * 澶变笟淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal sybxf; + /** + * 浣忔埧鍏Н閲 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal zfgjj; + /** + * 骞撮噾 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal nj; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩紝濉啓鍏朵粬锛屼竴瀹 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉 + */ + private String bz; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0锛屾寜鐓х◣娉曚互鍙婄浉鍏虫硶瑙勩佹斂绛栬瀹氾紝鍙互鍦ㄧ◣鍓嶆墸闄ょ殑鎹愯禒棰 + */ + private BigDecimal zykcjze; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 姝e父宸ヨ祫钖噾锛 + */ + private String sdxm; + /** + * 瀛愬コ鏁欒偛鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal znjyzc; + /** + * 缁х画鏁欒偛鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal jxjyzc; + /** + * 浣忔埧绉熼噾鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal zfzjzc; + /** + * 鎴垮眿璐锋鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal zfdklxzc; + /** + * 璧″吇鑰佷汉鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal sylrzc; + /** + * 3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=1鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal yyezhzc; + /** + * 绱瀛愬コ鏁欒偛鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljznjyzc; + /** + * 绱缁х画鏁欒偛鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljjxjyzc; + /** + * 绱浣忔埧绉熼噾鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljzfzjzc; + /** + * 绱鎴垮眿璐锋鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljzfdklxzc; + /** + * 绱璧″吇鑰佷汉鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljsylrzc; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛氭潯浠跺繀濉 鍦▃cgzxjsfcrzx=2鏃跺繀浼狅紝榛樿涓嶄紶 + */ + private BigDecimal ljyyezhzc; + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛氬惁 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 + */ + private BigDecimal ljgrylj; + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛氬惁 + * 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 鍦╨jgrylj浼犲兼椂鏍¢獙鏄惁鍚堟硶 ljgrylj浼0鏃朵笉鏍¢獙 + */ + private String ljgryljjym; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氬惁 閰嶅悎sfsysyybtse瀛楁浣跨敤 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class qnycxjjss { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 鎵规鍙 蹇呭~锛氬惁 榛樿涓嶅~涓篘ull,琛ㄧず涓鏈堜竴娆$畻钖紱 鍏朵粬鏁存暟鍊硷紙濡1銆2銆3绛夛級涓轰竴鏈堝娆″彂钖畻钖殑鎵规 + */ + private Integer pch; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal zykcjze; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 澶囨敞 蹇呭~锛氥鏉′欢蹇呭~ 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氬叏骞翠竴娆℃у閲戞敹鍏ワ紱 + */ + private String sdxm; + } + + @Data + public static class gcsd { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 澶囨敞 蹇呭~锛氥鏉′欢蹇呭~ 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氱ǹ閰墍寰楋紱 + */ + private String sdxm; + } + + @Data + public static class lwbc { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 褰撴湡鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 + */ + private BigDecimal yxkcsf; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氫竴鑸姵鍔℃姤閰墍寰楋紱 + */ + private String sdxm; + } + + @Data + public static class jcldhtycxbcj { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氥鏉′欢蹇呭~ 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal zykcjze; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氳В闄ゅ姵鍔ㄥ悎鍚屼竴娆℃цˉ鍋块噾锛 + */ + private String sdxm; + + } + + @Data + public static class bxyxy { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭潯浠跺繀濉 褰搒ygs涓虹┖鎴栬呯瓑浜庡叕寮5鏃跺繀濉 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氭槸 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氭槸 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氭槸 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0锛屾寜鐓х◣娉曚互鍙婄浉鍏虫硶瑙勩佹斂绛栬瀹氾紝鍙互鍦ㄧ◣鍓嶆墸闄ょ殑鎹愯禒棰 + */ + private BigDecimal zykcjze; + /** + * 鍏朵粬 蹇呭~锛氭槸 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑忓厤绋庨 蹇呭~锛氭槸 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛氬惁 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 + */ + private BigDecimal ljgrylj; + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛氬惁 + * 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 鍦╨jgrylj浼犲兼椂鏍¢獙鏄惁鍚堟硶 ljgrylj浼0鏃朵笉鏍¢獙 + */ + private String ljgryljjym; + + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 淇濋櫓钀ラ攢鍛樹剑閲戞敹鍏ワ紱 + */ + private String sdxm; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 + */ + private BigDecimal yxkcsf; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氬惁 閰嶅悎sfsysyybtse瀛楁浣跨敤 + */ + private BigDecimal ybtse; + } + + @Data + public static class zqjjr { + /** + * 璇佸埜缁忕邯浜烘墍寰楄柂閲戝垪琛 蹇呭~锛歯ull 鍙傝冪患鍚堟墍寰-璇佸埜缁忕邯浜哄垪琛 + */ + private List zqjjrsdlb; + /** + * 涓婃湀璇佸埜缁忕邯浜哄垪琛 蹇呭~锛歯ull 鍙傝冪患鍚堟墍寰-璇佸埜缁忕邯浜哄垪琛 + */ + private List syzqjjrlb; + /** + * 浜哄憳鍒楄〃 蹇呭~锛歯ull 瑙佷紒涓氫汉鍛樺垪琛 + */ + private List rylb; + /** + * 鎵规鍙 蹇呭~锛氬惁 + * 榛樿涓嶅~涓篘ull,琛ㄧず涓鏈堜竴娆$畻钖紱 + * 鍏朵粬鏁存暟鍊硷紙濡1銆2銆3绛夛級涓轰竴鏈堝娆″彂钖畻钖殑鎵规 + */ + private Integer pch; + /** + * 鏄惁瀵煎叆涓婃湀姝e父宸ヨ祫钖噾(涓鏈堝娆″彂钖) 蹇呭~锛氬惁 + * 浠呭湪涓鏈堝娆$畻绋庡満鏅腑浣跨敤 + * 0锛氫笉瀵煎叆涓婃湀钖噾 1锛氬鍏ヤ笂鏈堣柂璧 锛堥粯璁や负1锛屽鍏ヤ笂鏈堣柂璧勶級 + */ + private String sfdrsyzcgzxj; + /** + * 鏄惁鍚屾椂浜哄憳鎶ラ 蹇呭~锛氬惁 0锛 浜哄憳涓嶆姤閫侊紱 1锛 浜哄憳鎶ラ 锛堥粯璁や负1锛岀畻绋庡墠鍚屾椂澶勭悊浜哄憳鎶ラ侊紝绂荤嚎绠楄柂妯″紡鏃讹紝涓嶄細杩涜浜哄憳鎶ラ侊級 + */ + private String sfrysb; + /** + * 鏄惁宸蹭唬鎶ヤ笂鏈堣柂閲 蹇呭~锛氬惁 锛堥粯璁や负1锛 1: 宸蹭唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲 0: 鏈唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲戯紙涓や釜鏈堢畻绋庝紶鍏0锛 + */ + private String syysfsyzcgzxj; + /** + * 浼佷笟涓嬭浇寰鏈熸爣蹇 蹇呭~锛氬惁 1:鎸夌収浼佷笟缁村害涓嬭浇锛堥粯璁わ級 0:鎸夌収閮ㄩ棬缁村害涓嬭浇(浼佷笟鍦ㄥ眬绔妗堝垎閮ㄩ棬,闇瑕佷紶鍏0) + */ + private String qyxzwqbz; + /** + * 澶氭湀绠楃◣锛屾槸鍚︿娇鐢ㄤ笂鏈堜紶鍏ョ殑搴旇ˉ閫绋庨 蹇呭~锛氬惁 + * 1. 涓嶄紶鎴栦紶绌(榛樿涓哄惁)鎴栬呬紶鈥滃惁鈥,涓庡綋鍓嶅鏈堢畻绋庨昏緫涓鑷淬 2. 浼犫滄槸鈥,澶氭湀绠楃◣鏃跺彇涓婃湀钖祫鏁版嵁浼犲叆鐨勫簲琛ラ绋庨鍙備笌绠楃◣銆 + */ + private String sfsysyybtse; + /** + * 涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 + * 0: 涓嶄紶鎴栦紶绌烘垨鑰呬紶鈥0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String gryljcl; + /** + * 涓婃湀涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 + * 涓嶄紶鎴栦紶绌鸿祴鍊奸粯璁ゅ硷紝榛樿鍊间负1 0:浼犫0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String sygryljcl; + + + @Data + public static class zqjjrsd { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭潯浠跺繀濉 褰搒ygs涓虹┖鎴栬呯瓑浜庡叕寮5鏃跺繀濉 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0锛屾寜鐓х◣娉曚互鍙婄浉鍏虫硶瑙勩佹斂绛栬瀹氾紝鍙互鍦ㄧ◣鍓嶆墸闄ょ殑鎹愯禒棰 + */ + private BigDecimal zykcjze; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛氬惁 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 + */ + private BigDecimal ljgrylj; + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛氬惁 + * 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 鍦╨jgrylj浼犲兼椂鏍¢獙鏄惁鍚堟硶 ljgrylj浼0鏃朵笉鏍¢獙 + */ + private String ljgryljjym; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 璇佸埜缁忕邯浜轰剑閲戞敹鍏ワ紱 + */ + private String sdxm; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 + */ + private BigDecimal yxkcsf; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氬惁 閰嶅悎sfsysyybtse瀛楁浣跨敤 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class qtlxlwbc { + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰楀垪琛 蹇呭~锛歯ull 鍙傝冪患鍚堟墍寰-鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰楀垪琛 + */ + private List qtlxlwbclb; + /** + * 涓婃湀鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰楀垪琛 蹇呭~锛歯ull 鍙傝冪患鍚堟墍寰-鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰楀垪琛 + */ + private List syqtlxlwbclb; + /** + * 浜哄憳鍒楄〃 蹇呭~锛歯ull 瑙佷紒涓氫汉鍛樺垪琛 + */ + private List rylb; + /** + * 鏄惁鍚屾椂浜哄憳鎶ラ 蹇呭~锛氬惁 0锛 浜哄憳涓嶆姤閫侊紱1锛 浜哄憳鎶ラ 榛樿涓1锛岀畻绋庡墠鍚屾椂澶勭悊浜哄憳鎶ラ侊紝绂荤嚎绠楄柂妯″紡鏃讹紝涓嶄細杩涜浜哄憳鎶ラ侊級 + */ + private String sfrysb; + /** + * 鏄惁宸蹭唬鎶ヤ笂钖噾 蹇呭~锛氬惁 锛堥粯璁や负1锛 1: 宸蹭唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲 0: 鏈唬鎶ヤ笂鏈堟甯稿伐璧勮柂閲戯紙涓や釜鏈堢畻绋庯級 + */ + private String syysfsyzcgzxj; + /** + * 浼佷笟涓嬭浇寰鏈熸爣蹇 蹇呭~锛氬惁 1:鎸夌収浼佷笟缁村害涓嬭浇锛堥粯璁わ級 0:鎸夌収閮ㄩ棬缁村害涓嬭浇(浼佷笟鍦ㄥ眬绔妗堝垎閮ㄩ棬,闇瑕佷紶鍏0) + */ + private String qyxzwqbz; + /** + * 鎵规鍙 蹇呭~锛氬惁 榛樿涓嶅~涓篘ull,琛ㄧず涓鏈堜竴娆$畻钖紱 鍏朵粬鏁存暟鍊硷紙濡1銆2銆3绛夛級涓轰竴鏈堝娆″彂钖畻钖殑鎵规 + */ + private Integer pch; + /** + * 澶氭湀绠楃◣锛屾槸鍚︿娇鐢ㄤ笂鏈堜紶鍏ョ殑搴旇ˉ閫绋庨 蹇呭~锛氬惁 1. 涓嶄紶鎴栦紶绌(榛樿涓哄惁)鎴栬呬紶鈥滃惁鈥,涓庡綋鍓嶅鏈堢畻绋庨昏緫涓鑷淬 2. 浼犫滄槸鈥,澶氭湀绠楃◣鏃跺彇涓婃湀钖祫鏁版嵁浼犲叆鐨勫簲琛ラ绋庨鍙備笌绠楃◣銆 + */ + private String sfsysyybtse; + /** + * 涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 0: 涓嶄紶鎴栦紶绌烘垨鑰呬紶鈥0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String gryljcl; + /** + * 涓婃湀涓汉鍏昏侀噾绛栫暐 蹇呭~锛氬惁 涓嶄紶鎴栦紶绌鸿祴鍊奸粯璁ゅ硷紝榛樿鍊间负1 0:浼犫0鈥濆垯浼氬疄鏃朵笅杞戒釜浜哄吇鑰侀噾 1: 浼犫1鈥濆垯浣跨敤鏈湴鐨勪釜浜哄吇鑰侀噾 2: 浼犫2鈥濆垯浣跨敤浼犲叆鐨勭疮璁′釜浜哄吇鑰侀噾 + */ + private String sygryljcl; + + @Data + public static class qtlxlw { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭潯浠跺繀濉 褰搒ygs涓虹┖鎴栬呯瓑浜庡叕寮5鏃跺繀濉 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0锛屾寜鐓х◣娉曚互鍙婄浉鍏虫硶瑙勩佹斂绛栬瀹氾紝鍙互鍦ㄧ◣鍓嶆墸闄ょ殑鎹愯禒棰 + */ + private BigDecimal zykcjze; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛氬惁 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 + */ + private BigDecimal ljgrylj; + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛氬惁 鍦╣ryljcl=2鏃朵紶鍊硷紝榛樿涓嶄紶 鍦╨jgrylj浼犲兼椂鏍¢獙鏄惁鍚堟硶 ljgrylj浼0鏃朵笉鏍¢獙 + */ + private String ljgryljjym; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 璇佸埜缁忕邯浜轰剑閲戞敹鍏ワ紱 + */ + private String sdxm; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 + */ + private BigDecimal yxkcsf; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氬惁 閰嶅悎sfsysyybtse瀛楁浣跨敤 + */ + private BigDecimal ybtse; + } + } + + @Data + public static class txq { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氥鏉′欢蹇呭~ 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氱壒璁告潈浣跨敤璐规墍寰 + */ + private String sdxm; + } + + @Data + public static class grgqjl { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 + */ + private BigDecimal sre; + /** + * 绱鏀跺叆棰濓紙涓嶅惈鏈湡锛 蹇呭~锛氬惁 濡傛灉涓簄ull锛屽垯浣跨敤鏈湴鐢虫姤鏁版嵁绱鑷姩濉厖 + */ + private BigDecimal ljsre; + /** + * 绱鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal zykcjze; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 閫傜敤鍏紡 蹇呭~锛氬惁 瑙併婂伐璧勬敹鍏ュ叕寮忓瓧鍏搞 + */ + private String sygs; + /** + * 绱宸叉墸缂寸◣棰 蹇呭~锛氬惁 濡傛灉涓簄ull锛屽垯浣跨敤鏈湴鐢虫姤鏁版嵁绱鑷姩濉厖 + */ + private BigDecimal ykjse; + /** + * 澧冨唴宸ヤ綔澶╂暟 蹇呭~锛氭潯浠跺繀濉 + * 褰搒ygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 涓嶈兘涓や綅灏忔暟锛屽彧鑳芥槸1鎴栬1.0涓嶈兘1.00 + */ + private BigDecimal jngzts; + /** + * 澧冨宸ヤ綔澶╂暟 蹇呭~锛氭潯浠跺繀濉 + * 褰搒ygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 + * 涓嶈兘涓や綅灏忔暟锛屽彧鑳芥槸1鎴栬1.0涓嶈兘1.00 + */ + private BigDecimal jwgzts; + /** + * 澧冨唴鏀粯 蹇呭~锛氭潯浠跺繀濉 褰搒ygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 + */ + private BigDecimal jnzf; + /** + * 澧冨鏀粯 蹇呭~锛氭潯浠跺繀濉 褰搒ygs瀛楁濉煎苟涓斾笉绛変簬鍏紡5鏃讹紝璇ュ瓧娈靛繀濉 + */ + private BigDecimal jwzf; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氫釜浜鸿偂鏉冩縺鍔辨敹鍏 + */ + private String sdxm; + } + + @Data + public static class qynj { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 宸插畬绋庣即璐归 蹇呭~锛氬惁 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal ywsjfe; + /** + * 鍏ㄩ儴缂磋垂棰 蹇呭~锛氭槸 涓嶅皬浜庣瓑浜0锛屽彇鍊煎皬鏁扮偣鍚庝袱浣嶄緥0.00 + */ + private BigDecimal qbjfe; + /** + * 鏄惁涓娆℃ч鍙 蹇呭~锛氥鏄 1:鏄 0:鍚 + */ + private String sfycxlq; + /** + * 骞撮噾棰嗗彇鏂瑰紡 蹇呭~锛氭潯浠跺繀濉 褰撯滄槸鍚︿竴娆℃ч鍙栤濅负鏄椂锛屼笉鍙~鍐欙紝褰撯滄槸鍚︿竴娆℃ч鍙栤濅负鍚︽椂锛屽彲濉啓锛 棰嗗彇鏂瑰紡鎸夆滄寜骞粹濓紝鈥滄寜瀛b濓紝鈥滄寜鏈堚 + */ + private String njlqfs; + /** + * 骞撮噾棰嗗彇鍘熷洜 蹇呭~锛氭潯浠跺繀濉 褰撯滄槸鍚︿竴娆℃ч鍙栤濅负鏄椂锛屽彲濉啓锛 褰撯滄槸鍚︿竴娆℃ч鍙栤濅负鍚︽椂锛屼笉鍙~鍐欙紱 棰嗗彇鍘熷洜锛氣滃嚭鍥藉畾灞呮垨涓汉姝讳骸鈥溿佲濆叾浠栤滐紱 + */ + private String njlqyy; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 + */ + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛氬惁 + */ + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鎹愯禒棰 蹇呭~锛氬惁 + */ + private BigDecimal zykcjze; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氬勾閲戦鍙 + */ + private String sdxm; + } + + @Data + public static class ntycxbcj { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 涓娆℃цˉ鍋挎敹鍏 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鏈湡宸ヨ祫鏀跺叆 蹇呭~锛氥鍚 + */ + private BigDecimal bqgzs; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍏朵粬 蹇呭~锛氬惁 + */ + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鎹愯禒棰 蹇呭~锛氬惁 + */ + private BigDecimal zykcjze; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氬唴閫涓娆℃цˉ鍋块噾 + */ + private String sdxm; + /** + * 鍒嗘憡鏈堜唤鏁 蹇呭~锛氭槸 + */ + private Integer ftyfs; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + } + + @Data + public static class qtflxlwbc { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氭槸 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal mssd; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal syylbx; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 + */ + private BigDecimal yxkcsf; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 澶囨敞 蹇呭~锛氭潯浠跺繀濉 鏍规嵁鏀跨瓥瑕佹眰锛屽~鍐欍愬叾浠栥戦」锛屼竴瀹氬湪澶囨敞涓啓鏄庡叿浣撴墸闄ら」鐩悕绉帮紝澶囨敞涓嶈秴杩20涓瓧绗 + */ + private String bz; + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 鏃犲垯濉0 + */ + private BigDecimal jmse; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 濉啓锛氬叾浠栭潪杩炵画鍔冲姟鎶ラ叕 + */ + private String sdxm; + } + } + + +} diff --git a/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java b/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java new file mode 100644 index 000000000..f8912a261 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/declare/GetCompanyIncomesRequest.java @@ -0,0 +1,81 @@ +package com.engine.salary.remote.tax.request.declare; + +import lombok.Data; + +@Data +public class GetCompanyIncomesRequest { + /** + * 澶栭儴涓氬姟缂栧彿 蹇呭~锛氭槸 澶栭儴涓氬姟缂栧彿锛屽敮涓锛屽箓绛夐渶瑕侊紝鏈闀64浣,寤鸿浣跨敤UUID,寤鸿浣跨敤UUID + */ + private String bizNo; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇暶熺鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氬惁 0琛ㄧず鐢虫姤瀵嗙爜锛2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵,1琛ㄧず鍔犲瘑 + */ + private String jmsmmm; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑鐢虫姤瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmmc; + /** + * 鎵灞炴湡 蹇呭~锛氭槸 鏍煎紡YYYYMM骞存湀 + */ + private String skssq; + /** + * 姣忛〉鐨勬暟閲 + */ + private Integer pageSize; + /** + * 椤电爜 + */ + private Integer pageNo; + /** + * 鎶ヨ〃绫诲瀷 + *

+ * 1锛氱患鍚堟墍寰; + * 2: 鍒嗙被鎵寰楋紱 + * 3锛氶潪灞呮皯鎵寰 + * 4: 闄愬敭鑲℃墍寰 + */ + private String reportType; + +} diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java new file mode 100644 index 000000000..635c146ec --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java @@ -0,0 +1,96 @@ +package com.engine.salary.remote.tax.request.deductionAmount; + +import lombok.Data; + +import java.util.List; + +@Data +public class ConfirmPreDeductRequest { + /** + * 澶栭儴涓氬姟缂栧彿 蹇呭~锛氭槸 澶栭儴涓氬姟缂栧彿锛屽敮涓锛屽箓绛夐渶瑕侊紝鏈闀64浣,寤鸿浣跨敤UUID + */ + private String bizNo; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 浠f姤浼佷笟鍏ㄧО + */ + private String qymc; + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛 0琛ㄧず鐢虫姤瀵嗙爜锛2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + /** + * 鐧昏搴忓彿 蹇呭~锛氬惁 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氬惁 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑鐢虫姤瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 绋庢鎵灞炲勾搴 蹇呭~锛氬繀濉 yyyy + */ + private String skssnd; + + /** + * 鎵i櫎璧勬牸鍒楄〃 + */ + private List kczglb; + + + @Data + public static class kczg { + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 鍥界睄 + */ + private String gj; + /** + * 鎵i櫎鏍囪瘑 鏄/鍚 + */ + private String kcbs; + } + +} diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java new file mode 100644 index 000000000..1aaa0a3a1 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java @@ -0,0 +1,64 @@ +package com.engine.salary.remote.tax.request.deductionAmount; + +import lombok.Data; + +@Data +public class QueryDeductionAmountRequest { + /** + * 澶栭儴涓氬姟缂栧彿 蹇呭~锛氭槸 澶栭儴涓氬姟缂栧彿锛屽敮涓锛屽箓绛夐渶瑕侊紝鏈闀64浣,寤鸿浣跨敤UUID + */ + private String bizNo; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 浠f姤浼佷笟鍏ㄧО + */ + private String qymc; + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛 0琛ㄧず鐢虫姤瀵嗙爜锛2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + /** + * 鐧昏搴忓彿 蹇呭~锛氬惁 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氬惁 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑鐢虫姤瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 绋庢鎵灞炲勾搴 蹇呭~锛氬繀濉 yyyy + */ + private String skssnd; + +} diff --git a/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java b/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java new file mode 100644 index 000000000..a56c5103f --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/BatchInvalidSubmissionRequest.java @@ -0,0 +1,71 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchInvalidSubmissionRequest { + + + private String bizNo; + + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇曠綉缁滅鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭槸 + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭槸 + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氭槸 0琛ㄧず鐢虫姤瀵嗙爜锛 2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + + /** + * 浜哄憳鍒楄〃 蹇呭~锛氭槸 + */ + protected List rylb; + + + @Data + public static class RY { + private String xm; + private String zzhm; + private String zzlx; + } +} diff --git a/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java b/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java new file mode 100644 index 000000000..799722704 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/GetCompanyEmployeeRequest.java @@ -0,0 +1,65 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +@Data +public class GetCompanyEmployeeRequest { + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇曠綉缁滅鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭槸 + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭槸 + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氭槸 0琛ㄧず鐢虫姤瀵嗙爜锛 2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + + /** + * 鎵灞炴湀浠 蹇呭~锛氭槸 鏍煎紡YYYYMM骞 + */ + private String ssyf; + /** + * 椤电爜 蹇呭~锛氭槸 澶т簬0 + */ + private String pageNo; + /** + * 鏁伴噺 蹇呭~锛氭槸 澶т簬0 + */ + private String pageSize; +} diff --git a/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java b/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java new file mode 100644 index 000000000..32d364545 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/InformationChangeRequest.java @@ -0,0 +1,60 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +@Data +public class InformationChangeRequest { + + + private String bizNo; + + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇曠綉缁滅鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭槸 + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭槸 + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氭槸 0琛ㄧず鐢虫姤瀵嗙爜锛 2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + + private String xm; + private String zzlx; + private String zzhm; +} diff --git a/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java b/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java new file mode 100644 index 000000000..fa6c67adf --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/employee/MergedEmployeeArchivesRequest.java @@ -0,0 +1,71 @@ +package com.engine.salary.remote.tax.request.employee; + +import lombok.Data; + +import java.util.List; + +@Data +public class MergedEmployeeArchivesRequest { + + + private String bizNo; + + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 鎵g即涔夊姟浜哄悕绉帮細渚嬪锛氭祴璇曠綉缁滅鎶鏈夐檺鍏徃 + */ + private String qymc; + /** + * 鐧昏搴忓彿 蹇呭~锛氭潯浠跺繀濉 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氭槸 + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氭槸 + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氭槸 0琛ㄧず鐢虫姤瀵嗙爜锛 2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + + /** + * 浜哄憳鍒楄〃 蹇呭~锛氭槸 + */ + protected List bdrys; + + + @Data + public static class RY { + private String xm; + private String zzlx; + private String zzhm; + } +} diff --git a/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java b/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java new file mode 100644 index 000000000..e61c59ec2 --- /dev/null +++ b/src/com/engine/salary/remote/tax/request/payment/QueryArrearageRequest.java @@ -0,0 +1,64 @@ +package com.engine.salary.remote.tax.request.payment; + +import lombok.Data; + +@Data +public class QueryArrearageRequest { + /** + * 澶栭儴涓氬姟缂栧彿 蹇呭~锛氭槸 澶栭儴涓氬姟缂栧彿锛屽敮涓锛屽箓绛夐渶瑕侊紝鏈闀64浣,寤鸿浣跨敤UUID + */ + private String bizNo; + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 浠f姤浼佷笟鍏ㄧО + */ + private String qymc; + /** + * 瀵嗙爜绫诲瀷 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛 0琛ㄧず鐢虫姤瀵嗙爜锛2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜 + */ + private String mmlx; + /** + * 瀹炲悕璐﹀彿 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smzh; + /** + * 瀹炲悕瀵嗙爜 蹇呭~锛氶夋嫨蹇呭~ 褰搈mlx=2鏃讹紝蹇呭~ + */ + private String smmm; + /** + * 鍔犲瘑瀹炲悕瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 鍙傝3.4浠f姤銆佸疄鍚嶅瘑鐮佸姞瀵嗚鏄 + */ + private String jmsmmm; + + /** + * 鐧昏搴忓彿 蹇呭~锛氬惁 瀛樺湪澶氫釜鐧昏搴忓彿鏃讹紝闇瑕佹寚瀹氫紶鍏ヤ竴涓.渚嬶細10117440105249764755 + */ + private String djxhid; + /** + * 绋庡彿 蹇呭~锛氭槸 鎵g即鍗曚綅绾崇◣浜鸿瘑鍒彿 + */ + private String nsrsbh; + /** + * 绋庢鎵灞炴湡 蹇呭~锛氭槸 榛樿涓哄綋鍓嶆湀浠斤紝鏍煎紡YYYYMM + */ + private String skssq; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氬惁 鍒嗛儴闂ㄤ唬鎶ユ椂蹇呬紶 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 鐢虫姤瀵嗙爜 蹇呭~锛氭潯浠跺繀濉 褰搈mlx=0鏃讹紝蹇呭~ + */ + private String sbmm; + /** + * 鍔犲瘑鐢虫姤瀵嗙爜 蹇呭~锛氬惁 榛樿涓嶄紶鍒欒缃负0锛0琛ㄧず涓嶅姞瀵嗭紱1琛ㄧず鍔犲瘑 + */ + private String jmsbmm; +} diff --git a/src/com/engine/salary/remote/tax/response/RequestIdResponse.java b/src/com/engine/salary/remote/tax/response/RequestIdResponse.java new file mode 100644 index 000000000..ef5505021 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/RequestIdResponse.java @@ -0,0 +1,32 @@ +package com.engine.salary.remote.tax.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import lombok.Data; + +/** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class RequestIdResponse { + /** + * 鎺ュ彛鐘舵 + */ + private SzyhResponseHead head; + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣撶被 + **/ + @Data + public static class Body { + String requestId; + } +} diff --git a/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java new file mode 100644 index 000000000..ad6d5ed8a --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/calculate/GetASynIndividualIncomeTaxFeedbackResponse.java @@ -0,0 +1,1010 @@ +package com.engine.salary.remote.tax.response.calculate; + +import com.engine.salary.annotation.TaxField; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + @Data + public static class Body { + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 + */ + private String qymc; + /** + * 绋庡彿 蹇呭~锛氭槸 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭槸 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 绠楃◣鏈堜唤 蹇呭~锛氭槸 + */ + private String skssq; + /** + * 缁煎悎鎵寰 蹇呭~锛氭槸 瑙佺患鍚堟墍寰楄绠楃粨鏋 + */ + private zhsd zhsd; + /** + * 鍒嗙被鎵寰 蹇呭~锛氭槸 瑙佸垎绫绘墍寰楄绠楃粨鏋 + */ + private flsd flsd; + /** + * 闈炲眳姘戞墍寰 蹇呭~锛氭槸 瑙侀潪灞呮皯鎵寰楄绠楃粨鏋 + */ + private fjmsd fjmsd; +// /** +// * 闄愬敭鑲℃墍寰 蹇呭~锛氭槸 瑙侀檺鍞偂鎵寰楄绠楃粨鏋 +// */ +// private xsgsd xsgsd; + /** + * 浜哄憳鐢虫姤澶辫触鍒楄〃 蹇呭~锛氭槸 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + + + @Data + public static class zhsd { + /** + * 浜哄憳浠d唬鎶ュけ璐ュ垪琛 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + /** + * 姝e父宸ヨ祫钖噾绠楃◣缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx zcgzxj; + /** + * 鍏ㄥ勾涓娆℃у閲戞敹鍏ョ畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx qnycxjjsslb; + /** + * 绋块叕鎵寰楃畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx gcsdlb; + /** + * 涓鑸姵鍔℃姤閰畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx lwbclb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛樿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx bxyxy; + /** + * 璇佸埜缁忕邯浜鸿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx zqjjr; + /** + * 鐗硅鏉冪畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx txq; + /** + * 涓汉鑲℃潈婵鍔辩粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx grgqjl; + /** + * 浼佷笟骞撮噾缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx qynj; + /** + * 鍐呴涓娆℃цˉ鍋块噾 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx ntycxbcjlb; + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx qtlxlwbc; + /** + * 鍏朵粬闈炶繛缁姵鍔℃姤閰 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx qtflxlwbc; + /** + * 鎻愬墠閫浼戜竴娆℃цˉ璐 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx tqtxycxbt; + /** + * 澶紒璐熻矗浜虹哗鏁堣柂閲戝欢鏈熷厬鐜版敹鍏ュ拰浠绘湡濂栧姳 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx yqfzrsrhjl; + /** + * 娉曞緥鎻村姪鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx flyzlwbclb; + + + @Data + public static class rysb { + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 浠f姤鐘舵 1 寰呮姤閫 2 浠f姤涓 3 浠f姤澶辫触 4 浠f姤鎴愬姛 + */ + private String sbzt; + /** + * 浜哄憳璁よ瘉鐘舵 + */ + private String rzzt; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + } + + @Data + public static class ssjgdx { + /** + * 缁煎悎绠楃◣鎴愬姛鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 缁煎悎绠楃◣澶辫触鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 缁煎悎绠楃◣澶辫触鍘熷洜鍒楄〃 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 鍙備笌缁煎悎绠楃◣鎬讳汉鏁 + */ + private int sszrs; + /** + * 缁煎悎绠楃◣澶辫触鎬讳汉鏁 + */ + private int sssbrs; + /** + * 骞撮噾涓婇檺 + */ + private BigDecimal njsx; + /** + * 浣忔埧鍏Н閲戜笂闄 + */ + private BigDecimal zfgjjsx; + /** + * 骞村钩鍧囧伐璧 + */ + private BigDecimal npjgz; + /** + * 浼佷笟涓婃湀鏄惁宸茬敵鎶 0:涓婃湀鏈敵鎶 1:涓婃湀宸茬敵鎶 2:涓婁笂鏈堟湭鐢虫姤 + */ + private String qysysfysb; + + + @Data + public static class result { + /** + * 鏄惁鏄庣粏鐢虫姤 蹇呭~锛氬惁 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 濮撳悕 蹇呭~锛氬惁 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛氬惁 瑙佽瘉浠剁被鍨嬪瓧鍏 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氬惁 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + private String zzhm; + /** + * 浠昏亴鍙楅泧鏃ユ湡 蹇呭~锛氭槸 鏍煎紡YYYY-MM-DD + */ + private String rzsgrq; + /** + * 绂昏亴鏃ユ湡 蹇呭~锛氬惁 鏍煎紡YYYY-MM-DD + */ + private String lzrq; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + private BigDecimal sre; + /** + * 褰撴湡鍏嶇◣鏀跺叆 蹇呭~锛氬惁 + */ + private BigDecimal mssd; + /** + * 鍩烘湰鍏昏佷繚闄 蹇呭~锛氬惁 + */ + private BigDecimal jbylaobxf; + /** + * 鍩烘湰鍖荤枟淇濋櫓 蹇呭~锛氬惁 + */ + private BigDecimal jbylbxf; + /** + * 澶变笟淇濋櫓 蹇呭~锛氬惁 + */ + private BigDecimal sybxf; + /** + * 浣忔埧鍏Н閲 蹇呭~锛氬惁 + */ + private BigDecimal zfgjj; + /** + * 瀛愬コ鏁欒偛鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal znjyzc; + /** + * 璧″吇鑰佷汉鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal sylrzc; + /** + * 浣忔埧璐锋鍒╂伅鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal zfdklxzc; + /** + * 浣忔埧绉熼噾鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal zfzjzc; + /** + * 缁х画鏁欒偛鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal jxjyzc; + /** + * 闈炲鍘嗙户缁暀鑲叉敮鍑 蹇呭~锛氬惁 + */ + private BigDecimal fxljxjyzc; + /** + * 3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛氬惁 + */ + private BigDecimal yyezhzc; + /** + * 骞撮噾 蹇呭~锛氬惁 + */ + private BigDecimal nj; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛氬惁 + */ + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛氬惁 + */ + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛氬惁 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 + */ + private BigDecimal zykcjze; + + /** + * 澶囨敞 蹇呭~锛氬惁 + */ + private String bz; + /** + * 鍑忛櫎璐圭敤 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾鐨勫噺闄よ垂鐢ㄣ 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉鐨勮垂鐢 + */ + private BigDecimal jcfy; + /** + * 鍏朵粬鎵i櫎鍚堣 蹇呭~锛氬惁 + */ + private BigDecimal qtckhj; + /** + * 搴旂撼绋庢墍寰楅 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾杩斿洖鍚 + */ + private BigDecimal ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾杩斿洖鍚 + */ + private BigDecimal ynse; + /** + * 宸茬即绋庨 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾杩斿洖鍚 + */ + private BigDecimal ykjse; + /** + * 搴旀墸缂寸◣棰 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾杩斿洖鍚 + */ + private BigDecimal yingkjse; + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 姝e父宸ヨ祫钖噾锛涘叏骞翠竴娆℃у閲戞敹鍏ワ紱绋块叕鎵寰楋紱鍔冲姟鎶ラ叕 + */ + private String sdxm; + + /** + * 绱鏀跺叆棰 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱搴旂◣鏀跺叆鍚堣", taxIndex = "ljsre") + private BigDecimal ljsre; + /** + * 绱鍏嶇◣鏀跺叆棰 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱鍏嶇◣鏀跺叆", taxIndex = "ljmssd") + private BigDecimal ljmssd; + /** + * 绱涓撻」鎵i櫎棰 蹇呭~锛氬惁 涓夐櫓涓閲戝悎璁 + */ + @TaxField(name = "褰撳墠绱涓撻」鎵i櫎鍚堣", taxIndex = "ljzxkce") + private BigDecimal ljzxkce; + + /** + * 绱鍏朵粬鎵i櫎棰 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱鍏朵粬鎵i櫎鍚堣", taxIndex = "ljqtkce") + private BigDecimal ljqtkce; + + /** + * 绱鍑忛櫎璐圭敤棰 蹇呭~锛氬惁 姝e父宸ヨ祫钖噾绱鍑忛櫎璐圭敤 蹇呭~锛氬惁 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉绱璐圭敤 + */ + @TaxField(name = "褰撳墠绱鍑忛櫎璐圭敤", taxIndex = "ljjcfye") + private BigDecimal ljjcfye; + /** + * 绱鏈堝噺闄よ垂鐢 蹇呭~锛氬惁 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal ljyjcfy; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛氬惁 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal yxkcsf; + /** + * 灞曚笟鎴愭湰 蹇呭~锛氬惁 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal zycb; + /** + * 鏈堝噺闄よ垂鐢 蹇呭~锛氬惁 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal yjcfy; + /** + * 绱瀛愬コ鏁欒偛鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱瀛愬コ鏁欒偛", taxIndex = "ljznjyzc") + private BigDecimal ljznjyzc; + /** + * 绱缁х画鏁欒偛鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱缁х画鏁欒偛", taxIndex = "ljjxjyzc") + private BigDecimal ljjxjyzc; + + /** + * 绱闈炲鍘嗙户缁暀鑲叉敮鎸 蹇呭~锛氬惁 + */ + private BigDecimal ljfxljxjyzc; + /** + * 绱瀛﹀巻缁х画鏁欒偛鏀寔 蹇呭~锛氬惁 + */ + private BigDecimal ljxljxjyzc; + /** + * 绱浣忔埧绉熼噾鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱浣忔埧绉熼噾", taxIndex = "ljzfzjzc") + private BigDecimal ljzfzjzc; + /** + * 绱鎴垮眿璐锋鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱浣忔埧璐锋鍒╂伅", taxIndex = "ljzfdklxzc") + private BigDecimal ljzfdklxzc; + /** + * 绱璧″吇鑰佷汉鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱璧″吇鑰佷汉", taxIndex = "ljsylrzc") + private BigDecimal ljsylrzc; + /** + * 绱澶х梾鍖荤枟鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱澶х梾鍖荤枟", taxIndex = "ljdbylzc") + private BigDecimal ljdbylzc; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛氬惁 + */ + @TaxField(name = "绱濠村辜鍎跨収鎶", taxIndex = "ljyyezhzc") + private BigDecimal ljyyezhzc; + + + /** + * 绱涓撻」闄勫姞鎵i櫎棰 蹇呭~锛氬惁 涓撻」闄勫姞鍚堣 + */ + @TaxField(name = "褰撳墠绱涓撻」闄勫姞鎵i櫎鍚堣", taxIndex = "ljzxfjkce") + private BigDecimal ljzxfjkce; + + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱鍑嗕簣鎵i櫎鐨勬崘璧犻", taxIndex = "ljzykcjze") + private BigDecimal ljzykcjze; + + + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛氬惁 + */ + @TaxField(name = "绱涓汉鍏昏侀噾", taxIndex = "ljgrylj") + private BigDecimal ljgrylj; + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛氬惁 + */ + private String ljgryljjym; + /** + * 浠呭湪涓や釜鏈堢畻绋庡満鏅椂浣跨敤锛屽綋鍓嶆湀鍒嗕负N鏈堬細 + * 0琛ㄧずN-1鏈堬紙涓婃湀锛夋湭鐢虫姤 + * 1琛ㄧずN-1鏈堬紙涓婃湀锛夊凡鐢虫姤 + * 2琛ㄧずN-2鏈堬紙涓婁笂涓湀锛夋湭鐢虫姤 + */ + private String qysysfysb; + + /** + * 褰撳墠鏈堝垎涓篘,濡傛灉N-1锛堜笂鏈堬級宸茬敵鎶ワ紝鍒欒繑鍥濶-1鏈堝憳宸ュ湪绋庡眬绱宸叉墸缂寸殑绋庨; + * 濡傛灉N-1鏈堟湭鐢虫姤锛屽垯杩斿洖N-2鏈堝伐鍦ㄧ◣灞绱宸叉墸缂寸殑绋庨; + */ + private BigDecimal ygzsjljykjse; + /** + * 鏈湀宸茬疮璁℃墸闄ょ◣棰 蹇呭~锛氬惁 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁 + */ + private BigDecimal byyljkjse; + /** + * 鏈搴旀墸缂寸◣棰 蹇呭~锛氬惁 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁锛屾湰娆″簲鎵g即绋庨=鏈湀搴旀墸缂寸◣棰-鏈湀宸茬疮璁$◣棰 + */ + private BigDecimal bcykjse; + /** + * 鍒嗘憡骞村害鏁 蹇呭~锛氬惁 + */ + private Integer ftnds; + /** + * 骞村噺闄よ垂鐢 蹇呭~锛氬惁 榛樿涓60000 + */ + private BigDecimal njcfy; + + /** + * 绱搴旂撼绋庢墍寰楅 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱搴旂撼绋庢墍寰楅", taxIndex = "ljynssde") + private BigDecimal ljynssde; + + + /** + * 绋庣巼 蹇呭~锛氬惁 + */ + @TaxField(name = "绋庣巼", taxIndex = "sl") + private BigDecimal sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛氬惁 + */ + @TaxField(name = "閫熺畻鎵i櫎鏁", taxIndex = "sskcs") + private BigDecimal sskcs; + + /** + * 绱搴旂撼绋庨 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱搴旂撼绋庨", taxIndex = "ljynse") + private BigDecimal ljynse; + + + /** + * 鍑忓厤绋庨 蹇呭~锛氬惁 + */ + @TaxField(name = "鏈湀锛堟锛夊噺鍏嶇◣棰", taxIndex = "jmse") + private BigDecimal jmse; + + /** + * 绱鍑忓厤绋庨 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱鍑忓厤绋庨鍚堣", taxIndex = "ljjmse") + private BigDecimal ljjmse; + + /** + * 绱搴旀墸缂寸◣棰 蹇呭~锛氬惁 绱搴旀墸缂寸◣棰 = 绱搴旂撼绋庨 - 绱鍑忓厤绋庨 + */ + private BigDecimal ljyingkjse; + + /** + * 绱宸茬即绋庨 蹇呭~锛氬惁 + */ + @TaxField(name = "褰撳墠绱宸叉墸缂寸◣棰濆悎璁", taxIndex = "ljykjse") + private BigDecimal ljykjse; + + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氬惁 搴旇ˉ閫绋庨=绱搴旀墸缂寸◣棰-绱宸茬即绋庨 + */ + @TaxField(name = "鏈湀锛堟锛夊簲琛ョ◣棰", taxIndex = "ybtse") + private BigDecimal ybtse; + } + } + + } + + /** + * 鍒嗙被鎵寰 + */ + @Data + public static class flsd { + + /** + * 鍒╂伅鑲℃伅绾㈠埄鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx lxgxhllb; + /** + * 鑲℃潈杞鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx ggzrlb; + /** + * 鍏朵粬璐骇杞鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx qtcczrlb; + /** + * 鍋剁劧鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx orsdlb; + /** + * 鍏朵粬璐骇绉熻祦鍒楄〃 蹇呭~锛歯ull + */ + private flsdssjgdx qtcczllb; + /** + * 涓婂競鍏徃鑲℃伅绾㈠埄 蹇呭~锛歯ull + */ + private flsdssjgdx ssgsgxhllb; + /** + * 涓汉鎴垮眿鍑虹鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx grfwczsdlb; + /** + * 闅忔満璧犻佺ぜ鍝佸垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx sjzslplb; + /** + * 涓夋澘甯傚満鑲℃伅绾㈠埄鎵寰 蹇呭~锛歯ull + */ + private flsdssjgdx sbscgxhllb; + /** + * 璇佸姷璧勯噾鍒╂伅鎵寰 蹇呭~锛歯ull + */ + private flsdssjgdx zjzjlxlb; + + + /** + * 鍒嗙被鎵寰楃畻绋庣粨鏋滃璞 + */ + @Data + public static class flsdssjgdx { + /** + * 绠楃◣鎴愬姛鍒楄〃 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 绠楃◣澶辫触鍒楄〃 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 绠楃◣澶辫触鍘熷洜鍒楄〃 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 绠楃◣鎬讳汉鏁 + */ + private int sszrs; + /** + * 绠楃◣澶辫触鎬讳汉鏁 + */ + private int sssbrs; + + /** + * 鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + @Data + public static class result { + /** + * 鏄惁鏄庣粏鐢虫姤 蹇呭~锛氬惁 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 濮撳悕 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + private String zzhm; + /** + * 鏀跺叆棰 蹇呭~锛氭槸 + */ + private String sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氭槸 + */ + private String mssd; + /** + * 璐骇鍘熷 蹇呭~锛氭槸 + */ + private String ccyz; + /** + * 鍏佽鎵i櫎鐨勭◣璐 蹇呭~锛氭槸 + */ + private String yxkcsf; + /** + * 鎶曡祫鎶垫墸 蹇呭~锛氭槸 + */ + private String tzdk; + /** + * 鍏朵粬 蹇呭~锛氭槸 + */ + private String qt; + /** + * 澶囨敞 蹇呭~锛氭槸 + */ + private String bz; + /** + * 鍑忛櫎璐圭敤 蹇呭~锛氭槸 + */ + private String jcfy; + /** + * 鍑忚姣斾緥 蹇呭~锛氭槸 + */ + private String jjbl; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氭槸 + */ + private String zykcjze; + /** + * 绋庡墠鎵i櫎椤圭洰鍚堣 蹇呭~锛氭槸 + */ + private String sqkcxmhj; + /** + * 搴旂撼绋庢墍寰楅 蹇呭~锛氭槸 + */ + private String ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛氭槸 + */ + private String ynse; + /** + * 鍑忓厤绋庨 蹇呭~锛氭槸 + */ + private String jmse; + /** + * 宸茬即绋庨 蹇呭~锛氭槸 鏃犻渶濉啓璇ュ硷紝鎸0澶勭悊 + */ + private String ykjse; + /** + * 搴旀墸缂寸◣棰 蹇呭~锛氭槸 + */ + private String yingkjse; + /** + * 绋庣巼 蹇呭~锛氭槸 + */ + private String sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛氭槸 + */ + private String sskcs; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氭槸 + */ + private String ybtse; + /** + * 鍒嗙被鎵寰楀悕瀛 蹇呭~锛氭槸 鍒嗙被鎵寰楄柂閲戠被鍒-鍒╂伅鑲℃伅绾㈠埄鎵寰楋紝鑲℃潈杞鎵寰楋紝鍏朵粬璐骇杞鎵寰楋紝鍋剁劧鎵寰楋紝鍏朵粬鎵寰" + */ + private String sdxm; + /** + * 鎵寰楁湡闂磋捣 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjq; + /** + * 鎵寰楁湡闂存 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjz; + } + } + } + + + @Data + public static class fjmsd { + /** + * 姝e父宸ヨ祫钖噾锛堟棤浣忔墍涓汉姝e父宸ヨ祫钖噾锛夋墍寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx wjgzxjlb; + /** + * 鏃犱綇鎵涓汉鏁版湀濂栭噾鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx wjrysyjjlb; + /** + * 鍔冲姟鎶ラ叕鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx lwbclb; + /** + * 绋块叕鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx gcsdlb; + /** + * 鍒╂伅濮戞伅绾㈠埄鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx lxgxhllb; + /** + * 鑲℃潈杞鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx gqzrlb; + /** + * 鍏朵粬璐骇杞鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx qtcczrlb; + /** + * 鍋剁劧鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx orsdlb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛樿柂閲戠畻绋庣粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx bxyxy; + /** + * 璇佸埜缁忕邯浜鸿柂閲戠畻绋庣粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx zqjjr; + /** + * 涓汉鑲℃潈婵鍔辩粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx grgqjl; + /** + * 鐗硅鏉冧娇鐢ㄨ垂鎵寰 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx txqsyfsd; + /** + * 涓汉鎴垮眿鍑虹鎵寰 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private ssjgdx grfwczsd; + + @Data + public static class ssjgdx { + /** + * 闈炲眳姘戠畻绋庢垚鍔熷垪琛 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 闈炲眳姘戠畻绋庡け璐ュ垪琛 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 闈炲眳姘戠畻绋庡け璐ュ師鍥犲垪琛 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 鍙備笌闈炲眳姘戠畻绋庢讳汉鏁 + */ + private int sszrs; + /** + * 闈炲眳姘戠畻绋庡け璐ユ讳汉鏁 + */ + private int sssbrs; + + @Data + public static class result { + + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О 蹇呭~锛氭槸 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + private String zzhm; + /** + * 鏀跺叆棰 蹇呭~锛氭槸 + */ + private String sre; + /** + * 绱鏀跺叆锛堜笉鍚湰娆★級 蹇呭~锛氭槸 + */ + private String ljsre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氭槸 + */ + private String mssd; + /** + * 璐骇鍘熷 蹇呭~锛氭槸 + */ + private String ccyz; + /** + * 鍏佽鎵i櫎鐨勭◣璐 蹇呭~锛氭槸 + */ + private String yxkcsf; + /** + * 鎶曡祫鎶垫墸 蹇呭~锛氭槸 + */ + private String tzdk; + /** + * 鍏朵粬 蹇呭~锛氭槸 + */ + private String qt; + /** + * 澶囨敞 蹇呭~锛氭槸 + */ + private String bz; + /** + * 瀹為檯宸ヤ綔骞撮檺 蹇呭~锛氭槸 + */ + private String sjgznxs; + /** + * 鍑忛櫎璐圭敤 蹇呭~锛氭槸 + */ + private String jcfy; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氭槸 + */ + private String zykcjze; + /** + * 绋庡墠鎵i櫎椤圭洰鍚堣 蹇呭~锛氭槸 + */ + private String sqkcxmhj; + /** + * 搴旂撼绋庨鎵寰楅 蹇呭~锛氭槸 + */ + private String ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛氭槸 + */ + private String ynse; + /** + * 鍑忓厤绋庨 蹇呭~锛氭槸 + */ + private String jmse; + /** + * 搴旀墸缂寸◣棰 蹇呭~锛氭槸 + */ + private String yingkjse; + /** + * 宸叉墸缂寸◣棰 蹇呭~锛氭槸 鏃犻渶濉啓璇ュ硷紝鎸0澶勭悊 + */ + private String ykjse; + /** + * 绋庣巼 蹇呭~锛氭槸 + */ + private String sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛氭槸 + */ + private String sskcs; + /** + * 浠f姤鏂瑰紡 蹇呭~锛氭槸 + */ + private String sbfs; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氭槸 + */ + private String ybtse; + /** + * 闈炲眳姘戞墍寰楅」鐩悕瀛 蹇呭~锛氭槸 銆闈炲眳姘戞墍寰楄柂閲戠被鍒-鏃犱綇鎵涓汉姝e父宸ヨ祫钖噾銆佸叏骞翠竴娆℃у閲戞敹鍏 + */ + private String sdxm; + /** + * 鎵寰楁湡闂磋捣 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjq; + /** + * 鎵寰楁湡闂存 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjz; + } + } + } + + @Data + public static class rysbsb { + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 浠f姤鐘舵 1 寰呮姤閫 2 浠f姤涓 3 浠f姤澶辫触 4 浠f姤鎴愬姛 + */ + private String sbzt; + /** + * 浜哄憳璁よ瘉鐘舵 + */ + private String rzzt; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + } + + + /** + * 绠楃◣澶辫触鍘熷洜瀵硅薄 + */ + @Data + public static class sssbyy { + /** + * 浜哄憳ID + */ + private Integer ygid; + /** + * 浜哄憳鍚嶇О + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 閿欒鐮 + */ + private String cwm; + /** + * 閿欒淇℃伅 + */ + private String cwxx; + /** + * 鎵寰楃◣鐨刢ode + */ + private String sdxmdm; + /** + * 鎵寰楃◣鐨勫悕绉 + */ + private String sdxmmc; + } + + } + + +} diff --git a/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java new file mode 100644 index 000000000..779ec3671 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/declare/GetCompanyIncomesResponse.java @@ -0,0 +1,456 @@ +package com.engine.salary.remote.tax.response.declare; + +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.util.excel.ExcelHead; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetCompanyIncomesResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + + /** + * 浜哄憳涓撻」闄勫姞鎵i櫎淇℃伅鏌ヨ缁撴灉body + **/ + @Data + public static class Body { + /** + * 鏄庣粏 + */ + private List sfmx; + + /** + * 鍚堣 + */ + private sfhj sfhj; + + + } + + @Data + public static class sfmx { + /** + * 鏄惁鏄庣粏鐢虫姤 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 绾崇◣浜哄鍚 姹囨荤敵鎶ヤ负绌 + */ + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "xm") + @ExcelHead(title = "濮撳悕", dataIndex = "xm") + private String xm; + /** + * 绾崇◣璇嗗埆鍙 + */ + private String nsrsbh; + /** + * 璇佷欢绫诲瀷 姹囨荤敵鎶ヤ负绌 + */ + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "zjlx") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "zjlx") + private String zjlx; + /** + * 璇佷欢鍙风爜 姹囨荤敵鎶ヤ负绌 + */ + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "zjhm") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "zjhm") + private String zjhm; + /** + * 闈炲眳姘戜釜浜 1锛氬惁 2锛氭槸 + */ + private String sffjm; + /** + * 鎵寰楅」鐩悕绉 瑙佹墍寰楅」鐩瓧鍏 + */ + private String sdxmmc; + /** + * 鏀跺叆棰 + */ + @SalaryTableColumn(text = "鏈湡鏀跺叆", width = "10%", column = "sre") + @ExcelHead(title = "鏈湡鏀跺叆", dataIndex = "sre") + private String sre; + /** + * 璐圭敤 + */ + private String fy; + /** + * 鍏嶇◣鏀跺叆 + */ + @SalaryTableColumn(text = "鏈湡鍏嶇◣鏀跺叆", width = "10%", column = "mssr") + @ExcelHead(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "mssr") + private String mssr; + /** + * 璐骇鍘熷 + */ + private String ccyz; + /** + * 鎶曡祫鎶垫墸 + */ + private String tzdk; + /** + * 鍏佽鎵i櫎鐨勮垂鐢 + */ + private String yxkcsf; + /** + * 鍑忚姣斾緥 + */ + private String jjbl; + /** + * 鍑忛櫎璐圭敤 + */ + private String jcfy; + /** + * 鍩烘湰鍏昏佷繚闄 + */ + @SalaryTableColumn(text = "鍩烘湰鍏昏佷繚闄╄垂", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "鍩烘湰鍏昏佷繚闄╄垂", dataIndex = "jbylaobxf") + private String jbylaobxf; + /** + * 鍩烘湰鍖荤枟淇濋櫓璐 + */ + @SalaryTableColumn(text = "鍩烘湰鍖荤枟淇濋櫓璐", width = "10%", column = "jbylbxf") + @ExcelHead(title = "鍩烘湰鍖荤枟淇濋櫓璐", dataIndex = "jbylbxf") + private String jbylbxf; + /** + * 澶变笟淇濋櫓璐 + */ + @SalaryTableColumn(text = "澶变笟淇濋櫓璐", width = "10%", column = "sybxf") + @ExcelHead(title = "澶变笟淇濋櫓璐", dataIndex = "sybxf") + private String sybxf; + /** + * 浣忔埧鍏Н閲 + */ + @SalaryTableColumn(text = "浣忔埧鍏Н閲", width = "10%", column = "zfgjj") + @ExcelHead(title = "浣忔埧鍏Н閲", dataIndex = "zfgjj") + private String zfgjj; + /** + * 骞撮噾 + */ + @SalaryTableColumn(text = "浼佷笟(鑱屼笟)骞撮噾", width = "10%", column = "nj") + @ExcelHead(title = "浼佷笟(鑱屼笟)骞撮噾", dataIndex = "nj") + private String nj; + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 + */ + @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "syjkbx") + @ExcelHead(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "syjkbx") + private String syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 + */ + @SalaryTableColumn(text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "syylbx") + @ExcelHead(title = "绋庡欢鍏昏佷繚闄", dataIndex = "syylbx") + private String syylbx; + /** + * 鍏跺畠鎵i櫎 + */ + @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "qt") + @ExcelHead(title = "鍏朵粬", dataIndex = "qt") + private String qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 + */ + @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "zykcjze") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "zykcjze") + private String zykcjze; + /** + * 绱鏀跺叆棰 + */ + @SalaryTableColumn(text = "绱鏀跺叆棰", width = "10%", column = "ljsre") + @ExcelHead(title = "绱鏀跺叆棰", dataIndex = "ljsre") + private String ljsre; + /** + * 绱鍑忛櫎璐圭敤 + */ + @SalaryTableColumn(text = "绱鍑忛櫎璐圭敤", width = "10%", column = "ljjcfy") + @ExcelHead(title = "绱鍑忛櫎璐圭敤", dataIndex = "ljjcfy") + private String ljjcfy; + /** + * 绱涓撻」鎵i櫎 + */ + @SalaryTableColumn(text = "绱涓撻」鎵i櫎", width = "10%", column = "ljzxkc") + @ExcelHead(title = "绱涓撻」鎵i櫎", dataIndex = "ljzxkc") + private String ljzxkc; + /** + * 绱瀛愬コ鏁欒偛 + */ + @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "ljznjy") + @ExcelHead(title = "绱瀛愬コ鏁欒偛", dataIndex = "ljznjy") + private String ljznjy; + /** + * 绱璧″吇鑰佷汉 + */ + @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "ljsylr") + @ExcelHead(title = "绱璧″吇鑰佷汉", dataIndex = "ljsylr") + private String ljsylr; + /** + * 绱浣忔埧璐锋鍒╂伅 + */ + @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "ljzfdklx") + @ExcelHead(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "ljzfdklx") + private String ljzfdklx; + /** + * 绱浣忔埧绉熼噾 + */ + @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "ljzfzj") + @ExcelHead(title = "绱浣忔埧绉熼噾", dataIndex = "ljzfzj") + private String ljzfzj; + /** + * 绱缁х画鏁欒偛 + */ + @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "ljjxjy") + @ExcelHead(title = "绱缁х画鏁欒偛", dataIndex = "ljjxjy") + private String ljjxjy; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 + */ + @SalaryTableColumn(text = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", width = "10%", column = "ljyyezhzc") + @ExcelHead(title = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", dataIndex = "ljyyezhzc") + private String ljyyezhzc; + /** + * 绱鍏跺畠鎵i櫎 + */ + @SalaryTableColumn(text = "绱鍏朵粬鎵i櫎", width = "10%", column = "ljqtkc") + @ExcelHead(title = "绱鍏朵粬鎵i櫎", dataIndex = "ljqtkc") + private String ljqtkc; + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 + */ + @SalaryTableColumn(text = "绱鍑嗕簣鎵i櫎鐨勬崘璧", width = "10%", column = "ljzykcjze") + @ExcelHead(title = "绱鍑嗕簣鎵i櫎鐨勬崘璧", dataIndex = "ljzykcjze") + private String ljzykcjze; + /** + * 绱涓汉鍏昏侀噾 + */ + private BigDecimal ljgrylj; + /** + * 搴旂撼绋庢墍寰楅 + */ + @SalaryTableColumn(text = "绱搴旂撼绋庢墍寰楅", width = "10%", column = "ynssde") + @ExcelHead(title = "绱搴旂撼绋庢墍寰楅", dataIndex = "ynssde") + private String ynssde; + /** + * 绋庣巼 + */ + @SalaryTableColumn(text = "绋庣巼", width = "10%", column = "sl") + @ExcelHead(title = "绋庣巼", dataIndex = "sl") + private String sl; + /** + * 鍗忓畾绋庣巼 + */ + private String xdsl; + /** + * 閫熺畻鎵i櫎鏁 + */ + @SalaryTableColumn(text = "閫熺畻鎵i櫎鏁", width = "10%", column = "sskcs") + @ExcelHead(title = "閫熺畻鎵i櫎鏁", dataIndex = "sskcs") + private String sskcs; + /** + * 搴旂撼绋庨 + */ + @SalaryTableColumn(text = "绱搴旂撼绋庨", width = "10%", column = "ynse") + @ExcelHead(title = "绱搴旂撼绋庨", dataIndex = "ynse") + private String ynse; + /** + * 鍑忓厤绋庨 + */ + @SalaryTableColumn(text = "绱鍑忓厤绋庨", width = "10%", column = "jmse") + @ExcelHead(title = "绱鍑忓厤绋庨", dataIndex = "jmse") + private String jmse; + /** + * 宸叉墸缂寸◣棰 + */ + @SalaryTableColumn(text = "绱宸茬即绋庨", width = "10%", column = "ykjse") + @ExcelHead(title = "绱宸茬即绋庨", dataIndex = "ykjse") + private String ykjse; + /** + * 搴旇ˉ閫绋庨 + */ + @SalaryTableColumn(text = "搴旇ˉ(閫)绋庨", width = "10%", column = "ybtse") + @ExcelHead(title = "搴旇ˉ(閫)绋庨", dataIndex = "ybtse") + private String ybtse; + /** + * 澶囨敞 + */ + private String bz; + /** + * 鍒嗘憡骞村害鏁 + */ + private Integer ftnds; + /** + * 骞村噺闄よ垂鐢 榛樿涓60000 + */ + private BigDecimal njcfy; + /** + * 搴旀墸缂寸◣棰 + */ + private BigDecimal kjse; + /** + * 璇佸埜璐︽埛鍙 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private String zqzhh; + /** + * 鑲$エ浠g爜 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private String gpdm; + /** + * 鑲$エ鍚嶇О 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private String gpmc; + /** + * 姣忚偂璁$◣浠锋牸 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private BigDecimal mgjsjg; + /** + * 杞鑲℃暟 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private Integer zrgs; + /** + * 闄愬敭鑲″師鍊 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private BigDecimal xsgyz; + /** + * 鍚堢悊绋庤垂 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private BigDecimal hlsf; + /** + * 鎵i櫎鍙婂噺闄ら」鐩悎璁 闄愬敭鑲℃墍寰楁墠浼氳繑鍥 + */ + private BigDecimal kcjjcxmhj; + + } + + @Data + public static class sfhj { + /** + * 鏀跺叆棰濆悎璁 + */ + 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 BigDecimal ljgryljhj; + /** + * 搴旂撼绋庢墍寰楅鍚堣 + */ + private String ynssdehj; + /** + * 搴旂撼绋庨鍚堣 + */ + private String ynsehj; + /** + * 鍑忓厤绋庨鍚堣 + */ + private String jmsehj; + /** + * 宸叉墸缂寸◣棰濆悎璁 + */ + private String ykjsehj; + /** + * 搴旇ˉ閫绋庨鍚堣 + */ + private String ybtsehj; + } + +} diff --git a/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java new file mode 100644 index 000000000..137d849ae --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/declare/GetDeclareTaxResultFeedbackResponse.java @@ -0,0 +1,1173 @@ +package com.engine.salary.remote.tax.response.declare; + +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.util.excel.ExcelHead; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + @Data + public static class Body { + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 + */ + private String qymc; + /** + * 绋庡彿 蹇呭~锛氭槸 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭槸 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 绠楃◣鏈堜唤 蹇呭~锛氭槸 + */ + private String skssq; + /** + * 缁煎悎鎵寰 蹇呭~锛氭槸 瑙佺患鍚堟墍寰楄绠楃粨鏋 + */ + private zhsd zhsd; + /** + * 鍒嗙被鎵寰 蹇呭~锛氭槸 瑙佸垎绫绘墍寰楄绠楃粨鏋 + */ + private flsd flsd; + /** + * 闈炲眳姘戞墍寰 蹇呭~锛氭槸 瑙侀潪灞呮皯鎵寰楄绠楃粨鏋 + */ + private fjmsd fjmsd; + + // /** +// * 闄愬敭鑲℃墍寰 蹇呭~锛氭槸 瑙侀檺鍞偂鎵寰楄绠楃粨鏋 +// */ +// private 瀵硅薄 xsgsd; + + + @Data + public static class zhsd { + /** + * 浜哄憳浠d唬鎶ュけ璐ュ垪琛 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + /** + * 姝e父宸ヨ祫钖噾绠楃◣缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj zcgzxj; + /** + * 鍏ㄥ勾涓娆℃у閲戞敹鍏ョ畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qnycxjjsslb; + /** + * 绋块叕鎵寰楃畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj gcsdlb; + /** + * 涓鑸姵鍔℃姤閰畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj lwbclb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛樿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj bxyxy; + /** + * 璇佸埜缁忕邯浜鸿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj zqjjr; + /** + * 鐗硅鏉冪畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj txq; + /** + * 涓汉鑲℃潈婵鍔辩粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj grgqjl; + /** + * 浼佷笟骞撮噾缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qynj; + /** + * 鍐呴涓娆℃цˉ鍋块噾 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj ntycxbcjlb; + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qtlxlwbc; + /** + * 鍏朵粬闈炶繛缁姵鍔℃姤閰 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qtflxlwbc; + /** + * 鎻愬墠閫浼戜竴娆℃цˉ璐 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj tqtxycxbt; + /** + * 澶紒璐熻矗浜虹哗鏁堣柂閲戝欢鏈熷厬鐜版敹鍏ュ拰浠绘湡濂栧姳 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj yqfzrsrhjl; + /** + * 娉曞緥鎻村姪鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj flyzlwbclb; + + + /** + * 浜哄憳浠f姤缁撴灉瀵硅薄 + */ + @Data + public static class rydbjgdx { + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 浠f姤鐘舵 1 寰呮姤閫 2 浠f姤涓 3 浠f姤澶辫触 4 浠f姤鎴愬姛 + */ + private String sbzt; + /** + * 浜哄憳璁よ瘉鐘舵 + */ + private String rzzt; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + } + + + /** + * 缁煎悎鎵寰楃畻绋庣粨鏋滃璞 + */ + @Data + public static class zcgzxj { + /** + * 缁煎悎绠楃◣鎴愬姛鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 缁煎悎绠楃◣澶辫触鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 缁煎悎绠楃◣澶辫触鍘熷洜鍒楄〃 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 鍙備笌缁煎悎绠楃◣鎬讳汉鏁 + */ + private int sszrs; + /** + * 缁煎悎绠楃◣澶辫触鎬讳汉鏁 + */ + private int sssbrs; + /** + * 骞撮噾涓婇檺 + */ + private BigDecimal njsx; + /** + * 浣忔埧鍏Н閲戜笂闄 + */ + private BigDecimal zfgjjsx; + /** + * 骞村钩鍧囧伐璧 + */ + private BigDecimal npjgz; + /** + * 浼佷笟涓婃湀鏄惁宸茬敵鎶 0:涓婃湀鏈敵鎶 1:涓婃湀宸茬敵鎶 2:涓婁笂鏈堟湭鐢虫姤 + */ + private String qysysfysb; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + + + /** + * 缁煎悎鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + @Data + public static class zhsdscjgbw { + /** + * 鏄惁鏄庣粏鐢虫姤 蹇呭~锛氬惁 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 濮撳悕 蹇呭~锛歯ull 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "xm") + @ExcelHead(title = "濮撳悕", dataIndex = "xm") + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛歯ull 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "zzlx") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "zzlx") + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛歯ull 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "zzhm") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "zzhm") + private String zzhm; + /** + * 浠昏亴鍙楅泧鏃ユ湡 蹇呭~锛氭槸 鏍煎紡YYYY-MM-DD + */ + @SalaryTableColumn(text = "浠昏亴鍙楅泧鏃ユ湡", width = "10%", column = "rzsgrq") + @ExcelHead(title = "浠昏亴鍙楅泧鏃ユ湡", dataIndex = "rzsgrq") + private String rzsgrq; + /** + * 绂昏亴鏃ユ湡 蹇呭~锛氬惁 鏍煎紡YYYY-MM-DD + */ + @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "lzrq") + @ExcelHead(title = "绂昏亴鏃ユ湡", dataIndex = "lzrq") + private String lzrq; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + @SalaryTableColumn(text = "鏈湡鏀跺叆", width = "10%", column = "sre") + @ExcelHead(title = "鏈湡鏀跺叆", dataIndex = "sre") + private BigDecimal sre; + /** + * 褰撴湡鍏嶇◣鏀跺叆 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鏈湡鍏嶇◣鏀跺叆", width = "10%", column = "mssd") + @ExcelHead(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "mssd") + private BigDecimal mssd; + /** + * 鍩烘湰鍏昏佷繚闄 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍩烘湰鍏昏佷繚闄╄垂", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "鍩烘湰鍏昏佷繚闄╄垂", dataIndex = "jbylaobxf") + private BigDecimal jbylaobxf; + /** + * 鍩烘湰鍖荤枟淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍩烘湰鍖荤枟淇濋櫓璐", width = "10%", column = "jbylbxf") + @ExcelHead(title = "鍩烘湰鍖荤枟淇濋櫓璐", dataIndex = "jbylbxf") + private BigDecimal jbylbxf; + /** + * 澶变笟淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "澶变笟淇濋櫓璐", width = "10%", column = "sybxf") + @ExcelHead(title = "澶变笟淇濋櫓璐", dataIndex = "sybxf") + private BigDecimal sybxf; + /** + * 浣忔埧鍏Н閲 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "浣忔埧鍏Н閲", width = "10%", column = "zfgjj") + @ExcelHead(title = "浣忔埧鍏Н閲", dataIndex = "zfgjj") + private BigDecimal zfgjj; + + /** + * 骞撮噾 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "浼佷笟(鑱屼笟)骞撮噾", width = "10%", column = "nj") + @ExcelHead(title = "浼佷笟(鑱屼笟)骞撮噾", dataIndex = "nj") + private BigDecimal nj; + + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "syjkbx") + @ExcelHead(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "syjkbx") + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "syylbx") + @ExcelHead(title = "绋庡欢鍏昏佷繚闄", dataIndex = "syylbx") + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛歯ull 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "qt") + @ExcelHead(title = "鍏朵粬", dataIndex = "qt") + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "zykcjze") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "zykcjze") + private BigDecimal zykcjze; + + /** + * 鍑忓厤绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "jmse") + @ExcelHead(title = "鍑忓厤绋庨", dataIndex = "jmse") + private BigDecimal jmse; + + /** + * 澶囨敞 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "澶囨敞", width = "10%", column = "bz") + @ExcelHead(title = "澶囨敞", dataIndex = "bz") + private String bz; + + /** + * 绱鏀跺叆棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鏀跺叆棰", width = "10%", column = "ljsre") + @ExcelHead(title = "绱鏀跺叆棰", dataIndex = "ljsre") + private BigDecimal ljsre; + /** + * 绱鍏嶇◣鏀跺叆棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍏嶇◣鏀跺叆", width = "10%", column = "ljmssd") + @ExcelHead(title = "绱鍏嶇◣鏀跺叆", dataIndex = "ljmssd") + private BigDecimal ljmssd; + + /** + * 绱鍑忛櫎璐圭敤棰 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾绱鍑忛櫎璐圭敤 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉绱璐圭敤 + */ + @SalaryTableColumn(text = "绱鍑忛櫎璐圭敤", width = "10%", column = "ljjcfye") + @ExcelHead(title = "绱鍑忛櫎璐圭敤", dataIndex = "ljjcfye") + private BigDecimal ljjcfye; + + /** + * 绱涓撻」鎵i櫎棰 蹇呭~锛歯ull 涓夐櫓涓閲戝悎璁 + */ + @SalaryTableColumn(text = "绱涓撻」鎵i櫎", width = "10%", column = "ljzxkce") + @ExcelHead(title = "绱涓撻」鎵i櫎", dataIndex = "ljzxkce") + private BigDecimal ljzxkce; + + /** + * 绱瀛愬コ鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "ljznjyzc") + @ExcelHead(title = "绱瀛愬コ鏁欒偛", dataIndex = "ljznjyzc") + private BigDecimal ljznjyzc; + /** + * 绱缁х画鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "ljjxjyzc") + @ExcelHead(title = "绱缁х画鏁欒偛", dataIndex = "ljjxjyzc") + private BigDecimal ljjxjyzc; + /** + * 绱闈炲鍘嗙户缁暀鑲叉敮鎸 蹇呭~锛歯ull + */ + private BigDecimal ljfxljxjyzc; + /** + * 绱瀛﹀巻缁х画鏁欒偛鏀寔 蹇呭~锛歯ull + */ + private BigDecimal ljxljxjyzc; + /** + * 绱浣忔埧绉熼噾鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "ljzfzjzc") + @ExcelHead(title = "绱浣忔埧绉熼噾", dataIndex = "ljzfzjzc") + private BigDecimal ljzfzjzc; + /** + * 绱鎴垮眿璐锋鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "ljzfdklxzc") + @ExcelHead(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "ljzfdklxzc") + private BigDecimal ljzfdklxzc; + /** + * 绱璧″吇鑰佷汉鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "ljsylrzc") + @ExcelHead(title = "绱璧″吇鑰佷汉", dataIndex = "ljsylrzc") + private BigDecimal ljsylrzc; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", width = "10%", column = "ljyyezhzc") + @ExcelHead(title = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", dataIndex = "ljyyezhzc") + private BigDecimal ljyyezhzc; + + + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱涓汉鍏昏侀噾", width = "10%", column = "ljgrylj") + @ExcelHead(title = "绱涓汉鍏昏侀噾", dataIndex = "ljgrylj") + private BigDecimal ljgrylj; + + /** + * 绱鍏朵粬鎵i櫎棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍏朵粬鎵i櫎", width = "10%", column = "ljqtkce") + @ExcelHead(title = "绱鍏朵粬鎵i櫎", dataIndex = "ljqtkce") + private BigDecimal ljqtkce; + + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍑嗕簣鎵i櫎鐨勬崘璧", width = "10%", column = "ljzykcjze") + @ExcelHead(title = "绱鍑嗕簣鎵i櫎鐨勬崘璧", dataIndex = "ljzykcjze") + private BigDecimal ljzykcjze; + + /** + * 绱搴旂撼绋庢墍寰楅 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱搴旂撼绋庢墍寰楅", width = "10%", column = "ljynssde") + @ExcelHead(title = "绱搴旂撼绋庢墍寰楅", dataIndex = "ljynssde") + private BigDecimal ljynssde; + + /** + * 绋庣巼 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绋庣巼", width = "10%", column = "sl") + @ExcelHead(title = "绋庣巼", dataIndex = "sl") + private BigDecimal sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "閫熺畻鎵i櫎鏁", width = "10%", column = "sskcs") + @ExcelHead(title = "閫熺畻鎵i櫎鏁", dataIndex = "sskcs") + private BigDecimal sskcs; + + /** + * 绱搴旂撼绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱搴旂撼绋庨", width = "10%", column = "ljynse") + @ExcelHead(title = "绱搴旂撼绋庨", dataIndex = "ljynse") + private BigDecimal ljynse; + + /** + * 绱鍑忓厤绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍑忓厤绋庨", width = "10%", column = "ljjmse") + @ExcelHead(title = "绱鍑忓厤绋庨", dataIndex = "ljjmse") + private BigDecimal ljjmse; + + /** + * 绱搴旀墸缂寸◣棰 蹇呭~锛歯ull 绱搴旀墸缂寸◣棰 = 绱搴旂撼绋庨 - 绱鍑忓厤绋庨 + */ + @SalaryTableColumn(text = "绱搴旀墸缂寸◣棰", width = "10%", column = "ljyingkjse") + @ExcelHead(title = "绱搴旀墸缂寸◣棰", dataIndex = "ljyingkjse") + private BigDecimal ljyingkjse; + /** + * 绱宸茬即绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱宸茬即绋庨", width = "10%", column = "ljykjse") + @ExcelHead(title = "绱宸茬即绋庨", dataIndex = "ljykjse") + private BigDecimal ljykjse; + /** + * 宸茬即绋庨 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ykjse; + + /** + * 绱涓撻」闄勫姞鎵i櫎棰 蹇呭~锛歯ull 涓撻」闄勫姞鍚堣 + */ + private BigDecimal ljzxfjkce; + + /** + * 搴旇ˉ閫绋庨 蹇呭~锛歯ull 搴旇ˉ閫绋庨=绱搴旀墸缂寸◣棰-绱宸茬即绋庨 + */ + @SalaryTableColumn(text = "搴旇ˉ(閫)绋庨", width = "10%", column = "ybtse") + @ExcelHead(title = "搴旇ˉ(閫)绋庨", dataIndex = "ybtse") + private BigDecimal ybtse; + + /** + * 瀛愬コ鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal znjyzc; + /** + * 璧″吇鑰佷汉鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal sylrzc; + /** + * 浣忔埧璐锋鍒╂伅鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal zfdklxzc; + /** + * 浣忔埧绉熼噾鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal zfzjzc; + /** + * 缁х画鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal jxjyzc; + /** + * 闈炲鍘嗙户缁暀鑲叉敮鍑 蹇呭~锛歯ull + */ + private BigDecimal fxljxjyzc; + /** + * 3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal yyezhzc; + + + /** + * 鍑忛櫎璐圭敤 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾鐨勫噺闄よ垂鐢ㄣ 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉鐨勮垂鐢 + */ + private BigDecimal jcfy; + /** + * 鍏朵粬鎵i櫎鍚堣 蹇呭~锛歯ull + */ + private BigDecimal qtckhj; + /** + * 搴旂撼绋庢墍寰楅 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ynse; + + /** + * 搴旀墸缂寸◣棰 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal yingkjse; + + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 姝e父宸ヨ祫钖噾锛涘叏骞翠竴娆℃у閲戞敹鍏ワ紱绋块叕鎵寰楋紱鍔冲姟鎶ラ叕 + */ + private String sdxm; + + /** + * 绱鏈堝噺闄よ垂鐢 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal ljyjcfy; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal yxkcsf; + /** + * 灞曚笟鎴愭湰 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal zycb; + /** + * 鏈堝噺闄よ垂鐢 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal yjcfy; + + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛歯ull + */ + private String ljgryljjym; + /** + * 浼佷笟涓婃湀鏄惁宸茬敵鎶 蹇呭~锛歯ull 浠呭湪涓や釜鏈堢畻绋庡満鏅椂浣跨敤锛屽綋鍓嶆湀鍒嗕负N鏈堬細 + * 0琛ㄧずN-1鏈堬紙涓婃湀锛夋湭鐢虫姤 + * 1琛ㄧずN-1鏈堬紙涓婃湀锛夊凡鐢虫姤 + * 2琛ㄧずN-2鏈堬紙涓婁笂涓湀锛夋湭鐢虫姤 + */ + private String qysysfysb; + /** + * 鍛樺伐鍦ㄧ◣灞绱宸叉墸缂寸殑绋庨 蹇呭~锛歯ull 褰撳墠鏈堝垎涓篘,濡傛灉N-1锛堜笂鏈堬級宸茬敵鎶ワ紝鍒欒繑鍥濶-1鏈堝憳宸ュ湪绋庡眬绱宸叉墸缂寸殑绋庨; + * 濡傛灉N-1鏈堟湭鐢虫姤锛屽垯杩斿洖N-2鏈堝伐鍦ㄧ◣灞绱宸叉墸缂寸殑绋庨; + */ + private BigDecimal ygzsjljykjse; + + /** + * 鏈湀宸茬疮璁℃墸闄ょ◣棰 蹇呭~锛歯ull 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁 + */ + private BigDecimal byyljkjse; + /** + * 鏈搴旀墸缂寸◣棰 蹇呭~锛歯ull 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁锛屾湰娆″簲鎵g即绋庨=鏈湀搴旀墸缂寸◣棰-鏈湀宸茬疮璁$◣棰 + */ + private BigDecimal bcykjse; + /** + * 鍒嗘憡骞村害鏁 蹇呭~锛歯ull + */ + private Integer ftnds; + /** + * 骞村噺闄よ垂鐢 蹇呭~锛歯ull 榛樿涓60000 + */ + private BigDecimal njcfy; + + } + + /** + * 4.4.1.3.2绠楃◣澶辫触鍘熷洜瀵硅薄 + */ + @Data + public static class sssbyydx { + /** + * 浜哄憳ID + */ + private Integer ygid; + /** + * 浜哄憳鍚嶇О + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 閿欒鐮 + */ + private String cwm; + /** + * 閿欒淇℃伅 + */ + private String cwxx; + /** + * 鎵寰楃◣鐨刢ode + */ + private String sdxmdm; + /** + * 鎵寰楃◣鐨勫悕绉 + */ + private String sdxmmc; + } + + } + + } + + /** + * 鍒嗙被鎵寰 + */ + @Data + public static class flsd { + + /** + * 鍒╂伅鑲℃伅绾㈠埄鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx lxgxhllb; + /** + * 鑲℃潈杞鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx ggzrlb; + /** + * 鍏朵粬璐骇杞鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx qtcczrlb; + /** + * 鍋剁劧鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx orsdlb; + /** + * 鍏朵粬璐骇绉熻祦鍒楄〃 蹇呭~锛歯ull + */ + private flsdssjgdx qtcczllb; + /** + * 涓婂競鍏徃鑲℃伅绾㈠埄 蹇呭~锛歯ull + */ + private flsdssjgdx ssgsgxhllb; + /** + * 涓汉鎴垮眿鍑虹鎵寰楀垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx grfwczsdlb; + /** + * 闅忔満璧犻佺ぜ鍝佸垪琛 蹇呭~锛歯ull + */ + private flsdssjgdx sjzslplb; + /** + * 涓夋澘甯傚満鑲℃伅绾㈠埄鎵寰 蹇呭~锛歯ull + */ + private flsdssjgdx sbscgxhllb; + /** + * 璇佸姷璧勯噾鍒╂伅鎵寰 蹇呭~锛歯ull + */ + private flsdssjgdx zjzjlxlb; + + + /** + * 4.3.1.3.3.1鍒嗙被鎵寰楃畻绋庣粨鏋滃璞 + */ + @Data + public static class flsdssjgdx { + /** + * 绠楃◣鎴愬姛鍒楄〃 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 绠楃◣澶辫触鍒楄〃 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 澶辫触鍘熷洜鍒楄〃 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 绠楃◣鎬讳汉鏁 + */ + private int sszrs; + /** + * 澶辫触鎬讳汉鏁 + */ + private int sssbrs; + + /** + * 鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + @Data + public static class flsdscbw { + /** + * 鏄惁鏄庣粏鐢虫姤 蹇呭~锛氬惁 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 濮撳悕 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "xm") + @ExcelHead(title = "濮撳悕", dataIndex = "xm") + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "zzlx") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "zzlx") + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛歯ull 姹囨荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "zzhm") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "zzhm") + private String zzhm; + /** + * 鏀跺叆棰 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鏈湡鏀跺叆", width = "10%", column = "sre") + @ExcelHead(title = "鏈湡鏀跺叆", dataIndex = "sre") + private String sre; + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鏈湡鍏嶇◣鏀跺叆", width = "10%", column = "mssd") + @ExcelHead(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "mssd") + private String mssd; + /** + * 璐骇鍘熷 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "璐骇鍘熷", width = "10%", column = "ccyz") + @ExcelHead(title = "璐骇鍘熷", dataIndex = "ccyz") + private String ccyz; + /** + * 鍏佽鎵i櫎鐨勭◣璐 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍏佽鎵i櫎鐨勭◣璐", width = "10%", column = "yxkcsf") + @ExcelHead(title = "鍏佽鎵i櫎鐨勭◣璐", dataIndex = "yxkcsf") + private String yxkcsf; + /** + * 鎶曡祫鎶垫墸 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鎶曡祫鎶垫墸", width = "10%", column = "tzdk") + @ExcelHead(title = "鎶曡祫鎶垫墸", dataIndex = "tzdk") + private String tzdk; + /** + * 鍏朵粬 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "qt") + @ExcelHead(title = "鍏朵粬", dataIndex = "qt") + private String qt; + /** + * 澶囨敞 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "澶囨敞", width = "10%", column = "bz") + @ExcelHead(title = "澶囨敞", dataIndex = "bz") + private String bz; + /** + * 鍑忛櫎璐圭敤 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍑忛櫎璐圭敤", width = "10%", column = "jcfy") + @ExcelHead(title = "鍑忛櫎璐圭敤", dataIndex = "jcfy") + private String jcfy; + /** + * 鍑忚姣斾緥 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍑忚姣斾緥", width = "10%", column = "jjbl") + @ExcelHead(title = "鍑忚姣斾緥", dataIndex = "jjbl") + private String jjbl; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "zykcjze") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "zykcjze") + private String zykcjze; + /** + * 绋庡墠鎵i櫎椤圭洰鍚堣 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "绋庡墠鎵i櫎椤圭洰鍚堣", width = "10%", column = "sqkcxmhj") + @ExcelHead(title = "绋庡墠鎵i櫎椤圭洰鍚堣", dataIndex = "sqkcxmhj") + private String sqkcxmhj; + /** + * 搴旂撼绋庢墍寰楅 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旂撼绋庢墍寰楅", width = "10%", column = "ynssde") + @ExcelHead(title = "搴旂撼绋庢墍寰楅", dataIndex = "ynssde") + private String ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旂撼绋庨", width = "10%", column = "ynse") + @ExcelHead(title = "搴旂撼绋庨", dataIndex = "ynse") + private String ynse; + /** + * 鍑忓厤绋庨 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "jmse") + @ExcelHead(title = "鍑忓厤绋庨", dataIndex = "jmse") + private String jmse; + /** + * 宸茬即绋庨 蹇呭~锛氭槸 鏃犻渶濉啓璇ュ硷紝鎸0澶勭悊 + */ + @SalaryTableColumn(text = "宸茬即绋庨", width = "10%", column = "ykjse") + @ExcelHead(title = "宸茬即绋庨", dataIndex = "ykjse") + private String ykjse; + /** + * 搴旀墸缂寸◣棰 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旀墸缂寸◣棰", width = "10%", column = "yingkjse") + @ExcelHead(title = "搴旀墸缂寸◣棰", dataIndex = "yingkjse") + private String yingkjse; + /** + * 绋庣巼 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "绋庣巼", width = "10%", column = "sl") + @ExcelHead(title = "绋庣巼", dataIndex = "sl") + private String sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "閫熺畻鎵i櫎鏁", width = "10%", column = "sskcs") + @ExcelHead(title = "閫熺畻鎵i櫎鏁", dataIndex = "sskcs") + private String sskcs; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旇ˉ閫绋庨", width = "10%", column = "ybtse") + @ExcelHead(title = "搴旇ˉ閫绋庨", dataIndex = "ybtse") + private String ybtse; + /** + * 鍒嗙被鎵寰楀悕瀛 蹇呭~锛氭槸 鍒嗙被鎵寰楄柂閲戠被鍒-鍒╂伅鑲℃伅绾㈠埄鎵寰楋紝鑲℃潈杞鎵寰楋紝鍏朵粬璐骇杞鎵寰楋紝鍋剁劧鎵寰楋紝鍏朵粬鎵寰" + */ + private String sdxm; + /** + * 鎵寰楁湡闂磋捣 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjq; + /** + * 鎵寰楁湡闂存 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjz; + } + } + } + + @Data + public static class fjmsd { + /** + * 姝e父宸ヨ祫钖噾锛堟棤浣忔墍涓汉姝e父宸ヨ祫钖噾锛夋墍寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx wjgzxjlb; + /** + * 鏃犱綇鎵涓汉鏁版湀濂栭噾鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx wjrysyjjlb; + /** + * 鍔冲姟鎶ラ叕鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx lwbclb; + /** + * 绋块叕鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx gcsdlb; + /** + * 鍒╂伅濮戞伅绾㈠埄鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx lxgxhllb; + /** + * 鑲℃潈杞鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx gqzrlb; + /** + * 鍏朵粬璐骇杞鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx qtcczrlb; + /** + * 鍋剁劧鎵寰楀垪琛 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx orsdlb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛樿柂閲戠畻绋庣粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx bxyxy; + /** + * 璇佸埜缁忕邯浜鸿柂閲戠畻绋庣粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx zqjjr; + /** + * 涓汉鑲℃潈婵鍔辩粨鏋滃璞 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx grgqjl; + /** + * 鐗硅鏉冧娇鐢ㄨ垂鎵寰 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx txqsyfsd; + /** + * 涓汉鎴垮眿鍑虹鎵寰 鍙傝冮潪灞呮皯鎵寰楃畻绋庣粨鏋滃璞 + */ + private fjmsdssjgdx grfwczsd; + + /** + * 闈炲眳姘戞墍寰楃畻绋庣粨鏋滃璞 + */ + @Data + public static class fjmsdssjgdx { + /** + * 闈炲眳姘戠畻绋庢垚鍔熷垪琛 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 闈炲眳姘戠畻绋庡け璐ュ垪琛 鍙傝冭緭鍏ユ姤鏂囬潪灞呮皯鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 闈炲眳姘戠畻绋庡け璐ュ師鍥犲垪琛 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 鍙備笌闈炲眳姘戠畻绋庢讳汉鏁 + */ + private int sszrs; + /** + * 闈炲眳姘戠畻绋庡け璐ユ讳汉鏁 + */ + private int sssbrs; + + /** + * 4.4.1.3.4.2闈炲眳姘戞墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + @Data + public static class fjmsdscbw { + /** + * 濮撳悕 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "xm") + @ExcelHead(title = "濮撳悕", dataIndex = "xm") + private String xm; + + /** + * 璇佷欢绫诲瀷鍚嶇О 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "zzlx") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "zzlx") + private String zzlx; + + /** + * 璇佷欢鍙风爜 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "zzhm") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "zzhm") + private String zzhm; + + /** + * 鏀跺叆棰 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鏀跺叆棰", width = "10%", column = "sre") + @ExcelHead(title = "鏀跺叆棰", dataIndex = "sre") + private String sre; + + /** + * 绱鏀跺叆锛堜笉鍚湰娆★級 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "绱鏀跺叆锛堜笉鍚湰娆★級", width = "10%", column = "ljsre") + @ExcelHead(title = "绱鏀跺叆锛堜笉鍚湰娆★級", dataIndex = "ljsre") + private String ljsre; + + /** + * 鍏嶇◣鏀跺叆 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍏嶇◣鏀跺叆", width = "10%", column = "mssd") + @ExcelHead(title = "鍏嶇◣鏀跺叆", dataIndex = "mssd") + private String mssd; + /** + * 璐骇鍘熷 蹇呭~锛氭槸 + */ + private String ccyz; + /** + * 鍏佽鎵i櫎鐨勭◣璐 蹇呭~锛氭槸 + */ + private String yxkcsf; + /** + * 鎶曡祫鎶垫墸 蹇呭~锛氭槸 + */ + private String tzdk; + /** + * 鍏朵粬 蹇呭~锛氭槸 + */ + private String qt; + /** + * 澶囨敞 蹇呭~锛氭槸 + */ + private String bz; + /** + * 瀹為檯宸ヤ綔骞撮檺 蹇呭~锛氭槸 + */ + private String sjgznxs; + /** + * 鍑忛櫎璐圭敤 蹇呭~锛氭槸 + */ + private String jcfy; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "zykcjze") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "zykcjze") + private String zykcjze; + /** + * 绋庡墠鎵i櫎椤圭洰鍚堣 蹇呭~锛氭槸 + */ + private String sqkcxmhj; + /** + * 搴旂撼绋庨鎵寰楅 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旂撼绋庨鎵寰楅", width = "10%", column = "ynssde") + @ExcelHead(title = "搴旂撼绋庨鎵寰楅", dataIndex = "ynssde") + private String ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旂撼绋庨", width = "10%", column = "ynse") + @ExcelHead(title = "搴旂撼绋庨", dataIndex = "ynse") + private String ynse; + /** + * 鍑忓厤绋庨 蹇呭~锛氭槸 + */ + private String jmse; + /** + * 搴旀墸缂寸◣棰 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旀墸缂寸◣棰", width = "10%", column = "yingkjse") + @ExcelHead(title = "搴旀墸缂寸◣棰", dataIndex = "yingkjse") + private String yingkjse; + /** + * 宸叉墸缂寸◣棰 蹇呭~锛氭槸 鏃犻渶濉啓璇ュ硷紝鎸0澶勭悊 + */ + @SalaryTableColumn(text = "宸叉墸缂寸◣棰", width = "10%", column = "ykjse") + @ExcelHead(title = "宸叉墸缂寸◣棰", dataIndex = "ykjse") + private String ykjse; + /** + * 绋庣巼 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "绋庣巼", width = "10%", column = "sl") + @ExcelHead(title = "绋庣巼", dataIndex = "sl") + private String sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "閫熺畻鎵i櫎鏁", width = "10%", column = "sskcs") + @ExcelHead(title = "閫熺畻鎵i櫎鏁", dataIndex = "sskcs") + private String sskcs; + /** + * 浠f姤鏂瑰紡 蹇呭~锛氭槸 + */ + private String sbfs; + /** + * 搴旇ˉ閫绋庨 蹇呭~锛氭槸 + */ + @SalaryTableColumn(text = "搴旇ˉ閫绋庨", width = "10%", column = "ybtse") + @ExcelHead(title = "搴旇ˉ閫绋庨", dataIndex = "ybtse") + private String ybtse; + /** + * 闈炲眳姘戞墍寰楅」鐩悕瀛 蹇呭~锛氭槸闈炲眳姘戞墍寰楄柂閲戠被鍒-鏃犱綇鎵涓汉姝e父宸ヨ祫钖噾銆佸叏骞翠竴娆℃у閲戞敹鍏 + */ + private String sdxm; + /** + * 鎵寰楁湡闂磋捣 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjq; + /** + * 鎵寰楁湡闂存 蹇呭~锛氭槸 YYYY-MM + */ + private String sdqjz; + } + } + } + + + /** + * 浜哄憳鐢虫姤澶辫触鍒楄〃 蹇呭~锛氭槸 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + + /** + * 4.4.1.3.1.1浜哄憳浠f姤缁撴灉瀵硅薄 + */ + @Data + public static class rydbjgdx { + /** + * 浜哄憳ID + */ + private Integer ygid; + /** + * 浜哄憳鍚嶇О + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 閿欒鐮 + */ + private String cwm; + /** + * 閿欒淇℃伅 + */ + private String cwxx; + /** + * 鎵寰楃◣鐨刢ode + */ + private String sdxmdm; + /** + * 鎵寰楃◣鐨勫悕绉 + */ + private String sdxmmc; + } + } + + +} diff --git a/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java new file mode 100644 index 000000000..783f5f359 --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java @@ -0,0 +1,75 @@ +package com.engine.salary.remote.tax.response.deductionAmount; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 鎵i櫎鍚嶅崟纭鍙嶉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@EqualsAndHashCode(callSuper = true) +public class ConfirmFeedbackResponse extends BaseResponse { + + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + /** + * 绁炲窞浜戝悎鎺ュ彛杩斿洖鐘舵佸疄浣撶被 + **/ + @Data + public static class Body { + + /** + * 鎬讳汉鏁 + */ + private String zrs; + /** + * 鎴愬姛浜烘暟 + */ + private String cgrs; + /** + * 澶辫触浜烘暟 + */ + private String sbrs; + /** + * 鎵i櫎纭澶辫触鍒楄〃 + */ + private List kcqrsblb; + + @Data + public static class kcqrsb { + + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 鍥界睄 + */ + private String gj; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + } + } + +} diff --git a/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java new file mode 100644 index 000000000..300dc9a1a --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/employee/GetCompanyEmployeeResponse.java @@ -0,0 +1,334 @@ +package com.engine.salary.remote.tax.response.employee; + +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetCompanyEmployeeResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private List body; + + + @Data + public static class Employee { + /** + * 鍏朵粬璇佷欢绫诲瀷 蹇呭~锛氭潯浠跺繀濉 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String qtzzlx; + + + /** + * 鍛樺伐濮撳悕 蹇呭~锛氱撼绋庝汉濮撳悕 + */ + private String xm; + + /** + * 璇佷欢绫诲瀷 蹇呭~锛氳璇佷欢绫诲瀷瀛楀吀 + */ + private String zzlx; + + /** + * 璇佷欢鍙风爜 蹇呭~锛 + */ + private String zzhm; + + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭潯浠跺繀濉 鑻ヤ汉鍛樺瓨鍦ㄩ儴闂ㄧ紪鍙峰垯杩斿洖 + */ + private String bmbh; + + /** + * 鍏朵粬璇佷欢鍙风爜 蹇呭~锛氭潯浠跺繀濉 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String qtzzhm; + + /** + * 宸ュ彿 蹇呭~锛氬惁 + */ + private String gh; + + /** + * 鎶ラ佺姸鎬 蹇呭~锛 1 寰呮姤閫 2 鎶ラ佷腑 3 鎶ラ佸け璐 4 鎶ラ佹垚鍔 + */ + private String sbzt; + + + /** + * 楠岃瘉鐘舵 蹇呭~锛 0 鑻ユ槸韬唤璇侊紝鐘舵佷负楠岃瘉涓紱鍏朵粬璇佷欢涓烘殏涓嶉獙璇 1 楠岃瘉閫氳繃 2 楠岃瘉涓嶉氳繃 4 寰呴獙璇 9 鍚屼唬鐮0澶勭悊 + */ + private String rzzt; + + /** + * 浠昏亴鍙楅泧绫诲瀷 蹇呭~锛氭槸 鍙夋嫨闆囧憳銆佷繚闄╄惀閿鍛樸佽瘉鍒哥粡绾汉銆佸叾浠栥佸疄涔犲鐢燂紙鍏ㄦ棩鍒跺鍘嗘暀鑲诧級 + */ + private String sfgy; + + /** + * 鎵灞炴湡 蹇呭~锛氬惁 YYYYMM + */ + private String skssq; + + /** + * 鐢佃瘽鍙风爜 蹇呭~锛氭槸 11浣嶆墜鏈哄彿鐮 + */ + private String lxdh; + + /** + * 浜哄憳鐘舵 蹇呭~锛氭槸 0 锛氭甯 1 锛氶潪姝e父 + */ + private String nsrzt; + + /** + * 鍏ヨ亴骞村害灏变笟鎯呭舰 蹇呭~锛氬惁 + */ + private String rzndjyqk; + + /** + * 鍙楅泧鏃ユ湡 蹇呭~锛氭潯浠跺繀濉 YYYY-MM-DD, + */ + private String rzsgrq; + + /** + * 鎬у埆 蹇呭~锛氭槸 1:鐢 2锛氬コ + */ + private String xb; + + /** + * 鍑虹敓鏃ユ湡 蹇呭~锛氭槸 YYYY-MM-DD + */ + private String csny; + + /** + * 鍥界睄 蹇呭~锛氭槸 瑙佸浗绫嶅瓧鍏 + */ + private String gj; + + /** + * 浜哄憳鍦板尯 蹇呭~锛氭槸 1:澧冨唴 2:澧冨 + */ + private String rydq; + + /** + * 绂昏亴鏃ユ湡 蹇呭~锛氬惁 YYYY-MM-DD,涓嶈兘澶т簬褰撳墠鏃堕棿 + */ + private String lzrq; + + /** + * 涓汉鎶曡祫鎬婚 蹇呭~锛氭潯浠跺繀濉 褰撲负鑲′笢鎶曡祫鑰呮椂蹇呭~ + */ + private BigDecimal grgbze; + /** + * 涓汉鎶曡祫姣斾緥 蹇呭~锛氬惁 鑼冨洿涓0~100锛屼笉鍖呭惈0 + */ + private BigDecimal grgbbl; + + /** + * 鏄惁娈嬬柧 蹇呭~锛氬惁 0锛氬惁 1锛氭槸 + */ + private String sfcj; + + /** + * 鏄惁鐑堝睘 蹇呭~锛氬惁 0锛氬惁 1锛氭槸 + */ + private String sfls; + + /** + * 鏄惁瀛よ 蹇呭~锛氬惁 0锛氬惁 1锛氭槸 + */ + private String sfgl; + + /** + * 娈嬬柧璇佸彿 蹇呭~锛氭潯浠跺繀濉 + */ + private String cjzh; + + /** + * 鐑堝睘璇佸彿 蹇呭~锛氭潯浠跺繀濉 + */ + private String lszh; + + /** + * 閭 蹇呭~锛氬惁 + */ + private String dzyx; + + /** + * 瀛﹀巻 蹇呭~锛氬惁 10锛氱爺绌剁敓 20锛氬ぇ瀛︽湰绉 30锛氬ぇ瀛︽湰绉戜互涓 + */ + private String xl; + + /** + * 鑱屽姟 蹇呭~锛氬惁 1锛氶珮灞 3锛氭櫘閫 + */ + private String zw; + + /** + * 浜哄憳鐘舵佸悕绉 蹇呭~锛氬惁 + */ + private String nsrztmc; + + /** + * 鎬у埆鍚嶇О 蹇呭~锛氬惁 + */ + private String xbmc; + + /** + * 浜哄憳鍦板尯鍚嶇О 蹇呭~锛氬惁 + */ + private String rydqmc; + + /** + * 鏄惁娈嬬柧鍚嶇О 蹇呭~锛氬惁 + */ + private String sfcjmc; + + /** + * 鏄惁鐑堝睘鍚嶇О 蹇呭~锛氬惁 + */ + private String sflsmc; + + /** + * 鏄惁瀛よ佸悕绉 蹇呭~锛氬惁 + */ + private String sfglmc; + + /** + * 瀛﹀巻鍚嶇О 蹇呭~锛氬惁 + */ + private String xlmc; + + /** + * 鑱屽姟鍚嶇О 蹇呭~锛氬惁 + */ + private String zwmc; + + /** + * 寮鎴烽摱琛 蹇呭~锛氬惁 + */ + private String khyh; + + /** + * 閾惰璐﹀彿 蹇呭~锛氬惁 + */ + private String yhzh; + + /** + * 灞呬綇鐪佷唤 蹇呭~锛氬惁 涓枃锛屼緥濡傛禉姹熺渷 + */ + private String lxdz_sheng; + + /** + * 灞呬綇鍩庡競 蹇呭~锛氬惁 涓枃锛屼緥濡傛澀宸炲競 + */ + private String lxdz_shi; + + /** + * 灞呬綇鍖哄幙 蹇呭~锛氬惁 涓枃锛屼緥濡傛花姹熷尯 + */ + private String lxdz_qx; + + /** + * 灞呬綇琛楅亾 蹇呭~锛氬惁 + */ + private String lxdz_jd; + + /** + * 灞呬綇璇︾粏鍦板潃 蹇呭~锛氬惁 + */ + private String lxdz; + + /** + * 鎴风睄鐪佷唤 蹇呭~锛氬惁 涓枃锛屼緥濡傛禉姹熺渷 + */ + private String hjszd_sheng; + + /** + * 鎴风睄鍩庡競 蹇呭~锛氬惁 涓枃锛屼緥濡傛澀宸炲競 + */ + private String hjszd_shi; + + /** + * 鎴风睄鍖哄幙 蹇呭~锛氬惁 涓枃锛屼緥濡傛花姹熷尯 + */ + private String hjszd_qx; + + /** + * 鎴风睄琛楅亾 蹇呭~锛氬惁 + */ + private String hjszd_jd; + + /** + * 鎴风睄璇︾粏鍦板潃 蹇呭~锛氬惁 + */ + private String hjszd_xxdz; + + /** + * 澶囨敞 蹇呭~锛氬惁 + */ + private String bz; + + /** + * 鍑虹敓鍦 蹇呭~锛氭潯浠跺繀濉 澶栫睄浜哄憳蹇呭~锛屽~鍐欏嚭鐢熷湴鍥藉锛堝湴鍖鸿鍥界睄瀛楀吀 + */ + private String csd; + + /** + * 娑夌◣浜嬬敱 蹇呭~锛氭槸 ("10","浠昏亴鍙楅泧")("20","鎻愪緵涓存椂鍔冲姟")("30","杞璐骇")("40","浠庝簨鎶曡祫鍜岀粡钀ユ椿鍔")("90","鍏朵粬"), + */ + private String sssx; + + + /** + * 棣栨鍏ュ鏃堕棿 蹇呭~锛氭潯浠跺繀濉 璇佷欢绫诲瀷涓烘腐婢冲眳姘戞潵寰鍐呭湴閫氳璇併佹腐婢冲眳姘戝眳浣忚瘉銆佸彴婀惧眳姘戞潵寰澶ч檰閫氳璇併佸彴婀惧眳姘戝眳浣忚瘉銆佸鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丄銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丅銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丆鏃讹紝涓斾换鑱屽彈闆囩被鍨嬮夋嫨闆囧憳鏃跺繀濉紝鏍煎紡YYYY-MM-DD + */ + private String scrjsj; + + /** + * 棰勮绂诲鏃堕棿 蹇呭~锛氭潯浠跺繀濉 璇佷欢绫诲瀷涓烘腐婢冲眳姘戞潵寰鍐呭湴閫氳璇併佹腐婢冲眳姘戝眳浣忚瘉銆佸彴婀惧眳姘戞潵寰澶ч檰閫氳璇併佸彴婀惧眳姘戝眳浣忚瘉銆佸鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丄銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丅銆佸鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丆鏃讹紝涓斾换鑱屽彈闆囩被鍨嬮夋嫨闆囧憳鏃跺繀濉紝鏍煎紡YYYY-MM-DD + */ + private String yjljsj; + + /** + * 鑱旂郴鍦扮渷浠 蹇呭~锛氬惁 + */ + private String wjrlxdz_sheng; + + /** + * 鑱旂郴鍦板煄甯 蹇呭~锛氬惁 + */ + private String wjrlxdz_shi; + + /** + * 鑱旂郴鍦板尯鍘 蹇呭~锛氬惁 + */ + private String wjrlxdz_qx; + + /** + * 鑱旂郴鍦拌閬 蹇呭~锛氬惁 + */ + private String wjrlxdz_jd; + + /** + * 鑱旂郴鍦拌缁嗗湴鍧 蹇呭~锛氬惁 + */ + private String wjrlxdz_xxdz; + + /** + * 涓枃鍚 蹇呭~锛氬惁 璇佷欢绫诲瀷涓哄鍥芥姢鐓с佸鍥戒汉姘镐箙灞呯暀韬唤璇併佸鍥戒汉宸ヤ綔璁稿彲璇侊紙A绫伙級銆佸鍥戒汉宸ヤ綔璁稿彲璇侊紙B绫伙級銆佸鍥戒汉宸ヤ綔璁稿彲璇侊紙C绫伙級鏃朵笉鍙~鍐欙紝鍏朵粬璇佷欢绫诲瀷鍙~鍐欍傚鏋滄湁濉啓蹇呴』涓轰腑鏂 + */ + private String xmzw; + + /** + * 娑夌◣浜嬮」鏄惁鎵i櫎鍑忛櫎璐圭敤 蹇呭~锛氬惁 + */ + private String sfzdw; + + } +} diff --git a/src/com/engine/salary/report/common/constant/SalaryConstant.java b/src/com/engine/salary/report/common/constant/SalaryConstant.java index b6af93d9d..4e3a32a5f 100644 --- a/src/com/engine/salary/report/common/constant/SalaryConstant.java +++ b/src/com/engine/salary/report/common/constant/SalaryConstant.java @@ -9,4 +9,35 @@ public class SalaryConstant { * 鍒楄〃涓柂璧勯」鐩姩鎬佸垪鍚庣紑鏍囪瘑 */ public static final String DYNAMIC_SUFFIX = "_salaryItem"; + + /** + * 妯″潡鏍囪瘑 + */ + public static final String MODULE = "hrmsalary"; + + /** + * 鍏叡绉熸埛鏍囪瘑 + */ + public static final String DEFAULT_TENANT_KEY = "all_teams"; + /** + * 閫氱敤鐨勫垎闅旂 + */ + public static final String COMMON_SEPARATOR = "-"; + /** + * 涓嬪垝绾 + */ + public static final String FORMULA_VAR_SEPARATOR = "_"; + /** + * 涓嬪垝绾垮垎闅旂 + */ + public static final String UNDERLINE_SEPARATOR = "_"; + /** + * 瀹屾暣涓诲煙鍚 + */ + public static final String PRIMARY_DOMAIN = "primary.domain"; + + /** + * 鍥剧墖鍏叡鍦板潃 + */ + public static final String IMG_URL = "/papi/file/preview?type=imgs&fileId=%s&random=123456"; } diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java index 2a4bdd282..727f8b2f4 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java @@ -343,7 +343,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { } // public Map exportDetailList(SalaryStatisticsEmployeeDetailQueryParam queryParam) { -// SalaryAssert.notNull(queryParam.getEmployeeId(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 163974, "浜哄憳id涓嶈兘涓虹┖")); +// SalaryAssert.notNull(queryParam.getEmployeeId(), SalaryI18nUtil.getI18nLabel( 163974, "浜哄憳id涓嶈兘涓虹┖")); // // 鏋勫缓寮傛瀵煎嚭鍙傛暟 // Map map = salaryBatchService.buildeExportParam("exportSalaryStatisticsEmployeeDetailList"); // LocalRunnable localRunnable = new LocalRunnable() { diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 514564b4b..0f28d8a45 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; @@ -145,7 +145,45 @@ public interface AddUpDeductionService { * @return void * @author lfc */ - String autoAddAll(Date yearMonth, boolean isAdmin, List taxAgentIds); + String autoAddAll(Date yearMonth, Boolean isAdmin, List taxAgentIds); + + /** + * 鍦ㄧ嚎鑾峰彇鏁版嵁 + * + * @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); List listAuth(AddUpDeductionQueryParam param); } diff --git a/src/com/engine/salary/service/ApiTaskService.java b/src/com/engine/salary/service/ApiTaskService.java new file mode 100644 index 000000000..bdf3ac137 --- /dev/null +++ b/src/com/engine/salary/service/ApiTaskService.java @@ -0,0 +1,7 @@ +package com.engine.salary.service; + +public interface ApiTaskService { + + void writeApiTaskRecord (String source,String api,String param,String response); + +} diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java new file mode 100644 index 000000000..5609882e9 --- /dev/null +++ b/src/com/engine/salary/service/DeductionAmountService.java @@ -0,0 +1,30 @@ +package com.engine.salary.service; + +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; +import com.engine.salary.entity.deductionamount.param.*; + +/** + * 骞存敹鍏ヤ笉瓒6涓囧厓鐨勭撼绋庝汉鏆備笉棰勬墸棰勭即绋庢鎵i櫎鍚嶅崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface DeductionAmountService { + + PageInfo list(DeductionAmountListParam param); + + void add(DeductionAmountAddParam param); + + void edit(DeductionAmountEditParam param); + + void delete(DeductionAmountDeleteParam param); + + Object query(DeductionAmountOnlineQueryParam param); + + String confirm(DeductionAmountConfirmParam param); + + String feedback(DeductionAmountFeedBackParam param); +} diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java new file mode 100644 index 000000000..cce2e72e9 --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -0,0 +1,72 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.util.Map; + +/** + * @description: 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ鍑 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 9/5/22 10:22 AM + * @version:v1.0 + */ +public interface EmployeeDeclareExcelService { + + /** + * 瀵煎嚭涓嬭浇妯℃澘 + * + * @param importParam + * @return + */ + XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam); + + + /** + * 瀵煎叆棰勮 + * @param param + * @return + */ + Map preview(EmployeeDeclareImportParam param); + + /** + * 瀵煎叆浜哄憳鎶ラ佹暟鎹 + * @param param + * @return + */ + Map importData(EmployeeDeclareImportParam param); + + /** + * 瀵煎嚭浜哄憳淇℃伅閲囬泦-鍏ㄩ儴 + * + * @param queryParam + * @return + */ + XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam); + +// /** +// * 瀵煎嚭浜哄憳淇℃伅閲囬泦-鏈湀鏂板 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Add(EmployeeDeclareAddListQueryParam queryParam); +// +// /** +// * 瀵煎嚭浜哄憳淇℃伅閲囬泦-鏈湀淇℃伅鍙樺姩 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Update(EmployeeDeclareListQueryParam queryParam); +// +// /** +// * 瀵煎嚭浜哄憳淇℃伅閲囬泦-鏈湀鎶ラ佸け璐 +// * +// * @param queryParam +// * @return +// */ +// XSSFWorkbook export4Fail(EmployeeDeclareFailListQueryParam queryParam); +} diff --git a/src/com/engine/salary/service/EmployeeDeclareRecordService.java b/src/com/engine/salary/service/EmployeeDeclareRecordService.java new file mode 100644 index 000000000..825c5e920 --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareRecordService.java @@ -0,0 +1,22 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; + +import java.util.Date; + +/** + * 鍛樺伐鎶ラ佽褰 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface EmployeeDeclareRecordService { + + EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); + + void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); + + void save(EmployeeDeclareRecordPO employeeDeclareRecord); +} diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java new file mode 100644 index 000000000..715f4d428 --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -0,0 +1,197 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface EmployeeDeclareService{ + + /** + * 鏌ヨ浜哄憳鎶ラ佷俊鎭 + * + * @param id + * @return + */ + EmployeeDeclarePO getById(Long id); + + /** + * 鏌ヨ浜哄憳鎶ラ佷俊鎭 + * + * @param ids + * @return + */ + List listByIds(Collection ids); + + /** + * 鏌ヨ浜哄憳鎶ラ佷俊鎭 + * + * @param taxCycle + * @param taxAgentId + * @return + */ + List listByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId); + + /** + * 鏌ヨ浜哄憳鎶ラ佷俊鎭 + * + * @param taxCycle + * @param taxAgentId + * @param employeeIds + * @return + */ + List listByTaxCycleAndTaxAgentIdAndEmployeeIds(Date taxCycle, Long taxAgentId, + Collection employeeIds); + + /** + * 鏌ヨ浜哄憳鎶ラ佷俊鎭 + * + * @param queryParam + * @return + */ + List listByParam(EmployeeDeclareListQueryParam queryParam); + + + /** + * 鏌ヨ浜哄憳鎶ラ-鏈湀鏂板 + * * + * + * @param queryParam + * @return + */ + List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam); + + /** + * 鏈湀鍙樺姩 + * + * @param queryParam + * @return + */ + List list4UpdateByParam(EmployeeDeclareListQueryParam queryParam); + + /** + * 鏈湀淇℃伅鍙樺姩 + * + * @param queryParam + * @return + */ + PageInfo listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam); + + /** + * 鏈湀鎶ラ佸け璐 + * + * @param param + * @param tenantKey + * @return + */ +// List list4FailByParam(EmployeeDeclareFailListQueryParam param); + + /** + * 鏈湀鎶ラ佸け璐 + * + * @param param + * @return + */ + PageInfo listPage4FailByParam(EmployeeDeclareFailListQueryParam param); + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍鍏崇郴鐨勪釜绋庢墸缂翠箟鍔′汉鏌ヨ鎶ラ佷汉鍛 + * + * @param salaryAcctTaxAgents + * @return + */ + List listBySalaryAcctTaxAgent(List salaryAcctTaxAgents); + + /** + * 淇濆瓨 + * + * @param saveParam + */ + void save(EmployeeDeclareSaveParam saveParam); + + /** + * 鎵归噺缂栬緫 + * + * @param batchUpdateParam + */ + void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam); + + /** + * 鍒犻櫎 + * + * @param ids + */ + void deleteByIds(Collection ids); + + /** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊垪琛 + * + * @param employeeDeclares + * @return + */ + List convert(List employeeDeclares); + + /** + * 浜哄憳鎶ラ-澶辫触鍒楄〃 + * + * @param employeeDeclares + * @return + */ + List convert2FailListDTO(List employeeDeclares); + + /** + * 鍒锋柊鏁版嵁 + * + * @param refreshParam + * @param employeeId + */ + void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId); + + /** + * 鑾峰彇浜哄憳鎶ラ佺殑鏁翠綋鎯呭喌 + * + * @param employeeDeclareParam + * @return + */ + EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam); + + /** + * 鎶ラ佷汉鍛 + * + * @param param + */ + void declare(EmployeeDeclareParam param); + + /** + * 鑾峰彇鎶ラ佷汉鍛樼殑鍙嶉 + * + * @param param + */ + void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate); + + /** + * 鍚屾浠昏亴鍙楅泧鏃ユ湡涓哄叆鑱屾棩鏈 + * + * @return + */ + String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param); + + void batchInsert(List insertList); + +} diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 43ffacf58..94225cd42 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -16,6 +16,8 @@ import java.util.Map; public interface ExtEmpService { + List listAll(); + List list(ExtEmpQueryParam param); PageInfo listPage (ExtEmpQueryParam param); @@ -26,6 +28,8 @@ public interface ExtEmpService { void delete(Collection ids); + List getExtEmpByIds(List ids); + DataCollectionEmployee getEmployeeById(Long id); /** @@ -56,5 +60,7 @@ public interface ExtEmpService { Map importExtEmp(ExtEmpImportParam param); + List listByKeyword(String keyword); + List listBySubCompanyOrDepartment(List subCompanyIds, List departmentIds); } \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 18b743cda..c2fd7f1e0 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -1,9 +1,9 @@ package com.engine.salary.service; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; -import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.entity.datacollection.po.*; +import com.engine.salary.enums.datacollection.TaxFreeTypeEnum; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -47,15 +47,13 @@ public interface OtherDeductionService { /** * 瀵煎嚭 - * */ XSSFWorkbook export(OtherDeductionQueryParam queryParam); /** * 瀵煎嚭璇︽儏 - * */ - XSSFWorkbook exportDetail( OtherDeductionQueryParam queryParam); + XSSFWorkbook exportDetail(OtherDeductionQueryParam queryParam); /** * 涓嬭浇瀵煎叆妯℃澘 @@ -65,6 +63,14 @@ public interface OtherDeductionService { */ XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param); + /** + * 涓嬭浇鏄庣粏妯℃澘 + * + * @param param + * @return + */ + XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param); + /** * 棰勮 */ @@ -75,7 +81,13 @@ public interface OtherDeductionService { */ Map importData(OtherDeductionImportParam importParam); - + /** + * 瀵煎叆鏄庣粏鏁版嵁 + * + * @param importParam + * @return + */ + Map importDetailData(OtherDeductionImportParam importParam); /** * 鑾峰彇鍏朵粬鍏嶇◣鎵i櫎鏁版嵁 @@ -86,6 +98,16 @@ public interface OtherDeductionService { */ List getOtherDeductionList(YearMonth declareMonth, List employeeIds, List taxAgentIds); + /** + * 鎸夌収鐢虫姤琛ㄧ被鍨嬶紝鑾峰彇鍏朵粬鍏嶇◣鎵i櫎鏁版嵁 + * @param declareMonth + * @param employeeIds + * @param taxAgentIds + * @param incomeCategory + * @return + */ + List getOtherDeductionList(YearMonth declareMonth, List employeeIds, List taxAgentIds, Integer incomeCategory); + /** * 缂栬緫鏁版嵁 */ @@ -113,5 +135,79 @@ public interface OtherDeductionService { String extendToLastMonth(OtherDeductionExtendLastParam param); + PageInfo freeIncomeList(OtherDeductionDetailQueryParam param); + + PageInfo derateDeductionList(OtherDeductionDetailQueryParam param); + + PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param); + + PageInfo grantDonationList(OtherDeductionDetailQueryParam param); + + PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param); + + PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param); + + PageInfo personalPensionList(OtherDeductionDetailQueryParam param); + + List queryFreeIncomes(OtherDeductionFreeListQueryParam param); + + List queryDerateDeductions(OtherDeductionFreeListQueryParam param); + + List queryEndowmentInsurances(OtherDeductionFreeListQueryParam param); + + List queryGrantDonations(OtherDeductionFreeListQueryParam param); + + List queryHealthInsurances(OtherDeductionFreeListQueryParam param); + + List queryOtherDerateDeductions(OtherDeductionFreeListQueryParam param); + + List queryPersonalPensions(OtherDeductionFreeListQueryParam param); + + void saveFreeIncome(FreeIncomeSaveParam param); + + void saveEndowmentInsurance(EndowmentInsuranceSaveParam param); + + void saveGrantDonation(GrantDonationSaveParam param); + + void saveHealthInsurance(HealthInsuranceSaveParam param); + + void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param); + + void saveDerateDeduction(DerateDeductionSaveParam param); + + void savePersonalPension(PersonalPensionSaveParam param); + + void deleteFreeIncome(OtherDeductionDetailDeleteParam param); + + void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param); + + void deleteGrantDonation(OtherDeductionDetailDeleteParam param); + + void deleteHealthInsurance(OtherDeductionDetailDeleteParam param); + + void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param); + + void deleteDerateDeduction(OtherDeductionDetailDeleteParam param); + + void deletePersonalPension(OtherDeductionDetailDeleteParam param); + + + + void syncMain(Long mainId, List taxFreeTypes); + + void syncFreeIncome(OtherDeductionPO mainPO); + + void syncEndowmentInsurance(OtherDeductionPO mainPO); + + void syncGrantDonation(OtherDeductionPO mainPO); + + void syncHealthInsurance(OtherDeductionPO mainPO); + + void syncOtherDerateDeduction(OtherDeductionPO mainPO); + + void syncDerateDeduction(OtherDeductionPO mainPO); + + void syncPersonalPension(OtherDeductionPO mainPO); + List listAuth(OtherDeductionQueryParam queryParam); } diff --git a/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java b/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java new file mode 100644 index 000000000..8fe41c879 --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctCalcTaxReqService.java @@ -0,0 +1,30 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO; + +import java.util.List; + +public interface SalaryAcctCalcTaxReqService { + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍鏌ヨ + * + * @param salaryAcctRecordId + * @return + */ + List listByRecordId(Long salaryAcctRecordId); + + /** + * 鎵归噺淇濆瓨 + * + * @param salaryAcctCalcTaxReqs + */ + void batchSave(List salaryAcctCalcTaxReqs); + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍鍒犻櫎 + * + * @param salaryAcctRecordId + */ + void deleteByRecordId(Long salaryAcctRecordId); +} diff --git a/src/com/engine/salary/service/SalaryAcctEmployeeService.java b/src/com/engine/salary/service/SalaryAcctEmployeeService.java index 2d858a9ab..3dfc3ddc2 100644 --- a/src/com/engine/salary/service/SalaryAcctEmployeeService.java +++ b/src/com/engine/salary/service/SalaryAcctEmployeeService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -124,6 +125,8 @@ public interface SalaryAcctEmployeeService { */ List listByParam(SalaryAcctEmployeeQueryParam queryParam); + List listByTaxCycleAndTaxAgentId(SalaryAcctEmployeeQueryParam queryParam); + /** * 鏍规嵁钖祫鏍哥畻缁撴灉鍒楄〃鐨勫垪琛ㄦ煡璇㈡潯浠舵煡璇㈣柂璧勬牳绠椾汉鍛橈紙鍒嗛〉锛 * @@ -263,6 +266,16 @@ public interface SalaryAcctEmployeeService { */ void lockEmp(SalaryAcctResultUpdateLockStatusParam updateParam); + /** + * 鏈姤閫佷汉鍛 + * @param queryParam + * @return + */ + PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + + int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + /** * 鏇存柊 * @param salaryAcctEmployeePO diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 603e2a164..28c838536 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -6,6 +6,7 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.util.page.PageInfo; @@ -125,6 +126,13 @@ public interface SalaryAcctRecordService { */ Long save(SalaryAcctRecordSaveParam saveParam); + /** + * 淇濆瓨涔嬪墠妫鏌ヤ竴涓嬫槸鍚﹀彲浠ユ柊寤烘牳绠 + * + * @param salaryAcctTaxAgents + */ + void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents); + /** * 鏇存柊钖祫鏍哥畻璁板綍鐨勭姸鎬 * @@ -212,6 +220,15 @@ public interface SalaryAcctRecordService { void updateDate(Long id, Date updateTime); + /** + * 鏍规嵁钖祫鏍哥畻璁板綍id鏌ヨ鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + * + * @param salaryAcctRecordIds + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + void batSave(SalaryAcctBatParam saveParam); void batFile(SalaryAcctBatParam param); diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index ac7309950..18d0ff00b 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -5,7 +5,9 @@ import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; import com.engine.salary.entity.salaryacct.param.*; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.enums.common.SalaryLogOperateTypeEnum; import com.engine.salary.util.page.PageInfo; import java.util.Collection; @@ -117,6 +119,7 @@ public interface SalaryAcctResultService { * @param salaryAcctResultPOS 钖祫鏍哥畻缁撴灉 */ void batchSave(List salaryAcctResultPOS); + void batchUpdate(List salaryAcctResultPOS); /** * 鏍规嵁钖祫鏍哥畻浜哄憳id鍒犻櫎钖祫鏍哥畻缁撴灉 @@ -149,6 +152,13 @@ public interface SalaryAcctResultService { */ void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee); + /** + * 鏍哥畻绋庡悗 + * @param calculateParam + * @param simpleEmployee + */ + void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee); + /** * 鏍规嵁钖祫鏍哥畻璁板綍鐨刬d銆佷釜绋庢墸缂翠箟鍔′汉鏌ヨ钖祫鏍哥畻缁撴灉 * @@ -231,4 +241,16 @@ public interface SalaryAcctResultService { * @version 1.0 **/ List listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List employeeIds); + + /** + * 璁板綍鏃ュ織 + * + * @param salaryAcctRecord + * @param newResultValueMap + * @param operateType + */ + void writeBatchLog(SalaryAcctRecordPO salaryAcctRecord, + Map newResultValueMap, + SalaryLogOperateTypeEnum operateType); + } diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java new file mode 100644 index 000000000..e2796aa4a --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -0,0 +1,56 @@ +package com.engine.salary.service; + +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; + +import java.util.Collection; +import java.util.List; + +/** + * 钖祫鏍哥畻璁板綍瀵瑰簲鐨勪釜绋庢墸缂翠箟鍔′汉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalaryAcctTaxAgentService { + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍id鏌ヨ鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + * + * @param salaryAcctRecordIds + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 鏍规嵁绋庢鎵灞炴湡鑼冨洿鏌ヨ + * + * @param taxCycleRange + * @return + */ + List listByTaxCycleRange(YearMonthRange taxCycleRange); + +// /** +// * 鏍规嵁钖祫鏍哥畻浜哄憳鍒濆鍖 +// * +// * @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/SalaryCalcTaxService.java b/src/com/engine/salary/service/SalaryCalcTaxService.java new file mode 100644 index 000000000..7e6efec5c --- /dev/null +++ b/src/com/engine/salary/service/SalaryCalcTaxService.java @@ -0,0 +1,29 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO; +import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam; + +public interface SalaryCalcTaxService { + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍id鑾峰彇鍦ㄧ嚎璁$畻涓◣鐨勭浉鍏充俊鎭 + * + * @param salaryCalcTaxParam + * @return + */ + SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam); + + /** + * 璁$畻涓◣ + * + * @param salaryCalcTaxParam + */ + void calcTax(SalaryCalcTaxParam salaryCalcTaxParam); + + /** + * 璁$畻涓◣鑾峰彇鍙嶉 + * + * @param salaryCalcTaxParam + */ + void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam); +} diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 50cd67190..571073eee 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; @@ -179,6 +180,21 @@ public interface SalaryEmployeeService { * @return */ List listBySubCompanyOrDepartment(List subCompanyIds, List departmentIds); + /** + * 鏍规嵁浜哄憳id鏌ヨ韬唤璇 + * + * @param employeeIds + * @return + */ + Map mapByEmployeeIds(Collection employeeIds); + + /** + * 鏍规嵁濮撳悕宸ュ彿妯$硦鏌ョ湅 + * @param keyword + * @return + */ + List listByKeyword(String keyword); + List listBySubCompany(List subCompanyIds); diff --git a/src/com/engine/salary/service/SalaryFormulaService.java b/src/com/engine/salary/service/SalaryFormulaService.java index 60142fd05..247440f17 100644 --- a/src/com/engine/salary/service/SalaryFormulaService.java +++ b/src/com/engine/salary/service/SalaryFormulaService.java @@ -28,6 +28,9 @@ public interface SalaryFormulaService { */ List listExpressFormula(Collection formulaIds); + + List listAllExpressFormula(); + /** * 鏍规嵁鍏紡id鑾峰彇鍏紡鍐呭 * diff --git a/src/com/engine/salary/service/SalarySobAddUpRuleService.java b/src/com/engine/salary/service/SalarySobAddUpRuleService.java new file mode 100644 index 000000000..36dad8bca --- /dev/null +++ b/src/com/engine/salary/service/SalarySobAddUpRuleService.java @@ -0,0 +1,52 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobAddUpRuleService { + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + * + * @param salarySobIds + * @return + */ + List listBySalarySobIds(Collection salarySobIds); + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + * + * @param salarySobId + * @return + */ + List listSalarySobAddUpRuleDTO(Long salarySobId); + + /** + * 淇濆瓨 + * + * @param saveParam + */ + void saveByParam(SalarySobAddUpRuleSaveParam saveParam); + + /** + * 鏍规嵁钖祫璐﹀id鍒犻櫎 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobAddUpRules); + +} diff --git a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java index a221b9f3c..9d928cd39 100644 --- a/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java +++ b/src/com/engine/salary/service/SalarySobDefaultEmpFieldService.java @@ -1,18 +1,23 @@ package com.engine.salary.service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO; + +import java.util.List; + /** - * @description: 钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/13/22 9:52 AM - * @version:v1.0 - */ + * 钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobDefaultEmpFieldService { -// /** -// * 鑾峰彇鎵鏈夌殑钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 -// * -// * @return -// */ -// List list(); + /** + * 鑾峰彇鎵鏈夌殑钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 + * + * @return + */ + List list(); } diff --git a/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java new file mode 100644 index 000000000..0ed15c4df --- /dev/null +++ b/src/com/engine/salary/service/SalarySobDefaultItemGroupService.java @@ -0,0 +1,26 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; + +import java.util.Collection; +import java.util.List; + +/** + * 钖祫璐﹀榛樿鐨勮柂璧勯」鐩垎绫 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobDefaultItemGroupService { + + /** + * 鏍规嵁鎵寰楅」鐩幏鍙栬柂璧勮处濂楅粯璁ょ殑钖祫椤圭洰鍒嗙被 + * + * @param incomeCategories + * @return + */ + List listByIncomeCategoryIn(Collection incomeCategories); +} diff --git a/src/com/engine/salary/service/SalarySobInitService.java b/src/com/engine/salary/service/SalarySobInitService.java new file mode 100644 index 000000000..7e94a7cf9 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobInitService.java @@ -0,0 +1,23 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; + +/** + * 钖祫璐﹀鍒濆鍖 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobInitService { + + /** + * 钖祫璐﹀鍒濆鍖 + * + * @param saveParam 鍒濆鍖栧弬鏁 + * @return + */ + SalarySobPO init(SalarySobBasicSaveParam saveParam); +} diff --git a/src/com/engine/salary/service/SalarySobItemService.java b/src/com/engine/salary/service/SalarySobItemService.java index af509a042..4630aee84 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -1,8 +1,10 @@ package com.engine.salary.service; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; @@ -10,12 +12,13 @@ import java.util.Collection; import java.util.List; /** - * @description: 钖祫璐﹀鐨勮柂璧勯」鐩壇鏈 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 7:26 PM - * @version:v1.0 - */ + * 钖祫璐﹀鐨勮柂璧勯」鐩壇鏈 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public interface SalarySobItemService { /** @@ -125,7 +128,20 @@ public interface SalarySobItemService { */ SalarySobItemFormDTO getSalaryItemForm(SalarySobItemPO param); + /** + * 鏇存柊 + * @param po + */ void update(SalarySobItemPO po); List getConfig(Long salarySobId); + + /** + * 鎷撴墤鍥 + * @param param + * @return + */ + SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param); + + void checkLoop(Long salarySobId); } diff --git a/src/com/engine/salary/service/SalarySobTaxReportRuleService.java b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java new file mode 100644 index 000000000..5c31c19dd --- /dev/null +++ b/src/com/engine/salary/service/SalarySobTaxReportRuleService.java @@ -0,0 +1,51 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobTaxReportRuleService { + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + * + * @param salarySobIds + * @return + */ + List listBySalarySobIds(Collection salarySobIds); + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + * + * @param salarySobId + * @return + */ + List getSalarySobTaxReportRuleDTO(Long salarySobId); + + /** + * 淇濆瓨 + * + * @param saveParam + */ + void saveByParam(SalarySobTaxReportRuleSaveParam saveParam); + + /** + * 鎸夎柂璧勮处濂梚d鍒犻櫎 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobTaxReportRules); +} diff --git a/src/com/engine/salary/service/SalarySobTaxRuleService.java b/src/com/engine/salary/service/SalarySobTaxRuleService.java new file mode 100644 index 000000000..b4d15c58b --- /dev/null +++ b/src/com/engine/salary/service/SalarySobTaxRuleService.java @@ -0,0 +1,51 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; + +import java.util.Collection; +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庤鍒 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobTaxRuleService { + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勪釜绋庤鍒 + * + * @param salarySobIds + * @return + */ + List listBySalarySobId(Long salarySobIds); + + /** + * 鏍规嵁钖祫璐﹀id鏌ヨ钖祫璐﹀鐨勪釜绋庤鍒 + * + * @param salarySobId + * @return + */ + List getSalarySobTaxRuleDTO(Long salarySobId); + + /** + * 淇濆瓨 + * + * @param saveParam + */ + void saveByParam(SalarySobTaxRuleSaveParam saveParam); + + /** + * 鎸夎柂璧勮处濂梚d鍒犻櫎 + * + * @param salarySobIds + */ + void deleteBySalarySobIds(Collection salarySobIds); + + void saveBatch(List salarySobTaxReportRules); +} diff --git a/src/com/engine/salary/service/TaxAgentService.java b/src/com/engine/salary/service/TaxAgentService.java index f6df75965..d0c5c14de 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -273,4 +273,12 @@ public interface TaxAgentService { List getConfig(); List parseConfig(List configs); + + /** + * 鏌ヨ鍖呭惈鍒犻櫎鐘舵佺殑鏁版嵁 + * + * @param taxAgentIds + * @return + */ + List listByIdsIncludeDel(Collection taxAgentIds); } diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..c15930dd4 --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnCheckService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +import java.util.List; + +/** + * 鎶ョ◣淇℃伅楠岃瘉service鎺ュ彛 + * + * @author chengliming + * @date 2022-09-02 9:26 AM + **/ +public interface TaxAgentTaxReturnCheckService { + /** + * 鑾峰彇楠岃瘉绫诲瀷 + * + * @return + */ + int getCheckType(); + + /** + * 楠岃瘉鎶ョ◣淇℃伅 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 妫鏌ョ◣鍙嬭繑鍥炵殑鏁版嵁 + * + * + * @param apiConfig + * @param saveParam + * @param po + * @param registerInfoResponse + * @return + */ + List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, + TaxAgentTaxReturnSaveParam saveParam, + TaxAgentTaxReturnPO po, + CompanyRegisterInfoResponse registerInfoResponse); +} diff --git a/src/com/engine/salary/service/TaxAgentTaxReturnService.java b/src/com/engine/salary/service/TaxAgentTaxReturnService.java new file mode 100644 index 000000000..c87b48267 --- /dev/null +++ b/src/com/engine/salary/service/TaxAgentTaxReturnService.java @@ -0,0 +1,58 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; + +import java.util.Collection; +import java.util.List; + +/** + * 涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅service鎺ュ彛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxAgentTaxReturnService { + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜篿d鑾峰彇鎶ョ◣淇℃伅 + * + * @param taxAgentId + * @return + */ + TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId); + + /** + * 淇濆瓨鎶ョ◣淇℃伅 + * + * @param saveParam + * @return + */ + TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + /** + * 鏍规嵁id鍒楄〃鑾峰彇 + * + * @param taxAgentIds + * @return + */ + List getByTaxAgentIds(Collection taxAgentIds); + + /** + * 鏍规嵁绋庡彿鑾峰彇绾崇◣涓讳綋 + * + * @param taxCode + * @return + */ + List getByTaxCode(String taxCode); + + /** + * 鏍规嵁澶氫釜绋庡彿鑾峰彇 + * + * @param taxCodes + * @return + */ + List getByTaxCodes(Collection taxCodes); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java new file mode 100644 index 000000000..574076008 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -0,0 +1,51 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.util.List; + +/** + * 涓◣鐢虫姤璁¤垂service + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationApiBillingService { + + /** + * 鏇存柊褰撳墠绉熸埛鐨勬祦閲忎娇鐢ㄦ儏鍐 + * + * @param updateWrapper + */ + void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + + /** + * 鑾峰彇娴侀噺浣跨敤璁板綍(鍒嗛〉) + * + * @param queryParam + * @return + */ + PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 鑾峰彇娴侀噺浣跨敤璁板綍锛堜笉鍒嗛〉锛 + * + * @param queryParam + * @return + */ + List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + + /** + * 瀵煎嚭娴侀噺浣跨敤璁板綍 + * + * @param queryParam + */ + XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java new file mode 100644 index 000000000..c239d6339 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -0,0 +1,52 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; + +/** + * 涓◣鐢虫姤api閰嶇疆service + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationApiConfigService { + + /** + * 鏍规嵁鏈嶅姟鍘傚晢鑾峰彇閰嶇疆 + * + * @param needExist 鏄惁瑕佹楠屽瓨鍦 + * @return + */ + TaxDeclarationApiConfigPO getConfig( boolean needExist); + + /** + * 淇濆瓨 + * + * @param config + */ + void insert(TaxDeclarationApiConfigPO config); + + /** + * 鏇存柊 + * + * @param config + */ + void update(TaxDeclarationApiConfigPO config); + + /** + * 淇敼寮鍏崇姸鎬 + * + * @param saveParam + */ + void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + /** + * 鏄惁寮鍚櫤鑳界畻钖 + * @return + */ + boolean enableUse(); +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java new file mode 100644 index 000000000..a8e0cb4dc --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowStatisticService.java @@ -0,0 +1,83 @@ +package com.engine.salary.service; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.util.List; + +/** + * 涓◣鐢虫姤璁¤垂service + * + * @author chengliming + * @date 2022-11-11 14:54:14 + */ +public interface TaxDeclarationApiFlowStatisticService { + + /** + * 鑾峰彇褰撳墠绉熸埛鐨勬祦閲忕粺璁℃儏鍐 + * + * @return + */ + TaxDeclarationApiFlowTotalDTO getFlowStatistics(); + + /** + * 鑾峰彇鍚勪富浣撶殑娴侀噺浣跨敤鏄庣粏锛堝垎椤碉級 + * + * @param queryParam + * @return + */ + PageInfo pageFlowStatistics(BaseQueryParam queryParam); + + /** + * 鑾峰彇鍚勪富浣撶殑娴侀噺浣跨敤鏄庣粏锛堜笉鍒嗛〉锛 + * + * @return + */ + List listFlowStatistic(); + + /** + * 鑾峰彇鍗曚釜涓讳綋鐨勬祦閲忔湀搴︿娇鐢ㄦ槑缁(鍒嗛〉) + * + * @param queryParam + * @return + */ + PageInfo pageFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam); + + /** + * 鑾峰彇鍗曚釜涓讳綋鐨勬祦閲忔湀搴︿娇鐢ㄦ槑缁(涓嶅垎椤) + * + * @param queryParam + * @return + */ + List listFlowStatisticDetail(TaxDeclarationApiFlowMonthQueryParam queryParam); + + /** + * 瀵煎嚭娴侀噺缁熻 + * + * @param dtoList + */ + XSSFWorkbook exportFlowStatistics(List dtoList); + + /** + * 瀵煎嚭娴侀噺鏈堝害缁熻 + * + * @param dtoList + */ + XSSFWorkbook exportFlowStatisticsDetail( List dtoList); + + /** + * 鏌ヨ娴侀噺缁熻鏁版嵁 + * + * @param apiConfig + * @return + */ + QueryAccountBalanceResponse getQueryAccountBalanceResponse(TaxDeclarationApiConfigPO apiConfig); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java new file mode 100644 index 000000000..2b5992ea2 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiFlowWarnService.java @@ -0,0 +1,93 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; + +/** + * 娴侀噺涓嶈冻鎻愰啋 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationApiFlowWarnService { + + /** + * 鑾峰彇娴侀噺涓嶈冻鎻愰啋璁剧疆 + * + * @return + */ + TaxDeclarationApiFlowWarnConfigPO getWarnConfig(); + + /** + * 鑾峰彇娴侀噺涓嶈冻鎻愰啋瀵硅薄鍒楄〃 + * + * @param warnConfigId + * @return + */ + List getWarnReceiverList(Long warnConfigId); + + + PageInfo getWarnReceiverPageList(Long warnConfigId); + + /** + * 鍒犻櫎娴侀噺涓嶈冻鎻愰啋瀵硅薄 + * + * @param id + */ + void deleteReceiver(Long id); + + /** + * 鑾峰彇鎻愰啋瀵硅薄 + * + * @param id + * @return + */ + TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id); + + /** + * 淇濆瓨鎴栫紪杈戞彁閱掑璞 + * + * @param param + */ + void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param); + + /** + * 鍒涘缓鎻愰啋瑙勫垯 + * + * @param param + */ + void createMessageRule(CreateMessageRuleParam param); + + /** + * 淇濆瓨娴侀噺涓嶈冻鎻愰啋閰嶇疆 + * + * @param param + * @return + */ + String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param); + + /** + * 鑾峰彇鎺ㄩ佽鍒欑殑涓氬姟ID + * + * @return + */ + Long getRuleBusinessId(); + + /** + * 鍙戦佹彁閱 + * + * @param updateWrapper + */ + void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper); + +} diff --git a/src/com/engine/salary/service/TaxDeclarationExcelService.java b/src/com/engine/salary/service/TaxDeclarationExcelService.java index fb95a6e5c..e5e154fe7 100644 --- a/src/com/engine/salary/service/TaxDeclarationExcelService.java +++ b/src/com/engine/salary/service/TaxDeclarationExcelService.java @@ -1,7 +1,12 @@ package com.engine.salary.service; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.util.Map; + /** * 涓◣鐢虫姤琛ㄥ鍑 *

Copyright: Copyright (c) 2022

@@ -15,7 +20,44 @@ public interface TaxDeclarationExcelService { /** * 瀵煎嚭涓◣鐢虫姤琛 * - * @param taxDeclarationId + * @param queryParam + * @return */ - XSSFWorkbook exportTaxDeclaration(Long taxDeclarationId); + XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam); + + /** + * 瀵煎嚭鏈姤閫佺殑浜哄憳 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam); + + /** + * 瀵煎嚭缂哄皯鐢虫姤鏁版嵁鐨勪汉鍛 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam); + + /** + * 瀵煎嚭鐢虫姤澶辫触鐨勪汉鍛 + * + * @param queryParam + * @return + */ + XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam); + + XSSFWorkbook downloadTemplate(DownloadTemplateParam param); + /** + * 棰勮 + */ + Map preview(DownloadTemplateParam importParam); + + /** + * 瀵煎叆鏁版嵁 + */ + Map importData(DownloadTemplateParam importParam); + } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 7537c1c06..ef4c71fd1 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -1,7 +1,10 @@ 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.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -22,6 +25,9 @@ public interface TaxDeclarationService { */ List listByTaxCycleAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds); + List listByTaxDeclareRecordId(Long taxDeclareRecordId); + List listByTaxDeclareRecordId(Long taxDeclareRecordId,Integer incomeCategory); + PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); List countByTaxDeclarationId(Collection taxAgentIds); @@ -32,7 +38,6 @@ public interface TaxDeclarationService { /** * 鍒犻櫎涓◣鐢虫姤琛 - * */ void delete(SalaryAcctRecordPO salaryAcctRecordPO); @@ -47,7 +52,35 @@ public interface TaxDeclarationService { /** * 鎾ゅ洖涓◣鐢虫姤鍗 + * * @param taxDeclarationId */ void withDrawTaxDeclaration(Long taxDeclarationId); + + /** + * 鍒犻櫎涓◣鐢虫姤琛 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + void saveBatch(List taxDeclarations); + + + /** + * 鏍规嵁绋庢鎵灞炴湡鏌ヨ涓◣鐢虫姤琛 + * + * @param yearMonthRange + * @return + */ + List listByTaxCycleRange(YearMonthRange yearMonthRange); + + + /** + * 鏂板鐢虫姤琛 + * @param param + */ + void addTaxDeclaration(TaxDeclarationAddParam param); + + void deleteTaxDeclaration(TaxDeclarationDeleteParam param); } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java new file mode 100644 index 000000000..f961dbc6f --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -0,0 +1,110 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤琛ㄦ槑缁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationValueService { + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 + * + * @param taxDeclarationIds + * @return + */ + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds, String keyWord); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 + * + * @param taxDeclarationIds + * @return + */ + List listByTaxDeclarationIds(Collection taxDeclarationIds); + + List listByTaxDeclarationId(Long taxDeclarationId); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 + * + * @param taxDeclarationIds + * @return + */ + List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds); + + /** + * 涓◣鐢虫姤琛ㄦ槑缁嗗垪琛 + * + * @param taxDeclarationValues + * @return + */ + TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues); + + /** + * 鎵归噺淇濆瓨 + * + * @param taxDeclarationValues + */ + void batchSave(List taxDeclarationValues); + + void batchEdit(List taxDeclarationValues); + + + void save(TaxDeclareRecordDetailSaveParam param); + + void edit(TaxDeclareRecordDetailSaveParam param); + + TaxDeclarationValuePO getById(Long id); + + /** + * 鍒犻櫎涓◣鐢虫姤琛ㄦ槑缁 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 鍥犱负鍗曠嫭鐢虫姤骞寸粓濂栦笉鍙 + * 闇瑕佽ˉ鍏呮甯稿伐璧勮柂閲戠殑鐢虫姤锛屾寜0鐢虫姤 + * + * @param po + */ + void autoAddWagesDeclare(TaxDeclareRecordPO po); + + /** + * 瀵规瘮 + * @param param + */ + Map contrast(ContrastQueryParam param); + + + /** + * 瀵煎嚭鍦ㄧ嚎瀵规瘮 + */ + XSSFWorkbook exportContrast(ContrastQueryParam param); + + /** + * 鏍规嵁涓婚敭鍒犻櫎 + * @param deleteId + */ + void deleteById(Long deleteId); + +} diff --git a/src/com/engine/salary/service/TaxDeclareEmployeeService.java b/src/com/engine/salary/service/TaxDeclareEmployeeService.java new file mode 100644 index 000000000..da950b1ad --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareEmployeeService.java @@ -0,0 +1,61 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; + +import java.util.List; + +/** + * 涓◣鐢虫姤琛ㄦ槑缁嗕腑鐨勪汉鍛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclareEmployeeService { + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鏈姤閫佹垚鍔熺殑浜哄憳 + * + * @param queryParam + * @return + */ + List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ宸叉姤閫佷絾鏄病鏈夌敵鎶ユ暟鎹殑浜哄憳 + * + * @param queryParam + * @return + */ + PageInfo listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 鏌ヨ宸叉姤閫佷絾鏄病鏈夌敵鎶ユ暟鎹殑浜哄憳 + * + * @param queryParam + * @return + */ + List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam); + + /** + * 杞崲鎴愭暟鎹紓甯镐汉鍛榙to + * + * @param taxDeclareRecord + * @param taxDeclareEmployees + * @return + */ + List convert2AbnormalEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareEmployees); +} diff --git a/src/com/engine/salary/service/TaxDeclareFailService.java b/src/com/engine/salary/service/TaxDeclareFailService.java new file mode 100644 index 000000000..c7affede6 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareFailService.java @@ -0,0 +1,53 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; + +import java.util.Collection; +import java.util.List; + +/** + * 涓◣鐢虫姤澶辫触鏁版嵁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclareFailService { + + /** + * 鏍规嵁涓◣鐢虫姤璁板綍id鏌ヨ鐢虫姤澶辫触鏁版嵁锛堝垎椤碉級 + * + * @param taxDeclareRecordIds + * @return + */ + List listPageByTaxDeclareRecordIds( Collection taxDeclareRecordIds); + + /** + * 鏍规嵁涓◣鐢虫姤璁板綍id鏌ヨ鐢虫姤澶辫触鏁版嵁 + * + * @param taxDeclareRecordIds + * @return + */ + List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 鏍规嵁涓◣鐢虫姤璁板綍id鍒犻櫎鐢虫姤澶辫触鏁版嵁 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 杞崲鎴愮敵鎶ュけ璐ユ暟鎹甦to + * + * @param taxDeclareRecord + * @param taxDeclareFails + * @return + */ + List convert2FailEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareFails); + + void saveBatch(List taxDeclareFails); +} diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java new file mode 100644 index 000000000..0309c65a3 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -0,0 +1,187 @@ +package com.engine.salary.service; + +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam; +import com.engine.salary.entity.taxdeclaration.param.GetCompanyIncomesQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclareRecordService { + + /** + * 鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param id + * @return + */ + TaxDeclareRecordPO getById(Long id); + + /** + * 鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param ids + * @return + */ + List listByIds(Collection ids); + + /** + * 鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param taxCycleRange + * @return + */ + List listByTaxCycleRange(YearMonthRange taxCycleRange); + + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜篿d銆佺◣娆炬墍灞炴湡鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param taxAgentIds + * @param taxCycle + * @return + */ + List listByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds); + + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜篿d銆佽柂璧勬墍灞炴湀鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param salaryMonth + * @param taxAgentIds + * @return + */ + List listBySalaryMonthAndTaxAgentIds(Date salaryMonth, Collection taxAgentIds); + + /** + * 鏌ヨ涓◣鐢虫姤璁板綍 + * + * @param queryParam + * @return + */ + PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); + + /** + * 鐢熸垚鐢虫姤琛 + * + * @param saveParam + */ + void save(TaxDeclarationSaveParam saveParam); + + /** + * 鍒锋柊鏁版嵁 + * + * @param id + */ + void refreshData(Long id); + + /** + * 鏇存柊涓◣鐢虫姤琛ㄧ殑寰呭埛鏂版暟鎹殑鏍囪瘑 + * + * @param id + */ + void updateIcon(Long id, Integer displayIcon); + + /** + * 鍥犱负钖祫鏍哥畻缁撴灉鍙戠敓鍙樺姩锛屾墍浠ラ渶瑕佹洿鏂颁釜绋庣敵鎶ヨ〃鐨勫緟鍒锋柊鏁版嵁鐨勬爣璇 + * + * @param taxCycle + * @param taxAgentIds + */ + void updateByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds); + + /** + * 鍒ゆ柇鏄惁鏈夋潈闄愬彲鏌ョ湅涓◣鐢虫姤琛 + * + * @param taxDeclaration + * @return + */ + boolean checkByAuthority(TaxDeclarationPO taxDeclaration); + + /** + * 鏍规嵁id鍒犻櫎 + * + * @param ids + */ + void deleteByIds(Collection ids); + + /** + * 涓◣鐢虫姤 + * + * @param id + */ + void declare(Long id, Integer reportType); + + /** + * 涓◣鐢虫姤鑾峰彇鍙嶉 + * + * @param id + */ + void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate); + + + /** + * 鏌ヨ浼佷笟鐢虫姤鏁版嵁鏄庣粏 + * + * @return + */ + Object getCompanyIncomes(GetCompanyIncomesQueryParam param); + + XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param); + + /** + * 鐢虫姤鍐呯疆绠楃◣缁撴灉鏌ヨ + * + * @param id + * @return + */ + Object getDeclareTaxResultFeedback(Long id); + + XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + + + /** + * 浣滃簾 + * + * @param id + */ + void cancelDeclare(Long id, Integer reportType,TaxDeclarationRateDTO taxDeclarationRate); + + /** + * 鑾峰彇浣滃簾鍙嶉 + * + * @param id + */ + void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate); + + /** + * 鏇存鐢虫姤 + * + * @param id + */ + void updateDeclare(Long id, Integer reportType); + + /** + * 鎾ら攢鐢虫姤 + * + * @param id + */ + void cancelCorrect(Long id); + + void updateById(TaxDeclareRecordPO taxDeclareRecord); + +} diff --git a/src/com/engine/salary/service/TaxDeclareStatusService.java b/src/com/engine/salary/service/TaxDeclareStatusService.java new file mode 100644 index 000000000..f6f6674b0 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareStatusService.java @@ -0,0 +1,40 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; + +import java.util.List; + +/** + * 涓◣鐢虫姤琛ㄧ姸鎬 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclareStatusService { + + List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId); + + + /** + * 鑾峰彇鐢虫姤璁板綍鐘舵 + * @param taxDeclareRecordId + * @param reportType + * @return + */ + TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType); + + /** + * 鏇存柊涓昏褰曪紝杩斿洖鐢虫姤璁板綍鐘舵佸垪琛 + * @param id + * @return + */ + List updateRecord(Long id); + + /** + * 鏇存柊鐢虫姤鐘舵侊紝鍚屾椂鏇存柊涓昏褰 + * @param declareStatus + */ + void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus,boolean updateRecord); +} diff --git a/src/com/engine/salary/service/TaxPaymentService.java b/src/com/engine/salary/service/TaxPaymentService.java new file mode 100644 index 000000000..6f8ae318f --- /dev/null +++ b/src/com/engine/salary/service/TaxPaymentService.java @@ -0,0 +1,82 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; + +import java.util.Map; + +/** + * 涓◣杈呭姪缂存 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxPaymentService { + /** + * 鏌ヨ澶栭儴鎺ュ彛锛堝紓姝ユ帴鍙o級 + * + * @param param + * @return + */ + String getRequestId(TaxPaymentQueryParam param); + + /** + * 鑾峰彇鍙嶉鏌ヨ缁撴灉 + * + * @param param + * @return + */ + TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param); + + /** + * 鑾峰彇涓氬姟绫诲瀷 + * + * @return + */ + Integer getServiceType(); + + /** + * 鏌ヨ搴旂即閲戦 + * + * @param param + * @return + */ + TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param); + + /** + * 浣滃簾缂磋垂鍑瘉 + * + * @param apiConfig + * @param taxDeclareRecord + * @param requestParam + */ + void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam); + + /** + * 鑾峰彇瀹岀◣璇佹槑 + * + * @param param + * @return + */ + TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param); + + /** + * 鍒锋柊缂存鐘舵侊紙涓昏閽堝绾夸笅缂存鍦烘櫙锛 + * + * @param param + */ + void syncWithholdingFeedback(TaxPaymentQueryParam param); + + /** + * 浣滃簾缂存鍑瘉 + * + * @param param + */ + void cancelWithholdingVoucher(TaxPaymentQueryParam param); +} diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java new file mode 100644 index 000000000..bed870ffb --- /dev/null +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -0,0 +1,40 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; + +import java.util.List; + +/** + * 涓◣鐢虫姤琛ㄨ〃澶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxReportColumnService { + + /** + * 鏌ヨ鎵鏈夋墍寰楅」鐩殑涓◣鐢虫姤琛ㄨ〃澶 + * + * @return + */ + List listAll(); + + + /** + * 鏍规嵁鏄惁鏄姣斿瓧娈垫煡璇 + * @param contrastType 1鏄 0鍚 + * @return + */ + List listByContrastType(Integer contrastType); + + /** + * 鏍规嵁鎵寰楅」鐩煡璇釜绋庣敵鎶ヨ〃琛ㄥご + * + * @param incomeCategory + * @return + */ + List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes); +} diff --git a/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java new file mode 100644 index 000000000..938452813 --- /dev/null +++ b/src/com/engine/salary/service/factory/SalaryCalcRunServiceFactory.java @@ -0,0 +1,50 @@ +//package com.engine.salary.service.factory; +// +//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryCalcItem; +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.SalaryCalcRunService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.Map; +//import java.util.Objects; +//import java.util.concurrent.ConcurrentHashMap; +// +///** +// * @description: SalaryCalcRunService鐨勭瓥鐣ラ夋嫨宸ュ巶 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2023/5/19 16:17 +// * @version:v1.0 +// */ +// +//public class SalaryCalcRunServiceFactory { +// +// private final Map serviceMap = new ConcurrentHashMap<>(); +// +// +// public SalaryCalcRunServiceFactory(Map map) { +// for (Map.Entry entry : map.entrySet()) { +// serviceMap.put(entry.getValue().getCalcType(), entry.getValue()); +// } +// } +// +// public SalaryCalcRunService get(SalaryCalcItem salaryCalcItem) { +// String calcType = ""; +// if (Objects.equals(salaryCalcItem.getUseInEmployeeSalary(), 1) +// && salaryCalcItem.getExpressFormula() == null) { +// calcType = "SPECIAL"; +// } else if (salaryCalcItem.getExpressFormula() != null && salaryCalcItem.getExpression() != null) { +// calcType = "EXPRESSION"; +// } else if (salaryCalcItem.getExpressFormula() != null) { +// calcType = "EXPRESS_FORMULA"; +// } else { +// calcType = "INPUT"; +// } +// SalaryCalcRunService salaryCalcRunService = serviceMap.get(calcType); +// if (salaryCalcRunService == null) { +// throw new SalaryRunTimeException("SalaryCalcRunService can not be null"); +// } +// return salaryCalcRunService; +// } +//} diff --git a/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java new file mode 100644 index 000000000..14b08ed4e --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxAgentTaxReturnCheckServiceFactory.java @@ -0,0 +1,33 @@ +package com.engine.salary.service.factory; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.AbstractTaxAgentTaxReturnCheckService; +import com.engine.salary.service.impl.TaxReturnCheckDepartmentServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckMainServiceImpl; +import com.engine.salary.service.impl.TaxReturnCheckRegistrationServiceImpl; +import weaver.hrm.User; + + +public class TaxAgentTaxReturnCheckServiceFactory { + private User user; + + public TaxAgentTaxReturnCheckServiceFactory(User user) { + this.user = user; + } + + + public TaxAgentTaxReturnCheckService get(Integer type) { + //楠岃瘉绫诲瀷 1.璇锋眰绋庡弸楠岃瘉鎶ョ◣淇℃伅 2.璇锋眰绋庡弸楠岃瘉鐧昏搴忓彿+绋庡彿 3.璇锋眰绋庡弸楠岃瘉閮ㄩ棬缂栫爜 + AbstractTaxAgentTaxReturnCheckService service = null; + if (type == 1) { + service = ServiceUtil.getService(TaxReturnCheckMainServiceImpl.class, user); + } else if (type == 2) { + service = ServiceUtil.getService(TaxReturnCheckRegistrationServiceImpl.class, user); + } else { + service = ServiceUtil.getService(TaxReturnCheckDepartmentServiceImpl.class, user); + } + + return service; + } +} diff --git a/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java new file mode 100644 index 000000000..f778ff2df --- /dev/null +++ b/src/com/engine/salary/service/factory/TaxPaymentServiceFactory.java @@ -0,0 +1,34 @@ +package com.engine.salary.service.factory; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.service.TaxPaymentService; +import com.engine.salary.service.impl.*; +import weaver.hrm.User; + + +public class TaxPaymentServiceFactory { + private User user; + + public TaxPaymentServiceFactory(User user) { + this.user = user; + } + + public TaxPaymentService get(Integer type) { + AbstractTaxPaymentService service = null; + if (type == 1) { + service = ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user); + } else if (type == 2) { + service = ServiceUtil.getService(TaxPaymentWithholdingServiceImpl.class, user); + } else if(type == 3){ + service = ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user); + }else if(type == 4){ + service = ServiceUtil.getService(TaxPaymentWithheldVoucherServiceImpl.class, user); + } + + return service; + } + + + + +} diff --git a/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java new file mode 100644 index 000000000..aacc4a117 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractSalarySobInitService.java @@ -0,0 +1,82 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv; +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.service.SalarySobInitService; + +/** + * 钖祫璐﹀鍒濆鍖 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public abstract class AbstractSalarySobInitService extends Service implements SalarySobInitService { + + @Override + public SalarySobPO init(SalarySobBasicSaveParam saveParam) { + SalarySobInitEnv env = new SalarySobInitEnv(); + env.setSaveParam(saveParam); + env.setCurrentUser(user); + + // 鍒濆鍖栧熀纭璁剧疆 + initBasic(env); + // 鍒濆鍖栧憳宸ヤ俊鎭瓧娈 + initEmpField(env); + // 鍒濆鍖栬柂璧勯」鐩佽柂璧勯」鐩垎缁 + initItem(env); + // 鍒濆鍖栧洖绠楄柂璧勯」鐩 + initBackItem(env); + // 鍒濆鍖栫疮璁″瓧娈靛搴旇鍒 + initAddUpRule(env); + // 鍒濆鍖栦釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲瑙勫垯 + initTaxReportRule(env); + + return env.getSalarySob(); + } + + /** + * 鍒濆鍖栧熀纭璁剧疆 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initBasic(SalarySobInitEnv env); + + /** + * 鍒濆鍖栦汉鍛樹俊鎭瓧娈 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initEmpField(SalarySobInitEnv env); + + /** + * 鍒濆鍖栬柂璧勯」鐩佽柂璧勯」鐩垎缁 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initItem(SalarySobInitEnv env); + + /** + * 鍒濆鍖栧洖绠楄柂璧勯」鐩 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initBackItem(SalarySobInitEnv env); + + /** + * 鍒濆鍖栫疮璁″瓧娈靛搴旇鍒 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initAddUpRule(SalarySobInitEnv env); + + /** + * 鍒濆鍖栦釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲瑙勫垯 + * + * @param env 鍏叡鍙橀噺 + */ + protected abstract void initTaxReportRule(SalarySobInitEnv env); +} diff --git a/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java new file mode 100644 index 000000000..ea1684fac --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -0,0 +1,213 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.remote.tax.client.CompanyClient; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 绋庡弸鐩稿叧鍏叡鏂规硶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public abstract class AbstractTaxAgentTaxReturnCheckService extends Service implements TaxAgentTaxReturnCheckService { + protected TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + protected TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + protected TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + protected TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + protected ApiTaskService getApiTaskService(User user) { + return ServiceUtil.getService(ApiTaskServiceImpl.class, user); + } + + /** + * 鑾峰彇楠岃瘉绫诲瀷 + * + * @return + */ + @Override + public abstract int getCheckType(); + + /** + * 淇濆瓨鎶ョ◣淇℃伅 + * + * @param saveParam + * @return + */ + @Override + public abstract TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam); + + @Override + public List verifyCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, CompanyRegisterInfoResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setUpdateTime(new Date()); + // 濡傛灉绋庡弸杩斿洖閿欒淇℃伅 + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || CollectionUtils.isEmpty(response.getBody())) { + throw new SalaryRunTimeException(response.getHead().getMsg()); + } + // 濡傛灉绋庡弸杩斿洖楠岃瘉淇℃伅 + List checkFormDTOList = buildCheckDTO(saveParam, response.getBody()); + if (checkFormDTOList.size() == 1) { + po.setTaxRegistrationNumber(checkFormDTOList.get(0).getTaxRegistrationNumber()); + if (SalaryOnOffEnum.OFF.equals(checkFormDTOList.get(0).getDivideFiling())) { + // 濡傛灉鍙湁涓鏉¤褰曚笖娌℃湁鍒嗛儴闂ㄥ妗堬紝鍒欑洿鎺ヨ涓洪獙璇佹垚鍔燂紝缁х画妫鏌ュ瘑鐮佹槸鍚︽纭 + CheckPasswordResponse checkPasswordResponse = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, checkPasswordResponse); + } + } + return checkFormDTOList; + } + + /** + * 浼佷笟娉ㄥ唽鎺ュ彛 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CompanyRegisterInfoResponse getCompanyRegisterInfo(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + Long taxAgentId = taxAgentTaxReturnPO.getTaxAgentId(); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentId); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + } + Map requestParam = new HashMap<>(4); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (StringUtils.isNotEmpty(saveParam.getTaxRegistrationNumber())) { + requestParam.put("djxhid", saveParam.getTaxRegistrationNumber()); + } + + return new CompanyClient(taxAgentId).getCompanyRegisterInfo(requestParam); + } + + + private List buildCheckDTO(TaxAgentTaxReturnSaveParam saveParam, List registerInfos) { + List checkFormDTOList = new ArrayList<>(); + for (int i = 1; i <= registerInfos.size(); i++) { + CompanyRegisterInfoResponse.CompanyRegisterInfo registerInfo = registerInfos.get(i - 1); + SalaryAssert.notNull(registerInfo.getFbmba(), "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗閲嶈瘯"); + TaxAgentTaxReturnCheckFormDTO checkFormDTO = TaxAgentTaxReturnCheckFormDTO + .builder() + .taxAgentName(registerInfo.getQymc()) + .taxAgentId(saveParam.getTaxAgentId()) + .taxCode(saveParam.getTaxCode()) + .businessAddress(registerInfo.getScjydz()) + .legalPersonName(registerInfo.getFrxm()) + .mobile(registerInfo.getLxdh()) + .industryName(registerInfo.getHymc()) + .taxAuthorities(registerInfo.getZgswjgmc()) + .taxBranch(registerInfo.getZgswjgskmc()) + .taxRegistrationNumber(registerInfo.getDjxhid()) + .divideFiling(SalaryOnOffEnum.parseByValue(Integer.parseInt(registerInfo.getFbmba()))) + .index((long) i) + .build(); + checkFormDTOList.add(checkFormDTO); + } + return checkFormDTOList; + } + + /** + * 鏍¢獙瀵嗙爜 + * + * @param apiConfig + * @param taxAgentTaxReturnPO + * @param saveParam + * @return + */ + protected CheckPasswordResponse getCheckPasswordResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + } + Long taxAgentId = taxAgentPO.getId(); + Map requestParam = new HashMap<>(16); + requestParam.put("bizNo", IdGenerator.generate()); + requestParam.put("qymc", taxAgentPO.getName()); + requestParam.put("mmlx", taxAgentTaxReturnPO.getPasswordType()); + requestParam.put("djxhid", taxAgentTaxReturnPO.getTaxRegistrationNumber()); + requestParam.put("nsrsbh", taxAgentTaxReturnPO.getTaxCode()); + requestParam.put("areaid", taxAgentTaxReturnPO.getAreaCode()); + if (TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD.getValue().equals(taxAgentTaxReturnPO.getPasswordType())) { + requestParam.put("sbmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsbmm", "1"); + } else { + requestParam.put("smzh", taxAgentTaxReturnPO.getRealAccount()); + requestParam.put("smmm", taxAgentTaxReturnPO.getPwd()); + requestParam.put("jmsmmm", "1"); + } + if (StringUtils.isNotEmpty(saveParam.getDepartmentCode()) && StringUtils.isNotEmpty(saveParam.getDepartmentName())) { + requestParam.put("bmbh", saveParam.getDepartmentCode()); + requestParam.put("bmmc", saveParam.getDepartmentName()); + } + + return new CompanyClient(taxAgentId).checkPassword(requestParam); + } + + /** + * 妫鏌ユ牎楠屽瘑鐮佹帴鍙f暟鎹 + * + * @param po + * @param response + * @return + */ + protected void verifyCheckPasswordResponse(TaxAgentTaxReturnPO po, CheckPasswordResponse response) { + if (response == null || response.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + po.setUpdateTime(new Date()); + if (!SzyhApiConstant.SUCCESS_CODE.equals(response.getHead().getCode()) || !response.isBody()) { + // 濡傛灉杩斿洖閿欒 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + } else { + // 濡傛灉杩斿洖鎴愬姛 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); + } + } +} diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java new file mode 100644 index 000000000..0881fd6cf --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -0,0 +1,310 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +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.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public abstract class AbstractTaxPaymentService extends Service implements TaxPaymentService { + + protected TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + protected TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + + protected TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + protected TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + protected TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + protected TaxPaymentRequestMapper getTaxPaymentRequestMapper() { + return MapperProxyFactory.getProxy(TaxPaymentRequestMapper.class); + } + + /** + * 鑾峰彇requestId + * + * @param returnPO + * @param taxAgentName + * @param param + * @param apiConfig + * @param clazz + * @return + */ + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + /** + * 鍙戣捣璇锋眰鑾峰彇requestId + * + * @param apiConfig + * @param url + * @param requestParam + * @return + */ + protected T postRequest(TaxDeclarationApiConfigPO apiConfig, + String url, + Map requestParam, + Class clazz) { + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("getAsyncQueryResponse4Payment url: {}, params:\n{}\n", url, 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("getAsyncQueryResponse4Payment response --- \n{}\n", res); + return JsonUtil.parseObject(res, clazz); + } + + /** + * 鍙戣捣璇锋眰鑾峰彇鍙嶉 + * + * @param apiConfig + * @param requestId + * @param url + * @return + */ + protected String getRequest(TaxDeclarationApiConfigPO apiConfig, String requestId, String url) { + Map params = new HashMap<>(1); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + return HttpUtil.getRequest(url, header, params); + } + + protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId()); + SalaryAssert.isTrue(Objects.nonNull(taxReturnPO) && TaxAgentTaxReturnStatusEnum.SUCCESS.getValue().equals(taxReturnPO.getCheckStatus()), SalaryI18nUtil.getI18nLabel(184010, "浼佷笟鏈氳繃楠岃瘉锛岃鍏堝湪銆愪釜绋庢墸缂翠箟鍔′汉銆戣彍鍗曢獙璇佷紒涓氭姤绋庝俊鎭")); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(param.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + SalaryAssert.notNull(taxDeclareRecord, "鐢虫姤琛ㄤ笉瀛樺湪"); + return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord); + } + + public String getRequestId(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + QuerySpecialAmountResponse queryResponse = getRequestIdResponse(tempWrapper.taxReturnPO, tempWrapper.taxAgentPO.getName(), + param, tempWrapper.apiConfigPO, QuerySpecialAmountResponse.class); + // 鏍¢獙璇锋眰缁撴灉 + String responseCode = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getHead) + .map(SzyhResponseHead::getCode) + .orElse(null); + String requestId = Optional.ofNullable(queryResponse) + .map(QuerySpecialAmountResponse::getBody) + .map(QuerySpecialAmountResponse.Body::getRequestId) + .orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || StringUtils.isEmpty(requestId)) { + log.info("getAsyncQueryResponse4Payment code error锛歿}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + // 瀛樺偍 + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestPO(param); + if (paymentRequestPO != null) { + if (SalaryOnOffEnum.ON.getValue().equals(paymentRequestPO.getFeedback())) { + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .requestId(requestId) + .feedback(SalaryOnOffEnum.OFF.getValue()) + .requestType(param.getType()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) + .build()); + } + } else { + paymentRequestPO = TaxPaymentRequestPO.builder() + .id(IdGenerator.generate()) +// todo .creator((long) user.getUID()) + .creator(1L) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .taxDeclareRecordId(param.getTaxDeclareRecordId()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .requestId(requestId) + .requestType(param.getType()) + .feedback(SalaryOnOffEnum.OFF.getValue()) + .reportType(param.getReportType()) + .build(); + getTaxPaymentRequestMapper().insertIgnoreNull(paymentRequestPO); + } + return requestId; + } + + protected TaxPaymentRequestPO getTaxPaymentRequestPO(TaxPaymentQueryParam param) { + List paymentRequests = getTaxPaymentRequestMapper().listSome(TaxPaymentRequestPO + .builder() + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) + .build()); + if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + TaxPaymentRequestPO notFeedback = paymentRequests.stream() + .filter(e -> { + boolean conditionA = getServiceType().equals(e.getRequestType()) + || TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(e.getRequestType()); + boolean conditionB = SalaryOnOffEnum.OFF.getValue().equals(e.getFeedback()); + return !conditionA && conditionB; + }) + .findFirst() + .orElse(null); + + if (Objects.nonNull(notFeedback)) { + TaxPaymentServiceTypeEnum notFeedbackType = TaxPaymentServiceTypeEnum.parseByValue(notFeedback.getRequestType()); + throw new SalaryRunTimeException("璇峰厛鑾峰彇涓婃" + notFeedbackType.getDefaultLabel() + "鐨勭即娆惧弽棣堢粨鏋滃悗锛屽啀杩涜鍏朵粬缂存"); + } + } + return paymentRequests.stream().filter(e -> getServiceType().equals(e.getRequestType())).findFirst().orElse(null); + } + + protected void updateTaxPaymentRequest(TaxPaymentQueryParam param) { + TaxPaymentRequestPO paymentRequest = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO + .builder() + .requestType(getServiceType()) + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .reportType(param.getReportType()) + .build()); + SalaryAssert.notNull(paymentRequest, "璇峰厛鐐瑰嚮[涓夋柟缂存]鎴朳閾惰绔嚟璇佺即娆綸鎸夐挳鍙戣捣缂存璇锋眰鍚庯紝鍐嶇偣鍑籟缂存鍙嶉]鎸夐挳"); + paymentRequest.setFeedback(SalaryOnOffEnum.ON.getValue()); + paymentRequest.setUpdateTime(new Date()); + getTaxPaymentRequestMapper().updateIgnoreNull(paymentRequest); + } + + protected BaseResponse checkBeforeGetFeedbackResponse(TaxPaymentQueryParam param) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(param.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestPO(param); + String button = TaxPaymentServiceTypeEnum.parseByValue(getServiceType()).getDefaultLabel(); + if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + Integer feedback = Optional.ofNullable(paymentRequestPO).map(TaxPaymentRequestPO::getFeedback).orElse(SalaryOnOffEnum.ON.getValue()); + if (TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue().equals(getServiceType())) { + SalaryAssert.isTrue(SalaryOnOffEnum.OFF.getValue().equals(feedback), SalaryI18nUtil.getI18nLabel(184011, "涓夋柟淇℃伅鏌ヨ璇锋眰鑾峰彇澶辫触")); + } else { + SalaryAssert.isTrue(SalaryOnOffEnum.OFF.getValue().equals(feedback), String.format(SalaryI18nUtil.getI18nLabel(184012, "璇峰厛鐐瑰嚮[%s]鎸夐挳鍙戣捣缂存璇锋眰鍚庯紝鍐嶇偣鍑籟缂存鍙嶉]鎸夐挳"), button)); + } + } + BaseResponse response = getFeedbackResponse(apiConfigPO, paymentRequestPO.getRequestId()); + log.info("{} data : {} , paymentRequest : {}", button, response, JsonUtil.toJsonString(paymentRequestPO)); + return response; + } + + @Override + public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + SalaryAssert.notNull(taxDeclareRecord, "涓◣鐢虫姤璁板綍涓嶅瓨鍦"); + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(), param.getReportType()); + if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareStatus.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("褰撳墠鐢虫姤鐘舵佷笉鏄痆鐢虫姤鎴愬姛锛屾湭缂磋垂]锛屾殏鏃舵棤娉曡幏鍙"); + } + if (taxDeclareStatus.getTaxPayAmount() == null || taxDeclareStatus.getPersonNum() == null) { + throw new SalaryRunTimeException("鏈幏鍙栧埌搴旂即淇℃伅锛岃鍏堣繘琛屼釜绋庡湪绾跨敵鎶"); + } + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪"); + + return TaxAmountFormDTO.builder() + .taxAgent(taxAgentPO.getName()) + .amount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPayAmount())) + .personNum(taxDeclareStatus.getPersonNum().toString()) + .build(); + } + + + @Override + public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + @Override + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + @Override + public void syncWithholdingFeedback(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + @Override + public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { + throw new SalaryRunTimeException("鏆傛棤瀹炵幇"); + } + + @Data + @AllArgsConstructor + public static class TempWrapper { + private TaxDeclarationApiConfigPO apiConfigPO; + private TaxAgentTaxReturnPO taxReturnPO; + private TaxAgentPO taxAgentPO; + private TaxDeclareRecordPO taxDeclareRecord; + } +} diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index eb0bd4f65..e4f04dc4d 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.util.ConditionFactory; @@ -13,30 +14,54 @@ import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.AddUpDeductionBiz; import com.engine.salary.config.SalaryElogConfig; +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.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; 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.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; +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.salarysob.IncomeCategoryEnum; +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.service.auth.AuthService; import com.engine.salary.service.auth.AuthServiceImpl; @@ -44,9 +69,8 @@ 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.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -56,6 +80,8 @@ 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.Data; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -71,6 +97,8 @@ import java.math.BigDecimal; 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; @@ -84,6 +112,7 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; * @author qiantao * @version 1.0 **/ +@Slf4j public class AddUpDeductionServiceImpl extends Service implements AddUpDeductionService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -119,6 +148,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); + } + public AuthService getAuthService(User user) { return ServiceUtil.getService(AuthServiceImpl.class, user); } @@ -712,7 +773,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } @Override - public String autoAddAll(Date yearMonth, boolean isAdmin, List taxAgentIds) { + public String autoAddAll(Date yearMonth, Boolean isAdmin, List taxAgentIds) { String cacheKey = "addUpDeduction_autoAddAll_processing"; Object objVal = Util_DataCache.getObjVal(cacheKey); if (objVal != null) { @@ -1167,4 +1228,488 @@ 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(param.getTaxAgentIds()); + 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) { + Set taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId); + 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)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + // 濡傛灉鎺ュ彛浠嶅湪澶勭悊涓紝鍒欑户缁疆璇 + return AddUpDeductionRequestResultDTO.builder().finish(false).msg(msg).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()); + log.info("GET_QUERY_SPECIAL_AMOUNT_FEEDBACK params = {}", params); + 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 04caffe35..58fd15be5 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.NumberUtil; +import com.alibaba.fastjson.JSON; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.util.ConditionFactory; @@ -12,24 +13,34 @@ import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.AddUpSituationBiz; import com.engine.salary.config.SalaryElogConfig; +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.param.TaxAgentQueryParam; 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.OperateTypeEnum; 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.enums.auth.AuthFilterTypeEnum; 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; @@ -37,13 +48,12 @@ import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.auth.AuthService; import com.engine.salary.service.auth.AuthServiceImpl; +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; @@ -53,8 +63,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.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -74,6 +86,7 @@ import java.util.stream.Collectors; import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; +@Slf4j public class AddUpSituationServiceImpl extends Service implements AddUpSituationService { private EncryptUtil encryptUtil = new EncryptUtil(); @@ -97,6 +110,18 @@ 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() { @@ -107,6 +132,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation return ServiceUtil.getService(AuthServiceImpl.class, user); } + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + @Override public Map getSearchCondition() { Map apidatas = new HashMap(); @@ -282,8 +311,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation private List> getExcelRowList(AddUpSituationQueryParam param, boolean hasData) { // excel鏍囬 final List title = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鍏ヨ亴鏃ユ湡", "绱鏀跺叆棰", "绱鍑忛櫎璐圭敤", - "绱绀句繚涓汉鍚堣", "绱鍏Н閲戜釜浜哄悎璁", "绱瀛愬コ鏁欒偛", "绱缁х画鏁欒偛", "绱浣忔埧璐锋鍒╂伅", "绱浣忔埧绉熼噾", "绱璧″吇鑰佷汉", - "绱澶х梾鍖荤枟", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶", "绱涓汉鍏昏侀噾"); + "绱绀句繚涓汉鍚堣", "绱鍏Н閲戜釜浜哄悎璁", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", + "绱宸查鎵i缂寸◣棰", "瀹為檯绱宸查鎵i缂寸◣棰", "涓◣璋冨樊", "绱搴旂撼绋庢墍寰楅"); List> rowList = new ArrayList<>(); @@ -310,24 +339,20 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation cellList.add(NumberUtil.isNumber(dto.getAddUpSubtraction()) ? new BigDecimal(dto.getAddUpSubtraction()) : Util.null2String(dto.getAddUpSubtraction())); cellList.add(NumberUtil.isNumber(dto.getAddUpSocialSecurityTotal()) ? new BigDecimal(dto.getAddUpSocialSecurityTotal()) : Util.null2String(dto.getAddUpSocialSecurityTotal())); cellList.add(NumberUtil.isNumber(dto.getAddUpAccumulationFundTotal()) ? new BigDecimal(dto.getAddUpAccumulationFundTotal()) : Util.null2String(dto.getAddUpAccumulationFundTotal())); - cellList.add(NumberUtil.isNumber(dto.getAddUpChildEducation()) ? new BigDecimal(dto.getAddUpChildEducation()) : Util.null2String(dto.getAddUpChildEducation())); - cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) : Util.null2String(dto.getAddUpContinuingEducation())); - cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) : Util.null2String(dto.getAddUpHousingLoanInterest())); - cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) : Util.null2String(dto.getAddUpHousingRent())); - cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) : Util.null2String(dto.getAddUpSupportElderly())); - cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) : Util.null2String(dto.getAddUpIllnessMedical())); cellList.add(NumberUtil.isNumber(dto.getAddUpEnterpriseAndOther()) ? new BigDecimal(dto.getAddUpEnterpriseAndOther()) : Util.null2String(dto.getAddUpEnterpriseAndOther())); cellList.add(NumberUtil.isNumber(dto.getAddUpOtherDeduction()) ? new BigDecimal(dto.getAddUpOtherDeduction()) : Util.null2String(dto.getAddUpOtherDeduction())); cellList.add(NumberUtil.isNumber(dto.getAddUpTaxExemptIncome()) ? new BigDecimal(dto.getAddUpTaxExemptIncome()) : Util.null2String(dto.getAddUpTaxExemptIncome())); cellList.add(NumberUtil.isNumber(dto.getAddUpAllowedDonation()) ? new BigDecimal(dto.getAddUpAllowedDonation()) : Util.null2String(dto.getAddUpAllowedDonation())); cellList.add(NumberUtil.isNumber(dto.getAddUpTaxSavings()) ? new BigDecimal(dto.getAddUpTaxSavings()) : Util.null2String(dto.getAddUpTaxSavings())); cellList.add(NumberUtil.isNumber(dto.getAddUpAdvanceTax()) ? new BigDecimal(dto.getAddUpAdvanceTax()) : Util.null2String(dto.getAddUpAdvanceTax())); - cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) : Util.null2String(dto.getAddUpInfantCare())); - cellList.add(NumberUtil.isNumber(dto.getAddUpPrivatePension()) ? new BigDecimal(dto.getAddUpPrivatePension()) : Util.null2String(dto.getAddUpPrivatePension())); + cellList.add(NumberUtil.isNumber(dto.getActualAddUpAdvanceTax()) ? new BigDecimal(dto.getActualAddUpAdvanceTax()) : Util.null2String(dto.getActualAddUpAdvanceTax())); + cellList.add(NumberUtil.isNumber(dto.getTaxAdjustment()) ? new BigDecimal(dto.getTaxAdjustment()) : Util.null2String(dto.getTaxAdjustment())); + cellList.add(NumberUtil.isNumber(dto.getAddUpTaxableIncome()) ? new BigDecimal(dto.getAddUpTaxableIncome()) : Util.null2String(dto.getAddUpTaxableIncome())); return cellList; }).collect(Collectors.toList())) .orElse(Collections.emptyList()); + rowList.addAll(dataRowList); } return rowList; @@ -350,9 +375,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation */ private List> getExcelRowDetailList(AddUpSituationQueryParam param) { //excel鏍囬 - List title = Arrays.asList("濮撳悕", "绋庢鎵灞炴湡", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "绱鏀跺叆棰", "绱鍑忛櫎璐圭敤", "绱绀句繚涓汉鍚堣", - "绱鍏Н閲戜釜浜哄悎璁", "绱瀛愬コ鏁欒偛", "绱缁х画鏁欒偛", "绱浣忔埧璐锋鍒╂伅", "绱浣忔埧绉熼噾", "绱璧″吇鑰佷汉", "绱澶х梾鍖荤枟", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", - "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", "绱宸查鎵i缂寸◣棰", "绱濠村辜鍎跨収鎶", "绱涓汉鍏昏侀噾"); + List title = Arrays.asList("濮撳悕", "绋庢鎵灞炴湡", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "绱鏀跺叆棰", "绱鍑忛櫎璐圭敤", + "绱绀句繚涓汉鍚堣", "绱鍏Н閲戜釜浜哄悎璁", "绱浼佷笟锛堣亴涓氾級骞撮噾鍙婂叾浠栫鍒", "绱鍏朵粬鎵i櫎", "绱鍏嶇◣鏀跺叆", "绱鍑嗕簣鎵i櫎鐨勬崘璧犻", "绱鍑忓厤绋庨", + "绱宸查鎵i缂寸◣棰", "瀹為檯绱宸查鎵i缂寸◣棰", "涓◣璋冨樊", "绱搴旂撼绋庢墍寰楅"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //鏌ヨ璇︾粏淇℃伅 @@ -369,24 +394,19 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation cellList.add(Util.null2String(dto.getDepartmentName())); cellList.add(Util.null2String(dto.getMobile())); cellList.add(Util.null2String(dto.getJobNum())); - cellList.add(NumberUtil.isNumber(dto.getAddUpIncome()) ? new BigDecimal(dto.getAddUpIncome()) : dto.getAddUpIncome()); - cellList.add(NumberUtil.isNumber(dto.getAddUpSubtraction()) ? new BigDecimal(dto.getAddUpSubtraction()) : dto.getAddUpSubtraction()); - cellList.add(NumberUtil.isNumber(dto.getAddUpSocialSecurityTotal()) ? new BigDecimal(dto.getAddUpSocialSecurityTotal()) : dto.getAddUpSocialSecurityTotal()); - cellList.add(NumberUtil.isNumber(dto.getAddUpAccumulationFundTotal()) ? new BigDecimal(dto.getAddUpAccumulationFundTotal()) : dto.getAddUpAccumulationFundTotal()); - cellList.add(NumberUtil.isNumber(dto.getAddUpChildEducation()) ? new BigDecimal(dto.getAddUpChildEducation()) : dto.getAddUpChildEducation()); - cellList.add(NumberUtil.isNumber(dto.getAddUpContinuingEducation()) ? new BigDecimal(dto.getAddUpContinuingEducation()) : dto.getAddUpContinuingEducation()); - cellList.add(NumberUtil.isNumber(dto.getAddUpHousingLoanInterest()) ? new BigDecimal(dto.getAddUpHousingLoanInterest()) : dto.getAddUpHousingLoanInterest()); - cellList.add(NumberUtil.isNumber(dto.getAddUpHousingRent()) ? new BigDecimal(dto.getAddUpHousingRent()) : dto.getAddUpHousingRent()); - cellList.add(NumberUtil.isNumber(dto.getAddUpSupportElderly()) ? new BigDecimal(dto.getAddUpSupportElderly()) : dto.getAddUpSupportElderly()); - cellList.add(NumberUtil.isNumber(dto.getAddUpIllnessMedical()) ? new BigDecimal(dto.getAddUpIllnessMedical()) : dto.getAddUpIllnessMedical()); - cellList.add(NumberUtil.isNumber(dto.getAddUpEnterpriseAndOther()) ? new BigDecimal(dto.getAddUpEnterpriseAndOther()) : dto.getAddUpEnterpriseAndOther()); - cellList.add(NumberUtil.isNumber(dto.getAddUpOtherDeduction()) ? new BigDecimal(dto.getAddUpOtherDeduction()) : dto.getAddUpOtherDeduction()); - cellList.add(NumberUtil.isNumber(dto.getAddUpTaxExemptIncome()) ? new BigDecimal(dto.getAddUpTaxExemptIncome()) : dto.getAddUpTaxExemptIncome()); - cellList.add(NumberUtil.isNumber(dto.getAddUpAllowedDonation()) ? new BigDecimal(dto.getAddUpAllowedDonation()) : dto.getAddUpAllowedDonation()); - cellList.add(NumberUtil.isNumber(dto.getAddUpTaxSavings()) ? new BigDecimal(dto.getAddUpTaxSavings()) : dto.getAddUpTaxSavings()); - cellList.add(NumberUtil.isNumber(dto.getAddUpAdvanceTax()) ? new BigDecimal(dto.getAddUpAdvanceTax()) : dto.getAddUpAdvanceTax()); - cellList.add(NumberUtil.isNumber(dto.getAddUpInfantCare()) ? new BigDecimal(dto.getAddUpInfantCare()) : dto.getAddUpInfantCare()); - cellList.add(NumberUtil.isNumber(dto.getAddUpPrivatePension()) ? new BigDecimal(dto.getAddUpPrivatePension()) : dto.getAddUpPrivatePension()); + cellList.add(NumberUtil.isNumber(dto.getAddUpIncome()) ? new BigDecimal(dto.getAddUpIncome()) : Util.null2String(dto.getAddUpIncome())); + cellList.add(NumberUtil.isNumber(dto.getAddUpSubtraction()) ? new BigDecimal(dto.getAddUpSubtraction()) : Util.null2String(dto.getAddUpSubtraction())); + cellList.add(NumberUtil.isNumber(dto.getAddUpSocialSecurityTotal()) ? new BigDecimal(dto.getAddUpSocialSecurityTotal()) : Util.null2String(dto.getAddUpSocialSecurityTotal())); + cellList.add(NumberUtil.isNumber(dto.getAddUpAccumulationFundTotal()) ? new BigDecimal(dto.getAddUpAccumulationFundTotal()) : Util.null2String(dto.getAddUpAccumulationFundTotal())); + cellList.add(NumberUtil.isNumber(dto.getAddUpEnterpriseAndOther()) ? new BigDecimal(dto.getAddUpEnterpriseAndOther()) : Util.null2String(dto.getAddUpEnterpriseAndOther())); + cellList.add(NumberUtil.isNumber(dto.getAddUpOtherDeduction()) ? new BigDecimal(dto.getAddUpOtherDeduction()) : Util.null2String(dto.getAddUpOtherDeduction())); + cellList.add(NumberUtil.isNumber(dto.getAddUpTaxExemptIncome()) ? new BigDecimal(dto.getAddUpTaxExemptIncome()) : Util.null2String(dto.getAddUpTaxExemptIncome())); + cellList.add(NumberUtil.isNumber(dto.getAddUpAllowedDonation()) ? new BigDecimal(dto.getAddUpAllowedDonation()) : Util.null2String(dto.getAddUpAllowedDonation())); + cellList.add(NumberUtil.isNumber(dto.getAddUpTaxSavings()) ? new BigDecimal(dto.getAddUpTaxSavings()) : Util.null2String(dto.getAddUpTaxSavings())); + cellList.add(NumberUtil.isNumber(dto.getAddUpAdvanceTax()) ? new BigDecimal(dto.getAddUpAdvanceTax()) : Util.null2String(dto.getAddUpAdvanceTax())); + cellList.add(NumberUtil.isNumber(dto.getActualAddUpAdvanceTax()) ? new BigDecimal(dto.getActualAddUpAdvanceTax()) : Util.null2String(dto.getActualAddUpAdvanceTax())); + cellList.add(NumberUtil.isNumber(dto.getTaxAdjustment()) ? new BigDecimal(dto.getTaxAdjustment()) : Util.null2String(dto.getTaxAdjustment())); + cellList.add(NumberUtil.isNumber(dto.getAddUpTaxableIncome()) ? new BigDecimal(dto.getAddUpTaxableIncome()) : Util.null2String(dto.getAddUpTaxableIncome())); return cellList; }).collect(Collectors.toList())) .orElse(Collections.emptyList()); @@ -458,11 +478,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation excelComments.add(new ExcelComment(17, 0, 22, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); excelComments.add(new ExcelComment(18, 0, 23, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); excelComments.add(new ExcelComment(19, 0, 24, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); - excelComments.add(new ExcelComment(20, 0, 25, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); - excelComments.add(new ExcelComment(21, 0, 26, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); - excelComments.add(new ExcelComment(22, 0, 27, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); - excelComments.add(new ExcelComment(23, 0, 28, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); - excelComments.add(new ExcelComment(24, 0, 29, 2, SalaryI18nUtil.getI18nLabel(100344, "杈撳叆鏁板瓧"))); return ExcelUtil.genWorkbookV2(rowList, sheetName, excelComments); } @@ -550,7 +565,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 25, "template.xlsx"); + List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 20, "template.xlsx"); int total = excelDates.size(); int index = 0; @@ -718,6 +733,16 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation po.setAddUpInfantCare(dto.getAddUpInfantCare()); po.setAddUpPrivatePension(dto.getAddUpPrivatePension()); + //瀹為檯绱宸查鎵i缂寸◣棰 + String actualAddUpAdvanceTax = dto.getActualAddUpAdvanceTax(); + po.setActualAddUpAdvanceTax(actualAddUpAdvanceTax); + //涓◣璋冨樊 + String taxAdjustment = dto.getTaxAdjustment(); + po.setTaxAdjustment(taxAdjustment); + //绱搴旂撼绋庢墍寰楅 + String addUpTaxableIncome = dto.getAddUpTaxableIncome(); + po.setAddUpTaxableIncome(addUpTaxableIncome); + if (errorSum == 0) { successCount += 1; // 鍚堟牸鏁版嵁 @@ -880,6 +905,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation .addUpTaxSavings(addUpSituationParam.getAddUpTaxSavings()).addUpAdvanceTax(addUpSituationParam.getAddUpAdvanceTax()) .addUpInfantCare(addUpSituationParam.getAddUpInfantCare()) .addUpPrivatePension(addUpSituationParam.getAddUpPrivatePension()) + .actualAddUpAdvanceTax(addUpSituationParam.getActualAddUpAdvanceTax()) + .taxAdjustment(addUpSituationParam.getTaxAdjustment()) + .addUpTaxableIncome(addUpSituationParam.getAddUpTaxableIncome()) .build(); updateList.add(build); biz.batchUpdate(updateList); @@ -1015,6 +1043,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation po.setAddUpTaxSavings(addUpSituationParam.getAddUpTaxSavings()); po.setAddUpInfantCare(addUpSituationParam.getAddUpInfantCare()); po.setAddUpPrivatePension(addUpSituationParam.getAddUpPrivatePension()); + //瀹為檯绱宸查鎵i缂寸◣棰 + po.setActualAddUpAdvanceTax(addUpSituationParam.getActualAddUpAdvanceTax()); + //涓◣璋冨樊 + po.setTaxAdjustment(addUpSituationParam.getTaxAdjustment()); + //绱搴旂撼绋庢墍寰楅 + po.setAddUpTaxableIncome(addUpSituationParam.getAddUpTaxableIncome()); + + insertList.add(po); //鍏ュ簱 @@ -1147,10 +1183,37 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { - encryptUtil.encryptList(list, AddUpSituation.class); + list = encryptUtil.encryptList(list, AddUpSituation.class); List> partition = Lists.partition(list, 50); partition.forEach(getAddUpSituationMapper()::insertData); } } + + 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父鐨勬暟鎹紝璇峰厛鎶ラ佸啀鑾峰彇寰鏈熺疮璁℃暟鎹")); + 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/ApiTaskServiceImpl.java b/src/com/engine/salary/service/impl/ApiTaskServiceImpl.java new file mode 100644 index 000000000..107edf704 --- /dev/null +++ b/src/com/engine/salary/service/impl/ApiTaskServiceImpl.java @@ -0,0 +1,53 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.api.ApiTaskRecordPO; +import com.engine.salary.mapper.api.ApiTaskRecordMapper; +import com.engine.salary.service.ApiTaskService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +import java.util.Date; + +/** + * api浠诲姟璋冨害鏈嶅姟 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class ApiTaskServiceImpl extends Service implements ApiTaskService { + + private ApiTaskRecordMapper getApiTaskRecordMapper() { + return MapperProxyFactory.getProxy(ApiTaskRecordMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + @Override + public void writeApiTaskRecord(String source, String api, String param, String response) { + log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); + Date now = new Date(); + ApiTaskRecordPO build = ApiTaskRecordPO.builder() + .id(IdGenerator.generate()) + .source(source) + .api(api) + .param(param) + .response(response) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getApiTaskRecordMapper().insertIgnoreNull(build); + } +} diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java new file mode 100644 index 000000000..e6b3c6b4c --- /dev/null +++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java @@ -0,0 +1,255 @@ +package com.engine.salary.service.impl; + + +import cn.hutool.core.collection.CollUtil; +import com.engine.core.impl.Service; +import com.engine.salary.component.PageInfo; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; +import com.engine.salary.entity.deductionamount.param.*; +import com.engine.salary.entity.deductionamount.po.DeductionAmountPO; +import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.deductionamount.DeductionAmountMapper; +import com.engine.salary.mapper.deductionamount.DeductionAmountRecordMapper; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.remote.tax.client.DeductionAmountClient; +import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest; +import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse; +import com.engine.salary.service.DeductionAmountService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 骞存敹鍏ヤ笉瓒6涓囧厓鐨勭撼绋庝汉鏆備笉棰勬墸棰勭即绋庢鎵i櫎鍚嶅崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountServiceImpl extends Service implements DeductionAmountService { + + private DeductionAmountRecordMapper getDeductionAmountRecordMapper() { + return MapperProxyFactory.getProxy(DeductionAmountRecordMapper.class); + } + + private DeductionAmountMapper getDeductionAmountMapper() { + return MapperProxyFactory.getProxy(DeductionAmountMapper.class); + } + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + + @Override + public PageInfo list(DeductionAmountListParam param) { + ValidUtil.doValidator(param); + + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().year(param.getYear()).taxAgentId(param.getTaxAgentId()).build()); + + List list = deductionAmountPOS.stream() + .map(deductionAmountPO -> DeductionAmountDTO.builder() + .id(deductionAmountPO.getId()) + .taxAgentId(deductionAmountPO.getEmployeeId()) + .year(deductionAmountPO.getYear()) + .employeeId(deductionAmountPO.getEmployeeId()) + .employeeName(deductionAmountPO.getEmployeeName()) + .employeeType(deductionAmountPO.getEmployeeType()) + .jobNum(deductionAmountPO.getJobNum()) + .nationality(deductionAmountPO.getNationality()) + .cardNum(deductionAmountPO.getCardNum()) + .cardType(deductionAmountPO.getCardType()) + .declareStatus(deductionAmountPO.getDeclareStatus()) + .declareStatusName(DeclareStatusEnum.getByValue(deductionAmountPO.getDeclareStatus()).getDefaultLabel()) + .declareErrorMsg(deductionAmountPO.getDeclareErrorMsg()) + .deductFlag(deductionAmountPO.getDeductFlag()) + .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared()) + .creator(deductionAmountPO.getCreator()) + .createTime(deductionAmountPO.getCreateTime()) + .updateTime(deductionAmountPO.getUpdateTime()) + .build()) + .collect(Collectors.toList()); + + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class); + } + + @Override + public void add(DeductionAmountAddParam param) { + ValidUtil.doValidator(param); + + //宸插瓨鍦 + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(param.getTaxAgentId()).year(param.getYear()).build()); + List oldIds = SalaryEntityUtil.properties(deductionAmountPOS, DeductionAmountPO::getEmployeeId, Collectors.toList()); + + //鏈鏂板 + List employeeDeclareIds = param.getEmployeeDeclareIds(); + List employeeDeclarePOS = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(employeeDeclareIds).build()); + + Date now = new Date(); + employeeDeclarePOS.stream() + .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId())) + .map(employeeDeclarePO -> DeductionAmountPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(employeeDeclarePO.getTaxAgentId()) + .year(param.getYear()) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeName(employeeDeclarePO.getEmployeeName()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .jobNum(employeeDeclarePO.getJobNum()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(employeeDeclarePO.getCardType()) + .nationality(employeeDeclarePO.getNationality()) + .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .deductFlag(SalaryOnOffEnum.ON.getValue()) + .successfullyDeclared(SalaryOnOffEnum.OFF.getValue()) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(NumberUtils.INTEGER_ZERO) + .build()) + .forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO)); + } + + @Override + public void edit(DeductionAmountEditParam param) { + ValidUtil.doValidator(param); + + DeductionAmountPO po = getDeductionAmountMapper().getById(param.getId()); + if (po == null) { + throw new SalaryRunTimeException("鎵i櫎鍚嶅崟涓嶅瓨鍦"); + } + + po.setDeductFlag(param.getDeductFlag()); + getDeductionAmountMapper().updateIgnoreNull(po); + } + + @Override + public void delete(DeductionAmountDeleteParam param) { + if (CollUtil.isEmpty(param.getIds())) { + return; + } + param.getIds().forEach(id -> { + getDeductionAmountMapper().delete(DeductionAmountPO.builder().id(id).build()); + }); + } + + @Override + public Object query(DeductionAmountOnlineQueryParam param) { + Long taxAgentId = param.getTaxAgentId(); + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + return deductionAmountClient.query(param.getYear()); + } + + @Override + public String confirm(DeductionAmountConfirmParam param) { + ValidUtil.doValidator(param); + Long taxAgentId = param.getTaxAgentId(); + String year = param.getYear(); + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build()); + List kczglb = deductionAmountPOS.stream() + .map(deductionAmountPO -> { + ConfirmPreDeductRequest.kczg kczg = new ConfirmPreDeductRequest.kczg(); + kczg.setXm(deductionAmountPO.getEmployeeName()); + kczg.setZzhm(deductionAmountPO.getCardNum()); + kczg.setZzlx(CardTypeEnum.getByValue(deductionAmountPO.getCardType()).getDefaultLabel()); + kczg.setGj(deductionAmountPO.getNationality()); + kczg.setKcbs(SalaryOnOffEnum.parseByValue(deductionAmountPO.getDeductFlag()).getDefaultLabel()); + return kczg; + }).collect(Collectors.toList()); + + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + String requestId = deductionAmountClient.confirm(year, kczglb); + + //鏇存柊鐘舵 + deductionAmountPOS.forEach(deductionAmountPO -> { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARING.getValue()); + getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO); + }); + + //鎻掑叆璁板綍 + getDeductionAmountRecordMapper().deleteByTaxAgentIdAndYear(taxAgentId, year); + DeductionAmountRecordPO recordPO = DeductionAmountRecordPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .year(year) + .requestId(requestId) + .creator((long) user.getUID()) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getDeductionAmountRecordMapper().insertIgnoreNull(recordPO); + + return requestId; + } + + @Override + public String feedback(DeductionAmountFeedBackParam param) { + Long taxAgentId = param.getTaxAgentId(); + String year = param.getYear(); + DeductionAmountRecordPO recordPO = getDeductionAmountRecordMapper().getByTaxAgentIdAndYear(taxAgentId, year); + + if (recordPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "璇峰厛鐐瑰嚮鎶ラ佹墸闄ゅ悕鍗曪紝鍐嶇偣鍑诲弽棣")); + } + + String requestId = recordPO.getRequestId(); + DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId); + ConfirmFeedbackResponse feedback = deductionAmountClient.feedback(requestId); + + if (feedback == null || feedback.getHead() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯")); + } + // 濡傛灉绋庡弸杩斿洖閿欒淇℃伅 + String code = feedback.getHead().getCode(); + if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) { + //杩涜涓殑浠诲姟锛岄噸璇 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "浠诲姟杩樺湪澶勭悊涓紝璇风◢鍚庣偣鍑诲弽棣")); + } + + if (!SzyhApiConstant.SUCCESS_CODE.equals(code)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, feedback.getHead().getMsg())); + } + + List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build()); + + List kcqrsblb = feedback.getBody().getKcqrsblb(); + Map failMap = SalaryEntityUtil.convert2Map(kcqrsblb, ConfirmFeedbackResponse.Body.kcqrsb::getZzhm, ConfirmFeedbackResponse.Body.kcqrsb::getSbyy); + + deductionAmountPOS.forEach(deductionAmountPO -> { + String cardNum = deductionAmountPO.getCardNum(); + if (failMap.containsKey(cardNum)) { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + deductionAmountPO.setDeclareErrorMsg(failMap.get(cardNum)); + } else { + deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()); + deductionAmountPO.setSuccessfullyDeclared(SalaryOnOffEnum.ON.getValue()); + } + getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO); + }); + + return String.format("鎴愬姛%s鏉★紝澶辫触%s鏉", feedback.getBody().getCgrs(), feedback.getBody().getSbrs()); + + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java new file mode 100644 index 000000000..d8a01f687 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -0,0 +1,1200 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareBO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.service.EmployeeDeclareExcelService; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.*; +import com.engine.salary.util.valid.SalaryCardUtil; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.engine.salary.util.db.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.BeanWrapper; +import org.springframework.beans.BeanWrapperImpl; +import weaver.file.ExcelSheet; +import weaver.file.ImageFileManager; +import weaver.general.Util; +import weaver.hrm.User; + +import java.beans.PropertyDescriptor; +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ鍑 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeDeclareExcelServiceImpl extends Service implements EmployeeDeclareExcelService { + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } +// private ExtEmployeeService extEmployeeService; + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + @Override + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam) { + // 鏌ヨ浜哄憳 + List employeeDeclares = Collections.emptyList(); + if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { + employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); + } + String yesI18 = SalaryI18nUtil.getI18nLabel(111111, "鏄"); + String noI18 = SalaryI18nUtil.getI18nLabel(111111, "鍚"); + List> rows = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + List row = Lists.newArrayList(); + row.add(employeeDeclare.getJobNum()); + row.add(employeeDeclare.getEmployeeName()); + row.add(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel()); + row.add(employeeDeclare.getCardNum()); + row.add(employeeDeclare.getNationality()); + row.add(GenderEnum.getDefaultLabelByValue(employeeDeclare.getGender()).getDefaultLabel()); + row.add(employeeDeclare.getBirthplace()); + row.add(employeeDeclare.getBirthday()); + row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); + row.add(employeeDeclare.getMobile()); + row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEntryDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDepartureDate())); + row.add(employeeDeclare.getTaxReasons()); + row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getDisabilityCardNo()); + row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getMartyrDependentsCardNo()); + row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); + row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); + rows.add(row); + } + // 缁勮excel瀵煎嚭鏁版嵁 + ExcelSheetData excelSheetData = new ExcelSheetData(); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(111111, "浜哄憳淇℃伅閲囬泦")); + excelSheetData.setHeaders(getImportHeader()); + excelSheetData.setRows(rows); + return ExcelUtil.genWorkbook(excelSheetData); + } + + @Override + public Map preview(EmployeeDeclareImportParam param) { + //1銆佸弬鏁版牎楠 + String imageId = param.getImageId(); + if (StringUtils.isBlank(imageId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鏂囦欢id涓虹┖")); + } + Map map = new HashMap<>(); + + InputStream fileInputStream = null; + try { + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + map.put("headers", headers); + map.put("list", ExcelParseHelper.parse2List(sheet, 1)); + + return map; + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + } + + @Override + public Map importData(EmployeeDeclareImportParam param) { + Map apidatas = new HashMap<>(); + InputStream fileInputStream = null; + try { + Date now = new Date(); + // 涓◣鎵g即涔夊姟浜篿d + Long taxAgentId = param.getTaxAgentId(); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); + if (taxAgent == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鍙傛暟閿欒锛屾棤娉曟壘鍒颁釜绋庢墸缂翠箟鍔′汉")); + } + // 绋庢鎵灞炴湡 + String taxCycle = SalaryDateUtil.getFormatDate(param.getTaxCycle()); + Date taxCycleDate = param.getTaxCycle(); + + // 瀵煎嚭妯℃澘涓殑琛ㄥご + List headerList = getImportHeader().stream().map(header -> header.toString()).collect(Collectors.toList()); + // 鏌ヨ鎵鏈夌殑浜哄憳 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + // 鏌ヨ鎵鏈夌殑澶栭儴浜哄憳 + List extEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.EXT); + // 鏌ヨ浜哄憳鎶ラ佽〃鐨勪汉鍛 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(SalaryDateUtil.dateStrToLocalDate(taxCycle), taxAgentId); + // 鏍¢獙瀛楁 + String checkType = param.getCheckType(); + Map extEmployeeMap = Maps.newHashMap(); + Map simpleEmployeeMap = Maps.newHashMap(); + Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); + if (Objects.equals(checkType, "jobNum")) { + extEmployeeMap = Collections.emptyMap(); + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getWorkcode); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); + } else { + // 鏌ヨ鎵鏈変汉鍛樼殑涓汉淇℃伅 + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getIdNo); + extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, DataCollectionEmployee::getIdNo); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); + } + // 闇瑕佹柊澧炵殑鎶ラ佷汉鍛 + List needAddEmployeeDeclares = Lists.newArrayList(); + // 闇瑕佹洿鏂扮殑鎶ラ佷汉鍛 + List needUpdateEmployeeDeclares = Lists.newArrayList(); + // 绱㈠紩(鐢ㄤ簬璁$畻杩涘害) + int index = 0; + // 澶辫触鐨勬暟閲 + int failCount = 0; + // 鎴愬姛鐨勬暟閲 + int successCount = 0; + // 閿欒琛岀殑绱㈠紩 + int failRowIndex = 1; + // 鍖呭惈閿欒鎻愮ず淇℃伅鐨剆heet椤 + List errorExcelSheets = Lists.newArrayList(); + + String imageId = Util.null2String(param.getImageId()); + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + // 琛ㄥご + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + // 妫鏌ヨ〃澶 + String isCorrectHeader = checkHeader(headers, headerList); + if (isCorrectHeader != null) { + throw new SalaryRunTimeException(isCorrectHeader); + } + // 鏁版嵁 + List> data = ExcelParseHelper.parse2Map(sheet, 1); + if (CollectionUtils.isEmpty(data)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "瀵煎叆鏁版嵁涓嶈兘涓虹┖")); + } + // 閿欒鎻愮ず淇℃伅 + List excelComments = Lists.newArrayList(); + List errorData = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + Map map = data.get(i); + // 鏁版嵁鏄惁瀛樺湪閿欒 + boolean isError = false; + EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); + for (String dataKey : headerList) { + String dataValue = Util.null2String(map.get(dataKey)); + if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "宸ュ彿"))) { + if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "宸ュ彿涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } + employeeDeclareExcel.setJobNum(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "濮撳悕"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "濮撳悕涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmployeeName(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "璇佷欢绫诲瀷"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "璇佷欢绫诲瀷涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else { + CardTypeEnum cardTypeEnum = CardTypeEnum.getByDefaultLabel(dataValue); + if (cardTypeEnum == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "璇佷欢绫诲瀷濉啓閿欒锛屽彧鑳藉~鍐欏眳姘戣韩浠借瘉銆佸鍥芥姢鐓")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setCardType(cardTypeEnum.getValue()); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else { + // 韬唤璇佸彿鍏ㄩ儴杞负澶у啓 + employeeDeclareExcel.setCardNum(dataValue.toUpperCase()); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鍥界睄"))) { + employeeDeclareExcel.setNationality(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鎬у埆"))) { + Integer gender = GenderEnum.getValueByDefaultLabel(dataValue); + if (gender == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鎬у埆濉啓鏈夎锛")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setGender(gender); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鍑虹敓鍦"))) { + employeeDeclareExcel.setBirthplace(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鍑虹敓鏃ユ湡"))) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setBirthday(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鐘舵"))) { + boolean legalDataValue = false; + for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { + if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浜哄憳鐘舵佸彧鑳藉~鍐欐甯告垨闈炴甯")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else if (!SalaryCardUtil.checkMobile(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setMobile(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))) { + boolean legalDataValue = false; + for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { + if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷濉啓閿欒")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))) { + if (StringUtils.isEmpty(dataValue)) { + if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷涓嶄负銆屽叾浠栥嶆椂锛屼换鑱屽彈闆囦粠涓氭棩鏈熶负蹇呭~")); + errorData.add(errorMessageMap); + } + } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "绂昏亴鏃ユ湡"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue().toString())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浜哄憳鐘舵佷负闈炴甯告椂锛岀鑱屾棩鏈熷繀濉")); + errorData.add(errorMessageMap); + } + } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDismissDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "棣栨鍏ュ鏃堕棿"))) { + if (StringUtils.isNotBlank(dataValue)) { + if (dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "棰勮绂诲鏃堕棿"))) { + if (StringUtils.isNotBlank(dataValue)) { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "娑夌◣浜嬬敱"))) { + employeeDeclareExcel.setTaxReasons(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁娈嬬柧"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁娈嬬柧鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "娈嬬柧璇佸彿"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "銆屾槸鍚︽畫鐤俱嶅~銆屾槸銆嶆椂锛屾畫鐤捐瘉鍙峰繀濉")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setDisabilityCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁鐑堝睘"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁鐑堝睘鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鐑堝睘璇佸彿"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "銆屾槸鍚︾儓灞炪嶅~銆屾槸銆嶆椂锛岀儓灞炶瘉鍙峰繀濉")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁瀛よ"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁瀛よ佸彧鑳藉~鍐欐槸涓庡惁")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁鎵i櫎鍑忛櫎璐圭敤鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } + } + if (!isError) { + if (StringUtils.equals(checkType, "jobNum")) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ宸ュ彿")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + } + } else { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ璇佷欢鍙风爜")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + } + } + } + if (isError) { + failCount++; + failRowIndex++; + continue; + } + successCount++; + } + + if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { + getEmployeeDeclareService(user).batchInsert(needAddEmployeeDeclares); + } + if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + needUpdateEmployeeDeclares.stream().forEach(getEmployeeDeclareMapper()::update); + } + + // 璁板綍鏃ュ織 + needAddEmployeeDeclares.addAll(needUpdateEmployeeDeclares); + if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(taxAgentId)); + loggerContext.setTargetName(taxAgent.getName() + "-" + SalaryDateUtil.getFormatYearMonth(param.getTaxCycle())); + loggerContext.setOperateType(OperateTypeEnum.EXCEL_IMPORT.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "瀵煎叆浜哄憳淇℃伅鎶ラ")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "瀵煎叆浜哄憳淇℃伅鎶ラ侊細") + taxAgent.getName()); + loggerContext.setNewValueList(needAddEmployeeDeclares); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", failCount); + apidatas.put("errorData", errorData); + // 鍙戦佸鍏ュ洖璋冧俊鎭 +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); + + } catch (Exception e) { + log.error("浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細{}", e.getMessage(), e); + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + + + public static String[] getNullPropertyNames(Object source) { + final BeanWrapper src = new BeanWrapperImpl(source); + PropertyDescriptor[] pds = src.getPropertyDescriptors(); + + Set emptyNames = new HashSet<>(); + for (PropertyDescriptor pd : pds) { + String name = pd.getName(); + if("dismissDate".equals(name)){ + continue; + } + Object srcValue = src.getPropertyValue(name); + // 姝ゅ鍒ゆ柇鍙牴鎹渶姹備慨鏀 + if (srcValue == null) { + emptyNames.add(name); + } + } + String[] result = new String[emptyNames.size()]; + return emptyNames.toArray(result); + } + + + private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, + EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, + Date taxCycle, Date now) { + EmployeeDeclarePO employeeDeclare = EmployeeDeclarePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .taxCycle(taxCycle) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(Long.valueOf(user.getUID())) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .build(); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + + BeanUtils.copyProperties(employeeDeclarePO, employeeDeclare, getNullPropertyNames(employeeDeclarePO)); + if (extEmployee != null) { + employeeDeclare.setEmployeeId(extEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); + } + if (simpleEmployee != null) { + employeeDeclare.setEmployeeId(simpleEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + } + return employeeDeclare; + } + + @Override + public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { + // 鏌ヨ闇瑕佹姤閫佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByParam(queryParam); + // 杞崲鎴恉to + List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); + // 闇瑕佸鍑虹殑鏁版嵁 + List> excelSheetData = ExcelUtil.getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(queryParam.getTaxAgentId()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.employeeDeclareLoggerTemplate, + queryParam.getTaxAgentId(), + SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(queryParam.getTaxCycle())), + "瀵煎嚭浜哄憳淇℃伅鎶ラ", + "瀵煎嚭浜哄憳淇℃伅鎶ラ", + user); + return ExcelUtil.genWorkbookV2(excelSheetData, "浜哄憳淇℃伅閲囬泦"); + } + +// @Override +// public XSSFWorkbook export4Add(EmployeeDeclareAddListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 鏌ヨ闇瑕佹姤閫佺殑浜哄憳 +// List employeeDeclares = getEmployeeDeclareService(user).list4AddByParam(queryParam); +// // 杞崲鎴恉to +// List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); +// // 闇瑕佸鍑虹殑鏁版嵁 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); +// CustomExportUtil.customColumnsBuild(false, queryParam.getCustomColumns(), excelSheetData); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156426, "浜哄憳淇℃伅閲囬泦鏈湀鏂板") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156426, "浜哄憳淇℃伅閲囬泦鏈湀鏂板")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Add") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } +// +// @BatchExportHandler("exportEmployeeDeclare4Add") +// private void exportEmployeeDeclare4Add() { +// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); +// log.info("瀵煎嚭缁撴潫锛歿}", JsonUtil.toJsonString(message)); +// } +// +// @Override +// public XSSFWorkbook export4Update(EmployeeDeclareListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 鏌ヨ闇瑕佹姤閫佺殑浜哄憳 +// List employeeDeclares = getEmployeeDeclareService(user).list4UpdateByParam(queryParam); +// // 杞崲鎴恉to +// List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); +// // 闇瑕佸鍑虹殑鏁版嵁 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); +// CustomExportUtil.customColumnsBuild(false, queryParam.getCustomColumns(), excelSheetData); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156427, "浜哄憳淇℃伅閲囬泦鏈湀淇℃伅鍙樺姩") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156427, "浜哄憳淇℃伅閲囬泦鏈湀淇℃伅鍙樺姩")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Update") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } +// +// @BatchExportHandler("exportEmployeeDeclare4Update") +// private void exportEmployeeDeclare4Update() { +// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); +// log.info("瀵煎嚭缁撴潫锛歿}", JsonUtil.toJsonString(message)); +// } +// +// @Override +// public XSSFWorkbook export4Fail(EmployeeDeclareFailListQueryParam queryParam) { +// String tenantKey = simpleEmployee.getTenantKey(); +// Long currentEmployeeId = simpleEmployee.getEmployeeId(); +// // 鏌ヨ闇瑕佹姤閫佺殑浜哄憳 +// List employeeDeclares = getEmployeeDeclareService(user).list4FailByParam(queryParam); +// // 杞崲鎴恉to +// List dtos = getEmployeeDeclareService(user).convert2FailListDTO(employeeDeclares); +// // 闇瑕佸鍑虹殑鏁版嵁 +// ExcelSheetData excelSheetData = getExcelSheetData(EmployeeDeclareFailListDTO.class, dtos); +// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() +// .fileName(SalaryI18nUtil.getI18nLabel(156428, "浜哄憳淇℃伅閲囬泦鏈湀鎶ラ佸け璐") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) +// .dataType(SalaryI18nUtil.getI18nLabel(156428, "浜哄憳淇℃伅閲囬泦鏈湀鎶ラ佸け璐")) +// .function(excelExportParam.getFunction()) +// .handlerName("exportEmployeeDeclare4Fail") +// .flag(true) +// .bizId(excelExportParam.getBiz()) +// .module(excelExportParam.getModule()) +// .userId(simpleEmployee.getEmployeeId()) +// .tenantKey(simpleEmployee.getTenantKey()) +// .operator(simpleEmployee.getUsername()) +// .eteamsId(TenantRpcContext.getEteamsId()) +// .build(); +// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); +// } + + +// public Map importEmployeeDeclare(EmployeeDeclareImportEmployeeParam param) { +// try { +// Date now = new Date(); +// // 涓◣鎵g即涔夊姟浜篿d +// Long taxAgentId = param.getTaxAgentId(); +// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); +// if (taxAgent == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "鍙傛暟閿欒锛屾棤娉曟壘鍒颁釜绋庢墸缂翠箟鍔′汉")); +// } +// // 绋庢鎵灞炴湡 +// Date taxCycle = param.getTaxCycle(); +// if (taxCycle == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒")); +// } +// +// InputStream fileInputStream = null; +// fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); +// +// // 瀵煎嚭妯℃澘涓殑琛ㄥご +// List headerList = getImportHeader(); +// // 鏌ヨ鎵鏈夌殑浜哄憳 +// List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); +// // 鏌ヨ浜哄憳鎶ラ佽〃鐨勪汉鍛 +// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxCycle, taxAgentId); +// // 鏍¢獙瀛楁 +// String checkType = Util.null2String(paramMap.getOrDefault("checkType", "jobNum")); +// Map simpleEmployeeMap = Maps.newHashMap(); +// Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); +// if (Objects.equals(checkType, "jobNum")) { +// simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getJobNum); +// employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); +// } else { +// // 鏌ヨ鎵鏈変汉鍛樼殑涓汉淇℃伅 +// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds); +// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); +// for (SimpleUserInfo simpleUserInfo : simpleUserInfos) { +// if (idKeySimpleEmployeeMap.containsKey(simpleUserInfo.getEmployeeId())) { +// simpleEmployeeMap.put(simpleUserInfo.getIdNo(), idKeySimpleEmployeeMap.get(simpleUserInfo.getEmployeeId())); +// } +// } +// employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); +// +// } +// // 闇瑕佹柊澧炵殑鎶ラ佷汉鍛 +// List needAddEmployeeDeclares = Lists.newArrayList(); +// // 闇瑕佹洿鏂扮殑鎶ラ佷汉鍛 +// List needUpdateEmployeeDeclares = Lists.newArrayList(); +// // 绱㈠紩(鐢ㄤ簬璁$畻杩涘害) +// int index = 0; +// // 澶辫触鐨勬暟閲 +// int errorCount = 0; +// // 鎴愬姛鐨勬暟閲 +// int successCount = 0; +// // 閿欒琛岀殑绱㈠紩 +// int failRowIndex = 1; +// // 閿欒鎻愮ず +// List> excelComments = new ArrayList<>(); +// // 閿欒excel鍐呭 +// List errorData = new ArrayList<>(); +// +// Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); +// // 琛ㄥご +// List headers = ExcelSupport.getSheetHeader(sheet, 0); +// +// // 妫鏌ヨ〃澶 +// String isValidHeader = checkHeader(headers, headerList); +// if (StringUtils.isNotBlank(isValidHeader)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", isValidHeader); +// excelComments.add(errorMessageMap); +// apidatas.put("errorData", excelComments); +// return apidatas; +// } +// +// // 鏁版嵁 +// List data = ExcelParseHelper.parse2Map(fileInputStream, EmployeeDeclareExcelDTO.class, 0, 1, 14, "1.xlsx"); +// if (CollectionUtils.isEmpty(data)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// return apidatas; +// } +// +// for (int i = 0; i < data.size(); i++) { +// EmployeeDeclareExcelDTO employeeDeclareExcelDTO = data.get(i); +// +// employeeDeclareExcelDTO.getEmployeeName() +// +// //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 +// List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(simpleEmployees, userName, deparmentName, mobile, workcode, null); +// +// if (StringUtils.isBlank(userName) && "0".equals(confValue)) { +// //濮撳悕 涓嶈兘涓虹┖ +// //閿欒娑堟伅瀵硅薄 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (CollectionUtils.isEmpty(employeeSameIds)) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (employeeSameIds.size() > 1) { +// //瀛樺湪绂昏亴鍜屽湪鑱岀姸鎬佸彇鍦ㄨ亴鐘舵 +// employeeSameIds = employeeSameIds.stream() +// .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) +// .collect(Collectors.toList()); +// if (employeeSameIds.size() != 1) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// addUpDeduction.setEmployeeId(employeeId); +// } +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// if (employeeId != null && employeeId > 0) { +// addUpDeduction.setEmployeeId(employeeId); +// } else { +// //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } +// } +// +// +// // 鏁版嵁鏄惁瀛樺湪閿欒 +// boolean isError = false; +// if (StringUtils.equals(employeeDeclareExcelDTO.getJobNum(), SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"))) { +// if (StringUtils.isEmpty(employeeDeclareExcelDTO.getJobNum()) ) { +// isError = true; +// +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(136250, "宸ュ彿涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } +// employeeDeclareExcel.setJobNum(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "濮撳悕涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmployeeName(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(105139, "璇佷欢绫诲瀷"))) { +// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(86318, "璇佷欢鍙风爜"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156386, "璇佷欢鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156429, "璇佷欢鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setCardNum(dataValue); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156394, "浜哄憳鐘舵"))) { +// boolean legalDataValue = false; +// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { +// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156430, "浜哄憳鐘舵佸彧鑳藉~鍐欐甯告垨闈炴甯"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156396, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))) { +// boolean legalDataValue = false; +// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { +// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156431, "浠昏亴鍙楅泧浠庝笟绫诲瀷濉啓閿欒"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187374, "鍏ヨ亴骞村害灏变笟鎯呭舰"))) { +// employeeDeclareExcel.setEmploymentFirstYear(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(98621, "鎵嬫満鍙风爜"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(106429, "鎵嬫満鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkMobile(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160510, "鎵嬫満鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setMobile(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156409, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160511, "浠昏亴鍙楅泧浠庝笟绫诲瀷涓嶄负銆屽叾浠栥嶆椂锛屼换鑱屽彈闆囦粠涓氭棩鏈熶负蹇呭~"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(95228, "绂昏亴鏃ユ湡"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160512, "浜哄憳鐘舵佷负闈炴甯告椂锛岀鑱屾棩鏈熷繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156399, "鏄惁娈嬬柧"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "鏄惁娈嬬柧鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156412, "娈嬬柧璇佸彿"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160513, "銆屾槸鍚︽畫鐤俱嶅~銆屾槸銆嶆椂锛屾畫鐤捐瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setDisabilityCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187385, "鏄惁鐑堝睘"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "鏄惁鐑堝睘鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156413, "鐑堝睘璇佸彿"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160514, "銆屾槸鍚︾儓灞炪嶅~銆屾槸銆嶆椂锛岀儓灞炶瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156400, "鏄惁瀛よ"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156434, "鏄惁瀛よ佸彧鑳藉~鍐欐槸涓庡惁"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156402, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156435, "鏄惁鎵i櫎鍑忛櫎璐圭敤鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } +// if (!isError) { +// if (StringUtils.equals(checkType, "jobNum")) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String jobNumI18 = SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156436, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ宸ュ彿"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// } +// } else { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String cardNoI18 = SalaryI18nUtil.getI18nLabel(86318, "璇佷欢鍙风爜"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156437, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ璇佷欢鍙风爜"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// } +// } +// } +// if (isError) { +// errorCount++; +// failRowIndex++; +// errorData.add(map); +// continue; +// } +// successCount++; +// } +// // 濡傛灉sheet鍖呭惈閿欒鏁版嵁 +// if (CollectionUtils.isNotEmpty(errorData)) { +// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// } +// +// if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { +// getEmployeeDeclareService(user).saveBatch(needAddEmployeeDeclares); +// } +// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { +// getEmployeeDeclareService(user).updateBatchById(needUpdateEmployeeDeclares); +// } +// // 鍙戦佸鍏ュ洖璋冧俊鎭 +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); +// } catch (Exception e) { +// log.error("浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細{}", e.getMessage(), e); +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(156438, "浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細") + e.getMessage()); +// } +// } +// +// private EmployeeDeclarePO buildEmployeeDeclare(ExtEmployeePO extEmployee, +// EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, +// String taxCycle, LocalDateTime now, Long String tenantKey) { +// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() +// .setId(IdGenerator.generate()) +// .setTaxAgentId(taxAgentId) +// .setTaxCycle(taxCycle) +// .setTenantKey(tenantKey) +// .setCreator(employeeId) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// BeanUtils.copyProperties(employeeDeclareExcel, employeeDeclare); +// if (extEmployee != null) { +// employeeDeclare.setEmployeeId(extEmployee.getId()) +// .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); +// } +// if (simpleEmployee != null) { +// employeeDeclare.setEmployeeId(simpleEmployee.getEmployeeId()) +// .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); +// } +// return employeeDeclare; +// } + + private List getImportHeader() { + List headers = new ArrayList<>(); + + headers.add(SalaryI18nUtil.getI18nLabel(111111, "宸ュ彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "濮撳悕")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "璇佷欢绫诲瀷")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "璇佷欢鍙风爜")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鍥界睄")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鎬у埆")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鍑虹敓鍦")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鍑虹敓鏃ユ湡")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鐘舵")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鎵嬫満鍙风爜")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "浠昏亴鍙楅泧浠庝笟绫诲瀷")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "浠昏亴鍙楅泧浠庝笟鏃ユ湡")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "绂昏亴鏃ユ湡")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "棣栨鍏ュ鏃堕棿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "棰勮绂诲鏃堕棿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "娑夌◣浜嬬敱")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁娈嬬柧")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "娈嬬柧璇佸彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁鐑堝睘")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鐑堝睘璇佸彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁瀛よ")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁鎵i櫎鍑忛櫎璐圭敤")); + + return headers; + + } + + + /** + * 妫鏌ヨ〃澶 + * + * @param headers + * @return + */ + private String checkHeader(List headers, List headerList) { + // 缂哄皯鐨勫垪 + List lackHeaders = headerList.stream() + .filter(header -> !headers.contains(header)) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(lackHeaders)) { + // 鍙戦佸鍏ュ洖璋冧俊鎭 + return SalaryI18nUtil.getI18nLabel(111111, "缂哄皯濡備笅鍒楋紝璇锋鏌ワ細") + Joiner.on(",").join((Iterable) lackHeaders); + } + return null; + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java new file mode 100644 index 000000000..aacb876e2 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -0,0 +1,45 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareRecordMapper; +import com.engine.salary.service.EmployeeDeclareRecordService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * 鍛樺伐鎶ラ佽褰 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService { + + private EmployeeDeclareRecordMapper getEmployeeDeclareRecordMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareRecordMapper.class); + } + + @Override + public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { + List employeeDeclareRecordPOS = getEmployeeDeclareRecordMapper().listSome(EmployeeDeclareRecordPO.builder().taxCycle(taxCycle).taxAgentId(taxAgentId).build()); + if (CollectionUtils.isNotEmpty(employeeDeclareRecordPOS)) { + return employeeDeclareRecordPOS.get(0); + } + return null; + } + + @Override + public void deleteByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { + getEmployeeDeclareRecordMapper().deleteByTaxCycleAndTaxAgentId(taxCycle, taxAgentId); + } + + @Override + public void save(EmployeeDeclareRecordPO employeeDeclareRecord) { + getEmployeeDeclareRecordMapper().insertIgnoreNull(employeeDeclareRecord); + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java new file mode 100644 index 000000000..4ed07d42d --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -0,0 +1,767 @@ +package com.engine.salary.service.impl; + + +import cn.hutool.core.map.MapUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; +import com.engine.salary.entity.employeedeclare.dto.*; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO; +import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeFeedbackResponse; +import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeInfoResponse; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; +import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.SalaryCycleTypeEnum; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +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.employeedeclare.EmployeeDeclareMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +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.ImmutableMap; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; +import weaver.hrm.User; + +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeDeclareServiceImpl extends Service implements EmployeeDeclareService { + + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.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 EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) { + return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user); + } + + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + @Override + public EmployeeDeclarePO getById(Long id) { + return getEmployeeDeclareMapper().getById(id); + } + + @Override + public List listByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build()); + } + + @Override + public List listByTaxCycleAndTaxAgentId(Date taxCycle, Long taxAgentId) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxCycle(taxCycle) + .taxAgentId(taxAgentId) + .build()); + } + + @Override + public List listByTaxCycleAndTaxAgentIdAndEmployeeIds(Date taxCycle, Long taxAgentId, Collection employeeIds) { + if (CollectionUtils.isEmpty(employeeIds)) { + return Collections.emptyList(); + } + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxCycle(taxCycle) + .taxAgentId(taxAgentId) + .employeeIds(employeeIds) + .build()); + } + + @Override + public List listByParam(EmployeeDeclareListQueryParam queryParam) { + return getEmployeeDeclareMapper().listByParam(queryParam); + } + + + @Override + public List list4AddByParam(EmployeeDeclareAddListQueryParam queryParam) { + queryParam.setPreTaxCycle(SalaryDateUtil.plusMonths(queryParam.getTaxCycle(), -1)); + return getEmployeeDeclareMapper().list4AddByParam(queryParam); + } + + @Override + public List list4UpdateByParam(EmployeeDeclareListQueryParam queryParam) { + return getEmployeeDeclareMapper().list4UpdateByParam(queryParam); + } + + @Override + public PageInfo listPage4UpdateByParam(EmployeeDeclareListQueryParam queryParam) { + List list = getEmployeeDeclareMapper().list4UpdateByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, EmployeeDeclarePO.class); + } + +// @Override +// public List list4FailByParam(EmployeeDeclareFailListQueryParam queryParam) { +// return new LambdaQueryChainWrapper<>(employeeDeclareMapper) +// .eq(EmployeeDeclarePO::getTenantKey) +// .eq(EmployeeDeclarePO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .eq(EmployeeDeclarePO::getTaxAgentId, queryParam.getTaxAgentId()) +// .eq(EmployeeDeclarePO::getTaxCycle, queryParam.getTaxCycle().toString()) +// .eq(EmployeeDeclarePO::getDeclareStatus, DeclareStatusEnum.DECLARE_FAIL.getValue()) +// .list(); +// } + + @Override + public PageInfo listPage4FailByParam(EmployeeDeclareFailListQueryParam queryParam) { + ValidUtil.doValidator(queryParam); + List list = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .taxAgentId(queryParam.getTaxAgentId()) + .taxCycle(queryParam.getTaxCycle()) + .declareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()) + .build()); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + list, EmployeeDeclarePO.class); + return page; + } + + @Override + public List listBySalaryAcctTaxAgent(List salaryAcctTaxAgents) { + if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) { + return Collections.emptyList(); + } + Map employeeDeclareParamMap = new HashMap<>(); + for (SalaryAcctTaxAgentPO po : salaryAcctTaxAgents) { + employeeDeclareParamMap.putIfAbsent(po.getTaxAgentId() + "-" + po.getTaxCycle(), po); + } + List employeeDeclares = new ArrayList<>(); + for (Map.Entry entry : employeeDeclareParamMap.entrySet()) { + SalaryAcctTaxAgentPO salaryAcctTaxAgent = entry.getValue(); + List temp = listByTaxCycleAndTaxAgentId(salaryAcctTaxAgent.getTaxCycle(), salaryAcctTaxAgent.getTaxAgentId()); + employeeDeclares.addAll(temp); + } + return employeeDeclares; + } + + @Override + public void save(EmployeeDeclareSaveParam saveParam) { + Date now = new Date(); + EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO(); + employeeDeclare.setTaxAgentId(saveParam.getTaxAgentId()); + employeeDeclare.setTaxCycle(saveParam.getTaxCycle()); + employeeDeclare.setEmployeeName(saveParam.getEmployeeName()); + employeeDeclare.setJobNum(saveParam.getJobNum()); + employeeDeclare.setNationality(saveParam.getNationality()); + employeeDeclare.setCardType(saveParam.getCardType().getValue()); + employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase()); + employeeDeclare.setGender(saveParam.getGender().getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(saveParam.getBirthday())); + employeeDeclare.setBirthplace(saveParam.getBirthplace()); + employeeDeclare.setTaxReasons(saveParam.getTaxReasons()); + employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); + employeeDeclare.setMobile(saveParam.getMobile()); + employeeDeclare.setEmploymentType(saveParam.getEmploymentType().getValue()); + employeeDeclare.setEmploymentFirstYear(""); + employeeDeclare.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())); + employeeDeclare.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())); + employeeDeclare.setEntryDate(SalaryDateUtil.localDateToDate(saveParam.getEntryDate())); + employeeDeclare.setDepartureDate(SalaryDateUtil.localDateToDate(saveParam.getDepartureDate())); + employeeDeclare.setDisability(saveParam.getDisability().getValue()); + employeeDeclare.setDisabilityCardNo(saveParam.getDisabilityCardNo()); + employeeDeclare.setLonelyOld(saveParam.getLonelyOld().getValue()); + employeeDeclare.setMartyrDependents(saveParam.getMartyrDependents().getValue()); + employeeDeclare.setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo()); + employeeDeclare.setDeductExpenses(saveParam.getDeductExpenses().getValue()); + employeeDeclare.setSuccessfullyDeclared(0); + employeeDeclare.setNewEmployeeInfo(0); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(saveParam.getTaxAgentId()); + if (Objects.isNull(saveParam.getId())) { + employeeDeclare.setId(IdGenerator.generate()); + employeeDeclare.setEmployeeId(saveParam.getEmployeeId()); + employeeDeclare.setEmployeeType(saveParam.getEmployeeType().getValue()); + employeeDeclare.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + employeeDeclare.setCreator((long) user.getUID()); + employeeDeclare.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclare.setCreateTime(now); + employeeDeclare.setUpdateTime(now); + getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare); + // 璁板綍鏃ュ織 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏂板鎶ラ佷汉鍛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏂板鎶ラ佷汉鍛橈細") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } else { + EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId()); + if (Objects.isNull(originEmployeeDeclare)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "浜哄憳涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); + } + if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1) + && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName()) + && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "鎴愬姛鎶ラ佽繃鐨勪汉鍛橈紝濮撳悕鍜岃瘉浠跺彿鐮佸彧鑳戒慨鏀瑰叾涓锛屽悓鏃堕渶瑕佷慨鏀圭殑璇峰墠寰鍔炵◣鏈嶅姟鍘")); + } + employeeDeclare.setId(originEmployeeDeclare.getId()); + employeeDeclare.setEmployeeId(originEmployeeDeclare.getEmployeeId()); + employeeDeclare.setEmployeeType(originEmployeeDeclare.getEmployeeType()); + employeeDeclare.setTenantKey(originEmployeeDeclare.getTenantKey()); + employeeDeclare.setCreator(originEmployeeDeclare.getCreator()); + employeeDeclare.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + employeeDeclare.setCreateTime(originEmployeeDeclare.getCreateTime()); + employeeDeclare.setUpdateTime(now); + employeeDeclare.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()); + // 鍒ゆ柇鏈缂栬緫鏄惁鏈変慨鏀逛汉鍛樹俊鎭 + if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { + employeeDeclare.setNewEmployeeInfo(1); + } + getEmployeeDeclareMapper().update(employeeDeclare); + // 璁板綍鏃ュ織 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "缂栬緫鎶ラ佷汉鍛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "缂栬緫鎶ラ佷汉鍛橈細") + employeeDeclare.getEmployeeName()); + loggerContext.setOldValues(originEmployeeDeclare); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + } + + @Override + public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam) { + // 鏌ヨ鎶ラ佷汉鍛 + List employeeDeclares; + if (CollectionUtils.isNotEmpty(batchUpdateParam.getIds())) { + employeeDeclares = listByIds(batchUpdateParam.getIds()); + } else { + employeeDeclares = listByParam(batchUpdateParam); + } + // 浜哄憳涓虹┖鏃讹紝涓嶅厑璁告壒閲忕紪杈 + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182693, "褰撳墠浜哄憳鍒楄〃涓虹┖锛岃閫夋嫨瑕佹壒閲忕紪杈戠殑浜哄憳")); + } + Date now = new Date(); + // 鏍¢獙鍙傛暟 + if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentStatus")) { + EmploymentStatusEnum employmentStatusEnum = null; + for (EmploymentStatusEnum value : EmploymentStatusEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + employmentStatusEnum = value; + } + } + if (employmentStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentStatus(), employmentStatusEnum.getValue())) { + employeeDeclare.setEmploymentStatus(employmentStatusEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentType")) { + EmploymentTypeEnum employmentTypeEnum = null; + for (EmploymentTypeEnum value : EmploymentTypeEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + employmentTypeEnum = value; + } + } + if (employmentTypeEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentType(), employmentTypeEnum.getValue())) { + employeeDeclare.setEmploymentType(employmentTypeEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "employmentDate")) { + if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + Date employmentDate = SalaryDateUtil.localDateToDate(LocalDate.parse(batchUpdateParam.getItemValue())); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getEmploymentDate(), employmentDate)) { + employeeDeclare.setEmploymentDate(employmentDate); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "dismissDate")) { + if (!SalaryDateUtil.checkDay(batchUpdateParam.getItemValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + Date dismissDate = SalaryDateUtil.localDateToDate(LocalDate.parse(batchUpdateParam.getItemValue())); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getDismissDate(), dismissDate)) { + employeeDeclare.setDismissDate(dismissDate); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } else if (Objects.equals(batchUpdateParam.getBatchUpdateItem(), "deductExpenses")) { + SalaryOnOffEnum salaryOnOffEnum = null; + for (SalaryOnOffEnum value : SalaryOnOffEnum.values()) { + if (Objects.equals(value.name(), batchUpdateParam.getItemValue())) { + salaryOnOffEnum = value; + } + } + if (salaryOnOffEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + if (!Objects.equals(employeeDeclare.getDeductExpenses(), salaryOnOffEnum.getValue())) { + employeeDeclare.setDeductExpenses(salaryOnOffEnum.getValue()); + employeeDeclare.setNewEmployeeInfo(1); + employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + employeeDeclare.setDeclareErrorMsg(""); + employeeDeclare.setUpdateTime(now); + } + } + } + employeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); +// updateBatchById(employeeDeclares); + } + + @Override + public void deleteByIds(Collection ids) { + List employeeDeclares = listByIds(ids); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156466, "鍙傛暟閿欒锛屼汉鍛樹笉瀛樺湪鎴栧凡琚垹闄")); + } + boolean declareSuccess = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getSuccessfullyDeclared(), 1)); + if (declareSuccess) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156467, "鎶ラ佹垚鍔熻繃鐨勪汉鍛樹笉鍏佽鍒犻櫎")); + } + getEmployeeDeclareMapper().deleteByIds(ids, new Date()); + // 璁板綍鏃ュ織 + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + TaxAgentPO taxAgent = taxAgentMap.get(employeeDeclare.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); + loggerContext.setTargetName((taxAgent == null ? "" : taxAgent.getName()) + "-" + employeeDeclare.getEmployeeName()); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎鎶ラ佷汉鍛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎鎶ラ佷汉鍛橈細") + employeeDeclare.getEmployeeName()); + loggerContext.setNewValues(employeeDeclare); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + } + + @Override + public List convert(List employeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + + // 鏌ヨ涓◣鎵g即涔夊姟浜 + Set taxAgentIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + List dtoList = EmployeeDeclareList.convert(employeeDeclares, taxAgents); + // 浜哄憳id闆嗗悎 + List employeeIds = employeeDeclares.stream().map(EmployeeDeclarePO::getEmployeeId).distinct().collect(Collectors.toList()); + // 鑾峰彇浜哄憳閮ㄩ棬銆佸垎閮ㄨ缁嗕俊鎭 + Map employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp()); + // 琛ュ厖鍒嗛儴锛岄儴闂 + dtoList.forEach(po -> { + boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0; + DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp); + if (ObjectUtils.isNotEmpty(employee)) { + po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse("")); + po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse("")); + } + }); + return dtoList; + } + + @Override + public List convert2FailListDTO(List employeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + // 鏌ヨ浜哄憳淇℃伅 + List employeeIds = SalaryEntityUtil.properties(employeeDeclares, EmployeeDeclarePO::getEmployeeId, Collectors.toList()); + Map employeeInfoMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds), emp -> emp.getEmployeeId() + "-" + emp.isExtEmp()); + return EmployeeDeclareList.convert2FailListDTO(employeeDeclares, employeeInfoMap); + } + + @Override + public void refresh(EmployeeDeclareRefreshParam refreshParam, Long employeeId) { + // 鏌ヨ鏈湀宸叉湁鐨勯渶瑕佹姤閫佺殑浜哄憳 + List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); + // 鏌ヨ涓婃湀宸叉湁鎶ラ佺殑浜哄憳 + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(SalaryDateUtil.plusMonths(refreshParam.getTaxCycle(), -1), refreshParam.getTaxAgentId()) + //鍙渶瑕佹甯哥殑 + .stream() + .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .collect(Collectors.toList()); + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(refreshParam.getTaxAgentId()); + // 鏍规嵁绋庢鎵灞炴湡璁$畻鍑鸿柂璧勫懆鏈 + Date salaryCycle; + Date taxCycle = refreshParam.getTaxCycle(); + // TODO锛氬厛涓存椂鍐欐鏈湀锛侊紒锛侊紒闇鍏堝畬鎴愪釜绋庢墸缂翠箟鍔′汉鐨勬敼閫 +// SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryEnumUtil.enumMatchByValue(taxAgent.getTaxCycleType(), SalaryCycleTypeEnum.class); + SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryCycleTypeEnum.THIS_MONTH; + if (salaryCycleTypeEnum == SalaryCycleTypeEnum.BEFORE_LAST_MONTH) { + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, 2); + } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.LAST_MONTH) { + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, 1); + } else if (salaryCycleTypeEnum == SalaryCycleTypeEnum.NEXT_MONTH) { + salaryCycle = SalaryDateUtil.plusMonths(taxCycle, -1); + } else { + salaryCycle = taxCycle; + } + // 鏌ヨ钖祫妗f鐨勫彂钖汉鍛 + LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(salaryCycle).endDate(SalaryDateUtil.localDateToDate(SalaryDateUtil.localDate2YearMonth(salaryCycle).atEndOfMonth())).build(); + List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salaryCycleRange, Collections.emptyList(), Collections.singletonList(refreshParam.getTaxAgentId())); + List employeeIds = salaryArchiveDataDTOS.stream().map(SalaryArchiveDataDTO::getEmployeeId).collect(Collectors.toList()); + List salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); + + // 鏈湀澧炲姞浜嗗摢浜涗汉鍛 + Set orgEmployeeIds = ((List) CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) + .stream() + .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(EmployeeDeclarePO::getEmployeeId) + .collect(Collectors.toSet()); + Set newOrgEmployeeIds = salaryArchiveDataDTOS.stream() + .map(SalaryArchiveDataDTO::getEmployeeId) + .filter(e -> !orgEmployeeIds.contains(e)) + .collect(Collectors.toSet()); + // 鏌ヨ鏂板鍔犵殑浜哄憳淇℃伅 + List employeeInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(newOrgEmployeeIds)); +// List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds); +// List newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); + // 鏌ヨ鏈湀澧炲姞浜嗗摢浜涢潪绯荤粺浜哄憳 +// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId()); +// Set extEmployeeIds = employeeDeclares.stream() +// .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) +// .map(EmployeeDeclarePO::getEmployeeId) +// .collect(Collectors.toSet()); +// List newExtEmployees = extEmployees.stream() +// .filter(e -> !extEmployeeIds.contains(e.getId())) +// .collect(Collectors.toList()); + + // 鏈鏂板鐨勯渶瑕佹姤閫佺殑浜哄憳 + EmployeeDeclareRefreshDTO dto = new EmployeeDeclareRefreshDTO() + .setTaxAgentId(taxAgent.getId()) + .setTaxCycle(taxCycle) + .setEmployeeDeclares(employeeDeclares) + .setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares) + .setSalaryArchives(salaryArchivePOS) + .setHrmEmployeeComInfos(employeeInfos); + EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); + // 淇濆瓨鏂板鐨勪汉鍛 + if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { + result.getNewEmployeeDeclares().forEach(getEmployeeDeclareMapper()::insertIgnoreNull); + } + // 鏇存柊宸叉湁浜哄憳 + if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { + result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull); + } + + // 璁板綍鏃ュ織 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(refreshParam.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜:銆寋0}銆嶇◣娆炬墍灞炴湡:銆寋1}銆").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(refreshParam.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍒锋柊鏁版嵁")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍒锋柊鏁版嵁")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + + @Override + public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) { + // 鏌ヨ鏈湀宸叉湁鐨勯渶瑕佹姤閫佺殑浜哄憳 + List employeeDeclares = listByTaxCycleAndTaxAgentId(employeeDeclareParam.getTaxCycle(), employeeDeclareParam.getTaxAgentId()); + // 鏈湀鏄惁鏈変慨鏀硅繃浜哄憳淇℃伅 + boolean updateEmployeeInfo = employeeDeclares.stream().anyMatch(e -> Objects.equals(e.getNewEmployeeInfo(), 1) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue())); + // 鏈湀鎶ラ佸け璐ョ殑浜烘暟 + Integer declareFailSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())).count(); + // 鏈湀鏈姤閫佺殑浜烘暟 + Integer notDeclareSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.NOT_DECLARE.getValue())).count(); + // 鏈湀鎶ラ佹垚鍔熺殑浜烘暟 + Integer declareSuccessSize = (int) employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).count(); + return new EmployeeDeclareInfoDTO() + .setShowUpdate(updateEmployeeInfo) + .setDeclareFailSize(declareFailSize) + .setNotDeclareSize(notDeclareSize) + .setDeclareSuccessSize(declareSuccessSize); + } + + @Override + public void declare(EmployeeDeclareParam param) { + // 鑾峰彇api閰嶇疆淇℃伅 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId()); + // 鏌ヨ涓◣鎵g即涔夊姟浜哄叧鑱旂殑浼佷笟淇℃伅 + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId()); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "涓◣鎵g即涔夊姟浜虹殑鎶ョ◣淇℃伅楠岃瘉鏈氳繃锛岃鍏堢淮鎶ゅソ涓◣鎵g即涔夊姟浜虹殑鎶ョ◣淇℃伅")); + } + // 鏌ヨ闇瑕佹姤閫佺殑浜哄憳 + List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (CollectionUtils.isEmpty(employeeDeclares)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156470, "褰撳墠鎶ラ佷汉鍛樺垪琛ㄦ殏鏃犳暟鎹")); + } + EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156471, "鎶ラ佷腑锛岀◢鍚庤鐐瑰嚮銆愯幏鍙栨姤閫佺粨鏋溿戞洿鏂版姤閫佺姸鎬")); + } + // 浜哄憳鍒楄〃 + List> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + // 浼佷笟淇℃伅 + Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()).replace("-", "")); + // 浜哄憳鍒楄〃 + requestParam.put("rylb", employeeInfoMapList); + + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO; + 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("鍙戣捣浜哄憳鎶ラ:{} 鍙嶉{}", reqJson, res); + DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class); + if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) { + log.error("鏈嶅姟寮傚父:" + res); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg()); + } + // 鍒犻櫎鍘熸潵鐨勪汉鍛樻姤閫佽褰 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 淇濆瓨鏂扮殑浜哄憳鎶ラ佽褰 + Date now = new Date(); + AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody(); + employeeDeclareRecord = new EmployeeDeclareRecordPO() + .setId(IdGenerator.generate()) + .setTaxAgentId(param.getTaxAgentId()) + .setTaxCycle(param.getTaxCycle()) + .setRequestId(asyncRequestIdDTO.getRequestId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) user.getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + getEmployeeDeclareRecordService(user).save(employeeDeclareRecord); + // 璁板綍鏃ュ織 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜:銆寋0}銆嶇◣娆炬墍灞炴湡:銆寋1}銆").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍏ㄩ儴鎶ラ")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍏ㄩ儴鎶ラ")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + } + + @Override + public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate) { + // 鑾峰彇api閰嶇疆淇℃伅 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId()); + // 鏌ヨ浜哄憳鎶ラ佽褰 + EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + if (Objects.isNull(employeeDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "璇峰厛鎶ラ佸悗鍐嶈幏鍙栨姤閫佺粨鏋")); + } + if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "璇峰厛鎶ラ佸悗鍐嶈幏鍙栨姤閫佺粨鏋")); + } + + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK; + ImmutableMap requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("浜哄憳鎶ラ佸弽棣:{}", res); + DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); + if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { + log.error("鏈嶅姟寮傚父:" + res); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); + } + DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); + Map> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "") + + "-" + e.getOrDefault("zzlx", "") + + "-" + e.getOrDefault("zzhm", "")); + // 娴侀噺浣跨敤鎯呭喌 + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(param.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION, (long) user.getUID()); + // 鏌ヨ鐢虫姤鐨勪汉鍛樺垪琛 + Date now = new Date(); + List needUpdateEmployeeDeclares = Lists.newArrayList(); + List employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + String key = employeeDeclare.getEmployeeName() + + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel()) + + "-" + employeeDeclare.getCardNum(); + Map employeeInfoMap = employeeFeedbackMap.get(key); + if (MapUtil.isEmpty(employeeInfoMap)) { + continue; + } + // 鎶ラ佺姸鎬 + employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue())); + // 澶辫触鍘熷洜 + employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy"))); + // 楠岃瘉鐘舵併侀摱琛屽崱楠岃瘉鐘舵 + // 鏄惁鎶ラ佹垚鍔熶簡 + if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) { + employeeDeclare.setSuccessfullyDeclared(1); + } + employeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(employeeDeclare); + + // 娴侀噺浣跨敤璁板綍 + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId()); + flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + } + // 鏇存柊鍛樺伐鐨勬姤閫佺姸鎬 + if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + needUpdateEmployeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); + } + // 鍒犻櫎鍘熸潵鐨勪汉鍛樻姤閫佽褰 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 璁板綍鏃ュ織 + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(param.getTaxAgentId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜:銆寋0}銆嶇◣娆炬墍灞炴湡:銆寋1}銆").replace("{0}", taxAgent.getName()).replace("{1}", SalaryDateUtil.getFormatYearMonth(param.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鑾峰彇缁撴灉鍙嶉")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鑾峰彇缁撴灉鍙嶉")); + SalaryElogConfig.employeeDeclareLoggerTemplate.write(loggerContext); + // 鏇存柊娴侀噺缁熻 + getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); + // 鎶ラ佸け璐ョ殑 + int declareFailSize = (int) needUpdateEmployeeDeclares.stream() + .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue())) + .count(); + employeeDeclareRate.setFinish(true); + if (declareFailSize > 0) { + employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(156472, "鎶ラ佹垚鍔焮0}鏉★紝鎶ラ佸け璐1}鏉") + .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize)) + .replace("{1}", Util.null2String(declareFailSize))); + } else { + employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(187388, "鎶ラ佹垚鍔焮0}鏉").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size()))); + } + } + + + @Override + public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) { + List employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map empPayStartDateMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getCompanystartdate); + + List employeeDeclarePOS = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + employeeDeclarePOS.forEach(po -> { + String payStartDate = empPayStartDateMap.getOrDefault(po.getEmployeeId(), ""); + if (SalaryDateUtil.checkDay(payStartDate)) { + po.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(payStartDate)); + po.setNewEmployeeInfo(1); + po.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + getEmployeeDeclareMapper().updateIgnoreNull(po); + } + }); + + return "鎵ц瀹屾瘯"; + } + + @Override + public void batchInsert(List insertList) { + if (CollectionUtils.isEmpty(insertList)) { + return; + } + List> partition = Lists.partition(insertList, 50); + partition.forEach(getEmployeeDeclareMapper()::batchInsert); + } +} diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index f2fbd1d89..9d6b27f36 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -73,6 +73,11 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { return MapperProxyFactory.getProxy(EmployMapper.class); } + @Override + public List listAll() { + return getExternalEmployeeMapper().listAll(); + } + @Override public List list(ExtEmpQueryParam param) { return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); @@ -185,6 +190,18 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } } + @Override + public List getExtEmpByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List extEmpPOS = new ArrayList<>(); + List> partition = Lists.partition(ids, 500); + partition.forEach(list -> extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build()))); + return extEmpPOS; + + } + @Override public DataCollectionEmployee getEmployeeById(Long id) { ExtEmpPO po = getExternalEmployeeMapper().getById(id); @@ -631,6 +648,14 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { return resultPo; } + @Override + public List listByKeyword(String keyword) { + if (StringUtils.isBlank(keyword)) { + return Collections.emptyList(); + } + return getExternalEmployeeMapper().listByKeyword(keyword); + } + @Override public List listBySubCompanyOrDepartment(List subCompanyIds, List departmentIds) { return getExternalEmployeeMapper().listSomeDataCollectionEmployee(ExtEmpPO.builder().subcompanyIds(subCompanyIds).departmentIds(departmentIds).build()); diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index a0fd93816..b192459e7 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.api.formmode.mybatis.util.SqlProxyHandle; @@ -12,19 +13,22 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; 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.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; -import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.entity.datacollection.po.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.TaxFreeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.OtherDeductionMapper; +import com.engine.salary.mapper.datacollection.*; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.OtherDeductionService; @@ -39,6 +43,7 @@ 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.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelParseHelper; @@ -46,6 +51,7 @@ import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; 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.Maps; import org.apache.commons.collections4.CollectionUtils; @@ -54,6 +60,8 @@ import org.apache.commons.lang3.Validate; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.BeanUtils; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; @@ -104,6 +112,37 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return ServiceUtil.getService(AuthServiceImpl.class, user); } + + private FreeIncomeMapper getFreeIncomeMapper() { + return MapperProxyFactory.getProxy(FreeIncomeMapper.class); + } + + private HealthInsuranceMapper getHealthInsuranceMapper() { + return MapperProxyFactory.getProxy(HealthInsuranceMapper.class); + } + + private EndowmentInsuranceMapper getEndowmentInsuranceMapper() { + return MapperProxyFactory.getProxy(EndowmentInsuranceMapper.class); + } + + private GrantDonationMapper getGrantDonationMapper() { + return MapperProxyFactory.getProxy(GrantDonationMapper.class); + } + + private DerateDeductionMapper getDerateDeductionMapper() { + return MapperProxyFactory.getProxy(DerateDeductionMapper.class); + } + + + private OtherDerateDeductionMapper getOtherDerateDeductionMapper() { + return MapperProxyFactory.getProxy(OtherDerateDeductionMapper.class); + } + + private PersonalPensionMapper getPersonalPensionMapper() { + return MapperProxyFactory.getProxy(PersonalPensionMapper.class); + } + + @Override public OtherDeductionPO getById(Long id) { return getOtherDeductionMapper().getById(id); @@ -189,13 +228,11 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Validate.notBlank(imageId, "imageId涓虹┖"); //绋庢鎵灞炴湡 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //涓◣鎵g即涔夊姟浜 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx"); + List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 14, "OtherDeductionTemplate.xlsx"); int total = OtherDeductions.size(); int index = 0; @@ -298,15 +335,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } else { Optional optionalTemp = taxAgentList.stream().filter(m -> m.getName().equals(taxAgentName)).findFirst(); if (optionalTemp.isPresent()) { - if (StringUtils.isNotEmpty(taxAgentId) && !optionalTemp.get().getId().equals(Long.valueOf(taxAgentId))) { - //涓◣鎵g即涔夊姟浜轰笌瀵煎叆鏃堕夋嫨鐨勪笉涓鑷 - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笌瀵煎叆鏃堕夋嫨鐨勪笉涓鑷"); - errorData.add(errorMessageMap); - errorSum += 1; - } else { - po.setTaxAgentId(optionalTemp.get().getId()); - } + po.setTaxAgentId(optionalTemp.get().getId()); } else { //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 Map errorMessageMap = Maps.newHashMap(); @@ -316,6 +345,12 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + //鍏嶇◣鏀跺叆 + String freeIncome = dto.getFreeIncome(); + po.setFreeIncome(freeIncome); + //鍑忓厤绋庨 + String derateDeduction = dto.getDerateDeduction(); + po.setDerateDeduction(derateDeduction); //鍟嗕笟鍋ュ悍淇濋櫓 String businessHealthyInsurance = dto.getBusinessHealthyInsurance(); po.setBusinessHealthyInsurance(businessHealthyInsurance); @@ -370,6 +405,1236 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return apidatas; } + @Override + public Map importDetailData(OtherDeductionImportParam importParam) { + + long currentEmployeeId = user.getUID(); + Map apidatas = new HashMap(); + OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz(); + + //鏌ヨ瀵逛簬浜哄憳淇℃伅瀵煎叆绛涢夌殑鍏ㄥ眬閰嶇疆 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + //妫楠屽弬鏁 + checkImportParam(importParam); + + //excel鏂囦欢id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId涓虹┖"); + //绋庢鎵灞炴湡 + String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); + + //浜哄憳淇℃伅 + List employees = getSalaryEmployeeService(user).listEmployee(); + // 鑾峰彇鎵鏈変釜绋庢墸缂翠箟鍔′汉 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); + //绋庢鎵灞炴湡 + Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01"); + // 鑾峰彇宸茬粡鏍哥畻鐨勬暟鎹 + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(declareMonthStr); + // 鏌ヨ宸叉湁鏁版嵁 + List list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build()); + + InputStream fileInputStream = null; + + List eligibleData = new ArrayList<>(); + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + //鍏嶇◣鏀跺叆 + List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 10, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < freeIncomeList.size(); i++) { + FreeIncomeListDTO dto = freeIncomeList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO po = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + FreeIncomePO freeIncomePO = FreeIncomePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + po.setEmployeeId(employeeId); + freeIncomePO.setEmployeeId(employeeId); + freeIncomePO.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + freeIncomePO.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + freeIncomePO.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + //鍏嶇◣鏀跺叆 + String freeIncome = dto.getFreeItem(); + String freeProperty = dto.getFreeProperty(); + String freeAmount = dto.getFreeAmount(); + freeIncomePO.setFreeItem(freeIncome); + freeIncomePO.setFreeProperty(freeProperty); + freeIncomePO.setFreeAmount(freeAmount); + + + if (errorSum == 0) { + successCount += 1; + String key = po.getTaxAgentId() + "-" + po.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getFreeIncomeList().add(freeIncomePO); + } else { + po.getFreeIncomeList().add(freeIncomePO); + eligibleData.add(po); + } + + } else { + errorCount += 1; + // 娣诲姞閿欒鏁版嵁 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("freeIncome", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 12, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + HealthInsuranceListDTO dto = dtoList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + HealthInsurancePO po = HealthInsurancePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setIdentificationNumber(dto.getIdentificationNumber()); + po.setEffectiveDate(dto.getEffectiveDate()); + po.setYearPremium(dto.getYearPremium()); + po.setMonthPremium(dto.getMonthPremium()); + po.setCurrentDeduction(dto.getCurrentDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getHealthInsuranceList().add(po); + } else { + mainPo.getHealthInsuranceList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 13, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < derateDeductionList.size(); i++) { + EndowmentInsuranceListDTO dto = derateDeductionList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + EndowmentInsurancePO po = EndowmentInsurancePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setAccountNumber(dto.getAccountNumber()); + po.setCheckCode(dto.getCheckCode()); + po.setYearPremium(dto.getYearPremium()); + po.setMonthPremium(dto.getMonthPremium()); + po.setCurrentDeduction(dto.getCurrentDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getEndowmentInsuranceList().add(po); + } else { + mainPo.getEndowmentInsuranceList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + // 娣诲姞閿欒鏁版嵁 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 14, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + GrantDonationListDTO dto = dtoList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + GrantDonationPO po = GrantDonationPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setRecipientName(dto.getRecipientName()); + po.setTaxCode(dto.getTaxCode()); + po.setDonationNumber(dto.getDonationNumber()); + po.setDonateDate(dto.getDonateDate()); + po.setDonateAmount(dto.getDonateAmount()); + po.setDeductionProportion(dto.getDeductionProportion()); + po.setActualDeduction(dto.getActualDeduction()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getGrantDonationList().add(po); + } else { + mainPo.getGrantDonationList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 10, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < derateDeductionList.size(); i++) { + DerateDeductionListDTO dto = derateDeductionList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + DerateDeductionPO po = DerateDeductionPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setDerateAmount(dto.getDerateAmount()); + po.setDerateItem(dto.getDerateItem()); + po.setDerateProperty(dto.getDerateProperty()); + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getDerateDeductionList().add(po); + } else { + mainPo.getDerateDeductionList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + // 娣诲姞閿欒鏁版嵁 + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 9, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + OtherDerateDeductionListDTO dto = dtoList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + OtherDerateDeductionPO po = OtherDerateDeductionPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setOtherDeduction(dto.getOtherDeduction()); + po.setRemark(dto.getRemark()); + + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getOtherDerateDeductionList().add(po); + } else { + mainPo.getOtherDerateDeductionList().add(po); + eligibleData.add(mainPo); + } + + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + // 閿欒excel鍐呭 + List errorData = new ArrayList<>(); + + List dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 10, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < dtoList.size(); i++) { + PersonalPensionListDTO dto = dtoList.get(i); + + Date now = new Date(); + //寰呮彃鍏ユ暟鎹簱瀵硅薄 + OtherDeductionPO mainPo = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .derateDeductionList(new ArrayList<>()) + .endowmentInsuranceList(new ArrayList<>()) + .grantDonationList(new ArrayList<>()) + .healthInsuranceList(new ArrayList<>()) + .otherDerateDeductionList(new ArrayList<>()) + .personalPensionList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + PersonalPensionPO po = PersonalPensionPO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //寮傚父鐐规暟閲 + int errorSum = 0; + + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + //鐩稿悓鐨勫鍚 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //鍚湪鑱屽拰绂昏亴锛岄夊湪鑱屾暟鎹 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //褰撲汉鍛樹俊鎭鍏ョ瓫閫夌殑鍏ㄥ眬閰嶇疆涓"0"鏃讹紝濮撳悕鎵嶆槸蹇呭~椤 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //濮撳悕 涓嶈兘涓虹┖ + //閿欒娑堟伅瀵硅薄 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + mainPo.setEmployeeId(employeeId); + po.setEmployeeId(employeeId); + po.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //涓◣鎵g即涔夊姟浜轰笉鑳戒负绌 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + mainPo.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //涓◣鎵g即涔夊姟浜轰笉瀛樺湪 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName()); + if (incomeCategoryEnum == null) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "鎵寰楅」鐩笉瀛樺湪锛"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + po.setIncomeCategory(incomeCategoryEnum.getValue()); + } + + po.setVoucherTypeName(dto.getVoucherTypeName()); + po.setVoucherNo(dto.getVoucherNo()); + po.setPayAmount(dto.getPayAmount()); + + + if (errorSum == 0) { + successCount += 1; + String key = mainPo.getTaxAgentId() + "-" + mainPo.getEmployeeId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getPersonalPensionList().add(po); + } else { + mainPo.getPersonalPensionList().add(po); + eligibleData.add(mainPo); + } + } else { + errorCount += 1; + } + } + + HashMap dataMap = new HashMap<>(); + dataMap.put("successCount", successCount); + dataMap.put("errorCount", errorCount); + dataMap.put("errorData", errorData); + apidatas.put("derateDeduction", dataMap); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + + eligibleData.forEach(po -> { + //鍒楄〃杞负灞炴ф暟鎹 + po.handleList(); + + //娓呴櫎鏃ф暟鎹 + OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeIdAndDeclareMonth(po.getTaxAgentId(), po.getEmployeeId(), po.getDeclareMonth()); + if (otherDeductionPO != null) { + getOtherDeductionMapper().delete(otherDeductionPO); + getFreeIncomeMapper().deleteByMainId(otherDeductionPO.getId()); + getHealthInsuranceMapper().deleteByMainId(otherDeductionPO.getId()); + getEndowmentInsuranceMapper().deleteByMainId(otherDeductionPO.getId()); + getGrantDonationMapper().deleteByMainId(otherDeductionPO.getId()); + getDerateDeductionMapper().deleteByMainId(otherDeductionPO.getId()); + getOtherDerateDeductionMapper().deleteByMainId(otherDeductionPO.getId()); + getPersonalPensionMapper().deleteByMainId(otherDeductionPO.getId()); + } + + //鏇存柊涓昏〃 + getOtherDeductionMapper().insertIgnoreNull(po); + + //鏇存柊鍚勯」鏄庣粏 + po.getFreeIncomeList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getFreeIncomeMapper().insertIgnoreNull(l); + }); + po.getHealthInsuranceList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getHealthInsuranceMapper().insertIgnoreNull(l); + }); + po.getEndowmentInsuranceList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getEndowmentInsuranceMapper().insertIgnoreNull(l); + }); + po.getGrantDonationList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getGrantDonationMapper().insertIgnoreNull(l); + }); + po.getDerateDeductionList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getDerateDeductionMapper().insertIgnoreNull(l); + }); + po.getOtherDerateDeductionList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getOtherDerateDeductionMapper().insertIgnoreNull(l); + }); + po.getPersonalPensionList().forEach(l -> { + l.setId(IdGenerator.generate()); + l.setMainId(po.getId()); + getPersonalPensionMapper().insertIgnoreNull(l); + }); + + syncMain(po.getId(), Arrays.asList(TaxFreeTypeEnum.FREE_INCOME, + TaxFreeTypeEnum.HEALTH_INSURANCE, + TaxFreeTypeEnum.ENDOWMENT_INSURANCE, + TaxFreeTypeEnum.GRANT_DONATION, + TaxFreeTypeEnum.DERATE_DEDUCTION, + TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION, + TaxFreeTypeEnum.PERSONAL_PENSION)); + }); + + return apidatas; + } + /** * 澶勭悊瀵煎叆鏁版嵁 * @@ -447,8 +1712,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction String imageId = Util.null2String(importParam.getImageId()); //绋庢鎵灞炴湡 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //涓◣鎵g即涔夊姟浜 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); if (StringUtils.isBlank(imageId)) { throw new SalaryRunTimeException("鏂囦欢涓嶅瓨鍦"); @@ -492,7 +1755,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction */ private List> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) { //excel鏍囬 - List title = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鍏ヨ亴鏃ユ湡", "鍟嗕笟鍋ュ悍淇濋櫓", "绋庡欢鍏昏佷繚闄", "鍏朵粬", "鍑嗕簣鎵i櫎鐨勬崘璧犻", "涓汉鍏昏侀噾"); + List title = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鍏ヨ亴鏃ユ湡", "鍏嶇◣鏀跺叆", "鍟嗕笟鍋ュ悍淇濋櫓", "绋庡欢鍏昏佷繚闄", "鍑嗕簣鎵i櫎鐨勬崘璧犻", "鍑忓厤绋庨", "鍏朵粬", "涓汉鍏昏侀噾"); List> rowList = new ArrayList<>(); rowList.add(title); @@ -517,6 +1780,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction cellList.add(Util.null2String(dto.getJobNum())); cellList.add(Util.null2String(dto.getIdNo())); cellList.add(Util.null2String(dto.getHiredate())); + cellList.add(NumberUtil.isNumber(dto.getFreeIncome()) ? new BigDecimal(dto.getFreeIncome()) : Util.null2String(dto.getFreeIncome())); + cellList.add(NumberUtil.isNumber(dto.getDerateDeduction()) ? new BigDecimal(dto.getDerateDeduction()) : Util.null2String(dto.getDerateDeduction())); cellList.add(NumberUtil.isNumber(dto.getBusinessHealthyInsurance()) ? new BigDecimal(dto.getBusinessHealthyInsurance()) : Util.null2String(dto.getBusinessHealthyInsurance())); cellList.add(NumberUtil.isNumber(dto.getTaxDelayEndowmentInsurance()) ? new BigDecimal(dto.getTaxDelayEndowmentInsurance()) : Util.null2String(dto.getTaxDelayEndowmentInsurance())); cellList.add(NumberUtil.isNumber(dto.getOtherDeduction()) ? new BigDecimal(dto.getOtherDeduction()) : Util.null2String(dto.getOtherDeduction())); @@ -584,7 +1849,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction */ private List> getExcelRowDetailList(OtherDeductionQueryParam param) { //excel鏍囬 - List title = Arrays.asList("濮撳悕", "鐢虫姤鏈堜唤", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "鍟嗕笟鍋ュ悍淇濋櫓", "绋庡欢鍏昏佷繚闄", "鍏朵粬", "鍑嗕簣鎵i櫎鐨勬崘璧犻", "涓汉鍏昏侀噾"); + List title = Arrays.asList("濮撳悕", "鐢虫姤鏈堜唤", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鍏ヨ亴鏃ユ湡", "鍏嶇◣鏀跺叆", "鍟嗕笟鍋ュ悍淇濋櫓", "绋庡欢鍏昏佷繚闄", "鍑嗕簣鎵i櫎鐨勬崘璧犻", "鍑忓厤绋庨", "鍏朵粬", "涓汉鍏昏侀噾"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //鏌ヨ璇︾粏淇℃伅 @@ -601,6 +1866,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction cellList.add(Util.null2String(dto.getDepartmentName())); cellList.add(Util.null2String(dto.getMobile())); cellList.add(Util.null2String(dto.getJobNum())); + cellList.add(NumberUtil.isNumber(dto.getFreeIncome()) ? new BigDecimal(dto.getFreeIncome()) : Util.null2String(dto.getFreeIncome())); + cellList.add(NumberUtil.isNumber(dto.getDerateDeduction()) ? new BigDecimal(dto.getDerateDeduction()) : Util.null2String(dto.getDerateDeduction())); cellList.add(NumberUtil.isNumber(dto.getBusinessHealthyInsurance()) ? new BigDecimal(dto.getBusinessHealthyInsurance()) : Util.null2String(dto.getBusinessHealthyInsurance())); cellList.add(NumberUtil.isNumber(dto.getTaxDelayEndowmentInsurance()) ? new BigDecimal(dto.getTaxDelayEndowmentInsurance()) : Util.null2String(dto.getTaxDelayEndowmentInsurance())); cellList.add(NumberUtil.isNumber(dto.getOtherDeduction()) ? new BigDecimal(dto.getOtherDeduction()) : Util.null2String(dto.getOtherDeduction())); @@ -626,6 +1893,42 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return OtherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build()); } + @Override + public List getOtherDeductionList(YearMonth declareMonth, List employeeIds, List taxAgentIds, Integer incomeCategory) { + if (declareMonth == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "鍙傛暟鏈夎锛氱敵鎶ユ湀浠藉繀浼")); + } + if (CollUtil.isEmpty(taxAgentIds)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "鍙傛暟鏈夎锛氭墸缂翠箟鍔′汉蹇呬紶")); + } + if (incomeCategory == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "鍙傛暟鏈夎锛氭墍寰楅」鐩繀浼")); + } + + List otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build()); + if (CollUtil.isEmpty(otherDeductionPOS)) { + return new ArrayList<>(); + } + otherDeductionPOS.forEach(OtherDeductionPO::handleList); + return otherDeductionPOS; + } + + private List listDetails(OtherDeductionPO param) { + if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) { + List> partition = Lists.partition(param.getEmployeeIds(), 500); + List otherDeductionPOS = new ArrayList<>(); + partition.forEach(l -> { + param.setEmployeeIds(l); + otherDeductionPOS.addAll(getOtherDeductionMapper().listDetails(param)); + }); + return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class); + } else { + List otherDeductionPOS = getOtherDeductionMapper().listDetails(param); + return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class); + } + } + + @Override public void editData(OtherDeductionParam otherDeductionParam) { String declareMonthStr = otherDeductionParam.getDeclareMonth(); @@ -657,6 +1960,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction ArrayList updateList = new ArrayList<>(); OtherDeductionPO build = OtherDeductionPO.builder() .id(otherDeductionParam.getId()) + .freeIncome(otherDeductionParam.getFreeIncome()) + .derateDeduction(otherDeductionParam.getDerateDeduction()) .businessHealthyInsurance(otherDeductionParam.getBusinessHealthyInsurance()) .taxDelayEndowmentInsurance(otherDeductionParam.getTaxDelayEndowmentInsurance()) .otherDeduction(otherDeductionParam.getOtherDeduction()) @@ -735,7 +2040,12 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction throw new SalaryRunTimeException("涓◣鎵g即涔夊姟浜轰笉瀛樺湪鎴栦笉鍦ㄦ潈闄愯寖鍥村唴"); } } - + //鍏嶇◣鏀跺叆 + String freeIncome = otherDeductionParam.getFreeIncome(); + po.setFreeIncome(freeIncome); + //鍑忓厤绋庨 + String derateDeduction = otherDeductionParam.getDerateDeduction(); + po.setDerateDeduction(derateDeduction); //鍟嗕笟鍋ュ悍淇濋櫓 String businessHealthyInsurance = otherDeductionParam.getBusinessHealthyInsurance(); po.setBusinessHealthyInsurance(businessHealthyInsurance); @@ -1006,4 +2316,989 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return book; } + @Override + public XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param) { + + + List freeIncomeList = new ArrayList<>(); + List healthInsuranceList = new ArrayList<>(); + List endowmentInsuranceList = new ArrayList<>(); + List grantDonationList = new ArrayList<>(); + List derateDeductionList = new ArrayList<>(); + List otherDerateDeductionList = new ArrayList<>(); + List personalPensionList = new ArrayList<>(); + if (param.isHasData()) { + long employeeId = user.getUID(); + //鎺掑簭閰嶇疆 + OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); + param.setOrderRule(orderRule); + + List list = getOtherDeductionMapper().list(param); + encryptUtil.decryptList(list, OtherDeductionListDTO.class); + SalaryI18nUtil.i18nList(list); + // 寮鍚垎鏉冨苟涓斾笉鏄柂閰ā鍧楁荤鐞嗗憳 + if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) { + List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + list = list.stream().filter(f -> + // 浣滀负绠$悊鍛 + taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) + ).collect(Collectors.toList()); + } + list.forEach(dto -> { + List freeIncomeListDTOS = freeIncomePO2DTO(getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(dto.getId()).build())); + freeIncomeList.addAll(freeIncomeListDTOS); + List endowmentInsuranceListDTOS = endowmentInsurancePO2DTO(getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().mainId(dto.getId()).build())); + endowmentInsuranceList.addAll(endowmentInsuranceListDTOS); + List grantDonationListDTOS = grantDonationPO2DTO(getGrantDonationMapper().listSome(GrantDonationPO.builder().mainId(dto.getId()).build())); + grantDonationList.addAll(grantDonationListDTOS); + List healthInsuranceListDTOS = healthInsurancePO2DTO(getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().mainId(dto.getId()).build())); + healthInsuranceList.addAll(healthInsuranceListDTOS); + List otherDerateDeductionListDTOS = otherDerateDeductionPO2DTO(getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().mainId(dto.getId()).build())); + otherDerateDeductionList.addAll(otherDerateDeductionListDTOS); + List derateDeductionListDTOS = derateDeductionPO2DTO(getDerateDeductionMapper().listSome(DerateDeductionPO.builder().mainId(dto.getId()).build())); + derateDeductionList.addAll(derateDeductionListDTOS); + List personalPensionListDTOS = personalPensionPO2DTO(getPersonalPensionMapper().listSome(PersonalPensionPO.builder().mainId(dto.getId()).build())); + personalPensionList.addAll(personalPensionListDTOS); + }); + } + + Map>> map = new LinkedHashMap<>(); + + List> freeIncomeRowList = new ArrayList<>(); + List freeIncomeTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鍏嶇◣浜嬮」", "鍏嶇◣鎬ц川", "鍏嶇◣閲戦"); + freeIncomeRowList.add(freeIncomeTitle); + freeIncomeList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getFreeItem()); + row.add(dto.getFreeProperty()); + row.add(dto.getFreeAmount()); + freeIncomeRowList.add(row); + }); + map.put("鍏嶇◣鏀跺叆", freeIncomeRowList); + + List> healthInsuranceRowList = new ArrayList<>(); + List healthInsuranceTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "绋庝紭璇嗗埆鐮", "淇濆崟鐢熸晥鏃ユ湡", "骞村害淇濊垂", "鏈堝害淇濊垂", "鏈湡鎵i櫎閲戦"); + healthInsuranceRowList.add(healthInsuranceTitle); + healthInsuranceList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getIdentificationNumber()); + row.add(dto.getEffectiveDate()); + row.add(dto.getYearPremium()); + row.add(dto.getMonthPremium()); + row.add(dto.getCurrentDeduction()); + healthInsuranceRowList.add(row); + }); + map.put("鍟嗕笟鍋ュ悍淇濋櫓", healthInsuranceRowList); + + + List> endowmentInsuranceRowList = new ArrayList<>(); + List endowmentInsuranceTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鐢虫姤鎵i櫎鏈堜唤", "绋庡欢鍏昏佽处鎴风紪鍙", "鎶ョ◣鏍¢獙鐮", "骞村害淇濊垂", "鏈堝害淇濊垂", "鏈湡鎵i櫎閲戦"); + endowmentInsuranceRowList.add(endowmentInsuranceTitle); + endowmentInsuranceList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getDeductionMonth()); + row.add(dto.getAccountNumber()); + row.add(dto.getCheckCode()); + row.add(dto.getYearPremium()); + row.add(dto.getMonthPremium()); + row.add(dto.getCurrentDeduction()); + endowmentInsuranceRowList.add(row); + }); + map.put("绋庡欢鍏昏佷繚闄", endowmentInsuranceRowList); + + List> grantDonationRowList = new ArrayList<>(); + List grantDonationTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鍙楄禒鍗曚綅鍚嶇О", "鍙楄禒鍗曚綅绾崇◣浜鸿瘑鍒彿", "鍑瘉鍙", "鎹愯禒鏃ユ湡", "鎹愯禒閲戦", "鎵i櫎姣斾緥", "瀹為檯鎵i櫎閲戦"); + grantDonationRowList.add(grantDonationTitle); + grantDonationList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getRecipientName()); + row.add(dto.getTaxCode()); + row.add(dto.getDonationNumber()); + row.add(dto.getDonateDate()); + row.add(dto.getDonateAmount()); + row.add(dto.getDeductionProportion()); + row.add(dto.getActualDeduction()); + grantDonationRowList.add(row); + }); + map.put("鍑嗕簣鎵i櫎鐨勬崘璧犻", grantDonationRowList); + + List> derateDeductionRowList = new ArrayList<>(); + List derateDeductionTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鍑忓厤浜嬮」", "鍑忓厤鎬ц川", "鍑忓厤閲戦"); + derateDeductionRowList.add(derateDeductionTitle); + derateDeductionList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getDerateItem()); + row.add(dto.getDerateProperty()); + row.add(dto.getDerateAmount()); + derateDeductionRowList.add(row); + }); + map.put("鍑忓厤绋庨", derateDeductionRowList); + + List> otherDerateDeductionRowList = new ArrayList<>(); + List otherDerateDeductionTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鍏朵粬鍏嶇◣鎵i櫎閲戦", "澶囨敞"); + otherDerateDeductionRowList.add(otherDerateDeductionTitle); + otherDerateDeductionList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getOtherDeduction()); + row.add(dto.getRemark()); + otherDerateDeductionRowList.add(row); + }); + map.put("鍏朵粬", otherDerateDeductionRowList); + + List> personalPensionRowList = new ArrayList<>(); + List personalPensionTitle = Arrays.asList("濮撳悕", "涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "鎵嬫満鍙", "宸ュ彿", "璇佷欢鍙风爜", "鎵寰楅」鐩", "鍑瘉绫诲瀷", "鍑瘉缂栫爜", "缂磋垂閲戦"); + personalPensionRowList.add(personalPensionTitle); + personalPensionList.forEach(dto -> { + List row = new ArrayList<>(); + row.add(dto.getUsername()); + row.add(dto.getTaxAgentName()); + row.add(dto.getDepartmentName()); + row.add(dto.getMobile()); + row.add(dto.getJobNum()); + row.add(dto.getIdNo()); + row.add(dto.getIncomeCategoryName()); + row.add(dto.getVoucherTypeName()); + row.add(dto.getVoucherNo()); + row.add(dto.getPayAmount()); + personalPensionRowList.add(row); + }); + map.put("涓汉鍏昏侀噾", personalPensionRowList); + + XSSFWorkbook book = ExcelUtil.genWorkbookV2(map); + return book; + } + + @Override + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + + FreeIncomePO build; + if (param.getId() != null) { + build = FreeIncomePO.builder().mainId(param.getId()).build(); + } else { + build = FreeIncomePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + List pos = getFreeIncomeMapper().listSome(build); + + List listDTOS = freeIncomePO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); + } + + @NotNull + private List freeIncomePO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, FreeIncomePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + FreeIncomeListDTO dto = new FreeIncomeListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + dto.setIncomeCategoryName(IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo derateDeductionList(OtherDeductionDetailQueryParam param) { + DerateDeductionPO build; + if (param.getId() != null) { + build = DerateDeductionPO.builder().mainId(param.getId()).build(); + } else { + build = DerateDeductionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getDerateDeductionMapper().listSome(build); + List listDTOS = derateDeductionPO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, DerateDeductionListDTO.class); + } + + private List derateDeductionPO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, DerateDeductionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + DerateDeductionListDTO dto = new DerateDeductionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param) { + EndowmentInsurancePO build; + if (param.getId() != null) { + build = EndowmentInsurancePO.builder().mainId(param.getId()).build(); + } else { + build = EndowmentInsurancePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getEndowmentInsuranceMapper().listSome(build); + + List listDTOS = endowmentInsurancePO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, EndowmentInsuranceListDTO.class); + } + + @NotNull + private List endowmentInsurancePO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, EndowmentInsurancePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + EndowmentInsuranceListDTO dto = new EndowmentInsuranceListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo grantDonationList(OtherDeductionDetailQueryParam param) { + GrantDonationPO build; + if (param.getId() != null) { + build = GrantDonationPO.builder().mainId(param.getId()).build(); + } else { + build = GrantDonationPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getGrantDonationMapper().listSome(build); + List listDTOS = grantDonationPO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, GrantDonationListDTO.class); + } + + @NotNull + private List grantDonationPO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, GrantDonationPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + GrantDonationListDTO dto = new GrantDonationListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param) { + HealthInsurancePO build; + if (param.getId() != null) { + build = HealthInsurancePO.builder().mainId(param.getId()).build(); + } else { + build = HealthInsurancePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getHealthInsuranceMapper().listSome(build); + List listDTOS = healthInsurancePO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, HealthInsuranceListDTO.class); + } + + @NotNull + private List healthInsurancePO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, HealthInsurancePO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + HealthInsuranceListDTO dto = new HealthInsuranceListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param) { + OtherDerateDeductionPO build; + if (param.getId() != null) { + build = OtherDerateDeductionPO.builder().mainId(param.getId()).build(); + } else { + build = OtherDerateDeductionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getOtherDerateDeductionMapper().listSome(build); + List listDTOS = otherDerateDeductionPO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, OtherDerateDeductionListDTO.class); + } + + @NotNull + private List otherDerateDeductionPO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, OtherDerateDeductionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + OtherDerateDeductionListDTO dto = new OtherDerateDeductionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public PageInfo personalPensionList(OtherDeductionDetailQueryParam param) { + PersonalPensionPO build; + if (param.getId() != null) { + build = PersonalPensionPO.builder().mainId(param.getId()).build(); + } else { + build = PersonalPensionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getPersonalPensionMapper().listSome(build); + List listDTOS = personalPensionPO2DTO(pos); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PersonalPensionListDTO.class); + } + + @NotNull + private List personalPensionPO2DTO(List pos) { + List empIds = SalaryEntityUtil.properties(pos, PersonalPensionPO::getEmployeeId, Collectors.toList()); + List employeeList = getSalaryEmployeeService(user).listByIds(empIds); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + List taxAgentPOS = getTaxAgentService(user).listAll(); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); + List listDTOS = pos.stream().map(po -> { + PersonalPensionListDTO dto = new PersonalPensionListDTO(); + BeanUtils.copyProperties(po, dto); + DataCollectionEmployee employee = employeeMap.getOrDefault(po.getEmployeeId(), new DataCollectionEmployee()); + TaxAgentPO taxAgent = taxAgentMap.getOrDefault(po.getTaxAgentId(), new TaxAgentPO()); + dto.setUsername(employee.getUsername()); + dto.setTaxAgentName(taxAgent.getName()); + dto.setDepartmentName(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + dto.setIdNo(employee.getIdNo()); + return dto; + }).collect(Collectors.toList()); + return listDTOS; + } + + @Override + public List queryFreeIncomes(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getFreeIncomeMapper().listSome(FreeIncomePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryDerateDeductions(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getDerateDeductionMapper().listSome(DerateDeductionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryEndowmentInsurances(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryGrantDonations(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getGrantDonationMapper().listSome(GrantDonationPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryHealthInsurances(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryOtherDerateDeductions(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + @Override + public List queryPersonalPensions(OtherDeductionFreeListQueryParam param) { + ValidUtil.doValidator(param); + return getPersonalPensionMapper().listSome(PersonalPensionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build()); + } + + + @Override + public void saveFreeIncome(FreeIncomeSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + FreeIncomePO po = FreeIncomePO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .freeItem(param.getFreeItem()) + .freeProperty(param.getFreeProperty()) + .freeAmount(param.getFreeAmount()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getFreeIncomeMapper().insertIgnoreNull(po); + } else { + FreeIncomePO po = getFreeIncomeMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setFreeItem(param.getFreeItem()); + po.setFreeProperty(param.getFreeProperty()); + po.setFreeAmount(param.getFreeAmount()); + + getFreeIncomeMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.FREE_INCOME)); + } + + @Override + public void saveEndowmentInsurance(EndowmentInsuranceSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + EndowmentInsurancePO po = EndowmentInsurancePO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .deductionMonth(param.getDeductionMonth()) + .accountNumber(param.getAccountNumber()) + .checkCode(param.getCheckCode()) + .yearPremium(param.getYearPremium()) + .monthPremium(param.getMonthPremium()) + .currentDeduction(param.getCurrentDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getEndowmentInsuranceMapper().insertIgnoreNull(po); + } else { + EndowmentInsurancePO po = getEndowmentInsuranceMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setDeductionMonth(param.getDeductionMonth()); + po.setAccountNumber(param.getAccountNumber()); + po.setCheckCode(param.getCheckCode()); + po.setYearPremium(param.getYearPremium()); + po.setMonthPremium(param.getMonthPremium()); + po.setCurrentDeduction(param.getCurrentDeduction()); + + getEndowmentInsuranceMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.ENDOWMENT_INSURANCE)); + } + + @Override + public void saveGrantDonation(GrantDonationSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + GrantDonationPO po = GrantDonationPO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .recipientName(param.getRecipientName()) + .taxCode(param.getTaxCode()) + .donationNumber(param.getDonationNumber()) + .donateDate(param.getDonateDate()) + .donateAmount(param.getDonateAmount()) + .deductionProportion(param.getDeductionProportion()) + .actualDeduction(param.getActualDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getGrantDonationMapper().insertIgnoreNull(po); + } else { + GrantDonationPO po = getGrantDonationMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setRecipientName(param.getRecipientName()); + po.setTaxCode(param.getTaxCode()); + po.setDonationNumber(param.getDonationNumber()); + po.setDonateDate(param.getDonateDate()); + po.setDonateAmount(param.getDonateAmount()); + po.setDeductionProportion(param.getDeductionProportion()); + po.setActualDeduction(param.getActualDeduction()); + + getGrantDonationMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.GRANT_DONATION)); + } + + @Override + public void saveHealthInsurance(HealthInsuranceSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + HealthInsurancePO po = HealthInsurancePO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .identificationNumber(param.getIdentificationNumber()) + .effectiveDate(param.getEffectiveDate()) + .yearPremium(param.getYearPremium()) + .monthPremium(param.getMonthPremium()) + .currentDeduction(param.getCurrentDeduction()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getHealthInsuranceMapper().insertIgnoreNull(po); + } else { + HealthInsurancePO po = getHealthInsuranceMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setIdentificationNumber(param.getIdentificationNumber()); + po.setEffectiveDate(param.getEffectiveDate()); + po.setYearPremium(param.getYearPremium()); + po.setMonthPremium(param.getMonthPremium()); + po.setCurrentDeduction(param.getCurrentDeduction()); + + getHealthInsuranceMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.HEALTH_INSURANCE)); + } + + @Override + public void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + OtherDerateDeductionPO po = OtherDerateDeductionPO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .otherDeduction(param.getOtherDeduction()) + .remark(param.getRemark()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getOtherDerateDeductionMapper().insertIgnoreNull(po); + } else { + OtherDerateDeductionPO po = getOtherDerateDeductionMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setOtherDeduction(param.getOtherDeduction()); + po.setRemark(param.getRemark()); + + getOtherDerateDeductionMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION)); + } + + @Override + public void saveDerateDeduction(DerateDeductionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + DerateDeductionPO po = DerateDeductionPO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .derateAmount(param.getDerateAmount()) + .derateItem(param.getDerateItem()) + .derateProperty(param.getDerateProperty()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getDerateDeductionMapper().insertIgnoreNull(po); + } else { + DerateDeductionPO po = getDerateDeductionMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setDerateAmount(param.getDerateAmount()); + po.setDerateItem(param.getDerateItem()); + po.setDerateProperty(param.getDerateProperty()); + + getDerateDeductionMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.DERATE_DEDUCTION)); + } + + @Override + public void savePersonalPension(PersonalPensionSaveParam param) { + Date now = new Date(); + + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + Long id = param.getId(); + if (id == null) { + PersonalPensionPO po = PersonalPensionPO.builder() + .id(IdGenerator.generate()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) + .incomeCategory(param.getIncomeCategory()) + .voucherTypeName(param.getVoucherTypeName()) + .voucherNo(param.getVoucherNo()) + .payAmount(param.getPayAmount()) + .fileStatus(1) + .employeeType(0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + getPersonalPensionMapper().insertIgnoreNull(po); + } else { + PersonalPensionPO po = getPersonalPensionMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("璁板綍涓嶅瓨鍦紒"); + } + + po.setUpdateTime(now); + po.setIncomeCategory(param.getIncomeCategory()); + po.setVoucherTypeName(param.getVoucherTypeName()); + po.setVoucherNo(param.getVoucherNo()); + po.setPayAmount(param.getPayAmount()); + + getPersonalPensionMapper().updateIgnoreNull(po); + } + + syncMain(mainId, Collections.singletonList(TaxFreeTypeEnum.PERSONAL_PENSION)); + } + + @Override + public void deleteFreeIncome(OtherDeductionDetailDeleteParam param) { + getFreeIncomeMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.FREE_INCOME)); + } + + @Override + public void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param) { + getEndowmentInsuranceMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.ENDOWMENT_INSURANCE)); + } + + @Override + public void deleteGrantDonation(OtherDeductionDetailDeleteParam param) { + getGrantDonationMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.GRANT_DONATION)); + } + + @Override + public void deleteHealthInsurance(OtherDeductionDetailDeleteParam param) { + getHealthInsuranceMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.HEALTH_INSURANCE)); + } + + @Override + public void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDerateDeductionMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION)); + } + + @Override + public void deleteDerateDeduction(OtherDeductionDetailDeleteParam param) { + getDerateDeductionMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.DERATE_DEDUCTION)); + } + + @Override + public void deletePersonalPension(OtherDeductionDetailDeleteParam param) { + getPersonalPensionMapper().deleteByIds(param.getIds()); + syncMain(param.getMainId(), Collections.singletonList(TaxFreeTypeEnum.PERSONAL_PENSION)); + } + + @Override + public void syncMain(Long mainId, List taxFreeTypes) { + OtherDeductionPO deductionPO = getById(mainId); + if (deductionPO == null) { + throw new SalaryRunTimeException("涓昏〃涓嶅瓨鍦紒"); + } + + if (taxFreeTypes.contains(TaxFreeTypeEnum.FREE_INCOME)) { + syncFreeIncome(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.HEALTH_INSURANCE)) { + syncHealthInsurance(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.ENDOWMENT_INSURANCE)) { + syncEndowmentInsurance(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.GRANT_DONATION)) { + syncGrantDonation(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.DERATE_DEDUCTION)) { + syncDerateDeduction(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION)) { + syncOtherDerateDeduction(deductionPO); + } + if (taxFreeTypes.contains(TaxFreeTypeEnum.PERSONAL_PENSION)) { + syncPersonalPension(deductionPO); + } + } + + @Override + public void syncFreeIncome(OtherDeductionPO mainPO) { + List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(mainPO.getId()).build()); + String sum = freeIncomePOS.stream().filter(po -> NumberUtil.isNumber(po.getFreeAmount())).map(po -> new BigDecimal(po.getFreeAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setFreeIncome(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncEndowmentInsurance(OtherDeductionPO mainPO) { + List endowmentInsurancePOS = getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().mainId(mainPO.getId()).build()); + String sum = endowmentInsurancePOS.stream().filter(po -> NumberUtil.isNumber(po.getCurrentDeduction())).map(po -> new BigDecimal(po.getCurrentDeduction())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setTaxDelayEndowmentInsurance(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncGrantDonation(OtherDeductionPO mainPO) { + List grantDonationPOS = getGrantDonationMapper().listSome(GrantDonationPO.builder().mainId(mainPO.getId()).build()); + String sum = grantDonationPOS.stream().filter(po -> NumberUtil.isNumber(po.getActualDeduction())).map(po -> new BigDecimal(po.getActualDeduction())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setDeductionAllowedDonation(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncHealthInsurance(OtherDeductionPO mainPO) { + List healthInsurancePOS = getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().mainId(mainPO.getId()).build()); + String sum = healthInsurancePOS.stream().filter(po -> NumberUtil.isNumber(po.getCurrentDeduction())).map(po -> new BigDecimal(po.getCurrentDeduction())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setBusinessHealthyInsurance(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncOtherDerateDeduction(OtherDeductionPO mainPO) { + List otherDerateDeductionPOS = getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().mainId(mainPO.getId()).build()); + String sum = otherDerateDeductionPOS.stream().filter(po -> NumberUtil.isNumber(po.getOtherDeduction())).map(po -> new BigDecimal(po.getOtherDeduction())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setOtherDeduction(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncDerateDeduction(OtherDeductionPO mainPO) { + List derateDeductionPOS = getDerateDeductionMapper().listSome(DerateDeductionPO.builder().mainId(mainPO.getId()).build()); + String sum = derateDeductionPOS.stream().filter(po -> NumberUtil.isNumber(po.getDerateAmount())).map(po -> new BigDecimal(po.getDerateAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setDerateDeduction(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + + @Override + public void syncPersonalPension(OtherDeductionPO mainPO) { + List personalPensionPOS = getPersonalPensionMapper().listSome(PersonalPensionPO.builder().mainId(mainPO.getId()).build()); + String sum = personalPensionPOS.stream().filter(po -> NumberUtil.isNumber(po.getPayAmount())).map(po -> new BigDecimal(po.getPayAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString(); + mainPO.setPrivatePension(sum); + getOtherDeductionMapper().updateData(Collections.singletonList(mainPO)); + } + } diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index ba0f7df9a..c13d4da61 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -312,7 +312,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService * @param currentEmployeeId */ @Override - @Transactional(rollbackFor = Exception.class) public void handleStayDelData(long currentEmployeeId) { log.info("绂忓埄妗f涓緟鍑忓憳鏁版嵁鑷姩澶勭悊閫昏緫寮濮嬶細"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); @@ -349,7 +348,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService * 绂忓埄妗f涓閲忔暟鎹鐞 * @param currentEmployeeId */ - @Transactional(rollbackFor = Exception.class) @Override public void handleChangeData(long currentEmployeeId) { try { diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java index c48450772..1df986fef 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalcServiceImpl.java @@ -135,7 +135,6 @@ // } // // @Override -// @Transactional(rollbackFor = Exception.class) // public void calcByEmployeeIds(Long salaryAcctRecordId, Collection salaryAcctEmployeeIds, DataCollectionEmployee simpleEmployee) throws Exception { // SalaryAcctRateDTO salaryAcctRate = new SalaryAcctRateDTO("" + salaryAcctRecordId); // try { diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java new file mode 100644 index 000000000..c23a9b87c --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctCalcTaxReqServiceImpl.java @@ -0,0 +1,37 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO; +import com.engine.salary.mapper.salaryacct.SalaryAcctCalcTaxReqMapper; +import com.engine.salary.service.SalaryAcctCalcTaxReqService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +public class SalaryAcctCalcTaxReqServiceImpl extends Service implements SalaryAcctCalcTaxReqService { + + private SalaryAcctCalcTaxReqMapper getSalaryAcctCalcTaxReqMapper() { + return MapperProxyFactory.getProxy(SalaryAcctCalcTaxReqMapper.class); + } + + + @Override + public List listByRecordId(Long salaryAcctRecordId) { + return getSalaryAcctCalcTaxReqMapper().listSome(SalaryAcctCalcTaxReqPO.builder().salaryAcctRecordId(salaryAcctRecordId).build()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void batchSave(List salaryAcctCalcTaxReqs) { + if (CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs)) { + salaryAcctCalcTaxReqs.forEach(getSalaryAcctCalcTaxReqMapper()::insertIgnoreNull); + } + } + + @Override + public void deleteByRecordId(Long salaryAcctRecordId) { + getSalaryAcctCalcTaxReqMapper().deleteByRecordId(salaryAcctRecordId); + } +} diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 81fae4808..10673a1d1 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -23,6 +23,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.formlua.entity.standard.ExcelResult; import com.engine.salary.service.*; @@ -126,6 +127,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc List employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); SalarySobCycleDTO salarySobCycleDTO = salaryAcctCalculateBO.getSalarySobCycleDTO(); + SalarySobPO salarySobPO = salaryAcctCalculateBO.getSalarySobPO(); List taxAgentIds = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentIds(); sw.stop(); // 2銆佹煡璇㈣柂璧勬。妗堢殑鏁版嵁 @@ -148,7 +150,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc sw.stop(); // 5銆佹煡璇㈠叾浠栧厤绋庢墸闄 sw.start("鏌ヨ鍏朵粬鍏嶇◣鎵i櫎"); - List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds); + List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds,salarySobPO.getIncomeCategory()); sw.stop(); //6銆佹煡璇㈢ぞ淇濈鍒 sw.start("鏌ヨ绀句繚绂忓埄"); @@ -210,6 +212,9 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc Set salarySobBackItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); Map salarySobBackItemMap = SalaryEntityUtil.convert2Map(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); List salaryAcctResultTempPOS = Lists.newArrayList(); + + //涓◣椤圭洰id + List taxIds = salaryAcctCalculateBO.getTaxIds(); sw.stop(); // 寮濮嬫牳绠 sw.start("鏍哥畻鑰楁椂"); @@ -224,91 +229,95 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc formulaVarValues.addAll(empInfo); Map formulaVarValueMap = SalaryEntityUtil.convert2Map(formulaVarValues, CalculateFormulaVarBO.FormulaVarValue::getFieldId, CalculateFormulaVarBO.FormulaVarValue::getFieldValue); // 鎸夌収璁$畻濂界殑浼樺厛绾ц绠楄柂璧勯」鐩殑鍊 - for (List salaryItemIds : salaryAcctCalculateBO.getSalaryItemIdWithPriorityList()) { + for (Long salaryItemId : salaryAcctCalculateBO.getSalaryItemIdWithPriorityList()) { // 鍚屼竴杩愮畻浼樺厛绾т笅鐨勮柂璧勯」鐩愪釜鐙珛杩愮畻 - for (Long salaryItemId : salaryItemIds) { - String resultValue; - SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemId); - ExpressFormula expressFormula; - String defaultValue; - if (salarySobBackItemMap.containsKey(salaryItemId)) { - // 濡傛灉钖祫璐﹀鐨勫洖绠楅」鐩腑閲嶆柊瀹氫箟浜嗗洖绠楅」鐩叕寮忥紝鍒欎娇鐢ㄨ柂璧勮处濂椾笅鐨勫叕寮 - SalarySobBackItemPO salarySobBackItemPO = salarySobBackItemMap.get(salaryItemId); - expressFormula = expressFormulaMap.get(salarySobBackItemPO.getFormulaId()); - defaultValue = salarySobBackItemPO.getDefaultValue(); - } else if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId)) { - // 濡傛灉钖祫璐﹀涓嬮噸鏂板畾涔変簡钖祫椤圭洰鐨勫叕寮忥紝鍒欎娇鐢ㄨ柂璧勮处濂椾笅鐨勫叕寮忥紝鍚﹀垯浣跨敤钖祫椤圭洰鏈韩鐨勫叕寮 - SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); - expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); - defaultValue = salarySobItemPO.getDefaultValue(); - } else { - expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); - defaultValue = salaryItemPO.getDefaultValue(); - } - if (Objects.nonNull(expressFormula)) { - // 杩愯鍏紡 - ExcelResult result = runExpressFormula(expressFormula, formulaVarValueMap, simpleEmployee); - resultValue = result.getData2String(); - //鍏紡寮傚父淇℃伅 - if (!result.isStatus()) { - String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); - String errorMsg = String.format("%s鐨%s鏍哥畻寮傚父锛屽師鍥狅細%s \r\n", username, salaryItemPO.getName(), result.getErrorMsg()); - noticeMsg.append(errorMsg); - } - //鎻愰啋杩愯瓒呮椂 - if (StringUtils.isNotBlank(formulaRunOvertimeThreshold) && result.getRunTime() > Long.parseLong(formulaRunOvertimeThreshold)) { - String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); - String errorMsg = String.format("%s鐨%s鏍哥畻瓒呮椂锛岃楁椂锛%s姣 \r\n", username, salaryItemPO.getName(), result.getRunTime()); - noticeMsg.append(errorMsg); - } - } else { - // 澶勭悊鍙栧肩被鍨嬩负鈥滆緭鍏/瀵煎叆鈥濈殑钖祫椤圭洰 - String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); - if (StrUtil.isBlank(resultValue)) { - resultValue = Util.null2String(defaultValue); - } - } - // 澶勭悊钖祫妗f - if (Objects.equals(salaryItemPO.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { - String key = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); - } - // 澶勭悊鍚堝苟璁$◣ - resultValue = handleConsolidatedTax(resultValue, salaryItemPO, salaryAcctCalculateBO, otherSalaryAcctEmployeePOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()), otherSalaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId())); + String resultValue; + SalaryItemPO salaryItemPO = salaryItemMap.get(salaryItemId); + ExpressFormula expressFormula; + String defaultValue; + if (salarySobBackItemMap.containsKey(salaryItemId)) { + // 濡傛灉钖祫璐﹀鐨勫洖绠楅」鐩腑閲嶆柊瀹氫箟浜嗗洖绠楅」鐩叕寮忥紝鍒欎娇鐢ㄨ柂璧勮处濂椾笅鐨勫叕寮 + SalarySobBackItemPO salarySobBackItemPO = salarySobBackItemMap.get(salaryItemId); + expressFormula = expressFormulaMap.get(salarySobBackItemPO.getFormulaId()); + defaultValue = salarySobBackItemPO.getDefaultValue(); + } else if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId)) { + // 濡傛灉钖祫璐﹀涓嬮噸鏂板畾涔変簡钖祫椤圭洰鐨勫叕寮忥紝鍒欎娇鐢ㄨ柂璧勮处濂椾笅鐨勫叕寮忥紝鍚﹀垯浣跨敤钖祫椤圭洰鏈韩鐨勫叕寮 + SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(salaryItemId); + expressFormula = expressFormulaMap.get(salarySobItemPO.getFormulaId()); + defaultValue = salarySobItemPO.getDefaultValue(); + } else { + expressFormula = expressFormulaMap.get(salaryItemPO.getFormulaId()); + defaultValue = salaryItemPO.getDefaultValue(); + } - // 澶勭悊灏忔暟鐐 - resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap); + if (taxIds.contains(salaryItemId)) { + //涓◣椤圭洰锛岄粯璁ゅ彧鑳戒粠绋庡眬鍙栥 + expressFormula = null; + defaultValue = ""; + } - //鏄惁閿佸畾 - if (lockItems != null && lockItems.contains(salaryItemId)) { - resultValue = empItemValueMap.getOrDefault(salaryAcctEmployeePOId + "_" + salaryItemId, StringUtils.EMPTY); + if (Objects.nonNull(expressFormula)) { + // 杩愯鍏紡 + ExcelResult result = runExpressFormula(expressFormula, formulaVarValueMap, simpleEmployee); + resultValue = result.getData2String(); + //鍏紡寮傚父淇℃伅 + if (!result.isStatus()) { + String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); + String errorMsg = String.format("%s鐨%s鏍哥畻寮傚父锛屽師鍥狅細%s \r\n", username, salaryItemPO.getName(), result.getErrorMsg()); + noticeMsg.append(errorMsg); } - // 灏嗗凡缁忚绠楄繃鐨勮柂璧勯」鐩殑鍊艰浆鎹㈡垚鍏紡鍙橀噺鐨勫兼坊鍔犲埌闆嗗悎涓 + //鎻愰啋杩愯瓒呮椂 + if (StringUtils.isNotBlank(formulaRunOvertimeThreshold) && result.getRunTime() > Long.parseLong(formulaRunOvertimeThreshold)) { + String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse(""); + String errorMsg = String.format("%s鐨%s鏍哥畻瓒呮椂锛岃楁椂锛%s姣 \r\n", username, salaryItemPO.getName(), result.getRunTime()); + noticeMsg.append(errorMsg); + } + } else { + // 澶勭悊鍙栧肩被鍨嬩负鈥滆緭鍏/瀵煎叆鈥濈殑钖祫椤圭洰 String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); - formulaVarValueMap.put(key, resultValue); - // 鍊间繚瀛樿柂璧勮处濂椾笅鐨勮柂璧勯」鐩殑鏍哥畻缁撴灉 - if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId) || salarySobBackItemIds.contains(salaryItemId)) { - // 杞崲鎴愯柂璧勬牳绠楃粨鏋減o - SalaryAcctResultTempPO salaryAcctResultTempPO = new SalaryAcctResultTempPO() - .setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()) - .setSalaryAcctEmpId(salaryAcctEmployeePOId) - .setEmployeeId(salaryAcctEmployeePO.getEmployeeId()) - .setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()) - .setSalarySobId(salaryAcctEmployeePO.getSalarySobId()) - .setSalaryItemId(salaryItemPO.getId()) - .setResultValue(resultValue) - .setOriginResultValue(salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId) == null - ? StringUtils.EMPTY : salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId)) - .setCalculateKey(salaryAcctCalculateBO.getCalculateKey()) - .setCreator((long) user.getUID()) - .setCreateTime(now) - .setUpdateTime(now) - .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .setDeleteType(0); - salaryAcctResultTempPOS.add(salaryAcctResultTempPO); + resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); + if (StrUtil.isBlank(resultValue)) { + resultValue = Util.null2String(defaultValue); } } + // 澶勭悊钖祫妗f + if (Objects.equals(salaryItemPO.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { + String key = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); + resultValue = formulaVarValueMap.getOrDefault(key, StringUtils.EMPTY); + } + // 澶勭悊鍚堝苟璁$◣ + resultValue = handleConsolidatedTax(resultValue, salaryItemPO, salaryAcctCalculateBO, otherSalaryAcctEmployeePOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()), otherSalaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId())); + + // 澶勭悊灏忔暟鐐 + resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap); + //鏄惁閿佸畾 + if (lockItems != null && lockItems.contains(salaryItemId)) { + resultValue = empItemValueMap.getOrDefault(salaryAcctEmployeePOId + "_" + salaryItemId, StringUtils.EMPTY); + } + // 灏嗗凡缁忚绠楄繃鐨勮柂璧勯」鐩殑鍊艰浆鎹㈡垚鍏紡鍙橀噺鐨勫兼坊鍔犲埌闆嗗悎涓 + String key = SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + salaryItemPO.getCode(); + formulaVarValueMap.put(key, resultValue); + // 鍊间繚瀛樿柂璧勮处濂椾笅鐨勮柂璧勯」鐩殑鏍哥畻缁撴灉 + if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId) || salarySobBackItemIds.contains(salaryItemId)) { + // 杞崲鎴愯柂璧勬牳绠楃粨鏋減o + SalaryAcctResultTempPO salaryAcctResultTempPO = new SalaryAcctResultTempPO() + .setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()) + .setSalaryAcctEmpId(salaryAcctEmployeePOId) + .setEmployeeId(salaryAcctEmployeePO.getEmployeeId()) + .setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .setSalarySobId(salaryAcctEmployeePO.getSalarySobId()) + .setSalaryItemId(salaryItemPO.getId()) + .setResultValue(resultValue) + .setOriginResultValue(salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId) == null + ? StringUtils.EMPTY : salaryAcctResultPOMap.get(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId() + "-" + salaryItemId)) + .setCalculateKey(salaryAcctCalculateBO.getCalculateKey()) + .setCreator((long) user.getUID()) + .setCreateTime(now) + .setUpdateTime(now) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setDeleteType(0); + salaryAcctResultTempPOS.add(salaryAcctResultTempPO); + } } } sw.stop(); diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 1ad833b52..fec3890f1 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -248,6 +249,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct return getSalaryAcctEmployeeMapper().list(queryParam); } + @Override + public List listByTaxCycleAndTaxAgentId(SalaryAcctEmployeeQueryParam queryParam) { + return getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().taxAgentIds(queryParam.getTaxAgentIds()).taxCycle(queryParam.getTaxCycle()).build()); + } + @Override public PageInfo listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam) { ValidUtil.doValidator(queryParam); @@ -861,6 +867,32 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct } } + + @Override + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + + Long recordId = queryParam.getRecordId(); + SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); + SalarySobPO sobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); + queryParam.setTaxCycle(recordPO.getTaxCycle()); + queryParam.setTaxAgentId(sobPO.getTaxAgentId()); + + List list = getSalaryAcctEmployeeMapper().listPage4NotDeclareByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AbnormalEmployeeListDTO.class); + } + + @Override + public int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + + Long recordId = queryParam.getRecordId(); + SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); + SalarySobPO sobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); + queryParam.setTaxCycle(recordPO.getTaxCycle()); + queryParam.setTaxAgentId(sobPO.getTaxAgentId()); + + return getSalaryAcctEmployeeMapper().countNotDeclareByParam(queryParam); + } + @Override public void updateIgnoreNull(SalaryAcctEmployeePO salaryAcctEmployeePO) { getSalaryAcctEmployeeMapper().updateIgnoreNull(salaryAcctEmployeePO); diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 254208b86..0edbada4a 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -6,17 +6,22 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctBatParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; import com.engine.salary.entity.salarysob.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.OperateTypeEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; @@ -39,6 +44,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; @@ -89,6 +96,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); } + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } + // private SalaryCheckResultService salaryCheckResultService; // // private SalaryCheckResultDetailService salaryCheckResultDetailService; @@ -118,6 +129,15 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + public AuthService getAuthService(User user) { return ServiceUtil.getService(AuthServiceImpl.class, user); } @@ -277,17 +297,22 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫鏍哥畻璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); } // 鏌ヨ钖祫鏍哥畻鎵鐢ㄨ柂璧勮处濂楃殑钖祫鍛ㄦ湡銆佽冨嫟鍛ㄦ湡鈥︹ - return getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth())); + SalarySobCycleDTO salarySobCycle = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth())); + int i = getSalaryAcctEmployeeService(user).countNotDeclareByParam(AbnormalEmployeeListQueryParam.builder().recordId(id).build()); + salarySobCycle.setAbnormalEmployeeNum(i); + return salarySobCycle; } @Override 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()); // 钖祫鎵灞炴湀鎵鍦ㄥ勾鐨勬棩鏈熻寖鍥达紙绗竴澶╋綖鏈鍚庝竴澶╋級 @@ -307,6 +332,18 @@ 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()) + .salaryMonth(salaryAcctRecordPO.getSalaryMonth()) + .taxCycle(salaryAcctRecordPO.getTaxCycle()) + .build(); + List salaryAcctTaxAgents = new ArrayList<>(); + salaryAcctTaxAgents.add(build); + checkBeforeSave(salaryAcctRecordPO, salaryAcctTaxAgents); + // 淇濆瓨钖祫鏍哥畻璁板綍 getSalaryAcctRecordMapper().insertIgnoreNull(salaryAcctRecordPO); // 鍒濆鍖栬柂璧勬牳绠椾汉鍛 @@ -352,75 +389,74 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe //鑾峰彇璐﹀涓嬬殑鎵鏈夋牳绠楃粨鏋 List salaryAcctRecords = listByTaxCycle(taxCycleYearRange, salarySobIds); - // 鑾峰彇涓◣鐢虫姤鍔熻兘鐘舵 - TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); - - if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.OPEN.getValue())) { - // 寮鍚簡涓◣鐢虫姤鍔熻兘 - // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忓綊妗d簡锛屼笉鍙互鏂板缓涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 - SalaryAcctRecordPO hasArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) - && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(hasArchivedSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98752, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忓綊妗o紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } - // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夎繕鏈敵鎶ワ紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 - SalaryAcctRecordPO notDeclaredSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> !Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) - && e.getTaxCycle().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(notDeclaredSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98751, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滆繕鏈敵鎶ワ紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(notDeclaredSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } - // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忕敵鎶ヤ簡锛屼笉鍙互鏂板缓鏈湀浠ュ強涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 - SalaryAcctRecordPO hasDeclaredSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) - && e.getTaxCycle().compareTo(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1))) >= 0) - .findAny() - .orElse(null); - if (Objects.nonNull(hasDeclaredSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98753, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忕敵鎶ワ紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasDeclaredSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } + // 鑾峰彇涓◣鐢虫姤鍔熻兘鐘舵 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.OPEN.getValue())) { + // 寮鍚簡涓◣鐢虫姤鍔熻兘 + // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忓綊妗d簡锛屼笉鍙互鏂板缓涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 + SalaryAcctRecordPO hasArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() + .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) + && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(hasArchivedSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98752, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忓綊妗o紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) + .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); + } + // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夎繕鏈敵鎶ワ紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 + SalaryAcctRecordPO notDeclaredSalaryAcctRecordPO = salaryAcctRecords.stream() + .filter(e -> !Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) + && e.getTaxCycle().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(notDeclaredSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98751, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滆繕鏈敵鎶ワ紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(notDeclaredSalaryAcctRecordPO.getTaxCycle()).toString()) + .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); + } + // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忕敵鎶ヤ簡锛屼笉鍙互鏂板缓鏈湀浠ュ強涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 + SalaryAcctRecordPO hasDeclaredSalaryAcctRecordPO = salaryAcctRecords.stream() + .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) + && e.getTaxCycle().compareTo(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1))) >= 0) + .findAny() + .orElse(null); + if (Objects.nonNull(hasDeclaredSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98753, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忕敵鎶ワ紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasDeclaredSalaryAcctRecordPO.getTaxCycle()).toString()) + .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); + } + } + if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.REBOOT.getValue())) { + // 閲嶅惎浜嗕釜绋庣敵鎶ュ姛鑳斤紙涓嶅幓鏍¢獙閲嶅惎涔嬪墠鏄惁鐢虫姤鏁版嵁锛 + // 濡傛灉鏌愪釜鏈堬紙钖祫鎵灞炴湡锛夎繕鏈綊妗o紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 + SalaryAcctRecordPO notArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() + .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) + && e.getSalaryMonth().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(notArchivedSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98754, "钖祫鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滆繕鏈綊妗o紝涓嶈兘鏂板缓钖祫鎵灞炴湡{1}鐨勮柂璧勬牳绠") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) + .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); + } + // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忓綊妗d簡锛屼笉鍙互鏂板缓涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 + SalaryAcctRecordPO hasArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() + .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) + && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(hasArchivedSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98752, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忓綊妗o紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) + .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); + } + // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夎繕鏈敵鎶ワ紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 + //鑾峰彇璐﹀涓嬩粠閲嶅惎鏈堣嚦鎵鍦ㄥ勾鐨勬渶鍚庝竴澶╃殑鎵鏈夋牳绠楃粨鏋 + Date taxDeclarationRebootDate = getSalarySysConfService(user).getTaxDeclarationRebootDate(); + if (taxDeclarationRebootDate == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤鍔熻兘寮傚父"); } - if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.REBOOT.getValue())) { - // 閲嶅惎浜嗕釜绋庣敵鎶ュ姛鑳斤紙涓嶅幓鏍¢獙閲嶅惎涔嬪墠鏄惁鐢虫姤鏁版嵁锛 - // 濡傛灉鏌愪釜鏈堬紙钖祫鎵灞炴湡锛夎繕鏈綊妗o紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 - SalaryAcctRecordPO notArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) - && e.getSalaryMonth().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(notArchivedSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98754, "钖祫鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滆繕鏈綊妗o紝涓嶈兘鏂板缓钖祫鎵灞炴湡{1}鐨勮柂璧勬牳绠") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } - // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夊凡缁忓綊妗d簡锛屼笉鍙互鏂板缓涔嬪墠鏈堜唤鐨勮柂璧勬牳绠 - SalaryAcctRecordPO hasArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) - && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getTaxCycle().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(hasArchivedSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98752, "绋庢鎵灞炴湡{0}鐨勮柂璧勬牳绠楃粨鏋滃凡缁忓綊妗o紝涓嶈兘鏂板缓绋庢鎵灞炴湡{1}鐨勮柂璧勬牳绠") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } - // 濡傛灉鏌愪釜鏈堬紙绋庢鎵灞炴湡锛夎繕鏈敵鎶ワ紝涓嶅彲浠ユ柊寤轰箣鍚庢湀浠界殑钖祫鏍哥畻 - //鑾峰彇璐﹀涓嬩粠閲嶅惎鏈堣嚦鎵鍦ㄥ勾鐨勬渶鍚庝竴澶╃殑鎵鏈夋牳绠楃粨鏋 - Date taxDeclarationRebootDate = getSalarySysConfService(user).getTaxDeclarationRebootDate(); - if (taxDeclarationRebootDate == null) { - throw new SalaryRunTimeException("涓◣鐢虫姤鍔熻兘寮傚父"); - } LocalDateRange taxCycleRebootYearRange = LocalDateRange.builder() .fromDate(taxDeclarationRebootDate) @@ -454,6 +490,142 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe }); } + + /** + * 淇濆瓨涔嬪墠妫鏌ヤ竴涓嬫槸鍚﹀彲浠ユ柊寤烘牳绠 + * + * @param salaryAcctTaxAgents + */ + @Override + public void checkBeforeSave(SalaryAcctRecordPO salaryAcctRecord, List salaryAcctTaxAgents) { + // 濡傛灉涓◣鐢虫姤鍔熻兘鏄叧闂殑锛屽垯涓嶉渶瑕佹鏌 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + if (taxDeclarationFunctionEnum == TaxDeclarationFunctionEnum.CLOSURE) { + return; + } + + // 鏌ヨ钖祫璐﹀ + 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.getTaxCycle())) + .replace("{2}", SalaryDateUtil.getFormatYYYYMM(salaryAcctTaxAgent.getTaxCycle()))); + } + } + } + private List listByCreateDate(LocalDateRange taxCycleRebootYearRange, Set salarySobIds) { return getSalaryAcctRecordMapper().listByCreateDate(taxCycleRebootYearRange, salarySobIds); } @@ -677,29 +849,32 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe if (!isReCalc) { getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); } + // 鎾ゅ洖宸ヨ祫鍗 getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); - // 閲嶆柊鏍哥畻鎴栬呭洖绠楁椂锛岃嫢鏈钖祫鏍哥畻璁板綍宸茬粡鐢虫姤浜嗭紝鍒欐湰娆¤柂璧勬牳绠楄褰曚笅鐨勬墍鏈変釜绋庢墸缂翠箟鍔′汉鍦ㄧ浉鍚岀◣娆炬墍灞炴湡鍐呯殑鎵鏈夎柂璧勬牳绠楄褰曠殑鐘舵侀兘搴旇浠庡凡鐢虫姤鍙樻洿涓哄凡褰掓。 - // 杩囨护鑾峰彇鎵鍦ㄧ◣娆炬墍灞炴湡鍐呰涓◣鎵g即涔夊姟浜烘墍鏈夌殑钖祫鏍哥畻璁板綍ID - List needUpdateSalaryAcctRecordIds = selfSalaryAcctRecordPOS.stream().filter(po -> po.getTaxCycle().equals(salaryAcctRecordPO.getTaxCycle())) - .map(SalaryAcctRecordPO::getId).collect(Collectors.toList()); - if (Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue())) { - if (needUpdateSalaryAcctRecordIds.size() > 0) { - // 鏇存柊钖祫鏍哥畻璁板綍鐨勭姸鎬 - updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); - } - // 鍒犻櫎涓◣鐢虫姤琛ㄥ強寰鏈熺疮璁℃儏鍐 - getTaxDeclarationService(user).delete(salaryAcctRecordPO); - } + //鍒犻櫎鎶ヨ〃缂撳瓨 + getSalaryStatisticsReportService(user).removeReportCache(); + // 鏌ヨ鏈钖祫鏍哥畻璁板綍鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordPO.getId())); + // 濡傛灉宸茬粡瀛樺湪绋庢鎵灞炴湡涓8鏈堜唤鐨勮柂璧勬牳绠楄褰曪紝灏变笉鑳藉啀閲嶆柊鏍哥畻1-7鏈堜唤鐨勮柂璧勬牳绠楄褰曚簡 + // 鏇存柊涓◣鐢虫姤璁板綍鐨勬爣璁(閲嶆柊鏍哥畻浼氬奖鍝嶄釜绋庣敵鎶ヨ〃) + Map> taxCycleKeyTaxAgentIdMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle, SalaryAcctTaxAgentPO::getTaxAgentId); + for (Map.Entry> entry : taxCycleKeyTaxAgentIdMap.entrySet()) { + getTaxDeclareRecordService(user).updateByTaxCycleAndTaxAgentIds(entry.getKey(), entry.getValue()); + } + salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); + salaryAcctRecordPO.setUpdateTime(new Date()); + if (!isReCalc) { + salaryAcctRecordPO.setBackCalcStatus(1); + salaryAcctRecordPO.setSuperId(salaryAcctRecordPO.getId()); + salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); + } // 鏇存柊钖祫鏍哥畻璁板綍鐨勭姸鎬 salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); salaryAcctRecordPO.setUpdateTime(new Date()); getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); - - //鍒犻櫎鎶ヨ〃缂撳瓨 - getSalaryStatisticsReportService(user).removeReportCache(); } @@ -820,6 +995,14 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return getSalaryAcctRecordMapper().listSome(po); } + @Override + public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { + if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { + return Collections.emptyList(); + } + return getSalaryAcctRecordMapper().listAcctTaxAgent(salaryAcctRecordIds); + } + @Override public void updateDate(Long id, Date updateTime) { getSalaryAcctRecordMapper().updateDate(id, updateTime); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 581e64149..1b78e42d4 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -25,6 +25,7 @@ import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.*; import com.engine.salary.entity.salaryformula.ExpressFormula; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.*; import com.engine.salary.entity.salarysob.po.*; @@ -32,9 +33,12 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.common.FilterEnum; +import com.engine.salary.enums.common.SalaryLogGroupTypeEnum; +import com.engine.salary.enums.common.SalaryLogOperateTypeEnum; import com.engine.salary.enums.salaryaccounting.LockStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -64,6 +68,8 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.BeanUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.util.StopWatch; import weaver.general.BaseBean; @@ -74,10 +80,13 @@ import java.util.*; import java.util.concurrent.BlockingDeque; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingDeque; +import java.util.regex.Matcher; import java.util.stream.Collectors; import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE; +import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN; + /** * 钖祫鏍哥畻缁撴灉 *

Copyright: Copyright (c) 2022

@@ -207,6 +216,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user); } + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + @Override public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { @@ -769,6 +782,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + public void batchUpdate(List salaryAcctResultPOS) { + if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { + // 鏁版嵁鍔犲瘑 + encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); + List> partition = Lists.partition(salaryAcctResultPOS, 100); + partition.forEach(getSalaryAcctResultMapper()::batchUpdate); + } + } + @Override public void deleteBySalaryAcctEmployeeIds(Collection salaryAcctEmployeeIds) { @@ -839,9 +861,13 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); // 鏈杩愮畻鐨勫洖绠楄柂璧勯」鐩墍娑夊強鐨勫彉閲 - Set issuedFieldIds = new HashSet<>(); + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); // 9銆佽绠楄柂璧勯」鐩殑杩愮畻浼樺厛绾 - List> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas, salarySobBackItems, issuedFieldIds); + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); + //璐﹀涓厤缃殑涓◣瀛楁锛屼笉闇瑕佺郴缁熺畻 + List salarySobTaxRulePOS = getSalarySobTaxRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List taxIds = SalaryEntityUtil.properties(salarySobTaxRulePOS, SalarySobTaxRulePO::getSalaryItemId, Collectors.toList()); + // 10銆佹牴鎹甶d鏌ヨ鍏朵粬鍚堝苟璁$◣鐨勮柂璧勬牳绠楄褰 List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); // 11銆佹煡璇㈡湰娆℃牳绠椾汉鍛 @@ -897,7 +923,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .setResults(calculateResults) .setCalculateKey(calculateKey) .setVariableItems(variableItemPOS) - .setTaxDeclarationFunction(taxDeclarationFunction); + .setTaxDeclarationFunction(taxDeclarationFunction) + .setTaxIds(taxIds); List finalSalarySobBackItems = salarySobBackItems; if (isSync) { getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems); @@ -967,6 +994,213 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + + @Override + public void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee) { + Long salaryAcctRecordId = calculateParam.getSalaryAcctRecordId(); + try { + // 1銆佹煡璇㈣柂璧勬牳绠楄褰 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫鏍哥畻璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); + } + //鏌ヨ瀵瑰簲璐﹀ + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫璐﹀涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); + } + + // 涓嶆槸鏌ヨ钖祫璐﹀涓嬪疄鏃剁殑钖祫椤圭洰锛岃屾槸鏌ヨ鍙戣捣钖祫鏍哥畻鏃跺瓨鍌ㄧ殑钖祫椤圭洰蹇収 + SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(salaryAcctRecordId); + + // 1.1銆佸鏋滆柂璧勬牳绠楄褰曞凡缁忓綊妗d簡锛屽氨涓嶈兘缁х画鏍哥畻 + if (!Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99148, "褰撳墠钖祫鏍哥畻璁板綍宸插綊妗o紝璇烽噸鏂版墦寮鍚庡啀杩涜鏍哥畻")); + } + // 2銆佹煡璇㈣柂璧勬牳绠楄褰曠殑钖祫鍛ㄦ湡銆佽冨嫟鍛ㄦ湡绛 + SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordId); + // 3銆佹煡璇㈣柂璧勬牳绠楄褰曟墍鐢ㄨ柂璧勮处濂楃殑钖祫椤圭洰鍓湰 + List salarySobItemPOS = salaryAcctSobConfig.getSalarySobItems(); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "褰撳墠鎵鐢ㄧ殑钖祫璐﹀鏈夋嫨浠讳綍钖祫椤圭洰锛屾棤娉曟牳绠")); + } + // 鍥炵畻钖祫椤圭洰 + List salarySobBackItems = Collections.emptyList(); + if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), 1)) { + salarySobBackItems = salaryAcctSobConfig.getSalarySobBackItems(); + } + // 4銆佹煡璇㈠綋鍓嶇鎴风殑鎵鏈夎柂璧勯」鐩 + List salaryItemPOS = getSalaryItemService(user).listAll(); + // 5銆佹煡璇㈣柂璧勬牳绠楄褰曟墍鐢ㄨ柂璧勮处濂楃殑璋冭柂璁¤柂瑙勫垯 + List salarySobAdjustRulePOS = getSalarySobAdjustRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 6銆佹煡璇㈢ぞ淇濈鍒╃殑鎵鏈夊瓧娈 + Map welfareColumns = getSIAccountService(user).welfareColumns(); + // 7銆佹煡璇㈣冨嫟寮曠敤鐨勬墍鏈夊瓧娈 + List attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll(); + List variableItemPOS = getVariableItemService(user).listAll(); + + // 8銆佹煡璇㈠叕寮忚鎯 + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); + formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 鏈杩愮畻鐨勫洖绠楄柂璧勯」鐩墍娑夊強鐨勫彉閲 + Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); + // 9銆佽绠楄柂璧勯」鐩殑杩愮畻浼樺厛绾 + List salarySobItemsWithPriority = sortItems(salarySobItemPOS, salarySobBackItems, salaryItemPOS, expressFormulas); + + //璐﹀涓厤缃殑涓◣瀛楁锛屼笉闇瑕佺郴缁熺畻 + List salarySobTaxRulePOS = getSalarySobTaxRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List taxIds = SalaryEntityUtil.properties(salarySobTaxRulePOS, SalarySobTaxRulePO::getSalaryItemId, Collectors.toList()); + + /** + * 璁$畻绋庡悗钖祫 + */ + int index = salarySobItemsWithPriority.size() - 1; + for (Long id : taxIds) { + int i = salarySobItemsWithPriority.indexOf(id); + if (i != -1 && i < index) { + index = i; + } + } + salarySobItemsWithPriority = salarySobItemsWithPriority.subList(index, salarySobItemsWithPriority.size()); + + // 10銆佹牴鎹甶d鏌ヨ鍏朵粬鍚堝苟璁$◣鐨勮柂璧勬牳绠楄褰 + List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); + // 11銆佹煡璇㈡湰娆℃牳绠椾汉鍛 + List salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId()); + if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "钖祫鏍哥畻浜哄憳涓嶈兘涓虹┖")); + } + + // 11.1銆佸垵濮嬪寲杩涘害 + ProgressDTO initProgress = new ProgressDTO().setTitle(SalaryI18nUtil.getI18nLabel(97515, "鏍哥畻涓")).setTitleLabelId(97515L).setTotalQuantity(salaryAcctEmployeePOS.size() * 2 + 1).setCalculatedQuantity(0).setProgress(BigDecimal.ZERO).setStatus(true).setMessage(StringUtils.EMPTY); + getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, initProgress); + // 12銆佸钖祫鏍哥畻浜哄憳杩涜鎷嗗垎 + List> partition = Lists.partition(salaryAcctEmployeePOS, 100); + // 12.1銆佺洃鎺у瓙绾跨▼鐨勪换鍔℃墽琛 + CountDownLatch childMonitor = new CountDownLatch(partition.size()); + // 12.2銆佽褰曞瓙绾跨▼鐨勬墽琛岀粨鏋 + BlockingDeque calculateResults = new LinkedBlockingDeque<>(partition.size()); + // 12.3銆佺敓鎴愭湰娆¤繍绠楃殑key + String calculateKey = UUID.randomUUID().toString(); + // 12.4銆佹槸鍚﹂噰鐢ㄧ郴缁熺畻绋 + TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration(); + // 12.5銆佸绾跨▼杩愮畻锛岃繍绠楃粨鏋滃瓨鏀惧湪涓存椂琛ㄤ腑 + for (List acctEmployeePOS : partition) { + SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO() + .setSalaryAcctRecordPO(salaryAcctRecordPO) + .setSalarySobPO(salarySobPO) + .setSalarySobCycleDTO(salarySobCycleDTO) + .setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS) + .setSalarySobItemPOS(salarySobItemPOS) + .setSalaryItemIdWithPriorityList(salarySobItemsWithPriority) + .setExpressFormulas(expressFormulas) + .setSalaryItemPOS(salaryItemPOS) + .setSalarySobAdjustRulePOS(salarySobAdjustRulePOS) + .setWelfareColumns(MapUtils.emptyIfNull(welfareColumns)) + .setAttendQuoteFieldListDTOS(attendQuoteFieldListDTOS) + .setSalaryAcctEmployeePOS(acctEmployeePOS) + .setIssuedFieldIds(issuedFieldIds) + .setChildMonitor(childMonitor) + .setResults(calculateResults) + .setCalculateKey(calculateKey) + .setVariableItems(variableItemPOS) + .setTaxDeclarationFunction(taxDeclarationFunction) + .setTaxIds(taxIds); + List finalSalarySobBackItems = salarySobBackItems; + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems); + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable); + } + // 13銆佺瓑寰呮墍鏈夊瓙绾跨▼鎵ц瀹屾瘯 + childMonitor.await(); + + + // 14銆佸垽鏂瓙绾跨▼鎵ц缁撴灉 + boolean allSuccess = calculateResults.stream().allMatch(SalaryAcctCalculateBO.Result::isStatus); + if (!allSuccess) { + // 钖祫鏍哥畻瀹炵幇鐨勭嚎绋嬬殑閿欒淇℃伅 + String errorMsg = calculateResults.stream().filter(result -> !result.isStatus()).map(SalaryAcctCalculateBO.Result::getErrMsg).collect(Collectors.joining("|")); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, errorMsg); + // 鍒犻櫎钖祫鏍哥畻涓存椂瀛樺偍琛ㄤ腑鐨勬暟鎹 + getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); + return; + } + // 15銆佸鐞嗘牳绠楃粨鏋滀复鏃惰〃鏁版嵁 + handleSalaryAfterTaxAcctResultTemp(salaryAcctRecordId, calculateKey,salarySobItemsWithPriority); + // 16銆佸紑濮嬭繍琛屾牎楠岃鍒 +// SalaryAcctCheckParam salaryAcctCheckParam = new SalaryAcctCheckParam() +// .setSalaryAcctRecordId(calculateParam.getSalaryAcctRecordId()) +// .setIds(calculateParam.getIds()); +// salaryCheckResultService.check(salaryAcctCheckParam, true, simpleEmployee); +// Thread.sleep(10); + getSalaryAcctProgressService(user).finish(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, true); + + + // 璁板綍鏃ュ織 + // 鏌ヨ鎿嶄綔鏃ュ織鐨則argetName + String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctRecordId); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salaryAcctRecordId)); + loggerContext.setTargetName(targetName); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏍哥畻绋庡悗钖祫")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏍哥畻绋庡悗钖祫")); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext); + } catch (Exception e) { + log.info("鏍哥畻绋庡悗钖祫鍑洪敊锛歿}", e.getMessage(), e); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + salaryAcctRecordId, SalaryI18nUtil.getI18nLabel(99642, "钖祫鏍哥畻鍑洪敊") + ": " + e.getMessage()); + } finally { + // 鏁版嵁搴撳瓧娈靛姞瀵嗙敤 + } + } + + @NotNull + private List sortItems(List salarySobItemPOS, List salarySobBackItems, List salaryItemPOS, List expressFormulas) { + + List temp = salarySobBackItems.stream() + .map(e -> { + SalarySobItemPO salarySobItem = new SalarySobItemPO(); + BeanUtils.copyProperties(e, salarySobItem); + return salarySobItem; + }).collect(Collectors.toList()); + salarySobItemPOS.addAll(temp); + + SalaryCalcItemGraph salaryCalcItemGraph = new SalaryCalcItemGraph(salarySobItemPOS, salaryItemPOS, expressFormulas); + List salaryCalcItems = salaryCalcItemGraph.sort(); + return SalaryEntityUtil.properties(salaryCalcItems, SalaryCalcItem::getSalaryItemId, Collectors.toList()); + } + + /** + * 鑾峰彇鍥炵畻鍙橀噺 + * + * @param salarySobBackItems + * @return + */ + @NotNull + private Set getIssuedFieldIds(List salarySobBackItems) { + Set issuedFieldIds; + Set issuedFormulaIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId); + List expressFormulas1 = getSalaryFormulaService(user).listExpressFormula(issuedFormulaIds); + List issuedFormulaVars = new ArrayList<>(); + expressFormulas1.forEach(f -> issuedFormulaVars.addAll(f.getParameters())); + issuedFieldIds = issuedFormulaVars.stream() + .map(FormulaVar::getFieldId) + .filter(StringUtils::isNotBlank) + .filter(v -> v.startsWith(SalaryFormulaReferenceEnum.ISSUED.getValue() + "_")) + .map(SALARY_PATTERN::matcher) + .filter(Matcher::find) + .map(m -> m.group(2)) + .collect(Collectors.toSet()); + return issuedFieldIds; + } + /** * 澶勭悊钖祫鏍哥畻涓存椂瀛樺偍琛ㄤ腑鐨勬暟鎹 * @@ -1000,6 +1234,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe log.info(sw.prettyPrint()); } + + private void handleSalaryAfterTaxAcctResultTemp(Long salaryAcctRecordId, String calculateKey, List afterTaxItemIds) { + // 鏌ヨ钖祫鏍哥畻缁撴灉鐨勪复鏃跺瓨鍌 + List salaryAcctResultTempPOS = getSalaryAcctResultTempService(user).listByCalculateKey(calculateKey); + // 鍒犻櫎鍘熸潵鐨勮柂璧勬牳绠楃粨鏋 + getSalaryAcctResultMapper().deleteBySalaryAcctRecordIdAndSalaryItemIds(salaryAcctRecordId, afterTaxItemIds); + // 淇濆瓨钖祫鐨勮柂璧勬牳绠楃粨鏋 + List salaryAcctResultPOS = SalaryAcctResultBO.convert2ResultPO(salaryAcctResultTempPOS); + batchSave(salaryAcctResultPOS); + // 鍒犻櫎钖祫鏍哥畻涓存椂瀛樺偍琛ㄤ腑鐨勬暟鎹 + getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey); + } + @Override public List listBySalaryAcctRecordIdsAndTaxAgentIds(Collection salaryAcctRecordIds, Collection taxAgentIds) { if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { @@ -1301,4 +1548,21 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); return salaryAcctResultPOS; } + + @Override + public void writeBatchLog(SalaryAcctRecordPO salaryAcctRecord, + Map newResultValueMap, + SalaryLogOperateTypeEnum operateType) { + LoggerContext> context = new LoggerContext<>(); + context.setUser(user); + context.setTargetId(salaryAcctRecord.getId().toString()); + context.setTargetName(SalaryI18nUtil.getI18nLabel(268573, "鍏ㄩ儴浜哄憳")); + context.setOperator(user.getUID() + ""); + context.setOperateType(operateType.getValue()); + context.setOperateTypeName(operateType.getDefaultLabel()); + context.setGroupId(SalaryLogGroupTypeEnum.SALARY_ACCT_RESULT_VALUE.getValue()); + context.setGroupNameLabel(SalaryLogGroupTypeEnum.SALARY_ACCT_RESULT_VALUE.getLabelId().toString()); + context.setNewValues(newResultValueMap); + SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(context); + } } \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java new file mode 100644 index 000000000..8bd4fe4f1 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java @@ -0,0 +1,91 @@ +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 initBySalaryAcctEmployees(List salaryAcctEmployees) { +// if (CollectionUtils.isEmpty(salaryAcctEmployees)) { +// return Collections.emptyList(); +// } +// LocalDateTime now = LocalDateTime.now(); +// Set keySet = Sets.newHashSet(); +// List salaryAcctTaxAgents = Lists.newArrayList(); +// for (SalaryAcctEmployeePO salaryAcctEmployee : salaryAcctEmployees) { +// String key = salaryAcctEmployee.getTaxAgentId() + "-" + salaryAcctEmployee.getTaxCycle() + "-" + salaryAcctEmployee.getIncomeCategory(); +// if (!keySet.contains(key)) { +// keySet.add(key); +// SalaryAcctTaxAgentPO salaryAcctTaxAgent = new SalaryAcctTaxAgentPO() +// .setId(IdGenerator.generate()) +// .setSalaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) +// .setIncomeCategory(Util.getIntValue(salaryAcctEmployee.getIncomeCategory())) +// .setTaxAgentId(salaryAcctEmployee.getTaxAgentId()) +// .setSalaryMonth(salaryAcctEmployee.getSalaryMonth()) +// .setTaxCycle(salaryAcctEmployee.getTaxCycle()) +// .setCreator(employeeId) +// .setTenantKey(tenantKey) +// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .setCreateTime(now) +// .setUpdateTime(now); +// salaryAcctTaxAgents.add(salaryAcctTaxAgent); +// } +// } +// return salaryAcctTaxAgents; +// } +// +// @Override +// public void batchSave(List salaryAcctTaxAgents) { +// if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) { +// saveBatch(salaryAcctTaxAgents); +// } +// } +// +// @Override +// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { +// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { +// return; +// } +// new LambdaUpdateChainWrapper<>(getSalaryAcctTaxAgentMapper()) +// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) +// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) +// .set(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .set(SalaryAcctTaxAgentPO::getUpdateTime, LocalDateTime.now()) +// .update(); +// } +} diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 4db580e19..9fe6d8191 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -404,7 +404,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch // * 瀵煎叆钖祫妗f // */ // @BatchImportHandler("importSalaryArchive") -// @Transactional(rollbackFor = Exception.class) // public void importSalaryArchive() { // BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage(); // log.info("銆愯柂璧勬。妗堛戞帴鏀跺埌涓婁紶鐨勬暟鎹細{}", String.format("batchTaskId=%s, fileName=%s", message.getBatchTaskId(), message.getBatchFile().getName())); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index d3dc237c9..f2e2e2c14 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -268,7 +268,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe * * @param currentEmployeeId */ - @Transactional(rollbackFor = Exception.class) public void handleSuspendData(Long currentEmployeeId) { List personnelStatuss = new ArrayList() {{ add("4"); @@ -620,7 +619,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe BeanUtils.copyProperties(salaryArchive, oldSalaryArchive); List oldList = Collections.singletonList(oldSalaryArchive); // 鏀跺叆鎵寰楅」鐩 -// boolean checkIncomeCategory = saveParam.getIncomeCategory() == null || StringUtils.isEmpty(SalaryArchiveBO.getIncomeCategoryByValue(saveParam.getIncomeCategory())); +// boolean checkIncomeCategory = saveParam.getIncomeCategory() == null || StringUtils.isEmpty(SalaryArchiveBO.getIncomeCategoryByValue(saveParam.getIncomeCategory(), currentEmployeeId, currentTenantKey)); // if (checkIncomeCategory) { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(122085, "鏀跺叆鎵寰楅」鐩笉鑳戒负绌烘垨涓嶅瓨鍦")); // } else { @@ -729,7 +728,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // List salarySobList = getSalarySobList(currentEmployeeId, currentTenantKey); // List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).filter(id -> saveParam.getSalarySobIds().contains(id)).collect(Collectors.toList()); -// List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now()); +// List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now(), currentEmployeeId, currentTenantKey); // this.salaryArchiveSobService.saveBatchBySalaryArchiveIdsAndSaves(Collections.singletonList(salaryArchive.getId()), salaryArchiveSobSaveList, currentTenantKey); // 璁板綍鏃ュ織 diff --git a/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java new file mode 100644 index 000000000..f76d1354a --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryCalcTaxServiceImpl.java @@ -0,0 +1,306 @@ +package com.engine.salary.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.bo.SalaryCalcTax; +import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO; +import com.engine.salary.entity.salaryacct.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam; +import com.engine.salary.entity.salaryacct.po.*; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse; +import com.engine.salary.enums.common.SalaryLogOperateTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.OnlineCalculateTaxException; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.CalculateClient; +import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse; +import com.engine.salary.service.*; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; + +@Slf4j +public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxService { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } + + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private SalaryAcctCalcTaxReqService getSalaryAcctCalcTaxReqService(User user) { + return ServiceUtil.getService(SalaryAcctCalcTaxReqServiceImpl.class, user); + } + + private SalaryAcctResultService getSalaryAcctResultService(User user) { + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + } + + + @Override + public SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam) { + // 鏌ヨ钖祫鏍哥畻璁板綍 + SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId()); + // 鏌ヨ渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(false); + // 鏌ヨ鍦ㄧ嚎璁$畻涓◣璁板綍 + List salaryAcctCalcTaxReqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecord.getId()); + + boolean enableTaxDeclarationApiConfig = Objects.nonNull(apiConfig) && Objects.equals(apiConfig.getEnableUse(), 1); + boolean showCalcTaxButton = enableTaxDeclarationApiConfig && CollectionUtils.isEmpty(salaryAcctCalcTaxReqs); + boolean showCalcTaxFeedbackButton = enableTaxDeclarationApiConfig && CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs); + + SalaryCalcTaxInfoDTO salaryCalcTaxInfo = new SalaryCalcTaxInfoDTO(); + salaryCalcTaxInfo.setShowCalcTaxButton(showCalcTaxButton); + salaryCalcTaxInfo.setShowCalcTaxFeedbackButton(showCalcTaxFeedbackButton); + salaryCalcTaxInfo.setShowCalcAfterTaxButton(showCalcTaxFeedbackButton); + + return salaryCalcTaxInfo; + } + + @Override + public void calcTax(SalaryCalcTaxParam salaryCalcTaxParam) { + // 鏌ヨ渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + if (apiConfig == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "鎺ュ彛娴侀噺涓嶈冻锛屾殏鏃犳硶浣跨敤璇ュ姛鑳斤紝璇峰厛璐拱鏅鸿兘绠楄柂鎺ュ彛娴侀噺")); + } + + Long salaryAcctRecordId = salaryCalcTaxParam.getSalaryAcctRecordId(); + int i = getSalaryAcctEmployeeService(user).countNotDeclareByParam(AbnormalEmployeeListQueryParam.builder().recordId(salaryAcctRecordId).build()); + if (i > 0) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(11111, "瀛樺湪鏈姤閫佺殑浜哄憳锛岃鍏堣繘琛屼汉鍛樻姤閫")); + } + List reqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecordId); + if (CollUtil.isNotEmpty(reqs)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(11111, "璇峰厛鑾峰彇涓婁竴娆″湪绾跨畻绋庣粨鏋")); + } + + // 鏌ヨ钖祫鏍哥畻璁板綍 + SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + List salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user) + .listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勮柂璧勬牳绠椾汉鍛 + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId()); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勮柂璧勬牳绠楃粨鏋 + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + // 鏌ヨ涓◣鎵g即涔夊姟浜 + Set taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + // 鏌ヨ涓◣鎵g即涔夊姟浜哄叧鑱旂殑鎶ョ◣淇℃伅 + List taxAgentTaxReturns = getTaxAgentTaxReturnService(user).getByTaxAgentIds(taxAgentIds); + // 鏌ヨ涓◣鐢虫姤琛ㄥ瓧娈 + List taxReportColumns = getTaxReportColumnService(user).listByContrastType(0); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈钖祫璐﹀鐨勪釜绋庣敵鎶ラ厤缃 + List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user) + .listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId())); + // 鏌ヨ鎶ラ佷汉鍛 + List employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents); + + List salaryAcctCalcTaxReqs = new ArrayList<>(); + + Date now = new Date(); + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String url = apiConfig.getHost() + SzyhApiConstant.CALCULATE_ASYN_INDIVIDUAL_INCOME_TAX; + SalaryCalcTax salaryCalcTax = new SalaryCalcTax(salaryAcctRecord, salaryAcctTaxAgents, salaryAcctEmployees, + salaryAcctResultValues, taxAgents, taxAgentTaxReturns, taxReportColumns, salarySobTaxReportRules, employeeDeclares); + Map> taxAgentIdKeyRequestParam = salaryCalcTax.buildCalcTaxRequestParam(); + for (Map.Entry> entry : taxAgentIdKeyRequestParam.entrySet()) { + String reqJson = JsonUtil.toJsonString(entry.getValue()); + // 璇锋眰绗笁鏂逛緵搴斿晢 + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + TaskUtil taskUtil = new TaskUtil(); + taskUtil.writeApiTaskRecord(salaryAcctRecordId + "", url, reqJson, res); + + DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); + if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); + } + + SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq = new SalaryAcctCalcTaxReqPO(); + salaryAcctCalcTaxReq.setId(IdGenerator.generate()); + salaryAcctCalcTaxReq.setSalaryAcctRecordId(salaryAcctRecord.getId()); + salaryAcctCalcTaxReq.setTaxAgentId(entry.getKey()); + salaryAcctCalcTaxReq.setRequestId(declareTaxResponse.getBody().getRequestId()); + salaryAcctCalcTaxReq.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salaryAcctCalcTaxReq.setCreator((long) user.getUID()); + salaryAcctCalcTaxReq.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salaryAcctCalcTaxReq.setCreateTime(now); + salaryAcctCalcTaxReq.setUpdateTime(now); + salaryAcctCalcTaxReqs.add(salaryAcctCalcTaxReq); + } + + // 鎵归噺淇濆瓨 + getSalaryAcctCalcTaxReqService(user).batchSave(salaryAcctCalcTaxReqs); + // 璁板綍鏃ュ織 + getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.CALC_TAX_ONLINE); + } + + @Override + public void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam) { + // 鏌ヨ渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + if (apiConfig == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "鎺ュ彛娴侀噺涓嶈冻锛屾殏鏃犳硶浣跨敤璇ュ姛鑳斤紝璇峰厛璐拱鏅鸿兘绠楄柂鎺ュ彛娴侀噺")); + } + // 鏌ヨ钖祫鏍哥畻璁板綍 + Long salaryAcctRecordId = salaryCalcTaxParam.getSalaryAcctRecordId(); + SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勮柂璧勬牳绠椾汉鍛 + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId()); + Map> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, e -> e.getTaxAgentId() + "-" + e.getIncomeCategory()); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勮柂璧勬牳绠楃粨鏋 + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + Map> salaryAcctResultValueMap = SalaryEntityUtil.list2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId, SalaryAcctResultPO::getSalaryItemId); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + List salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user) + .listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId())); + Map> salaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId); + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勫紓姝ョ畻绋庤姹傝褰 + List salaryAcctCalcTaxReqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecord.getId()); + if (CollectionUtils.isEmpty(salaryAcctCalcTaxReqs)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(268184, "璇峰厛璁$畻涓◣鍐嶈幏鍙栧弽棣")); + } + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勮柂璧勮处濂椾釜绋庡瓧娈靛搴 + List salarySobTaxRules = getSalarySobTaxRuleService(user).getSalarySobTaxRuleDTO(salaryAcctRecord.getSalarySobId()); + Map salarySobTaxRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxRules, SalarySobTaxRuleDTO::getIncomeCategoryId); + // 鏌ヨ鎶ラ佷汉鍛 + List employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents); + Map> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId); + + + List addResultPOS = new ArrayList<>(); + List updateResultPOS = new ArrayList<>(); + + for (SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq : salaryAcctCalcTaxReqs) { + CalculateClient calculateClient = new CalculateClient(salaryAcctCalcTaxReq.getTaxAgentId()); + GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse = calculateClient.getASynIndividualIncomeTaxFeedback(salaryAcctCalcTaxReq.getRequestId()); + + List subSalaryAcctTaxAgents = salaryAcctTaxAgentMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); + if (CollectionUtils.isEmpty(subSalaryAcctTaxAgents)) { + continue; + } + List subEmployeeDeclares = employeeDeclareMap.get(salaryAcctCalcTaxReq.getTaxAgentId()); + Date now = new Date(); + // 鑾峰彇涓嶅悓鎵寰楅」鐩殑涓◣ + for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : subSalaryAcctTaxAgents) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(salaryAcctTaxAgent.getIncomeCategory()); + if (incomeCategoryEnum == null) { + continue; + } + SalarySobTaxRuleDTO taxRuleDTO = salarySobTaxRuleMap.get(incomeCategoryEnum.getValue().toString()); + Map empIdResult; + try { + empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares, taxRuleDTO); + } catch (OnlineCalculateTaxException e) { + log.error("鑾峰彇鍦ㄧ嚎绠楃◣缁撴灉寮傚父", e); + getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); + throw new SalaryRunTimeException(e.getMessage()); + } + List subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory()); + if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) { + continue; + } + for (SalaryAcctEmployeePO salaryAcctEmployee : subSalaryAcctEmployees) { + Map salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId()); + if (salaryAcctResultValue == null) { + continue; + } + SalarySobTaxRuleDTO salarySobTaxRuleDTO = empIdResult.get(salaryAcctEmployee.getEmployeeId()); + if (salarySobTaxRuleDTO == null) { + continue; + } + List taxRules = salarySobTaxRuleDTO.getTaxRules(); + taxRules.stream() + .filter(rule -> rule.getSalaryItemId() != null) + .forEach(rule -> { + Long salaryItemId = rule.getSalaryItemId(); + SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salaryItemId); + if (salaryAcctResultPO != null) { + salaryAcctResultPO.setResultValue(rule.getValue()); + updateResultPOS.add(salaryAcctResultPO); + } else { + salaryAcctResultPO = SalaryAcctResultPO.builder() + .salaryAcctRecordId(salaryAcctRecordId) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(salaryItemId) + .resultValue(rule.getValue()) + .originResultValue("") + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build(); + addResultPOS.add(salaryAcctResultPO); + } + }); + } + } + } + + getSalaryAcctResultService(user).batchSave(addResultPOS); + getSalaryAcctResultService(user).batchUpdate(updateResultPOS); + getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId()); + // 璁板綍鏃ュ織 + getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.GET_CALC_TAX_FEEDBACK); + } +} diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 101f49c6d..154da1d18 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -91,7 +91,6 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return SqlProxyHandle.getProxy(ExpandFieldSettingsMapper.class); } - private ExtEmpService getExtEmpService(User user) { return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } @@ -633,6 +632,28 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return getEmployMapper().listByJob(jobIds); } + @Override + public Map mapByEmployeeIds(Collection employeeIds) { + List simpleUserInfos = getEmployeeByIdsAll(new ArrayList<>(employeeIds)); + Map result = new HashMap<>(); + simpleUserInfos.forEach(e -> { + result.put(e.getEmployeeId(), e.getIdNo()); + }); + return result; + } + + @Override + public List listByKeyword(String keyword) { + if (StringUtils.isBlank(keyword)) { + return Collections.emptyList(); + } + List result = getEmployMapper().listByKeyword(keyword); + if (openExtEmp) { + result.addAll(getExtEmpService(user).listByKeyword(keyword)); + } + return result; + } + @Override public JobCallInfo getJobCallInfoById(Long jobCallId) { if (jobCallId == null) { diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index f6b895a9b..3b942283f 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -87,6 +87,19 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe } } + @Override + public List listAllExpressFormula() { + List expressFormulas = getFormulaMapper().listAll(); + + return expressFormulas.stream().filter(Objects::nonNull).map(m -> { + ExpressFormula expressFormula = new ExpressFormula(); + BeanUtils.copyProperties(m, expressFormula); + List formulaVarPOS = getFormulaVarMapper().listSome(FormulaVar.builder().formulaId(m.getId()).build()); + expressFormula.setParameters(formulaVarPOS); + return expressFormula; + }).collect(Collectors.toList()); + } + @Override public ExpressFormula getExpressFormula(Long formulaId) { if (formulaId == null || formulaId <= 0) { diff --git a/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java new file mode 100644 index 000000000..29d6af22d --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -0,0 +1,178 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobAddUpRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.engine.salary.util.db.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.lang.reflect.Field; +import java.util.*; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobAddUpRuleServiceImpl extends Service implements SalarySobAddUpRuleService { + + private SalarySobAddUpRuleMapper getSalarySobAddUpRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobAddUpRuleMapper.class); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + @Override + public List listBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return new ArrayList<>(); + } + return getSalarySobAddUpRuleMapper().listSome(SalarySobAddUpRulePO.builder().salarySobIds(salarySobIds).build()); + } + + @Override + public List listSalarySobAddUpRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 鏌ヨ钖祫璐﹀ + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + // 钖祫璐﹀鐨勬敹鍏ユ墍寰楅」鐩 + Integer incomeCategoryId = salarySob.getIncomeCategory(); + // 钖祫璐﹀鐨勮柂璧勯」鐩 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 钖祫璐﹀鐨勫洖绠楄柂璧勯」鐩 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 钖祫椤圭洰 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 钖祫璐﹀鐨勫凡缁忓瓨鍦ㄧ殑瀵瑰簲鍏崇郴 + List salarySobAddUpRulePOS = listBySalarySobIds(Collections.singleton(salarySobId)); + Map salarySobAddUpMap = SalaryEntityUtil.convert2Map(salarySobAddUpRulePOS, + e -> e.getIncomeCategory() + "-" + e.getAddUpColumnDataIndex(), SalarySobAddUpRulePO::getSalaryItemId); + + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + if (incomeCategoryEnum != IncomeCategoryEnum.WAGES_AND_SALARIES + && incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN + && incomeCategoryEnum != IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER + && incomeCategoryEnum != IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR) { + return resultList; + } + List addUpRules = Lists.newArrayList(); + Field[] declaredFields = AddUpSituation.class.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { + continue; + } + SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class); + SalarySobAddUpRuleDTO.AddUpRuleDTO addUpRuleDTO = new SalarySobAddUpRuleDTO.AddUpRuleDTO(); + addUpRuleDTO.setId(IdGenerator.generate()); + addUpRuleDTO.setAddUpColumnName(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel())); + addUpRuleDTO.setAddUpColumnDataIndex(declaredField.getName()); + addUpRuleDTO.setSalaryItem(Collections.emptyList()); + addUpRuleDTO.setCanEdit(true); + + Long salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + declaredField.getName()); + if(salaryItemId == null){ + //寰鏈熺疮璁″睘鎬у悕鍜岄」鐩悕涓嶅尮閰嶏紝閲囩敤鍒悕 + salaryItemId = salarySobAddUpMap.get(incomeCategoryId + "-" + annotation.alias()); + } + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", salaryItem.getId().toString()); + dataMap.put("name", salaryItem.getName()); + dataMap.put("icon", "Icon-N-Salary-item-management"); + addUpRuleDTO.setSalaryItem(Collections.singletonList(dataMap)); + } + addUpRules.add(addUpRuleDTO); + } + SalarySobAddUpRuleDTO salarySobAddUpRuleDTO = new SalarySobAddUpRuleDTO(); + salarySobAddUpRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobAddUpRuleDTO.setIncomeCategoryName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobAddUpRuleDTO.setAddUpRules(addUpRules); + resultList.add(salarySobAddUpRuleDTO); + return resultList; + } + + @Override + public void saveByParam(SalarySobAddUpRuleSaveParam saveParam) { + // 鏍¢獙鍙傛暟鏄惁鍚堟硶 + // 鏍规嵁淇濆瓨鍙傛暟鏋勫缓鍑簆o + Date now = new Date(); + List salarySobAddUpRulePOS = Lists.newArrayList(); + for (SalarySobAddUpRuleSaveParam.AddUpRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobAddUpRuleSaveParam.AddUpRuleParam addUpRuleParam : incomeCategoryParam.getAddUpRuleParams()) { + SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO(); + salarySobAddUpRulePO.setId(IdGenerator.generate()); + salarySobAddUpRulePO.setSalarySobId(saveParam.getSalarySobId()); + salarySobAddUpRulePO.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobAddUpRulePO.setSalaryItemId(addUpRuleParam.getSalaryItemId()); + salarySobAddUpRulePO.setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex()); + salarySobAddUpRulePO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobAddUpRulePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobAddUpRulePO.setCreator((long) user.getUID()); + salarySobAddUpRulePO.setCreateTime(now); + salarySobAddUpRulePO.setUpdateTime(now); + salarySobAddUpRulePOS.add(salarySobAddUpRulePO); + } + } + // 鍒犻櫎鍘熸潵鐨勯厤缃紝淇濆瓨鏂扮殑 + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobAddUpRulePOS)) { + saveBatch(salarySobAddUpRulePOS); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isNotEmpty(salarySobIds)) { + getSalarySobAddUpRuleMapper().deleteBySalarySobIds(salarySobIds); + } + } + + @Override + public void saveBatch(List salarySobAddUpRules) { + if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { + salarySobAddUpRules.forEach(o -> getSalarySobAddUpRuleMapper().insertIgnoreNull(o)); + } + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java index aa63617a8..1df38c8b8 100644 --- a/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobDefaultEmpFieldServiceImpl.java @@ -1,6 +1,12 @@ package com.engine.salary.service.impl; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO; +import com.engine.salary.mapper.salarysob.SalarySobDefaultEmpFieldMapper; import com.engine.salary.service.SalarySobDefaultEmpFieldService; +import com.engine.salary.util.db.MapperProxyFactory; + +import java.util.List; /** * 钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 @@ -10,17 +16,14 @@ import com.engine.salary.service.SalarySobDefaultEmpFieldService; * @author qiantao * @version 1.0 **/ -public class SalarySobDefaultEmpFieldServiceImpl implements SalarySobDefaultEmpFieldService { +public class SalarySobDefaultEmpFieldServiceImpl extends Service implements SalarySobDefaultEmpFieldService { -// -// private SalarySobDefaultEmpFieldMapper salarySobDefaultEmpFieldMapper; -// -// @Override -// public List list() { -// -// return new LambdaQueryChainWrapper<>(salarySobDefaultEmpFieldMapper) -// .eq(SalarySobDefaultEmpFieldPO::getTenantKey, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) -// .eq(SalarySobDefaultEmpFieldPO::getDeleteType, 0) -// .list(); -// } + private SalarySobDefaultEmpFieldMapper getSalarySobDefaultEmpFieldMapper() { + return MapperProxyFactory.getProxy(SalarySobDefaultEmpFieldMapper.class); + } + + @Override + public List list() { + return getSalarySobDefaultEmpFieldMapper().listAll(); + } } diff --git a/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java new file mode 100644 index 000000000..2d41dfbb7 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobDefaultItemGroupServiceImpl.java @@ -0,0 +1,31 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.salarysob.SalarySobDefaultItemGroupMapper; +import com.engine.salary.service.SalarySobDefaultItemGroupService; +import com.engine.salary.util.SalaryEntityUtil; +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.stream.Collectors; + +public class SalarySobDefaultItemGroupServiceImpl extends Service implements SalarySobDefaultItemGroupService { + + private SalarySobDefaultItemGroupMapper getSalarySobDefaultItemGroupMapper() { + return MapperProxyFactory.getProxy(SalarySobDefaultItemGroupMapper.class); + } + + @Override + public List listByIncomeCategoryIn(Collection incomeCategories) { + if (CollectionUtils.isEmpty(incomeCategories)) { + return Collections.emptyList(); + } + List incomeCategoryValues = SalaryEntityUtil.properties(incomeCategories, IncomeCategoryEnum::getValue, Collectors.toList()); + return getSalarySobDefaultItemGroupMapper().listSome(SalarySobDefaultItemGroupPO.builder().incomeCategorys(incomeCategoryValues).build()); + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java new file mode 100644 index 000000000..2dc977dee --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -0,0 +1,395 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.bo.SalarySobInitEnv; +import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; +import com.engine.salary.entity.salarysob.po.*; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.engine.salary.util.db.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import weaver.hrm.User; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 钖祫璐﹀鍒濆鍖 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { + + private SalarySobMapper getSalarySobMapper() { + return MapperProxyFactory.getProxy(SalarySobMapper.class); + } + + private SalarySobDefaultEmpFieldService getSalarySobDefaultEmpFieldService(User user) { + return ServiceUtil.getService(SalarySobDefaultEmpFieldServiceImpl.class, user); + } + + private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) { + return ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user); + } + + private SalarySobDefaultItemGroupService getSalarySobDefaultItemGroupService(User user) { + return ServiceUtil.getService(SalarySobDefaultItemGroupServiceImpl.class, user); + } + + private SalarySobDefaultItemService getSalarySobDefaultItemService(User user) { + return ServiceUtil.getService(SalarySobDefaultItemServiceImpl.class, user); + } + + private SysSalaryItemService getSysSalaryItemService(User user) { + return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemGroupService getSalarySobItemGroupService(User user) { + return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + @Override + protected void initBasic(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + // 鍥犱负钖祫璐﹀鐨勩屽悕绉般嶆敮鎸佷簡"灏忓湴鐞"锛屾墍浠ュ湪鎵撳紑鏂板缓琛ㄥ崟鏃讹紝鍚庣灏变細灏唅d浼犵粰鍓嶇锛屾墍浠ユ柊寤轰繚瀛樼殑鏃跺欏墠绔槸浼氬皢id浼犵粰鍚庣鐨 + // 褰撳墠绔湭灏唅d浼犵粰鍚庣鏃讹紝鍚庣鑷姩鐢熸垚涓涓猧d + SalarySobBasicSaveParam saveParam = env.getSaveParam(); + if (saveParam.getId() == null) { + saveParam.setId(IdGenerator.generate()); + } + + Date now = new Date(); + SalarySobPO salarySob = new SalarySobPO() +// .setId(saveParam.getId()) + .setTaxAgentId(saveParam.getTaxAgentIds().get(0)) + .setName(saveParam.getName()) + .setIncomeCategory(saveParam.getTaxableItems()) + .setSalaryCycleType(saveParam.getSalaryCycleType()) + .setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay()) + .setTaxCycleType(saveParam.getTaxCycleType()) + .setAttendCycleType(saveParam.getAttendCycleType()) + .setAttendCycleFromDay(saveParam.getAttendCycleFromDay()) + .setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType()) + .setDisable(0) + .setDescription(saveParam.getDescription()) +// .setOriginSalarySobId(saveParam.getId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now); + getSalarySobMapper().insertIgnoreNull(salarySob); + env.setSalarySob(salarySob); + } + + @Override + protected void initEmpField(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + // 鏌ヨ钖祫璐﹀榛樿鐨勫憳宸ヤ俊鎭瓧娈 + List salarySobDefaultEmpFields = getSalarySobDefaultEmpFieldService(user).list(); + + Date now = new Date(); + List salarySobEmpFields = salarySobDefaultEmpFields.stream() + .map(field -> new SalarySobEmpFieldPO() +// .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setFieldCode(field.getFieldCode()) + .setSortedIndex(field.getSortedIndex()) + .setCanDelete(field.getCanDelete()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .setUpdateTime(now)) + .collect(Collectors.toList()); + getSalarySobEmpFieldService(user).batchSave(salarySobEmpFields); + } + + @Override + protected void initItem(SalarySobInitEnv env) { + if (env == null || env.getSaveParam() == null || env.getCurrentUser() == null) { + throw new SalaryRunTimeException("Invalid arguments"); + } + Date now = new Date(); + // 鏍规嵁鎵寰楅」鐩煡璇㈤粯璁ょ殑璐﹀钖祫椤圭洰鍒嗙粍 + List salarySobDefaultItemGroups = getSalarySobDefaultItemGroupService(user) + .listByIncomeCategoryIn(Collections.singletonList(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems()))); + // 鏍规嵁鎵寰楅」鐩煡璇㈤粯璁ょ殑璐﹀钖祫椤圭洰 + List salarySobDefaultItems = getSalarySobDefaultItemService(user) + .listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems())); + // 鏍规嵁榛樿鐨勮处濂楄柂璧勯」鐩煡璇㈠叧鑱旂殑绯荤粺钖祫椤圭洰id + Set sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItems, + SalarySobDefaultItemPO::getSysSalaryItemId); + List sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds); + Map sysSalaryItemMap = SalaryEntityUtil.convert2Map(sysSalaryItems, SysSalaryItemPO::getId); + // 鏍规嵁绯荤粺钖祫椤圭洰id鏌ヨ褰撳墠绉熸埛鐨勮嚜瀹氫箟钖祫椤圭洰 + // 濡傛灉榛樿鐨勮处濂楄柂璧勯」鐩煡璇㈠叧鑱旂殑绯荤粺钖祫椤圭洰id娌℃湁鐢熸垚鑷畾涔夎柂璧勯」鐩紝闇瑕佽嚜鍔ㄧ敓鎴愬搴旂殑鑷畾涔夎柂璧勯」鐩 + List needInsertSalaryItems = new ArrayList<>(); + List salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds); + // key:绯荤粺钖祫椤圭洰id;value:钖祫椤圭洰po + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, + SalaryItemPO::getSysSalaryItemId); + for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) { + salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> { + SalaryItemPO salaryItem = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID()); + needInsertSalaryItems.add(salaryItem); + return salaryItem; + }); + } + + // key:榛樿鐨勮处濂楄柂璧勯」鐩垎缁刬d;value:璐﹀钖祫椤圭洰鍒嗙粍po + Map salarySobItemGroupMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroups.size()); + // 閬嶅巻榛樿鐨勮处濂楄柂璧勯」鐩垎缁勶紝鐢熸垚璐﹀钖祫椤圭洰鍒嗙粍po + for (SalarySobDefaultItemGroupPO salarySobDefaultItemGroup : salarySobDefaultItemGroups) { + SalarySobItemGroupPO salarySobItemGroup = SalarySobItemGroupPO.builder() + .id(IdGenerator.generate()) + .name(salarySobDefaultItemGroup.getName()) + .salarySobId(env.getSalarySob().getId()) + .sortedIndex(salarySobDefaultItemGroup.getSortedIndex()) + .description(salarySobDefaultItemGroup.getDescription()) +// .incomeCategory(salarySobDefaultItemGroup.getIncomeCategory().toString()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobItemGroupMap.put(salarySobDefaultItemGroup.getId(), salarySobItemGroup); + } + + List salarySobItems = new ArrayList<>(salarySobDefaultItems.size()); + // 閬嶅巻榛樿鐨勮处濂楄柂璧勯」鐩紝鐢熸垚璐﹀钖祫椤圭洰po + for (SalarySobDefaultItemPO salarySobDefaultItem : salarySobDefaultItems) { + // 璐﹀钖祫椤圭洰鍒嗙粍 + SalarySobItemGroupPO salarySobItemGroup = salarySobItemGroupMap.get(salarySobDefaultItem.getSobDefaultItemGroupId()); + // 鍏宠仈鐨勮柂璧勯」鐩佺郴缁熻柂璧勯」鐩 + SalaryItemPO salaryItem = salaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId()); + SysSalaryItemPO sysSalaryItem = sysSalaryItemMap.get(salarySobDefaultItem.getSysSalaryItemId()); + if (salaryItem == null || sysSalaryItem == null) { + throw new SalaryRunTimeException("Invalid arguments,salaryItem can not be null"); + } + SalarySobItemPO salarySobItem = SalarySobItemPO.builder() +// .id(IdGenerator.generate()) + .salarySobId(env.getSalarySob().getId()) + .incomeCategory(salarySobDefaultItem.getIncomeCategory().toString()) + .salaryItemId(salaryItem.getId()) + .salaryItemCode(salaryItem.getCode()) + .salarySobItemGroupId(Optional.ofNullable(salarySobItemGroup).map(SalarySobItemGroupPO::getId).orElse(0L)) +// .useInEmployeeSalary(0) +// .dataType(salaryItem.getDataType()) +// .roundingMode(sysSalaryItem.getRoundingMode()) +// .pattern(sysSalaryItem.getPattern()) +// .valueType(sysSalaryItem.getValueType()) + .formulaId(sysSalaryItem.getFormulaId()) +// .hideSwitch(0) +// .sumSwitch(0) +// .readonlySwitch(0) + .sortedIndex(salarySobDefaultItem.getSortedIndex()) + .description(salaryItem.getDescription()) +// .canEdit(1) + .canDelete(1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobItems.add(salarySobItem); + } + if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) { + getSalaryItemService(user).batchSave(needInsertSalaryItems); + } + if (MapUtils.isNotEmpty(salarySobItemGroupMap)) { + getSalarySobItemGroupService(user).batchSave(salarySobItemGroupMap.values()); + } + if (CollectionUtils.isNotEmpty(salarySobItems)) { + getSalarySobItemService(user).batchSave(salarySobItems); + } + env.setSalarySobItems(salarySobItems); + } + + @Override + protected void initBackItem(SalarySobInitEnv env) { + // 鍙湁銆屾甯稿伐璧勮柂閲戙嶆墠榛樿鐢熸垚鍥炵畻钖祫椤圭洰 + boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + if (!contains) { + return; + } + // 746777981115629575L--宸插彂钖祫鍚堣 + // 746777981115629576L--琛ュ彂钖祫鍚堣 + List sysSalaryItemIds = Lists.newArrayList(746777981115629575L, 746777981115629576L); + List sysSalaryItems = getSysSalaryItemService(user).listByIds(sysSalaryItemIds); + // 鏍规嵁绯荤粺钖祫椤圭洰id鏌ヨ褰撳墠绉熸埛鐨勮嚜瀹氫箟钖祫椤圭洰 + // 濡傛灉榛樿鐨勮处濂楄柂璧勯」鐩煡璇㈠叧鑱旂殑绯荤粺钖祫椤圭洰id娌℃湁鐢熸垚鑷畾涔夎柂璧勯」鐩紝闇瑕佽嚜鍔ㄧ敓鎴愬搴旂殑鑷畾涔夎柂璧勯」鐩 + List salaryItems = getSalaryItemService(user).listBySysSalaryItemIds(sysSalaryItemIds); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getSysSalaryItemId); + + Date now = new Date(); + List needInsertSalaryItems = new ArrayList<>(); + List salarySobBackItems = new ArrayList<>(); + for (SysSalaryItemPO sysSalaryItem : sysSalaryItems) { + SalaryItemPO salaryItem = salaryItemMap.computeIfAbsent(sysSalaryItem.getId(), key -> { + SalaryItemPO temp = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItem, now, (long) env.getCurrentUser().getUID()); + needInsertSalaryItems.add(temp); + return temp; + }); + SalarySobBackItemPO salarySobBackItem = SalarySobBackItemPO.builder() + .id(IdGenerator.generate()) + .salarySobId(env.getSalarySob().getId()) +// .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()) + .salaryItemId(salaryItem.getId()) + .salaryItemCode(salaryItem.getCode()) + .dataType(salaryItem.getDataType()) + .roundingMode(sysSalaryItem.getRoundingMode()) + .pattern(sysSalaryItem.getPattern()) + .valueType(sysSalaryItem.getValueType()) + .formulaId(sysSalaryItem.getFormulaId()) +// .hideSwitch(0) +// .sumSwitch(0) +// .readonlySwitch(0) +// .sortedIndex(0) + .backCalcType(Objects.equals(sysSalaryItem.getId(), 746777981115629575L) ? 0 : 1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) +// .breator((long) env.getCurrentUser().getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + salarySobBackItems.add(salarySobBackItem); + } + if (CollectionUtils.isNotEmpty(needInsertSalaryItems)) { + getSalaryItemService(user).batchSave(needInsertSalaryItems); + } + if (CollectionUtils.isNotEmpty(salarySobBackItems)) { + getSalarySobBackItemService(user).batchInsert(salarySobBackItems); + } + } + + @Override + protected void initAddUpRule(SalarySobInitEnv env) { + // 鍙湁銆屾甯稿伐璧勮柂閲戙嶆墠榛樿鐢熸垚绱瀛楁瀵瑰簲瑙勫垯 + boolean contains = Objects.equals(env.getSaveParam().getTaxableItems(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + if (!contains) { + return; + } + Date now = new Date(); + List salarySobAddUpRules = new ArrayList<>(); + // 璐﹀钖祫椤圭洰 + List salarySobItems = env.getSalarySobItems().stream() + .filter(e -> Objects.equals(e.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString())) + .collect(Collectors.toList()); + // AddUpSituationPO.class甯︽湁SalaryFormulaVar.class娉ㄨВ瀛楁鐨刵ame鍜岃处濂楄柂璧勯」鐩殑code閮芥槸瀵瑰簲鐨勶紝闄や簡銆宎ddUpAdvanceTax銆 + // 閬嶅巻AddUpSituationPO.class鐨凷alaryFormulaVar.class娉ㄨВ锛岀敓鎴愮疮璁″瓧娈靛搴旇鍒檖o + Map salarySobItemMap = SalaryEntityUtil.convert2Map(salarySobItems, + SalarySobItemPO::getSalaryItemCode); + for (Field declaredField : AddUpSituation.class.getDeclaredFields()) { + SalarySobItemPO salarySobItem = salarySobItemMap.get(declaredField.getName()); + 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; + } + SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO(); + salarySobAddUpRule.setId(IdGenerator.generate()); + salarySobAddUpRule.setSalarySobId(env.getSalarySob().getId()); + salarySobAddUpRule.setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()); + salarySobAddUpRule.setSalaryItemId(salarySobItem.getSalaryItemId()); + salarySobAddUpRule.setAddUpColumnDataIndex(declaredField.getName()); + salarySobAddUpRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobAddUpRule.setCreator((long) env.getCurrentUser().getUID()); + salarySobAddUpRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobAddUpRule.setCreateTime(now); + salarySobAddUpRule.setUpdateTime(now); + salarySobAddUpRules.add(salarySobAddUpRule); + } + if (CollectionUtils.isNotEmpty(salarySobAddUpRules)) { + getSalarySobAddUpRuleService(user).saveBatch(salarySobAddUpRules); + } + } + + @Override + protected void initTaxReportRule(SalarySobInitEnv env) { + // 鏌ヨ涓◣鐢虫姤琛ㄧ殑琛ㄥご + List taxReportColumns = new ArrayList<>(getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(env.getSaveParam().getTaxableItems()))); + Date now = new Date(); + // 涓◣鐢虫姤琛ㄨ〃澶寸殑reportColumnDataIndex鍜岃处濂楄柂璧勯」鐩殑code閮芥槸瀵瑰簲鐨 + // 閬嶅巻涓◣鐢虫姤琛ㄧ殑琛ㄥご锛岀敓鎴愪釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲瑙勫垯po + List salarySobTaxReportRules = Lists.newArrayList(); + Map salarySobItemMap = SalaryEntityUtil.convert2Map(env.getSalarySobItems(), + e -> e.getIncomeCategory() + "-" + e.getSalaryItemCode()); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + SalarySobItemPO salarySobItem = salarySobItemMap.get(taxReportColumn.getIncomeCategory() + "-" + taxReportColumn.getReportColumnDataIndex()); + if (Objects.nonNull(salarySobItem)) { + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO(); + salarySobTaxReportRule.setId(IdGenerator.generate()); + salarySobTaxReportRule.setSalarySobId(env.getSalarySob().getId()); + salarySobTaxReportRule.setIncomeCategory(salarySobItem.getIncomeCategory()); + salarySobTaxReportRule.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()); + salarySobTaxReportRule.setSalaryItemId(salarySobItem.getSalaryItemId()); + salarySobTaxReportRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxReportRule.setCreator((long) env.getCurrentUser().getUID()); + salarySobTaxReportRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxReportRule.setCreateTime(now); + salarySobTaxReportRule.setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxReportRule); + } + } + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + getSalarySobTaxReportRuleService(user).saveBatch(salarySobTaxReportRules); + } + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 9f68de3ae..29345763f 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -9,15 +9,32 @@ import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.AddUpDeduction; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.datacollection.dto.AttendQuoteDataDTO; +import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; +import com.engine.salary.entity.datacollection.po.OtherDeductionPO; +import com.engine.salary.entity.datacollection.po.VariableItemPO; +import com.engine.salary.entity.salaryacct.bo.CalculateFormulaVarBO; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculatePriorityBO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.config.FormluaConfig; import com.engine.salary.entity.salaryformula.po.FormulaPO; import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; +import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; @@ -25,23 +42,30 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; +import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; import com.engine.salary.mapper.salarysob.SalarySobItemMapper; import com.engine.salary.service.*; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; +import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.general.BaseBean; import weaver.hrm.User; +import java.time.Month; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -107,6 +131,64 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user); } + private SalaryAcctResultService getSalaryAcctResultService(User user) { + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + } +// private LoggerTemplate salarySobLoggerTemplate; + + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + } + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private SIAccountService getSIAccountService(User user) { + return ServiceUtil.getService(SIAccountServiceImpl.class, user); + } + + private AttendQuoteFieldService getAttendQuoteFieldService(User user) { + return ServiceUtil.getService(AttendQuoteFieldServiceImpl.class, user); + } + + private VariableItemService getVariableItemService(User user) { + return ServiceUtil.getService(VariableItemServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + private AddUpSituationService getAddUpSituationService(User user) { + return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); + } + + private AddUpDeductionService getAddUpDeductionService(User user) { + return ServiceUtil.getService(AddUpDeductionServiceImpl.class, user); + } + + private OtherDeductionService getOtherDeductionService(User user) { + return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); + } + + private AttendQuoteDataService getAttendQuoteDataService(User user) { + return ServiceUtil.getService(AttendQuoteDataServiceImpl.class, user); + } + + private VariableArchiveService getVariableArchiveService(User user) { + return ServiceUtil.getService(VariableArchiveServiceImpl.class, user); + } + + @Override public List list() { return salarySobItemMapper.listAll(); @@ -366,6 +448,8 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Date now = new Date(); Long salarySobId = saveParam.getSalarySobId(); + SalarySobPO sob = salarySobBiz.getById(salarySobId); + String incomeCategory = sob.getIncomeCategory() == null ? "1" : sob.getIncomeCategory().toString(); List itemGroups = saveParam.getItemGroups(); List newGroupIds = SalaryEntityUtil.properties(itemGroups, SalarySobItemSaveParam.SalarySobItemGroupParam::getId, Collectors.toList()); List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salarySobId); @@ -389,7 +473,27 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (SalarySobItemSaveParam.SalarySobItemParam itemParam : itemGroupParam.getItems()) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemId(itemParam.getSalaryItemId()).salarySobItemGroupId(salarySobItemGroupId).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() + .salarySobId(salarySobId) + .incomeCategory(incomeCategory) + .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) + .salarySobItemGroupId(salarySobItemGroupId) + .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) + .sortedIndex(itemParam.getSortedIndex()) + .description(StringUtils.EMPTY) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) + .roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()) + .pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()) + .valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()) + .itemHide(itemParam.getItemHide()) + .defaultValue(itemParam.getDefaultValue()) + .build(); salarySobItems.add(salarySobItemPO); } } @@ -413,13 +517,49 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe //鏂板 for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needAddItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemId(itemParam.getSalaryItemId()).salarySobItemGroupId(groupId).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).deleteType(NumberUtils.INTEGER_ZERO).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() + .salarySobId(salarySobId) + .incomeCategory(incomeCategory) + .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) + .salarySobItemGroupId(groupId) + .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) + .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) + .sortedIndex(itemParam.getSortedIndex()) + .description(StringUtils.EMPTY) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(NumberUtils.INTEGER_ZERO) + .roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()) + .pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()) + .valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()) + .itemHide(itemParam.getItemHide()) + .defaultValue(itemParam.getDefaultValue()) + .build(); salarySobItems.add(salarySobItemPO); } //鏇存柊 for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needUpdateItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).salaryItemId(itemParam.getSalaryItemId()).salarySobItemGroupId(groupId).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() + .id(itemParam.getId()) + .incomeCategory(incomeCategory) + .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) + .salarySobItemGroupId(groupId) + .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) + .sortedIndex(itemParam.getSortedIndex()) + .canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()) + .pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()) + .valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()) + .itemHide(itemParam.getItemHide()) + .defaultValue(itemParam.getDefaultValue()) + .build(); getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); } @@ -446,13 +586,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needAddItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemId(itemParam.getSalaryItemId()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().salarySobId(salarySobId).incomeCategory(incomeCategory).salaryItemId(itemParam.getSalaryItemId()).salaryItemCode(salaryItemPO.getCode()).salarySobItemGroupId(NumberUtils.LONG_ZERO).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).description(StringUtils.EMPTY).creator(employeeId).createTime(now).updateTime(now).deleteType(NumberUtils.INTEGER_ZERO).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); salarySobItems.add(salarySobItemPO); } for (SalarySobItemSaveParam.SalarySobItemParam itemParam : needUpdateItems) { SalaryItemPO salaryItemPO = checkItemExists(itemParam.getSalaryItemId(), salaryItemsMap); - SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); + SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder().id(itemParam.getId()).incomeCategory(incomeCategory).formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)).sortedIndex(itemParam.getSortedIndex()).updateTime(now).canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)).roundingMode(itemParam.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : itemParam.getRoundingMode()).pattern(itemParam.getPattern() == null ? salaryItemPO.getPattern() : itemParam.getPattern()).valueType(itemParam.getValueType() == null ? salaryItemPO.getValueType() : itemParam.getValueType()).itemHide(itemParam.getItemHide()).defaultValue(itemParam.getDefaultValue()).build(); getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); } @@ -551,7 +691,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } salarySobItemPO.setFormula(formulaPO); } - if(SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getSalaryItemId())){ + if (SalaryEntityUtil.isNotNullOrEmpty(salarySobItemPO.getSalaryItemId())) { SalaryItemPO salaryItemPO = itemIdMap.get(salarySobItemPO.getSalaryItemId()); salarySobItemPO.setSalaryItem(salaryItemPO); } @@ -599,7 +739,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe salarySobItemFormDTO .setId(salarySobItemPO.getId()) .setName(salaryItemPO.getName()) - .setItemHide(salarySobItemPO.getItemHide()==null?0:Integer.parseInt(salarySobItemPO.getItemHide().toString())) + .setItemHide(salarySobItemPO.getItemHide() == null ? 0 : Integer.parseInt(salarySobItemPO.getItemHide().toString())) .setDataType(salaryItemPO.getDataType()) .setRoundingMode(salarySobItemPO.getRoundingMode() == null ? salaryItemPO.getRoundingMode() : salarySobItemPO.getRoundingMode()) .setPattern(salarySobItemPO.getPattern() == null ? salaryItemPO.getPattern() : salarySobItemPO.getPattern()) @@ -614,4 +754,308 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe } return salarySobItemFormDTO; } + + /** + * 鎷撴墤鍥 + * + * @param param + * @return + */ + @Override + public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { + + // 鏌ヨ钖祫璐﹀ + SalarySobPO salarySobPO = salarySobBiz.getById(param.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "鍙傛暟閿欒锛岃柂璧勮处濂椾笉瀛樺湪鎴栬呭凡琚垹闄")); + } + // 鏌ヨ钖祫椤圭洰 + List salarySobItemPOS = getSalarySobItemMapper().listSome(SalarySobItemPO.builder().salarySobId(param.getSalarySobId()).salaryItemId(param.getSalaryItemId()).build()); + if (CollectionUtils.isEmpty(salarySobItemPOS)) { + throw new SalaryRunTimeException("璐﹀涓柂璧勯」鐩笉瀛樺湪"); + } + SalarySobItemPO salarySobItemPO = salarySobItemPOS.get(0); + + + //鎵鏈夎柂璧勯」鐩 + TopologyData topologyData = init(param); + SalaryItemPO salaryItemPO = topologyData.getSalaryItemPO(); + + // 鑾峰彇钖祫椤圭洰鍏紡 + ExpressFormula expressFormula = getSalaryFormulaService(user).getExpressFormula(salarySobItemPO.getFormulaId()); + + SalaryItemTopologyDTO salaryItemTopologyDTO = new SalaryItemTopologyDTO(); + salaryItemTopologyDTO.setSalaryItemId(salaryItemPO.getId()); + salaryItemTopologyDTO.setSalaryItemName(salaryItemPO.getName()); + salaryItemTopologyDTO.setFormula(expressFormula); + salaryItemTopologyDTO.setResult(topologyData.getResultItemMap().getOrDefault(SalaryFormulaReferenceEnum.SALARY_ITEM.getValue() + "_" + salaryItemPO.getCode(), "")); + + topology(salaryItemTopologyDTO, topologyData); + + return salaryItemTopologyDTO; + } + + @Override + public void checkLoop(Long salarySobId) { + // 鏌ヨ钖祫椤圭洰鍓湰 + List salarySobItemPOS = listBySalarySobId(salarySobId); + // 鏌ヨ钖祫椤圭洰 + List salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId, Collectors.toList()); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + // 鏌ヨ鍏紡璇︽儏 + List formulaIds = SalaryEntityUtil.properties(salaryItems, SalaryItemPO::getFormulaId, Collectors.toList()); + List expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItems, expressFormulas, new ArrayList<>(), new HashSet<>()); + } + + /** + * 閫掑綊鎷撴墤 + * + * @param salaryItemTopologyDTO + * @param topologyData + */ + private void topology(SalaryItemTopologyDTO salaryItemTopologyDTO, TopologyData topologyData) { + Long salaryItemId = topologyData.getSalaryItemId(); + Map salaryItemIdMap = topologyData.getSalaryItemIdMap(); + Map salaryItemCodeMap = topologyData.getSalaryItemCodeMap(); + Map salarySobItemCodeMap = topologyData.getSalarySobItemCodeMap(); + Map expressFormulaIdMap = topologyData.getExpressFormulaIdMap(); + + ExpressFormula formula = salaryItemTopologyDTO.getFormula(); + if (formula != null) { + List parameters = formula.getParameters(); + if (CollectionUtils.isNotEmpty(parameters)) { + List salaryItemTopologyDTOChildren = new ArrayList<>(); + for (int i = 0; i < parameters.size(); i++) { + FormulaVar formulaVar = parameters.get(i); + String source = formulaVar.getSource(); + String fieldId = formulaVar.getFieldId(); + String code = fieldId.replace(source + "_", ""); + String name = formulaVar.getName(); + String fieldName = formulaVar.getFieldName(); + //鏄惁鏄柂璧勯」鐩 + boolean isSalaryItemVar; + SalaryFormulaReferenceEnum salaryFormulaReferenceEnum = SalaryFormulaReferenceEnum.parseByValue(source); + if (salaryFormulaReferenceEnum == null) { + SalarySQLReferenceEnum referenceEnum = SalarySQLReferenceEnum.parseByValue(source); + if (referenceEnum == null) { + isSalaryItemVar = false; + } else { + isSalaryItemVar = referenceEnum == SalarySQLReferenceEnum.SALARY_ITEM; + } + } else { + isSalaryItemVar = salaryFormulaReferenceEnum == SalaryFormulaReferenceEnum.SALARY_ITEM; + } + + ExpressFormula expressFormula; + if (salarySobItemCodeMap.containsKey(code)) { + // 濡傛灉钖祫璐﹀涓嬮噸鏂板畾涔変簡钖祫椤圭洰鐨勫叕寮忥紝鍒欎娇鐢ㄨ柂璧勮处濂椾笅鐨勫叕寮忥紝鍚﹀垯浣跨敤钖祫椤圭洰鏈韩鐨勫叕寮 + expressFormula = expressFormulaIdMap.get(salarySobItemCodeMap.get(code).getFormulaId()); + } else if (salaryItemCodeMap.containsKey(code)) { + expressFormula = expressFormulaIdMap.get(salaryItemCodeMap.get(code).getFormulaId()); + } else { + expressFormula = null; + } + + SalaryItemPO salaryItemChild = isSalaryItemVar ? salaryItemCodeMap.get(code) : new SalaryItemPO(); + + SalaryItemTopologyDTO salaryItemTopologyChild = new SalaryItemTopologyDTO(); + salaryItemTopologyChild.setSalaryItemId(isSalaryItemVar ? salaryItemChild.getId() : null); + salaryItemTopologyChild.setSalaryItemName(isSalaryItemVar ? salaryItemChild.getName() : fieldName); + salaryItemTopologyChild.setFormula(expressFormula); + salaryItemTopologyChild.setResult(topologyData.getResultItemMap().getOrDefault(fieldId, "")); + salaryItemTopologyDTOChildren.add(salaryItemTopologyChild); + + if (isSalaryItemVar) { + SalaryItemPO salaryItemChildChild = salaryItemCodeMap.get(code); + SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemChildChild.getValueType()); + if (salaryValueTypeEnum != SalaryValueTypeEnum.INPUT) { + topologyData.setSalaryItemId(salaryItemChildChild.getId()); + topology(salaryItemTopologyChild, topologyData); + } + } + + } + salaryItemTopologyDTO.setChildren(salaryItemTopologyDTOChildren); + } + } + } + + private TopologyData init(SalaryItemTopologyQueryParam param) { + TopologyData topologyData = new TopologyData(); + + //钖祫椤圭洰 + topologyData.setSalaryItemId(param.getSalaryItemId()); + List salaryItems = getSalaryItemService(user).listAll(); + + Map salaryItemIdMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + topologyData.setSalaryItemIdMap(salaryItemIdMap); + + Map salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getCode); + topologyData.setSalaryItemCodeMap(salaryItemCodeMap); + + SalaryItemPO salaryItemPO = salaryItemIdMap.get(topologyData.salaryItemId); + topologyData.setSalaryItemPO(salaryItemPO); + + //璐﹀椤圭洰 + List salarySobItems = listBySalarySobId(param.getSalarySobId()); + + Map salarySobItemCodeMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemCode); + topologyData.setSalarySobItemCodeMap(salarySobItemCodeMap); + + //鍏紡 + List expressFormulas = getSalaryFormulaService(user).listAllExpressFormula(); + + Map expressFormulaIdMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId); + topologyData.setExpressFormulaIdMap(expressFormulaIdMap); + + //钖祫缁撴灉 + Long acctEmpId = param.getAcctEmpId(); + if (acctEmpId != null) { + SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(acctEmpId); + List acctEmployeePOS = new ArrayList<>(); + acctEmployeePOS.add(acctEmployeePO); + + Long salaryAcctRecordId = acctEmployeePO.getSalaryAcctRecordId(); + + // 1銆佹煡璇㈣柂璧勬牳绠楄褰 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫鏍哥畻璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); + } + //鏌ヨ瀵瑰簲璐﹀ + SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫璐﹀涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); + } + + // 涓嶆槸鏌ヨ钖祫璐﹀涓嬪疄鏃剁殑钖祫椤圭洰锛岃屾槸鏌ヨ鍙戣捣钖祫鏍哥畻鏃跺瓨鍌ㄧ殑钖祫椤圭洰蹇収 + SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(salaryAcctRecordId); + + // 2銆佹煡璇㈣柂璧勬牳绠楄褰曠殑钖祫鍛ㄦ湡銆佽冨嫟鍛ㄦ湡绛 + SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordId); + // 3銆佹煡璇㈣柂璧勬牳绠楄褰曟墍鐢ㄨ柂璧勮处濂楃殑钖祫椤圭洰鍓湰 + List salarySobItemPOS = salaryAcctSobConfig.getSalarySobItems(); + // 鍥炵畻钖祫椤圭洰 + List salarySobBackItems = Collections.emptyList(); + if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), 1)) { + salarySobBackItems = salaryAcctSobConfig.getSalarySobBackItems(); + } + // 4銆佹煡璇㈠綋鍓嶇鎴风殑鎵鏈夎柂璧勯」鐩 + List salaryItemPOS = getSalaryItemService(user).listAll(); + // 6銆佹煡璇㈢ぞ淇濈鍒╃殑鎵鏈夊瓧娈 + Map welfareColumns = getSIAccountService(user).welfareColumns(); + // 7銆佹煡璇㈣冨嫟寮曠敤鐨勬墍鏈夊瓧娈 + List attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll(); + List variableItemPOS = getVariableItemService(user).listAll(); + + // 8銆佹煡璇㈠叕寮忚鎯 + Set formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId); + formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId)); + formulaIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getFormulaId)); + List formulas = getSalaryFormulaService(user).listExpressFormula(formulaIds); + // 鏈杩愮畻鐨勫洖绠楄柂璧勯」鐩墍娑夊強鐨勫彉閲 +// Set issuedFieldIds = getIssuedFieldIds(salarySobBackItems); + + // 10銆佹牴鎹甶d鏌ヨ鍏朵粬鍚堝苟璁$◣鐨勮柂璧勬牳绠楄褰 + List otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId()); + + // 12.3銆佺敓鎴愭湰娆¤繍绠楃殑key + String calculateKey = UUID.randomUUID().toString(); + // 12.5銆佸绾跨▼杩愮畻锛岃繍绠楃粨鏋滃瓨鏀惧湪涓存椂琛ㄤ腑 + SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO() + .setSalaryAcctRecordPO(salaryAcctRecordPO) + .setSalarySobPO(salarySobPO) + .setSalarySobCycleDTO(salarySobCycleDTO) + .setOtherSalaryAcctRecordPOS(otherSalaryAcctRecordPOS) + .setSalarySobItemPOS(salarySobItemPOS) + .setSalaryItemIdWithPriorityList(new ArrayList<>()) + .setExpressFormulas(formulas) + .setSalaryItemPOS(salaryItemPOS) + .setSalarySobAdjustRulePOS(new ArrayList<>()) + .setWelfareColumns(MapUtils.emptyIfNull(welfareColumns)) + .setAttendQuoteFieldListDTOS(attendQuoteFieldListDTOS) + .setSalaryAcctEmployeePOS(acctEmployeePOS) + .setIssuedFieldIds(new HashSet<>()) + .setResults(null) + .setCalculateKey(calculateKey) + .setVariableItems(variableItemPOS) + .setTaxDeclarationFunction(null) + .setTaxIds(null); + + + List employeeIds = Collections.singletonList(acctEmployeePO.getEmployeeId()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); + List taxAgentIds = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentIds(); + List salaryArchiveData = getSalaryArchiveService(user).getSalaryArchiveData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds); + List addUpSituationPOS; + if (salarySobCycleDTO.getTaxCycle().getMonth() == Month.JANUARY) { + // 3.1銆佸鏋滃綋鍓嶇◣娆炬墍灞炴湡鏄湰骞村害绗竴涓◣娆炬墍灞炴湡锛屽氨涓嶉渶瑕佹煡璇㈠線鏈熺疮璁℃儏鍐 + addUpSituationPOS = Collections.emptyList(); + } else { + addUpSituationPOS = getAddUpSituationService(user).getAddUpSituationList(salarySobCycleDTO.getTaxCycle().plusMonths(-1), employeeIds); + } + List addUpDeductionPOS = getAddUpDeductionService(user).getAddUpDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds); + List otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds); + List> welfareData = new ArrayList<>(); + taxAgentIds.forEach(id -> { + welfareData.addAll(getSIAccountService(user).welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds, id)); + }); + List attendQuoteDataDTOS = getAttendQuoteDataService(user).getAttendQuoteData(salarySobCycleDTO.getSalaryMonth(), salarySobCycleDTO.getSalarySobId(), employeeIds); + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList()); + List salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); + List> variableArchiveList = getVariableArchiveService(user).listBySalaryMonthAndEmployeeIds(salarySobCycleDTO.getSalaryMonth(), employeeIds, taxAgentIds); + Map> collect = salaryAcctResultPOS.stream().collect(Collectors.groupingBy(k -> k.getEmployeeId() + "-" + k.getTaxAgentId() + "-" + k.getSalaryItemId())); + Map salaryAcctResultPOMap = new HashMap<>(); + for (Map.Entry> et : collect.entrySet()) { + salaryAcctResultPOMap.put(et.getKey(), et.getValue().get(0).getOriginResultValue()); + } + List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS); + Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); + + Map resultMap = new HashMap<>(); + formulaVarMap.entrySet().forEach(e -> { + e.getValue().forEach(f -> { + resultMap.put(f.getFieldId(), f.getFieldValue()); + }); + }); + topologyData.setResultItemMap(resultMap); + } else { + topologyData.setResultItemMap(new HashMap<>()); + } + return topologyData; + } + + @Data + class TopologyData { + /** + * 钖祫椤圭洰id + */ + Long salaryItemId; + + /** + * 钖祫椤圭洰 + */ + Map salaryItemIdMap; + Map salaryItemCodeMap; + + /** + * 璐﹀椤圭洰 + */ + SalaryItemPO salaryItemPO; + Map salarySobItemCodeMap; + + /** + * 鍏紡 + */ + Map expressFormulaIdMap; + + /** + * 鏍哥畻缁撴灉 + */ + Map resultItemMap; + } + + } diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 1273809a6..b3fc0eb7f 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -14,7 +14,10 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; -import com.engine.salary.entity.salarysob.bo.*; +import com.engine.salary.entity.salarysob.bo.SalarySobBackItemBO; +import com.engine.salary.entity.salarysob.bo.SalarySobCycleBO; +import com.engine.salary.entity.salarysob.bo.SalarySobDuplicateBO; +import com.engine.salary.entity.salarysob.bo.SalarySobItemBO; import com.engine.salary.entity.salarysob.config.SalarySobConfig; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.param.*; @@ -174,6 +177,19 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user); } + private SalarySobInitService getSalarySobInitService(User user) { + return ServiceUtil.getService(SalarySobInitServiceImpl.class, user); + } + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + @Override public SalarySobPO getById(Long id) { handleHistory(); @@ -311,27 +327,21 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98403, "钖祫璐﹀鍚嶇О宸插瓨鍦")); } - // 淇濆瓨鍙傛暟杞崲鎴愯柂璧勮处濂梡o - SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID()); - // 淇濆瓨钖祫璐﹀ - salarySobMapper.insert(salarySobPO); + SalarySobPO salarySobPO = getSalarySobInitService(user).init(saveParam); // 璁板綍鏃ュ織 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); - loggerContext.setTargetName(salarySobPO.getName()); - loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏂板缓钖祫璐﹀")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏂板缓钖祫璐﹀") + ": " + salarySobPO.getName()); - loggerContext.setNewValues(salarySobPO); - SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); + loggerContext.setTargetName(salarySobPO.getName()); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏂板缓钖祫璐﹀")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏂板缓钖祫璐﹀") + ": " + salarySobPO.getName()); + loggerContext.setNewValues(salarySobPO); + SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext); //淇濆瓨涓◣鎵g即涔夊姟浜鸿仈绯 saveSobTaxLink(saveParam.getTaxAgentIds(), salarySobPO); - // 鏂板缓钖祫璐﹀鏃讹紝淇濆瓨榛樿鐨勫憳宸ヤ俊鎭瓧娈 - saveDefaultEmpField(salarySobPO); - // 鏂板缓钖祫璐﹀鏃讹紝淇濆瓨榛樿鐨勮柂璧勯」鐩 - saveDefaultItem(salarySobPO); + // 鏂板缓钖祫璐﹀鏃讹紝淇濆瓨榛樿鐨勫叧鑱斾汉鍛樿寖鍥村強浠庤寖鍥翠腑鎺掗櫎 saveDefaultEmployeeRange(salarySobPO); // 杩斿洖钖祫璐﹀鐨勪富閿甶d @@ -769,6 +779,52 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getSalarySobCheckRules())) { getSalarySobCheckRuleService(user).batchSave(result.getSalarySobCheckRules()); } + + //澶嶅埗绱瀛楁瀵瑰簲 + + // 鏌ヨ钖祫璐﹀鐨勭疮璁″瓧娈靛搴旇鍒 + List originSalarySobAddUpRules = getSalarySobAddUpRuleService(user).listBySalarySobIds(Collections.singleton(duplicateParam.getId())); + if (CollectionUtils.isEmpty(originSalarySobAddUpRules)) { + return; + } + Date now = new Date(); + List newSalarySobAddUpRules = new ArrayList<>(); + for (SalarySobAddUpRulePO originSalarySobAddUpRule : originSalarySobAddUpRules) { + SalarySobAddUpRulePO newSalarySobAddUpRule = new SalarySobAddUpRulePO(); + BeanUtils.copyProperties(originSalarySobAddUpRule, newSalarySobAddUpRule); + newSalarySobAddUpRule.setId(IdGenerator.generate()); + newSalarySobAddUpRule.setSalarySobId(newSalarySob.getId()); + newSalarySobAddUpRule.setCreator((long)user.getUID()); + newSalarySobAddUpRule.setCreateTime(now); + newSalarySobAddUpRule.setUpdateTime(now); + newSalarySobAddUpRules.add(newSalarySobAddUpRule); + } + if (CollectionUtils.isNotEmpty(newSalarySobAddUpRules)) { + getSalarySobAddUpRuleService(user).saveBatch(newSalarySobAddUpRules); + } + + + //澶嶅埗涓◣鐢虫姤瀛楁瀵瑰簲 + // 鏌ヨ钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瀛楁瀵瑰簲瑙勫垯 + List originSalarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(duplicateParam.getId())); + if (CollectionUtils.isEmpty(originSalarySobTaxReportRules)) { + return; + } + List newSalarySobTaxReportRules = new ArrayList<>(); + for (SalarySobTaxReportRulePO originSalarySobTaxReportRule : originSalarySobTaxReportRules) { + SalarySobTaxReportRulePO newSalarySobTaxReportRule = new SalarySobTaxReportRulePO(); + BeanUtils.copyProperties(originSalarySobTaxReportRule, newSalarySobTaxReportRule); + newSalarySobTaxReportRule.setId(IdGenerator.generate()); + newSalarySobTaxReportRule.setSalarySobId(newSalarySob.getId()); + newSalarySobTaxReportRule.setCreator((long)user.getUID()); + newSalarySobTaxReportRule.setCreateTime(now); + newSalarySobTaxReportRule.setUpdateTime(now); + newSalarySobTaxReportRules.add(newSalarySobTaxReportRule); + } + if (CollectionUtils.isNotEmpty(newSalarySobTaxReportRules)) { + getSalarySobTaxReportRuleService(user).saveBatch(newSalarySobTaxReportRules); + } + // 璁板綍鏃ュ織 LoggerContext loggerContext = new LoggerContext<>(); loggerContext.setUser(user); diff --git a/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java new file mode 100644 index 000000000..92b6fa9e3 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -0,0 +1,171 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobTaxReportRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.engine.salary.util.db.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxReportRuleServiceImpl extends Service implements SalarySobTaxReportRuleService { + + + private SalarySobTaxReportRuleMapper salarySobTaxReportRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobTaxReportRuleMapper.class); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + @Override + public List listBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return Collections.emptyList(); + } + return salarySobTaxReportRuleMapper().listSome(SalarySobTaxReportRulePO.builder().salarySobIds(salarySobIds).build()); + } + + @Override + public List getSalarySobTaxReportRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 鏌ヨ钖祫璐﹀ + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + Integer incomeCategory = salarySob.getIncomeCategory(); + List incomeCategoryIds = Collections.singletonList(incomeCategory); + // 钖祫璐﹀鐨勮柂璧勯」鐩 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 钖祫璐﹀鐨勫洖绠楄柂璧勯」鐩 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 钖祫椤圭洰 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 钖祫璐﹀涓凡缁忓瓨鍦ㄧ殑瀵瑰簲鍏崇郴 + List salarySobTaxReportRules = listBySalarySobIds(Collections.singleton(salarySobId)); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, + e -> e.getIncomeCategory() + "-" + e.getReportColumnDataIndex(), SalarySobTaxReportRulePO::getSalaryItemId); + + for (Integer incomeCategoryId : incomeCategoryIds) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportRules = Lists.newArrayList(); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + SalarySobTaxReportRuleDTO.TaxReportRuleDTO taxReportRuleDTO = new SalarySobTaxReportRuleDTO.TaxReportRuleDTO(); + taxReportRuleDTO.setId(taxReportColumn.getId()); + taxReportRuleDTO.setReportColumnName(taxReportColumn.getReportColumnName()); + taxReportRuleDTO.setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()); + taxReportRuleDTO.setSalaryItem(Collections.emptyList()); + taxReportRuleDTO.setCanEdit(true); + Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxReportColumn.getReportColumnDataIndex()); + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + Map dataMap = Maps.newHashMap(); + dataMap.put("id", salaryItem.getId().toString()); + dataMap.put("name", salaryItem.getName()); + dataMap.put("icon", "Icon-N-Salary-item-management"); + taxReportRuleDTO.setSalaryItem(Collections.singletonList(dataMap)); + } + taxReportRules.add(taxReportRuleDTO); + } + + SalarySobTaxReportRuleDTO salarySobTaxReportRuleDTO = new SalarySobTaxReportRuleDTO(); + salarySobTaxReportRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobTaxReportRuleDTO.setIncomeCategoryName(incomeCategoryEnum == null ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobTaxReportRuleDTO.setTaxReportRules(taxReportRules); + resultList.add(salarySobTaxReportRuleDTO); + } + return resultList; + } + + @Override + public void saveByParam(SalarySobTaxReportRuleSaveParam saveParam) { + // 鏍¢獙鍙傛暟鏄惁鍚堟硶 + // 鏋勫缓po + Date now = new Date(); + List salarySobTaxReportRules = Lists.newArrayList(); + for (SalarySobTaxReportRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobTaxReportRuleSaveParam.TaxReportRuleParam taxReportRuleParam : incomeCategoryParam.getTaxReportRuleParams()) { + SalarySobTaxReportRulePO salarySobTaxReportRule = new SalarySobTaxReportRulePO(); + salarySobTaxReportRule.setId(IdGenerator.generate()); + salarySobTaxReportRule.setSalarySobId(saveParam.getSalarySobId()); + salarySobTaxReportRule.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobTaxReportRule.setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex()); + salarySobTaxReportRule.setSalaryItemId(taxReportRuleParam.getSalaryItemId()); + salarySobTaxReportRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxReportRule.setCreator((long) user.getUID()); + salarySobTaxReportRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxReportRule.setCreateTime(now); + salarySobTaxReportRule.setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxReportRule); + } + } + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); +// salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return; + } + salarySobTaxReportRuleMapper().deleteBySalarySobIds(salarySobIds); + } + + @Override + public void saveBatch(List salarySobTaxReportRules) { + if (CollectionUtils.isEmpty(salarySobTaxReportRules)) { + return; + } + salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); + } +} diff --git a/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java new file mode 100644 index 000000000..2b95251dc --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobTaxRuleServiceImpl.java @@ -0,0 +1,165 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxRulePO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.salarysob.SalarySobTaxRuleMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxRuleServiceImpl extends Service implements SalarySobTaxRuleService { + + + private SalarySobTaxRuleMapper salarySobTaxRuleMapper() { + return MapperProxyFactory.getProxy(SalarySobTaxRuleMapper.class); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + + private SalarySobBackItemService getSalarySobBackItemService(User user) { + return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); + } + + @Override + public List listBySalarySobId(Long salarySobId) { + if (salarySobId == null) { + return Collections.emptyList(); + } + return salarySobTaxRuleMapper().listSome(SalarySobTaxRulePO.builder().salarySobId(salarySobId).build()); + } + + @Override + public List getSalarySobTaxRuleDTO(Long salarySobId) { + List resultList = Lists.newArrayList(); + // 鏌ヨ钖祫璐﹀ + SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId); + Integer incomeCategory = salarySob.getIncomeCategory(); + List incomeCategoryIds = Collections.singletonList(incomeCategory); + // 钖祫璐﹀鐨勮柂璧勯」鐩 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salarySobId); + // 钖祫璐﹀鐨勫洖绠楄柂璧勯」鐩 + List salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId); + // 钖祫椤圭洰 + Set salaryItemIds = Sets.newHashSet(); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId)); + salaryItemIds.addAll(SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId)); + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map idKeySalaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + // 钖祫璐﹀涓凡缁忓瓨鍦ㄧ殑瀵瑰簲鍏崇郴 + List salarySobTaxReportRules = listBySalarySobId(salarySobId); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, + e -> e.getIncomeCategory() + "-" + e.getTaxIndex(), SalarySobTaxRulePO::getSalaryItemId); + + for (Integer incomeCategoryId : incomeCategoryIds) { + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(incomeCategoryId); + List taxRules = new ArrayList<>(); + if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES || incomeCategoryEnum == IncomeCategoryEnum.NON_RESIDENT_INCOME_WAGES_AND_SALARIES) { + //鍙湁姝e父宸ヨ祫钖噾锛屾墠鏄剧ず绠楃◣鏄庣粏瑙勫垯 + taxRules = incomeCategoryEnum.getReportType().getTaxRules(); + } else { + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("绋庣巼").taxIndex("sl").build()); + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("閫熺畻鎵i櫎鏁").taxIndex("sskcs").build()); + taxRules.add(SalarySobTaxRuleDTO.TaxRuleDTO.builder().name("鏈湀锛堟锛夊簲琛ョ◣棰").taxIndex("ybtse").build()); + } + for (SalarySobTaxRuleDTO.TaxRuleDTO taxRule : taxRules) { + Long salaryItemId = salarySobTaxReportRuleMap.get(incomeCategoryId + "-" + taxRule.getTaxIndex()); + SalaryItemPO salaryItem = idKeySalaryItemMap.get(salaryItemId); + if (Objects.nonNull(salaryItem)) { + taxRule.setSalaryItemId(salaryItem.getId()); + taxRule.setSalaryItemName(salaryItem.getName()); + } + } + + SalarySobTaxRuleDTO salarySobTaxReportRuleDTO = new SalarySobTaxRuleDTO(); + salarySobTaxReportRuleDTO.setIncomeCategoryId(incomeCategoryId.toString()); + salarySobTaxReportRuleDTO.setIncomeCategoryName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + salarySobTaxReportRuleDTO.setTaxRules(taxRules); + resultList.add(salarySobTaxReportRuleDTO); + } + return resultList; + } + + @Override + public void saveByParam(SalarySobTaxRuleSaveParam saveParam) { + // 鏍¢獙鍙傛暟鏄惁鍚堟硶 + // 鏋勫缓po + Date now = new Date(); + List salarySobTaxReportRules = Lists.newArrayList(); + for (SalarySobTaxRuleSaveParam.TaxReportRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobTaxRuleSaveParam.TaxRuleParam taxReportRuleParam : incomeCategoryParam.getTaxRuleParams()) { + SalarySobTaxRulePO salarySobTaxRule = new SalarySobTaxRulePO(); + salarySobTaxRule.setId(IdGenerator.generate()); + salarySobTaxRule.setSalarySobId(saveParam.getSalarySobId()); + salarySobTaxRule.setIncomeCategory(incomeCategoryParam.getIncomeCategory()); + salarySobTaxRule.setTaxIndex(taxReportRuleParam.getTaxIndex()); + salarySobTaxRule.setSalaryItemId(taxReportRuleParam.getSalaryItemId()); + salarySobTaxRule.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + salarySobTaxRule.setCreator((long) user.getUID()); + salarySobTaxRule.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + salarySobTaxRule.setCreateTime(now); + salarySobTaxRule.setUpdateTime(now); + salarySobTaxReportRules.add(salarySobTaxRule); + } + } + deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId())); + if (CollectionUtils.isNotEmpty(salarySobTaxReportRules)) { + salarySobTaxReportRules.forEach(salarySobTaxRuleMapper()::insertIgnoreNull); + } + } + + @Override + public void deleteBySalarySobIds(Collection salarySobIds) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return; + } + salarySobTaxRuleMapper().deleteBySalarySobIds(salarySobIds); + } + + @Override + public void saveBatch(List salarySobTaxReportRules) { + if (CollectionUtils.isEmpty(salarySobTaxReportRules)) { + return; + } +// salarySobTaxReportRules.forEach(salarySobTaxReportRuleMapper()::insertIgnoreNull); + } +} diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 85a3b8207..85cc9ba47 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -672,7 +672,10 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd @Override public SpecialAddDeductionRecordDTO getRecordById(Long id) { List specialAddDeductionRecordDTOList = getSpecialAddDeductionBiz().listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build()); - return CollUtil.isNotEmpty(specialAddDeductionRecordDTOList) ? specialAddDeductionRecordDTOList.get(0) : null; + if(CollUtil.isNotEmpty(specialAddDeductionRecordDTOList)){ + return specialAddDeductionRecordDTOList.get(0); + } + return null; } private List> queryInfoForExcel(SpecialAddDeductionQueryParam param, List> rowList) { diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index e4982baa8..f92992600 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -853,5 +853,10 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return results; } + @Override + public List listByIdsIncludeDel(Collection taxAgentIds) { + return getTaxAgentMapper().listByIdsIncludeDel(taxAgentIds); + } + } diff --git a/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java new file mode 100644 index 000000000..a39f2a941 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxAgentTaxReturnServiceImpl.java @@ -0,0 +1,44 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.factory.TaxAgentTaxReturnCheckServiceFactory; +import com.engine.salary.util.db.MapperProxyFactory; + +import java.util.Collection; +import java.util.List; + +public class TaxAgentTaxReturnServiceImpl extends Service implements TaxAgentTaxReturnService { + private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() { + return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class); + } + + @Override + public TaxAgentTaxReturnPO getByTaxAgentId(Long taxAgentId) { + return getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + return new TaxAgentTaxReturnCheckServiceFactory(user).get(saveParam.getType()).verify(saveParam); + } + + @Override + public List getByTaxAgentIds(Collection taxAgentIds) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxAgentIds(taxAgentIds).build()); + } + + @Override + public List getByTaxCode(String taxCode) { + return null; + } + + @Override + public List getByTaxCodes(Collection taxCodes) { + return getTaxAgentTaxReturnMapper().listSome(TaxAgentTaxReturnPO.builder().taxCodes(taxCodes).build()); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java new file mode 100644 index 000000000..9652dcb29 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -0,0 +1,212 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +@Slf4j +public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService { + + private TaxDeclarationApiFlowRecordMapper getTaxDeclarationApiFlowRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowRecordMapper.class); + } + + public TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + public SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); + } + + public ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + @Override + public void updateApiFlowInfo(ApiFlowUpdateWrapper updateWrapper) { + // 淇濆瓨娴侀噺浣跨敤璇︽儏 + saveApiFlowRecord(updateWrapper); + // 娴侀噺涓嶈冻鎻愰啋 + getTaxDeclarationApiFlowWarnService(user).sendFlowWarnMessage(updateWrapper); + } + + private void saveApiFlowRecord(ApiFlowUpdateWrapper updateWrapper) { + if (!updateWrapper.getApiFlowDetailPOList().isEmpty()) { + List> failPartition = Lists.partition(updateWrapper.getApiFlowDetailPOList(), 50); + failPartition.forEach(list -> getTaxDeclarationApiFlowRecordMapper().batchInsert(list)); + } + } + + @Override + public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List records = getTaxDeclarationApiFlowRecordMapper().listSome(queryChainWrapper); + + if (records.isEmpty()) { + return new PageInfo<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); + // 杞崲鏁版嵁 + AtomicInteger indexNum = new AtomicInteger(1); + List listDTOS = records.stream().map(e -> + TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e) + ).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listDTOS, TaxDeclarationApiFlowRecordListDTO.class); + } + + @Override + public List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); + List list = getTaxDeclarationApiFlowRecordMapper().listSome(queryChainWrapper); + if (list.isEmpty()) { + return new ArrayList<>(); + } + TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list); + // 杞崲鏁版嵁 + AtomicInteger indexNum = new AtomicInteger(1); + return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList()); + } + + private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List list) { + Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); + // 鑾峰彇浜哄憳淇℃伅 + List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(employeeTaxAgentMap.keySet())); + Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); + + //闈炵郴缁熶汉鍛樹俊鎭 + List extEmployeePOS = getExtEmpService(user).listAll(); + Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmpPO::getId); + + // 鑾峰彇涓◣鎵g即涔夊姟浜轰俊鎭 + List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); + + //鍒涘缓浜轰俊鎭 + List creators = SalaryEntityUtil.properties(list, TaxDeclarationApiFlowRecordPO::getCreator, Collectors.toList()); + List creatorInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(new ArrayList<>(creators)); + Map creatorNameMap = SalaryEntityUtil.convert2Map(creatorInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + + return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap, creatorNameMap); + + } + + private TaxDeclarationApiFlowRecordPO getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam) { + TaxDeclarationApiFlowRecordPO build = TaxDeclarationApiFlowRecordPO.builder() + .taxAgentId(queryParam.getTaxAgentId()) + .businessType(queryParam.getBusinessType()) + .resultStatus(queryParam.getResult()) + .build(); + if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) { + build.setUseTimeStartDate(queryParam.getStartDate()); + build.setUseTimeEndDate(queryParam.getEndDate()); + } + return build; + } + + @Override + public XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + List> rows = new ArrayList<>(); + // 琛ㄥご + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(159083, "鏃堕棿")); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); + headers.add(SalaryI18nUtil.getI18nLabel(100133, "浜哄憳")); + headers.add(SalaryI18nUtil.getI18nLabel(106277, "韬唤璇佸彿")); + headers.add(SalaryI18nUtil.getI18nLabel(159085, "鎺ュ彛鏈嶅姟")); + headers.add(SalaryI18nUtil.getI18nLabel(85435, "鎿嶄綔浜")); + headers.add(SalaryI18nUtil.getI18nLabel(159086, "缁撴灉")); + rows.add(headers); + // 鑾峰彇鏁版嵁 + List dtoList = listFlowRecord(queryParam); + // 缁勮鏁版嵁 + for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getCreateTime()); + row.add(dto.getTaxAgentName()); + row.add(dto.getEmployeeName()); + row.add(dto.getIdCardNo()); + row.add(dto.getBusinessTypeName()); + row.add(dto.getCreator()); + row.add(dto.getResult()); + rows.add(row); + } + // 鐢熸垚琛ㄦ牸 + return ExcelUtil.genWorkbookV2(rows, "鎺ュ彛浣跨敤璁板綍鏁版嵁"); + } + + + /** + * 灏佽涓浜涗复鏃剁殑闆嗗悎绫伙紝渚夸簬鏂规硶澶嶇敤 + */ + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class TempPropertiesWrapper { + // 濮撳悕 + private Map empNameMap; + // 韬唤璇 + private Map empIdNoMap; + // 鑾峰彇涓◣鎵g即涔夊姟浜轰俊鎭 + private Map taxAgentNameMap; + // 鑾峰彇闈炵郴缁熶汉鍛 + private Map extEmployeeMap; + //鍒涘缓浜 + private Map creatorNameMap; + } + + @Data + public static class ApiFlowUpdateWrapper { + private String tenantKey; + private Long currentEmployeeId; + // 绋庢鎵灞炴湡 + private Date taxYearMonth; + // api娴侀噺浣跨敤鎯呭喌 + private List apiFlowDetailPOList; + // 褰撳墠绉熸埛鐨刟pi鎺ュ彛閰嶇疆 + private TaxDeclarationApiConfigPO apiConfig; + // 鎺ュ彛绫诲瀷 + private EnumDeclareApiBusinessType businessType; + + public ApiFlowUpdateWrapper(Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType, Long currentEmployeeId) { + this.taxYearMonth = taxYearMonth; + this.apiFlowDetailPOList = new ArrayList<>(); + this.apiConfig = apiConfig; + this.businessType = businessType; + this.currentEmployeeId = currentEmployeeId; + } + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java new file mode 100644 index 000000000..ade9b3e6c --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -0,0 +1,125 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountFeedbackResponse; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiProfilePO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareApiProfileEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * chengliming + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService { + + private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class); + } + + private TaxDeclarationApiProfileMapper getTaxDeclarationApiProfileMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiProfileMapper.class); + } + @Override + public TaxDeclarationApiConfigPO getConfig(boolean needValid) { + TaxDeclarationApiConfigPO configPO = getTaxDeclareApiConfigMapper().getOne(); + if (needValid) { + String tips1 = SalaryI18nUtil.getI18nLabel(183786, "褰撳墠鐢ㄦ埛鏅鸿兘绠楄柂灏氭湭閰嶇疆锛岃鍏堝墠寰[璁剧疆] -> [鏅鸿兘绠楄柂]涓厤缃"); + String tips2 = SalaryI18nUtil.getI18nLabel(183787, "褰撳墠鐢ㄦ埛鏅鸿兘绠楄柂灏氭湭鍚敤锛岃鍏堝墠寰[璁剧疆] -> [鏅鸿兘绠楄柂]涓惎鐢ㄨ閰嶇疆"); + String tips3 = SalaryI18nUtil.getI18nLabel(183788, "褰撳墠鐢ㄦ埛鏅鸿兘绠楄柂璐﹀彿鎴栧瘑鐮佷负绌猴紝璇峰墠寰[璁剧疆] -> [鏅鸿兘绠楄柂]涓鏌ヨ处鍙峰瘑鐮佹槸鍚﹀~鍐"); + SalaryAssert.isTrue(configPO != null, tips1); + SalaryAssert.isTrue(SalaryOnOffEnum.ON.getValue().equals(configPO.getEnableUse()), tips2); + SalaryAssert.isTrue(StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppKey())) + && StringUtils.isNotEmpty(StringUtils.trim(configPO.getAppSecret())), tips3); + } + if (configPO != null) { + configPO.setAppKey(StringUtils.trim(configPO.getAppKey())); + configPO.setAppSecret(StringUtils.trim(configPO.getAppSecret())); + } + return configPO; + } + + @Override + public void insert(TaxDeclarationApiConfigPO configPO) { + getTaxDeclareApiConfigMapper().insertIgnoreNull(configPO); + } + + @Override + public void update(TaxDeclarationApiConfigPO config) { + getTaxDeclareApiConfigMapper().updateIgnoreNull(config); + } + + @Override + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + Date now = new Date(); + if (config != null) { + config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(now); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + } + + @Override + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + TaxDeclarationApiConfigPO config = this.getConfig(false); + if (config != null) { + config.setAppKey(saveParam.getAppKey()) + .setAppSecret(saveParam.getAppSecret()) + .setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue()) + .setUpdateTime(new Date()); + update(config); + } else { + config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID()); + config.setHost(getApiHost()); + insert(config); + } + } + + @Override + public boolean enableUse() { + TaxDeclarationApiConfigPO config = getConfig(false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } + + private String getApiHost() { + List apiProfiles = getTaxDeclarationApiProfileMapper().listAll(); + if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { + return SzyhApiConstant.HOST_URL; + } + return SzyhApiConstant.TEST_HOST_URL; + } + + public QuerySpecialAmountFeedbackResponse getQuerySpecialAmountFeedbackResponse(TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_QUERY_SPECIAL_AMOUNT_FEEDBACK; + Map params = new HashMap<>(1); + params.put("requestId", ""); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + return JsonUtil.parseObject(res, QuerySpecialAmountFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java new file mode 100644 index 000000000..71af06009 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowStatisticServiceImpl.java @@ -0,0 +1,231 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.constant.SzyhApiConstant; +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.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.entity.taxapiflow.response.QueryDetailsByTaxNumberResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.util.*; +import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.db.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiFlowStatisticServiceImpl extends Service implements TaxDeclarationApiFlowStatisticService { + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } +// private SalaryBatchService salaryBatchService; + + @Override + public TaxDeclarationApiFlowTotalDTO getFlowStatistics() { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + QueryAccountBalanceResponse response = getQueryAccountBalanceResponse(apiConfigPO); + apiConfigPO.setTotality(Long.parseLong(response.getBody().getTotal())); + apiConfigPO.setRemain(Long.parseLong(response.getBody().getSurplus())); + apiConfigPO.setLastUpdateTime(new Date()); + getTaxDeclarationApiConfigService(user).update(apiConfigPO); + return TaxDeclarationApiFlowTotalDTO.builder() + .total(apiConfigPO.getTotality()) + .remain(apiConfigPO.getRemain()) + .used(Long.parseLong(response.getBody().getSurplus())) + .lastUpdateTime(SalaryDateUtil.getFormatLocalDateTime(apiConfigPO.getLastUpdateTime())) + .build(); + } + + @Override + public PageInfo pageFlowStatistics(BaseQueryParam queryParam) { + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), listFlowStatistic(),TaxDeclarationApiFlowStatisticListDTO.class); + } + + @Override + public List listFlowStatistic() { + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(true); + QueryAccountBalanceResponse response = getQueryAccountBalanceResponse(config); + List details = Optional.of(response).map(e -> e.getBody().getTaxList()).orElse(new ArrayList<>()); + if (details.isEmpty()) { + log.info("details is empty"); + return new ArrayList<>(); + } + Set taxCodes = details.stream().map(QueryAccountBalanceResponse.Detail::getTaxNum).collect(Collectors.toSet()); + List returnPOList = getTaxAgentTaxReturnService(user).getByTaxCodes(taxCodes); + if (returnPOList.isEmpty()) { + log.info("TaxAgentTaxReturnPO is empty"); + return new ArrayList<>(); + } + Set taxAgentIds = returnPOList.stream().map(TaxAgentTaxReturnPO::getTaxAgentId).collect(Collectors.toSet()); + List taxAgentPOList = getTaxAgentService(user).listByIdsIncludeDel(taxAgentIds); + if (taxAgentPOList.isEmpty()) { + log.info("TaxAgentPO is empty"); + return new ArrayList<>(); + } + + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOList, TaxAgentPO::getId, TaxAgentPO::getName); + Map> taxCodeMap = returnPOList.stream().collect(Collectors.groupingBy(TaxAgentTaxReturnPO::getTaxCode)); + List flowStatisticDTOS = new ArrayList<>(); + for (QueryAccountBalanceResponse.Detail detail : details) { + List list = taxCodeMap.getOrDefault(detail.getTaxNum(), new ArrayList<>()); + for (TaxAgentTaxReturnPO returnPO : list) { + TaxDeclarationApiFlowStatisticListDTO statisticDTO = new TaxDeclarationApiFlowStatisticListDTO(); + statisticDTO.setId(IdGenerator.generate()); + statisticDTO.setUsed(Integer.parseInt(detail.getUsed())); + statisticDTO.setTaxAgentId(returnPO.getTaxAgentId()); + statisticDTO.setTaxAgentName(taxAgentMap.get(returnPO.getTaxAgentId())); + flowStatisticDTOS.add(statisticDTO); + } + } + flowStatisticDTOS.sort((o1, o2) -> o2.getTaxAgentId().compareTo(o1.getTaxAgentId())); + for (int i = 0; i < flowStatisticDTOS.size(); i++) { + flowStatisticDTOS.get(i).setIndexNum(i + 1); + } + return flowStatisticDTOS; + } + + @Override + public PageInfo pageFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + List dtoList = listFlowStatisticDetail(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxDeclarationApiFlowStatisticDetailListDTO.class); + } + + @Override + public List listFlowStatisticDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + TaxDeclarationApiConfigPO apiConfigPO = getTaxDeclarationApiConfigService(user).getConfig(true); + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(queryParam.getTaxAgentId()); + SalaryAssert.notNull(taxReturnPO, SalaryI18nUtil.getI18nLabel(184065, "涓◣鎵g即涔夊姟浜烘殏鏃犳姤绋庝俊鎭")); + List taxAgentPOS = getTaxAgentService(user).listByIdsIncludeDel(Collections.singleton(taxReturnPO.getTaxAgentId())); + SalaryAssert.notEmpty(taxAgentPOS, SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + QueryDetailsByTaxNumberResponse response = getQueryDetailsByTaxNumberResponse(apiConfigPO, taxReturnPO.getTaxCode()); + List details = Optional.of(response) + .map(QueryDetailsByTaxNumberResponse::getBody) + .map(QueryDetailsByTaxNumberResponse.Body::getDetail) + .orElse(new ArrayList<>()); + if (details.isEmpty()) { + return new ArrayList<>(); + } + details.sort((o1, o2) -> Integer.valueOf(o2.getMonth()).compareTo(Integer.valueOf(o1.getMonth()))); + details = details.stream().filter(detail -> detail.getMonthValue() >= queryParam.getStartTaxMonth() + && detail.getMonthValue() <= queryParam.getEndTaxMonth()).collect(Collectors.toList()); + + return details.stream().map(e -> TaxDeclarationApiFlowStatisticDetailListDTO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentPOS.get(0).getId()) + .taxAgentName(taxAgentPOS.get(0).getName()) + .taxMonth(LocalDate.parse(e.getMonth() + "01", DateTimeFormatter.ofPattern("yyyyMMdd")).format(SalaryDateUtil.MONTH_FORMATTER)) + .used(Integer.valueOf(e.getUsed())) + .build()).collect(Collectors.toList()); + } + + @Override + public XSSFWorkbook exportFlowStatistics(List dtoList) { + + List> rows = new ArrayList<>(); + // 琛ㄥご + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); + headers.add(SalaryI18nUtil.getI18nLabel(159084, "宸蹭娇鐢ㄦ祦閲")); + rows.add(headers); + // 缁勮鏁版嵁 + for (TaxDeclarationApiFlowStatisticListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getTaxAgentName()); + row.add(dto.getUsed()); + rows.add(row); + } + // 鐢熸垚琛ㄦ牸 + return ExcelUtil.genWorkbookV2(rows, "鎺ュ彛娴侀噺缁熻鏁版嵁"); + } + + @Override + public XSSFWorkbook exportFlowStatisticsDetail(List dtoList) { + List> rows = new ArrayList<>(); + // 琛ㄥご + List headers = new ArrayList<>(); + headers.add(SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); + headers.add(SalaryI18nUtil.getI18nLabel(86176, "绋庢鎵灞炴湡")); + headers.add(SalaryI18nUtil.getI18nLabel(159087, "鏈堜娇鐢ㄦ祦閲忔暟")); + // 缁勮鏁版嵁 + for (TaxDeclarationApiFlowStatisticDetailListDTO dto : dtoList) { + List row = new ArrayList<>(); + row.add(dto.getTaxAgentName()); + row.add(dto.getTaxMonth()); + row.add(dto.getUsed()); + rows.add(row); + } + // 鐢熸垚琛ㄦ牸 + return ExcelUtil.genWorkbookV2(rows, "鎺ュ彛娴侀噺鏈堢粺璁℃暟鎹"); + } + + + public QueryAccountBalanceResponse getQueryAccountBalanceResponse(TaxDeclarationApiConfigPO apiConfig) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_ACCOUNT_BALANCE; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("getQueryAccountBalanceResponse response : {}", res); + QueryAccountBalanceResponse response = JsonUtil.parseObject(res, QueryAccountBalanceResponse.class); + QueryAccountBalanceResponse.Body body = Optional.ofNullable(response).map(QueryAccountBalanceResponse::getBody).orElse(null); + String code = Optional.ofNullable(response) + .map(QueryAccountBalanceResponse::getHead) + .map(SzyhResponseHead::getCode).orElse("error"); + String msg = Optional.ofNullable(response) + .map(QueryAccountBalanceResponse::getHead) + .map(SzyhResponseHead::getMsg).orElse(SalaryI18nUtil.getI18nLabel(184014, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗鍐嶈瘯")); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(code), msg); + SalaryAssert.notNull(body, SalaryI18nUtil.getI18nLabel(184014, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗鍐嶈瘯")); + return response; + } + + public QueryDetailsByTaxNumberResponse getQueryDetailsByTaxNumberResponse(TaxDeclarationApiConfigPO apiConfig, String taxCode) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DETAILS_BY_TAX_NUMBER; + Map params = new HashMap<>(1); + params.put("taxNumber", taxCode); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, params); + log.info("getQueryDetailsByTaxNumberResponse response : {}", res); + QueryDetailsByTaxNumberResponse response = JsonUtil.parseObject(res, QueryDetailsByTaxNumberResponse.class); + QueryDetailsByTaxNumberResponse.Body body = Optional.ofNullable(response).map(QueryDetailsByTaxNumberResponse::getBody).orElse(null); + String code = Optional.ofNullable(response) + .map(QueryDetailsByTaxNumberResponse::getHead) + .map(SzyhResponseHead::getCode).orElse("error"); + String msg = Optional.ofNullable(response) + .map(QueryDetailsByTaxNumberResponse::getHead) + .map(SzyhResponseHead::getMsg).orElse(SalaryI18nUtil.getI18nLabel(184014, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗鍐嶈瘯")); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(code), msg); + SalaryAssert.notNull(body, SalaryI18nUtil.getI18nLabel(184014, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗鍐嶈瘯")); + return response; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java new file mode 100644 index 000000000..276f3ab71 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -0,0 +1,314 @@ +package com.engine.salary.service.impl; + +import com.cloudstore.dev.api.bean.MessageBean; +import com.cloudstore.dev.api.bean.MessageType; +import com.cloudstore.dev.api.util.Util_Message; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.OptionDTO; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO; +import com.engine.salary.entity.taxapiflow.response.QueryAccountBalanceResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnConfigMapper; +import com.engine.salary.mapper.taxapiflow.TaxDeclarationApiFlowWarnReceiverMapper; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.common.MessageUtil; +import weaver.email.EmailWorkRunnable; +import weaver.general.BaseBean; +import weaver.hrm.User; + +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author chengliming + * @date 2022-11-11 2:57 PM + **/ +@Slf4j +public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements TaxDeclarationApiFlowWarnService { + + private TaxDeclarationApiFlowWarnConfigMapper getTaxDeclarationApiFlowWarnConfigMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowWarnConfigMapper.class); + } + + private TaxDeclarationApiFlowWarnReceiverMapper getTaxDeclarationApiFlowWarnReceiverMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationApiFlowWarnReceiverMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private TaxDeclarationApiFlowStatisticService getTaxDeclarationApiFlowStatisticService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticServiceImpl.class, user); + } + + @Override + public TaxDeclarationApiFlowWarnConfigPO getWarnConfig() { + return getTaxDeclarationApiFlowWarnConfigMapper().getOne(); + } + + @Override + public List getWarnReceiverList(Long warnConfigId) { + List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO.builder().warnConfigId(warnConfigId).build()); + + List empIds = SalaryEntityUtil.properties(receiverPOList, TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, Collectors.toList()); + List empInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); + Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(empInfos, DataCollectionEmployee::getEmployeeId); + + return receiverPOList.stream().map(e -> { + DataCollectionEmployee employee = salaryEmployeeMap.get(e.getEmployeeId()); + return TaxDeclarationApiFlowWarnReceiverListDTO.builder() + .employeeName(employee.getUsername()) + .employeeId(e.getEmployeeId()) + .mobile(employee.getMobile()) + .email(employee.getEmail()) + .id(e.getId()) + .build(); + }).collect(Collectors.toList()); + } + + @Override + public PageInfo getWarnReceiverPageList(Long warnConfigId) { + List dtos = getWarnReceiverList(warnConfigId); + return SalaryPageUtil.buildPage(1, 10000, dtos, TaxDeclarationApiFlowWarnReceiverListDTO.class); + } + + @Override + public void deleteReceiver(Long id) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id); + SalaryAssert.notNull(receiverPO, "璇ユ彁閱掑璞′笉瀛樺湪锛岃鍒锋柊椤甸潰鍚庨噸璇"); + getTaxDeclarationApiFlowWarnReceiverMapper().delete(TaxDeclarationApiFlowWarnReceiverPO.builder().id(id).build()); + } + + @Override + public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverFormById(Long id) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id); + SalaryAssert.notNull(receiverPO, "璇ユ彁閱掑璞′笉瀛樺湪锛岃鍒锋柊椤甸潰鍚庨噸璇"); + // 鏌ユ壘浜哄憳淇℃伅 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); + Map empMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + DataCollectionEmployee simpleEmployee = empMap.get(receiverPO.getEmployeeId()); + SalaryAssert.notNull(simpleEmployee, SalaryI18nUtil.getI18nLabel(139811, "浜哄憳涓嶅瓨鍦")); + + return TaxDeclarationApiFlowWarnReceiverFormDTO.builder() + .id(receiverPO.getId()) + .employee(Collections.singletonList(new OptionDTO(receiverPO.getEmployeeId().toString(), simpleEmployee.getUsername()))) + .email(receiverPO.getEmail()) + .mobile(receiverPO.getMobile()) + .emailOptions(StringUtils.isNotEmpty(simpleEmployee.getEmail()) ? Collections.singletonList(simpleEmployee.getEmail()) : null) + .build(); + } + + private TaxDeclarationApiFlowWarnReceiverPO getWarnReceiverPOById(Long id) { + return getTaxDeclarationApiFlowWarnReceiverMapper().getById(id); + } + + @Override + public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + Date now = new Date(); + if (param.getId() != null) { + TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(param.getId()); + SalaryAssert.notNull(receiverPO, "璇ユ彁閱掑璞′笉瀛樺湪锛岃鍒锋柊椤甸潰鍚庨噸璇"); + if (param.getEmployeeId() != null && !receiverPO.getEmployeeId().equals(param.getEmployeeId())) { + filterByEmpId(param); + receiverPO.setEmployeeId(param.getEmployeeId()); + } + receiverPO.setUpdateTime(now); + receiverPO.setEmail(param.getEmail()); + receiverPO.setMobile(param.getMobile()); + getTaxDeclarationApiFlowWarnReceiverMapper().updateIgnoreNull(receiverPO); + } else { + filterByEmpId(param); + TaxDeclarationApiFlowWarnReceiverPO receiverPO = TaxDeclarationApiFlowWarnReceiverPO.builder() + .id(IdGenerator.generate()) + .email(param.getEmail()) + .mobile(param.getMobile()) + .employeeId(param.getEmployeeId()) + .warnConfigId(param.getWarnConfigId()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .build(); + getTaxDeclarationApiFlowWarnReceiverMapper().insertIgnoreNull(receiverPO); + } + } + + private void filterByEmpId(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + List another = getTaxDeclarationApiFlowWarnReceiverMapper().filterByEmpId(param); + SalaryAssert.isEmpty(another, SalaryI18nUtil.getI18nLabel(184007, "褰撳墠浜哄憳瀵瑰簲鐨勬彁閱掑璞″凡瀛樺湪锛岃鏇存崲浜哄憳鍚庡皾璇")); + } + + @Override + public void createMessageRule(CreateMessageRuleParam param) { +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setBusinessId(param.getBusinessId()) +// .setEvent(MessageEvent.PAYROLL) +// .setModule(MessageModule.HRSA) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC鎺ュ彛鍒涘缓瑙勫垯澶辫触")); + } + + @Override + public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { + Date now = new Date(); + TaxDeclarationApiFlowWarnConfigPO warnConfigPO; + if (param.getId() != null) { + warnConfigPO = getTaxDeclarationApiFlowWarnConfigMapper().getById(param.getId()); + SalaryAssert.notNull(warnConfigPO, "鎻愰啋瑙勫垯涓嶅瓨鍦紝璇峰厛淇濆瓨"); + warnConfigPO.setThreshold(param.getThreshold()); + warnConfigPO.setEnableWarn(param.getEnable() ? 1 : 0); + warnConfigPO.setUpdateTime(now); + getTaxDeclarationApiFlowWarnConfigMapper().updateIgnoreNull(warnConfigPO); + } else { + warnConfigPO = TaxDeclarationApiFlowWarnConfigPO.builder() + .id(IdGenerator.generate()) + .businessId(param.getBusinessId()) + .threshold(param.getThreshold()) + .enableWarn(param.getEnable() ? 1 : 0) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getTaxDeclarationApiFlowWarnConfigMapper().insertIgnoreNull(warnConfigPO); + } + if (StringUtils.isNotEmpty(param.getConfig())) { + //todo 娑堟伅 +// CreateRuleEntity createRule = new CreateRuleEntity() +// .setName(SalaryI18nUtil.getI18nLabel(159146, "娴侀噺涓嶈冻鎻愰啋")) +// .setUser(new UserEntity(currentEmployeeId)) +// .setModule(MessageModule.HRSA) +// .setEvent(MessageEvent.PAYROLL) +// .setBusinessId(param.getBusinessId().toString()) +// .setConfig(param.getConfig()); +// log.info("RuleRest.createRuleV2 -> config ====== {}", param.getConfig()); +// WeaResult weaResult = ruleRest.createRuleV2(createRule); +// SalaryAssert.isTrue(weaResult.isStatus(), SalaryI18nUtil.getI18nLabel(184008, "RPC鎺ュ彛鍒涘缓瑙勫垯澶辫触")); + } + return warnConfigPO.getId().toString(); + } + + @Override + public Long getRuleBusinessId() { + TaxDeclarationApiFlowWarnConfigPO warnConfig = this.getWarnConfig(); + return warnConfig == null ? IdGenerator.generate() : warnConfig.getBusinessId(); + } + + @Override + public void sendFlowWarnMessage(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) { + TaxDeclarationApiFlowWarnConfigPO warnConfig = getWarnConfig(); + // 鏈厤缃垨寮鍏冲叧闂 + if (Objects.isNull(warnConfig) || SalaryOnOffEnum.OFF.getValue().equals(warnConfig.getEnableWarn())) { + return; + } + QueryAccountBalanceResponse response = getTaxDeclarationApiFlowStatisticService(user).getQueryAccountBalanceResponse(updateWrapper.getApiConfig()); + // 鍓╀綑娴侀噺澶т簬闃堝兼棤闇鎻愰啋 + if (StringUtils.isNotEmpty(response.getBody().getSurplus()) && Long.parseLong(response.getBody().getSurplus()) > warnConfig.getThreshold()) { + return; + } + List warnReceiverList = getWarnReceiverList(warnConfig.getId()); + if (warnReceiverList.isEmpty()) { + log.info("warnReceiverList is empty, send msg fail"); + return; + } + String title = "娴侀噺涓嶈冻鎻愰啋"; + String context = String.format(SalaryI18nUtil.getI18nLabel(111, "鏅鸿兘绠楄柂娴侀噺宸蹭笉瓒%s锛岃鍙婃椂閲囪喘缁垂锛岄伩鍏嶆鏈堟棤娉曚娇鐢ㄣ"), warnConfig.getThreshold()); + warnReceiverList.forEach(e -> { + Long receiver = e.getEmployeeId(); + sendMsg(receiver, title, context, warnConfig.getBusinessId()); + sendEmail(e.getEmail(), title, context); + sendSMS(e.getMobile(), context); + } + ); + } + + //鎻愰啋鐨勬秷鎭被鍨 + BaseBean bb = new BaseBean(); + private final String flowNoticeMessageType = bb.getPropValue("hrmSalaryCustom", "flowNoticeMessageType"); + + /** + * 鍙戦丒m娑堟伅 + * + * @param receiver + * @param title + * @param context + * @param businessId + */ + public void sendMsg(Long receiver, String title, String context, Long businessId) { + if (StringUtils.isBlank(flowNoticeMessageType)) { + return; + } + MessageType messageType = MessageType.newInstance(Integer.parseInt(flowNoticeMessageType)); + Set userIdList = new HashSet<>(); + userIdList.add(receiver.toString()); + try { + MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, "", ""); + messageBean.setCreater(1);// 鍒涘缓浜篿d + messageBean.setBizState("0");// 闇瑕佷慨鏀规秷鎭负宸插鐞嗙瓑鐘舵佹椂浼犲叆,琛ㄧず娑堟伅鏈鍒濈姸鎬佷负寰呭鐞 + messageBean.setTargetId(flowNoticeMessageType + "|" + businessId); //娑堟伅鏉ユ簮code +鈥渱鈥+涓氬姟id闇瑕佷慨鏀规秷鎭负宸插鐞嗙瓑鐘舵佹椂浼犲叆 + Util_Message.store(messageBean); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 鍙戦侀偖浠 + * + * @param email + * @param title + * @param context + */ + private void sendEmail(String email, String title, String context) { + if (MessageUtil.checkSendEmail()) { + EmailWorkRunnable.threadModeReminder(email, title, context); + } + } + + /** + * 鍙戦佺煭淇 + * + * @param mobile + * @param context + */ + private void sendSMS(String mobile, String context) { + if (MessageUtil.checkSendSMS()) { + MessageUtil.sendSMS(mobile, context); + } + } + + +} diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 16b4c3006..ebacaab1a 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -1,36 +1,53 @@ package com.engine.salary.service.impl; +import com.api.formmode.mybatis.util.SqlProxyHandle; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.config.SalaryElogConfig; -import com.engine.hrmelog.entity.dto.LoggerContext; -import com.engine.salary.constant.TaxDeclarationDataIndexConstant; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; -import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.TaxDeclarationDetailService; -import com.engine.salary.service.TaxDeclarationExcelService; -import com.engine.salary.service.TaxDeclarationService; -import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.excel.ExcelParseHelper; +import com.engine.salary.util.excel.ExcelSheetData; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; -import com.engine.salary.util.page.PageInfo; 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.Validate; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.file.ImageFileManager; +import weaver.general.Util; import weaver.hrm.User; -import java.math.BigDecimal; +import java.io.InputStream; import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** * 涓◣鐢虫姤琛ㄥ鍑 @@ -43,150 +60,397 @@ import java.util.*; @Slf4j public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclarationExcelService { - private TaxDeclarationDetailService getTaxDeclarationDetailService(User user) { - return ServiceUtil.getService(TaxDeclarationDetailServiceImpl.class, user); - } - private TaxDeclarationDetailMapper getTaxDeclarationDetailMapper() { - return MapperProxyFactory.getProxy(TaxDeclarationDetailMapper.class); - } private TaxDeclarationService getTaxDeclarationService(User user) { return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); } + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } @Override - public XSSFWorkbook exportTaxDeclaration(Long taxDeclarationId) { - // 1.宸ヤ綔绨垮悕绉 - String sheetName = SalaryI18nUtil.getI18nLabel(85368, "涓◣鐢虫姤琛"); - - - TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(taxDeclarationId); - // 鏌ヨ褰撳墠涓◣鐢虫姤琛ㄤ竴鍏辨湁澶氬皯浜哄憳 - int count = getTaxDeclarationDetailMapper().countEmployeeId(taxDeclarationId); - // 浠1000涓汉鍛樹竴椤碉紝涓鍏辨湁澶氬皯椤 - int totalPages = (count % 1000 == 0) ? (count / 1000) : (count / 1000 + 1); //鎬婚〉鏁 + public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤琛 + TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); + // 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 + List taxDeclarationValues = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singleton(queryParam.getTaxDeclarationId())); + // 杞垚涓◣鐢虫姤琛ㄦ槑缁 + TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclarationPO, taxDeclarationValues); // excel瀵煎嚭鐨勬暟鎹 - List> rows = Lists.newArrayListWithExpectedSize(count); + List> rows = Lists.newArrayList(); + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + + // 瑙f瀽琛ㄥご + for (WeaTableColumn column : taxDeclarationValueListDTO.getColumns()) { + headerList.add(column.getText()); + dataIndexList.add(column.getColumn()); + } + + rows.add(headerList); + // 瑙f瀽琛ㄤ腑鏁版嵁 + for (Map datum : taxDeclarationValueListDTO.getData()) { + List row = Lists.newArrayList(); + for (String dataIndex : dataIndexList) { + row.add(Util.null2String(datum.get(dataIndex))); + } + rows.add(row); + } + + String sheetName = SalaryI18nUtil.getI18nLabel(100090, "涓◣鐢虫姤琛"); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclarationPO.getTaxAgentId()); + SalaryLoggerUtil.recordExportSingleLog(SalaryElogConfig.taxDeclarationLoggerTemplate, + taxDeclarationPO.getTaxDeclareRecordId(), + SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclarationPO.getTaxCycle())), + "瀵煎嚭涓◣鐢虫姤琛", + "瀵煎嚭涓◣鐢虫姤琛", + user); + + return ExcelUtil.genWorkbook(rows, sheetName); + } + + + @Override + public XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鐨勪汉鍛 + List taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); + // 杞崲鎴愬垪琛╠to + List dtoList = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees); + ExcelSheetData excelSheetData = getExcelSheetData(AbnormalEmployeeListDTO.class, dtoList); + return ExcelUtil.genWorkbook(excelSheetData); + } + + + @Override + public XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鐨勪汉鍛 + List taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); + // 杞崲鎴愬垪琛╠to + List dtoList = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees); + ExcelSheetData excelSheetData = getExcelSheetData(AbnormalEmployeeListDTO.class, dtoList); + + return ExcelUtil.genWorkbook(excelSheetData); + } + + @Override + public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁嗕腑鐨勪汉鍛 + List taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + // 杞崲鎴愬垪琛╠to + List dtoList = getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFails); + ExcelSheetData excelSheetData = getExcelSheetData(FailEmployeeListDTO.class, dtoList); + return ExcelUtil.genWorkbook(excelSheetData); + } + + private ExcelSheetData getExcelSheetData(Class clazz, List dtoList) { + // 瀵煎嚭鐨勮〃澶 List headerList = Lists.newArrayList(); List dataIndexList = Lists.newArrayList(); - List NumberCode = Arrays.asList(TaxDeclarationDataIndexConstant.INCOME, TaxDeclarationDataIndexConstant.TAX_FREE_INCOME, - TaxDeclarationDataIndexConstant.ENDOWMENT_INSURANCE, TaxDeclarationDataIndexConstant.MEDICAL_INSURANCE, TaxDeclarationDataIndexConstant.UNEMPLOYMENT_INSURANCE, - TaxDeclarationDataIndexConstant.HOUSING_PROVIDENT_FUND, TaxDeclarationDataIndexConstant.ADD_UP_CHILD_EDUCATION, TaxDeclarationDataIndexConstant.ADD_UP_CONTINUING_EDUCATION, - TaxDeclarationDataIndexConstant.ADD_UP_HOUSING_LOAN_INTEREST, TaxDeclarationDataIndexConstant.ADD_UP_HOUSING_RENT, TaxDeclarationDataIndexConstant.ADD_UP_SUPPORT_ELDERLY, - TaxDeclarationDataIndexConstant.ADD_UP_ILLNESS_MEDICAL, TaxDeclarationDataIndexConstant.ADD_UP_INFANT_CARE, TaxDeclarationDataIndexConstant.ADD_UP_PRIVATE_PENSION, - TaxDeclarationDataIndexConstant.ANNUITY, TaxDeclarationDataIndexConstant.COMMERCIAL_HEALTH_INSURANCE, TaxDeclarationDataIndexConstant.TAX_DEFERRED_ENDOWMENT_INSURANCE, - TaxDeclarationDataIndexConstant.OTHER, TaxDeclarationDataIndexConstant.ALLOWED_DONATION, TaxDeclarationDataIndexConstant.TAX_DEDUCTION, - TaxDeclarationDataIndexConstant.LABOR_INCOME, TaxDeclarationDataIndexConstant.LABOR_TAX_FREE_INCOME, TaxDeclarationDataIndexConstant.ANNUAL_INCOME, - TaxDeclarationDataIndexConstant.ANNUAL_TAX_FREE_INCOME, TaxDeclarationDataIndexConstant.ANNUAL_OTHER, TaxDeclarationDataIndexConstant.ANNUAL_DONATE_TAX, - TaxDeclarationDataIndexConstant.ANNUAL_TAX_SAVINGS); - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) { - // 瑙f瀽琛ㄥご - ExcelUtil.parseHeader(TaxDeclarationWageListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i+1); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Wage(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationWageListDTO taxDeclarationWageListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationWageListDTO, Object.class); - for (String dataIndex : dataIndexList) { - try { - if (NumberCode.contains(dataIndex)) { - row.add(new BigDecimal(map.get(dataIndex).toString())); - } else { - row.add(map.get(dataIndex)); - } - } catch (Exception e) { - row.add(map.get(dataIndex)); - } - } - rows.add(row); - } - } - } - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_LABOR.getValue())) { - // 瑙f瀽琛ㄥご - ExcelUtil.parseHeader(TaxDeclarationLaborListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Labor(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationLaborListDTO taxDeclarationLaborListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationLaborListDTO, Object.class); - for (String dataIndex : dataIndexList) { - try { - if (NumberCode.contains(dataIndex)) { - row.add(new BigDecimal(map.get(dataIndex).toString())); - } else { - row.add(map.get(dataIndex)); - } - } catch (Exception e) { - row.add(map.get(dataIndex)); - } - } - rows.add(row); + ExcelUtil.parseHeader(clazz, headerList, dataIndexList); + // 瀵煎嚭鐨勬暟鎹 + List> rows = Lists.newArrayListWithExpectedSize(dtoList.size()); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); + dataIndexList.forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + // 缁勮excel瀵煎嚭鏁版嵁 + ExcelSheetData excelSheetData = new ExcelSheetData(); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(156423, "涓◣鐢虫姤琛ㄤ汉鍛")); + excelSheetData.setHeaders(headerList); + excelSheetData.setRows(rows); + return excelSheetData; + } + + @Override + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); + + + List heads = new ArrayList<>(); + heads.add(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕")); + heads.add(SalaryI18nUtil.getI18nLabel(86185, "閮ㄩ棬")); + heads.add(SalaryI18nUtil.getI18nLabel(86186, "鎵嬫満鍙")); + heads.add(SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿")); + heads.add(SalaryI18nUtil.getI18nLabel(86317, "璇佷欢鍙风爜")); + heads.addAll(SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList())); + + List> rowList = new ArrayList<>(); + rowList.add(heads); + + if(param.isHasData()){ + // 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 + List taxDeclarationValues = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singleton(param.getTaxDeclarationId())); + // 杞垚涓◣鐢虫姤琛ㄦ槑缁 + TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(declarationPO, taxDeclarationValues); + + List dataIndexList = new ArrayList<>(); + dataIndexList.add("username"); + dataIndexList.add("departmentName"); + dataIndexList.add("mobile"); + dataIndexList.add("jobNum"); + dataIndexList.add("idNo"); + dataIndexList.addAll(SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnDataIndex, Collectors.toList())); + + // 瑙f瀽琛ㄤ腑鏁版嵁 + for (Map datum : taxDeclarationValueListDTO.getData()) { + List row = Lists.newArrayList(); + for (String dataIndex : dataIndexList) { + row.add(Util.null2String(datum.get(dataIndex))); } + rowList.add(row); } } - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) { - // 瑙f瀽琛ㄥご - ExcelUtil.parseHeader(TaxDeclarationAnnualListDTO.class, headerList, dataIndexList); - rows.add(headerList); - for (int i = 0; i < totalPages; i++) { - TaxDeclarationDetailListQueryParam queryParam = new TaxDeclarationDetailListQueryParam(); - queryParam.setTaxDeclarationId(taxDeclarationId); - queryParam.setCurrent(i); - queryParam.setPageSize(1000); - PageInfo dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam4Annual(queryParam); - List list = dtoPage.getList(); - for (TaxDeclarationAnnualListDTO taxDeclarationLaborListDTO : list) { - List row = Lists.newArrayListWithExpectedSize(dataIndexList.size()); - Map map = JsonUtil.parseMap(taxDeclarationLaborListDTO, Object.class); - for (String dataIndex : dataIndexList) { - try { - if (NumberCode.contains(dataIndex)) { - row.add(new BigDecimal(map.get(dataIndex).toString())); - } else { - row.add(map.get(dataIndex)); - } - } catch (Exception e) { - row.add(map.get(dataIndex)); + XSSFWorkbook book = ExcelUtil.genWorkbookV2(rowList, incomeCategoryEnum.getDefaultLabel()); + return book; + } + + @Override + public Map preview(DownloadTemplateParam importParam) { + //excel鏂囦欢id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId涓虹┖"); + + InputStream fileInputStream = null; + Map map = new HashMap<>(); + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + map.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + map.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return map; + } finally { + IOUtils.closeQuietly(fileInputStream); + } + } + + @Override + public Map importData(DownloadTemplateParam param) { + Map apidatas = new HashMap<>(); + + //鏌ヨ瀵逛簬浜哄憳淇℃伅瀵煎叆绛涢夌殑鍏ㄥ眬閰嶇疆 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + + // 绉熸埛涓嬫墍鏈夌殑浜哄憳 + List salaryEmployees = getSalaryEmployeeService(user).listAllForReport(); + + + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); + List taxReportColumnNames = SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); + Map empDeclarationValueMap = SalaryEntityUtil.convert2Map(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + // 澶辫触鐨勬暟閲 + int errorCount = 0; + // 鎴愬姛鐨勬暟閲 + int successCount = 0; + Date now = new Date(); + + List addList = Lists.newArrayList(); + List editList = Lists.newArrayList(); + + + InputStream fileInputStream = null; + try { + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + + // 閿欒鎻愮ず淇℃伅 + List excelComments = Lists.newArrayList(); + // 瀛樺湪閿欒鐨勯偅琛屾暟鎹 + List> errorDatas = Lists.newArrayList(); + // 琛ㄥご + List headers = ExcelSupport.getSheetHeader(sheet, 0); + List> data = ExcelParseHelper.parse2Map(sheet, 1, 0); + + if (CollectionUtils.isEmpty(headers)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "琛ㄥご涓虹┖"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + if (CollectionUtils.isEmpty(data)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "鏃犳暟鎹"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + + Optional first = taxReportColumnNames.stream().filter(name -> !headers.contains(name)).findFirst(); + if (first.isPresent()) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "鐢虫姤妯℃澘寮傚父锛岀己澶" + first.get() + "鍒,璇锋鏌ユ槸鍚︿负" + incomeCategoryEnum.getDefaultLabel() + "鐢虫姤妯℃澘"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + + + for (int i = 0; i < data.size(); i++) { + + String row = "绗" + (i + 2) + "琛"; + + boolean isError = false; + Map map = data.get(i); + Long employeeId = 0L; + + String username = (String) map.getOrDefault("濮撳悕", ""); + String deparmentName = (String) map.getOrDefault("閮ㄩ棬", ""); + String mobile = (String) map.getOrDefault("鎵嬫満鍙", ""); + String workcode = (String) map.getOrDefault("宸ュ彿", ""); + String idNo = (String) map.getOrDefault("璇佷欢鍙风爜", ""); + + if (StringUtils.isEmpty(username) && "0".equals(confValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "濮撳悕涓嶈兘涓虹┖")); + excelComments.add(errorMessageMap); + } else { + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, username, deparmentName, mobile, workcode, idNo,null); + + if (CollectionUtils.isEmpty(employeeSameIds)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕")); + excelComments.add(errorMessageMap); + } else if (employeeSameIds.size() > 1) { + //瀛樺湪绂昏亴鍜屽湪鑱岀姸鎬佸彇鍦ㄨ亴鐘舵 + employeeSameIds = employeeSameIds.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .collect(Collectors.toList()); + if (employeeSameIds.size() != 1) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + excelComments.add(errorMessageMap); + } else { + employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; } + } else { + employeeId = employeeSameIds.get(0).getEmployeeId(); } - rows.add(row); + } + + if (isError) { + errorCount++; + errorDatas.add(map); + continue; + } + + successCount++; + + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumnPOS) { + String value = (String) map.getOrDefault(taxReportColumn.getReportColumnName(), ""); + valueMap.put(taxReportColumn.getReportColumnDataIndex(), StringUtils.isNotBlank(value) ? value.toString() : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""); + } + + if (empDeclarationValueMap.containsKey(employeeId)) { + TaxDeclarationValuePO taxDeclarationValue = empDeclarationValueMap.get(employeeId); + taxDeclarationValue.setResultValue(valueMap); + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(valueMap)); + taxDeclarationValue.setUpdateTime(new Date()); + taxDeclarationValue.setSource(SourceEnum.IMP.getValue()); + editList.add(taxDeclarationValue); + } else { + //鏂板 + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(declarationPO.getTaxDeclareRecordId()) + .taxDeclarationId(declarationPO.getId()) + .employeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) + .employeeId(employeeId) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .source(SourceEnum.IMP.getValue()) + .build(); + addList.add(taxDeclarationValue); } } - } - // 鏌ヨ涓◣鎵g即涔夊姟浜哄悕绉 - String bar = "_"; - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclarationPO.getTaxAgentId()); - String targetName = SalaryDateUtil.getFormatYearMonth(taxDeclarationPO.getSalaryMonth()) + bar + taxAgentPO.getName() + bar + IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel(); - // 璁板綍鏃ュ織 - LoggerContext loggerContext = new LoggerContext<>(); - loggerContext.setUser(user); - loggerContext.setTargetId(taxDeclarationId.toString()); - loggerContext.setTargetName(targetName); - loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue()); - loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "瀵煎嚭涓◣鐢虫姤琛")); - loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "瀵煎嚭涓◣鐢虫姤琛")); - SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); - return ExcelUtil.genWorkbookV2(rows, sheetName); + getTaxDeclarationValueService(user).batchSave(addList); + getTaxDeclarationValueService(user).batchEdit(editList); + + if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(declarationPO.getTaxDeclareRecordId()); + getTaxDeclarationValueService(user).autoAddWagesDeclare(declareRecordPO); + } + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index e6ad762f4..904424876 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -5,7 +5,9 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -13,13 +15,18 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; @@ -32,9 +39,11 @@ 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.db.IdGenerator; 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 lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import weaver.general.BaseBean; @@ -106,6 +115,16 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration //鏄惁鏍规嵁绋庢鎵灞炴湡杩涜鐢虫姤 private final boolean isTaxDeclarationByTaxCycle = "1".equals(getSalarySysConfService(user).getValueByCode(TAX_DECLARATION_DATE_TYPE)); + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + @Override public List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds) { if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { @@ -116,6 +135,25 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration return taxDeclarationPOS; } + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).build(); + return getTaxDeclarationMapper().listSome(po); + } + + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId, Integer incomeCategory) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).incomeCategory(incomeCategory).build(); + return getTaxDeclarationMapper().listSome(po); + } + + @Override public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { // 鍒嗛〉鍙傛暟 @@ -196,7 +234,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration } else { //鏍规嵁钖祫鎵灞炴湀鐢虫姤 // 钖祫鎵灞炴湀鐨勬棩鏈熻寖鍥 - LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); + LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(saveParam.getSalaryMonth()); if (Objects.isNull(salaryMonthDateRange)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "钖祫鎵灞炴湀鍙傛暟閿欒")); } @@ -408,4 +446,133 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鎾ゅ洖涓◣鐢虫姤琛")); SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { + return; + } + getTaxDeclarationMapper().deleteByTaxDeclareRecordIds(taxDeclareRecordIds); +// new LambdaUpdateChainWrapper<>(baseMapper) +// .eq(TaxDeclarationPO::getTenantKey, tenantKey) +// .eq(TaxDeclarationPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(TaxDeclarationPO::getTaxDeclareRecordId, taxDeclareRecordIds) +// .set(TaxDeclarationPO::getDeleteType, DeleteTypeEnum.DELETED.getValue()) +// .set(TaxDeclarationPO::getUpdateTime, LocalDateTime.now()) +// .update(); + } + + @Override + public void saveBatch(List taxDeclarations) { + if (CollectionUtils.isNotEmpty(taxDeclarations)) { + getTaxDeclarationMapper().batchInsert(taxDeclarations); + } + } + + @Override + public List listByTaxCycleRange(YearMonthRange yearMonthRange) { + return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder() + .taxMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) + .build()); + } + + + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + @Override + public void addTaxDeclaration(TaxDeclarationAddParam param) { + ValidUtil.doValidator(param); + + Long taxDeclareRecordId = param.getTaxDeclareRecordId(); + IncomeCategoryEnum incomeCategory = param.getIncomeCategory(); + + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); + if (taxDeclareRecord == null) { + throw new SalaryRunTimeException("鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + List taxDeclarations = listByTaxDeclareRecordId(taxDeclareRecordId); + Optional first = taxDeclarations.stream().filter(taxDeclarationPO -> incomeCategory.getValue().equals(taxDeclarationPO.getIncomeCategory())).findFirst(); + if (first.isPresent()) { + throw new SalaryRunTimeException("宸插瓨鍦" + incomeCategory.getDefaultLabel() + "鐢虫姤琛"); + } + + Date now = new Date(); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO + .builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .incomeCategory(incomeCategory.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .description(taxDeclareRecord.getRemark()) + .controlView(0) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + List objects = new ArrayList<>(); + objects.add(taxDeclaration); + getTaxDeclarationMapper().batchInsert(objects); + + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆嶇敵鎶ヨ〃绫诲瀷銆寋2}銆") + .replace("{0}", taxAgentPO.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle())) + .replace("{2}", incomeCategory.getDefaultLabel())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏂板涓◣鐢虫姤琛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏂板涓◣鐢虫姤琛")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + @Override + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + ValidUtil.doValidator(param); + Long taxDeclarationId = param.getTaxDeclarationId(); + TaxDeclarationPO declarationPO = getById(taxDeclarationId); + + if (declarationPO == null) { + throw new SalaryRunTimeException("鐢虫姤琛ㄤ笉瀛樺湪锛"); + } + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(taxDeclarationId); + + if (CollectionUtils.isNotEmpty(taxDeclarationValuePOS)) { + throw new SalaryRunTimeException("瀛樺湪鐢虫姤鏄庣粏涓嶅厑璁稿垹闄わ紝璇峰厛鍒犻櫎鐢虫姤琛ㄦ槑缁嗭紒"); + } + + getTaxDeclarationMapper().deleteByIdZj(taxDeclarationId); + // 璁板綍鏃ュ織 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(declarationPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(declarationPO.getTaxDeclareRecordId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆嶇敵鎶ヨ〃绫诲瀷銆寋2}銆") + .replace("{0}", taxAgentPO.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(declarationPO.getTaxCycle())) + .replace("{2}", IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()).getDefaultLabel())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎涓◣鐢虫姤琛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎涓◣鐢虫姤琛")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java new file mode 100644 index 000000000..5d75c8efa --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -0,0 +1,537 @@ +package com.engine.salary.service.impl; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.encrypt.EncryptUtil; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; +import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.service.*; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelUtilPlus; +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 com.wbi.core.entity.WeaResultMsg; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; +import weaver.general.Util; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +/** + * 涓◣鐢虫姤琛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { + public EncryptUtil encryptUtil = new EncryptUtil(); + + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + @Override + public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds, String keyword) { + List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + // 鏍规嵁鍏抽敭璇嶆煡浜哄憳淇℃伅 + if (StringUtils.isNotBlank(keyword)) { + List employeeList = getSalaryEmployeeService(user).listByKeyword(keyword); + List empIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList()); + taxDeclarationValuePOS = taxDeclarationValuePOS.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList()); + } + taxDeclarationValuePOS = decryptBatch(taxDeclarationValuePOS); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class); + } + + @Override + public List listByTaxDeclarationIds(Collection taxDeclarationIds) { + List taxDeclarationValues = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + return decryptBatch(taxDeclarationValues); + } + + @Override + public List listByTaxDeclarationId(Long taxDeclarationId) { + List taxDeclarationValues = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationId(taxDeclarationId).build()); + return decryptBatch(taxDeclarationValues); + } + + @Override + public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { + return getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + } + + @Override + public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { + // 鏌ヨ涓◣鐢虫姤琛ㄨ〃澶 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); + // 浜哄憳id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 鏌ヨ鎶ラ佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 鏌ヨ浜哄憳淇℃伅 + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(simpleEmployeeIds); + // 鏌ヨ澶栭儴浜哄憳 + List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + + // 鍒楄〃琛ㄥご + List weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns); + // 鍒楄〃鏁版嵁 + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, extEmployees, false); + + return new TaxDeclarationValueListDTO().setColumns(weaTableColumns).setData(data); + } + + @Override + public void batchSave(List taxDeclarationValues) { + if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { + // 鍔犲瘑 + taxDeclarationValues.forEach(taxDeclarationValue -> taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + // 鍒嗘壒淇濆瓨 + List> partition = Lists.partition(taxDeclarationValues, 100); + for (List subTaxDeclarationValues : partition) { + subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::insertIgnoreNull); + } + } + } + + @Override + public void batchEdit(List taxDeclarationValues) { + if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { + // 鍔犲瘑 + taxDeclarationValues.forEach(taxDeclarationValue -> taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + // 鍒嗘壒淇濆瓨 + List> partition = Lists.partition(taxDeclarationValues, 100); + for (List subTaxDeclarationValues : partition) { + subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::updateIgnoreNull); + } + } + } + + @Override + public void save(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤琛ㄤ笉瀛樺湪锛"); + } + + Long taxDeclareRecordId = taxDeclaration.getTaxDeclareRecordId(); + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId); + if (declareRecordPO == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + TaxDeclarationValuePO po = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclarationId(param.getTaxDeclarationId()).taxDeclareRecordId(taxDeclareRecordId).employeeId(param.getEmployeeId()).employeeType(param.getEmployeeType()).resultValue(param.getTaxReportColumnValues()).resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())).createTime(new Date()).updateTime(new Date()).source(SourceEnum.ADD.getValue()).creator((long) user.getUID()).deleteType(0).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + TaxDeclarationValuePO po4log = new TaxDeclarationValuePO(); + BeanUtils.copyProperties(po, po4log); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + getTaxDeclarationValueMapper().insertIgnoreNull(po); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(po.getTaxDeclareRecordId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆,绋庢鎵灞炴湡銆寋1}銆,浜哄憳id銆寋3}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(declareRecordPO.getTaxCycle())) + .replace("{2}", po.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏂板浜哄憳")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏂板浜哄憳")); + loggerContext.setNewValues(po4log); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + + //鏂板骞寸粓濂 + if (IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue().equals(taxDeclaration.getIncomeCategory())) { + autoAddWagesDeclare(declareRecordPO); + } + } + + @Override + public void edit(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationValuePO po = getById(param.getId()); + TaxDeclarationValuePO oldPo = new TaxDeclarationValuePO(); + BeanUtils.copyProperties(po, oldPo); + po.setResultValue(param.getTaxReportColumnValues()); + po.setResultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())); + po.setUpdateTime(new Date()); + po.setSource(SourceEnum.EDIT.getValue()); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + getTaxDeclarationValueMapper().updateIgnoreNull(po); + TaxDeclarationValuePO po4log = getTaxDeclarationValueMapper().getById(po.getId()); + + // 璁板綍鏃ュ織 + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(po.getTaxDeclareRecordId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecordPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(po.getTaxDeclareRecordId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆嶄汉鍛榠d銆寋3}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) + .replace("{2}", po.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "淇敼涓◣鐢虫姤鏁版嵁")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "淇敼涓◣鐢虫姤鏁版嵁")); + loggerContext.setOldValues(oldPo); + loggerContext.setNewValues(po4log); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public TaxDeclarationValuePO getById(Long id) { + TaxDeclarationValuePO po = getTaxDeclarationValueMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤鏄庣粏涓嶅瓨鍦紒"); + } + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); + po.setResultValue(JsonUtil.parseMap(po.getResultValueJson(), String.class)); + + return po; + } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { + return; + } + getTaxDeclarationValueMapper().deleteBytaxDeclareRecordIds(taxDeclareRecordIds); + } + + private List decryptBatch(List taxDeclarationValues) { + if (CollectionUtils.isEmpty(taxDeclarationValues)) { + return Collections.emptyList(); + } + // 瑙e瘑 + taxDeclarationValues = encryptUtil.decryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + taxDeclarationValues.forEach(salaryAcctResultValue -> { + salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); + }); + return taxDeclarationValues; + } + + + @Override + public void autoAddWagesDeclare(TaxDeclareRecordPO taxDeclareRecord) { + + Long taxDeclareRecordId = taxDeclareRecord.getId(); + Date now = new Date(); + + //闈炴甯歌柂璧勭殑浜哄憳 + List notWagesEmpIds = getTaxDeclarationValueMapper().queryNotWagesEmpIds(taxDeclareRecordId); + if (CollectionUtils.isEmpty(notWagesEmpIds)) { + return; + } + + //姝e父钖祫浜哄憳 + List wagesEmpIds = getTaxDeclarationValueMapper().queryWagesEmpIds(taxDeclareRecordId); + + //姣旇緝宸紓 + List autoAddIds = notWagesEmpIds.stream().filter(id -> !wagesEmpIds.contains(id)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(autoAddIds)) { + return; + } + + //姝e父钖祫鐨勮〃澶 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES, 0); + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + String value = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); + } + + //褰撳墠鐢虫姤琛ㄦ槸鍚﹀惈姝e父鐢虫姤 + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId, IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + TaxDeclarationPO taxDeclarationPO; + if (CollectionUtils.isNotEmpty(list)) { + if (list.size() > 1) { + throw new SalaryRunTimeException("瀛樺湪澶氭潯姝e父宸ヨ祫钖噾鐢虫姤琛ㄦ暟鎹"); + } + taxDeclarationPO = list.get(0); + } else { + taxDeclarationPO = TaxDeclarationPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecordId).incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()).taxAgentId(taxDeclareRecord.getTaxAgentId()).salaryMonth(taxDeclareRecord.getSalaryMonth()).taxCycle(taxDeclareRecord.getTaxCycle()).description(taxDeclareRecord.getRemark()).controlView(0).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + List taxList = new ArrayList<>(); + getTaxDeclarationService(user).saveBatch(taxList); + } + + //缁勮鏁版嵁锛岃嚜鍔ㄨˉ瓒 + List autoAddValuePOs = autoAddIds.stream().map((empId -> { + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclarationPO.getTaxDeclareRecordId()).taxDeclarationId(taxDeclarationPO.getId()).employeeType(0).employeeId(empId).resultValue(valueMap).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).source(SourceEnum.AUTO.getValue()).build(); + return taxDeclarationValue; + })).collect(Collectors.toList()); + batchSave(autoAddValuePOs); + } + + + @Override + public Map contrast(ContrastQueryParam param) { + + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("鏃犵敵鎶ヨ〃"); + } + + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclaration.getTaxDeclareRecordId()); + if (taxDeclareRecordPO == null) { + throw new SalaryRunTimeException("鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + Integer reportType = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType().getValue(); + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordPO.getId(), reportType); + + //绾夸笂鏁版嵁 + DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareStatus.getDeclareRequestId()); + + Map>> onlineDataMap = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); + list.stream() + .map(TaxDeclarationPO::getIncomeCategory) + .map(IncomeCategoryEnum::parseByValue) + .filter(Objects::nonNull) + .filter(e -> e.getReportType() == DeclareReportTypeEnum.parseByValue(reportType)) + .forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + + Map resultList = new HashMap<>(); + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); + + // 鏌ヨ涓◣鐢虫姤琛ㄨ〃澶 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + // 浜哄憳id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 鏌ヨ鎶ラ佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 鏌ヨ浜哄憳淇℃伅 + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(simpleEmployeeIds); + // 鏌ヨ澶栭儴浜哄憳 + List extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + + // 鍒楄〃鏁版嵁 + List> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, extEmployees, true); + + + Map> localMap = new HashMap<>(); + for (Map map : localList) { + String no = map.getOrDefault("璇佷欢鍙风爜", "").toString(); + localMap.put(no, map); + } + + List> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel()); + List heads = onlineData.get(0); + List> data = onlineData.subList(1, onlineData.size()); + List> onlineMap = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + List row = data.get(i); + Map m = new HashMap<>(); + for (int j = 0; j < heads.size(); j++) { + String key = heads.get(j).toString(); + m.put(key, row.get(j)); + } + onlineMap.add(m); + } + + Map> onlineNoMap = new HashMap<>(); + for (Map map : onlineMap) { + String no = map.getOrDefault("璇佷欢鍙风爜", "").toString(); + onlineNoMap.put(no, map); + } + + List onlyShowColumns = new ArrayList<>(); + List> oneResultList = new ArrayList<>(); + for (Map local : localList) { + AtomicBoolean hasDiff = new AtomicBoolean(false); + Map result = new HashMap<>(); + result.put("宸ュ彿", local.get("宸ュ彿")); + result.put("濮撳悕", local.get("濮撳悕")); + result.put("璇佷欢绫诲瀷", local.get("璇佷欢绫诲瀷")); + result.put("璇佷欢鍙风爜", local.get("璇佷欢鍙风爜")); + String no = local.getOrDefault("璇佷欢鍙风爜", "").toString(); + Map online = onlineNoMap.get(no); + if (online == null) { + log.warn("绾夸笂娌℃湁璇ユ潯鏁版嵁锛岃妫鏌ワ紒璇佷欢鍙风爜锛歿}", no); + continue; + } + + taxReportColumns.stream().map(TaxReportColumnPO::getReportColumnName).forEach(col -> { + ContrastListDTO dto = new ContrastListDTO(); + // 绯荤粺鍊 + String localValue = Util.null2String(local.get(col)); + // 绾夸笂鍊 + String onlineValue = Util.null2String(online.get(col)); + dto.setLocal(localValue); + dto.setOnline(onlineValue); + if (NumberUtil.isNumber(localValue) && NumberUtil.isNumber(onlineValue)) { + BigDecimal diff = new BigDecimal(localValue).subtract(new BigDecimal(onlineValue)); + if (diff.compareTo(new BigDecimal(0)) != 0) { + dto.setDiff(diff); + onlyShowColumns.add(col); + hasDiff.set(true); + } + } else if ((StrUtil.isBlank(localValue) && ("0.00".equals(onlineValue) || "0".equals(onlineValue))) || (StrUtil.isBlank(onlineValue) && ("0.00".equals(localValue) || "0".equals(localValue)))) { + //鐭矾 + } else { + if (!Objects.equals(localValue, onlineValue)) { + dto.setDiff(localValue); + onlyShowColumns.add(col); + hasDiff.set(true); + } + } + result.put(col, dto); + }); + if (param.isOnlyShowDiffEmp()) { + if (hasDiff.get()) { + oneResultList.add(result); + } + } else { + oneResultList.add(result); + } + } + + List finalOnlyShowColumns = onlyShowColumns.stream().distinct().collect(Collectors.toList()); + List headerList = new ArrayList<>(); + headerList.add("宸ュ彿"); + headerList.add("濮撳悕"); + headerList.add("璇佷欢绫诲瀷"); + headerList.add("璇佷欢鍙风爜"); + headerList.addAll((param.isOnlyShowDiffItem() ? finalOnlyShowColumns : columns).stream().collect(Collectors.toList())); + resultList.put("columns", headerList); + resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); + + // 鏄剧ず瀹氬埗鍒 + List weaColumns = new ArrayList<>(); + weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "宸ュ彿"), "宸ュ彿")); + weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "濮撳悕"), "濮撳悕")); + weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "璇佷欢绫诲瀷"), "璇佷欢绫诲瀷")); + weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜"), "璇佷欢鍙风爜")); + for (TaxReportColumnPO columnPO : taxReportColumns) { + weaColumns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName())); + } + + SalaryWeaTable table = new SalaryWeaTable(user, TaxDeclarationValueListDTO.class); + table.setColumns(weaColumns); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + resultList.put("dataKey", result.getResultMap()); + return resultList; + + } + + @Override + public XSSFWorkbook exportContrast(ContrastQueryParam param) { + param.setPageSize(1000000000); + param.setCurrent(1); + // 鑾峰彇绾夸笅瀵规瘮缁撴灉 + Map contrastMap = contrast(param); + List header = ((List) contrastMap.get("columns")); + PageInfo> pageInfo = (PageInfo>) contrastMap.get("pageInfo"); + List> list = pageInfo.getList(); + + List empInfoColumns = new ArrayList<>(); + empInfoColumns.add(new WeaTableColumn("100px", "宸ュ彿", "jobNum")); + empInfoColumns.add(new WeaTableColumn("100px", "濮撳悕", "username")); + empInfoColumns.add(new WeaTableColumn("100px", "璇佷欢绫诲瀷", "cardType")); + empInfoColumns.add(new WeaTableColumn("100px", "璇佷欢鍙风爜", "cardNum")); + + List empInfoList = empInfoColumns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); + header = header.stream().filter(h -> !empInfoList.contains(h)).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(param.getColumns())) { + List finalHeader = header; + header = param.getColumns().stream().filter(col -> finalHeader.contains(col)).collect(Collectors.toList()); + } + + return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "鍦ㄧ嚎瀵规瘮缁撴灉"); + + } + + @Override + public void deleteById(Long deleteId) { + getTaxDeclarationValueMapper().deleteByIds(Collections.singletonList(deleteId)); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java new file mode 100644 index 000000000..d2ed11f26 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -0,0 +1,109 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclareEmployeeBO; +import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareEmployeePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.service.EmployeeDeclareService; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.TaxDeclareEmployeeService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 涓◣鐢虫姤琛ㄦ槑缁嗕腑鐨勪汉鍛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclareEmployeeService { + + + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + @Override + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + List list = getTaxDeclarationValueMapper().listPage4NotDeclareByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); + } + + @Override + public List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationValueMapper().list4NotDeclareByParam(queryParam); + } + + @Override + public PageInfo listPage4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { + List list = getTaxDeclarationValueMapper().listPage4NoValueByParam(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, TaxDeclareEmployeePO.class); + } + + @Override + public List list4NoValueByParam(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationValueMapper().list4NoValueByParam(queryParam); + } + + @Override + public List convert2AbnormalEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareEmployees) { + if (CollectionUtils.isEmpty(taxDeclareEmployees)) { + return Collections.emptyList(); + } + // 浜哄憳id + Set employeeIds = SalaryEntityUtil.properties(taxDeclareEmployees, TaxDeclareEmployeePO::getEmployeeId); + // 鏌ヨ鎶ラ佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( + taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId(), employeeIds); + // 鏌ヨ浜哄憳淇℃伅 + List simpleEmployeeIds = taxDeclareEmployees.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclareEmployeePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 鏌ヨ浜哄憳钖祫锛堣韩浠借瘉鍙风爜绛夛級 + List simpleUserInfos = getSalaryEmployeeService(user).listByIds(simpleEmployeeIds); + // 鏌ヨ澶栭儴浜哄憳 + List extEmployeeIds = taxDeclareEmployees.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) + .map(TaxDeclareEmployeePO::getEmployeeId) + .collect(Collectors.toList()); + List extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds); + + return TaxDeclareEmployeeBO.convert2AbnormalEmployee(taxDeclareEmployees, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java new file mode 100644 index 000000000..d1d219c2d --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareFailServiceImpl.java @@ -0,0 +1,92 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareFailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareFailMapper; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclareFailService; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤澶辫触鏁版嵁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclareFailServiceImpl extends Service implements TaxDeclareFailService { + + private TaxDeclareFailMapper getTaxDeclareFailMapper() { + return MapperProxyFactory.getProxy(TaxDeclareFailMapper.class); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + @Override + public List listPageByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + return getTaxDeclareFailMapper().listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); + } + + @Override + public List listByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + return getTaxDeclareFailMapper().listSome(TaxDeclareFailPO.builder().taxDeclareRecordIds(taxDeclareRecordIds).build()); + } + + @Override + public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { + getTaxDeclareFailMapper().deleteBytaxDeclareRecordIds(taxDeclareRecordIds); + } + + @Override + public List convert2FailEmployeeList(TaxDeclareRecordPO taxDeclareRecord, List taxDeclareFails) { + if (CollectionUtils.isEmpty(taxDeclareFails)) { + return Collections.emptyList(); + } + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + Map incomeCategoryEnumMap = Maps.newHashMap(); + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + incomeCategoryEnumMap.put(incomeCategoryEnum.getCode(), incomeCategoryEnum); + } + + List dtos = Lists.newArrayList(); + for (TaxDeclareFailPO taxDeclareFail : taxDeclareFails) { + IncomeCategoryEnum incomeCategoryEnum = incomeCategoryEnumMap.get(taxDeclareFail.getIncomeCategory()); + FailEmployeeListDTO dto = new FailEmployeeListDTO() + .setId(taxDeclareFail.getId()) + .setEmployeeName(taxDeclareFail.getEmployeeName()) + .setTaxAgentName(taxAgent.getName()) + .setCardNum(taxDeclareFail.getCardNum()) + .setErrorMsg(taxDeclareFail.getErrorMsg()) + .setIncomeCategory(incomeCategoryEnum == null ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); + dtos.add(dto); + } + return dtos; + } + + @Override + public void saveBatch(List taxDeclareFails) { + if (CollectionUtils.isNotEmpty(taxDeclareFails)) { + taxDeclareFails.forEach(getTaxDeclareFailMapper()::insertIgnoreNull); +// getTaxDeclareFailMapper().batchInsert(taxDeclareFails); + } + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java new file mode 100644 index 000000000..2c78fa48e --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -0,0 +1,1362 @@ +package com.engine.salary.service.impl; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.param.OtherDeductionFreeListQueryParam; +import com.engine.salary.entity.datacollection.po.*; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobAddUpRulePO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO; +import com.engine.salary.entity.taxdeclaration.bo.*; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.engine.salary.entity.taxdeclaration.param.*; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse; +import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse; +import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse; +import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.datacollection.TaxFreeTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.enums.taxdeclaration.*; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper; +import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.declare.GetCompanyIncomesResponse; +import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.service.*; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; +import com.engine.salary.util.*; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.general.Util; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.time.YearMonth; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE; +import static com.engine.salary.sys.constant.SalarySysConstant.TAX_DECLARATION_DATE_TYPE; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRecordService { + + + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + + private TaxDeclareStatusMapper getTaxDeclareStatusMapper() { + return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class); + } + + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + private AddUpSituationService getAddUpSituationService(User user) { + return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); + } + + private TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { + return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); + } + + private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + } + + private SalaryAcctResultService getSalaryAcctResultService(User user) { + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + } + + private SalaryItemService getSalaryItemService(User user) { + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + } + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private OtherDeductionService getOtherDeductionService(User user) { + return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); + } + + private SalaryAcctRecordMapper getSalaryAcctRecordMapper() { + return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class); + } + + + private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); + + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + + //鏄惁鏍规嵁绋庢鎵灞炴湡杩涜鐢虫姤 + private final boolean isTaxDeclarationByTaxCycle = "1".equals(getSalarySysConfService(user).getValueByCode(TAX_DECLARATION_DATE_TYPE)); + + +// private TaxPaymentRequestMapper taxPaymentRequestMapper; + + @Override + public TaxDeclareRecordPO getById(Long id) { + return getTaxDeclareRecordMapper().getById(id); + } + + @Override + public List listByIds(Collection ids) { + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().ids(ids).build()); + } + + @Override + public List listByTaxCycleRange(YearMonthRange taxCycleRange) { + TaxDeclareRecordPO build = TaxDeclareRecordPO.builder().build(); + if (Objects.nonNull(taxCycleRange.getStartMonth())) { + build.setStartDate(taxCycleRange.getStartMonth()); + } + if (Objects.nonNull(taxCycleRange.getEndMonth())) { + build.setEndDate(taxCycleRange.getEndMonth()); + } + return getTaxDeclareRecordMapper().listSome(build); + } + + @Override + public List listByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds) { + if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { + return Collections.emptyList(); + } + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).taxCycle(taxCycle).build()); + } + + @Override + public List listBySalaryMonthAndTaxAgentIds(Date salaryMonth, Collection taxAgentIds) { + if (Objects.isNull(salaryMonth) || CollectionUtils.isEmpty(taxAgentIds)) { + return Collections.emptyList(); + } + return getTaxDeclareRecordMapper().listSome(TaxDeclareRecordPO.builder().taxAgentIds(taxAgentIds).salaryMonth(salaryMonth).build()); + } + + @Override + public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordPO.class); + // 鏋勫缓鏌ヨ鍙傛暟 + TaxDeclareRecordPO build = TaxDeclareRecordPO.builder().build(); + if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())) { + build.setSalaryMonthStartDate(queryParam.getFromSalaryMonth()); + } + if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth())) { + build.setSalaryMonthEndDate(queryParam.getEndSalaryMonth()); + } + // 鍒ゆ柇鏄惁寮鍚簡鍒嗘潈 + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); + // 鍒ゆ柇鏄惁鏄荤鐞嗗憳 + Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); + // 鍙鑼冨洿鍐呯殑涓◣鎵g即涔夊姟浜 + Collection taxAgents = Lists.newArrayList(); + if (openDevolution && !isChief) { + taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + if (CollectionUtils.isEmpty(taxAgents)) { + return pageInfo; + } + List taxAgentDevolution = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); + build.setTaxAgentIds(taxAgentDevolution); + } + + List taxDeclareRecordPOS = getTaxDeclareRecordMapper().listSome(build); + + if (StrUtil.isNotBlank(queryParam.getTaxAgentName())) { + List taxAgentPOs = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build()); + Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOs, TaxAgentPO::getId); + taxDeclareRecordPOS = taxDeclareRecordPOS.stream().filter(tax -> taxAgentIds.contains(tax.getTaxAgentId())).collect(Collectors.toList()); + } + + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclareRecordPOS, TaxDeclareRecordPO.class); + } + + @Override + public void save(TaxDeclarationSaveParam saveParam) { + Date now = new Date(); + Set needDeleteTaxDeclareRecordIds = Sets.newHashSet(); + List newTaxDeclareRecords = Lists.newArrayList(); + List newTaxDeclarations = Lists.newArrayList(); + List newTaxDeclarationValues = Lists.newArrayList(); + List newAddUpSituations = Lists.newArrayList(); + // 鏍规嵁涓◣鎵g即涔夊姟浜鸿寖鍥存煡璇釜绋庢墸缂翠箟鍔′汉 + Collection taxAgents = queryByTaxAgentRange(saveParam); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + + Date taxCycle; + List salaryAcctRecords = new ArrayList<>(); + //鏍规嵁绋庢鎵灞炴湡鐢虫姤 + if (isTaxDeclarationByTaxCycle) { + taxCycle = saveParam.getTaxCycle(); + if (Objects.isNull(taxCycle)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "绋庢鎵灞炴湡鍙傛暟閿欒")); + } + + // 鏌ヨ钖祫鎵灞炴湀鐨勮柂璧勬牳绠楄褰 + salaryAcctRecords = listByTaxCycle(SalaryAcctRecordPO.builder().taxCycle(taxCycle).build()); + // 鏃犺柂璧勬牳绠楄褰曪紝涓嶅厑璁哥敓鎴愪釜绋庣敵鎶ヨ〃 + if (CollectionUtils.isEmpty(salaryAcctRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}鏃犵敵鎶ユ暟鎹").replace("{0}", SalaryDateUtil.getFormatYearMonth(taxCycle))); + } + } else { + //鏍规嵁钖祫鎵灞炴湀鐢虫姤 + // 钖祫鎵灞炴湀鐨勬棩鏈熻寖鍥 + LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(saveParam.getSalaryMonth()); + if (Objects.isNull(salaryMonthDateRange)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "钖祫鎵灞炴湀鍙傛暟閿欒")); + } + // 鏌ヨ钖祫鎵灞炴湀鐨勮柂璧勬牳绠楄褰 + salaryAcctRecords = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build()); + // 濡傛灉褰撳墠钖祫鎵灞炴湀涓嬪瓨鍦ㄤ笉鍚岀殑绋庢鎵灞炴湡锛屽睘浜庡紓甯镐笟鍔″満鏅紝涓嶅厑璁哥敓鎴愪釜绋庣敵鎶ヨ〃 + taxCycle = salaryAcctRecords.get(0).getTaxCycle(); + boolean differentTaxCycle = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0); + if (differentTaxCycle) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}瀛樺湪涓嶅悓鐨勭◣娆炬墍灞炴湡锛屾棤娉曟甯哥敓鎴愪釜绋庣敵鎶ヨ〃锛岃璋冩暣璐﹀璁剧疆锛岄噸鏂版牳绠楀悗鍐嶇敓鎴愪釜绋庣敵鎶ヨ〃") + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + } + } + // 鏌ヨ钖祫鎵灞炴湀涓嬬殑钖祫鏍哥畻璁板綍锛屽苟鎸夌収鏉冮檺杩囨护 + // LocalDateRange salaryMonthRange = new LocalDateRange().setFromDate(saveParam.getSalaryMonth()).setEndDate(saveParam.getSalaryMonth()); + // List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalaryMonth(salaryMonthRange); + + + // 鏌ヨ钖祫鏍哥畻璁板綍鍏宠仈鐨勪釜绋庢墸缂翠箟鍔′汉 + List salaryAcctTaxAgents = getSalaryAcctRecordService(user).listBySalaryAcctRecordIds(SalaryEntityUtil.properties(salaryAcctRecords, SalaryAcctRecordPO::getId)); + // 鎸夌収saveParam涓殑涓◣鎵g即涔夊姟浜鸿寖鍥磋繃婊 + List taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId, Collectors.toList()); + salaryAcctTaxAgents = salaryAcctTaxAgents.stream().filter(e -> taxAgentIds.contains(e.getTaxAgentId())).collect(Collectors.toList()); + List salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getSalaryAcctRecordId, Collectors.toList()); + salaryAcctRecords = salaryAcctRecords.stream().filter(e -> salaryAcctRecordIds.contains(e.getId())).collect(Collectors.toList()); + // 鏍¢獙鏄惁鍙互鐢熸垚涓◣鐢虫姤琛 + // 杩斿洖鐩墠宸茬粡鐢熸垚鐨勪釜绋庣敵鎶ヨ〃 + List taxDeclareRecords = checkBeforeSave(saveParam, taxAgentNameMap, salaryAcctRecords, salaryAcctTaxAgents); + Map taxDeclareRecordMap = SalaryEntityUtil.convert2Map(taxDeclareRecords, e -> e.getTaxCycle() + "-" + e.getTaxAgentId()); + // 鏌ヨ钖祫鏍哥畻浜哄憳 + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds, null, taxAgents.stream().findFirst().orElse(new TaxAgentPO()).getId()); + // 钖祫鏍哥畻浜哄憳鎸夌収绋庢鎵灞炴湡鑱氬悎鍒嗙被 + Map> taxCycleKeyEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxCycle); + for (Map.Entry> taxCycleEntry : taxCycleKeyEmployeeMap.entrySet()) { + // 钖祫鏍哥畻浜哄憳鎸夌収涓◣鎵g即涔夊姟浜篿d鑱氬悎鍒嗙被 + Map> taxAgentIdKeyEmployeeMap = SalaryEntityUtil.group2Map(taxCycleEntry.getValue(), SalaryAcctEmployeePO::getTaxAgentId); + for (Map.Entry> taxAgentIdEntry : taxAgentIdKeyEmployeeMap.entrySet()) { + TaxDeclareRecordPO oldTaxDeclareRecord = taxDeclareRecordMap.get(taxCycleEntry.getKey() + "-" + taxAgentIdEntry.getKey()); + // 濡傛灉宸茬粡鐢熸垚浜嗕釜绋庣敵鎶ヨ〃锛屽苟涓斾釜绋庣敵鎶ヨ〃宸茬粡鐢虫姤杩囦簡锛屽氨璺宠繃 + if (oldTaxDeclareRecord != null) { + if (!(Objects.equals(oldTaxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(oldTaxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()))) { + continue; + } + needDeleteTaxDeclareRecordIds.add(oldTaxDeclareRecord.getId()); + } + TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO().setId(IdGenerator.generate()).setTaxAgentId(taxAgentIdEntry.getKey()).setSalaryMonth(saveParam.getSalaryMonth()).setTaxCycle(taxCycleEntry.getKey()).setTaxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()).setTaxDeclareStatus(NOT_DECLARE.getValue()).setRemark(saveParam.getDescription()).setCreator((long) user.getUID()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()).setCreateTime(now).setUpdateTime(now); + newTaxDeclareRecords.add(taxDeclareRecord); + // 鐢熸垚涓◣鐢虫姤琛 + TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, taxAgentIdEntry.getValue()); + newTaxDeclarations.addAll(taxDeclarationResult.getTaxDeclarations()); + newTaxDeclarationValues.addAll(taxDeclarationResult.getTaxDeclarationValues()); + newAddUpSituations.addAll(taxDeclarationResult.getAddUpSituations()); + } + } + + // 鍒犻櫎鍘熸潵鐢熸垚鐨勪釜绋庣敵鎶ヨ褰曘佷釜绋庣敵鎶ヨ〃銆佷釜绋庣敵鎶ヨ〃鏄庣粏 + deleteByIds(needDeleteTaxDeclareRecordIds); + // 淇濆瓨涓◣鐢虫姤璁板綍 + if (CollectionUtils.isNotEmpty(newTaxDeclareRecords)) { + newTaxDeclareRecords.forEach(getTaxDeclareRecordMapper()::insertIgnoreNull); +// getTaxDeclareRecordMapper().batchInsert(newTaxDeclareRecords); + } + // 淇濆瓨涓◣鐢虫姤琛 + if (CollectionUtils.isNotEmpty(newTaxDeclarations)) { + getTaxDeclarationService(user).saveBatch(newTaxDeclarations); + } + // 淇濆瓨涓◣鐢虫姤琛ㄦ槑缁 + if (CollectionUtils.isNotEmpty(newTaxDeclarationValues)) { + getTaxDeclarationValueService(user).batchSave(newTaxDeclarationValues); + } + // 淇濆瓨绱鎯呭喌 + if (CollectionUtils.isNotEmpty(newAddUpSituations)) { + Map> addUpSituationMap = SalaryEntityUtil.group2Map(newAddUpSituations, e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); + for (Map.Entry> entry : addUpSituationMap.entrySet()) { + getAddUpSituationService(user).deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); + getAddUpSituationService(user).batchSave(entry.getValue()); + } + } + + //琛ュ厖姝e父宸ヨ祫钖噾鐨勭敵鎶ヤ汉鍛 + newTaxDeclareRecords.forEach(taxDeclareRecordPO -> { + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecordPO); + }); + + + //鏇存柊鏍哥畻璁板綍鐘舵 + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); + // 璁板綍鏃ュ織 + for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鐢熸垚涓◣鐢虫姤琛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鐢熸垚涓◣鐢虫姤琛")); + loggerContext.setNewValues(taxDeclareRecord); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + } + + public List listBySalaryMonth(SalaryAcctRecordPO po) { + return getSalaryAcctRecordMapper().listSome(po); + } + + public List listByTaxCycle(SalaryAcctRecordPO po) { + return getSalaryAcctRecordMapper().listSome(po); + } + + @Override + public void refreshData(Long id) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "鍙傛暟寮傚父锛屼釜绋庣敵鎶ヨ褰曚笉瀛樺湪鎴栧凡琚垹闄")); + } + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), NOT_DECLARE.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182700, "瀵逛笉璧凤紝鍙湁鏈敵鎶ョ姸鎬佷笅鍙互鍒锋柊鏁版嵁")); + } + // 鏌ヨ绋庢鎵灞炴湡涓嬬殑钖祫鏍哥畻浜哄憳 + SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam + .builder() + .taxAgentIds(Collections.singletonList(taxDeclareRecord.getTaxAgentId())) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .build(); + List salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByTaxCycleAndTaxAgentId(salaryAcctEmployeeQueryParam); + // 鏌ヨ钖祫鏍哥畻璁板綍 + Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId); + List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); + // 濡傛灉瀛樺湪鏈綊妗g殑钖祫鏍哥畻璁板綍锛屼笉鍏佽鐢熸垚涓◣鐢虫姤琛 + boolean notArchived = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + if (notArchived) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}鏈夋湭褰掓。鏁版嵁锛岃鍏ㄩ儴褰掓。鍚庡啀鐢虫姤").replace("{0}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getSalaryMonth()))); + } + + TaxDeclarationResult taxDeclarationResult = generateReportPerRecord(taxDeclareRecord, salaryAcctEmployees); + // 鏇存柊涓◣鐢虫姤璁板綍 + taxDeclareRecord.setDisplayUpdateIcon(0).setUpdateTime(new Date()); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + // 鍒犻櫎鍘熸潵鐨勭敵鎶ヨ〃锛屼繚瀛樻柊鐢熸垚鐨 + getTaxDeclarationService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarations())) { + getTaxDeclarationService(user).saveBatch(taxDeclarationResult.getTaxDeclarations()); + } + // 鍒犻櫎鍘熸潵鐨勭敵鎶ヨ〃鏄庣粏锛屼繚瀛樻柊鐢熸垚鐨 + getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getTaxDeclarationValues())) { + getTaxDeclarationValueService(user).batchSave(taxDeclarationResult.getTaxDeclarationValues()); + } + // 淇濆瓨绱鎯呭喌 + if (CollectionUtils.isNotEmpty(taxDeclarationResult.getAddUpSituations())) { + Map> addUpSituationMap = SalaryEntityUtil.group2Map(taxDeclarationResult.getAddUpSituations(), e -> SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())); + for (Map.Entry> entry : addUpSituationMap.entrySet()) { + getAddUpSituationService(user).deleteByTaxYearMonthAndTaxAgentIds(YearMonth.parse(entry.getKey()), SalaryEntityUtil.properties(entry.getValue(), AddUpSituation::getTaxAgentId)); + getAddUpSituationService(user).batchSave(entry.getValue()); + } + } + + //琛ュ厖姝e父宸ヨ祫钖噾鐨勭敵鎶ヤ汉鍛 + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecord); + + //鏇存柊鏍哥畻璁板綍鐘舵 + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclareRecord.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍒锋柊涓◣鐢虫姤鏁版嵁")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍒锋柊涓◣鐢虫姤鏁版嵁")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + private TaxDeclarationResult generateReportPerRecord(TaxDeclareRecordPO taxDeclareRecord, List salaryAcctEmployees) { + Date now = new Date(); + List taxDeclarations = Lists.newArrayList(); + List taxDeclarationValues = Lists.newArrayList(); + List addUpSituations = Lists.newArrayList(); + // 鏌ヨ钖祫椤圭洰 + List salaryItems = getSalaryItemService(user).listAll(); + // 鏌ヨ涓◣鐢虫姤琛ㄥ垪 + List taxReportColumns = getTaxReportColumnService(user).listAll(); + Map> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory); + // 鏌ヨ钖祫鏍哥畻璁板綍 + List salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalaryAcctRecordId, Collectors.toList()); + List salaryAcctRecords = getSalaryAcctRecordService(user).listByIds(salaryAcctRecordIds); + Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); + // 鏌ヨ钖祫鏍哥畻缁撴灉 + List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getId, Collectors.toList()); + List salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); + // 鏌ヨ钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + List salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getSalarySobId, Collectors.toList()); + List salarySobAddUpRules = getSalarySobAddUpRuleService(user).listBySalarySobIds(salarySobIds); + Map salarySobAddUpRuleMap = SalaryEntityUtil.convert2Map(salarySobAddUpRules, e -> e.getSalarySobId() + "-" + e.getAddUpColumnDataIndex()); + // 鏌ヨ钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瀵瑰簲瑙勫垯 + List salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(salarySobIds); + Map salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, e -> e.getSalarySobId() + "-" + e.getReportColumnDataIndex()); + // 钖祫鏍哥畻缁撴灉鎸夌収钖祫鏍哥畻浜哄憳id鑱氬悎鍒嗙被 + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); + // 钖祫鏍哥畻浜哄憳鎸夌収鎵寰楅」鐩仛鍚堝垎绫 + Map> incomeCategoryKeyEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory); + for (Map.Entry> incomeCategoryEntry : incomeCategoryKeyEmployeeMap.entrySet()) { + List controlViewSalaryAcctRecords = incomeCategoryEntry.getValue().stream().map(e -> salaryAcctRecordMap.get(e.getSalaryAcctRecordId())).distinct().filter(e -> Objects.equals(e.getControlView(), 1)).collect(Collectors.toList()); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).incomeCategory(Util.getIntValue(incomeCategoryEntry.getKey())).taxAgentId(taxDeclareRecord.getTaxAgentId()).salaryMonth(taxDeclareRecord.getSalaryMonth()).taxCycle(taxDeclareRecord.getTaxCycle()).description(taxDeclareRecord.getRemark()).controlView(CollectionUtils.isEmpty(controlViewSalaryAcctRecords) ? 0 : 1).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + taxDeclarations.add(taxDeclaration); + // 钖祫鏍哥畻缁撴灉 + Set salaryAcctEmployeeIdSet = SalaryEntityUtil.properties(incomeCategoryEntry.getValue(), SalaryAcctEmployeePO::getId); + List> resultValues = salaryAcctEmployeeIdSet.stream().map(salaryAcctResultValueMap::get).filter(Objects::nonNull).collect(Collectors.toList()); + TaxDeclareContext taxDeclareContext = new TaxDeclareContext() + .setSalaryAcctRecordMap(salaryAcctRecordMap) + .setSalaryAcctEmployees(incomeCategoryEntry.getValue()) + .setSalaryAcctResultValues(salaryAcctResultValues) + .setTaxDeclaration(taxDeclaration) + .setSalarySobTaxReportRuleMap(salarySobTaxReportRuleMap) + .setSalarySobAddUpRuleMap(salarySobAddUpRuleMap) + .setTaxReportColumns(taxReportColumnMap.get(incomeCategoryEntry.getKey())) + .setSalaryItems(salaryItems); + TaxDeclarationStrategy taxDeclarationStrategy = new TaxDeclarationCommon(); + TaxDeclarationGenerateResult generateResult = taxDeclarationStrategy.generate(taxDeclareContext, (long) user.getUID()); + taxDeclarationValues.addAll(generateResult.getTaxDeclarationValues()); + addUpSituations.addAll(generateResult.getAddUpSituations()); + } + return new TaxDeclarationResult().setTaxDeclarations(taxDeclarations).setTaxDeclarationValues(taxDeclarationValues).setAddUpSituations(addUpSituations); + } + + /** + * 鏍¢獙鏄惁鍙互鐢熸垚涓◣鐢虫姤琛 + * + * @param saveParam + * @param taxAgentNameMap + * @param salaryAcctRecords + * @param salaryAcctTaxAgents + */ + private List checkBeforeSave(TaxDeclarationSaveParam saveParam, Map taxAgentNameMap, List salaryAcctRecords, List salaryAcctTaxAgents) { + List resultList = Lists.newArrayList(); + // 濡傛灉瀛樺湪鏈綊妗g殑钖祫鏍哥畻璁板綍锛屼笉鍏佽鐢熸垚涓◣鐢虫姤琛 + boolean notArchived = salaryAcctRecords.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + if (notArchived) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}鏈夋湭褰掓。鏁版嵁锛岃鍏ㄩ儴褰掓。鍚庡啀鐢虫姤").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + } + // 鏌ヨ宸插綊妗g殑钖祫鏍哥畻璁板綍 + List archivedSalaryAcctRecords = salaryAcctRecords.stream().filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue())).collect(Collectors.toList()); + // 鏃犲凡褰掓。鐨勮柂璧勬牳绠楄褰曪紝涓嶅厑璁哥敓鎴愪釜绋庣敵鎶ヨ〃 + if (CollectionUtils.isEmpty(archivedSalaryAcctRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177860, "{0}鏃犲彲鐢虫姤鏁版嵁").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + } + // 鏌ヨ宸插綊妗g殑钖祫鏍哥畻璁板綍鏄惁宸茬粡鐢熸垚杩囦釜绋庣敵鎶ヨ〃 + Map> taxCycleKeySalaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxCycle); + for (Map.Entry> taxCycleEntry : taxCycleKeySalaryAcctTaxAgentMap.entrySet()) { + Set archivedTaxAgentIds = SalaryEntityUtil.properties(taxCycleEntry.getValue(), SalaryAcctTaxAgentPO::getTaxAgentId); + List taxDeclareRecords = listBySalaryMonthAndTaxAgentIds(saveParam.getSalaryMonth(), archivedTaxAgentIds); + TaxDeclareRecordPO declareSuccessTaxDeclareRecord = taxDeclareRecords.stream().filter(taxDeclareRecordPO -> archivedTaxAgentIds.contains(taxDeclareRecordPO.getTaxAgentId()) && !(Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); + // 宸茬粡鐢虫姤鎴愬姛浜嗙殑涓◣鐢虫姤琛ㄧ殑涓◣鎵g即涔夊姟浜轰笉鍏佽閲嶆柊鐢熸垚 + if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "宸插紑鍚櫤鑳界畻钖笟鍔★紝涓◣鎵g即涔夊姟浜簕0}鐨勭◣娆炬墍灞炴湡{1}鐨勪釜绋庣敵鎶ヨ〃姝e湪鐢虫姤涓垨鑰呭凡缁忕敵鎶ユ垚鍔燂紝涓嶅彲閲嶅鐢熸垚").replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())).replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); + } + resultList.addAll(taxDeclareRecords); + } + return resultList; + } + + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜鸿寖鍥存煡璇釜绋庢墸缂翠箟鍔′汉 + * + * @param saveParam + * @return + */ + private Collection queryByTaxAgentRange(TaxDeclarationSaveParam saveParam) { + Collection taxAgents; + if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ALL_TAX_AGENT) { + // 鍒ゆ柇褰撳墠鏄惁寮鍚簡鍒嗘潈 + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); + // 鍒ゆ柇鏄惁鏄荤鐞嗗憳 + Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); + if (openDevolution && !isChief) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160523, "瀵逛笉璧凤紝鎮ㄤ笉鏄柂閰ā鍧楃殑鎬荤鐞嗗憳锛屼笉鍏峰鐢熸垚鎵鏈変釜绋庢墸缂翠箟鍔′汉鐨勬潈闄")); + } + taxAgents = getTaxAgentService(user).listAll(); + } else if (saveParam.getTaxAgentRange() == TaxAgentRangeEnum.ADMIN_TAX_AGENT) { + taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + } else { +// taxAgents = getTaxAgentService(user).listByIds(saveParam.getTaxAgentIds()); + TaxAgentPO po = getTaxAgentService(user).getById(saveParam.getTaxAgentId()); + return Collections.singletonList(po); + } + return taxAgents; + } + + @Override + public void updateIcon(Long id, Integer displayIcon) { + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (taxDeclareRecord == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + taxDeclareRecord.setDisplayUpdateIcon(displayIcon); + taxDeclareRecord.setUpdateTime(new Date()); + getTaxDeclareRecordMapper().update(taxDeclareRecord); + } + + @Override + public void updateByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds) { + if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + List taxDeclareRecords = listByTaxCycleAndTaxAgentIds(taxCycle, taxAgentIds); + if (CollectionUtils.isEmpty(taxDeclareRecords)) { + return; + } + Date now = new Date(); + taxDeclareRecords.forEach(e -> { + e.setDisplayUpdateIcon(1).setUpdateTime(now); + getTaxDeclareRecordMapper().update(e); + }); + } + + @Override + public boolean checkByAuthority(TaxDeclarationPO taxDeclaration) { +// // 鍒ゆ柇鏄惁浠呮湰浜哄彲瑙 +// if (Objects.equals(taxDeclaration.getControlView(), 1) && !Objects.equals(taxDeclaration.getCreator(), employeeId)) { +// return false; +// } +// // 鍒ゆ柇鏄惁寮鍚簡鍒嗘潈 +// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(tenantKey); +// // 鍒ゆ柇鏄惁鏄荤鐞嗗憳 +// Boolean isChief = getTaxAgentService(user).isChief(employeeId); +// // 鍙鑼冨洿鍐呯殑涓◣鎵g即涔夊姟浜 +// List taxAgents = Lists.newArrayList(); +// if (openDevolution) { +// if (isChief) { +// taxAgents = getTaxAgentService(user).listAsChief(true, true); +// } else { +// taxAgents = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); +// } +// if (CollectionUtils.isEmpty(taxAgents)) { +// return false; +// } +// Set taxAgentIds = SalaryEntityUtil.properties(taxAgents, TaxAgentPO::getId); +// return taxAgentIds.contains(taxDeclaration.getTaxAgentId()); +// } + // 鏌ヨ涓◣鐢虫姤琛 + return true; + } + + @Override + public void deleteByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return; + } + List taxDeclareRecords = listByIds(ids); + if (CollectionUtils.isEmpty(taxDeclareRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160524, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡琚垹闄")); + } + List cantDeleteTaxDeclareRecords = taxDeclareRecords.stream().filter(e -> !(Objects.equals(e.getTaxDeclareType(), TaxDeclareTypeEnum.NORMAL_DECLARE.getValue()) && Objects.equals(e.getTaxDeclareStatus(), NOT_DECLARE.getValue()))).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(cantDeleteTaxDeclareRecords)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(177854, "涓◣鐢虫姤琛ㄥ凡缁忕敵鎶ワ紝鏃犳硶鍒犻櫎")); + } + getTaxDeclareRecordMapper().deleteByIds(ids); + // 鍒犻櫎涓◣鐢虫姤琛 + getTaxDeclarationService(user).deleteByTaxDeclareRecordIds(ids); + // 鍒犻櫎涓◣鐢虫姤琛ㄦ槑缁 + getTaxDeclarationValueService(user).deleteByTaxDeclareRecordIds(ids); + + taxDeclareRecords.forEach(po -> { + // 鑾峰彇褰撳墠涓◣鎵g即涔夊姟浜轰笅鐨勮柂璧勮处濂 + List salarySobPOS = getSalarySobService(user).listByTaxAgentId(po.getTaxAgentId()); + List salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList()); + // 鑾峰彇璁板綍 + LocalDateRange dateRange = new LocalDateRange(po.getTaxCycle(), po.getTaxCycle()); + List salaryAcctRecords = getSalaryAcctRecordService(user).listBySalarySobIdsAndTaxCycle(salarySobIds, dateRange); + List salaryAcctRecordIds = salaryAcctRecords.stream().map(SalaryAcctRecordPO::getId).collect(Collectors.toList()); + // 鍒犻櫎涓◣鐢虫姤琛 + // 淇敼钖祫鏍哥畻璁板綍鐘舵佷负宸插綊妗 + if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + } + }); + + // 璁板綍鏃ュ織 + writeDeleteLog(taxDeclareRecords); + } + + private void writeDeleteLog(List taxDeclareRecords) { + // 璁板綍鏃ュ織 + List taxAgents = getTaxAgentService(user).listByIds(SalaryEntityUtil.properties(taxDeclareRecords, TaxDeclareRecordPO::getTaxAgentId)); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + for (TaxDeclareRecordPO taxDeclareRecord : taxDeclareRecords) { + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "鍒犻櫎涓◣鐢虫姤琛")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "鍒犻櫎涓◣鐢虫姤琛")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + } + + @Override + public void declare(Long id, Integer reportType) { + + DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); + + + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160526, "鐩墠姝e浜庣敵鎶ヤ腑锛岃绋嶅悗鐗囧埢鍐嶇偣鍑汇岀敵鎶ュ弽棣堛嶈幏鍙栫粨鏋")); + } + if (StringUtils.isNotEmpty(declareStatus.getRequestId()) && Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160527, "鐩墠姝e浜庝綔搴熺敵鎶ヤ腑锛岃绋嶅悗鐗囧埢鍐嶇偣鍑汇屼綔搴熷弽棣堛嶈幏鍙栫粨鏋")); + } + + // 鏌ヨ涓◣鐢虫姤琛 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); + if (CollectionUtils.isEmpty(taxDeclarations)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "褰撳墠鏃犲彲鐢虫姤鐨勬暟鎹")); + } + AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam().setTaxDeclareRecordId(taxDeclareRecord.getId()).setTaxAgentId(taxDeclareRecord.getTaxAgentId()).setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 鏌ヨ鏄惁瀛樺湪鏈夋湭鎶ラ佺殑浜 + List notDeclareTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); + if (CollectionUtils.isNotEmpty(notDeclareTaxDeclareEmployees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(162125, "瀛樺湪鏈夋湭鎶ラ佺殑浜猴紝璇峰厛鎶ラ佺浉鍏充汉鍛樺悗鍐嶇敵鎶ヤ釜绋")); + } + // 鏌ヨ鏄惁瀛樺湪娌℃湁鐢虫姤鏁版嵁鐨勪汉 + List noValueTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); + if (CollectionUtils.isNotEmpty(noValueTaxDeclareEmployees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160535, "瀛樺湪娌℃湁鐢虫姤鏁版嵁鐨勪汉锛岃閲嶆柊鏍哥畻杩欎簺浜虹殑钖祫鍚庡啀鏉ョ敵鎶ヤ釜绋")); + } + // 鏌ヨ涓◣鐢虫姤琛ㄧ殑鐢虫姤鏁版嵁 + Set taxDeclarationIds = SalaryEntityUtil.properties(taxDeclarations, TaxDeclarationPO::getId); + List taxDeclarationValues = getTaxDeclarationValueService(user).listByTaxDeclarationIds(taxDeclarationIds); + // 鏌ヨ鏈◣娆炬墍灞炴湡鍐呮姤閫佹垚鍔熺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); + employeeDeclares = employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).collect(Collectors.toList()); + + // 鏌ヨ鍏朵粬鍏嶇◣鎵i櫎鏄庣粏 + Map> taxFreeMap = getOtherDeductionDetailMap(taxDeclareRecord); + + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 鏌ヨ涓◣鐢虫姤琛ㄧ殑琛ㄥご + List taxReportColumns = getTaxReportColumnService(user).listAll(); + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 浜哄憳鍒楄〃 + List> employeeDeclareParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + requestParam.put("rylb", employeeDeclareParam); + + if (declareReportType == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) { + // 缁煎悎鎵寰 + Map taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap); + requestParam.put("zhsd", taxDeclarationParam); + } + + if (declareReportType == DeclareReportTypeEnum.CLASSIFIED_INCOME) { + //鍒嗙被鎵寰 + Map flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap); + requestParam.put("flsd", flsdRequestParam); + } + + if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) { + //闈炲眳姘戞墍寰椾唬鎵d唬缂 fjmsd + Map fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap); + requestParam.put("fjmsd", fjmsdRequestParam); + } + + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX; + 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("涓◣鐢虫姤鏁版嵁:params {} ,res {}, taxDeclareRecord: {}",reqJson, res, taxDeclareRecord); + DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class); + if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg()); + } + + // 鍒犻櫎涓◣鐢虫姤鐢虫姤澶辫触鐨勬暟鎹 + getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + + //鏇存柊涓◣鐢虫姤鐘舵 + declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); + declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId()); + declareStatus.setTaxDeclareErrorMsg(""); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "鍦ㄧ嚎鐢虫姤")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "鍦ㄧ嚎鐢虫姤")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + private Map> getOtherDeductionDetailMap(TaxDeclareRecordPO taxDeclareRecord) { + Map> taxFreeMap = new HashMap<>(); + OtherDeductionFreeListQueryParam queryParam = OtherDeductionFreeListQueryParam.builder().taxAgentId(taxDeclareRecord.getTaxAgentId()).taxCycle(taxDeclareRecord.getTaxCycle()).build(); + + List freeIncomes = getOtherDeductionService(user).queryFreeIncomes(queryParam); + Map> freeIncomeMap = freeIncomes.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.FREE_INCOME, freeIncomeMap); + + List healthInsurances = getOtherDeductionService(user).queryHealthInsurances(queryParam); + Map> healthInsuranceMap = healthInsurances.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.HEALTH_INSURANCE, healthInsuranceMap); + + List endowmentInsurances = getOtherDeductionService(user).queryEndowmentInsurances(queryParam); + Map> endowmentInsuranceMap = endowmentInsurances.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.ENDOWMENT_INSURANCE, endowmentInsuranceMap); + + List grantDonations = getOtherDeductionService(user).queryGrantDonations(queryParam); + Map> grantDonationMap = grantDonations.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.GRANT_DONATION, grantDonationMap); + + List derateDeductions = getOtherDeductionService(user).queryDerateDeductions(queryParam); + Map> derateDeductionMap = derateDeductions.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.DERATE_DEDUCTION, derateDeductionMap); + + List otherDerateDeductions = getOtherDeductionService(user).queryOtherDerateDeductions(queryParam); + Map> otherDerateDeductionMap = otherDerateDeductions.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth()))); + taxFreeMap.put(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION, otherDerateDeductionMap); + return taxFreeMap; + } + + @Override + public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); + + if (StringUtils.isEmpty(declareStatus.getRequestId()) || !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156496, "璇峰厛鐐瑰嚮銆屽湪绾跨敵鎶ャ嶅悗鍐嶇偣鍑汇岀敵鎶ュ弽棣堛嶈幏鍙栫敵鎶ョ粨鏋")); + } + + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_TAX_FEEDBACK; + ImmutableMap requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + ""); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("鐢虫姤鍙嶉杩斿洖鏁版嵁: {}, taxDeclareRecord: {},declareStatus :{}", res, JsonUtil.toJsonString(taxDeclareRecord), JsonUtil.toJsonString(declareStatus)); + DeclareTaxFeedbackResponse declareTaxFeedbackResponse = JsonUtil.parseObject(res, DeclareTaxFeedbackResponse.class); + if (Objects.isNull(declareTaxFeedbackResponse) || Objects.isNull(declareTaxFeedbackResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(declareTaxFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(declareTaxFeedbackResponse.getHead().getMsg()); + } + // 鐢虫姤鍙嶉鐘舵 + Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), -1); + DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); + if (declareFeedBackStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); + } + // 鏌ヨ鎶ラ佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId()); + Map employeeInfoMap = SalaryEntityUtil.convert2Map(employeeDeclares, e -> e.getEmployeeName() + "-" + e.getCardNum()); + // 娴侀噺缁熻 + TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(taxDeclareRecord.getTaxCycle(), apiConfig, EnumDeclareApiBusinessType.TAX_DECLARATION, (long) user.getUID()); + + Date now = new Date(); + List errorMsg = Lists.newArrayList(); + List taxDeclareFails = Lists.newArrayList(); + if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { + List failInfoList = JsonUtil.parseList(Util.null2String(declareTaxFeedbackResponse.getBody().getOrDefault("fknr", "")).replace("\\\"", "\""), Map.class); + for (Map map : failInfoList) { + if (map.containsKey("details")) { + List details = JsonUtil.parseList(map.get("details"), List.class); + if (details != null) { + for (List detail : details) { + String employeeName = Util.null2String(detail.get(0)); + String cardNum = Util.null2String(detail.get(2)); + String detailMsg = Util.null2String(detail.get(1)); + errorMsg.add("銆" + employeeName + "銆" + detailMsg); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .employeeName(employeeName) + .cardNum(cardNum) + .incomeCategory("") + .errorMsg(detailMsg) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + taxDeclareFails.add(taxDeclareFailPO); + // 娴侀噺浣跨敤璁板綍 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); + } + } + } + if (map.containsKey("employeeList")) { + List emps = JsonUtil.parseList(map.get("employeeList"), Map.class); + if (emps != null) { + for (Map detail : emps) { + String employeeName = Util.null2String(detail.get("xm")); + String cardNum = Util.null2String(detail.get("zzhm")); + String detailMsg = Util.null2String(detail.get("cwxx")); + errorMsg.add("銆" + employeeName + "銆" + detailMsg); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder() + .id(IdGenerator.generate()). + taxDeclareRecordId(taxDeclareRecord.getId()) + .employeeName(employeeName) + .cardNum(cardNum) + .incomeCategory("") + .errorMsg(detailMsg) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator((long) user.getUID()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .build(); + taxDeclareFails.add(taxDeclareFailPO); + // 娴侀噺浣跨敤璁板綍 + EmployeeDeclarePO employeeDeclarePO = employeeInfoMap.get(employeeName + "-" + cardNum); + if (Objects.isNull(employeeDeclarePO)) { + continue; + } + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), employeeDeclarePO.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + employeeInfoMap.remove(employeeName + "-" + cardNum); + } + } + } + } + declareStatus.setTaxDeclareErrorMsg(String.join(",", errorMsg)); + } else { + //娓呴櫎涔嬪墠鐨勯敊璇 + declareStatus.setTaxDeclareErrorMsg(""); + } + // 鐢虫姤鐘舵 + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1), TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); + } + // 涓哄鐞嗗紓甯告儏鍐碉紝濡傛灉鍙嶉鐘舵佷负鐢虫姤澶辫触锛屽垯璁板綍鐢虫姤鐘舵佷篃涓虹敵鎶ュけ璐 + if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { + taxDeclareStatusEnum = TaxDeclareStatusEnum.DECLARE_FAIL; + } + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + // 鐢虫姤绫诲瀷 + declareStatus.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); + String nsrc = Util.null2String(declareTaxFeedbackResponse.getBody().get("nsrc")); + declareStatus.setPersonNum(Integer.parseInt(NumberUtil.isNumber(nsrc) ? nsrc : "0")); + declareStatus.setDeclareRequestId(declareStatus.getRequestId()); + declareStatus.setRequestId(""); + //瀹炵即锛堜笉鍚粸绾抽噾锛 + BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount()); + //搴旂即 + BigDecimal payAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount()); + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { + // 濡傛灉鏄凡缂寸撼鐘舵侊紝鍒欐洿鏂板凡缂寸撼閲戦锛屽垽鏂槸鍚﹂渶瑕佺嚎涓嬮绋 + if (purePaidAmount.compareTo(payAmount) > 0) { + declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount()); + taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(183789, "搴旂即绋庨锛堜笉鍚粸绾抽噾绛夛級锛%s鍏冿紝宸茬即閲戦锛堝彲鑳藉惈婊炵撼閲戠瓑锛夛細%s鍏冿紝褰撳墠宸茬即娆鹃噾棰濆ぇ浜庡簲缂寸撼閲戦锛岃绾夸笅鍓嶅線鍔炵◣澶у巺鍔炵悊閫娆俱"), payAmount, paidAmount)); + taxDeclarationRate.setMsgPersist(true); + } else if (purePaidAmount.compareTo(payAmount) == 0) { + declareStatus.setTaxPayAmount(BigDecimal.ZERO.toString()); + } else { + throw new SalaryRunTimeException("缂存鏁版嵁寮傚父锛岃澶勭悊鍚庨噸璇"); + } + } else if (TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.equals(taxDeclareStatusEnum)) { + // 濡傛灉涓嶆槸宸茬即绾崇姸鎬侊紝鍒欏噺鎺変箣鍓嶇殑宸茬即绾抽噾棰濆幓鏇存柊搴旂即绾抽噾棰 + declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + } + //鏇存柊鐢虫姤鐘舵 + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); + + // 濡傛灉鐢虫姤澶辫触 + if (CollectionUtils.isNotEmpty(taxDeclareFails)) { + getTaxDeclareFailService(user).saveBatch(taxDeclareFails); + } + // 鏇存柊娴侀噺浣跨敤璁板綍 + employeeInfoMap.forEach((key, value) -> { + TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, taxDeclareRecord.getTaxAgentId(), value.getEmployeeId()); + flowDetailPO.setResultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue()); + apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO); + }); + getTaxDeclarationApiBillingService(user).updateApiFlowInfo(apiFlowUpdateWrapper); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍙嶉")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍙嶉")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void cancelDeclare(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Long taxAgentId = taxDeclareRecord.getTaxAgentId(); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); + // 鏇存鐢虫姤鎴愬姛鍚庝笉鑳戒綔搴 + if (Objects.equals(declareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "鏇存鐢虫姤鍚庝笉鍏佽浣滃簾")); + } + // 鍙湁鐢虫姤鎴愬姛锛屾棤闇缂存/鐢虫姤鎴愬姛锛屾湭缂存鐨勭姸鎬佹墠鑳戒綔搴 + if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "鍙湁鐢虫姤鎴愬姛锛屾棤闇缂存/鐢虫姤鎴愬姛锛屾湭缂存鐨勭姸鎬佹墠鑳戒綔搴")); + } + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 鐢虫姤绫诲瀷 + requestParam.put("sblx", reportType + ""); + // 浣滃簾閾惰仈缂存鍑瘉 +// ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); + // 鏄惁娓呯┖鎵寰 + requestParam.put("sfqksd", "0"); + + Map responseParam = new HashMap<>(); + responseParam.put("reportType", reportType + ""); + DeclareClient declareClient = new DeclareClient(taxAgentId); + CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = declareClient.cancel(requestParam, responseParam); + + // 浣滃簾鏄惁鎴愬姛 + CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); + if (cancelDeclareStatusEnum == CancelDeclareStatusEnum.CANCEL_FAIL) { + String feedbackBody = Util.null2String(cancelDeclareFeedbackResponse.getBody().get("fknr")).replace("\\", ""); + List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream().map(e -> Util.null2String(e.get("msg"))).collect(Collectors.toList()); + taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(156508, "浣滃簾澶辫触锛") + StringUtils.join(errorMsgList, ",")); + } + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); + } + + //鏇存柊涓◣鐢虫姤鐘舵 + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鐢虫姤浣滃簾")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鐢虫姤浣滃簾")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void getCancelFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); + + + if (!Objects.equals(declareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(declareStatus.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "璇峰厛鐐瑰嚮銆屼綔搴熺敵鎶ャ嶅悗鍐嶆潵鐐瑰嚮銆岀敵鎶ュ弽棣堛嶆寜閽幏鍙栫粨鏋")); + } + + // 渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; + ImmutableMap requestParam = ImmutableMap.of("requestId", declareStatus.getRequestId(), "reportType", reportType + ""); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("浣滃簾鍙嶉杩斿洖鏁版嵁锛" + res); + CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = JsonUtil.parseObject(res, CancelDeclareFeedbackResponse.class); + if (Objects.isNull(cancelDeclareFeedbackResponse) || Objects.isNull(cancelDeclareFeedbackResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(cancelDeclareFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(cancelDeclareFeedbackResponse.getHead().getMsg()); + } + // 浣滃簾鏄惁鎴愬姛 + CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class); + if (cancelDeclareStatusEnum == CancelDeclareStatusEnum.CANCEL_FAIL) { + String feedbackBody = Util.null2String(cancelDeclareFeedbackResponse.getBody().get("fknr")).replace("\\", ""); + List errorMsgList = JsonUtil.parseList(feedbackBody, Map.class).stream().map(e -> Util.null2String(e.get("msg"))).collect(Collectors.toList()); + taxDeclarationRate.setStatus(false).setMsg(SalaryI18nUtil.getI18nLabel(156508, "浣滃簾澶辫触锛") + StringUtils.join(errorMsgList, ",")); + } + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("sbztbj"), 1), TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); + } + + //鏇存柊涓◣鐢虫姤鐘舵 + declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + declareStatus.setRequestId(""); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鑾峰彇鐢虫姤浣滃簾鐨勫弽棣")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鑾峰彇鐢虫姤浣滃簾鐨勫弽棣")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + + @Override + public Object getCompanyIncomes(GetCompanyIncomesQueryParam param) { + Long id = param.getId(); + TaxDeclareRecordPO taxDeclareRecord = getById(id); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + Map requestParam = declareClient.initRequestMap(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + requestParam.put("pageSize", 10000); + requestParam.put("pageNo", 1); + requestParam.put("reportType", param.getReportType()); + GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetCompanyIncomesResponse(map, companyIncomes)); + return map; + } + + @Override + public XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param) { + Long id = param.getId(); + TaxDeclareRecordPO taxDeclareRecord = getById(id); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + Map requestParam = declareClient.initRequestMap(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + requestParam.put("pageSize", 10000); + requestParam.put("pageNo", 1); + requestParam.put("reportType", param.getReportType()); + GetCompanyIncomesResponse companyIncomes = declareClient.getCompanyIncomes(requestParam); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream() + .map(TaxDeclarationPO::getIncomeCategory) + .map(IncomeCategoryEnum::parseByValue) + .filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType())) + .collect(Collectors.toList()) + .forEach(e -> e.parseGetCompanyIncomesResponse(map, companyIncomes)); + + return ExcelUtil.genWorkbookV2(map); + } + + @Override + public Object getDeclareTaxResultFeedback(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + } + + @Override + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + Long id = param.getId(); + TaxDeclareRecordPO taxDeclareRecord = getById(id); + String requestId = param.getRequestId(); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, param.getReportType()); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? declareStatus.getDeclareRequestId() : requestId); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream() + .map(TaxDeclarationPO::getIncomeCategory) + .map(IncomeCategoryEnum::parseByValue) + .filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType())) + .collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + return ExcelUtil.genWorkbookV2(map); + } + + + @Override + public void updateDeclare(Long id, Integer reportType) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, reportType); + + + List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); + if (!taxDeclareStatusEnumValueList.contains(declareStatus.getTaxDeclareStatus())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "瀵逛笉璧凤紝鍙湁鐢虫姤鎴愬姛鍚庢墠鍏佽鏇存鐢虫姤")); + } + // 渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 鐢虫姤绫诲瀷 + requestParam.put("sblx", reportType + ""); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + declareClient.correct(requestParam); + + //鏇存柊鐢虫姤鐘舵 + declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); + declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue()); + declareStatus.setRequestId(""); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true); + + // 璁板綍鏃ュ織 + TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecord.getTaxCycle()))); + loggerContext.setUser(user); + loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鏇存鐢虫姤")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鏇存鐢虫姤")); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void cancelCorrect(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); +// List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); +// if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "瀵逛笉璧凤紝鍙湁鐢虫姤鎴愬姛鍚庢墠鍏佽鏇存鐢虫姤")); +// } + // 渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 鐢虫姤绫诲瀷 + requestParam.put("sblx", "1"); + // 璇锋眰 + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("鎾ら攢鏇存鐢虫姤璇锋眰鏁版嵁锛" + reqJson); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_CORRECT; + 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("鎾ら攢鏇存鐢虫姤杩斿洖鏁版嵁锛" + res); + UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); + if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); + } +// taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); +// taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); +// taxDeclareRecord.setRequestId(""); +// taxDeclareRecord.setUpdateTime(new Date()); +// getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + // 璁板綍鏃ュ織 + // TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); + // LoggerContext loggerContext = new LoggerContext<>(); + // loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); + // loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") + // .replace("{0}", taxAgent.getName()) + // .replace("{1}", taxDeclareRecord.getTaxCycle())); + // loggerContext.setOperator(Util.null2String(employeeId)); + // loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); + // loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "鏇存鐢虫姤")); + // loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "鏇存鐢虫姤")); + // taxDeclarationLoggerTemplate.write(loggerContext); + } + + + @Override + public void updateById(TaxDeclareRecordPO taxDeclareRecord) { + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + } + + + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { + // 鏌ヨ渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + if (apiConfig == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "鎺ュ彛娴侀噺涓嶈冻锛屾殏鏃犳硶浣跨敤璇ュ姛鑳斤紝璇峰厛璐拱鏅鸿兘绠楄柂鎺ュ彛娴侀噺")); + } + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "鍙傛暟寮傚父锛屼釜绋庣敵鎶ヨ褰曚笉瀛樺湪鎴栧凡琚垹闄")); + } + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + // 鏌ヨ涓◣鎵g即涔夊姟浜哄叧鑱旂殑浼佷笟淇℃伅 + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxDeclareRecord.getTaxAgentId()); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "涓◣鎵g即涔夊姟浜虹殑鎶ョ◣淇℃伅楠岃瘉鏈氳繃锛岃鍏堢淮鎶ゅソ涓◣鎵g即涔夊姟浜虹殑鎶ョ◣淇℃伅")); + } + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn); + + return new TaxDeclareRequest().setTaxDeclarationApiConfig(apiConfig).setTaxAgent(taxAgent).setTaxDeclareRecord(taxDeclareRecord).setRequestParam(requestParam); + } +} diff --git a/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java new file mode 100644 index 000000000..88e92f045 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareStatusServiceImpl.java @@ -0,0 +1,142 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper; +import com.engine.salary.service.TaxDeclarationService; +import com.engine.salary.service.TaxDeclareStatusService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.util.*; + +import static com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum.NOT_DECLARE; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareStatusService { + + + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + + private TaxDeclareStatusMapper getTaxDeclareStatusMapper() { + return MapperProxyFactory.getProxy(TaxDeclareStatusMapper.class); + } + + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + + @Override + public List getTaxDeclareStatusByTaxDeclareRecordId(Long taxDeclareRecordId) { + return getTaxDeclareStatusMapper().listSome(TaxDeclareStatusPO.builder().taxDeclareRecordId(taxDeclareRecordId).build()); + } + + @Override + public TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType) { + return getTaxDeclareStatusMapper().getDeclareStatus(taxDeclareRecordId, reportType); + } + + + @Override + public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus, boolean updateRecord) { + //鏇存柊鐢虫姤琛ㄧ姸鎬 + getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus); + + //鏇存柊涓昏褰 + if (updateRecord) { + updateRecord(declareStatus.getTaxDeclareRecordId()); + } + } + + + @Override + public List updateRecord(Long id) { + + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordMapper().getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "鍙傛暟寮傚父锛屼釜绋庣敵鎶ヨ褰曚笉瀛樺湪鎴栧凡琚垹闄")); + } + + // 鏌ヨ涓◣鐢虫姤琛 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId())); + if (CollectionUtils.isEmpty(taxDeclarations)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "褰撳墠鏃犲彲鐢虫姤鐨勬暟鎹")); + } + + Set reportTypes = new HashSet<>(); + taxDeclarations.forEach(taxDeclarationPO -> { + reportTypes.add(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getReportType().getValue()); + }); + + List statuses = new ArrayList<>(); + + int personNum = 0; + BigDecimal taxPayAmount = new BigDecimal(0); + BigDecimal taxPaidAmount = new BigDecimal(0); + BigDecimal taxPurePaidAmount = new BigDecimal(0); + + for (Integer reportType : reportTypes) { + TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType); + if (declareStatus == null) { + declareStatus = TaxDeclareStatusPO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(id) + .reportType(reportType) + .taxDeclareType(taxDeclareRecord.getTaxDeclareType()) + .taxDeclareStatus(taxDeclareRecord.getTaxDeclareStatus()) + .taxDeclareErrorMsg(taxDeclareRecord.getTaxDeclareErrorMsg()) + .personNum(taxDeclareRecord.getPersonNum()) + .taxPayAmount(taxDeclareRecord.getTaxPayAmount()) + .taxPaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .taxPurePaidAmount(taxDeclareRecord.getTaxPaidAmount()) + .deleteType(0) + .build(); + getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus); + } + statuses.add(declareStatus); + + personNum += declareStatus.getPersonNum() == null ? 0 : declareStatus.getPersonNum(); + taxPayAmount = taxPayAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount())); + taxPaidAmount = taxPaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPaidAmount())); + taxPurePaidAmount = taxPurePaidAmount.add(SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount())); + } + + //鏇存柊璁板綍鐨勭姸鎬侊紝鍚勪釜鎶ヨ〃鐘舵佷竴鑷村垯閲囩撼锛屽惁鍒欏彇鏈灏忕殑杩涘害鐘舵 + Integer declareStatusEnum = statuses.stream().map(TaxDeclareStatusPO::getTaxDeclareStatus).min(Comparator.comparing(Integer::valueOf)).orElse(NOT_DECLARE.getValue()); + + taxDeclareRecord.setPersonNum(personNum); + taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); + taxDeclareRecord.setTaxPaidAmount(taxPaidAmount.toString()); + taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.toString()); + taxDeclareRecord.setTaxDeclareStatus(declareStatusEnum); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + return statuses; + } + + +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java new file mode 100644 index 000000000..b27e4e6b4 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -0,0 +1,110 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +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.entity.taxpayment.dto.TaxAgreementBankFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxAgreementFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.AgreementQueryFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.*; + +/** + * 涓夋柟淇℃伅鏌ヨ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentAgreementServiceImpl extends AbstractTaxPaymentService { + + @Override + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + AgreementQueryFeedbackResponse feedbackResponse = (AgreementQueryFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 鏍¢獙璇锋眰缁撴灉 + String responseCode = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(AgreementQueryFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + TaxAgreementFormDTO agreementFormDTO = new TaxAgreementFormDTO(); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode) || SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + // 濡傛灉鎺ュ彛浠嶅湪澶勭悊涓紝鍒欑户缁疆璇 + return agreementFormDTO.setFinish(false); + } + // 鑾峰彇杩斿洖鐨勪汉鍛樹俊鎭垪琛 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.error("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + TaxPaymentRequestPO taxPaymentRequestPO = getTaxPaymentRequestPO(param); + if (taxPaymentRequestPO != null && taxPaymentRequestPO.getId() != null) { + getTaxPaymentRequestMapper().delete(taxPaymentRequestPO); + } + throw new SalaryRunTimeException(msg); + } + List feedbacks = Optional.of(feedbackResponse) + .map(AgreementQueryFeedbackResponse::getBody) + .map(AgreementQueryFeedbackResponse.Body::getSflb) + .orElse(new ArrayList<>()); + if (feedbacks.isEmpty()) { + log.error("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + TaxPaymentRequestPO taxPaymentRequestPO = getTaxPaymentRequestPO(param); + if (taxPaymentRequestPO != null && taxPaymentRequestPO.getId() != null) { + getTaxPaymentRequestMapper().delete(taxPaymentRequestPO); + } + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "绋庡眬鎺ュ彛閿欒锛屾湭杩斿洖鏈夋晥鏁版嵁")); + } + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + // 缁勮琛ㄥ崟鏁版嵁 + TaxAgreementBankFormDTO bankFormDTO = TaxAgreementBankFormDTO.builder() + .bank(feedbacks.get(0).getSfxyh()) + .bankNo(feedbacks.get(0).getKhhhh()) + .build(); + Map form = new HashMap<>(); + form.put("bankForm", bankFormDTO); + form.put("feedbacks", feedbacks); + + Map map = new HashMap<>(); + feedbacks.forEach(e -> { + map.put(e.getSfxyh(), e.getKhhhh()); + }); + + agreementFormDTO.setForm(form); + agreementFormDTO.setCount(map); + return agreementFormDTO.setFinish(true); + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_AGREEMENT; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + return postRequest(apiConfig, url, requestParam, clazz); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_AGREEMENT_QUERY_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + log.info("getAgreementQueryFeedback:requestId {} res {} ", requestId, res); + return JsonUtil.parseObject(res, AgreementQueryFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java new file mode 100644 index 000000000..16578143b --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -0,0 +1,72 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.TaxPaymentClient; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.*; + +/** + * 瀹岀◣璇佹槑 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentService { + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue(); + } + + @Override + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + + TaxPaymentClient taxPaymentClient = new TaxPaymentClient(param.getTaxAgentId()); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + WithheldVoucherResponse queryResponse = taxPaymentClient.getWithheldVoucher(requestParam); + + // 鏍¢獙璇锋眰缁撴灉 + String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(body -> { + if (DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue().equals(param.getReportType())) { + return body.getZhsd(); + } else if (DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue().equals(param.getReportType())) { + return body.getFlsd(); + } else if (DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue().equals(param.getReportType())) { + return body.getFjmsd(); + } else { + return body.getXsgsd(); + } + }).orElse(null); + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(feedback)) { + log.info("getWithheldVoucher code error锛歿}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗閲嶈瘯")); + } + Integer status = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + if (status.equals(1)) { + log.info("getWithheldVoucher status error锛歿}", JSON.toJSONString(queryResponse)); + throw new SalaryRunTimeException(feedback.getJksbyy()); + } + List vouchers = new ArrayList<>(); + for (int i = 1; i <= feedback.getWszmlb().size(); i++) { + vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel(184013, "瀹岀◣璇佹槑") + i, feedback.getWszmlb().get(i - 1))); + } + return new TaxWithheldVoucherResultDTO().setVouchers(vouchers); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java new file mode 100644 index 000000000..019701a54 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -0,0 +1,191 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +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.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * 涓夋柟缂存 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService { + + @Override + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + WithholdingFeedbackResponse feedbackResponse = (WithholdingFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 鏍¢獙璇锋眰缁撴灉 + String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(WithholdingFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode) || SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + // 濡傛灉鎺ュ彛浠嶅湪澶勭悊涓紝鍒欑户缁疆璇 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缂存杩樺湪澶勭悊涓紝璇风◢鍚庣偣鍑荤即娆惧弽棣")); + } + // 鑾峰彇杩斿洖鐨勪汉鍛樹俊鎭垪琛 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + + TaxDeclareStatusPO status = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(),param.getReportType()); + WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) + .map(WithholdingFeedbackResponse::getBody) + .map(body -> { + if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) { + return body.getZhsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) { + return body.getFlsdjk(); + } else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) { + return body.getFjmsdjk(); + } else { + return body.getXsgsdjk(); + } + + }) + .orElse(null); + if (feedback == null) { + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "绋庡眬鎺ュ彛閿欒锛屾湭杩斿洖鏈夋晥鏁版嵁")); + } + // 鍒ゆ柇缂存鐘舵佹槸鍚︽垚鍔 + Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException(String.format("缂存澶辫触锛屽け璐ュ師鍥狅細%s锛岀敵鎶ョ姸鎬侊細%s", feedback.getJksbyy(), feedback.getSbzt())); + } + // 绱瀹炵即閲戦 + BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); + + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) { + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException("褰撳墠鐢虫姤琛ㄧ姸鎬佷负宸茬即娆撅紝鏃犳硶鏇存柊鐘舵"); + } + BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount()); + BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount()); + if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid) && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + throw new SalaryRunTimeException("璇疯繘琛岀即娆惧悗鍐嶅埛鏂扮即娆剧姸鎬"); + } + status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); + status.setTaxPaidAmount(totalPaid.toString()); + status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); + status.setTaxPayAmount(BigDecimal.ZERO.toString()); + getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false); + + + //鏇存柊涓昏褰 + getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId()); + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount())); + + return new TaxAgreementFeedbackResultDTO() + .setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).toString())) + .setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString())) + .setPersonNum(status.getPersonNum().toString()); + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + String protocolNumber = param.getProtocolNumber(); + String paymentNumber = param.getPaymentNumber(); + Integer reportType = param.getReportType(); + String taxAmount = param.getTaxAmount(); + SalaryAssert.notBlank(protocolNumber, SalaryI18nUtil.getI18nLabel(184071, "涓夋柟鍗忚鍙蜂负绌")); + SalaryAssert.notBlank(paymentNumber, SalaryI18nUtil.getI18nLabel(184071, "缂存甯愬彿涓虹┖")); + SalaryAssert.notNull(reportType, SalaryI18nUtil.getI18nLabel(184071, "鎶ヨ〃绫诲瀷涓虹┖")); + SalaryAssert.notBlank(taxAmount, SalaryI18nUtil.getI18nLabel(184071, "搴旂撼绋庨涓虹┖")); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + requestParam.put("sfxyh", protocolNumber); + requestParam.put("jkzh", paymentNumber); + requestParam.put("bblx", reportType); + requestParam.put("ynse", taxAmount); + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Override + protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); + return tempWrapper; + } + +// @Override +// public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { +// TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO +// .builder() +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxAgentId(taxDeclareRecord.getTaxAgentId()) +// .taxYearMonth(taxDeclareRecord.getTaxCycle()) +// .build()); +//// if (paymentRequestPO != null) { +// TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); +// List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); +// statuses.forEach(status -> { +// requestParam.put("sblx", status.getReportType()); +// QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); +// SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) +// .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "閾惰仈缂存鍑瘉浣滃簾澶辫触锛岃绋嶅悗閲嶈瘯"))); +// SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()) || SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg()); +// +// getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO +// .builder() +// .feedback(SalaryOnOffEnum.ON.getValue()) +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxAgentId(taxDeclareRecord.getTaxAgentId()) +// .taxYearMonth(taxDeclareRecord.getTaxCycle()) +// .build()); +// }); +// +//// } +// } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + log.info("getWithholdingFeedback:requestId {} res {} ", requestId, res); + return JsonUtil.parseObject(res, WithholdingFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java new file mode 100644 index 000000000..5acb92777 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -0,0 +1,179 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.bo.DataCollectionBO; +import com.engine.salary.entity.datacollection.response.QuerySpecialAmountResponse; +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.entity.taxdeclaration.po.TaxDeclareRecordPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.entity.taxpayment.bo.TaxPaymentBO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithholdingVoucherFeedbackDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.SyncWithholdingFeedbackResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingVoucherFeedbackResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.remote.tax.client.TaxPaymentClient; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 缂存鍑瘉 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService { + + @Override + public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) { + WithholdingVoucherFeedbackResponse feedbackResponse = (WithholdingVoucherFeedbackResponse) checkBeforeGetFeedbackResponse(param); + // 鏍¢獙璇锋眰缁撴灉 + String responseCode = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + String msg = Optional.ofNullable(feedbackResponse).map(WithholdingVoucherFeedbackResponse::getHead).map(SzyhResponseHead::getMsg).orElse(null); + if (SzyhApiConstant.HANDLING_CODE.equals(responseCode)||SzyhApiConstant.TASK_HANDLING_CODE.equals(responseCode)) { + // 濡傛灉鎺ュ彛浠嶅湪澶勭悊涓紝鍒欑户缁疆璇 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缂存杩樺湪澶勭悊涓紝璇风◢鍚庣偣鍑荤即娆惧弽棣")); + } + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + if (feedbackResponse.getBody() == null) { + log.info("getAgreementQueryFeedbackResponse body null: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175339, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗閲嶈瘯")); + } + // 鑾峰彇杩斿洖鐨勪俊鎭垪琛 + WithholdingVoucherFeedbackResponse.Feedback synthesize = feedbackResponse.getBody().getZhsd(); + if (synthesize.getFkzt().equals("1")) { + throw new SalaryRunTimeException(synthesize.getFkms()); + } + if (SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) { + return new TaxFeedbackResultDTO().setFinish(true); + } + // 鏇存柊缂存璇锋眰涓哄凡鍙嶉 + updateTaxPaymentRequest(param); + // 缁勮鏁版嵁 + TaxWithholdingVoucherFeedbackDTO feedbackDTO = TaxPaymentBO.buildTaxWithholdingVoucherFeedbackDTO(synthesize); + List details = synthesize.getJkpzmxlb().stream().map(e -> { + TaxWithholdingVoucherFeedbackDTO.Detail detail = new TaxWithholdingVoucherFeedbackDTO.Detail(); + detail.setPaymentCode(e.getZsxmmc()); + detail.setPaymentItem(e.getZspmmc()); + detail.setPayAmount(e.getYjse()); + return detail; + }).collect(Collectors.toList()); + feedbackDTO.setDetails(details); + return feedbackDTO; + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + boolean syncStatus = clazz == SyncWithholdingFeedbackResponse.class; + String api = syncStatus ? SzyhApiConstant.GET_SYNC_WITHHOLDING_FEEDBACK : SzyhApiConstant.WITHHOLDING_VOUCHER; + String url = apiConfig.getHost() + api; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + if (syncStatus) { + requestParam.put("bblx", param.getReportType()); + } + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Override + public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map requestParam) { + List statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId()); + TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId()); + statuses.forEach(status -> { + requestParam.put("sblx", status.getReportType()); + QuerySpecialAmountResponse cancelResponse = taxPaymentClient.cancelWithholdingVoucher(requestParam); + SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead) + .orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "閾惰仈缂存鍑瘉浣滃簾澶辫触锛岃绋嶅悗閲嶈瘯"))); + SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode()), head.getMsg()); + getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO + .builder() + .feedback(SalaryOnOffEnum.ON.getValue()) + .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxYearMonth(taxDeclareRecord.getTaxCycle()) + .reportType(status.getReportType()) + .build()); + }); + } + +// @Override +// public void syncWithholdingFeedback(TaxPaymentQueryParam param) { +// TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); +// TaxPaymentClient taxPaymentClient = new TaxPaymentClient(param.getTaxAgentId()); +// Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); +// requestParam.put("bblx", param.getReportType()); +// SyncWithholdingFeedbackResponse response = taxPaymentClient.getSyncWithholding(requestParam); +// +// // 鏍¢獙璇锋眰缁撴灉 +// String responseCode = Optional.ofNullable(response) +// .map(SyncWithholdingFeedbackResponse::getHead) +// .map(SzyhResponseHead::getCode) +// .orElse(null); +// WithholdingFeedbackResponse.Feedback body = Optional.ofNullable(response) +// .map(SyncWithholdingFeedbackResponse::getBody) +// .orElse(null); +// if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(body)) { +// log.info("syncWithholdingFeedback code error锛歿}", JSON.toJSONString(response)); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "绋庡眬鎺ュ彛寮傚父锛岃绋嶅悗閲嶈瘯")); +// } +// Integer paymentStatus = SalaryEntityUtil.getIntValue(body.getJkzt(), -1); +// TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); +// if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { +// throw new SalaryRunTimeException(String.format("鏌ヨ澶辫触锛屽け璐ュ師鍥狅細%s锛岀敵鎶ョ姸鎬侊細%s", body.getJksbyy(), body.getSbzt())); +// } +// // 绱瀹炵即閲戦 +// BigDecimal totalPaid = body.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add); +// // 鏇存柊涓◣鐢虫姤璁板綍鐘舵佷负宸茬即娆 +// updateTaxDeclareRecord(param, totalPaid); +// // 鏇存柊涓夋柟缂存鍙嶉鐘舵 +// getTaxPaymentRequestMapper().updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO +// .builder() +// .feedback(SalaryOnOffEnum.ON.getValue()) +// .requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()) +// .taxDeclareRecordId(param.getTaxDeclareRecordId()) +// .build()); +// } + + @Override + public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); + } + + protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { + String url = apiConfig.getHost() + SzyhApiConstant.WITHHOLDING_VOUCHER_FEEDBACK; + String res = getRequest(apiConfig, requestId, url); + log.info("getWithholdingVoucherFeedback:requestId {} res {} ", requestId, res); + return JsonUtil.parseObject(res, WithholdingVoucherFeedbackResponse.class); + } +} diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java new file mode 100644 index 000000000..c09510bd8 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -0,0 +1,44 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxReportColumnMapper; +import com.engine.salary.service.TaxReportColumnService; +import com.engine.salary.util.db.MapperProxyFactory; + +import java.util.Arrays; +import java.util.List; + +/** + * 涓◣鐢虫姤琛ㄨ〃澶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { + + private TaxReportColumnMapper getTaxReportColumnMapper() { + return MapperProxyFactory.getProxy(TaxReportColumnMapper.class); + } + + + @Override + public List listAll() { + return getTaxReportColumnMapper().listAll(); + } + + @Override + public List listByContrastType(Integer contrastType) { + + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastType(contrastType).build()); + + } + + @Override + public List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes) { + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastTypes(Arrays.asList(contrastTypes)).incomeCategory(incomeCategory.getValue().toString()).build()); + } +} diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java new file mode 100644 index 000000000..087105b17 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckDepartmentServiceImpl.java @@ -0,0 +1,45 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CheckPasswordResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import lombok.extern.slf4j.Slf4j; + +/** + * 楠岃瘉閮ㄩ棬缂栫爜鐩稿叧鏂规硶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxReturnCheckDepartmentServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 璋冪敤绁炲窞浜戝悎API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CheckPasswordResponse response = getCheckPasswordResponse(apiConfig, po, saveParam); + verifyCheckPasswordResponse(po, response); + po.setDepartmentCode(saveParam.getDepartmentCode()); + po.setDepartmentName(saveParam.getDepartmentName()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 杩斿洖缁撴灉 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java new file mode 100644 index 000000000..8a9e315d9 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckMainServiceImpl.java @@ -0,0 +1,90 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.util.Sm4Utils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.List; +import java.util.Objects; + +/** + * 楠岃瘉涓讳綋鎶ョ◣淇℃伅鐩稿叧鏂规硶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxReturnCheckMainServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + try { + po = saveOrUpdate(apiConfig, po, saveParam); + if (NumberUtils.INTEGER_TWO.equals(saveParam.getRequestType())) { + return new TaxAgentTaxReturnCheckDTO().setStatus(po.getCheckStatus()).setMessage(po.getFailReason()); + } + } catch (Exception e) { + log.error("淇濆瓨寮傚父", e); + } + // 璋冪敤绁炲窞浜戝悎API + CompanyRegisterInfoResponse response = getCompanyRegisterInfo(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 鏋勫缓缁撴灉 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } + + private boolean hasChanged(TaxAgentTaxReturnSaveParam saveParam, TaxAgentTaxReturnPO po, TaxDeclarationApiConfigPO apiConfig) throws Exception { + return !(Objects.equals(po.getTaxCode(), saveParam.getTaxCode()) + && Objects.equals(po.getAreaCode(), saveParam.getAreaCode()) + && Objects.equals(po.getPasswordType(), TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue()) + && Objects.equals(po.getPwd(), Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword())) + && Objects.equals(po.getRealAccount(), saveParam.getAccount())); + } + + private TaxAgentTaxReturnPO saveOrUpdate(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception { + if (Objects.nonNull(po)) { + if (hasChanged(saveParam, po, apiConfig)) { + // 鏁版嵁鏈夊彉鍖栵紝鍒欑姸鎬佹洿鏂颁负鏈獙璇 + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue()); + po.setTaxRegistrationNumber(null); + po.setDepartmentCode(null); + po.setDepartmentName(null); + po.setFailReason(null); + } + TaxAgentTaxReturnBO.convertParam2Po4Update(apiConfig, po, saveParam); + getTaxAgentTaxReturnMapper().updateByTaxAgentId(po); + } else { + po = TaxAgentTaxReturnBO.convertParam2Po4Insert(apiConfig, saveParam); + po.setCreator((long) user.getUID()); + po.setTenantKey(""); + getTaxAgentTaxReturnMapper().insertIgnoreNull(po); + } + return po; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java new file mode 100644 index 000000000..3f6eff61c --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReturnCheckRegistrationServiceImpl.java @@ -0,0 +1,46 @@ +package com.engine.salary.service.impl; + +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckDTO; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnCheckFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxagent.response.CompanyRegisterInfoResponse; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; + +import java.util.List; + +/** + * 楠岃瘉绋庡彿+搴忓彿鐩稿叧鏂规硶 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxReturnCheckRegistrationServiceImpl extends AbstractTaxAgentTaxReturnCheckService { + + @Override + public int getCheckType() { + return TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue(); + } + + @Override + public TaxAgentTaxReturnCheckDTO verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnPO po = getTaxAgentTaxReturnService(user).getByTaxAgentId(saveParam.getTaxAgentId()); + // 璋冪敤绁炲窞浜戝悎API + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + CompanyRegisterInfoResponse response = getCompanyRegisterInfo(apiConfig, po, saveParam); + List checkFormDTOS = verifyCompanyRegisterInfoResponse(apiConfig, saveParam, po, response); + po.setTaxRegistrationNumber(saveParam.getTaxRegistrationNumber()); + getTaxAgentTaxReturnMapper().updateIgnoreNull(po); + // 鏋勫缓缁撴灉 + TaxAgentTaxReturnCheckDTO resultDTO = new TaxAgentTaxReturnCheckDTO(); + resultDTO.setRecords(checkFormDTOS); + resultDTO.setStatus(po.getCheckStatus()); + resultDTO.setMessage(po.getFailReason()); + resultDTO.setTaxRegistrationNumber(po.getTaxRegistrationNumber()); + resultDTO.setDepartmentCode(po.getDepartmentCode()); + return resultDTO; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index b4aa8e526..e517b6c06 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -23,6 +23,7 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.archive.SalaryArchiveItemMapper; import com.engine.salary.mapper.datacollection.*; @@ -37,6 +38,7 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.service.VariableArchiveItemService; import com.engine.salary.service.impl.VariableArchiveItemServiceImpl; import com.engine.salary.sys.config.SysConfig; @@ -157,6 +159,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + private VariableArchiveItemService getVariableArchiveItemService(User user) { return ServiceUtil.getService(VariableArchiveItemServiceImpl.class, user); } @@ -1054,12 +1060,16 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe if (CollectionUtils.isNotEmpty(otherDeductionPos)) { otherDeductionPos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + po.setFreeIncome(AESEncryptUtil.closeEncryptSetting(po.getFreeIncome(), sysConfPo)); + po.setDerateDeduction(AESEncryptUtil.closeEncryptSetting(po.getDerateDeduction(), sysConfPo)); po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance(), sysConfPo)); po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance(), sysConfPo)); po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction(), sysConfPo)); po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation(), sysConfPo)); po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension(), sysConfPo)); } else { + po.setFreeIncome(AESEncryptUtil.encrypt(po.getFreeIncome())); + po.setDerateDeduction(AESEncryptUtil.encrypt(po.getDerateDeduction())); po.setBusinessHealthyInsurance(AESEncryptUtil.encrypt(po.getBusinessHealthyInsurance())); po.setTaxDelayEndowmentInsurance(AESEncryptUtil.encrypt(po.getTaxDelayEndowmentInsurance())); po.setOtherDeduction(AESEncryptUtil.encrypt(po.getOtherDeduction())); @@ -1107,6 +1117,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings(), sysConfPo)); po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare(), sysConfPo)); po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension(), sysConfPo)); + po.setActualAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getActualAddUpAdvanceTax(), sysConfPo)); + po.setTaxAdjustment(AESEncryptUtil.closeEncryptSetting(po.getTaxAdjustment(), sysConfPo)); + po.setAddUpTaxableIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxableIncome(), sysConfPo)); } else { po.setAddUpIncome(AESEncryptUtil.encrypt(po.getAddUpIncome())); po.setAddUpSubtraction(AESEncryptUtil.encrypt(po.getAddUpSubtraction())); @@ -1126,6 +1139,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setAddUpTaxSavings(AESEncryptUtil.encrypt(po.getAddUpTaxSavings())); po.setAddUpInfantCare(AESEncryptUtil.encrypt(po.getAddUpInfantCare())); po.setAddUpPrivatePension(AESEncryptUtil.encrypt(po.getAddUpPrivatePension())); + po.setActualAddUpAdvanceTax(AESEncryptUtil.encrypt(po.getActualAddUpAdvanceTax())); + po.setTaxAdjustment(AESEncryptUtil.encrypt(po.getTaxAdjustment())); + po.setAddUpTaxableIncome(AESEncryptUtil.encrypt(po.getAddUpTaxableIncome())); } }); List> partition = Lists.partition(addUpSituations, 50); @@ -1170,8 +1186,34 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } return 1; }); - Future submit14 = fixedThreadPool.submit(() -> { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + List taxDeclarationValuePO = getTaxDeclarationValueMapper().listAll(); + if (CollectionUtils.isNotEmpty(taxDeclarationValuePO)) { + taxDeclarationValuePO.forEach(po -> { + if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); + } else { + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + } + }); + TaxDeclarationValueMapper mapper = sqlSession.getMapper(TaxDeclarationValueMapper.class); + taxDeclarationValuePO.forEach(mapper::updateIgnoreNull); + sqlSession.commit(); + log.info("finish hrsa_tax_declaration_detail"); + } + } catch (Exception e) { + sqlSession.rollback(); + log.error("fail hrsa_tax_declaration_detail", e); + return 0; + } finally { + sqlSession.close(); + } + return 1; + }); + + Future submit15 = fixedThreadPool.submit(() -> { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { List excelInsuranceDetailPOS = getExcelInsuranceDetailMapper().listAll(); @@ -1237,7 +1279,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return 1; }); - Future submit15 = fixedThreadPool.submit(() -> { + Future submit16 = fixedThreadPool.submit(() -> { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { List variableArchiveItemPOS = getVariableArchiveItemService(user).listAll(); @@ -1265,14 +1307,14 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return 1; }); - int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get() + submit15.get(); - if (flag == 16) { + int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get()+ submit15.get()+ submit16.get(); + if (flag == 17) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30); } else { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); } Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); - return flag == 16; + return flag == 17; } catch (Exception e) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); diff --git a/src/com/engine/salary/util/HttpUtil.java b/src/com/engine/salary/util/HttpUtil.java new file mode 100644 index 000000000..6f99cf590 --- /dev/null +++ b/src/com/engine/salary/util/HttpUtil.java @@ -0,0 +1,249 @@ +package com.engine.salary.util; + + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.AuthSchemes; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; + +/** + * Http璋冪敤澶勭悊绫 + * + * @author Terry + */ +@Slf4j +public class HttpUtil { + + public static final String TEXT_TYPE = "text/plain"; + public static final String JSON_TYPE = "application/json"; + public static final String XML_TYPE = "text/xml"; + public static final String HTML_TYPE = "text/html"; + + public static final String EXCEL_TYPE = "application/vnd.ms-excel"; + public static final String STREAM_TYPE = "application/octet-stream"; + public static final int SLEEP_TIME = 1000; + public static final int IAS_SUCCESS = 400; + + public static HttpClient httpsTrustClient() { + try { + // 鍦ㄨ皟鐢⊿SL涔嬪墠闇瑕侀噸鍐欓獙璇佹柟娉曪紝鍙栨秷妫娴婼SL + X509TrustManager trustManager = new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] xcs, String str) { + } + + @Override + public void checkServerTrusted(X509Certificate[] xcs, String str) { + } + }; + SSLContext ctx = SSLContext.getInstance(SSLConnectionSocketFactory.TLS); + ctx.init(null, new TrustManager[]{trustManager}, null); + SSLConnectionSocketFactory socketFactory = + new SSLConnectionSocketFactory(ctx, NoopHostnameVerifier.INSTANCE); + // 鍒涘缓Registry + RequestConfig requestConfig = + RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD_STRICT).setExpectContinueEnabled(Boolean.TRUE) + .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST)) + .setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC)).build(); + Registry socketFactoryRegistry = RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE).register("https", socketFactory).build(); + // 鍒涘缓ConnectionManager锛屾坊鍔燙onnection閰嶇疆淇℃伅 + PoolingHttpClientConnectionManager connectionManager = + new PoolingHttpClientConnectionManager(socketFactoryRegistry); + + return HttpClients.custom().setConnectionManager(connectionManager) + .setDefaultRequestConfig(requestConfig).build(); + } catch (KeyManagementException | NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 鑾峰彇 HttpClient + * + * @param path + * @return + */ + public static HttpClient wrapClient(String path) { + HttpClient httpClient = HttpClientBuilder.create().build(); + if (path != null && path.startsWith("https://")) { + return httpsTrustClient(); + } + return httpClient; + } + + /** + * 璁剧疆http瓒呮椂鏃堕棿 + * + * @param requestConfig + * @return + */ + private static RequestConfig setTimeOutConfig(RequestConfig requestConfig) { + if (requestConfig == null) { + requestConfig = RequestConfig.DEFAULT; + } + return RequestConfig.copy(requestConfig).setConnectionRequestTimeout(900000).setConnectTimeout(900000) + .setSocketTimeout(900000).build(); + } + + /** + * get 璇锋眰 + * + * @param url + * @param header + * @param params + * @return + */ + public static String getRequest(String url, Map header, Map params) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + + StringBuilder urlStr = new StringBuilder(); + urlStr.append(url).append("?"); + + int i = params.size(); + for (Map.Entry map : params.entrySet()) { + urlStr.append(map.getKey()).append("=").append(map.getValue()); + if ((--i) == 0) { + continue; + } + urlStr.append("&"); + } + try { + httpClient = (CloseableHttpClient) wrapClient(url); + HttpGet httpGet = new HttpGet(urlStr.toString()); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpGet.setHeader(key, header.get(key)); + } + } + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(20000) + .setConnectionRequestTimeout(20000).setSocketTimeout(40000).build(); + httpGet.setConfig(requestConfig); + response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity); + httpGet.abort(); + EntityUtils.consume(entity); + } catch (IOException e) { + log.error("鍙戣捣GET璇锋眰澶辫触", e); + result = getTimeoutErrorResponse(result, e); + } finally { + if (null != response) { + try { + httpClient.close(); + response.close(); + } catch (IOException e) { + log.error("鍙戣捣GET璇锋眰澶辫触", e); + } + } + + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + log.error("鍙戣捣GET璇锋眰澶辫触", e); + } + } + } + return result; + } + + /** + * HTTP Post 鑾峰彇鍐呭 + * + * @param url 璇锋眰鐨剈rl鍦板潃 ?涔嬪墠鐨勫湴鍧 + * @param params 璇锋眰鐨勫弬鏁 + * @param header 缂栫爜鏍煎紡 + * @return 椤甸潰鍐呭 + */ + public static String doPost(String url, Map header, String params, String contentType) { + String result = null; + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Connection", "close"); + httpPost.setConfig(setTimeOutConfig(httpPost.getConfig())); + httpPost.setHeader("Content-Type", contentType); + if (null != header && !header.isEmpty()) { + for (String key : header.keySet()) { + httpPost.setHeader(key, header.get(key)); + } + } + if (null != params) { + httpPost.setEntity(new StringEntity(params, Consts.UTF_8)); + } + HttpClient httpClient = wrapClient(url); + HttpResponse response = httpClient.execute(httpPost); + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + httpPost.abort(); + throw new RuntimeException("HttpClient,error status code :" + statusCode); + } + HttpEntity entity = response.getEntity(); + if (entity != null) { + result = EntityUtils.toString(entity, Consts.UTF_8); + } + EntityUtils.consume(entity); + httpPost.abort(); + return result; + } catch (Exception e) { + log.error("鍙戣捣POST璇锋眰澶辫触", e); + result = getTimeoutErrorResponse(result, e); + } + return result; + } + + private static String getTimeoutErrorResponse(String result, Exception e) { + if (e instanceof ConnectTimeoutException) { + BaseResponse baseResponse = new BaseResponse(); + SzyhResponseHead head = new SzyhResponseHead(); + head.setCode("-1"); + head.setMsg(SalaryI18nUtil.getI18nLabel(184072, "鎶辨瓑锛岀郴缁熷洜缃戠粶鍘熷洜鏃犳硶璁块棶绋庡眬涓◣绯荤粺锛屾鍔熻兘鏆傛椂鏃犳硶浣跨敤锛岃纭繚缃戠粶鎯呭喌姝e父涓斿厑璁歌闂缃")); + head.setDesc("澶辫触"); + head.setStatus("N"); + baseResponse.setHead(head); + result = JsonUtil.toJsonString(baseResponse); + } + return result; + } +} diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index 500080226..6c13ba9ee 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -21,12 +21,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * @description: 鏃堕棿宸ュ叿绫 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/19/21 4:23 PM - * @version:v1.0 - */ + * 鏃堕棿宸ュ叿绫 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class SalaryDateUtil { @@ -104,6 +105,19 @@ public class SalaryDateUtil { } } + public static String getFormatYYYYMM(Date localDate) { + if (localDate == null) { + return StringUtils.EMPTY; + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(MONTH_FORMATTER_PATTERN); + return simpleDateFormat.format(localDate).replace("-", ""); + } catch (Exception e) { + log.warn("鏍煎紡鍖栨湀浠介敊璇", e); + return StringUtils.EMPTY; + } + } + public static String getFormatYearMonth(YearMonth localDate) { if (localDate == null) { return StringUtils.EMPTY; @@ -233,7 +247,7 @@ public class SalaryDateUtil { Calendar c = Calendar.getInstance(); c.setTime(localDate); int year = c.get(Calendar.YEAR); - return year; + return year ; } public static LocalDateRange localDate2Range(Date localDate) { @@ -263,7 +277,6 @@ public class SalaryDateUtil { cal.set(Calendar.DAY_OF_MONTH, last); return cal.getTime(); } - public static Date getFirstDayDateOfMonthWithMinutesAndSeconds(final Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); @@ -301,6 +314,8 @@ public class SalaryDateUtil { } + + public static String getMonthBegin(String specifiedDay) { int year; int month; @@ -575,10 +590,9 @@ public class SalaryDateUtil { /** * 杞崲鏃堕棿瀵硅薄 - * + * @see SalaryDateUtil#toDate(LocalDateTime, String) * @param dateTime LocalDateTime * @return Date - * @see SalaryDateUtil#toDate(LocalDateTime, String) */ public static Date toDate(LocalDateTime dateTime) { return toDate(dateTime, null); @@ -587,9 +601,8 @@ public class SalaryDateUtil { /** * 杞崲鏃堕棿瀵硅薄 - * * @param dateTime LocalDateTime - * @param offset 鏃跺尯锛宔.g. +8 + * @param offset 鏃跺尯锛宔.g. +8 * @return Date */ public static Date toDate(LocalDateTime dateTime, String offset) { diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 03cc7c8df..81733feee 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -2,6 +2,7 @@ package com.engine.salary.util; import com.alibaba.fastjson.JSON; import com.engine.salary.enums.SalaryRoundingModeEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.apache.commons.collections.CollectionUtils; @@ -171,6 +172,36 @@ public class SalaryEntityUtil { Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toList())))); } + public static Map> list2Map(Collection objs, Function function1, Function function2, Function function3) { + if (CollectionUtils.isEmpty(objs)) { + return Maps.newHashMap(); + } + Map> collect = objs.stream().collect(Collectors.groupingBy(function1)); + Map> map = new HashMap<>(); + for (Map.Entry> entry: collect.entrySet()) { + Map values = map.getOrDefault(entry.getKey(), new HashMap<>()); + entry.getValue().forEach(e -> values.put(function2.apply(e), function3.apply(e))); + map.put(entry.getKey(), values); + } + return map; + } + + public static Map> list2Map(Collection objs, Function function1, Function function2) { + if (CollectionUtils.isEmpty(objs)) { + return Maps.newHashMap(); + } + Map> collect = objs.stream().collect(Collectors.groupingBy(function1)); + Map> map = new HashMap<>(); + for (Map.Entry> entry: collect.entrySet()) { + Map values = map.getOrDefault(entry.getKey(), new HashMap<>()); + entry.getValue().forEach(e -> values.put(function2.apply(e), e)); + map.put(entry.getKey(), values); + } + return map; + } + + + /** * LinkedHashMap鏈夊簭鍘婚噸 * @@ -219,9 +250,10 @@ public class SalaryEntityUtil { /** * 杩涗綅瑙勫垯 - * @param newScale 灏忔暟浣 + * + * @param newScale 灏忔暟浣 * @param rententionRule 杩涗綅瑙勫垯 - * @param value 鍊 + * @param value 鍊 * @return */ public static BigDecimal carryRule(Integer newScale, Integer rententionRule, BigDecimal value) { @@ -382,4 +414,57 @@ public class SalaryEntityUtil { } + public static String null2String(Object obj) { + if (Objects.isNull(obj)) { + return ""; + } + return obj.toString(); + } + + public static String null2String(Object obj, String def) { + if (Objects.isNull(obj)) { + return def; + } + return obj.toString(); + } + + public static Integer getIntValue(Object obj, Integer def) { + if (Objects.isNull(obj)) { + return def; + } + try { + return StringUtils.isEmpty(String.valueOf(obj)) ? def : Integer.valueOf(String.valueOf(obj)); + } catch (NumberFormatException e) { + return def; + } + } + + public static BigDecimal getBigDecimal(Object value, int scale) { + String valueStr = null2String(value); + if (StringUtils.isEmpty(valueStr)) { + return BigDecimal.ZERO; + } + try { + return new BigDecimal(valueStr).setScale(scale, RoundingMode.HALF_UP); + } catch (NumberFormatException e) { + return null; + } + } + + public static BigDecimal getBigDecimal(Object value, int scale, BigDecimal defValue) { + try { + return new BigDecimal(null2String(value)).setScale(scale, RoundingMode.HALF_UP); + } catch (NumberFormatException e) { + return defValue; + } + } + + + public static T findFirst(Collection objs) { + if (CollectionUtils.isEmpty(objs)) { + throw new SalaryRunTimeException("the collection can not be empty"); + } + return objs.stream().findFirst().orElse(null); + } + } diff --git a/src/com/engine/salary/util/SalaryI18nUtil.java b/src/com/engine/salary/util/SalaryI18nUtil.java index 14dc4644a..7964fbe8a 100644 --- a/src/com/engine/salary/util/SalaryI18nUtil.java +++ b/src/com/engine/salary/util/SalaryI18nUtil.java @@ -92,7 +92,7 @@ public class SalaryI18nUtil { * @param defaultLabel 榛樿涓枃 * @return */ - public static String getI18nLabel(int labelId, String defaultLabel) { + public static String getI18nLabel(Integer labelId, String defaultLabel) { return defaultLabel; } // diff --git a/src/com/engine/salary/util/SalaryThreadPoolUtil.java b/src/com/engine/salary/util/SalaryThreadPoolUtil.java index 12818a03f..94b399bb3 100644 --- a/src/com/engine/salary/util/SalaryThreadPoolUtil.java +++ b/src/com/engine/salary/util/SalaryThreadPoolUtil.java @@ -1,15 +1,14 @@ package com.engine.salary.util; -import org.apache.commons.lang3.StringUtils; - /** - * @description: 姝ょ嚎绋嬫睜绫诲彧閫傜敤浜嶳unnalbe鎺ュ彛锛屼笉閫傜敤涓嶤allable鎺ュ彛 + * 姝ょ嚎绋嬫睜绫诲彧閫傜敤浜嶳unnalbe鎺ュ彛锛屼笉閫傜敤涓嶤allable鎺ュ彛 * 濡傛湁callable涓氬姟闇瑕侊紝璇疯嚜琛屼娇鐢ㄧ嚎绋嬫睜鍒涘缓锛屽苟纭畾瑕佸叧闂 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/25/22 4:23 PM - * @version:v1.0 - */ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryThreadPoolUtil { // /** diff --git a/src/com/engine/salary/util/SingnatureData.java b/src/com/engine/salary/util/SingnatureData.java new file mode 100644 index 000000000..d6206c2bf --- /dev/null +++ b/src/com/engine/salary/util/SingnatureData.java @@ -0,0 +1,90 @@ +package com.engine.salary.util; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.SignatureException; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import java.util.UUID; + +/** + * @author jie.zhou + * @version 1.0 + * @date 2021/1/14 15:27 + */ +@Slf4j +public class SingnatureData { + + /** + * 鍒濆鍖栧欢绛惧ご淇℃伅(GET) + * + * @param param + * @param appKey + * @param appSecret + * @return + */ + public static Map initHeader(Map param, String appKey, String appSecret) { + String version = "1.0.0"; + long timestamp = System.currentTimeMillis(); + String nonce = UUID.randomUUID().toString().replace("-", ""); + Map head = new HashMap(); + if (param != null && param.size() > 0) head.putAll(param); + head.put("version", version); + head.put("timestamp", Long.toString(timestamp));//TimeStamp + head.put("appKey", appKey);//accessKeyID + head.put("xReqNonce", nonce);//SignatureNonce + String signature = getSign(head, appSecret, "UTF-8"); + head.put("signature", signature.trim()); + return head; + } + + /*** + * 鑾峰彇绛惧悕 + * @param params + * @param appSecret + * @param encoding + * @return + */ + public static String getSign(Map params, String appSecret, String encoding) { + TreeMap treeMap = new TreeMap<>(); + treeMap.put("appSecret", appSecret); + + for (Map.Entry entry : params.entrySet()) { + treeMap.put(entry.getKey(), entry.getValue().toString()); + } + StringBuilder builder = new StringBuilder(); + for (Object parameter : treeMap.values()) { + if (parameter != null) { + builder.append(parameter.toString()); + } + } + String signStr = null; + try { + signStr = sign(URLEncoder.encode(builder.toString(), encoding), appSecret); + } catch (Exception e) { + log.error("鑾峰彇绛惧悕澶辫触", e); + } + return signStr; + } + + public static String sign(String data, String appSecret) throws SignatureException { + try { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec signingKey = new SecretKeySpec(appSecret.getBytes(), "HmacSHA256"); + mac.init(signingKey); + byte[] signData = mac.doFinal(data.getBytes()); + return Base64.encodeBase64String(signData); + } catch (NoSuchAlgorithmException e) { + throw new SignatureException("骞冲彴涓嶆敮鎸" + "HMAC_SHA256" + "鎽樿鏂瑰紡"); + } catch (InvalidKeyException e) { + throw new SignatureException("Speicified access secret is not valid."); + } + } +} diff --git a/src/com/engine/salary/util/Sm4Utils.java b/src/com/engine/salary/util/Sm4Utils.java new file mode 100644 index 000000000..acaf98881 --- /dev/null +++ b/src/com/engine/salary/util/Sm4Utils.java @@ -0,0 +1,190 @@ +package com.engine.salary.util; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.pqc.math.linearalgebra.ByteUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; +import java.util.Arrays; + +public class Sm4Utils { + + static { + Security.addProvider(new BouncyCastleProvider()); + } + + private static final String ENCODING = "UTF-8"; + + public static final String ALGORITHM_NAME = "SM4"; + + // 鍔犲瘑绠楁硶/鍒嗙粍鍔犲瘑妯″紡/鍒嗙粍濉厖鏂瑰紡 + // PKCS5Padding-浠8涓瓧鑺備负涓缁勮繘琛屽垎缁勫姞瀵 + // 瀹氫箟鍒嗙粍鍔犲瘑妯″紡浣跨敤锛歅KCS5Padding + public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding"; + + // 128-32浣16杩涘埗锛256-64浣16杩涘埗 + public static final int DEFAULT_KEY_SIZE = 128; + + /** + * 鐢熸垚ECB鏆楀彿 + * + * @param algorithmName 绠楁硶鍚嶇О + * @param mode 妯″紡 + * @param key + * @return + * @throws Exception + * @explain ECB妯″紡锛堢數瀛愬瘑鐮佹湰妯″紡锛欵lectronic codebook锛 + */ + private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception { + Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); + Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME); + cipher.init(mode, sm4Key); + return cipher; + } + + /** + * 鑷姩鐢熸垚瀵嗛挜 + * + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @explain + */ + public static byte[] generateKey() throws Exception { + return generateKey(DEFAULT_KEY_SIZE); + } + + /** + * @param keySize + * @return + * @throws Exception + * @explain + */ + public static byte[] generateKey(int keySize) throws Exception { + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME); + kg.init(keySize, new SecureRandom()); + return kg.generateKey().getEncoded(); + } + + /* * sm4鍔犲瘑 + * @explain 鍔犲瘑妯″紡锛欵CB + * 瀵嗘枃闀垮害涓嶅浐瀹氾紝浼氶殢鐫琚姞瀵嗗瓧绗︿覆闀垮害鐨勫彉鍖栬屽彉鍖 + * @param hexKey + * 16杩涘埗瀵嗛挜锛堝拷鐣ュぇ灏忓啓锛 + * @param paramStr + * 寰呭姞瀵嗗瓧绗︿覆 + * @return 杩斿洖16杩涘埗鐨勫姞瀵嗗瓧绗︿覆 + * @throws Exception + */ + public static String encryptEcb(String hexKey, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + String cipherText = ""; + // 16杩涘埗瀛楃涓-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // String-->byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 鍔犲瘑鍚庣殑鏁扮粍 + byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData); + // byte[]-->hexString + cipherText = ByteUtils.toHexString(cipherArray); + return cipherText; + } + + /** + * 鍔犲瘑妯″紡涔婨cb + * + * @param key + * @param data + * @return + * @throws Exception + * @explain + */ + public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * sm4瑙e瘑 + * + * @param hexKey 16杩涘埗瀵嗛挜 + * @param cipherText 16杩涘埗鐨勫姞瀵嗗瓧绗︿覆锛堝拷鐣ュぇ灏忓啓锛 + * @return 瑙e瘑鍚庣殑瀛楃涓 + * @throws Exception + * @explain 瑙e瘑妯″紡锛氶噰鐢‥CB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + hexKey = strTo16(hexKey); + // 鐢ㄤ簬鎺ユ敹瑙e瘑鍚庣殑瀛楃涓 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 瑙e瘑 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 瑙e瘑 + * + * @param key + * @param cipherText + * @return + * @throws Exception + * @explain + */ + public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key); + return cipher.doFinal(cipherText); + } + + /** + * 鏍¢獙鍔犲瘑鍓嶅悗鐨勫瓧绗︿覆鏄惁涓哄悓涓鏁版嵁 + * + * @param hexKey 16杩涘埗瀵嗛挜锛堝拷鐣ュぇ灏忓啓锛 + * @param cipherText 16杩涘埗鍔犲瘑鍚庣殑瀛楃涓 + * @param paramStr 鍔犲瘑鍓嶇殑瀛楃涓 + * @return 鏄惁涓哄悓涓鏁版嵁 + * @throws Exception + * @explain + */ + public static boolean verifyEcb(String hexKey, String cipherText, String paramStr) throws Exception { + hexKey = strTo16(hexKey); + // 鐢ㄤ簬鎺ユ敹鏍¢獙缁撴灉 + boolean flag = false; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // 灏16杩涘埗瀛楃涓茶浆鎹㈡垚鏁扮粍 + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 瑙e瘑 + byte[] decryptData = decrypt_Ecb_Padding(keyData, cipherData); + // 灏嗗師瀛楃涓茶浆鎹㈡垚byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 鍒ゆ柇2涓暟缁勬槸鍚︿竴鑷 + flag = Arrays.equals(decryptData, srcData); + return flag; + } + + /** + * 瀛楃涓茶浆鍖栨垚涓16杩涘埗 + * + * @param s + * @return + */ + public static String strTo16(String s) { + String str = ""; + for (int i = 0; i < s.length(); i++) { + int ch = (int) s.charAt(i); + String s4 = Integer.toHexString(ch); + str = str + s4; + } + return str.substring(0, 32); + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/util/TaskUtil.java b/src/com/engine/salary/util/TaskUtil.java new file mode 100644 index 000000000..63df65134 --- /dev/null +++ b/src/com/engine/salary/util/TaskUtil.java @@ -0,0 +1,42 @@ +package com.engine.salary.util; + +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.api.ApiTaskRecordPO; +import com.engine.salary.mapper.api.ApiTaskRecordMapper; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; + +import java.util.Date; + +@Slf4j +public class TaskUtil { + + private ApiTaskRecordMapper getApiTaskRecordMapper() { + return MapperProxyFactory.getProxy(ApiTaskRecordMapper.class); + } + + public void writeApiTaskRecord(String source, String api, String param, String response) { + try { + log.info("source:{} , api:{} , param:{} , response : {}", source, api, param, response); + Date now = new Date(); + ApiTaskRecordPO build = ApiTaskRecordPO.builder() + .id(IdGenerator.generate()) + .source(source) + .api(api) + .param(param) + .response(response) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getApiTaskRecordMapper().insertIgnoreNull(build); + }catch (Exception e){ + log.error("writeApiTaskRecord error", e); + } + + } + + +} diff --git a/src/com/engine/salary/util/excel/ExcelSheetData.java b/src/com/engine/salary/util/excel/ExcelSheetData.java new file mode 100644 index 000000000..87a827d55 --- /dev/null +++ b/src/com/engine/salary/util/excel/ExcelSheetData.java @@ -0,0 +1,15 @@ +package com.engine.salary.util.excel; + +import lombok.Data; + +import java.util.List; + +@Data +public class ExcelSheetData { + + private String sheetName; + private List headers; + private List> rows; + + +} diff --git a/src/com/engine/salary/util/excel/ExcelUtil.java b/src/com/engine/salary/util/excel/ExcelUtil.java index 6877e7e03..093ee3ed3 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -2,6 +2,7 @@ package com.engine.salary.util.excel; import cn.hutool.core.util.StrUtil; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; @@ -20,9 +21,8 @@ import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; import java.util.List; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -486,6 +486,114 @@ public class ExcelUtil { return workbook; } + public static XSSFWorkbook genWorkbookV2(Map>> map) { + XSSFWorkbook workbook = new XSSFWorkbook(); + + map.entrySet().forEach(en->{ + + String sheetName = en.getKey(); + List> rowList = en.getValue(); + // 璁剧疆title鏍峰紡 + XSSFCellStyle titleCellStyle = workbook.createCellStyle(); + XSSFFont titleFont = workbook.createFont(); + titleFont.setFontName("浠垮畫"); + titleFont.setFontHeightInPoints((short) 15); + titleCellStyle.setFont(titleFont); + titleCellStyle.setAlignment(HorizontalAlignment.CENTER); + titleCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//鑳屾櫙鑹 + titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + + // 璁剧疆涓讳綋鏍峰紡 + XSSFCellStyle cellStyle = workbook.createCellStyle(); + XSSFFont font = workbook.createFont(); + font.setFontName("瀹嬩綋"); + font.setFontHeightInPoints((short) 10);// 璁剧疆瀛椾綋澶у皬 + cellStyle.setFont(font);// 閫夋嫨闇瑕佺敤鍒扮殑瀛椾綋鏍煎紡 + cellStyle.setWrapText(true); + + XSSFSheet sheet = workbook.createSheet(sheetName); + //鑷傚簲瀹藉害 + sheet.autoSizeColumn(0, true); + //榛樿鍒楀 + sheet.setDefaultColumnWidth(20); + //榛樿琛岄珮 + sheet.setDefaultRowHeightInPoints(18); + + for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) { + List infoList = rowList.get(rowIndex); + XSSFRow row = sheet.createRow(rowIndex); + for (int cellIndex = 0; cellIndex < infoList.size(); cellIndex++) { + XSSFCell cell = row.createCell(cellIndex); + if (rowIndex == 0) { + cell.setCellStyle(titleCellStyle); + } else { + cell.setCellStyle(cellStyle); + } + Object o = infoList.get(cellIndex); + if (o instanceof String) { + cell.setCellType(CellType.STRING); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Boolean) { + cell.setCellType(CellType.BOOLEAN); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Date) { + cell.setCellType(CellType.STRING); + cell.setCellValue(SalaryDateUtil.getFormatLocalDate((Date) o)); + } else { + cell.setCellType(CellType.STRING); + cell.setCellValue(o == null ? "" : o.toString()); + } + } + } + }); + + return workbook; + } + + public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { + List> list = new ArrayList<>(); + list.add(excelSheetData.getHeaders()); + list.addAll(excelSheetData.getRows()); + return genWorkbookV2(list, excelSheetData.getSheetName()); + } + + + public static Map> getHeader(Class clazz) { + Map> headerMap = new HashMap<>(); + // 瀵煎嚭鐨勮〃澶 + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { + continue; + } + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(annotation.title()); + dataIndexList.add(annotation.dataIndex()); + } + headerMap.put("header", headerList); + headerMap.put("dataIndex", dataIndexList); + return headerMap; + } + + public static List> getExcelSheetData(Class clazz, List dtoList) { + // 瀵煎嚭鐨勮〃澶 + Map> headerMap = getHeader(clazz); + // 瀵煎嚭鐨勬暟鎹 + List> rows = new ArrayList<>(); + rows.add(headerMap.get("header")); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); + headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + return rows; + } + + /** * 瑙f瀽琛ㄥご * diff --git a/src/com/engine/salary/util/excel/ExcelUtilPlus.java b/src/com/engine/salary/util/excel/ExcelUtilPlus.java index 96cff32ec..84b23b3a3 100644 --- a/src/com/engine/salary/util/excel/ExcelUtilPlus.java +++ b/src/com/engine/salary/util/excel/ExcelUtilPlus.java @@ -1,9 +1,12 @@ package com.engine.salary.util.excel; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import cn.hutool.core.util.StrUtil; import com.engine.salary.component.WeaTableColumnGroup; +import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.util.SalaryDateUtil; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.usermodel.*; @@ -11,6 +14,8 @@ import weaver.wechat.util.Utils; import java.awt.Color; import java.math.BigDecimal; +import java.util.List; +import java.util.*; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -879,23 +884,29 @@ public class ExcelUtilPlus { } public static float getFinalHeight(Object o, int width, float finalHeight, float height) { - if (o != null && getStrlength(o.toString()) > width) { - float remainder = getStrlength(o.toString()) % width; - int multiple = getStrlength(o.toString()) / width; - int finalMultiple = remainder > 0 ? (multiple + 1) : multiple; - float compareHeight = height * finalMultiple; - finalHeight = Math.max(finalHeight, compareHeight); + if (o != null) { + if (getStrlength(o.toString()) > width || o.toString().contains("\n")) { + float remainder = getStrlength(o.toString()) % width; + int multiple = getStrlength(o.toString()) / width; + int finalMultiple = remainder > 0 ? (multiple + 1) : multiple; + // 澶勭悊鎹㈣绗 + int leastMultiple = StringUtils.countMatches(o.toString(), "\n") + 1; + finalMultiple = Math.max(leastMultiple, finalMultiple); + float compareHeight = height * finalMultiple; + finalHeight = Math.max(finalHeight, compareHeight); + } } return finalHeight; } public static int getStrlength(String str) { int strLength = 0; + String finalStr = str.replace("\n", ""); String chinese = "[\u0391-\uFFE5]"; /* 鑾峰彇瀛楁鍊肩殑闀垮害锛屽鏋滃惈涓枃瀛楃锛屽垯姣忎釜涓枃瀛楃闀垮害涓2锛屽惁鍒欎负1 */ - for (int i = 0; i < str.length(); i++) { + for (int i = 0; i < finalStr.length(); i++) { /* 浠庡瓧绗︿覆涓幏鍙栦竴涓瓧绗 */ - String temp = str.substring(i, i + 1); + String temp = finalStr.substring(i, i + 1); /* 鍒ゆ柇鏄惁涓轰腑鏂囧瓧绗 */ if (temp.matches(chinese)) { /* 涓枃瀛楃闀垮害涓2 */ @@ -908,4 +919,134 @@ public class ExcelUtilPlus { return strLength; } + + public static XSSFWorkbook genWorkbook4TaxDeclareContrast(List empInfoColumns, List header, List> rowList, String sheetName) { + XSSFWorkbook workbook = new XSSFWorkbook(); + + // 璁剧疆title鏍峰紡 + XSSFCellStyle titleCellStyle = workbook.createCellStyle(); + XSSFFont titleFont = workbook.createFont(); + titleFont.setBold(true); + titleFont.setFontName("浠垮畫"); + titleFont.setFontHeightInPoints((short) 15); + titleCellStyle.setFont(titleFont); + titleCellStyle.setAlignment(HorizontalAlignment.CENTER); + titleCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//鑳屾櫙鑹 + titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + titleCellStyle.setBorderLeft(BorderStyle.THIN); + titleCellStyle.setBorderRight(BorderStyle.THIN); + titleCellStyle.setBorderTop(BorderStyle.THIN); + titleCellStyle.setBorderBottom(BorderStyle.THIN); + + // 璁剧疆涓讳綋鏍峰紡 + XSSFCellStyle cellStyle = workbook.createCellStyle(); + XSSFFont font = workbook.createFont(); + font.setFontName("瀹嬩綋"); + font.setFontHeightInPoints((short) 10);// 璁剧疆瀛椾綋澶у皬 + cellStyle.setFont(font);// 閫夋嫨闇瑕佺敤鍒扮殑瀛椾綋鏍煎紡 + cellStyle.setWrapText(true); + cellStyle.setAlignment(HorizontalAlignment.CENTER); + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + cellStyle.setBorderLeft(BorderStyle.THIN); + cellStyle.setBorderRight(BorderStyle.THIN); + cellStyle.setBorderTop(BorderStyle.THIN); + cellStyle.setBorderBottom(BorderStyle.THIN); + + XSSFFont fontRed = workbook.createFont(); + fontRed.setFontName("瀹嬩綋"); + fontRed.setFontHeightInPoints((short) 10);// 璁剧疆瀛椾綋澶у皬 + fontRed.setColor(IndexedColors.RED.getIndex()); + + + + XSSFSheet sheet = workbook.createSheet(sheetName); + //鑷傚簲瀹藉害 + sheet.autoSizeColumn(0, true); + //榛樿鍒楀 + sheet.setDefaultColumnWidth(20); + //榛樿琛岄珮 + sheet.setDefaultRowHeightInPoints(18); + + //澶勭悊鍚堝苟鍗曞厓鏍 + XSSFRow row0 = sheet.createRow(0); + + int startIndex = 0; + // 璁剧疆琛ㄥご浜哄憳淇℃伅 + for (int i = 0; i < empInfoColumns.size(); i++) { + WeaTableColumn empColumn = empInfoColumns.get(i); + XSSFCell rowZeroCell = row0.createCell(startIndex, CellType.STRING); + rowZeroCell.setCellValue(empColumn.getText()); + rowZeroCell.setCellStyle(titleCellStyle); + //璁剧疆鍒楀 + sheet.setColumnWidth(startIndex, Math.max(19, empColumn.getText().length() * 4) * 256); + startIndex++; + } + + // 璁剧疆琛ㄥご椤圭洰瀛楁 + for (int i = 0; i < header.size(); i++) { + String h = header.get(i); + XSSFCell rowZeroCell = row0.createCell(startIndex, CellType.STRING); + rowZeroCell.setCellValue(h); + rowZeroCell.setCellStyle(titleCellStyle); + //璁剧疆鍒楀 + sheet.setColumnWidth(startIndex, Math.max(19, h.length() * 4) * 256); + startIndex++; + } + + // 璁剧疆琛屽唴瀹 + for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) { + Map rowMap = rowList.get(rowIndex); + XSSFRow row = sheet.createRow(rowIndex + 1); + float height = 18; + float finalHeight = 18; + float maxHeight = 0; + // 璁剧疆浜哄憳淇℃伅 + for (int j = 0; j < empInfoColumns.size(); j++) { + String column = empInfoColumns.get(j).getText(); + XSSFCell cell = row.createCell(j); + String cellValue = rowMap.get(column) == null ? "" : rowMap.get(column).toString(); + cell.setCellStyle(cellStyle); + cell.setCellType(CellType.STRING); + cell.setCellValue(cellValue); + //鍒ゆ柇鏄惁瑕佽皟鏁撮珮搴 + int width = sheet.getColumnWidth(j) / 256; + finalHeight = getFinalHeight(cellValue, width, finalHeight, height); + maxHeight = Math.max(finalHeight, maxHeight); + } + // 鍒楃储寮 + int cellIndex = empInfoColumns.size(); + // 璁剧疆椤圭洰淇℃伅 + for (int i = 0; i < header.size(); i++) { + String h = header.get(i); + XSSFCell cell = row.createCell(cellIndex); + cell.setCellStyle(cellStyle); + + cell.setCellType(CellType.STRING); + ContrastListDTO contrastListDTO = rowMap.get(h) != null ? (ContrastListDTO)rowMap.get(h) : new ContrastListDTO(); + String local = StringUtils.isBlank(contrastListDTO.getLocal()) ? "绯荤粺鍊硷細" : "绯荤粺鍊硷細" + contrastListDTO.getLocal(); + String online = StringUtils.isBlank(contrastListDTO.getOnline()) ? "绾夸笂鍊硷細" : "绾夸笂鍊硷細" + contrastListDTO.getOnline(); + Object diff = contrastListDTO.getDiff(); + if (diff == null) { + cell.setCellValue(local + "\n" + online); + } else { + String value = local + "\n" + online + "\n宸硷細" + diff; + XSSFRichTextString textString = new XSSFRichTextString(value); + textString.applyFont(0, value.indexOf("宸硷細"), font); + textString.applyFont(value.indexOf("宸硷細"), value.length(), fontRed); + cell.setCellValue(textString); + } + + //鍒ゆ柇鏄惁瑕佽皟鏁撮珮搴 + int width = sheet.getColumnWidth(i) / 256; + finalHeight = getFinalHeight(cell.getStringCellValue(), width, finalHeight, height); + maxHeight = Math.max(finalHeight, maxHeight); + cellIndex++; + } + + row.setHeightInPoints(maxHeight); + } + return workbook; + } + } diff --git a/src/com/engine/salary/util/page/PageInfo.java b/src/com/engine/salary/util/page/PageInfo.java index 9547fb686..5f8b1076e 100644 --- a/src/com/engine/salary/util/page/PageInfo.java +++ b/src/com/engine/salary/util/page/PageInfo.java @@ -43,9 +43,17 @@ public class PageInfo extends com.engine.salary.component.PageInfo { this.columns = buildColumns(); } + public PageInfo(int pageNum, int pageSize, long total, List columns, List list) { + super(list); + super.setPageNum(pageNum); + super.setPageSize(pageSize); + super.setTotal(total); + this.columns = columns; + } + public List buildColumns() { - if(clazz==null){ + if (clazz == null) { return this.columns; } Field[] fields = clazz.getDeclaredFields(); diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index bf118b462..739a36721 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -1,5 +1,7 @@ package com.engine.salary.util.page; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import java.awt.*; @@ -8,6 +10,7 @@ import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public class SalaryPageUtil { @@ -106,4 +109,12 @@ public class SalaryPageUtil { int pxLength = (int) Math.ceil(bounds.getWidth()) + 55; return pxLength < 90 ? 90+"" : pxLength+""; } + + + public static List convertList(List columns){ + if(CollectionUtils.isNotEmpty(columns)){ + return columns.stream().map(c->Column.builder().title(c.getText()).key(c.getColumn()).dataIndex(c.getColumn()).build()).collect(Collectors.toList()); + } + return new ArrayList<>(); + } } diff --git a/src/com/engine/salary/util/valid/SalaryCardUtil.java b/src/com/engine/salary/util/valid/SalaryCardUtil.java new file mode 100644 index 000000000..fbd76bc2e --- /dev/null +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -0,0 +1,511 @@ +package com.engine.salary.util.valid; + +import com.engine.salary.enums.employeedeclare.GenderEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryI18nUtil; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.Calendar; +import java.util.Date; +import java.util.regex.Pattern; + +/** + * 韬唤璇 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryCardUtil { + /** + * 鎵嬫満鍙风爜 + */ + public static final String MOBILE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$"; + + /** + * 鏍¢獙鎵嬫満鍙风爜 + * + * @param mobile + * @return + */ + public static boolean checkMobile(String mobile) { + Pattern pattern_mobile = Pattern.compile(MOBILE); + if (!pattern_mobile.matcher(mobile).find()) { + return false; + } + return true; + } + + /** + * 鏍规嵁韬唤璇佸彿鍒ゆ柇鎬у埆 + * + * @param idNumber + * @return + */ + public static GenderEnum judgeGender(String idNumber) throws IllegalArgumentException { + if (!checkIdNum(idNumber)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "韬唤璇佸彿鏍煎紡閿欒")); + } + char sexIndex; + if (idNumber.length() == 18) { + //濡傛灉韬唤璇佸彿18浣嶏紝鍙栬韩浠借瘉鍙峰掓暟绗簩浣 + sexIndex = idNumber.charAt(idNumber.length() - 2); + } else { + //濡傛灉韬唤璇佸彿15浣嶏紝鍙栬韩浠借瘉鍙锋渶鍚庝竴浣 + sexIndex = idNumber.charAt(idNumber.length() - 1); + } + int gender = Integer.parseInt(String.valueOf(sexIndex)); + if (gender % 2 == 1) { + return GenderEnum.MALE; + } else { + return GenderEnum.FEMALE; + } + } + + /** + * 鏍规嵁韬唤璇佺殑鍙风爜绠楀嚭褰撳墠韬唤璇佹寔鏈夎呯殑鐢熸棩 + * + * @return + */ + public static LocalDate judgeBirthday(String idNumber) throws IllegalArgumentException { + if (!checkIdNum(idNumber)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156510, "韬唤璇佸彿鏍煎紡閿欒")); + } + String year; + String month; + String day; + if (idNumber.length() == 18) { + year = idNumber.substring(6).substring(0, 4);// 寰楀埌骞翠唤 + month = idNumber.substring(10).substring(0, 2);// 寰楀埌鏈堜唤 + day = idNumber.substring(12).substring(0, 2);//寰楀埌鏃 + } else { + year = "19" + idNumber.substring(6, 8);// 骞翠唤 + month = idNumber.substring(8, 10);// 鏈堜唤 + day = idNumber.substring(10, 12);//鏃 + } + return LocalDate.parse(year + "-" + month + "-" + day); + } + + + /** + *
+     * 鐪併佺洿杈栧競浠g爜琛細
+     *     11 : 鍖椾含  12 : 澶╂触  13 : 娌冲寳       14 : 灞辫タ  15 : 鍐呰挋鍙
+     *     21 : 杈藉畞  22 : 鍚夋灄  23 : 榛戦緳姹  31 : 涓婃捣  32 : 姹熻嫃
+     *     33 : 娴欐睙  34 : 瀹夊窘  35 : 绂忓缓       36 : 姹熻タ  37 : 灞变笢
+     *     41 : 娌冲崡  42 : 婀栧寳  43 : 婀栧崡       44 : 骞夸笢  45 : 骞胯タ      46 : 娴峰崡
+     *     50 : 閲嶅簡  51 : 鍥涘窛  52 : 璐靛窞       53 : 浜戝崡  54 : 瑗胯棌
+     *     61 : 闄曡タ  62 : 鐢樿們  63 : 闈掓捣       64 : 瀹佸  65 : 鏂扮枂
+     *     71 : 鍙版咕
+     *     81 : 棣欐腐  82 : 婢抽棬
+     *     91 : 鍥藉
+     * 
+ */ + private static String[] cityCode = { "11", "12", "13", "14", "15", "21", + "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42", + "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", + "63", "64", "65", "71", "81", "82", "91" }; + + /** + * 姣忎綅鍔犳潈鍥犲瓙 + */ + private static int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, + 8, 4, 2 }; + + /** + * 楠岃瘉鎵鏈夌殑韬唤璇佺殑鍚堟硶鎬 + * + * @param idcard + * 韬唤璇 + * @return 鍚堟硶杩斿洖true锛屽惁鍒欒繑鍥瀎alse + */ + public static boolean checkIdNum(String idcard) { + if (idcard == null || "".equals(idcard)) { + return false; + } + if (idcard.length() == 15) { + return validate15IDCard(idcard); + } + if(idcard.length()==18) { + return validate18Idcard(idcard); + } + return false; + } + + /** + *

+ * 鍒ゆ柇18浣嶈韩浠借瘉鐨勫悎娉曟 + *

+ * 鏍规嵁銆栦腑鍗庝汉姘戝叡鍜屽浗鍥藉鏍囧噯GB11643-1999銆椾腑鏈夊叧鍏皯韬唤鍙风爜鐨勮瀹氾紝鍏皯韬唤鍙风爜鏄壒寰佺粍鍚堢爜锛岀敱鍗佷竷浣嶆暟瀛楁湰浣撶爜鍜屼竴浣嶆暟瀛楁牎楠岀爜缁勬垚銆 + * 鎺掑垪椤哄簭浠庡乏鑷冲彸渚濇涓猴細鍏綅鏁板瓧鍦板潃鐮侊紝鍏綅鏁板瓧鍑虹敓鏃ユ湡鐮侊紝涓変綅鏁板瓧椤哄簭鐮佸拰涓浣嶆暟瀛楁牎楠岀爜銆 + *

+ * 椤哄簭鐮: 琛ㄧず鍦ㄥ悓涓鍦板潃鐮佹墍鏍囪瘑鐨勫尯鍩熻寖鍥村唴锛屽鍚屽勾銆佸悓鏈堛佸悓 鏃ュ嚭鐢熺殑浜虹紪瀹氱殑椤哄簭鍙凤紝椤哄簭鐮佺殑濂囨暟鍒嗛厤缁欑敺鎬э紝鍋舵暟鍒嗛厤 缁欏コ鎬с + *

+ *

+ * 1.鍓1銆2浣嶆暟瀛楄〃绀猴細鎵鍦ㄧ渷浠界殑浠g爜锛 2.绗3銆4浣嶆暟瀛楄〃绀猴細鎵鍦ㄥ煄甯傜殑浠g爜锛 3.绗5銆6浣嶆暟瀛楄〃绀猴細鎵鍦ㄥ尯鍘跨殑浠g爜锛 + * 4.绗7~14浣嶆暟瀛楄〃绀猴細鍑虹敓骞淬佹湀銆佹棩锛 5.绗15銆16浣嶆暟瀛楄〃绀猴細鎵鍦ㄥ湴鐨勬淳鍑烘墍鐨勪唬鐮侊紱 + * 6.绗17浣嶆暟瀛楄〃绀烘у埆锛氬鏁拌〃绀虹敺鎬э紝鍋舵暟琛ㄧず濂虫э紱 + * 7.绗18浣嶆暟瀛楁槸鏍℃鐮侊細涔熸湁鐨勮鏄釜浜轰俊鎭爜锛屼竴鑸槸闅忚绠楁満鐨勯殢鏈轰骇鐢燂紝鐢ㄦ潵妫楠岃韩浠借瘉鐨勬纭с傛牎妫鐮佸彲浠ユ槸0~9鐨勬暟瀛楋紝鏈夋椂涔熺敤x琛ㄧず銆 + *

+ *

+ * 绗崄鍏綅鏁板瓧(鏍¢獙鐮)鐨勮绠楁柟娉曚负锛 1.灏嗗墠闈㈢殑韬唤璇佸彿鐮17浣嶆暟鍒嗗埆涔樹互涓嶅悓鐨勭郴鏁般備粠绗竴浣嶅埌绗崄涓冧綅鐨勭郴鏁板垎鍒负锛7 9 10 5 8 4 + * 2 1 6 3 7 9 10 5 8 4 2 + *

+ *

+ * 2.灏嗚繖17浣嶆暟瀛楀拰绯绘暟鐩镐箻鐨勭粨鏋滅浉鍔犮 + *

+ *

+ * 3.鐢ㄥ姞鍑烘潵鍜岄櫎浠11锛岀湅浣欐暟鏄灏 + *

+ * 4.浣欐暟鍙彲鑳芥湁0 1 2 3 4 5 6 7 8 9 10杩11涓暟瀛椼傚叾鍒嗗埆瀵瑰簲鐨勬渶鍚庝竴浣嶈韩浠借瘉鐨勫彿鐮佷负1 0 X 9 8 7 6 5 4 3 + * 2銆 + *

+ * 5.閫氳繃涓婇潰寰楃煡濡傛灉浣欐暟鏄2锛屽氨浼氬湪韬唤璇佺殑绗18浣嶆暟瀛椾笂鍑虹幇缃楅┈鏁板瓧鐨勨叐銆傚鏋滀綑鏁版槸10锛岃韩浠借瘉鐨勬渶鍚庝竴浣嶅彿鐮佸氨鏄2銆 + *

+ * + * @param idcard + * @return + */ + public static boolean validate18Idcard(String idcard) { + if (idcard == null) { + return false; + } + + // 闈18浣嶄负鍋 + int s=18; + if (idcard.length() != s) { + return false; + } + // 鑾峰彇鍓17浣 + String idcard17 = idcard.substring(0, 17); + + // 鍓17浣嶅叏閮ㄤ负鏁板瓧 + if (!isDigital(idcard17)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 鏍¢獙鐪佷唤 + if (!checkProvinceid(provinceid)) { + return false; + } + + // 鏍¢獙鍑虹敓鏃ユ湡 + String birthday = idcard.substring(6, 14); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 鍑虹敓骞存湀鏃ヤ笉姝g‘ + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + // 鑾峰彇绗18浣 + String idcard18Code = idcard.substring(17, 18); + + char c[] = idcard17.toCharArray(); + + int bit[] = converCharToInt(c); + + int sum17 = 0; + + sum17 = getPowerSum(bit); + + // 灏嗗拰鍊间笌11鍙栨ā寰楀埌浣欐暟杩涜鏍¢獙鐮佸垽鏂 + String checkCode = getCheckCodeBySum(sum17); + if (null == checkCode) { + return false; + } + // 灏嗚韩浠借瘉鐨勭18浣嶄笌绠楀嚭鏉ョ殑鏍$爜杩涜鍖归厤锛屼笉鐩哥瓑灏变负鍋 + if (!idcard18Code.equalsIgnoreCase(checkCode)) { + return false; + } + //System.out.println("姝g‘"); + return true; + } + + /** + * 鏍¢獙15浣嶈韩浠借瘉 + * + *
+     * 鍙牎楠岀渷浠藉拰鍑虹敓骞存湀鏃
+     * 
+ * + * @param idcard + * @return + */ + public static boolean validate15IDCard(String idcard) { + if (idcard == null) { + return false; + } + // 闈15浣嶄负鍋 + int s=15; + if (idcard.length() != s) { + return false; + } + + // 15鍏ㄩ儴涓烘暟瀛 + if (!isDigital(idcard)) { + return false; + } + + String provinceid = idcard.substring(0, 2); + // 鏍¢獙鐪佷唤 + if (!checkProvinceid(provinceid)) { + return false; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + try { + Date birthDate = sdf.parse(birthday); + String tmpDate = sdf.format(birthDate); + // 韬唤璇佹棩鏈熼敊璇 + if (!tmpDate.equals(birthday)) { + return false; + } + + } catch (ParseException e1) { + + return false; + } + + return true; + } + + /** + * 灏15浣嶇殑韬唤璇佽浆鎴18浣嶈韩浠借瘉 + * + * @param idcard + * @return + */ + public static String convertIdcarBy15bit(String idcard) { + if (idcard == null) { + return null; + } + + // 闈15浣嶈韩浠借瘉 + int s=15; + if (idcard.length() != s) { + return null; + } + + // 15鍏ㄩ儴涓烘暟瀛 + if (!isDigital(idcard)) { + return null; + } + + String provinceid = idcard.substring(0, 2); + // 鏍¢獙鐪佷唤 + if (!checkProvinceid(provinceid)) { + return null; + } + + String birthday = idcard.substring(6, 12); + + SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); + + Date birthdate = null; + try { + birthdate = sdf.parse(birthday); + String tmpDate = sdf.format(birthdate); + // 韬唤璇佹棩鏈熼敊璇 + if (!tmpDate.equals(birthday)) { + return null; + } + + } catch (ParseException e1) { + return null; + } + + Calendar cday = Calendar.getInstance(); + cday.setTime(birthdate); + String year = String.valueOf(cday.get(Calendar.YEAR)); + + String idcard17 = idcard.substring(0, 6) + year + idcard.substring(8); + + char c[] = idcard17.toCharArray(); + String checkCode = ""; + + // 灏嗗瓧绗︽暟缁勮浆涓烘暣鍨嬫暟缁 + int bit[] = converCharToInt(c); + + int sum17 = 0; + sum17 = getPowerSum(bit); + + // 鑾峰彇鍜屽间笌11鍙栨ā寰楀埌浣欐暟杩涜鏍¢獙鐮 + checkCode = getCheckCodeBySum(sum17); + + // 鑾峰彇涓嶅埌鏍¢獙浣 + if (null == checkCode) { + return null; + } + // 灏嗗墠17浣嶄笌绗18浣嶆牎楠岀爜鎷兼帴 + idcard17 += checkCode; + return idcard17; + } + + /** + * 鏍¢獙鐪佷唤 + * + * @param provinceid + * @return 鍚堟硶杩斿洖TRUE锛屽惁鍒欒繑鍥濬ALSE + */ + private static boolean checkProvinceid(String provinceid) { + for (String id : cityCode) { + if (id.equals(provinceid)) { + return true; + } + } + return false; + } + + /** + * 鏁板瓧楠岃瘉 + * + * @param str + * @return + */ + private static boolean isDigital(String str) { + return str.matches("^[0-9]*$"); + } + + /** + * 灏嗚韩浠借瘉鐨勬瘡浣嶅拰瀵瑰簲浣嶇殑鍔犳潈鍥犲瓙鐩镐箻涔嬪悗锛屽啀寰楀埌鍜屽 + * + * @param bit + * @return + */ + private static int getPowerSum(int[] bit) { + + int sum = 0; + + if (power.length != bit.length) { + return sum; + } + + for (int i = 0; i < bit.length; i++) { + for (int j = 0; j < power.length; j++) { + if (i == j) { + sum = sum + bit[i] * power[j]; + } + } + } + return sum; + } + + /** + * 灏嗗拰鍊间笌11鍙栨ā寰楀埌浣欐暟杩涜鏍¢獙鐮佸垽鏂 + * + * @param sum17 + * @param sum17 + * @return 鏍¢獙浣 + */ + private static String getCheckCodeBySum(int sum17) { + String checkCode = null; + switch (sum17 % 11) { + case 10: + checkCode = "2"; + break; + case 9: + checkCode = "3"; + break; + case 8: + checkCode = "4"; + break; + case 7: + checkCode = "5"; + break; + case 6: + checkCode = "6"; + break; + case 5: + checkCode = "7"; + break; + case 4: + checkCode = "8"; + break; + case 3: + checkCode = "9"; + break; + case 2: + checkCode = "x"; + break; + case 1: + checkCode = "0"; + break; + case 0: + checkCode = "1"; + break; + default: + } + return checkCode; + } + + /** + * 灏嗗瓧绗︽暟缁勮浆涓烘暣鍨嬫暟缁 + * + * @param c + * @return + * @throws NumberFormatException + */ + private static int[] converCharToInt(char[] c) throws NumberFormatException { + int[] a = new int[c.length]; + int k = 0; + for (char temp : c) { + a[k++] = Integer.parseInt(String.valueOf(temp)); + } + return a; + } + + /** + * 楠岃瘉娓境閫氳璇 + * + * @param idcard + * 韬唤璇 + * @return 鍚堟硶杩斿洖true锛屽惁鍒欒繑鍥瀎alse + */ + public static boolean checkHMPassportIdNum(String idcard) { + + if (idcard == null || "".equals(idcard)) { + return false; + } + + if (idcard.length() == 9) { + return true; + } + + return false; + } + + /** + * 楠岃瘉鍙版咕閫氳璇 + * @param idcard + * @return + */ + public static boolean checkTPassportIdNum(String idcard) { + + if (idcard == null || "".equals(idcard)) { + return false; + } + + if (idcard.length() == 8) { + return true; + } + + return false; + } +} diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index 74d934add..1db4a449e 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; @@ -275,8 +274,8 @@ public class AddUpDeductionController { } /** - * @description 鏂板缓绱涓撻」闄勫姞鎵i櫎 * @return String + * @description 鏂板缓绱涓撻」闄勫姞鎵i櫎 * @author Harryxzy * @date 2022/10/26 14:23 */ @@ -289,8 +288,8 @@ public class AddUpDeductionController { } /** - * @description 鑾峰彇绱涓撻」闄勫姞鎵i櫎淇℃伅 * @return String + * @description 鑾峰彇绱涓撻」闄勫姞鎵i櫎淇℃伅 * @author Harryxzy * @date 2022/10/31 11:23 */ @@ -304,8 +303,8 @@ public class AddUpDeductionController { /** - * @description 缂栬緫绱涓撻」闄勫姞鎵i櫎 * @return String + * @description 缂栬緫绱涓撻」闄勫姞鎵i櫎 * @author Harryxzy * @date 2022/10/25 14:08 */ @@ -318,8 +317,8 @@ public class AddUpDeductionController { } /** - * @description 绱涓撻」闄勫姞鎵i櫎-鍒犻櫎鎵閫 * @return String + * @description 绱涓撻」闄勫姞鎵i櫎-鍒犻櫎鎵閫 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -332,8 +331,8 @@ public class AddUpDeductionController { } /** - * @description 绱涓撻」闄勫姞鎵i櫎-涓閿竻绌 * @return String + * @description 绱涓撻」闄勫姞鎵i櫎-涓閿竻绌 * @author Harryxzy * @date 2022/10/27 14:08 */ @@ -357,6 +356,7 @@ public class AddUpDeductionController { /** * 涓閿嚜鍔ㄧ疮璁 + * * @return */ @POST @@ -379,4 +379,107 @@ public class AddUpDeductionController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getAddUpDeductionWrapper(user)::autoAddAll, param); } + + + /** + * 鍦ㄧ嚎鑾峰彇 + * + * @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 c10443a88..db9de24d9 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -356,6 +356,4 @@ public class AddUpSituationController { map.put("importParam", importParam); return new ResponseResult>(user).run(getAddUpSituationWrapper(user)::preview, importParam); } - - } diff --git a/src/com/engine/salary/web/DeductionAmountController.java b/src/com/engine/salary/web/DeductionAmountController.java new file mode 100644 index 000000000..617c36920 --- /dev/null +++ b/src/com/engine/salary/web/DeductionAmountController.java @@ -0,0 +1,94 @@ +package com.engine.salary.web; + + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; +import com.engine.salary.entity.deductionamount.param.*; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.DeductionAmountWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 骞存敹鍏ヤ笉瓒6涓囧厓鐨勭撼绋庝汉鏆備笉棰勬墸棰勭即绋庢鎵i櫎鍚嶅崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountController { + + private DeductionAmountWrapper getDeductionAmountWrapper(User user) { + return ServiceUtil.getService(DeductionAmountWrapper.class, user); + } + + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountListParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getDeductionAmountWrapper(user)::list, param); + } + + @POST + @Path("/add") + @Produces(MediaType.APPLICATION_JSON) + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountAddParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::add, param); + } + + @POST + @Path("/edit") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountEditParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::edit, param); + } + + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::delete, param); + } + + @POST + @Path("/query") + @Produces(MediaType.APPLICATION_JSON) + public String query(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountOnlineQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::query, param); + } + + @POST + @Path("/confirm") + @Produces(MediaType.APPLICATION_JSON) + public String confirm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountConfirmParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::confirm, param); + } + + @POST + @Path("/feedback") + @Produces(MediaType.APPLICATION_JSON) + public String feedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountFeedBackParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getDeductionAmountWrapper(user)::feedback, param); + } + +} diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java new file mode 100644 index 000000000..356801c50 --- /dev/null +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -0,0 +1,446 @@ +package com.engine.salary.web; + + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO; +import com.engine.salary.entity.employeedeclare.dto.TaxAgentDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.EmployeeDeclareWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDate; +import java.util.Collection; +import java.util.Map; + +/** + * 浜哄憳鎶ラ + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeDeclareController { + + private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { + return ServiceUtil.getService(EmployeeDeclareWrapper.class, user); + } + + /** + * 浜哄憳鎶ラ-涓◣鎵g即涔夊姟浜哄垪琛 + * + * @param param 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/taxAgentDeclareList") + @Produces(MediaType.APPLICATION_JSON) + public String taxAgentDeclareList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentDeclareListQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::taxAgentDeclareList, param); + } + + /** + * 浜哄憳鎶ラ-鍏ㄩ儴浜哄憳鍒楄〃 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list, queryParam); + } + + /** + * 浜哄憳鎶ラ-鏈湀鏂板浜哄憳鍒楄〃 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/list4Add") + @Produces(MediaType.APPLICATION_JSON) + public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Add, queryParam); + } + + /** + * 浜哄憳鎶ラ-鏈湀淇℃伅鍙樺姩鍒楄〃 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/list4Update") + @Produces(MediaType.APPLICATION_JSON) + public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Update, queryParam); + } + + /** + * 浜哄憳鎶ラ-鏈湀鎶ラ佸け璐ヤ汉鍛樺垪琛 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/list4Fail") + @Produces(MediaType.APPLICATION_JSON) + public String list4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareFailListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::list4Fail, queryParam); + } + + /** + * 浜哄憳鎶ラ-鑾峰彇鏂板缓鎴栫紪杈戠殑琛ㄥ崟 + * + * @param id 鎶ラ佷汉鍛樺垪琛ㄧ殑涓婚敭id + * @return + */ + @GET + @Path("/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::getForm, id); + } + +// @GetMapping("/getBatchUpdateForm") +// @ApiOperation("浜哄憳鎶ラ-鑾峰彇鎵归噺缂栬緫鐨勮〃鍗") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult getBatchUpdateForm() { +// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm(); +// return WeaResult.success(weaForm); +// } +// +// @GetMapping("/getSearchCondition") +// @ApiOperation("浜哄憳鎶ラ-鑾峰彇楂樼骇鎼滅储鏉′欢") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult getSearchCondition() { +// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); +// return WeaResult.success(searchCondition); +// } + + /** + * 浜哄憳鎶ラ-鏂板浜哄憳/缂栬緫浜哄憳淇濆瓨 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return + */ + @POST + @Path("/save") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam); + } + +// /** +// * 浜哄憳鎶ラ-鎵归噺缂栬緫 +// * +// * @param batchUpdateParam 鎵归噺缂栬緫鍙傛暟 +// * @return +// */ +// @Path("/batchUpdate") +// @ApiOperation("浜哄憳鎶ラ-鎵归噺缂栬緫") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) { +// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } + + /** + * 浜哄憳鎶ラ-鍒犻櫎 + * + * @param ids 寰呭垹闄ょ殑涓婚敭id + * @return + */ + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getEmployeeDeclareWrapper(user)::deleteByIds, ids); + } + + /** + * 浜哄憳鎶ラ-鍒锋柊鏁版嵁 + * + * @param refreshParam 鍒锋柊鏁版嵁鐨勫弬鏁 + * @return + */ + @POST + @Path("/refresh") + @Produces(MediaType.APPLICATION_JSON) + public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::refresh, refreshParam); + } + + @POST + @Path("/batRefresh") + @Produces(MediaType.APPLICATION_JSON) + public String batRefresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batRefresh, refreshParam); + } + + /** + * 浜哄憳鎶ラ-鑾峰彇鏁翠綋鐨勬姤閫佹儏鍐 + * + * @param employeeDeclareParam 鑾峰彇鏁翠綋鐨勬姤閫佹儏鍐电殑鍙傛暟 + * @return + */ + @POST + @Path("/getDeclareInfo") + @Produces(MediaType.APPLICATION_JSON) + public String getDeclareInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); + } + + /** + * 浜哄憳鎶ラ-鍏ㄩ儴鎶ラ + * + * @param employeeDeclareParam 鍦ㄧ嚎鎶ラ + * @return + */ + @POST + @Path("/declare") + @Produces(MediaType.APPLICATION_JSON) + public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam); + } + + @POST + @Path("/batDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String batDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batDeclare, employeeDeclareParam); + } + + /** + * 浜哄憳鎶ラ-鑾峰彇鎶ラ佺粨鏋滃弽棣 + * + * @param employeeDeclareParam 鑾峰彇鍙嶉 + * @return + */ + @POST + @Path("/getDeclareFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); + } + + @POST + @Path("/batGetDeclareFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String batGetDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::batGetDeclareFeedback, employeeDeclareParam); + } + + /** + * 浜哄憳鎶ラ-鍚庣涓氬姟閫昏緫鏄惁宸茬粡瀹屾垚 + * + * @param index 杩涘害绱㈠紩 + * @return + */ + @GET + @Path("/getRate") + @Produces(MediaType.APPLICATION_JSON) + public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getEmployeeDeclareWrapper(user)::getRate, index); + } + + /** + * 浜哄憳鎶ラ-涓嬭浇瀵煎叆妯℃澘 + * + * @param queryParam 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/exportTemplate") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).exportTemplate(queryParam); + String fileName = "浜哄憳淇℃伅閲囬泦瀵煎叆妯℃澘-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + + /** + * 浜哄憳鎶ラ-瀵煎叆棰勮 + * + * @param queryParam 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::preview, queryParam); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆 + * + * @param queryParam 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_JSON) + public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); + } + + + /** + * 浜哄憳鎶ラ-瀵煎嚭鍏ㄩ儴浜哄憳 + * + * @param param 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam param) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(param); + String fileName = "浜哄憳淇℃伅閲囬泦-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀鏂板浜哄憳 +// * +// * @param queryParam 瀵煎嚭鍙傛暟 +// * @return +// */ +// @Path("/export4Add") +// @ApiOperation("浜哄憳鎶ラ-瀵煎嚭鏈湀鏂板浜哄憳") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀淇℃伅鍙樺姩浜哄憳 +// * +// * @param queryParam 瀵煎嚭鍙傛暟 +// * @return +// */ +// @Path("/export4Update") +// @ApiOperation("浜哄憳鎶ラ-瀵煎嚭鏈湀淇℃伅鍙樺姩浜哄憳") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀鎶ラ佸け璐ョ殑浜哄憳 +// * +// * @param queryParam 瀵煎嚭鍙傛暟 +// * @return +// */ +// @Path("/export4Fail") +// @ApiOperation("浜哄憳鎶ラ-瀵煎嚭鏈湀鎶ラ佸け璐ョ殑浜哄憳") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +// +// @Path("/getImportParam") +// @ApiOperation("浜哄憳鎶ラ-鑾峰彇瀵煎叆鍙傛暟") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult getAcctResultImportParams() { +// String tenantKey = TenantContext.getCurrentTenantKey(); +// Long currentEmployeeId = UserContext.getCurrentEmployeeId(); +// return WeaResult.success(salaryBatchService.buildImportParam("importEmployeeDeclare", +// "importEmployeeDeclare", +// SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 158769, "浜哄憳淇℃伅鎶ラ"), +// null, +// null)); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭瀵煎叆妯℃澘 +// * +// * @param importParam 鑾峰彇瀵煎叆妯℃澘 +// * @return +// */ +// @Path("/exportTemplate") +// @ApiOperation("浜哄憳鎶ラ-瀵煎嚭瀵煎叆妯℃澘") +// @Produces(MediaType.APPLICATION_JSON) +// public WeaResult exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { +// Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } +} diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index 251507f68..fb40b0fff 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -1,8 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; @@ -279,8 +278,8 @@ public class OtherDeductionController { } /** - * @description 缂栬緫鍏朵粬鍏嶇◣鎵i櫎 * @return String + * @description 缂栬緫鍏朵粬鍏嶇◣鎵i櫎 * @author Harryxzy * @date 2022/10/26 9:41 */ @@ -293,8 +292,8 @@ public class OtherDeductionController { } /** - * @description 鑾峰彇鍏朵粬鍏嶇◣鎵i櫎鏁版嵁 * @return String + * @description 鑾峰彇鍏朵粬鍏嶇◣鎵i櫎鏁版嵁 * @author Harryxzy * @date 2022/10/31 13:42 */ @@ -307,8 +306,8 @@ public class OtherDeductionController { } /** - * @description 鏂板缓鍏朵粬鍏嶇◣鎵i櫎 * @return String + * @description 鏂板缓鍏朵粬鍏嶇◣鎵i櫎 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -321,8 +320,8 @@ public class OtherDeductionController { } /** - * @description 鍒犻櫎鎵閫夊叾浠栧厤绋庢墸闄 * @return String + * @description 鍒犻櫎鎵閫夊叾浠栧厤绋庢墸闄 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -335,8 +334,8 @@ public class OtherDeductionController { } /** - * @description 涓閿竻绌哄叾浠栧厤绋庢墸闄 * @return null + * @description 涓閿竻绌哄叾浠栧厤绋庢墸闄 * @author Harryxzy * @date 2022/10/27 15:15 */ @@ -351,9 +350,190 @@ public class OtherDeductionController { @POST @Path("/extendToLastMonth") @Produces(MediaType.APPLICATION_JSON) - public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody OtherDeductionExtendLastParam param) { + public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionExtendLastParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getOtherDeductionWrapper(user)::extendToLastMonth, param); } + + //鍑忓厤绋庨鍒楄〃 + @POST + @Path("/freeIncomeList") + @Produces(MediaType.APPLICATION_JSON) + public String freeIncomeList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::freeIncomeList, param); + } + + + @POST + @Path("/healthInsuranceList") + @Produces(MediaType.APPLICATION_JSON) + public String healthInsuranceList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::healthInsuranceList, param); + } + + + @POST + @Path("/endowmentInsuranceList") + @Produces(MediaType.APPLICATION_JSON) + public String endowmentInsuranceList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::endowmentInsuranceList, param); + } + + @POST + @Path("/grantDonationList") + @Produces(MediaType.APPLICATION_JSON) + public String grantDonationList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::grantDonationList, param); + } + + + @POST + @Path("/derateDeductionList") + @Produces(MediaType.APPLICATION_JSON) + public String derateDeductionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::derateDeductionList, param); + } + + + @POST + @Path("/otherDerateDeductionList") + @Produces(MediaType.APPLICATION_JSON) + public String otherDerateDeductionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::otherDerateDeductionList, param); + } + + @POST + @Path("/personalPensionList") + @Produces(MediaType.APPLICATION_JSON) + public String personalPensionList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::personalPensionList, param); + } + + + @POST + @Path("/saveFreeIncome") + @Produces(MediaType.APPLICATION_JSON) + public String saveFreeIncome(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody FreeIncomeSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveFreeIncome, param); + } + + @POST + @Path("/saveHealthInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String saveHealthInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody HealthInsuranceSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveHealthInsurance, param); + } + + + @POST + @Path("/saveEndowmentInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String saveEndowmentInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EndowmentInsuranceSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveEndowmentInsurance, param); + } + + @POST + @Path("/saveGrantDonation") + @Produces(MediaType.APPLICATION_JSON) + public String saveGrantDonation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GrantDonationSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveGrantDonation, param); + } + + @POST + @Path("/saveDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String saveDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DerateDeductionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveDerateDeduction, param); + } + + + @POST + @Path("/saveOtherDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String saveOtherDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDerateDeductionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveOtherDerateDeduction, param); + } + + @POST + @Path("/savePersonalPension") + @Produces(MediaType.APPLICATION_JSON) + public String savePersonalPension(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PersonalPensionSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::savePersonalPension, param); + } + + + @POST + @Path("/deleteFreeIncome") + @Produces(MediaType.APPLICATION_JSON) + public String deleteFreeIncome(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteFreeIncome, param); + } + + @POST + @Path("/deleteHealthInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String deleteHealthInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteHealthInsurance, param); + } + + + @POST + @Path("/deleteEndowmentInsurance") + @Produces(MediaType.APPLICATION_JSON) + public String deleteEndowmentInsurance(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteEndowmentInsurance, param); + } + + @POST + @Path("/deleteGrantDonation") + @Produces(MediaType.APPLICATION_JSON) + public String deleteGrantDonation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteGrantDonation, param); + } + + @POST + @Path("/deleteDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String deleteDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteDerateDeduction, param); + } + + + @POST + @Path("/deleteOtherDerateDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String deleteOtherDerateDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deleteOtherDerateDeduction, param); + } + + + + @POST + @Path("/deletePersonalPension") + @Produces(MediaType.APPLICATION_JSON) + public String deletePersonalPension(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deletePersonalPension, param); + } + } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 57483fd40..1f42d825d 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -12,6 +12,7 @@ import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.excel.ExcelPreviewDTO; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.*; +import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -433,6 +434,17 @@ public class SalaryAcctController { } } + /** + * 鏈姤閫佷汉鍛樺垪琛 + */ + @POST + @Path("/acctemployee/listPage4NotDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryAcctEmployeeWrapper(user)::listPage4NotDeclareByParam, param); + } + // **********************************钖祫鏍哥畻浜哄憳鐩稿叧 end*********************************/ @@ -544,6 +556,42 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::calculate, param); } + @POST + @Path("/acctresult/getCalcTaxInfo") + @ApiOperation("鑾峰彇銆岃绠椾釜绋庛嶅拰銆岃幏鍙栦釜绋庤绠楀弽棣堛嶅弽棣堢殑鏄剧ず涓庡惁") + @Produces(MediaType.APPLICATION_JSON) + public String getCalcTaxInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::getCalcTaxInfo, salaryCalcTaxParam); + } + + @POST + @Path("/acctresult/calcTax") + @ApiOperation("璁$畻涓◣") + @Produces(MediaType.APPLICATION_JSON) + public String calcTax(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::calcTax, salaryCalcTaxParam); + } + + @POST + @Path("/acctresult/calcTaxFeedback") + @ApiOperation("鑾峰彇涓◣璁$畻鍙嶉") + @Produces(MediaType.APPLICATION_JSON) + public String calcTaxFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::calcTaxFeedback, salaryCalcTaxParam); + } + + //璁$畻绋庡悗宸ヨ祫 + @POST + @Path("/acctresult/afterTaxAccounting") + @Produces(MediaType.APPLICATION_JSON) + public String afterTaxAccounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAfterTaxAcctCalculateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::afterTaxAccounting, param); + } + //瀵煎嚭鏍哥畻缁撴灉 @GET @Path("/acctresult/export") @@ -610,7 +658,7 @@ public class SalaryAcctController { @GET @Path("/acctresult/importField") @Produces(MediaType.APPLICATION_JSON) - public String accounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { + public String importField(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getImportField, salaryAcctRecordId); } @@ -742,7 +790,7 @@ public class SalaryAcctController { // @GetMapping("/checkresult/getCount") // @ApiOperation(("鑾峰彇鏍¢獙缁撴灉锛堝紓甯革級鎬绘暟")) -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult getCheckResultCount(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // Integer salaryCheckResultCount = salaryAcctCheckResultWrapper.countBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(salaryCheckResultCount); @@ -750,7 +798,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresult/list") // @ApiOperation("鏍¢獙缁撴灉鍒楄〃") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) { // WeaTable weaTable = salaryAcctCheckResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); @@ -758,7 +806,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresultdetail/list") // @ApiOperation("鏍¢獙缁撴灉鏄庣粏鍒楄〃") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) { // WeaTable weaTable = salaryAcctCheckResultWrapper.listPage4CheckResultRecord(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); @@ -766,7 +814,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresult/ignore") // @ApiOperation("鏍¢獙缁撴灉鍒楄〃") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult ignoreCheckResult(@RequestParam(value = "id") Long id) { // salaryAcctCheckResultWrapper.ignoreById(id, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); @@ -774,7 +822,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresult/ignoreAll") // @ApiOperation("鏍¢獙缁撴灉鍒楄〃") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult ignoreAllCheckResult(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // salaryAcctCheckResultWrapper.ignoreBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); @@ -782,7 +830,7 @@ public class SalaryAcctController { // // @PostMapping("/acctresult/check") // @ApiOperation(("钖祫鏍哥畻缁撴灉鏍¢獙")) -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult check(@RequestBody @Validated SalaryAcctCheckParam checkParam) { // salaryAcctResultWrapper.check(checkParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); @@ -790,7 +838,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresult/export") // @ApiOperation("鏍¢獙寮傚父瀵煎嚭") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult> exportCheckResult(@RequestBody @Validated SalaryCheckResultExportParam exportParam) { // DataCollectionEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); @@ -801,7 +849,7 @@ public class SalaryAcctController { // // @PostMapping("/checkresultRecord/export") // @ApiOperation("鏍¢獙寮傚父鏄庣粏瀵煎嚭") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) { // DataCollectionEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 8bb205be2..ad775cc58 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -616,18 +616,6 @@ public class SalaryArchiveController { return new ResponseResult(user).run(getSalaryArchiveWrapper(user)::stopSalary, stopSalaryParam); } - /** - * 鍚屾鎵鏈夋。妗堣捣濮嬪彂钖棩鏈熷彉涓哄叆鑱屾棩鏈 - * - * @return - */ - @GET - @Path("/syncPayStartDate") - @Produces(MediaType.APPLICATION_JSON) - public String syncPayStartDate(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalaryArchiveWrapper(user)::syncPayStartDate); - } // ******** 钖祫妗f涓昏〃 end ***********************************************************************************************/ diff --git a/src/com/engine/salary/web/SalaryCommonController.java b/src/com/engine/salary/web/SalaryCommonController.java index 8e47a22d6..96d6e9ab5 100644 --- a/src/com/engine/salary/web/SalaryCommonController.java +++ b/src/com/engine/salary/web/SalaryCommonController.java @@ -1,6 +1,10 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.setting.param.PageListSettingQueryParam; +import com.engine.salary.entity.setting.param.PageListSettingSaveParam; +import com.engine.salary.entity.browser.dto.BrowserDataDTO; +import com.engine.salary.entity.browser.param.BrowserDataQueryParam; import com.engine.salary.entity.setting.dto.PageListTemplateDTO; import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO; import com.engine.salary.entity.setting.param.*; @@ -61,6 +65,13 @@ public class SalaryCommonController { return new ResponseResult(user).run(getSalaryCommonWrapper(user)::removeCache, key); } + @POST + @Path("/browser/data") + @Produces(MediaType.APPLICATION_JSON) + public String removeCache(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody BrowserDataQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryCommonWrapper(user)::getBrowserData, param); + } /** * 椤甸潰妯℃澘璁剧疆 diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 5882004c9..a452be05c 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -80,6 +80,18 @@ public class SalarySobController { return ServiceUtil.getService(SalaryApprovalWrapper.class, user); } + private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user); + } + + private SalarySobAddUpRuleWrapper getSalarySobAddUpRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleWrapper.class, user); + } + + private SalarySobTaxRuleWrapper getSalarySobTaxRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobTaxRuleWrapper.class, user); + } + /**********************************钖祫璐﹀ start*********************************/ /** @@ -115,6 +127,13 @@ public class SalarySobController { return new ResponseResult>(user).run(getSalarySobWrapper(user)::listAll); } + @GET + @Path("/incomeCategoryList") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobBasicForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>>(user).run(getSalarySobWrapper(user)::incomeCategoryList); + } /** * 钖祫璐﹀鍒楄〃锛堝垎鏉冿級 @@ -421,6 +440,7 @@ public class SalarySobController { return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::save, saveParam); } + /** * 钖祫璐﹀-钖祫椤圭洰鐨勮鎯 */ @@ -432,6 +452,29 @@ public class SalarySobController { return new ResponseResult(user).run(getSalarySobItemWrapper(user)::getSalaryItemForm, param); } + /** + * 璐﹀椤圭洰鎷撴墤鍥 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/item/topology") + @Produces(MediaType.APPLICATION_JSON) + public String getSalaryItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemTopologyQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobItemWrapper(user)::topology, param); + } + + @GET + @Path("/item/checkLoop") + @Produces(MediaType.APPLICATION_JSON) + public String checkLoop(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobItemWrapper(user)::checkLoop, salarySobId); + } /**********************************钖祫璐﹀鐨勮柂璧勯」鐩 end*********************************/ @@ -483,6 +526,106 @@ public class SalarySobController { /**********************************钖祫璐﹀鐨勫洖绠楅」鐩 end*********************************/ + /**********************************钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 start*********************************/ + + /** + * 钖祫璐﹀涓嬬殑绱瀛楁瀵瑰簲鍏崇郴 + * + * @param id 钖祫璐﹀id + * @return + */ + @GET + @Path("/adduprule/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobAddUpForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobAddUpRuleWrapper(user)::getForm, id); + } + + /** + * 淇濆瓨钖祫璐﹀涓嬬殑绱瀛楁瀵瑰簲鍏崇郴 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return + */ + @POST + @Path("/adduprule/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobAddUp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobAddUpRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobAddUpRuleWrapper(user)::save, saveParam); + } + + /**********************************钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 end*********************************/ + + + /**********************************钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 start*********************************/ + + /** + * 钖祫璐﹀涓嬬殑涓◣鐢虫姤琛ㄨ鍒欑殑璇︽儏 + * + * @param id 钖祫璐﹀id + * @return + */ + @GET + @Path("/taxreportrule/getForm") + @ApiOperation("钖祫璐﹀涓嬬殑涓◣鐢虫姤琛ㄨ鍒欑殑璇︽儏") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobTaxReportRuleForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobTaxReportRuleWrapper(user)::getForm, id); + } + + /** + * 淇濆瓨钖祫璐﹀涓嬬殑涓◣鐢虫姤琛ㄨ鍒欑殑 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return + */ + @POST + @Path("/taxreportrule/save") + @ApiOperation("淇濆瓨钖祫璐﹀涓嬬殑涓◣鐢虫姤琛ㄨ鍒欑殑") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobTaxReportRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobTaxReportRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobTaxReportRuleWrapper(user)::save, saveParam); + } + + /**********************************钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 end*********************************/ + + /**********************************钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 start*********************************/ + + /** + * 钖祫璐﹀涓嬬殑涓◣瑙勫垯鐨勮鎯 + * + * @param id 钖祫璐﹀id + * @return + */ + @GET + @Path("/taxrule/getForm") + @ApiOperation("钖祫璐﹀涓嬬殑涓◣瑙勫垯鐨勮鎯") + @Produces(MediaType.APPLICATION_JSON) + public String getSalarySobTaxRuleForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobTaxRuleWrapper(user)::getForm, id); + } + + /** + * 淇濆瓨钖祫璐﹀涓嬬殑涓◣瑙勫垯 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return + */ + @POST + @Path("/taxrule/save") + @ApiOperation("淇濆瓨钖祫璐﹀涓嬬殑涓◣瑙勫垯鐨") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobTaxRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobTaxRuleSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobTaxRuleWrapper(user)::save, saveParam); + } + + /**********************************钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 end*********************************/ /**********************************璋冭柂璁¤柂瑙勫垯 start*********************************/ diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index 4586af8e3..92f4401ea 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -287,7 +287,7 @@ public class SalarySystemConfigController { } /** - * 搴旂敤璁剧疆 + * 淇濆瓨鍔犲瘑璁剧疆 * * @param request * @param response diff --git a/src/com/engine/salary/web/TaxAgentTaxReturnController.java b/src/com/engine/salary/web/TaxAgentTaxReturnController.java new file mode 100644 index 000000000..e0bb24202 --- /dev/null +++ b/src/com/engine/salary/web/TaxAgentTaxReturnController.java @@ -0,0 +1,95 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxagent.dto.TaxAgentTaxReturnMainFormDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxAgentTaxReturnWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxAgentTaxReturnController { + + private TaxAgentTaxReturnWrapper getTaxAgentTaxReturnWrapper(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnWrapper.class, user); + } + + + /** + * 鑾峰彇鎶ョ◣淇℃伅琛ㄥ崟 + * + * @param taxAgentId + * @return + */ + @GET + @Path("/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("taxAgentId") Long taxAgentId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::getForm, taxAgentId); + } + + /** + * 淇濆瓨骞堕獙璇佹姤绋庝俊鎭 + * + * @param saveParam + * @return + */ + @POST + @Path("/saveAndCheck") + @Produces(MediaType.APPLICATION_JSON) + public String saveAndCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.MAIN_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 澶氫釜鐧昏搴忓彿鍗曢夋彁浜 + * + * @param saveParam + * @return + */ + @POST + @Path("/registration/check") + @Produces(MediaType.APPLICATION_JSON) + public String registrationCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Registration(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.REGISTRATION_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + + /** + * 澶氫釜鐧昏搴忓彿鍗曢夋彁浜 + * + * @param saveParam + * @return + */ + @POST + @Path("/departmentCode/check") + @Produces(MediaType.APPLICATION_JSON) + public String departmentCodeCheck(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentTaxReturnSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + saveParam.checkParam4Department(); + saveParam.setType(TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue()); + return new ResponseResult(user).run(getTaxAgentTaxReturnWrapper(user)::verify, saveParam); + } + +} diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..c4d9cd8db --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -0,0 +1,174 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.TaxDeclarationApiFlowBillingWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.HrmUserVarify; +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.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDateTime; + +/** + * 鏅鸿兘绠楄柂-璁¤垂 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationApiFlowController { + + private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowBillingWrapper.class, user); + } + + /** + * 璁¤垂閰嶇疆淇濆瓨 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/billing/config/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::saveConfig, saveParam); + } + + /** + * 璁¤垂閰嶇疆寮鍏 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/billing/config/enable") + @Produces(MediaType.APPLICATION_JSON) + public String enableConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::enableConfig, saveParam); + } + + + /** + * 鏌ヨ璁¤垂閰嶇疆寮鍏崇姸鎬 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/billing/config/status") + @Produces(MediaType.APPLICATION_JSON) + public String getConfigStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfigStatus); + } + + /** + * 璁¤垂閰嶇疆缂栬緫琛ㄥ崟 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/billing/config/get") + @Produces(MediaType.APPLICATION_JSON) + public String getConfig(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfig); + } + + /** + * 鎺ュ彛娴侀噺浣跨敤璁板綍 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/record/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord, queryParam); + } + + /** + * 瀵煎嚭鎺ュ彛娴侀噺浣跨敤璁板綍 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/record/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + TaxDeclarationApiFlowRecordQueryParam queryParam = TaxDeclarationApiFlowRecordQueryParam.builder().build(); + String taxAgentId = request.getParameter("taxAgentId"); + if(StringUtils.isNotBlank(taxAgentId)){ + queryParam.setTaxAgentId(Long.valueOf(taxAgentId)); + } + String startDate = request.getParameter("startDate"); + if(StringUtils.isNotBlank(startDate)){ + queryParam.setStartDate(SalaryDateUtil.stringToDate(startDate)); + } + String endDate = request.getParameter("endDate"); + if(StringUtils.isNotBlank(endDate)){ + queryParam.setEndDate(SalaryDateUtil.stringToDate(endDate)); + } + String businessType = request.getParameter("businessType"); + if(StringUtils.isNotBlank(businessType)){ + queryParam.setBusinessType(Integer.valueOf(businessType)); + } + String result = request.getParameter("result"); + if(StringUtils.isNotBlank(result)){ + queryParam.setResult(Integer.valueOf(result)); + } + + + XSSFWorkbook workbook = getTaxDeclarationApiFlowBillingWrapper(user).exportFlowRecord(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "鎺ュ彛娴侀噺鏈堢粺璁℃暟鎹") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + 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; + } + } + +} diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java new file mode 100644 index 000000000..184920487 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowStatisticController.java @@ -0,0 +1,172 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.TaxDeclarationApiFlowStatisticWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.HrmUserVarify; +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.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.time.LocalDateTime; + +/** + * 鏅鸿兘绠楄柂-璁¤垂 + * + * @author chengliming + * @date 2022-11-15 16:05:40 + */ +@Slf4j +public class TaxDeclarationApiFlowStatisticController { + + private TaxDeclarationApiFlowStatisticWrapper getTaxDeclarationApiFlowStatisticWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticWrapper.class, user); + } + + /** + * 鎺ュ彛娴侀噺缁熻 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/info") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatistics); + } + + /** + * 鎺ュ彛娴侀噺浣跨敤鏄庣粏 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatisticsList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody BaseQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsList, queryParam); + } + + + /** + * 瀵煎嚭鎺ュ彛娴侀噺浣跨敤鏄庣粏 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatistics(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclarationApiFlowStatisticWrapper(user).exportFlowStatistics(); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "鎺ュ彛娴侀噺缁熻鏁版嵁") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + 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; + } + } + + /** + * 鎺ュ彛娴侀噺鏈堝害浣跨敤鏄庣粏 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/detail/list") + @Produces(MediaType.APPLICATION_JSON) + public String getFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowMonthQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowStatisticWrapper(user)::getFlowStatisticsDetail, queryParam); + } + + /** + * 瀵煎嚭鎺ュ彛娴侀噺鏈堝害浣跨敤鏄庣粏 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/detail/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportFlowStatisticsDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + TaxDeclarationApiFlowMonthQueryParam queryParam = TaxDeclarationApiFlowMonthQueryParam.builder().build(); + String taxAgentId = request.getParameter("taxAgentId"); + if(StringUtils.isNotBlank(taxAgentId)){ + queryParam.setTaxAgentId(Long.valueOf(taxAgentId)); + } + String startTaxMonth = request.getParameter("startTaxMonth"); + if(StringUtils.isNotBlank(startTaxMonth)){ + queryParam.setStartTaxMonth(SalaryDateUtil.stringToDate(startTaxMonth)); + } + String endTaxMonth = request.getParameter("endTaxMonth"); + if(StringUtils.isNotBlank(endTaxMonth)){ + queryParam.setEndTaxMonth(SalaryDateUtil.stringToDate(endTaxMonth)); + } + + + XSSFWorkbook workbook = getTaxDeclarationApiFlowStatisticWrapper(user).exportFlowStatisticsDetail(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "鎺ュ彛娴侀噺鏈堢粺璁℃暟鎹") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + 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; + } + } +} diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java new file mode 100644 index 000000000..c209be628 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowWarnController.java @@ -0,0 +1,147 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnConfigFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.TaxDeclarationApiFlowWarnWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 鏅鸿兘绠楄柂-娴侀噺涓嶈冻鎻愰啋 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class TaxDeclarationApiFlowWarnController { + private TaxDeclarationApiFlowWarnWrapper getTaxDeclarationApiFlowWarnWrapper(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnWrapper.class, user); + } + + /** + * 娴侀噺涓嶈冻鎻愰啋琛ㄥ崟 + * + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/config/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnConfigForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnConfigForm); + } + + /** + * 娴侀噺涓嶈冻鎻愰啋缂栬緫鎴栦繚瀛 + * + * @param param 淇濆瓨鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/config/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveWarnConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnConfigSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::saveWarnConfig, param); + } + + /** + * 娴侀噺涓嶈冻鎻愰啋瀵硅薄缂栬緫琛ㄥ崟 + * + * @param param 鍓嶇鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/receiver/getForm") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnReceiverForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnReceiverSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverForm, param); + } + + /** + * 缂栬緫淇濆瓨娴侀噺涓嶈冻鎻愰啋瀵硅薄 + * + * @param param 淇濆瓨鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/receiver/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveWarnReceiver(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowWarnReceiverSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::saveWarnReceiver, param); + } + + /** + * 娴侀噺涓嶈冻鎻愰啋瀵硅薄鍒楄〃 + * + * @param warnConfigId 涓婚敭id + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/receiver/list") + @Produces(MediaType.APPLICATION_JSON) + public String getWarnReceiverList(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "warnConfigId") Long warnConfigId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getWarnReceiverList, warnConfigId); + } + + /** + * 娴侀噺涓嶈冻鎻愰啋瀵硅薄-鍒犻櫎 + * + * @param id 涓婚敭id + * @return WeaResult 杩斿洖缁撴灉 + */ + @GET + @Path("/receiver/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteReceiver(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::deleteReceiver, id); + } + + /** + * 鑾峰彇鍒涘缓瑙勫垯鍙傛暟 + * @param request + * @param response + * @return + */ + @GET + @Path("/rule/params") + @Produces(MediaType.APPLICATION_JSON) + public String getMessageRuleParams(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::getRuleBusinessId); + } + + /** + * 鍒涘缓瑙勫垯 + * + * @param param 鍓嶇鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @POST + @Path("/rule/create") + @Produces(MediaType.APPLICATION_JSON) + public String createMessageRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CreateMessageRuleParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclarationApiFlowWarnWrapper(user)::createMessageRule, param); + } +} diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index e6205eaaa..8a953dc92 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -1,24 +1,24 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.engine.salary.entity.taxdeclaration.dto.*; +import com.engine.salary.entity.taxdeclaration.param.*; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.service.TaxDeclarationExcelService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.TaxDeclarationDetailWrapper; import com.engine.salary.wrapper.TaxDeclarationWrapper; +import com.engine.salary.wrapper.TaxDeclareRecordWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -33,6 +33,10 @@ import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Map; @Slf4j @@ -47,88 +51,245 @@ public class TaxDeclarationController { } private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) { - return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); + return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); } private TaxDeclarationDetailWrapper getTaxDeclarationDetailWrapper(User user) { return ServiceUtil.getService(TaxDeclarationDetailWrapper.class, user); } - //涓◣鐢虫姤琛ㄥ垪琛 + private TaxDeclareRecordWrapper getTaxDeclareRecordWrapper(User user) { + return ServiceUtil.getService(TaxDeclareRecordWrapper.class, user); + } + + + /** + * 涓◣鐢虫姤琛ㄥ垪琛 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ @POST @Path("/list") @Produces(MediaType.APPLICATION_JSON) - public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam){ + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::listPage, queryParam); } - @POST - @Path("/withDrawTaxDeclaration") - @Produces(MediaType.APPLICATION_JSON) - public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::withDrawTaxDeclaration, param.getTaxDeclarationId()); - } - - - //涓◣鐢虫姤琛ㄨ〃鍗 + /** + * 涓◣鐢虫姤琛ㄨ〃鍗 + * + * @param id 涓◣鐢虫姤璁板綍id + * @return + */ @GET @Path("/getForm") @Produces(MediaType.APPLICATION_JSON) public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getForm, id); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getForm, id); } - //涓◣鐢虫姤琛ㄧ浉鍏充俊鎭 + + /** + * 涓◣鐢虫姤宸︿晶鍒嗙被 + * + * @param id 涓◣鐢虫姤璁板綍id + * @return + */ @GET + @Path("/getTaxReports") + @Produces(MediaType.APPLICATION_JSON) + public String getTaxReportType(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxReports, id); + } + + /** + * 涓◣鐢虫姤琛ㄧ浉鍏充俊鎭 + * + * @return + */ + @POST @Path("/getTaxDeclarationInfo") @Produces(MediaType.APPLICATION_JSON) - public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { + public String getTaxDeclarationInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, param); } - //涓◣鐢虫姤琛ㄧ敓鎴 - @POST + /** + * 涓◣鐢虫姤琛ㄧ敓鎴 + * + * @param saveParam 淇濆瓨鍙傛暟 + * @return + */ @Path("/save") + @POST @Produces(MediaType.APPLICATION_JSON) - public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { + public String saveTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::save, param); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::save, saveParam); } + /** + * 涓◣鐢虫姤琛ㄦ壒閲忕敓鎴 + * + * @param param 鎵归噺淇濆瓨鍙傛暟 + * @return + */ @POST @Path("/batSave") @Produces(MediaType.APPLICATION_JSON) - public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBatParam param) { + public String batSave(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) { User user = HrmUserVarify.getUser(request, response); - param.setSalaryMonth(SalaryDateUtil.String2YearMonth(param.getSalaryMonthStr())); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::batSave, param); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::batSave, param); } - //涓◣鐢虫姤琛ㄨ鎯呭垪琛 + + /** + * 鍒锋柊涓◣鐢虫姤琛ㄧ殑寰呭埛鏂版爣璇 + * + * @param param 鏇存柊鍙傛暟 + * @return + */ @POST - @Path("/detail/list") + @Path("/updateIcon") @Produces(MediaType.APPLICATION_JSON) - public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationDetailListQueryParam param) { + public String updateIcon(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { User user = HrmUserVarify.getUser(request, response); - param.setTaxDeclarationId(Long.parseLong(param.getTaxDeclarationIdStr())); - return new ResponseResult(user).run(getTaxDeclarationDetailWrapper(user)::listPage, param); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateIcon, param.getTaxDeclareRecordId()); } - //涓◣鐢虫姤琛ㄧ浉鍏充俊鎭 + /** + * 鍒犻櫎涓◣鐢虫姤璁板綍 + * + * @param ids 涓◣鐢虫姤璁板綍id + * @return + */ + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, TaxDeclarationInfoDTO>(user).run(getTaxDeclareRecordWrapper(user)::delete, ids); + } + + /** + * 涓◣鐢虫姤琛ㄦ槸鍚﹀凡缁忕敓鎴 + * + * @param index 杩涘害缂撳瓨绱㈠紩 + * @return + */ @GET - @Path("/export") + @Path("/getRate") + @Produces(MediaType.APPLICATION_JSON) + public String getRate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "index") String index) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getRate, index); + } + + /** + * 鑾峰彇涓◣鐢虫姤璁板綍涓嬬殑涓◣鐢虫姤琛═AB + * + * @return + */ + @POST + @Path("/getTaxDeclarationTab") + @Produces(MediaType.APPLICATION_JSON) + public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, param); + } + + /** + * 鏂板涓◣鐢虫姤璁板綍涓嬬殑涓◣鐢虫姤琛═AB + * + * @param param 涓◣鐢虫姤璁板綍id + * @return + */ + @POST + @Path("/addTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationAddParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param); + } + + /** + * 鍒犻櫎鐢虫姤琛 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param); + } + + + /** + * 鍦ㄧ嚎鐢虫姤 + * + * @param taxDeclareRecordParam 鍦ㄧ嚎鐢虫姤鍙傛暟 + * @return + */ + @POST + @Path("/declare") + @Produces(MediaType.APPLICATION_JSON) + public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::declare, taxDeclareRecordParam); + } + + /** + * 鑾峰彇鍦ㄧ嚎鐢虫姤鍙嶉 + * + * @param taxDeclareRecordParam 鐢虫姤鍙嶉鍙傛暟 + * @return + */ + @POST + @Path("/getDeclareFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam); + } + + /** + * 鏌ヨ浼佷笟鐢虫姤鏁版嵁鏄庣粏 + * + * @param + * @return + */ + @POST + @Path("/getCompanyIncomes") + @Produces(MediaType.APPLICATION_JSON) + public String getCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GetCompanyIncomesQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCompanyIncomes, param); + } + + /** + * 浼佷笟鐢虫姤鏁版嵁鏄庣粏 + * + * @return + */ + @POST + @Path("/exportGetCompanyIncomes") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { + public Response exportGetCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody GetCompanyIncomesQueryParam param) { + try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclarationExcelService(user).exportTaxDeclaration(taxDeclarationId); - - String fileName = "涓◣鐢虫姤琛" + LocalDate.now(); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetCompanyIncomes(param); + String fileName = "浼佷笟鐢虫姤鏁版嵁鏄庣粏-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); } catch (UnsupportedEncodingException e) { @@ -142,8 +303,541 @@ public class TaxDeclarationController { 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); + log.error("浼佷笟鐢虫姤鏁版嵁鏄庣粏瀵煎嚭寮傚父", e); throw e; } } + + /** + * 鐢虫姤鍐呯疆绠楃◣缁撴灉 + * + * @return + */ + @POST + @Path("/exportGetDeclareTaxResultFeedback") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeclareTaxResultFeedbackQueryParam param) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(param); + String fileName = "鐢虫姤鍐呯疆绠楃◣缁撴灉-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + + /** + * 瀵规瘮绠楃◣杩囩▼ + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/contrast") + @Produces(MediaType.APPLICATION_JSON) + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); + } + + /** + * 瀵煎嚭鍦ㄧ嚎瀵规瘮 + * + * @return + */ + @POST + @Path("/exportContrast") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportContrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportContrast(param); + String fileName = "鍦ㄧ嚎瀵规瘮缁撴灉-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + + + /** + * 浣滃簾 + * + * @param taxDeclareRecordParam 浣滃簾鍙傛暟 + * @return + */ + @POST + @Path("/cancel") + @Produces(MediaType.APPLICATION_JSON) + public String cancel(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelDeclare, taxDeclareRecordParam); + } + + /** + * 鑾峰彇浣滃簾鍙嶉 + * + * @param taxDeclareRecordParam 浣滃簾鍙嶉鍙傛暟 + * @return + */ + @POST + @Path("/getCancelFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String getCancelFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getCancelFeedback, taxDeclareRecordParam); + } + + /** + * 鏇存鐢虫姤 + * + * @param taxDeclareRecordParam 鏇存鐢虫姤鍙傛暟 + * @return + */ + @POST + @Path("/updateDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String updateDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam); + } + + /** + * 鎾ら攢鏇存鐢虫姤锛岀◣灞瀛樺湪閫昏緫闂銆傝鏇存鐢虫姤锛屽厛鍐嶈蛋鐢虫姤澶勭悊 + * + * @param taxDeclareRecordParam 鎾ら攢鏇存鐢虫姤鍙傛暟 + * @return + */ +// @POST +// @Path("/cancelCorrect") +// @Produces(MediaType.APPLICATION_JSON) +// public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId()); +// } + + /** + * 鍒锋柊鏁版嵁 + * + * @param taxDeclareRecordParam 鍒锋柊鏁版嵁鍙傛暟 + * @return + */ + @POST + @Path("/refreshData") + @Produces(MediaType.APPLICATION_JSON) + public String refreshData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::refreshData, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + + /** + * 鏂板琛ㄥ崟 + * + * @param param + * @return + */ + @POST + @Path("/getAddForm") + @Produces(MediaType.APPLICATION_JSON) + public String getAddForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailFormParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getAddForm, param); + } + + /** + * 鏂板 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/add") + @Produces(MediaType.APPLICATION_JSON) + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); + } + + + /** + * 缂栬緫 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/edit") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::edit, param); + } + + /** + * 鑾峰彇璇︾粏璇︾粏 + * + * @param request + * @param response + * @param id + * @return + */ + @GET + @Path("/detailInfo") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::detailInfo, id); + } + + /** + * 鍒犻櫎璇︾粏璇︾粏 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteInfo") + @Produces(MediaType.APPLICATION_JSON) + public String deleteInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteInfo, param.getId()); + } + + + /** + * 涓◣鐢虫姤琛ㄨ鎯呭垪琛 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/detail/list") + @Produces(MediaType.APPLICATION_JSON) + public String listTaxDeclarationValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationValueListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::listValuePage, queryParam); + } + + /** + * 瀵煎嚭涓◣鐢虫姤琛ㄧ敵鎶ユ暟鎹 + * + * @return + */ + @GET + @Path("/detail/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + + TaxDeclarationValueListQueryParam queryParam = genTaxDeclarationValueListQueryParam(request); + + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportTaxDeclarationValue(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156419, "涓◣鐢虫姤琛ㄦ槑缁") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + + private TaxDeclarationValueListQueryParam genTaxDeclarationValueListQueryParam(HttpServletRequest request) { + TaxDeclarationValueListQueryParam param = new TaxDeclarationValueListQueryParam(); + String current = request.getParameter("current"); + if (StringUtils.isNotBlank(current)) { + param.setCurrent(Integer.valueOf(current)); + } + String pageSize = request.getParameter("pageSize"); + if (StringUtils.isNotBlank(pageSize)) { + param.setPageSize(Integer.valueOf(pageSize)); + } + String taxDeclareRecordId = request.getParameter("taxDeclareRecordId"); + if (StringUtils.isNotBlank(taxDeclareRecordId)) { + param.setTaxDeclareRecordId(Long.valueOf(taxDeclareRecordId)); + } + String taxDeclarationId = request.getParameter("taxDeclarationId"); + if (StringUtils.isNotBlank(taxDeclarationId)) { + param.setTaxDeclarationId(Long.valueOf(taxDeclarationId)); + } + String incomeCategory = request.getParameter("incomeCategory"); + if (StringUtils.isNotBlank(incomeCategory)) { + param.setIncomeCategory(IncomeCategoryEnum.valueOf(incomeCategory)); + } + return param; + } + + + /** + * 涓◣鐢虫姤琛ㄧ敵鎶ユ暟鎹-浜哄憳鏈姤閫佸垪琛 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/employee/list4NotDeclare") + @Produces(MediaType.APPLICATION_JSON) + public String listEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4NotDeclare, queryParam); + } + + /** + * 涓◣鐢虫姤琛ㄧ敵鎶ユ暟鎹-鎶ラ佷汉鍛樻棤鐢虫姤鏁版嵁鍒楄〃 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/employee/list4NoValue") + @Produces(MediaType.APPLICATION_JSON) + public String listEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4NoValue, queryParam); + } + + /** + * 涓◣鐢虫姤琛ㄧ敵鎶ユ暟鎹-鐢虫姤澶辫触鍒楄〃 + * + * @param queryParam 鏌ヨ鏉′欢 + * @return + */ + @POST + @Path("/employee/list4Fail") + @Produces(MediaType.APPLICATION_JSON) + public String listEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AbnormalEmployeeListQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::listEmployeePage4Fail, queryParam); + } + + private AbnormalEmployeeListQueryParam genAbnormalEmployeeListQueryParam(HttpServletRequest request) { + AbnormalEmployeeListQueryParam param = new AbnormalEmployeeListQueryParam(); + String current = request.getParameter("current"); + if (StringUtils.isNotBlank(current)) { + param.setCurrent(Integer.valueOf(current)); + } + String pageSize = request.getParameter("pageSize"); + if (StringUtils.isNotBlank(pageSize)) { + param.setPageSize(Integer.valueOf(pageSize)); + } + String keyword = request.getParameter("keyword"); + if (StringUtils.isNotBlank(keyword)) { + param.setKeyword(keyword); + } + String taxDeclareRecordId = request.getParameter("taxDeclareRecordId"); + if (StringUtils.isNotBlank(taxDeclareRecordId)) { + param.setTaxDeclareRecordId(Long.valueOf(taxDeclareRecordId)); + } + + String taxAgentId = request.getParameter("taxAgentId"); + if (StringUtils.isNotBlank(taxAgentId)) { + param.setTaxAgentId(Long.valueOf(taxAgentId)); + } + + String taxCycle = request.getParameter("taxCycle"); + if (StringUtils.isNotBlank(taxCycle)) { + param.setTaxCycle(SalaryDateUtil.stringToDate(taxCycle)); + } + + return param; + } + + /** + * 涓◣鐢虫姤琛ㄧ敵鎶ユ暟鎹-瀵煎嚭浜哄憳鏈姤閫佸垪琛 + * + * @return + */ + @GET + @Path("/employee/export4NotDeclare") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4NotDeclare(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NotDeclare(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156420, "鏈姤閫佺殑浜哄憳") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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 + */ + @GET + @Path("/employee/export4NoValue") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4NoValue(@Context HttpServletRequest request, @Context HttpServletResponse response) { + + try { + User user = HrmUserVarify.getUser(request, response); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NoValue(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156421, "缂哄皯鐢虫姤鏁版嵁鐨勪汉鍛") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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 + */ + @GET + @Path("/employee/export4Fail") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4Fail(queryParam); + + String fileName = SalaryI18nUtil.getI18nLabel(156422, "鐢虫姤澶辫触浜哄憳") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + 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; + } + } + + @POST + @Path("/downloadTemplate") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response downloadTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam param) { + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).downloadTemplate(param); + + String fileName = "鐢虫姤琛ㄥ鍏ユā鏉" + LocalDate.now(); + + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error(e.getMessage(), e); + } + + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + + } catch (Exception e) { + log.error("鐢虫姤琛ㄥ鍏ユā鏉垮鍑哄紓甯", e); + throw e; + } + } + + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::preview, importParam); + } + + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_JSON) + public String importAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::importData, importParam); + } + } diff --git a/src/com/engine/salary/web/TaxPaymentController.java b/src/com/engine/salary/web/TaxPaymentController.java new file mode 100644 index 000000000..800e9e91d --- /dev/null +++ b/src/com/engine/salary/web/TaxPaymentController.java @@ -0,0 +1,200 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.TaxPaymentWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; + +/** + * 涓◣杈呭姪缂存 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentController { + + private TaxPaymentWrapper getTaxPaymentWrapper(User user) { + return ServiceUtil.getService(TaxPaymentWrapper.class, user); + } + + /** + * 鑾峰彇浼佷笟鐨勪笁鏂逛俊鎭 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/getAgreement") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 鑾峰彇浼佷笟鐨勪笁鏂逛俊鎭煡璇㈠弽棣 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/getAgreementFeedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getAgreementFeedback, param); + } + + /** + * 涓夋柟鍗忚缂存 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/agreement/pay") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String payAgreement(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 涓夋柟鍗忚缂存鍙嶉 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/agreement/pay/feedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String payAgreementFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::payAgreementFeedback, param); + } + + /** + * 缂存鍑瘉鎵撳嵃 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/voucher/print") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Deprecated + public String printVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getRequestId, param); + } + + /** + * 缂存鍑瘉鎵撳嵃鍙嶉 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/voucher/print/feedback") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Deprecated + public String printVoucherFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + param.setType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()); + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::printVoucherFeedback, param); + } + + /** + * 浣滃簾缂存鍑瘉 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/voucher/cancel") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Deprecated + public String cancelVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::cancelVoucher, param); + } + + /** + * 寮鍏蜂紒涓氱即绋庡畬绋庤瘉鏄 + * + * @param param 鍙傛暟 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/withheldVoucher/get") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getWithheldVoucher(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getWithheldVoucher, param); + } + + /** + * 鍚屾缂存鐘舵 + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/voucher/status/sync") + @POST + @Produces(MediaType.APPLICATION_JSON) + @Deprecated + public String getSyncWithholdingFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::getSyncWithholdingFeedback, param); + } + + /** + * 搴旂即绋庨鏌ヨ + * + * @param param 鏌ヨ鏉′欢 + * @return WeaResult 杩斿洖缁撴灉 + */ + @Path("/tax/amount") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String queryTaxAmount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxPaymentQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxPaymentWrapper(user)::queryTaxAmount, param); + } + +// /** +// * 缂存绫诲瀷 +// * +// * @return WeaResult 杩斿洖缁撴灉 +// */ +// @GET +// @Path("/pay/type") +// @Produces(MediaType.APPLICATION_JSON) +// public String payType(@Context HttpServletRequest request, @Context HttpServletResponse response) { +// User user = HrmUserVarify.getUser(request, response); +// return new ResponseResult(user).run(getTaxPaymentWrapper(user)::payType, param); +// return WeaResult.success(taxPaymentWrapper.payType()); +// } +} diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index 7bceb9672..58146a87b 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -5,7 +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.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; @@ -170,4 +173,36 @@ public class AddUpDeductionWrapper extends Service { } return getAddUpDeductionService(user).autoAddAll(yearMonth, false, param.getTaxAgentIds()); } + + 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..51fb76525 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; diff --git a/src/com/engine/salary/wrapper/DeductionAmountWrapper.java b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java new file mode 100644 index 000000000..a9586cafb --- /dev/null +++ b/src/com/engine/salary/wrapper/DeductionAmountWrapper.java @@ -0,0 +1,55 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.component.PageInfo; +import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO; +import com.engine.salary.entity.deductionamount.param.*; +import com.engine.salary.service.DeductionAmountService; +import com.engine.salary.service.impl.DeductionAmountServiceImpl; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +/** + * 骞存敹鍏ヤ笉瓒6涓囧厓鐨勭撼绋庝汉鏆備笉棰勬墸棰勭即绋庢鎵i櫎鍚嶅崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class DeductionAmountWrapper extends Service { + private DeductionAmountService getDeductionAmountService(User user) { + return ServiceUtil.getService(DeductionAmountServiceImpl.class, user); + } + + public PageInfo list(DeductionAmountListParam param) { + return getDeductionAmountService(user).list(param); + } + + public void add(DeductionAmountAddParam param) { + getDeductionAmountService(user).add(param); + } + + public void edit(DeductionAmountEditParam param) { + getDeductionAmountService(user).edit(param); + } + + public void delete(DeductionAmountDeleteParam param) { + getDeductionAmountService(user).delete(param); + } + + public Object query(DeductionAmountOnlineQueryParam param) { + return getDeductionAmountService(user).query(param); + } + + public String confirm(DeductionAmountConfirmParam param) { + return getDeductionAmountService(user).confirm(param); + } + + public String feedback(DeductionAmountFeedBackParam param) { + return getDeductionAmountService(user).feedback(param); + } + +} diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java new file mode 100644 index 000000000..8545240aa --- /dev/null +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -0,0 +1,739 @@ +package com.engine.salary.wrapper; + +import com.cloudstore.dev.api.util.Util_DataCache; +import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList; +import com.engine.salary.entity.employeedeclare.dto.*; +import com.engine.salary.entity.employeedeclare.param.*; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; +import com.engine.salary.enums.employeedeclare.*; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.Column; +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.Maps; +import com.google.common.collect.Sets; +import com.weaver.util.threadPool.ThreadPoolUtil; +import com.weaver.util.threadPool.constant.ModulePoolEnum; +import com.weaver.util.threadPool.entity.LocalRunnable; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class EmployeeDeclareWrapper extends Service { + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + + private EmployeeDeclareExcelService employeeDeclareExcelService; + + private EmployeeDeclareExcelService getEmployeeDeclareExcelService(User user) { + return ServiceUtil.getService(EmployeeDeclareExcelServiceImpl.class, user); + } + + /** + * 浜哄憳鎶ラ佺殑涓◣鎵g即涔夊姟浜哄垪琛 + * + * @param queryParam + * @return + */ + public PageInfo taxAgentDeclareList(TaxAgentDeclareListQueryParam queryParam) { + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + List taxAgents = getTaxAgentService(user).listAuth(param); + + if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { + taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); + } + // 鍒嗛〉 + List dtoList = Lists.newArrayList(); + for (TaxAgentPO taxAgent : taxAgents) { + TaxAgentDeclareListDTO dto = TaxAgentDeclareListDTO.builder() + .id(taxAgent.getId()) + .taxAgentName(taxAgent.getName()) + .opts(Sets.newHashSet("admin")) + .build(); + dtoList.add(dto); + } + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, TaxAgentDeclareListDTO.class); + } + + + /** + * 浜哄憳鎶ラ-鍏ㄩ儴浜哄憳鍒楄〃 + * + * @param queryParam + * @return + */ + public Map list(EmployeeDeclareListQueryParam queryParam) { + ValidUtil.doValidator(queryParam); + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam(queryParam); + pageInfo.setTotal(employeeDeclarePOS.size()); + employeeDeclarePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), employeeDeclarePOS); + List convert = getEmployeeDeclareService(user).convert(employeeDeclarePOS); + pageInfo.setList(convert); + + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", pageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 浜哄憳鎶ラ-鏈湀鏂板浜哄憳鍒楄〃 + * + * @param queryParam + * @return + */ + public Map list4Add(EmployeeDeclareAddListQueryParam queryParam) { + List addPOList = getEmployeeDeclareService(user).list4AddByParam(queryParam); + PageInfo addPoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), addPOList, EmployeeDeclarePO.class); + List addDTOList = getEmployeeDeclareService(user).convert(addPoPageInfo.getList()); + // 鍒嗛〉 + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), EmployeeDeclareListDTO.class); + pageInfo.setList(addDTOList); + pageInfo.setTotal(addPOList.size()); + +// // 鍒ゆ柇鏄惁寮鍚垎閮 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", pageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 浜哄憳鎶ラ-鏈湀淇℃伅鍙樺姩浜哄憳鍒楄〃 + * + * @param queryParam + * @return + */ + public Map list4Update(EmployeeDeclareListQueryParam queryParam) { + PageInfo poPageInfo = getEmployeeDeclareService(user).listPage4UpdateByParam(queryParam); + List dtoList = getEmployeeDeclareService(user).convert(poPageInfo.getList()); + PageInfo dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtoList, EmployeeDeclareListDTO.class); + dtoPageInfo.setTotal(poPageInfo.getTotal()); + // 鏌ヨ涓婁釜鏈堟姤閫佺殑浜哄憳 + Set employeeIds = SalaryEntityUtil.properties(poPageInfo.getList(), EmployeeDeclarePO::getEmployeeId); + List preTaxCycleEmployeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds( + SalaryDateUtil.plusMonths(queryParam.getTaxCycle(), -1), queryParam.getTaxAgentId(), employeeIds); + // 鑾峰彇淇敼浜嗗摢浜涘瓧娈 + Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); + for (EmployeeDeclareListDTO employeeDeclareListDTO : (List) dtoPageInfo.getList()) { + Set updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO); + employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet); + } +// // 鍒ゆ柇鏄惁寮鍚垎閮 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + SalaryWeaTable table = new SalaryWeaTable<>(user, EmployeeDeclareListDTO.class); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + Map datas = new HashMap<>(); + datas.put("pageInfo", dtoPageInfo); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + /** + * 浜哄憳鎶ラ-鏈湀鎶ラ佸け璐ヤ汉鍛樺垪琛 + * + * @param queryParam + * @return + */ + public PageInfo list4Fail(EmployeeDeclareFailListQueryParam queryParam) { + PageInfo poPageInfo = getEmployeeDeclareService(user).listPage4FailByParam(queryParam); + List dtoList = getEmployeeDeclareService(user).convert2FailListDTO(poPageInfo.getList()); + PageInfo dtoPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + dtoList, EmployeeDeclareFailListDTO.class); + // 鍒ゆ柇鏄惁寮鍚垎閮 +// boolean subcompanySupport = hrmConfigSetCache.isSubcompanySupport(tenantKey); +// if (!subcompanySupport) { +// weaTable.getColumns().stream() +// .filter(e -> Objects.equals(e.getDataIndex(), "subCompanyName")) +// .findAny() +// .ifPresent(weaTableColumn -> weaTableColumn.setHide(true)); +// } + return dtoPageInfo; + } + + /** + * 浜哄憳鎶ラ-鑾峰彇鏂板缓鎴栫紪杈戠殑琛ㄥ崟 + * + * @param id + * @return + */ + public Map getForm(Long id) { + // 璇佷欢绫诲瀷榛樿"灞呮皯韬唤璇" + EmployeeDeclarePO employeeDeclare; + EmployeeDeclareFromDTO employeeDeclareFrom = new EmployeeDeclareFromDTO() + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) + .setGender(GenderEnum.MALE) + .setEmploymentStatus(EmploymentStatusEnum.NORMAL) + .setEmploymentType(EmploymentTypeEnum.EMPLOYEE) + .setDisability(SalaryOnOffEnum.OFF) + .setLonelyOld(SalaryOnOffEnum.OFF) + .setMartyrDependents(SalaryOnOffEnum.OFF) + .setDeductExpenses(SalaryOnOffEnum.ON); + if (Objects.nonNull(id)) { + employeeDeclare = getEmployeeDeclareService(user).getById(id); + // 鏌ヨ浜哄憳淇℃伅 + Map employeeMap = Maps.newHashMap(); + if (Objects.equals(employeeDeclare.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeDeclare.getEmployeeId()); + employeeMap.put("id", simpleEmployee.getEmployeeId()); + employeeMap.put("name", simpleEmployee.getUsername()); + employeeMap.put("_entityType", EmployeeTypeEnum.ORGANIZATION); + } else { + DataCollectionEmployee extEmployee = getExtEmpService(user).getEmployeeById(employeeDeclare.getEmployeeId()); + employeeMap.put("id", extEmployee.getEmployeeId()); + employeeMap.put("name", extEmployee.getUsername()); + employeeMap.put("_entityType", EmployeeTypeEnum.EXT_EMPLOYEE); + } + employeeDeclareFrom.setId(employeeDeclare.getId()) + .setTaxAgentId(employeeDeclare.getTaxAgentId()) + .setEmployee(Collections.singletonList(employeeMap)) + .setEmployeeName(employeeDeclare.getEmployeeName()) + .setJobNum(employeeDeclare.getJobNum()) + .setNationality(employeeDeclare.getNationality()) + .setNationality(employeeDeclare.getNationality()) + .setNationality(employeeDeclare.getNationality()) + .setEntryDate(employeeDeclare.getEntryDate()) + .setDepartureDate(employeeDeclare.getDepartureDate()) + .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType())) + .setCardNum(employeeDeclare.getCardNum()) + .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) + .setBirthday(employeeDeclare.getBirthday()) + .setEmploymentStatus(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class)) + .setMobile(employeeDeclare.getMobile()) + .setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class)) + .setEmploymentDate(employeeDeclare.getEmploymentDate()) + .setDismissDate(employeeDeclare.getDismissDate()) + .setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class)) + .setDisabilityCardNo(employeeDeclare.getDisabilityCardNo()) + .setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class)) + .setMartyrDependents(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class)) + .setMartyrDependentsCardNo(employeeDeclare.getMartyrDependentsCardNo()) + .setDeductExpenses(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class)) + .setBirthplace(employeeDeclare.getBirthplace()) + .setTaxReasons(employeeDeclare.getTaxReasons()); + } else { + employeeDeclare = null; + } + PageInfo pageInfo = new PageInfo<>(EmployeeDeclareFromDTO.class); + List columns = pageInfo.getColumns(); + + List readOnlyColumns = new ArrayList<>(); + columns.stream().forEach(column -> { + if (Objects.nonNull(column) && StringUtils.equals(column.getKey(), "employee")) { + readOnlyColumns.add(column.getKey()); + } + if (employeeDeclare != null + && Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue()) + && (StringUtils.equals(column.getKey(), "employeeName") || StringUtils.equals(column.getKey(), "cardNum"))) { + readOnlyColumns.add(column.getKey()); + } + }); + Map datas = new HashMap<>(); + datas.put("data", employeeDeclareFrom); + datas.put("columns", columns); + datas.put("readOnlyColumns", readOnlyColumns); + return datas; + + } + +// /** +// * 浜哄憳鎶ラ-鎵归噺缂栬緫鐨勮〃鍗 +// * +// * @return +// */ +// public WeaForm getBatchUpdateForm() { +// WeaForm weaForm = new WeaForm(); +// WeaFormItem batchUpdateItem = new WeaFormItem(WeaFormItemType.SELECT); +// List options = new ArrayList<>(); +// options.add(new WeaFormOption("employmentStatus", SalaryI18nUtil.getI18nLabel(91075, "鐘舵"))); +// options.add(new WeaFormOption("employmentType", SalaryI18nUtil.getI18nLabel(156396, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))); +// options.add(new WeaFormOption("employmentDate", SalaryI18nUtil.getI18nLabel(156409, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))); +// options.add(new WeaFormOption("dismissDate", SalaryI18nUtil.getI18nLabel(95228, "绂昏亴鏃ユ湡"))); +// options.add(new WeaFormOption("deductExpenses", SalaryI18nUtil.getI18nLabel(156402, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))); +// batchUpdateItem.setOptions(options); +// +// Map otherParams = new HashMap<>(); +// WeaFormSalaryItem employmentStatus = new WeaFormSalaryItem(WeaFormItemType.SELECT); +// employmentStatus.setRequired(true); +// employmentStatus.setOptions(enum2Option(EmploymentStatusEnum.class)); +// otherParams.put("employmentStatus", employmentStatus); +// WeaFormSalaryItem employmentType = new WeaFormSalaryItem(WeaFormItemType.SELECT); +// employmentType.setRequired(true); +// employmentType.setOptions(enum2Option(EmploymentTypeEnum.class)); +// otherParams.put("employmentType", employmentType); +// WeaFormSalaryItem employmentDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER); +// employmentDate.setRequired(true); +// otherParams.put("employmentDate", employmentDate); +// WeaFormSalaryItem dismissDate = new WeaFormSalaryItem(WeaFormItemType.DATEPICKER); +// dismissDate.setRequired(true); +// otherParams.put("dismissDate", dismissDate); +// WeaFormSalaryItem deductExpenses = new WeaFormSalaryItem(WeaFormItemType.RADIO); +// deductExpenses.setRequired(true); +// deductExpenses.setOptions(enum2Option(SalaryOnOffEnum.class)); +// otherParams.put("deductExpenses", deductExpenses); +// batchUpdateItem.setOtherParams(otherParams); +// weaForm.getItems().put("batchUpdateItem", batchUpdateItem); +// +// List firstLine = new ArrayList<>(); +// firstLine.add(new WeaFormLayout("batchUpdateItem", SalaryI18nUtil.getI18nLabel(145214, "鎵归噺缂栬緫椤圭洰"), new String[]{"batchUpdateItem"})); +// List secondLine = new ArrayList<>(); +// secondLine.add(new WeaFormLayout("itemValue", SalaryI18nUtil.getI18nLabel(145215, "鎵归噺缂栬緫涓"), new String[]{"itemValue"})); +// weaForm.getLayout().add(firstLine); +// weaForm.getLayout().add(secondLine); +// return weaForm; +// } +// +// private List enum2Option(Class optionsEnum) { +// BaseEnum[] enumConstants = optionsEnum.getEnumConstants(); +// List weaFormOptions = Lists.newArrayListWithExpectedSize(enumConstants.length); +// for (BaseEnum enumConstant : enumConstants) { +// weaFormOptions.add(new WeaFormOption(enumConstant.name(), +// SalaryI18nUtil.getI18nLabel(enumConstant.getLabelId(), enumConstant.getDefaultLabel()))); +// } +// return weaFormOptions; +// } +// +// /** +// * 浜哄憳鎶ラ-鑾峰彇楂樼骇鎼滅储鏉′欢 +// * +// * @return +// */ +// public WeaSearchCondition getSearchCondition() { +// EmployeeDeclareConditionDTO employeeDeclareCondition = new EmployeeDeclareConditionDTO(); +// WeaSearchCondition searchCondition = SalaryFormatUtil.getInstance() +// .buildCondition(EmployeeDeclareConditionDTO.class, employeeDeclareCondition, "employeeDeclareCondition"); +// // "鍏朵粬鏉′欢"涓嶈 +// searchCondition.getGroups().remove(1); +// searchCondition.getItems().forEach((k, v) -> { +// if (Objects.equals(k, "employmentDate") || Objects.equals(k, "dismissDate")) { +// Map otherParams = new HashMap<>(); +// otherParams.put("isRange", "true"); +// v.setOtherParams(otherParams); +// } +// }); +// return searchCondition; +// } + + /** + * 浜哄憳鎶ラ-鏂板浜哄憳/缂栬緫浜哄憳淇濆瓨 + * + * @param saveParam + */ + public void save(EmployeeDeclareSaveParam saveParam) { + getEmployeeDeclareService(user).save(saveParam); + } + + + /** + * 鎵归噺缂栬緫 + * + * @param batchUpdateParam + */ + public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam) { + getEmployeeDeclareService(user).batchUpdate(batchUpdateParam); + } + + /** + * 浜哄憳鎶ラ-鍒犻櫎 + * + * @param ids + */ + public void deleteByIds(Collection ids) { + getEmployeeDeclareService(user).deleteByIds(ids); + } + + /** + * 浜哄憳鎶ラ-鍒锋柊鏁版嵁 + * + * @param refreshParam + */ + public String refresh(EmployeeDeclareRefreshParam refreshParam) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).refresh(refreshParam, Long.valueOf(user.getUID())); + employeeDeclareRate.setFinish(true); + } catch (Exception e) { + log.error("鍒锋柊鏁版嵁澶辫触锛歿}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } finally { + Util_DataCache.setObjVal(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "refresh", localRunnable); + return employeeDeclareRate.getIndex(); + } + + public String batRefresh(EmployeeDeclareRefreshParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + getEmployeeDeclareService(user).refresh(param, Long.valueOf(user.getUID())); + success++; + } catch (Exception e) { + log.error("鍒锋柊鏁版嵁澶辫触锛歿}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return String.format("鎴愬姛锛" + success + "涓紝澶辫触锛" + fail + "涓%s", fail == 0 ? "" : "锛屽け璐ュ師鍥狅細" + msg); + } + + /** + * 浜哄憳鎶ラ-鑾峰彇浜哄憳鎶ラ佺殑鏁翠綋鎯呭喌 + * + * @param employeeDeclareParam + * @return + */ + public EmployeeDeclareInfoDTO getDeclareInfo(EmployeeDeclareParam employeeDeclareParam) { + return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam); + } + + /** + * 浜哄憳鎶ラ-鍏ㄩ儴鎶ラ + * + * @param param + */ + public String declare(EmployeeDeclareParam param) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); +// if (!cacheResult) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "鍏ㄩ儴鎶ラ佸け璐")); +// } + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).declare(param); + employeeDeclareRate.setFinish(true); + } catch (SalaryRunTimeException e) { + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鍏ㄩ儴鎶ラ佸け璐ワ細{}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "绯荤粺閿欒锛岃鑱旂郴绠$悊鍛橈細") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); + return employeeDeclareRate.getIndex(); + } + + public String batDeclare(EmployeeDeclareParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + getEmployeeDeclareService(user).declare(param); + success++; + } catch (Exception e) { + log.error("鍏ㄩ儴鎶ラ佸け璐ワ細{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return String.format("鎴愬姛锛" + success + "涓紝澶辫触锛" + fail + "涓%s", fail == 0 ? "" : "锛屽け璐ュ師鍥狅細" + msg); + } + + /** + * 浜哄憳鎶ラ-鑾峰彇鎶ラ佺粨鏋滃弽棣 + * + * @param param + */ + public String getDeclareFeedback(EmployeeDeclareParam param) { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); +// if (!cacheResult) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "鑾峰彇鎶ラ佺粨鏋滃弽棣堝け璐")); +// } + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate); + employeeDeclareRate.setFinish(true); + } catch (SalaryRunTimeException e) { + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鑾峰彇鎶ラ佺粨鏋滃弽棣堝け璐ワ細{}", e.getMessage(), e); + employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "绯荤粺閿欒锛岃鑱旂郴绠$悊鍛橈細") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); + return employeeDeclareRate.getIndex(); + } + + public String batGetDeclareFeedback(EmployeeDeclareParam param) { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + param.setTaxAgentId(taxAgentId); + try { + EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO() + .setIndex(UUID.randomUUID().toString()) + .setStatus(true) + .setFinish(false) + .setMsg(""); + getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate); + success++; + } catch (Exception e) { + log.error("鑾峰彇鎶ラ佺粨鏋滃弽棣堝け璐ワ細{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + return String.format("鎴愬姛锛" + success + "涓紝澶辫触锛" + fail + "涓%s", fail == 0 ? "" : "锛屽け璐ュ師鍥狅細" + msg); + } + + + /** + * 鑾峰彇浜哄憳鎶ラ佺浉鍏冲悗绔帴鍙f槸鍚﹀凡缁忓畬鎴 + * + * @param index + * @return + */ + public EmployeeDeclareRateDTO getRate(String index) { + return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index); + } + + + /** + * 浜哄憳鎶ラ-涓嬭浇瀵煎叆妯℃澘 + * + * @param param + * @return + */ + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).exportTemplate(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆鏁版嵁 + * + * @param param + * @return + */ + public Map preview(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).preview(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆鏁版嵁 + * + * @param param + * @return + */ + public Map importData(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).importData(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎嚭鏈湀鍏ㄩ儴鐨勪汉鍛 + * + * @param param + * @return + */ + public XSSFWorkbook export(EmployeeDeclareListQueryParam param) { + return getEmployeeDeclareExcelService(user).export(param); + } + +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀鏂板鐨勪汉鍛 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Add(EmployeeDeclareAddListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Add"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Add(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Add", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀淇℃伅鍙樺姩鐨勪汉鍛 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Update(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Update"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Update(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Update", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭鏈湀鎶ラ佸け璐ョ殑浜哄憳 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export4Fail(EmployeeDeclareFailListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare4Fail"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export4Fail(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare4Fail", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 浜哄憳鎶ラ-瀵煎嚭瀵煎叆妯℃澘 +// * +// * @param importParam +// * @param simpleEmployee +// * @return +// */ +// public Map exportTemplate(EmployeeDeclareImportParam importParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclareTemplate"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.exportTemplate(excelExportParam, importParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclareTemplate", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +} diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index 3002e8cfd..4782d3af0 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -6,17 +6,18 @@ import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; -import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; +import com.engine.salary.entity.datacollection.dto.*; import com.engine.salary.entity.datacollection.param.*; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.OtherDeductionService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.impl.OtherDeductionServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -43,6 +44,10 @@ public class OtherDeductionWrapper extends Service { return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + private TaxAgentService getTaxAgentV2Service(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -196,7 +201,15 @@ public class OtherDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) { - return getOtherDeductionService(user).downloadTemplate(queryParam); + + //鏄惁寮鍚簡鏅鸿兘绠楄柂 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if (enableUse) { + return getOtherDeductionService(user).downloadDetailTemplate(queryParam); + } else { + return getOtherDeductionService(user).downloadTemplate(queryParam); + } } /** @@ -210,7 +223,14 @@ public class OtherDeductionWrapper extends Service { * 瀵煎叆鏁版嵁 */ public Map importData(OtherDeductionImportParam importParam) { - return getOtherDeductionService(user).importData(importParam); + //鏄惁寮鍚簡鏅鸿兘绠楄柂 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if (enableUse) { + return getOtherDeductionService(user).importDetailData(importParam); + } else { + return getOtherDeductionService(user).importData(importParam); + } } /** @@ -267,4 +287,89 @@ public class OtherDeductionWrapper extends Service { param.setYearMonthTime(localDate); return getOtherDeductionService(user).extendToLastMonth(param); } -} + + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).freeIncomeList(param); + } + + public PageInfo derateDeductionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).derateDeductionList(param); + } + + public PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).endowmentInsuranceList(param); + } + + public PageInfo grantDonationList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).grantDonationList(param); + } + + public PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).healthInsuranceList(param); + } + + public PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).otherDerateDeductionList(param); + } + + public PageInfo personalPensionList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).personalPensionList(param); + } + + public void saveFreeIncome(FreeIncomeSaveParam param) { + getOtherDeductionService(user).saveFreeIncome(param); + } + + public void saveEndowmentInsurance(EndowmentInsuranceSaveParam param) { + getOtherDeductionService(user).saveEndowmentInsurance(param); + } + + public void saveGrantDonation(GrantDonationSaveParam param) { + getOtherDeductionService(user).saveGrantDonation(param); + } + + public void saveHealthInsurance(HealthInsuranceSaveParam param) { + getOtherDeductionService(user).saveHealthInsurance(param); + } + + public void saveOtherDerateDeduction(OtherDerateDeductionSaveParam param) { + getOtherDeductionService(user).saveOtherDerateDeduction(param); + } + + public void saveDerateDeduction(DerateDeductionSaveParam param) { + getOtherDeductionService(user).saveDerateDeduction(param); + } + + public void savePersonalPension(PersonalPensionSaveParam param) { + getOtherDeductionService(user).savePersonalPension(param); + } + + public void deleteFreeIncome(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteFreeIncome(param); + } + + public void deleteEndowmentInsurance(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteEndowmentInsurance(param); + } + + public void deleteGrantDonation(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteGrantDonation(param); + } + + public void deleteHealthInsurance(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteHealthInsurance(param); + } + + public void deleteOtherDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteOtherDerateDeduction(param); + } + + public void deleteDerateDeduction(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deleteDerateDeduction(param); + } + + public void deletePersonalPension(OtherDeductionDetailDeleteParam param) { + getOtherDeductionService(user).deletePersonalPension(param); + } + +} \ No newline at end of file diff --git a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java index c0d207d45..9aa36bec9 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java @@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO; +import com.engine.salary.entity.salaryacct.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; @@ -195,4 +196,14 @@ public class SalaryAcctEmployeeWrapper extends Service { public void lockEmp(SalaryAcctResultUpdateLockStatusParam salaryAcctResultUpdateLockStatusParam) { getSalaryAcctEmployeeService(user).lockEmp(salaryAcctResultUpdateLockStatusParam); } + + + /** + * 鏈姤閫佷汉鍛樺垪琛 + * @param param + * @return + */ + public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam param) { + return getSalaryAcctEmployeeService(user).listPage4NotDeclareByParam(param); + } } diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index 097092b2e..c2a3d45eb 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; +import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.exception.SalaryRunTimeException; @@ -74,6 +75,10 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalaryCalcTaxService getSalaryCalcTaxService(User user) { + return ServiceUtil.getService(SalaryCalcTaxServiceImpl.class, user); + } + private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) { return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user); } @@ -243,14 +248,6 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult .setStatus(true) .setMessage(StringUtils.EMPTY); getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), initProgress); - // 寮傛鎵ц钖祫鏍哥畻 -// LocalRunnable localRunnable = new LocalRunnable() { -// @Override -// public void execute() { -// getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee); -// } -// }; -// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculateV1", localRunnable); new Thread() { public void run() { getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee); @@ -259,6 +256,41 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult } + /** + * 鏍哥畻绋庡悗 + * + * @param calculateParam 钖祫鏍哥畻鐨勫弬鏁 + */ + public void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam) { + //褰撳墠鐧婚檰浜哄憳 + DataCollectionEmployee simpleEmployee = new DataCollectionEmployee(); + simpleEmployee.setEmployeeId((long) user.getUID()); + // 妫鏌ヨ柂璧勬牳绠椾汉鍛樼殑涓◣鎵g即涔夊姟浜 + getSalaryAcctEmployeeWrapper(user).checkTaxAgent(calculateParam.getSalaryAcctRecordId()); + // 妫鏌ユ槸鍚︽鍦ㄦ牳绠椾腑 + ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + calculateParam.getSalaryAcctRecordId()); + if (Objects.nonNull(salaryAcctProgressDTO) && salaryAcctProgressDTO.isStatus() && Optional.ofNullable(salaryAcctProgressDTO.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) { + return; + } + // 鍒濆鍖栬繘搴 + ProgressDTO initProgress = new ProgressDTO() + .setTitle(SalaryI18nUtil.getI18nLabel(97515, "鏍哥畻涓")) + .setTitleLabelId(97515L) + .setTotalQuantity(NumberUtils.INTEGER_ONE) + .setCalculatedQuantity(NumberUtils.INTEGER_ZERO) + .setProgress(BigDecimal.ZERO) + .setStatus(true) + .setMessage(StringUtils.EMPTY); + getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.AFTER_TAXA_CCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), initProgress); + new Thread() { + public void run() { + getSalaryAcctResultService(user).afterTaxAccounting(calculateParam, simpleEmployee); + } + }.start(); + + } + + /** * 妫鏌ユ槸鍚︽湁钖祫鏍哥畻缁撴灉鐨勬煡鐪嬫潈闄 * @param salaryAcctRecordId @@ -311,4 +343,32 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult // }; // ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCheck", localRunnable); // } + + /** + * 鏍规嵁钖祫鏍哥畻璁板綍id鑾峰彇鍦ㄧ嚎璁$畻涓◣鐨勭浉鍏充俊鎭 + * + * @param salaryCalcTaxParam + * @return + */ + public SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam) { + return getSalaryCalcTaxService(user).getCalcTaxInfo(salaryCalcTaxParam); + } + + /** + * 璁$畻涓◣ + * + * @param salaryCalcTaxParam + */ + public void calcTax(SalaryCalcTaxParam salaryCalcTaxParam) { + getSalaryCalcTaxService(user).calcTax(salaryCalcTaxParam); + } + + /** + * 璁$畻涓◣鑾峰彇鍙嶉 + * + * @param salaryCalcTaxParam + */ + public void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam) { + getSalaryCalcTaxService(user).calcTaxFeedback(salaryCalcTaxParam); + } } diff --git a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 505c19e0a..43965e7d1 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -36,7 +36,7 @@ public class SalaryBillBaseSetWrapper extends Service { * @return */ // public Boolean isBaseSetHasRight(Long currentEmployeeId, String currentTenantKey) { -// return taxAgentService.isHasPermission(SalaryBillWatermarkBO.PERMISSION_SET_CODE, currentEmployeeId, currentTenantKey); +// return taxAgentService.isHasPermission(SalaryBillWatermarkBO.PERMISSION_SET_CODE); // } /** diff --git a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java index c91ac8913..64b1a1660 100644 --- a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java @@ -2,19 +2,29 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.browser.dto.BrowserDataDTO; +import com.engine.salary.entity.browser.param.BrowserDataQueryParam; +import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.setting.dto.PageListTemplateDTO; import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO; import com.engine.salary.entity.setting.param.*; import com.engine.salary.entity.setting.po.PageListTemplatePO; import com.engine.salary.service.SalaryCacheService; +import com.engine.salary.service.SalarySobItemService; import com.engine.salary.service.SettingService; import com.engine.salary.service.impl.SalaryCacheServiceImpl; +import com.engine.salary.service.impl.SalarySobItemServiceImpl; import com.engine.salary.service.impl.SettingServiceImpl; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.page.PageInfo; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import com.engine.salary.util.page.SalaryPageUtil; +import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class SalaryCommonWrapper extends Service { @@ -27,6 +37,10 @@ public class SalaryCommonWrapper extends Service { return ServiceUtil.getService(SettingServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + public Object getCacheInfo(String key) { return getSalaryCacheService(user).get(key); } @@ -35,6 +49,25 @@ public class SalaryCommonWrapper extends Service { getSalaryCacheService(user).remove(key); } + + public PageInfo getBrowserData(BrowserDataQueryParam param) { + String type = param.getType(); + + if (StringUtils.equals(type, "salaryItemBrowser")) { + Map map = JsonUtil.parseMap(param.getJsonParam(), String.class); + Long salarySobId = Long.valueOf(map.get("salarySobId")); + String key = map.get("key"); + List list = getSalarySobItemService(user).listBySalarySobId4SalaryItem(salarySobId); + if (StringUtils.isNotBlank(key)) { + list = list.stream().filter(po -> po.getName().contains(key)).collect(Collectors.toList()); + } + List collect = list.stream().map(po -> BrowserDataDTO.builder().id(po.getId()).name(po.getName()).build()).collect(Collectors.toList()); + PageInfo salarySobItemPOPageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), collect, BrowserDataDTO.class); + return salarySobItemPOPageInfo; + } + return null; + } + public void savePageListSetting(PageListSettingSaveParam param) { getSettingService(user).savePageListSetting(param); } @@ -50,7 +83,7 @@ public class SalaryCommonWrapper extends Service { public PageListTemplateDetailDTO getPageListTemplate(PageListTemplateQueryParam param) { - return getSettingService(user).getPageListTemplate(param); + return getSettingService(user).getPageListTemplate(param); } public List getPageListTemplates(PageListTemplateQueryParam param) { @@ -70,7 +103,7 @@ public class SalaryCommonWrapper extends Service { } public void deletePageListTemplate(PageListTemplateDeleteParam param) { - getSettingService(user).deletePageListTemplate(param); + getSettingService(user).deletePageListTemplate(param); } public void changePageListTemplate(PageListTemplateChangeParam param) { diff --git a/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java new file mode 100644 index 000000000..63ddc16b5 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobAddUpRuleWrapper.java @@ -0,0 +1,44 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobAddUpRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobAddUpRuleSaveParam; +import com.engine.salary.service.SalarySobAddUpRuleService; +import com.engine.salary.service.impl.SalarySobAddUpRuleServiceImpl; +import weaver.hrm.User; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobAddUpRuleWrapper extends Service { + + private SalarySobAddUpRuleService getSalarySobAddUpRuleService(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleServiceImpl.class, user); + } + /** + * 鑾峰彇钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobAddUpRuleService(user).listSalarySobAddUpRuleDTO(salarySobId); + } + + /** + * 淇濆瓨钖祫璐﹀鐨勭疮璁″瓧娈靛搴斿叧绯 + * + * @param saveParam + */ + public void save(SalarySobAddUpRuleSaveParam saveParam) { + getSalarySobAddUpRuleService(user).saveByParam(saveParam); + } +} diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index d8bece097..19e7de5ec 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -10,8 +10,10 @@ import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.dto.SalaryItemTopologyDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; +import com.engine.salary.entity.salarysob.param.SalaryItemTopologyQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; @@ -177,4 +179,19 @@ public class SalarySobItemWrapper extends Service { return getSalarySobItemService(user).getSalaryItemForm(param); } + + /** + * 鎷撴墤鍥 + * @param param + * @return + */ + public SalaryItemTopologyDTO topology(SalaryItemTopologyQueryParam param) { + return getSalarySobItemService(user).topology(param); + + } + + public void checkLoop(Long salarySobId) { + getSalarySobItemService(user).checkLoop(salarySobId); + } + } diff --git a/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java new file mode 100644 index 000000000..63e87b5e3 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobTaxReportRuleWrapper.java @@ -0,0 +1,45 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxReportRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxReportRuleSaveParam; +import com.engine.salary.service.SalarySobTaxReportRuleService; +import com.engine.salary.service.impl.SalarySobTaxReportRuleServiceImpl; +import weaver.hrm.User; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxReportRuleWrapper extends Service { + + private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user); + } + + /** + * 钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobTaxReportRuleService(user).getSalarySobTaxReportRuleDTO(salarySobId); + } + + /** + * 淇濆瓨钖祫璐﹀鐨勪釜绋庣敵鎶ヨ〃瑙勫垯 + * + * @param saveParam + */ + public void save(SalarySobTaxReportRuleSaveParam saveParam) { + getSalarySobTaxReportRuleService(user).saveByParam(saveParam); + } +} diff --git a/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java b/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java new file mode 100644 index 000000000..493b2ed36 --- /dev/null +++ b/src/com/engine/salary/wrapper/SalarySobTaxRuleWrapper.java @@ -0,0 +1,45 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO; +import com.engine.salary.entity.salarysob.param.SalarySobTaxRuleSaveParam; +import com.engine.salary.service.SalarySobTaxRuleService; +import com.engine.salary.service.impl.SalarySobTaxRuleServiceImpl; +import weaver.hrm.User; + +import java.util.List; + +/** + * 钖祫璐﹀鐨勪釜绋庤鍒 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobTaxRuleWrapper extends Service { + + private SalarySobTaxRuleService getSalarySobTaxRuleService(User user) { + return ServiceUtil.getService(SalarySobTaxRuleServiceImpl.class, user); + } + + /** + * 钖祫璐﹀鐨勪釜绋庤鍒 + * + * @param salarySobId + * @return + */ + public List getForm(Long salarySobId) { + return getSalarySobTaxRuleService(user).getSalarySobTaxRuleDTO(salarySobId); + } + + /** + * 淇濆瓨钖祫璐﹀鐨勪釜绋庤鍒 + * + * @param saveParam + */ + public void save(SalarySobTaxRuleSaveParam saveParam) { + getSalarySobTaxRuleService(user).saveByParam(saveParam); + } +} diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index 68722cffa..7a4296775 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -15,6 +15,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobDefaultBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; @@ -296,4 +297,20 @@ public class SalarySobWrapper extends Service { public List listByTaxAgent(SalarySobQueryParam param) { return getSalarySobService(user).list(param); } + public List> incomeCategoryList() { + List> list = new ArrayList<>(); + Arrays.stream(IncomeCategoryEnum.values()) + .filter(incomeCategory -> incomeCategory.getReportType() == DeclareReportTypeEnum.COMPREHENSIVE_INCOME + || incomeCategory.getReportType() == DeclareReportTypeEnum.CLASSIFIED_INCOME) + .forEach(incomeCategory -> { + Map map = new HashMap(); + map.put("enum", incomeCategory); + map.put("value", incomeCategory.getValue()); + map.put("defaultLabel", incomeCategory.getDefaultLabel()); + map.put("labelId", incomeCategory.getLabelId()); + map.put("reportTypeName", incomeCategory.getReportType().getDefaultLabel()); + list.add(map); + }); + return list; + } } diff --git a/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java new file mode 100644 index 000000000..79d2fe07a --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxAgentTaxReturnWrapper.java @@ -0,0 +1,139 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO; +import com.engine.salary.entity.taxagent.dto.*; +import com.engine.salary.entity.taxagent.param.TaxAgentTaxReturnSaveParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnCheckTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxAgentTaxReturnServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.Sm4Utils; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 涓◣鎵g即涔夊姟浜-鎶ョ◣淇℃伅鍖呰绫 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxAgentTaxReturnWrapper extends Service { + + private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) { + return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + /** + * 璇锋眰绫诲瀷锛1.淇濆瓨骞堕獙璇 2.浠呬繚瀛 + */ + private static final Integer[] REQUEST_TYPE = {1, 2}; + /** + * 灞曠ず绫诲瀷锛1.灞曠ず琛ㄥ崟 2.灞曠ず鍒楄〃 3.鍏抽棴鎵鏈塼ab + */ + private static final Integer[] COMP_TYPE = {1, 2, 3}; + + /** + * 闇瑕佽嚜瀹氫箟璁剧疆鐨勫瓧娈靛悕 + */ + private static final Set NEED_CUSTOM_ITEMS = new HashSet<>(Arrays.asList("areaCode", "account", "taxCode", "netPassword", "realNamePassword", "departmentName", "departmentCode")); + + public TaxAgentTaxReturnMainFormDTO getForm(Long taxAgentId) { + TaxAgentTaxReturnMainFormDTO formDTO = new TaxAgentTaxReturnMainFormDTO() + .setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.TAX_NET_PASSWORD) + .setCheckStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT); + // 鏌ヨ鏄惁濉啓杩囨姤绋庝俊鎭 + TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxAgentId); + if (Objects.nonNull(taxReturnPO)) { + try { + // 瀵嗙爜瑙e瘑 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd())); + } catch (Exception e) { + log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage()); + } + formDTO = TaxAgentTaxReturnBO.convertPo2FormDto(taxReturnPO); + } + // 鏌ヨ涓◣鎵g即涔夊姟浜哄悕绉 + TaxAgentPO agentPO = getTaxAgentService(user).getById(taxAgentId); + SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel(100545, "涓◣鎵g即涔夊姟浜轰笉瀛樺湪")); + formDTO.setName(agentPO.getName()); + return formDTO; + } + + public Object verify(TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentTaxReturnCheckDTO checkDTO = getTaxAgentTaxReturnService(user).verify(saveParam); + // 鏍¢獙绋庡弸楠岃瘉鏄惁鎴愬姛 + TaxAgentTaxReturnResultDTO resultDTO = TaxAgentTaxReturnResultDTO.builder() + .checkStatus(TaxAgentTaxReturnStatusEnum.parseByValue(checkDTO.getStatus())) + .failReason(checkDTO.getMessage()) + .message(checkDTO.getMessage()) + .taxRegistrationNumber(checkDTO.getTaxRegistrationNumber()) + .departmentCode(checkDTO.getDepartmentCode()) + .taxAgentId(saveParam.getTaxAgentId().toString()) + .build(); + // 鏄惁涓轰粎淇濆瓨 + if (REQUEST_TYPE[1].equals(saveParam.getRequestType())) { + return resultDTO; + } + // 鏄惁涓烘牎楠岄儴闂ㄤ俊鎭殑鎺ュ彛 + if (TaxAgentTaxReturnCheckTypeEnum.DEPARTMENT_CHECK.getValue().equals(saveParam.getType()) || checkDTO.getRecords().isEmpty()) { + return resultDTO; + } + // 缁勮鏁版嵁 + if (checkDTO.getRecords().size() > 1) { + // 濡傛灉杩斿洖浜嗗鏉★紝鍒涘缓琛ㄦ牸 + return resultDTO.setTable(buildTable(checkDTO)).setCompType(COMP_TYPE[1]); + } else { + // 濡傛灉鍙繑鍥炰竴鏉★紝鍒涘缓琛ㄥ崟 + return buildResultForm(checkDTO, resultDTO); + } + } + + private Map buildResultForm(TaxAgentTaxReturnCheckDTO resultDTO, TaxAgentTaxReturnResultDTO result) { + TaxAgentTaxReturnCheckFormDTO checkDTO = resultDTO.getRecords().get(0); + Map map = new HashMap<>(); + map.put("TaxAgentTaxReturnCheckFormDTO",checkDTO); + map.put("TaxAgentTaxReturnResultDTO",result); + return map; + } + + + private PageInfo buildTable(TaxAgentTaxReturnCheckDTO resultDTO) { + PageInfo page = new PageInfo<>(); + List list = resultDTO.getRecords().stream().map(e -> { + TaxAgentTaxReturnListDTO dto = new TaxAgentTaxReturnListDTO(); + BeanUtils.copyProperties(e, dto); + return dto; + }).collect(Collectors.toList()); + page.setList(list); + return page; + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java new file mode 100644 index 000000000..d63af20e7 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -0,0 +1,78 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.service.TaxDeclarationApiBillingService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.util.List; + +/** + * 涓◣鐢虫姤璁¤垂 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationApiFlowBillingWrapper extends Service { + + public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + public TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + getTaxDeclarationApiConfigService(user).saveConfig(saveParam); + } + + public TaxDeclarationBillingConfigFormDTO getConfig() { + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false); + if (config == null) { + return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build(); + } + return TaxDeclarationBillingConfigFormDTO.builder() + .id(config.getId()) + .appKey(config.getAppKey()) + .appSecret(config.getAppSecret()) + .enable(SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse())) + .build(); + } + + public PageInfo getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + return getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); + } + + public XSSFWorkbook exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { + List dtoList = getTaxDeclarationApiBillingService(user).listFlowRecord(queryParam); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "鏁版嵁涓嶅瓨鍦")); + return getTaxDeclarationApiBillingService(user).exportFlowRecord(queryParam); + } + + public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) { + getTaxDeclarationApiConfigService(user).enableConfig(saveParam); + } + + public Boolean getConfigStatus() { + TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java new file mode 100644 index 000000000..4129ea15e --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java @@ -0,0 +1,60 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticDetailListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowStatisticListDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; +import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; +import com.engine.salary.service.impl.TaxDeclarationApiFlowStatisticServiceImpl; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.hrm.User; + +import java.util.List; + +/** + * 涓◣鐢虫姤璁¤垂 + * + * @author chengliming + * @date 2022-11-11 15:16:22 + */ +@Slf4j +public class TaxDeclarationApiFlowStatisticWrapper extends Service { + + public TaxDeclarationApiFlowStatisticService getTaxDeclarationApiFlowStatisticService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowStatisticServiceImpl.class, user); + } + + public TaxDeclarationApiFlowTotalDTO getFlowStatistics() { + return getTaxDeclarationApiFlowStatisticService(user).getFlowStatistics(); + } + + public PageInfo getFlowStatisticsList(BaseQueryParam queryParam) { + PageInfo page = getTaxDeclarationApiFlowStatisticService(user).pageFlowStatistics(queryParam); + return page; + } + + public PageInfo getFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + PageInfo page = getTaxDeclarationApiFlowStatisticService(user).pageFlowStatisticsDetail(queryParam); + return page; + } + + public XSSFWorkbook exportFlowStatistics() { + List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatistic(); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "鏁版嵁涓嶅瓨鍦")); + return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatistics(dtoList); + } + + public XSSFWorkbook exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { + List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatisticDetail(queryParam); + SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "鏁版嵁涓嶅瓨鍦")); + return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatisticsDetail(dtoList); + } + +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java new file mode 100644 index 000000000..dad7ed25c --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowWarnWrapper.java @@ -0,0 +1,84 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnConfigFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; +import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; +import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam; +import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam; +import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.service.TaxDeclarationApiFlowWarnService; +import com.engine.salary.service.impl.TaxDeclarationApiFlowWarnServiceImpl; +import com.engine.salary.util.page.PageInfo; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.User; + +/** + * 娴侀噺涓嶈冻鎻愰啋 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclarationApiFlowWarnWrapper extends Service { + + public TaxDeclarationApiFlowWarnService getTaxDeclarationApiFlowWarnService(User user) { + return ServiceUtil.getService(TaxDeclarationApiFlowWarnServiceImpl.class, user); + } + + public TaxDeclarationApiFlowWarnConfigFormDTO getWarnConfigForm() { + Long businessId = getTaxDeclarationApiFlowWarnService(user).getRuleBusinessId(); + TaxDeclarationApiFlowWarnConfigFormDTO warnFormDTO = TaxDeclarationApiFlowWarnConfigFormDTO.builder() + .enable(false) + .moduleId("hrsa") + .businessId(businessId) + .build(); + TaxDeclarationApiFlowWarnConfigPO warnConfigPO = getTaxDeclarationApiFlowWarnService(user).getWarnConfig(); + if (warnConfigPO != null) { + warnFormDTO.setId(warnConfigPO.getId()); + warnFormDTO.setEnable(SalaryOnOffEnum.ON.getValue().equals(warnConfigPO.getEnableWarn())); + warnFormDTO.setThreshold(warnConfigPO.getThreshold().intValue()); + warnFormDTO.setBusinessId(warnConfigPO.getBusinessId()); + warnFormDTO.setConfig(null); + } + return warnFormDTO; + } + + public String saveWarnConfig(TaxDeclarationApiFlowWarnConfigSaveParam param) { + return getTaxDeclarationApiFlowWarnService(user).saveWarnConfig(param); + } + + public PageInfo getWarnReceiverList(Long warnConfigId) { + return getTaxDeclarationApiFlowWarnService(user).getWarnReceiverPageList(warnConfigId); + } + + public void deleteReceiver(Long id) { + getTaxDeclarationApiFlowWarnService(user).deleteReceiver(id); + } + + public TaxDeclarationApiFlowWarnReceiverFormDTO getWarnReceiverForm(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + TaxDeclarationApiFlowWarnReceiverFormDTO formDTO = TaxDeclarationApiFlowWarnReceiverFormDTO.builder().build(); + if (param.getId() != null) { + formDTO = getTaxDeclarationApiFlowWarnService(user).getWarnReceiverFormById(param.getId()); + } + + return formDTO; + } + + public void saveWarnReceiver(TaxDeclarationApiFlowWarnReceiverSaveParam param) { + getTaxDeclarationApiFlowWarnService(user).saveWarnReceiver(param); + } + + public void createMessageRule(CreateMessageRuleParam param) { + getTaxDeclarationApiFlowWarnService(user).createMessageRule(param); + } + + public Long getRuleBusinessId() { + return getTaxDeclarationApiFlowWarnService(user).getRuleBusinessId(); + } +} diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index 0bfd23343..1f78a4029 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -2,36 +2,14 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.component.WeaFormOption; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationBatParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.PageInfo; -import com.google.common.collect.Lists; -import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - /** * 涓◣鐢虫姤琛 *

Copyright: Copyright (c) 2022

@@ -53,126 +31,4 @@ public class TaxDeclarationWrapper extends Service { private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } - - /** - * 涓◣鐢虫姤琛ㄥ垪琛 - * - * @param queryParam 鍒楄〃鏌ヨ鏉′欢 - * @param - * @return - */ - public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { - // 璇釜绋庣敵鎶ヨ〃锛堝垎椤碉級 - PageInfo page = getTaxDeclarationService(user).listPageByParam(queryParam); - PageInfo dtoPage = new PageInfo(TaxDeclarationListDTO.class); - dtoPage.setPageNum(queryParam.getCurrent()); - dtoPage.setPageSize(queryParam.getPageSize()); - dtoPage.setTotal(page.getTotal()); - List list = page.getList(); - if (CollectionUtils.isNotEmpty(list)) { - // 鏌ヨ浜哄憳 - List employeeIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getCreator, Collectors.toList()); - List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); - // 鏌ヨ涓◣鎵g即涔夊姟浜 - Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getTaxAgentId); - List taxAgentPOS = getTaxDeclarationService(user).countByTaxDeclarationId(taxAgentIds); - // 杞崲鎴愬垪琛╠to - List taxDeclarationListDTOS = TaxDeclarationBO.convert2ListDTO(list, employeeComInfos, taxAgentPOS); - dtoPage.setList(taxDeclarationListDTOS); - } - return dtoPage; - } - - - public TaxDeclarationFormDTO getForm(Long id) { - TaxDeclarationFormDTO formDTO = new TaxDeclarationFormDTO(); - if (Objects.nonNull(id)) { - // 鏌ヨ涓◣鐢虫姤琛 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡鍒犻櫎")); - } - // 鏌ヨ涓◣鎵g即涔夊姟浜 - TaxAgentPO taxAgent = getTaxAgentService(user).getById(id); - //鏃ユ湡杞崲 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); - // 杞崲鎴愪釜绋庣敵鎶ヨ〃璇︽儏dto - formDTO = TaxDeclarationFormDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgent).map(TaxAgentPO::getName).orElse("")).description(taxDeclaration.getDescription()).build(); - } - // 杞崲鎴愬墠绔墍闇鐨勬暟鎹牸寮 - // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclarationFormDTO.class, formDTO); - - // 鏌ヨ绉熸埛鎵鏈夌殑涓◣鎵g即涔夊姟浜 - Collection taxAgentListDTOS = getTaxAgentService(user).listAll(); - // 琛ㄥ崟涓釜绋庢墸缂翠箟鍔′汉鐨勫彲閫夐」 - List weaFormOptions = Lists.newArrayListWithExpectedSize(taxAgentListDTOS.size()); - for (TaxAgentPO taxAgent : taxAgentListDTOS) { - weaFormOptions.add(new WeaFormOption("" + taxAgent.getId(), taxAgent.getName())); - } -// weaForm.getItems().forEach((k, v) -> { -// if (StringUtils.equals("taxAgentId", k)) { -// v.setOptions(weaFormOptions); -// } -// if (StringUtils.equals("salaryMonth", k)) { -// Map otherParams = new HashMap<>(); -// otherParams.put("type", "month"); -// v.setOtherParams(otherParams); -// } -// }); - return formDTO; - } - - /** - * 鏌ヨ涓◣鐢虫姤琛ㄧ殑鍩烘湰淇℃伅 - * - * @param id 涓◣鐢虫姤琛╥d - * @return - */ - public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { - // 鏌ヨ涓◣鐢虫姤琛 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡鍒犻櫎")); - } - //鏃ユ湡杞崲 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); - // 鏌ヨ涓◣鎵g即涔夊姟浜 - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); - return TaxDeclarationInfoDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); - } - - /** - * 淇濆瓨 - * - * @param saveParam 淇濆瓨鍙傛暟 - */ - public void save(TaxDeclarationSaveParam saveParam) { - getTaxDeclarationService(user).save(saveParam); - } - - /** - * 鎾ゅ洖涓◣鐢虫姤 - * @param taxDeclarationId - */ - public void withDrawTaxDeclaration(Long taxDeclarationId) { - getTaxDeclarationService(user).withDrawTaxDeclaration(taxDeclarationId); - } - - public void batSave(TaxDeclarationBatParam param) { - List taxAgentIds = param.getTaxAgentIds(); - for (int i = 0; i < taxAgentIds.size(); i++) { - Long taxAgentId = taxAgentIds.get(i); - TaxDeclarationSaveParam saveParam = TaxDeclarationSaveParam.builder() - .salaryMonth(param.getSalaryMonth()) - .taxAgentId(taxAgentId) - .description(param.getDescription()) - .taxCycle(param.getTaxCycle()) - .salaryDate(param.getSalaryDate()) - .build(); - save(saveParam); - } - - } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java new file mode 100644 index 000000000..1662cab30 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -0,0 +1,931 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; +import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.config.SalaryElogConfig; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; +import com.engine.salary.entity.taxdeclaration.dto.*; +import com.engine.salary.entity.taxdeclaration.param.*; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.salarysob.DeclareReportTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.IdGenerator; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; +import com.weaver.util.threadPool.ThreadPoolUtil; +import com.weaver.util.threadPool.constant.ModulePoolEnum; +import com.weaver.util.threadPool.entity.LocalRunnable; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.general.Util; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 涓◣鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxDeclareRecordWrapper extends Service { + + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclareStatusService getTaxDeclareStatusService(User user) { + return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalaryCacheService getSalaryCacheService(User user) { + return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); + } + + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) { + return ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user); + } + + private TaxDeclareEmployeeService getTaxDeclareEmployeeService(User user) { + return ServiceUtil.getService(TaxDeclareEmployeeServiceImpl.class, user); + } + + private TaxDeclareFailService getTaxDeclareFailService(User user) { + return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + + /** + * 涓◣鐢虫姤璁板綍鍒楄〃 + * + * @param queryParam + * @return + */ + public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { + PageInfo page = getTaxDeclareRecordService(user).listPageByParam(queryParam); + List list = page.getList(); + + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareRecordListDTO.class); + dtoPage.setTotal(page.getTotal()); + if (CollectionUtils.isNotEmpty(list)) { + // 鏌ヨ涓◣鎵g即涔夊姟浜 + Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getTaxAgentId); + List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); + // 鏌ヨ浜哄憳濮撳悕 + List employeeIds = SalaryEntityUtil.properties(list, TaxDeclareRecordPO::getCreator, Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(employeeIds); + + List dtoList = Lists.newArrayList(); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + Map simpleEmployeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + for (TaxDeclareRecordPO taxDeclareRecord : list) { + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + TaxDeclareRecordListDTO taxDeclareRecordListDTO = new TaxDeclareRecordListDTO() + .setId(taxDeclareRecord.getId()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxAgentName(taxAgentNameMap.get(taxDeclareRecord.getTaxAgentId())) + .setSalaryMonth(taxDeclareRecord.getSalaryMonth()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()) + .setTaxDeclareType(taxDeclareTypeEnum) + .setTaxDeclareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) + .setTaxDeclareStatus(taxDeclareStatusEnum) + .setTaxDeclareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) + .setTaxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPaidAmount())) + .setOperateEmployeeId(taxDeclareRecord.getCreator()) + .setOperateEmployeeName(simpleEmployeeNameMap.get(taxDeclareRecord.getCreator())) + .setOperateTime(SalaryDateUtil.getFormatLocalDateTime(taxDeclareRecord.getCreateTime())) + .setDescription(taxDeclareRecord.getRemark()) + .setDisplayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)); + dtoList.add(taxDeclareRecordListDTO); + } + dtoPage.setList(dtoList); + } + return dtoPage; + } + + /** + * 涓◣鐢虫姤琛ㄦ槑缁嗗垪琛 + * + * @param queryParam 鍒楄〃鏌ヨ鏉′欢 + * @return + */ + public PageInfo listValuePage(TaxDeclarationValueListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤琛 + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); + // 鍒ゆ柇鏄惁鏈夋潈闄愭煡鐪 + boolean canSee = getTaxDeclareRecordService(user).checkByAuthority(taxDeclaration); + if (!canSee) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "瀵逛笉璧凤紝鎮ㄦ殏鏃舵病鏈夋潈闄愭煡鐪")); + } + // 鏌ヨ涓◣鐢虫姤琛ㄨ鎯 + PageInfo page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId()), queryParam.getKeyword()); + TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList()); + PageInfo> dtoPage = new PageInfo<>( + page.getPageNum(), + page.getPageSize(), + page.getTotal(), + SalaryPageUtil.convertList(taxDeclarationValueListDTO.getColumns()), + taxDeclarationValueListDTO.getData()); + return dtoPage; + } + + /** + * 鏈姤閫佺殑浜哄憳鍒楄〃 + * + * @param queryParam + * @return + */ + public PageInfo listEmployeePage4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + return listEmployeePage("NotDeclare", queryParam); + } + + /** + * 娌℃湁鐢虫姤鏁版嵁鐨勪汉鍛樺垪琛 + * + * @param queryParam + * @return + */ + public PageInfo listEmployeePage4NoValue(AbnormalEmployeeListQueryParam queryParam) { + return listEmployeePage("NoValue", queryParam); + } + + /** + * 鐢虫姤澶辫触鐨勪汉鍛樺垪琛 + * + * @param queryParam + * @return + */ + public PageInfo listEmployeePage4Fail(AbnormalEmployeeListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + // 鏌ヨ鐢虫姤澶辫触鐨勬暟鎹 + List taxDeclareFailPOPageInfo = getTaxDeclareFailService(user).listPageByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + // 杞崲鎴恉to + List failEmployeeListDTOS = getTaxDeclareFailService(user).convert2FailEmployeeList(taxDeclareRecord, taxDeclareFailPOPageInfo); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), failEmployeeListDTOS, FailEmployeeListDTO.class); + // 杞垚鍓嶇鎵闇鐨勬牸寮 + return dtoPage; + } + + private PageInfo listEmployeePage(String key, AbnormalEmployeeListQueryParam queryParam) { + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(queryParam.getTaxDeclareRecordId()); + queryParam.setTaxAgentId(taxDeclareRecord.getTaxAgentId()); + queryParam.setTaxCycle(taxDeclareRecord.getTaxCycle()); + if (StringUtils.isEmpty(queryParam.getKeyword())) { + // 鏌ヨ涓◣鐢虫姤璁板綍鐨勪汉鍛 + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclareEmployeePO.class); + if (StringUtils.equals("NotDeclare", key)) { + page = getTaxDeclareEmployeeService(user).listPage4NotDeclareByParam(queryParam); + } else if (StringUtils.equals("NoValue", key)) { + page = getTaxDeclareEmployeeService(user).listPage4NoValueByParam(queryParam); + } + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AbnormalEmployeeListDTO.class); + dtoPage.setList(getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, page.getList())); + dtoPage.setTotal(page.getTotal()); + return dtoPage; + } else { + // 鏌ヨ鏉′欢涓寘鍚"keyword"鏃讹紝涓嶅ソ閫氳繃SQL鍒嗛〉锛屾墍浠ュ湪鍐呭瓨涓垎椤 + List taxDeclareEmployees = Collections.emptyList(); + if (StringUtils.equals("NotDeclare", key)) { + taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); + } else if (StringUtils.equals("NoValue", key)) { + taxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); + } + List dtos = getTaxDeclareEmployeeService(user).convert2AbnormalEmployeeList(taxDeclareRecord, taxDeclareEmployees) + .stream() + .filter(e -> StringUtils.contains(e.getEmployeeName(), queryParam.getKeyword()) + || StringUtils.contains(e.getJobNum(), queryParam.getKeyword()) + || StringUtils.contains(e.getCardNum(), queryParam.getKeyword())) + .collect(Collectors.toList()); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dtos, AbnormalEmployeeListDTO.class); + return dtoPage; + } + } + + /** + * 鑾峰彇涓◣鐢虫姤璁板綍鐨勮〃鍗 + * + * @param id + * @return + */ + public Map getForm(Long id) { +// TaxDeclareRecordFormDTO formDTO = new TaxDeclareRecordFormDTO(); +// formDTO.setTaxAgentRange(TaxAgentRangeEnum.SELECT_TAX_AGENT); +// // 鍒ゆ柇褰撳墠鏄惁寮鍚簡鍒嗘潈 +// Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); +// Boolean isChief = getTaxAgentService(user).isChief((long)user.getUID()); +// // 杞崲鎴愬墠绔墍闇鐨勬暟鎹牸寮 +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclareRecordFormDTO.class, formDTO); +// weaForm.getItems().forEach((k, v) -> { +// if (StringUtils.equals("salaryMonth", k)) { +// Map otherParams = new HashMap<>(); +// otherParams.put("type", "month"); +// v.setOtherParams(otherParams); +// } +// // 鏈紑鍚垎鏉冿紝娌℃湁"浣滀负绠$悊鍛樼殑涓◣鎵g即涔夊姟浜" +// if (!openDevolution && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(1); +// } +// // 寮鍚垎鏉冿紝浣嗕笉鏄荤鐞嗗憳锛屾病鏈"鎵鏈変釜绋庢墸缂翠箟鍔′汉" +// if (openDevolution && !isChief && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(0); +// } +// }); + return new HashMap(); + } + + /** + * 鑾峰彇涓◣鐢虫姤璁板綍涓嬬殑涓◣鐢虫姤琛═AB + * + * @return + */ + public List getTaxDeclarationTab(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + + // 鏌ヨ涓◣鐢虫姤璁板綍 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + + // 鏌ヨ涓◣鐢虫姤璁板綍涓嬬殑涓◣鐢虫姤琛 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), + Collections.singleton(taxDeclareRecord.getTaxAgentId())); + + //绛涢夌敵鎶ョ被鍨 + DeclareReportTypeEnum declareReportTypeEnum = DeclareReportTypeEnum.parseByValue(param.getReportType()); + taxDeclarations = taxDeclarations.stream().filter(po -> IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getReportType() == declareReportTypeEnum).collect(Collectors.toList()); + + Map taxDeclarationMap = SalaryEntityUtil.convert2Map(taxDeclarations, TaxDeclarationPO::getIncomeCategory); + List tabs = Lists.newArrayList(); + for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { + TaxDeclarationPO taxDeclaration = taxDeclarationMap.get(incomeCategoryEnum.getValue()); + if (taxDeclaration != null) { + TaxDeclarationTabDTO taxDeclarationTabDTO = new TaxDeclarationTabDTO() + .setTabName(SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())) + .setIncomeCategory(incomeCategoryEnum) + .setTaxDeclarationId(taxDeclaration.getId()); + tabs.add(taxDeclarationTabDTO); + } + } + return tabs; + } + + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + public void addTaxDeclaration(TaxDeclarationAddParam param) { + getTaxDeclarationService(user).addTaxDeclaration(param); + } + + + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + getTaxDeclarationService(user).deleteTaxDeclaration(param); + } + + /** + * 鏌ヨ涓◣鐢虫姤琛ㄧ殑鍩烘湰淇℃伅 + * + * @return + */ + public TaxDeclarationInfoDTO getTaxDeclarationInfoById(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + + // 鏌ヨ涓◣鐢虫姤琛 + Long taxDeclareRecordId = param.getTaxDeclareRecordId(); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡鍒犻櫎")); + } + AbnormalEmployeeListQueryParam queryParam = new AbnormalEmployeeListQueryParam() + .setTaxDeclareRecordId(taxDeclareRecord.getId()) + .setTaxAgentId(taxDeclareRecord.getTaxAgentId()) + .setTaxCycle(taxDeclareRecord.getTaxCycle()); + // 鏌ヨ鏄惁瀛樺湪鏈夋湭鎶ラ佺殑浜 + List notDeclareTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NotDeclareByParam(queryParam); + // 鏌ヨ鏄惁瀛樺湪娌℃湁鐢虫姤鏁版嵁鐨勪汉 + List noValueTaxDeclareEmployees = getTaxDeclareEmployeeService(user).list4NoValueByParam(queryParam); + // 鏌ヨ鏄惁瀛樺湪鐢虫姤澶辫触鐨勪汉 + List taxDeclareFails = getTaxDeclareFailService(user).listByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + // 鏌ヨ涓◣鎵g即涔夊姟浜 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + + TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordId, param.getReportType()); + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareStatus.getTaxDeclareStatus(), TaxDeclareStatusEnum.class); + + return TaxDeclarationInfoDTO.builder() + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")) + .declareType(taxDeclareTypeEnum) + .declareTypeDesc(taxDeclareTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareTypeEnum.getLabelId(), taxDeclareTypeEnum.getDefaultLabel())) + .declareStatus(taxDeclareStatusEnum) + .declareStatusDesc(taxDeclareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(taxDeclareStatusEnum.getLabelId(), taxDeclareStatusEnum.getDefaultLabel())) + .declareErrorMsg(taxDeclareStatus.getTaxDeclareErrorMsg()) + .displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) + .declareFailSize(taxDeclareFails.size()) + .abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) + .taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPaidAmount())) + .build(); + } + + /** + * 淇濆瓨 + * + * @param saveParam 淇濆瓨鍙傛暟 + */ + public String save(TaxDeclarationSaveParam saveParam) { + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) + .setIndex(Util.null2String(IdGenerator.generate())) + .setMsg(SalaryI18nUtil.getI18nLabel(95836, "鐢熸垚鐢虫姤琛")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).save(saveParam); + taxDeclarationRate.setStatus(true).setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("涓◣鐢虫姤琛ㄧ敓鎴愭姤閿欙細{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "涓◣鐢虫姤琛ㄧ敓鎴愭姤閿欙細") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "saveTaxDeclaration", localRunnable); + return taxDeclarationRate.getIndex(); + } + + public String batSave(TaxDeclarationSaveParam param) { + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true) + .setIndex(Util.null2String(IdGenerator.generate())) + .setMsg(SalaryI18nUtil.getI18nLabel(95836, "鐢熸垚鐢虫姤琛")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + List taxAgentIds = param.getTaxAgentIds(); + int success = 0; + int fail = 0; + StringBuilder msg = new StringBuilder(); + for (Long taxAgentId : taxAgentIds) { + try { + param.setTaxAgentId(taxAgentId); + getTaxDeclareRecordService(user).save(param); + success++; + } catch (SalaryRunTimeException e) { + msg.append(e.getMessage()).append(";"); + fail++; + } catch (Exception e) { + log.error("涓◣鐢虫姤琛ㄧ敓鎴愭姤閿欙細{}", e.getMessage(), e); + msg.append(e.getMessage()).append(";"); + fail++; + } finally { + } + } + taxDeclarationRate.setStatus(fail==0).setFinish(true).setMsg(msg.toString()); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("涓◣鐢虫姤琛ㄧ敓鎴愭姤閿欙細{}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "涓◣鐢虫姤琛ㄧ敓鎴愭姤閿欙細") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "saveTaxDeclaration", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 鏇存柊涓◣鐢虫姤琛ㄧ殑寰呭埛鏂版暟鎹殑鏍囪瘑 + * + * @param id + */ + public void updateIcon(Long id) { + getTaxDeclareRecordService(user).updateIcon(id, NumberUtils.INTEGER_ZERO); + } + + /** + * 鍒犻櫎涓◣鐢虫姤琛 + * + * @param ids + */ + public void delete(Collection ids) { + getTaxDeclareRecordService(user).deleteByIds(ids); + } + + /** + * 鑾峰彇涓◣鐢虫姤琛ㄦ槸鍚﹀凡缁忕敓鎴 + * + * @param index + * @return + */ + public TaxDeclarationRateDTO getRate(String index) { + return getSalaryCacheService(user).get(SalaryCacheKey.TAX_DECLARATION + index); + } + + /** + * 鐢虫姤 + * + * @param + */ + public String declare(TaxDeclareRecordParam taxDeclareRecordParam) { + ValidUtil.doValidator(taxDeclareRecordParam); + + Long id = taxDeclareRecordParam.getTaxDeclareRecordId(); + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(156454, "鍦ㄧ嚎鐢虫姤")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).declare(id, taxDeclareRecordParam.getReportType()); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鍦ㄧ嚎鐢虫姤澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187274, "鍦ㄧ嚎鐢虫姤澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 鑾峰彇鐢虫姤鍙嶉 + */ + public String getDeclareFeedback(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + + Long id = param.getTaxDeclareRecordId(); + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(182680, "鑾峰彇鐢虫姤鍙嶉")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).getDeclareFeedback(id, param.getReportType(), taxDeclarationRate); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鑾峰彇鐢虫姤鍙嶉澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187255, "鑾峰彇鐢虫姤鍙嶉澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable); + return taxDeclarationRate.getIndex(); + } + + + public Object getCompanyIncomes(GetCompanyIncomesQueryParam param) { + return getTaxDeclareRecordService(user).getCompanyIncomes(param); + } + + + public XSSFWorkbook exportGetCompanyIncomes(GetCompanyIncomesQueryParam param) { + return getTaxDeclareRecordService(user).exportGetCompanyIncomes(param); + } + + public Object getDeclareTaxResultFeedback(Long id) { + return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + } + + + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param); + } + + /** + * 浣滃簾 + */ + public String cancelDeclare(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + Long id = param.getTaxDeclareRecordId(); + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(158842, "浣滃簾鐢虫姤")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).cancelDeclare(id, param.getReportType(), taxDeclarationRate); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("浣滃簾鐢虫姤澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187272, "浣滃簾鐢虫姤澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "cancel", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 鑾峰彇浣滃簾鍙嶉 + */ + public String getCancelFeedback(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + Long id = param.getTaxDeclareRecordId(); + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(182681, "鑾峰彇浣滃簾鐢虫姤鍙嶉")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).getCancelFeedback(id, param.getReportType(), taxDeclarationRate); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鑾峰彇浣滃簾鍙嶉缁撴灉澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187270, "鑾峰彇浣滃簾鍙嶉缁撴灉澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getCancelFeedback", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 鏇存鐢虫姤 + * + * @return + */ + public String updateDeclare(TaxDeclareRecordParam param) { + ValidUtil.doValidator(param); + Long id = param.getTaxDeclareRecordId(); + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(177637, "鏇存鐢虫姤")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).updateDeclare(id, param.getReportType()); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鏇存鐢虫姤澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "鏇存鐢虫姤澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "updateDeclare", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 鎾ら攢鏇存鐢虫姤 + * + * @param id + * @return + */ + public String cancelCorrect(Long id) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(177637, "鎾ら攢鏇存鐢虫姤")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).cancelCorrect(id); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鎾ら攢鏇存鐢虫姤澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "鎾ら攢鏇存鐢虫姤澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "cancelCorrect", localRunnable); + return taxDeclarationRate.getIndex(); + } + + + /** + * 瀵规瘮绠楃◣缁撴灉 + * + * @param param + */ + public Map contrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).contrast(param); + } + + /** + * 瀵煎嚭鍦ㄧ嚎瀵规瘮 + * + * @param param + * @return + */ + public XSSFWorkbook exportContrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).exportContrast(param); + } + + /** + * 鍒锋柊鏁版嵁 + * + * @param id + * @return + */ + public String refreshData(Long id) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(156447, "鍒锋柊鏁版嵁")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).refreshData(id); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鍒锋柊鏁版嵁澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187268, "鍒锋柊鏁版嵁澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "refreshData", localRunnable); + return taxDeclarationRate.getIndex(); + } + + private void checkBefore(Long id) { + TaxDeclarationRateDTO taxDeclarationRate = getSalaryCacheService(user).get(SalaryCacheKey.TAX_DECLARATION + Util.null2String(id)); + if (taxDeclarationRate != null && !taxDeclarationRate.isFinish()) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182691, "褰撳墠姝e浜庛寋0}銆嶄腑锛岃绋嶅悗鍐嶈瘯").replace("{0}", taxDeclarationRate.getMsg())); + } + } + + /** + * 瀵煎嚭涓◣鐢虫姤鏄庣粏鍒楄〃 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportTaxDeclarationValue(queryParam); + } + + /** + * 瀵煎嚭鏈姤閫佺殑浜哄憳鍒楄〃 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4NotDeclare(queryParam); + } + + /** + * 瀵煎嚭娌℃湁鐢虫姤鏁版嵁鐨勪汉鍛樺垪琛 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4NoValue(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4NoValue(queryParam); + } + + /** + * 瀵煎嚭鐢虫姤澶辫触鐨勪汉鍛樺垪琛 + * + * @param queryParam + * @return + */ + public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { + return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); + } + + /** + * 鏂板琛ㄥ崟 + * + * @param param + * @return + */ + public TaxDeclareRecordDetailFormDTO getAddForm(TaxDeclareRecordDetailFormParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + + if (taxDeclaration == null) { + throw new SalaryRunTimeException("鐢虫姤琛ㄤ笉瀛樺湪!"); + } + + // 鏌ヨ涓◣鐢虫姤琛ㄥ垪 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()), 0); + //褰撳墠绋庢鎵灞炴湡鎶ラ佹垚鍔熶笖鐘舵佹甯哥殑浜哄憳 + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclaration.getTaxCycle()) + .taxAgentId(taxDeclaration.getTaxAgentId()) + .declareStatus(DeclareStatusEnum.DECLARE_SUCCESS) + .employmentStatus(EmploymentStatusEnum.NORMAL) + .build() + ); + + //杩囨护鐢虫姤琛ㄤ腑宸插瓨鍦ㄧ殑浜哄憳 + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singletonList(param.getTaxDeclarationId())); + Set empIds = SalaryEntityUtil.properties(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + employeeDeclarePOS = employeeDeclarePOS.stream().filter(emp -> !empIds.contains(emp.getEmployeeId())).collect(Collectors.toList()); + + return TaxDeclareRecordDetailFormDTO.builder() + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .employeeDeclares(employeeDeclarePOS) + .taxDeclarationId(taxDeclaration.getTaxAgentId()) + .build(); + } + + /** + * 鏂板 + * + * @param param + */ + public void add(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).save(param); + } + + /** + * 缂栬緫 + * + * @param param + */ + public void edit(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).edit(param); + } + + /** + * 璇︾粏淇℃伅 + * + * @param id + * @return + */ + public TaxDeclareRecordDetailFormDTO detailInfo(Long id) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(id); + TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(declarationValuePO.getTaxDeclarationId()); + + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclarationPO.getTaxCycle()) + .taxAgentId(taxDeclarationPO.getTaxAgentId()) + .employeeId(declarationValuePO.getEmployeeId()) + .build() + ); + + if (CollectionUtils.isEmpty(employeeDeclarePOS)) { + throw new SalaryRunTimeException("褰撳墠浜哄憳鏈姤閫侊紒"); + } + EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); + // 鏌ヨ涓◣鐢虫姤琛ㄥ垪 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()), 0); + return TaxDeclareRecordDetailFormDTO + .builder() + .id(id) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .taxDeclarationId(taxDeclarationPO.getId()) + .incomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(SalaryEnumUtil.enumMatchByValue(employeeDeclarePO.getCardType(), CardTypeEnum.class).getDefaultLabel()) + .username(employeeDeclarePO.getEmployeeName()) + .jobNum(employeeDeclarePO.getJobNum()) + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .resultValue(declarationValuePO.getResultValue()) + .build(); + } + + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).downloadTemplate(param); + } + + public Map preview(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).preview(param); + } + + public Map importData(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).importData(param); + } + + public void deleteInfo(Long deleteId) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(deleteId); + if (ObjectUtils.isEmpty(declarationValuePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "璇ユ槑缁嗕笉瀛樺湪鎴栧凡琚垹闄わ紒")); + } + getTaxDeclarationValueService(user).deleteById(deleteId); + + // 璁板綍鏃ュ織 + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordService(user).getById(declarationValuePO.getTaxDeclareRecordId()); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecordPO.getTaxAgentId()); + LoggerContext loggerContext = new LoggerContext<>(); + loggerContext.setUser(user); + loggerContext.setTargetId(taxDeclareRecordPO.getId().toString()); + loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "涓◣鎵g即涔夊姟浜恒寋0}銆,绋庢鎵灞炴湡銆寋1}銆,浜哄憳id銆寋3}銆") + .replace("{0}", taxAgent.getName()) + .replace("{1}", SalaryDateUtil.getFormatYearMonth(taxDeclareRecordPO.getTaxCycle())) + .replace("{2}", declarationValuePO.getEmployeeId().toString())); + loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); + loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎涓◣鐢虫姤鏁版嵁")); + loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "鍒犻櫎涓◣鐢虫姤鏁版嵁")); + loggerContext.setOldValues(declarationValuePO); + SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext); + } + + public List getTaxReports(Long id) { + return getTaxDeclareStatusService(user).updateRecord(id); + } +} diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java new file mode 100644 index 000000000..258af95af --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -0,0 +1,62 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import com.engine.salary.service.impl.TaxPaymentAgreementServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithheldVoucherServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithholdingServiceImpl; +import com.engine.salary.service.impl.TaxPaymentWithholdingVoucherServiceImpl; +import lombok.extern.slf4j.Slf4j; + +/** + * 涓◣杈呭姪缂存 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class TaxPaymentWrapper extends Service { + private final TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); + + public TaxFeedbackResultDTO getAgreementFeedback(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user).getFeedback(param); + } + + public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentWithholdingServiceImpl.class, user).getFeedback(param); + } + + + public String getRequestId(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); + } + + public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentAgreementServiceImpl.class, user).queryTaxAmount(param); + } + + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentWithheldVoucherServiceImpl.class, user).getWithheldVoucher(param); + } + + @Deprecated + public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { + ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).syncWithholdingFeedback(param); + } + @Deprecated + public void cancelVoucher(TaxPaymentQueryParam param) { + ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).cancelWithholdingVoucher(param); + } + @Deprecated + public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { + return ServiceUtil.getService(TaxPaymentWithholdingVoucherServiceImpl.class, user).getFeedback(param); + } + +} diff --git a/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java b/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java index 7a984d1c4..4334ed9ba 100644 --- a/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java +++ b/src/com/engine/salary/wrapper/proxy/SalaryAcctResultWrapperProxy.java @@ -19,5 +19,7 @@ public interface SalaryAcctResultWrapperProxy { void calculate(SalaryAcctCalculateParam calculateParam); + void afterTaxAccounting(SalaryAfterTaxAcctCalculateParam calculateParam); + void batchUpdate(SalaryAcctResultBatchUpdateParam param); } diff --git a/test/ApiDes.java b/test/ApiDes.java new file mode 100644 index 000000000..f2751fe24 --- /dev/null +++ b/test/ApiDes.java @@ -0,0 +1,20 @@ +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApiDes { + @ExcelProperty(index = 0) + public String name; + @ExcelProperty(index = 1) + public String mean; + @ExcelProperty(index = 2) + public String type; + @ExcelProperty(index = 3) + public String required; + @ExcelProperty(index = 4) + public String des; +} diff --git a/test/ApiReturnDes.java b/test/ApiReturnDes.java new file mode 100644 index 000000000..e27dc5cc4 --- /dev/null +++ b/test/ApiReturnDes.java @@ -0,0 +1,18 @@ +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApiReturnDes { + @ExcelProperty(index = 0) + public String name; + @ExcelProperty(index = 1) + public String mean; + @ExcelProperty(index = 2) + public String type; + @ExcelProperty(index = 3) + public String des; +} diff --git a/test/FwjtDemo.java b/test/FwjtDemo.java new file mode 100644 index 000000000..48d9f3719 --- /dev/null +++ b/test/FwjtDemo.java @@ -0,0 +1,70 @@ +import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SingnatureData; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class FwjtDemo { + + private static final String hostUrl = "https://uat-ddapi.bigfintax.com/"; + private static final String appKey = "fwjt"; + + private static final String appSecret = "D22439F71F0D7BB17C46583837962E6F"; + + public static void main(String[] args) throws Exception { + //1.鏍¢獙浠诲姟鍙戣捣 + //checkPassWord(); + // 鎴愬姛鍙楃悊杩斿洖锛 {"head":{"msg":"鎴愬姛","code":"00000000","description":"鎴愬姛","time":"2024-06-21 11:42:31","status":"Y"},"body":{"requestId":"25d99665958148698e60b1de97e2d53d"}} + //2.鏍¢獙浠诲姟鏌ヨ缁撴灉 + getCheckPassWord("25d99665958148698e60b1de97e2d53d"); + // 澶辫触鍦烘櫙濡備笅锛 {"head":{"msg":"鎮ㄨ緭鍏ョ殑瀵嗙爜閿欒锛屾偍杩樺墿3娆℃満浼氾紝杩炵画杈撻敊鍚庡瘑鐮佸皢浼氶攣瀹120鍒嗛挓锛岃璋ㄦ厧浣跨敤","code":"010013","description":null,"time":"2024-06-21 11:35:15","status":"N"}} + // 鎴愬姛鍦烘櫙濡備笅锛 {"head":{"msg":"鎴愬姛","code":"00000000","description":"鎴愬姛","time":"2024-06-21 11:34:00","status":"Y"},"body":true} + } + + /*** + * 鏍¢獙瀵嗙爜 + * @return + * @throws Exception + */ + public static String checkPassWord() throws Exception { + String url = hostUrl + "gateway/iit/service/check/checkPassword"; + Map requestParam = new HashMap(); + requestParam.put("bizNo", UUID.randomUUID().toString().replace("-", "")); + requestParam.put("qymc", "娴嬭瘯0"); + requestParam.put("mmlx", "0"); + requestParam.put("djxhid", "10117110118941289705"); + requestParam.put("nsrsbh", "91110118941289705K"); + requestParam.put("sbmm", "Aa123456"); + requestParam.put("mmlx", "0"); + requestParam.put("areaid", "110105"); + String reqJson = JsonUtil.toJsonString(requestParam); + Map params = new HashMap(); + Map header = SingnatureData.initHeader(params, appKey, appSecret); + String res = ""; + try { + //res = HttpUtil.getRequest(url, header, params); + res = HttpUtil.doPost(url, header, reqJson, "application/json"); + System.out.println(res); + } catch (Exception e) { + e.printStackTrace(); + } + return res; + } + + public static String getCheckPassWord(String requestId) throws Exception { + String url = hostUrl + "gateway/iit/service/check/getCheckPasswordFeedback"; + Map params = new HashMap(); + params.put("requestId", requestId); + Map header = SingnatureData.initHeader(params, appKey, appSecret); + String res = ""; + try { + res = HttpUtil.getRequest(url, header, params); + System.out.println(res); + } catch (Exception e) { + e.printStackTrace(); + } + return res; + } +} diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java new file mode 100644 index 000000000..56bb4a986 --- /dev/null +++ b/test/ParseTaxApi.java @@ -0,0 +1,92 @@ +import com.engine.salary.util.excel.ExcelParseHelper; +import org.apache.commons.lang3.StringUtils; + +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.List; + +public class ParseTaxApi { + public static void main(String[] args) { + readExcel("H:\\code\\salary\\test\\ApiDes.xlsx"); + +// readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx"); + } + + + public static void readExcel(String path) { + try { + // 鑾峰彇鏂囦欢杈撳叆娴 + InputStream inputStream = new FileInputStream(path); + + List apiDesList = ExcelParseHelper.parse2Map(inputStream, ApiDes.class, 0, 1, 5, "ApiDes.xlsx"); + + /** + * 瀛楁鍚嶇О 瀛楁鍚箟 瀛楁绫诲瀷 蹇呭~ 璇存槑 + * qtzzlx 鍏朵粬璇佷欢绫诲瀷 String(64) 鏉′欢蹇呭~ 瑙佽瘉浠剁被鍨嬪瓧鍏 + * + * private String qtzzlx; + */ + + apiDesList.forEach(des -> { + String type = des.getType(); + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; + } + } + + String a = "/** * " + + des.getMean() + + " " + + "蹇呭~锛" + des.getRequired() + + " " + (des.getDes() == null ? "" : des.getDes()) + + " */" + " private " + type + " " + des.getName() + ";"; + System.out.println(a); + + }); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public static void readExcel2(String path) { + try { + // 鑾峰彇鏂囦欢杈撳叆娴 + InputStream inputStream = new FileInputStream(path); + + List apiDesList = ExcelParseHelper.parse2Map(inputStream, ApiReturnDes.class, 0, 1, 4, "ApiDes.xlsx"); + + /** + * 瀛楁鍚嶇О 瀛楁鍚箟 瀛楁绫诲瀷 蹇呭~ 璇存槑 + * qtzzlx 鍏朵粬璇佷欢绫诲瀷 String(64) 鏉′欢蹇呭~ 瑙佽瘉浠剁被鍨嬪瓧鍏 + * + * private String qtzzlx; + */ + + apiDesList.forEach(des -> { + String type = des.getType(); + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; + } + } + + String a = "/** * " + + des.getMean() + + " " + (des.getDes() == null ? "" : des.getDes()) + + " */" + " private " + type + " " + des.getName() + ";"; + System.out.println(a); + + }); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + +}