diff --git a/resource/WEB-INF/prop/hrmSalaryCustom.properties b/resource/WEB-INF/prop/hrmSalaryCustom.properties index b873bc15e..7c7aecb15 100644 --- a/resource/WEB-INF/prop/hrmSalaryCustom.properties +++ b/resource/WEB-INF/prop/hrmSalaryCustom.properties @@ -1 +1,2 @@ -formulaRunOvertimeThreshold=10 \ No newline at end of file +formulaRunOvertimeThreshold=10 +flowNoticeMessageType=2022060951 \ No newline at end of file diff --git a/resource/sql/还原.sql b/resource/sql/还原.sql deleted file mode 100644 index fc70ed7b0..000000000 --- a/resource/sql/还原.sql +++ /dev/null @@ -1,138 +0,0 @@ -delete from hrsa_acct_result_temp where 1=1 -; -delete from hrsa_add_up_deduction where 1=1 -; -delete from hrsa_add_up_situation where 1=1 -; -delete from hrsa_attend_quote where 1=1 -; -delete from hrsa_attend_quote_data where 1=1 -; -delete from hrsa_attend_quote_data_value where 1=1 -; -delete from hrsa_attend_quote_field where 1=1 -; -delete from hrsa_attend_quote_sync_set where 1=1 -; - - -delete from hrsa_scheme_detail where 1=1 -; -delete from hrsa_social_archives where 1=1 -; -delete from hrsa_fund_archives where 1=1 -; -delete from hrsa_other_archives where 1=1 -; - - -delete from hrsa_bill_batch where 1=1 -; - -delete from hrsa_bill_detail where 1=1 -; -delete from hrsa_bill_detail_temp where 1=1 -; -delete from hrsa_bill_inspect where 1=1 -; - - - -delete from hrsa_check_result where 1=1 -; -delete from hrsa_check_result_record where 1=1 -; -delete from hrsa_ck_result_detail_temp where 1=1 -; -delete from hrsa_excel_acct_result where 1=1 -; - -delete from hrsa_other_deduction where 1=1 -; -delete from hrsa_salary_acct_emp where 1=1 -; -delete from hrsa_salary_acct_record where 1=1 -; -delete from hrsa_salary_acct_result where 1=1 -; -delete from hrsa_salary_archive where 1=1 -; -delete from hrsa_salary_archive_dimission where 1=1 -; -delete from hrsa_salary_archive_item where 1=1 -; -delete from hrsa_salary_archive_tax_agent where 1=1 -; -delete from hrsa_salary_item where 1=1 -; -delete from hrsa_salary_send where 1=1 -; -delete from hrsa_salary_send_info where 1=1 -; -delete from hrsa_salary_sob where 1=1 -; -delete from hrsa_salary_sob_adjust_rule where 1=1 -; -delete from hrsa_salary_sob_emp_field where 1=1 -; -delete from hrsa_salary_sob_item where 1=1 -; -delete from hrsa_salary_sob_item_group where 1=1 -; -delete from hrsa_salary_sob_range where 1=1 -; -delete from hrsa_salary_template where 1=1 -; - -delete from hrsa_social_security_scheme where 1=1 -; -delete from hrsa_sys_tax_rate_base where 1=1 -; -delete from hrsa_sys_tax_rate_detail where 1=1 -; -delete from hrsa_tax_agent where 1=1 -; -delete from hrsa_tax_agent_emp where 1=1 -; -delete from hrsa_tax_agent_emp_change where 1=1 -; -delete from hrsa_tax_agent_admin where 1=1 -; -delete from hrsa_tax_agent_manage_range where 1=1 -; - -delete from hrsa_tax_agent_sub_admin where 1=1 -; -delete from hrsa_tax_agent_sub_admin_emp where 1=1 -; - -delete from hrsa_tax_declaration where 1=1 -; -delete from hrsa_tax_declaration_detail where 1=1 -; -delete from hrsa_tax_rate_base where 1=1 -; -delete from hrsa_tax_rate_detail where 1=1 -; -delete from hrsa_salary_acct_result_report where 1=1 -; - -delete from hrsa_insurance_base_info where 1=1 -; - - -delete from hrsa_salary_sob_back_item where 1=1 -; -delete from hrsa_salary_send_range where 1=1 -; -delete from hrsa_salary_send_range_obj where 1=1 -; -delete from hrsa_compensation_log where 1=1 -; -delete from hrsa_compensation_config where 1=1 -; -delete from hrsa_special_add_deduction where 1=1 -; - - - 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..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/DM/sql202308150603.sql b/resource/sqlupgrade/DM/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /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'); +/ + 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 ,'ˆTϢ' 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/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..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/GS/sql202308150603.sql b/resource/sqlupgrade/GS/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /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'); +/ + 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 ,'ˆTϢ' 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/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..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/JC/sql202308150603.sql b/resource/sqlupgrade/JC/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /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'); +/ + 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 ,'ˆTϢ' 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/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..e7e16eeb1 --- /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') +; \ 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 ,'ˆTϢ' 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/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..b51e6e345 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150503.sql @@ -0,0 +1,49 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings') +/ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark') +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings' +/ +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark' +/ \ 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..824a4ce82 --- /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') +/ \ 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 ,'ˆTϢ' 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/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..001f75870 --- /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'); +/ \ 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 ,'ˆTϢ' 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/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..4cf555b00 --- /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') +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 ,'ˆTϢ' 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/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..d4c74b78c --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150503.sql @@ -0,0 +1,60 @@ +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157061, null, null, null, 0, 'all_teams', '1', '2', '', 'annualIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157062, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxFreeIncome'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157063, null, null, null, 0, 'all_teams', '1', '2', '', 'annualOther'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157064, null, null, null, 0, 'all_teams', '1', '2', '׼۳ľ', 'annualDonateTax'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157065, null, null, null, 0, 'all_teams', '1', '2', '˰', 'annualTaxSavings'); +/ + +INSERT INTO hrsa_tax_report_column (id, create_time, update_time, creator, delete_type, tenant_key, + tax_report_type, income_category, report_column_name, + report_column_data_index) +VALUES (805915446042157066, null, null, null, 0, 'all_teams', '1', '2', 'ע', 'annualRemark'); +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualIncome' +where report_column_data_index = 'annual_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxFreeIncome' +where report_column_data_index = 'annual_tax_free_income'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualOther' +where report_column_data_index = 'annual_other'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualDonateTax' +where report_column_data_index = 'annual_donate_tax'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualTaxSavings' +where report_column_data_index = 'annual_tax_savings'; +/ + +update hrsa_sob_tax_report_rule set report_column_data_index = 'annualRemark' +where report_column_data_index = 'annual_remark'; +/ + diff --git a/resource/sqlupgrade/ST/sql202308150603.sql b/resource/sqlupgrade/ST/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /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'); +/ + 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 ,'ˆTϢ' 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/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/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/constant/SalaryDefaultTenantConstant.java b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java index 184ccee40..a185dff62 100644 --- a/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java +++ b/src/com/engine/salary/constant/SalaryDefaultTenantConstant.java @@ -1,12 +1,13 @@ package com.engine.salary.constant; /** - * @description: 默认的租户key - * @author: xiajun - * @modified By: xiajun - * @date: Created in 2/8/22 11:25 AM - * @version:v1.0 - */ + * 默认的租户key + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public class SalaryDefaultTenantConstant { public static final String DEFAULT_TENANT_KEY = "all_teams"; 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..698f662f8 --- /dev/null +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -0,0 +1,169 @@ +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/declare/getCompanyRegisterInfo"; + + /** + * 校验密码接口 + */ + public static final String CHECK_PASSWORD_URL = "gateway/iit/check/checkPassword"; + + /** + * 人员专项附加扣除信息查询 + */ + public static final String QUERY_SPECIAL_AMOUNT = "gateway/iit/special/querySpecialAmount"; + + /** + * 人员专项附加扣除信息查询反馈 + */ + 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/report/correct"; + + /** + * 税局端申报状态查询 + */ + public static final String QUERY_DECLARE_STATUS = "/gateway/iit/report/queryDeclarationRecord"; + + /** + * 企业申报数据明细查询 + */ + public static final String QUERY_COMPANY_INCOMES = "/gateway/iit/report/getCompanyIncomes"; + + /** + * 获取流量统计情况 + */ + public static final String 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/payment/cancelWithholdingVoucher"; + /** + * 完税证明 + */ + public static final String GET_WITHHELD_VOUCHER = "gateway/iit/payment/getWithheldVoucher"; + /** + * 刷新缴款状态 + */ + public static final String GET_SYNC_WITHHOLDING_FEEDBACK = "gateway/iit/payment/getSyncWithholdingFeedback"; + + + /** + * 请求成功状态码 + */ + public static final String SUCCESS_CODE = "00000000"; + + /** + * 处理中状态码 + */ + public static final String HANDLING_CODE = "000004"; + + /** + * 企业服务不可用 + */ + 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: 个税税率表明细表的dataIndex - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/17/22 1:58 PM - * @version:v1.0 - */ + * 个税税率表明细表的dataIndex + *

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 0fbe29e78..e3be152b6 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 dm.jdbc.util.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/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/bo/DataCollectionBO.java b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java index e216ddc7d..db9a2241d 100644 --- a/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java +++ b/src/com/engine/salary/entity/datacollection/bo/DataCollectionBO.java @@ -1,17 +1,125 @@ package com.engine.salary.entity.datacollection.bo; +import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + /** * @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转DTO:累计专项附加扣除加密字段赋值 +// * +// * @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转DTO:往期累计情况加密字段赋值 +// * +// * @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转DTO:其他免税扣除加密字段赋值 +// * +// * @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 +139,296 @@ 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("修改之前的注解值:" + oldValue); +// //获取 targetAnnotation 这个代理实例所持有的 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("修改之后的注解值:" + 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, "个税扣缴义务人"), 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, "个税扣缴义务人"), 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.DATE_FORMATTER.format(employeeDeclarePO.getEmploymentDate())); +// employeeMap.put("xb", GenderEnum.MALE.getValue().equals(employeeDeclarePO.getGender()) ? GenderEnum.MALE.getDefaultLabel() : GenderEnum.FEMALE.getDefaultLabel()); +// employeeMap.put("csny", SalaryDateUtil.DATE_FORMATTER.format(employeeDeclarePO.getBirthday())); +// employeeMap.put("gj", "中国"); +// employeeMap.put("rydq", "境内"); +// boolean disability = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getDisability()); +// boolean martyrDependents = SalaryOnOffEnum.ON.getValue().equals(employeeDeclarePO.getMartyrDependents()); +// employeeMap.computeIfAbsent("sfcj", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDisability()).getDefaultLabel()); +// employeeMap.computeIfAbsent("cjzh", e -> disability ? employeeDeclarePO.getDisabilityCardNo() : null); +// employeeMap.computeIfAbsent("sfls", e->SalaryOnOffEnum.parseByValue(employeeDeclarePO.getMartyrDependents()).getDefaultLabel()); +// employeeMap.computeIfAbsent("lszh", e-> martyrDependents ? employeeDeclarePO.getMartyrDependentsCardNo() : null); +// employeeMap.computeIfAbsent("sfgl", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getLonelyOld()).getDefaultLabel()); +// employeeMap.computeIfAbsent("sfzdw", e -> SalaryOnOffEnum.parseByValue(employeeDeclarePO.getDeductExpenses()).getDefaultLabel()); +// employeeList.add(employeeMap); +// } +// return employeeList; +// } +// +// public static AddUpDeduction buildAddUpDeductionPO(QuerySpecialAmountFeedbackResponse.Feedback feedback) { +// return AddUpDeduction.builder() +// .id(IdGenerator.generate()) +// .addUpChildEducation(feedback.getLjznjyzc().toString()) +// .addUpContinuingEducation(feedback.getLjjxjyzc().toString()) +// .addUpHousingRent(feedback.getLjzfzjzc().toString()) +// .addUpInfantCare(feedback.getLjyyezhzc().toString()) +// .addUpHousingLoanInterest(feedback.getLjzfdklxzc().toString()) +// .addUpSupportElderly(feedback.getLjsylrzc().toString()) +// .addUpIllnessMedical("0") +// .dataSource(EnumAddUpDeductionDataSource.ONLINE.getValue()) +// .lastUpdateTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .build(); +// } +// +// public static AddUpDeductionRequestFailPO buildAddUpDeductionRequestFailPO(AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper, +// AddUpDeductionRequestPO requestPO, +// Long employeeId) { +// return AddUpDeductionRequestFailPO.builder() +// .id(IdGenerator.generate()) +// .requestId(requestPO.getRequestId()) +// .outerRequestId(requestPO.getOuterRequestId()) +// .taxYearMonth(requestPO.getTaxYearMonth()) +// .taxAgentId(requestPO.getTaxAgentId()) +// .employeeId(Optional.ofNullable(employeeId).orElse(0L)) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) +// .creator(requestWrapper.getCurrentEmployeeId()) +// .tenantKey(requestPO.getTenantKey()) +// .build(); +// } +// +// public static AddUpDeductionRequestResultDTO buildRequestResultDTO(Long requestId, AddUpDeductionServiceImpl.AddUpDeductionOnlineRequestWrapper requestWrapper) { +// return AddUpDeductionRequestResultDTO.builder() +// .requestId(requestId.toString()) +// .msg(String.format(SalaryI18nUtil.getI18nLabel(184070, "共成功获取数据%s条,失败%s条"), +// requestWrapper.getInsertList().size() + requestWrapper.getUpdateList().size(), +// requestWrapper.getFailPOList().size())) +// .result(requestWrapper.getFailPOList().size() > 0 ? "warning" : "success") +// .finish(true) +// .build(); +// } +// +// 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/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; + +/** + * 人员专项附加扣除信息查询结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class QuerySpecialAmountFeedbackResponse extends BaseResponse { + + /** + * 返回数据 + */ + private Body body; + + + /** + * 人员专项附加扣除信息查询反馈结果body + */ + @Data + public static class Body { + /** + * 结果列表 + */ + private List ryxxlb; + } + + /** + * 人员专项附加扣除信息查询反馈结果 + **/ + @Data + public static class Feedback { + /** + * 员工姓名 + */ + private String xm; + + /** + * 证件类型 + */ + private String zzlx; + + /** + * 证件号码 + */ + private String zzhm; + + /** + * 代报状态 + */ + 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..4562612e1 --- /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; + +/** + * 人员专项附加扣除信息查询结果 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class QuerySpecialAmountResponse extends BaseResponse { + + /** + * 返回数据 + */ + private QuerySpecialAmountBody body; + + /** + * 人员专项附加扣除信息查询结果body + **/ + @Data + public static class QuerySpecialAmountBody { + /** + * 请求查询ID + */ + private String requestId; + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + } +} 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..c63a55817 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareList.java @@ -0,0 +1,152 @@ +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 { + + /** + * 转换成人员报送(人员)列表dto + * + * @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())) + .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..3ef2357b2 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -0,0 +1,216 @@ +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.valid.SalaryCardUtil; +import com.google.common.collect.Lists; +import dm.jdbc.util.IdGenerator; +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); + // 员工的个人信息 + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId); + // 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期) + 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); + } + } + // 薪资档案中新增的需报送的人员 + for (DataCollectionEmployee hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) { + if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) { + continue; + } + EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); + String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); + employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); + employeeDeclare.setJobNum(hrmEmployeeComInfo.getWorkcode()); + employeeDeclare.setCardNum(idNum); + employeeDeclare.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name()) ? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue()); + employeeDeclare.setBirthday(simpleUserInfo == null || simpleUserInfo.getBirthday() == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday())); + employeeDeclare.setMobile(hrmEmployeeComInfo.getMobile()); + if (StringUtils.isEmpty(idNum)) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空")); + } else if (!SalaryCardUtil.checkIdNum(idNum)) { + employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue()); + employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误")); + } else { + employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum))); + } + // 对人员处理「人员状态」、「离职日期」 + 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, Date now, Long employeeId) { + EmployeeDeclarePO employeeDeclarePO = new EmployeeDeclarePO(); + employeeDeclarePO.setId(IdGenerator.generate()); + employeeDeclarePO.setTaxAgentId(taxAgentId); + employeeDeclarePO.setTaxCycle(taxCycle); + employeeDeclarePO.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); + employeeDeclarePO.setGender(GenderEnum.MALE.getValue()); + 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(now); + employeeDeclarePO.setUpdateTime(now); + 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..c40bcae9d --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -0,0 +1,143 @@ +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 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 = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class); + employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel()); + // *证件号码 + employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); + // *国籍 + employeeInfoMap.put("gj", "中国"); + // *性别 + GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class); + employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel()); + // *出生日期 + employeeInfoMap.put("csny", 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()); + // 入职年度就业情形 + 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()); + // 是否扣除减除费用 + 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("rydq", "境内"); + // 中文名 + employeeInfoMap.put("xmzw", ""); + // 出生地: + employeeInfoMap.put("csd", ""); + // 涉税事由 + employeeInfoMap.put("sssx", ""); + // 首次入境时间 + employeeInfoMap.put("scrjsj", ""); + // 预计离境时间 + employeeInfoMap.put("yjljsj", ""); + // 其他证件类型 + 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/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..21aedf5d9 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -0,0 +1,120 @@ +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; + + // 个税扣缴义务人id + 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 = "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 = "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; + + // 是否扣除减除费用 + @TableTitle(title = "是否扣除减除费用", 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..93a06d3b5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -0,0 +1,126 @@ +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.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") + 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; + + // 个税扣缴义务人 + @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + @TableTitle(title = "个税扣缴义务人", 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 String cardType; + + // 证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") + @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") + private String cardNum; + + // 性别 + @SalaryTableColumn(text = "性别", width = "10%", column = "gender") + @TableTitle(title = "性别", dataIndex = "gender", key = "gender") + private String gender; + + // 出生日期 + @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") + @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") + private String birthday; + + // 人员状态 + @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") + @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") + private String 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 String employmentType; + + // 任职受雇从业日期 + @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") + @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") + private String employmentDate; + + + // 离职日期 + @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") + @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") + private String dismissDate; + + // 申报状态 + 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/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 { + // 个税扣缴义务人 + private Long taxAgentId; + + // 税款所属期 + private Date taxCycle; + + // 已有的报送人员 + private List employeeDeclares; + + // 上个税款所属期的报送人员 + private List preTaxCycleEmployeeDeclare; + + // 薪资档案中的人员 + 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..6b1286c03 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/TaxAgentDeclareListDTO.java @@ -0,0 +1,29 @@ +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 TaxAgentDeclareListDTO { + + // 主键id + private Long id; + + // 个税扣缴义务人 + private String taxAgentName; +} 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..116623339 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareAddListQueryParam.java @@ -0,0 +1,101 @@ +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; + + + // 个税扣缴义务人id + @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 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; + + // 是否扣除减除费用 + 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; + + /** + * 个税扣缴义务人id + */ + @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/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java new file mode 100644 index 000000000..e569ecbf1 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -0,0 +1,90 @@ +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; + + // 个税扣缴义务人id + @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 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; + + // 是否扣除减除费用 + 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..8f99c2e98 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareParam.java @@ -0,0 +1,36 @@ +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 EmployeeDeclareParam { + + /** + * 个税扣缴义务人id + */ + @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/EmployeeDeclareRefreshParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java new file mode 100644 index 000000000..b70cba7b5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareRefreshParam.java @@ -0,0 +1,36 @@ +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 EmployeeDeclareRefreshParam { + + /** + * 个税扣缴义务人id + */ + @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/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java new file mode 100644 index 000000000..b61c2e713 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -0,0 +1,96 @@ +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不能为空 + */ + //个税扣缴义务人id") + private Long taxAgentId; + + /** + * 参数错误,税款所属期参数格式错误 + */ + //税款所属期") + private Date taxCycle; + + //员工id") + private Long employeeId; + + //员工类型") + private EmployeeTypeEnum employeeType; + + //姓名") + private String employeeName; + + //工号") + private String jobNum; + + //证件类型") + 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 SalaryOnOffEnum disability; + + //残疾证号") + private String disabilityCardNo; + + //是否孤老") + private SalaryOnOffEnum lonelyOld; + + //是否是烈属") + private SalaryOnOffEnum martyrDependents; + + //烈属证号") + private String martyrDependentsCardNo; + + //是否扣除减除费用") + private SalaryOnOffEnum deductExpenses; +} 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; + +/** + * 人员报送(个税扣缴义务人)查询条件 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaxAgentDeclareListQueryParam extends BaseQueryParam { + + // "个税扣缴义务人名称" + 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..a8c23d03b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -0,0 +1,222 @@ +package com.engine.salary.entity.employeedeclare.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_employee_declare +public class EmployeeDeclarePO { + + /** + * 主键id + */ + private Long id; + + /** + * 个税扣缴义务人 + */ + private Long taxAgentId; + + /** + * 税款所属期 + */ + private Date taxCycle; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 人员名称 + */ + private String employeeName; + + /** + * 工号 + */ + private String jobNum; + + /** + * 证件类型 + */ + private Integer cardType; + + /** + * 证件号码 + */ + private String cardNum; + + /** + * 性别 + */ + private Integer gender; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 状态 + */ + private Integer employmentStatus; + + /** + * 手机号码 + */ + private String mobile; + + /** + * 任职受雇从业类型 + */ + private Integer employmentType; + + /** + * 入职年度就业情形 + */ + private String employmentFirstYear; + + /** + * 任职受雇从业日期 + */ + private Date employmentDate; + + /** + * 离职日期 + */ + private Date dismissDate; + + /** + * 是否残疾 + */ + private Integer disability; + + /** + * 残疾证号 + */ + private String disabilityCardNo; + + /** + * 是否孤老 + */ + private Integer lonelyOld; + + /** + * 是否是烈属 + */ + private Integer martyrDependents; + + /** + * 烈属证号 + */ + private String martyrDependentsCardNo; + + /** + * 是否扣除减除费用 + */ + private Integer deductExpenses; + + /** + * 是否成功报送过 + * 注意:不仅仅是针对某一个月 + * 0:从未报送成功过、1:报送成功过 + */ + private Integer successfullyDeclared; + + /** + * 员工信息是否发生变动: + * 0:本月未改动、1:本月有改动 + */ + private Integer newEmployeeInfo; + + /** + * 申报状态 + */ + private Integer declareStatus; + + /** + * 申报失败的错误信息 + */ + private String declareErrorMsg; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + + public String toCompareString() { + return "EmployeeDeclarePO{" + + "id=" + id + + ", taxAgentId=" + taxAgentId + + ", taxCycle='" + taxCycle + '\'' + + ", employeeId=" + employeeId + + ", employeeType=" + employeeType + + ", employeeName='" + employeeName + '\'' + + ", jobNum='" + jobNum + '\'' + + ", cardType=" + cardType + + ", cardNum='" + cardNum + '\'' + + ", gender=" + gender + + ", birthday=" + birthday + + ", employmentStatus=" + employmentStatus + + ", mobile='" + mobile + '\'' + + ", employmentType=" + employmentType + + ", employmentFirstYear='" + employmentFirstYear + '\'' + + ", employmentDate=" + employmentDate + + ", dismissDate=" + dismissDate + + ", disability=" + disability + + ", disabilityCardNo='" + disabilityCardNo + '\'' + + ", lonelyOld=" + lonelyOld + + ", martyrDependents=" + martyrDependents + + ", martyrDependentsCardNo='" + martyrDependentsCardNo + '\'' + + ", deductExpenses=" + deductExpenses + + '}'; + } + + private Collection ids; + private Collection employeeIds; +} 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; + /** + * 个税扣缴义务人 + */ + private Long taxAgentId; + /** + * 税款所属期 + */ + private Date taxCycle; + /** + * 请求的requestId + */ + private String requestId; + /** + * 租户key + */ + private String tenantKey; + /** + * 创建人id + */ + 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 c298b33fd..882d2acd9 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryBillBO.java @@ -207,7 +207,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()); // // 消息接收者 @@ -403,7 +403,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/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/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/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 1929494a9..313779404 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/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 cfe97aae9..7ec1aea5e 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -7,6 +7,7 @@ import com.engine.salary.util.valid.DataCheck; import lombok.*; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -31,8 +32,14 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { //人员姓名") private String employeeName; + /** + * 税款所属期 + */ + private Date taxCycle; + //个税扣缴义务人") private Long taxAgentId; + private List taxAgentIds; //分部 private List subcompanyIds; @@ -48,8 +55,8 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { * 状态 * @see SalaryEmployeeStatusEnum */ - private SalaryEmployeeStatusEnum status; + //状态(多选) private List statuses; diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index 7d6c82f58..4cab0c6ec 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -69,6 +69,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 9587048ee..56a527116 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java @@ -83,6 +83,11 @@ public class SalaryAcctRecordPO { */ 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; +// +// /** +// * 创建人id +// */ +// 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..4a7dd7da6 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctTaxAgentPO.java @@ -0,0 +1,76 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 薪资核算记录对应的个税扣缴义务人 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +// "hrsa_acct_tax_agent") +public class SalaryAcctTaxAgentPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资核算记录的id + */ + private Long salaryAcctRecordId; + + /** + * 收入所得项目 + */ + private Integer incomeCategory; + + /** + * 个税扣缴义务人的id + */ + private Long taxAgentId; + + /** + * 薪资所属月 + */ + private Date salaryMonth; + + /** + * 税款所属期 + */ + private Date taxCycle; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} 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 544550acf..d22e3fcc7 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 3e2513908..ffb902b90 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -117,6 +117,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()) @@ -157,6 +158,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/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/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/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 { + + //薪资账套的id") + private Long salarySobId; + + //往期累计情况的对应关系") + private List incomeCategoryParams; + + @Data + public static class AddUpRuleIncomeCategoryParam { + + //所得项目") + private String incomeCategory; + + //往期累计情况的对应关系") + private List addUpRuleParams; + } + + @Data + public static class AddUpRuleParam { + + //薪资项目的id") + 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 bd86de4d6..d0357f414 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java @@ -40,11 +40,11 @@ public class SalarySobBasicSaveParam { private Long taxAgentId; /** - * 薪资类型不允许为空 + * 所得项目不允许为空 * * @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 e19856374..e166991dc 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 4e9e7af0a..bd1a9e75b 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java @@ -5,12 +5,13 @@ import lombok.Data; import lombok.EqualsAndHashCode; /** - * @description: 薪资账套列表查询参数 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 1/18/22 3:04 PM - * @version:v1.0 - */ + * 薪资账套列表查询参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ @Data @EqualsAndHashCode(callSuper = true) public class SalarySobListQueryParam extends BaseQueryParam { diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeEmpQueryParam.java index cddc8f603..fce9fdd00 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 { + + //薪资账套的id + 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; + + //薪资项目的id + 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..5ae545bf1 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobAddUpRulePO.java @@ -0,0 +1,51 @@ +package com.engine.salary.entity.salarysob.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_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; + //创建人id + 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 e3167bc23..b85ee84ea 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobItemPO.java @@ -35,11 +35,23 @@ public class SalarySobItemPO { */ private Long salarySobId; + /** + * 所得项目 + */ + private String incomeCategory; + /** * 薪资项目的id */ private Long salaryItemId; + /** + * 薪资项目的code + */ + 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 921fad01c..3d62f68c1 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 lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,6 +36,7 @@ public class SalarySobPO { /** * 应税项目。1:正常工资薪金所得 + * @see IncomeCategoryEnum */ private Integer incomeCategory; /** 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..927069540 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobTaxReportRulePO.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.salarysob.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_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; + //创建人id", 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/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java new file mode 100644 index 000000000..fab88eda0 --- /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 dm.jdbc.util.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", ""); + requestMap.put("bmmc", ""); + 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; + + //个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //个税扣缴义务人") + 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; + + //个税扣缴义务人 + 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; + + //行政区划代码") + 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、关闭所有tab") + private Integer compType; + + //验证状态") + private TaxAgentTaxReturnStatusEnum checkStatus; + + //失败原因") + private String failReason; + + //验证提示信息") + private String message; + + //个税扣缴义务人ID") + 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; + +/** + * 个税扣缴义务人-报税信息-保存参数 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("个税扣缴义务人-报税信息-保存参数") +public class TaxAgentTaxReturnSaveParam { + + //个税扣缴义务人id + 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, "个税扣缴义务人id不能为空")); + 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, "个税扣缴义务人id不能为空")); + 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, "个税扣缴义务人id不能为空")); + } +} 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..b338e53b6 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentTaxReturnPO.java @@ -0,0 +1,150 @@ +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; + +/** + * 个税扣缴义务人-报税信息 + *

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; + + /** + * 个税扣缴义务人ID + */ + private Long taxAgentId; + + /** + * 税号 + */ + 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; + + /** + * 行政区划代码 + */ + 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; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + + //查询条件 + 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..c4a21e6f6 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CheckPasswordResponse.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +/** + * 神州云合接口返回状态实体 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CheckPasswordResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + 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..f0ff1c84f --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/response/CompanyRegisterInfoResponse.java @@ -0,0 +1,68 @@ +package com.engine.salary.entity.taxagent.response; + +import lombok.Data; + +import java.util.List; + +/** + * 神州云合接口返回状态实体 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class CompanyRegisterInfoResponse { + /** + * 接口状态 + */ + private SzyhResponseHead head; + /** + * 返回数据 + */ + 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..8ee8ba3e6 --- /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 dm.jdbc.util.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; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", 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; + + //创建人id + @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 = "个税扣缴义务人",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; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人",key = "taxAgentName",dataIndex = "taxAgentName") + private String taxAgentName; + + //个税扣缴义务人ID + @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 { + + //个税扣缴义务人id") + @NotNull(message = "个税扣缴义务人不能为空") + 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 { + + //个税扣缴义务人id") + 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; + + /** + * 个税扣缴义务人的主键id + */ + private Long taxAgentId; + + /** + * 税款所属期 + */ + private Date taxMonth; + + /** + * 使用时间 + */ + private Date useTime; + + /** + * 是否扣流量 + * + * @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; + + + /** + * 提醒配置的id + */ + private Long warnConfigId; + + /** + * 接受人id + */ + 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..67779fd42 --- /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 taxNumber; + /** + * 已使用流量 + */ + 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 4fe0d32c3..e26135d00 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, @@ -469,7 +468,6 @@ public class TaxDeclarationBO { .tenantKey(taxDeclaration.getTenantKey()) .deleteType(NumberUtils.INTEGER_ZERO) .build(); - encryptUtil.encrypt(accumulatedSituation, AddUpSituation.class); result.getNeedInsertAddUpSituations().add(accumulatedSituation); }); } @@ -661,7 +659,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..6fc30bf15 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -0,0 +1,175 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +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.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; + +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()) { + // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源 + 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; + } + } + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) { + SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap() + .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex()); + List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId()); + String defaultValue = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0" : ""; + String value = defaultValue; + if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { + value = salaryAcctResultValue.stream() + .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) + .findFirst() + .orElse(new SalaryAcctResultPO()) + .getResultValue(); + } + 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) + .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(); + // 只有「工资工资薪金」、「保险营销员佣金收入」、「证券经纪人佣金收入」、「其他连续劳务报酬所得」需要累计计税 + 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")) + .addUpAdvanceTax(valueMap.get("addUpAdvanceTax")) +// .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/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..4879c1abb --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationRequest.java @@ -0,0 +1,165 @@ +package com.engine.salary.entity.taxdeclaration.bo; + +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.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.report.enums.IncomeCategoryEnum; +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.RoundingMode; +import java.util.*; + +/** + * 个税申报 + *

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> 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); + 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<>(); + // 正常工资薪金列表 + param.put("zcgzxjlb", Lists.newArrayList()); + // 正常工资薪金是否需要专项 + param.put("zcgzxjsfxyzx", 0); + // 正常工资薪金是否传入专项累计 + 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) { + // 解除劳动合同一次性补偿金 + List> employeeRequestParams = listRequestParam.computeIfAbsent("jcldhtycxbcjlb", k -> Lists.newArrayList()); + 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()); + employeeRequestParams.add(employeeRequestParam); + } else if (incomeCategoryEnum == IncomeCategoryEnum.ROYALTIES) { + // 特许权使用费所得 + List> employeeRequestParams = listRequestParam.computeIfAbsent("txq", k -> Lists.newArrayList()); + employeeRequestParams.add(employeeRequestParam); + } + } + } + + Map requestParam = Maps.newHashMap(); + requestParam.putAll(objRequestParam); + requestParam.putAll(listRequestParam); + return requestParam; + } + + 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.RESIDENT_IDENTITY_CARDS.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; + } +} 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..8b78d34d8 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -0,0 +1,115 @@ +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 simpleUserInfos + * @param extEmployees + * @return + */ + public static List> buildTableData(IncomeCategoryEnum incomeCategoryEnum, + List taxReportColumns, + List taxDeclarationValues, + List employeeDeclares, + List simpleEmployees, + List simpleUserInfos, + List extEmployees) { + if (CollectionUtils.isEmpty(simpleEmployees)) { + return Collections.emptyList(); + } + List> tableDataList = Lists.newArrayList(); + // 员工基本信息按照人员id聚合分类 + Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + // 员工报送信息按照人员id聚合分类 + Map employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getEmployeeId); + // 员工个人信息按照人员id聚合分类 + Map simpleUserInfoMap = SalaryEntityUtil.convert2Map(simpleUserInfos, e -> e.getEmployeeId()); + // 非系统员工按照人员id聚合分类 + 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(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); + } + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId()); + if (employeeDeclare != null) { + dataMap.put("jobNum", employeeDeclare.getJobNum()); + dataMap.put("username", employeeDeclare.getEmployeeName()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", employeeDeclare.getCardNum()); + } else if (Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put("jobNum", simpleEmployee.getWorkcode()); + dataMap.put("username", simpleEmployee.getUsername()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", simpleUserInfo == null ? "" : simpleUserInfo.getIdNo()); + } else { + ExtEmpPO extEmployee = extEmployeeMap.get(taxDeclarationValue.getEmployeeId()); + dataMap.put("jobNum", ""); + dataMap.put("username", extEmployee.getUsername()); + dataMap.put("cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put("cardNum", 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; + /** + * 薪资账套的个税申报表规则。key:薪资账套id-个税申报表字段索引、value:薪资账套的个税申报表规则 + */ + private Map salarySobTaxReportRuleMap; + /** + * 薪资账套的累计字段对应关系。key:薪资账套id-往期累计情况的字段索引、value:薪资账套的累计字段对应关系 + */ + 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..2b587f652 --- /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(SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())) + .setCardNum(employeeDeclare.getCardNum()) + .setDeclareStatus(declareStatusEnum) + .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); + } else if (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; + + /** + * 个税扣缴义务人 + */ + 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..7970724c7 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -0,0 +1,55 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +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") + private String employeeName; + + //工号") + @TableTitle(title = "工号",dataIndex = "jobNum",key = "jobNum") + private String jobNum; + + //证件类型") + @TableTitle(title = "证件类型",dataIndex = "cardType",key = "cardType") + private String cardType; + + //证件号码") + @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") + private String cardNum; + + //报送状态") + private DeclareStatusEnum declareStatus; + + //报送状态") + @TableTitle(title = "报送状态",dataIndex = "declareStatusDesc",key = "declareStatusDesc") + private String declareStatusDesc; +} 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..7d2ae71d2 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -0,0 +1,48 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +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") + private String employeeName; + + //个税扣缴义务人id + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //个税扣缴义务人名称 + @TableTitle(title = "个税扣缴义务人名称",dataIndex = "taxAgentName",key = "taxAgentName") + private String taxAgentName; + + //证件号码 + @TableTitle(title = "证件号码",dataIndex = "cardNum",key = "cardNum") + private String cardNum; + + //失败原因 + @TableTitle(title = "失败原因",dataIndex = "errorMsg",key = "errorMsg") + private String errorMsg; + + //所得项目 + @TableTitle(title = "所得项目",dataIndex = "incomeCategory",key = "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..20a06d05a 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; - //个税扣缴义务人id") + @ApiModelProperty("薪资所属月") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date salaryMonth; + + @ApiModelProperty("税款所属期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; + + @ApiModelProperty("个税扣缴义务人id") + @JsonSerialize(using = ToStringSerializer.class) private Long taxAgentId; - //个税扣缴义务人名称") + @ApiModelProperty("个税扣缴义务人名称") 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/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; + + //个税申报表id") + @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..7090bddfa --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationValueListDTO.java @@ -0,0 +1,31 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.cloudstore.eccom.pc.table.WeaTableColumn; +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 TaxDeclarationValueListDTO { + + /** + * 个税申报表表头 + */ + private List columns; + + /** + * 个税申报表数据 + */ + private List> data; +} 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; + + //个税扣缴义务人范围") + private TaxAgentRangeEnum taxAgentRange; + + //个税扣缴义务人id") + 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; + + //个税扣缴义务人 + @JsonSerialize(using = ToStringSerializer.class) + private Long taxAgentId; + + //个税扣缴义务人名称 + @TableTitle(title = "个税扣缴义务人名称",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; + + //操作人id + @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/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 + //个税扣缴义务人id") + private Long taxAgentId; + + @JsonIgnore + //税款所属期") + private Date taxCycle; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java index 521fadd56..83f65672c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationListQueryParam.java @@ -1,9 +1,13 @@ package com.engine.salary.entity.taxdeclaration.param; import com.engine.salary.common.BaseQueryParam; -import lombok.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; /** * 个税申报记录查询条件 @@ -20,12 +24,13 @@ import java.time.YearMonth; public class TaxDeclarationListQueryParam extends BaseQueryParam { //薪资所属月范围起点 - private YearMonth fromSalaryMonth; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date fromSalaryMonth; - //薪资所属月范围终点 - private YearMonth endSalaryMonth; + //薪资所属月范围终点 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date endSalaryMonth; - private String fromSalaryMonthStr; - - private String endSalaryMonthStr; + //个税扣缴义务人菜单") + private String taxAgentName; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java index 18b8c28c8..0a5003f69 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationSaveParam.java @@ -1,11 +1,14 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.enums.taxdeclaration.TaxAgentRangeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.time.YearMonth; +import java.util.Date; +import java.util.List; /** * 生成个税申报表参数 @@ -29,17 +32,26 @@ public class TaxDeclarationSaveParam { /** * 薪资所属月 */ - private YearMonth salaryMonth; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date salaryMonth; /** * 个税扣缴义务人 */ private Long taxAgentId; + /** + * 个税扣缴义务人范围 + */ + private TaxAgentRangeEnum taxAgentRange; + + /** + * 个税扣缴义务人id + */ + private List taxAgentIds; + /** * 备注 */ private String description; - - private String salaryMonthStr; } 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..864c4dac9 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -0,0 +1,29 @@ +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; + + //个税申报表id") + private Long taxDeclarationId; + + //收入所得项目") + private IncomeCategoryEnum incomeCategory; + + //导出excel时加密的密码") + private String sharePassword; +} 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..7e94fcc2e --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.Data; + +/** + * 个税申报 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordParam { + + //个税申报记录id") + private Long taxDeclareRecordId; +} 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; + + /** + * 创建人id + */ + 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; + + /** + * 创建人id + */ + 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 8319f9e4d..682f1a87b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -30,6 +30,18 @@ public class TaxDeclarationPO { */ private Long id; + /** + * 个税申报记录id + */ + private Long taxDeclareRecordId; + + /** + * 薪资类型 + * + * @see IncomeCategoryEnum + */ + private Integer incomeCategory; + /** * 薪资所属月 */ @@ -45,12 +57,6 @@ public class TaxDeclarationPO { */ private Long taxAgentId; - /** - * 薪资类型 - * - * @see IncomeCategoryEnum - */ - private Integer incomeCategory; /** * 备注 @@ -82,6 +88,12 @@ public class TaxDeclarationPO { */ private Date updateTime; + + /** + * 查看控制 + */ + private Integer controlView; + //税款所属期 LocalDateRange salaryMonths; 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..11b97036b --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -0,0 +1,94 @@ +package com.engine.salary.entity.taxdeclaration.po; + +import com.engine.salary.annotation.Encrypt; +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; +import java.util.Map; + +/** + * 个税申报表的值 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@Builder +@AllArgsConstructor +@NoArgsConstructor +//hrsa_tax_declaration_value") +public class TaxDeclarationValuePO implements Serializable { + /** + * 主键id + */ + private Long id; + + /** + * 个税申报表id + */ + private Long taxDeclarationId; + + /** + * 个税申报记录id + */ + private Long taxDeclareRecordId; + + /** + * 人员类型 + */ + private Integer employeeType; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 薪资核算结果 + */ + private Map resultValue; + + /** + * 薪资核算结果(只在加密解密中使用) + */ + @Encrypt + private String resultValueJson; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + 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; + + //创建人id", 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..6664f1985 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -0,0 +1,112 @@ +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; + +/** + * 个税申报 + *

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; + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + /** + * 薪资所属月 + */ + private Date salaryMonth; + /** + * 税款所属期 + */ + private Date taxCycle; + /** + * 申报类型 + */ + private Integer taxDeclareType; + /** + * 申报状态 + */ + private Integer taxDeclareStatus; + /** + * 申报失败的错误信息 + */ + private String taxDeclareErrorMsg; + /** + * 请求的requestId + */ + private String requestId; + /** + * 备注 + */ + private String remark; + + //应缴金额 + private String taxPayAmount; + + //实缴总额 + private String taxPaidAmount; + + //实缴税额(不含滞纳金等) + private String taxPurePaidAmount; + + //申报人数 + private Integer personNum; + + /** + * 个税申报表的待刷新数据的标识 + */ + private Integer displayUpdateIcon; + /** + * 租户key + */ + private String tenantKey; + /** + * 创建人id + */ + 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/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java new file mode 100644 index 000000000..5e824dc48 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -0,0 +1,54 @@ +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 { + + //name = "主键id") + private Long id; + //name = "报表类型") + private String taxReportType; + //name = "所得项目") + private String incomeCategory; + //name = "申报表的列名") + private String reportColumnName; + //name = "申报表的列名多语言标签") + private Integer reportColumnLabel; + //name = "申报表的列索引") + private String reportColumnDataIndex; + //name = "数值类型") + private String dataType; + //name = "个税对接时的参数key") + private String requestParamKey; + //name = "租户key", ignore = true) + private String tenantKey; + //name = "创建人id", ignore = true) + private Long creator; + //name = "是否删除", ignore = true) + private Integer deleteType; + //name = "创建时间", ignore = true) + private Date createTime; + //name = "更新时间", ignore = true) + private Date updateTime; + + Collection ids; +} 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..564edd0b7 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.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 CancelDeclareFeedbackResponse { + + //接口状态") + private SzyhResponseHead head; + + //接口状态") + 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..e2b77f90c --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.response; + +import com.engine.salary.entity.taxagent.response.SzyhResponseHead; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * 更正申报的返回数据 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@ApiModel("更正申报的返回数据") +public class UpdateDeclareResponse { + + //接口状态") + private SzyhResponseHead head; +} 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 { + + //个税扣缴义务人") + 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 { + /** + * 申报类型代码 + */ + private String taxDeclareCode; + /** + * 申报类型名称 + */ + private String taxDeclareName; + /** + * 缴款凭证序号 + */ + private String voucherNo; + /** + * 首次打印时间 + */ + private String firstPrintDate; + /** + * 纳税人识别号 + */ + private String taxCode; + /** + * 纳税人名称 + */ + private String taxAgentName; + /** + * 税务机关代码 + */ + 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 { + /** + * 扣款反馈代码 + */ + private String paymentCode; + /** + * 扣款名称 + */ + 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..6338da065 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -0,0 +1,47 @@ +package com.engine.salary.entity.taxpayment.param; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 查询企业三方信息 + * + * @author chengliming + * @date: 2022-12-06 17:25:28 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("查询企业三方信息") +public class TaxPaymentQueryParam { + + //个税扣缴义务人id") + private Long taxAgentId; + + //税款所属期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxYearMonth; + + //个税申报记录id") + private Long taxDeclareRecordId; + + /** + * TaxPaymentServiceTypeEnum + */ + //业务类型") + private Integer type; + + //三方协议号") + private String protocolNumber; + + //应缴税额") + private String taxAmount; + + //是否为反馈校验 0否 1是") + private Integer checkFeedback; +} 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..48c2a0973 --- /dev/null +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -0,0 +1,106 @@ +package com.engine.salary.entity.taxpayment.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-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; + + /** + * 个税扣缴义务人的主键id + */ + //个税扣缴义务人的主键id") + private Long taxAgentId; + + /** + * 个税申报记录ID + */ + //个税申报记录id") + private Long taxDeclareRecordId; + + /** + * 税款所属期 + */ + //税款所属期") + private Date taxYearMonth; + + /** + * 异步请求ID + */ + //异步请求ID") + private String requestId; + + + /** + * 请求类型 + * + * com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + */ + //异步请求ID") + private Integer requestType; + + /** + * 是否已获取反馈 + * + * com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + */ + //是否已获取反馈") + private Integer feedback; + + /** + * 租户key + */ + //租户key", ignore = true) + private String tenantKey; + + /** + * 创建人id + */ + //创建人id", 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; + /** + * 银行行别代码 + **/ + private String yhhbdm; + /** + * 银行行别名称 + **/ + private String yhhbmc; + /** + * 银行营业网点代码 + **/ + 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; + /** + * 扣款失败原因 + */ + 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; + + /** + * 扣款状态 0:扣款成功:1:信息校验失败;2:无欠费记录;3:扣款失败 + **/ + private String jkzt; + + /** + * 扣款失败原因 + **/ + private String jksbyy; + + /** + * 扣款详情列表 + **/ + private List kkfhlb; + } + + @Data + public static class Detail { + /** + * 扣款反馈代码 + */ + private String kkfhDm; + /** + * 扣款名称 + */ + 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 { + /** + * 申报类型代码 + */ + private String sblxdm; + /** + * 申报类型名称 + */ + private String sblxmc; + /** + * 缴款凭证序号 + */ + private String jkpzxh; + /** + * 首次打印时间 + */ + private String dysj; + /** + * 纳税人识别号 + */ + private String nsrsbh; + /** + * 纳税人名称 + */ + private String nsrxm; + /** + * 税务机关代码 + */ + 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 { + /** + * 扣款反馈代码 + */ + private String zsxmmc; + /** + * 扣款名称 + */ + 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 7afb5aab0..e16f8721b 100644 --- a/src/com/engine/salary/enums/SalaryOnOffEnum.java +++ b/src/com/engine/salary/enums/SalaryOnOffEnum.java @@ -1,14 +1,16 @@ package com.engine.salary.enums; +import java.util.Objects; /** - * @description: 是、否 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 10/28/21 5:50 PM - * @version:v1.0 - */ + * 是、否 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryOnOffEnum implements BaseEnum { ON(1, "是", 84967), @@ -40,4 +42,14 @@ public enum SalaryOnOffEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static SalaryOnOffEnum parseByValue(int value) { + for (SalaryOnOffEnum onOffEnum : SalaryOnOffEnum.values()) { + if (Objects.equals(onOffEnum.getValue(), value)) { + return onOffEnum; + } + } + return null; + } + } 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/employeedeclare/CardTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java new file mode 100644 index 000000000..a7f0de9d3 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/CardTypeEnum.java @@ -0,0 +1,43 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * 证件类型 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum CardTypeEnum implements BaseEnum { + + RESIDENT_IDENTITY_CARDS(0, "居民身份证", 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; + } +} 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..2a91aafde --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java @@ -0,0 +1,46 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * 人员报送状态 + *

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; + } +} 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..75a8901b6 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * 人员状态 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum EmploymentStatusEnum implements BaseEnum { + + NORMAL(0, "正常", 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; + } +} 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..609e7f8f8 --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -0,0 +1,47 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * 任职受雇从业类型 + *

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; + } +} 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..805afa7bd --- /dev/null +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -0,0 +1,44 @@ +package com.engine.salary.enums.employeedeclare; + +import com.engine.salary.enums.BaseEnum; + +/** + * 性别 + *

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; + } +} 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/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 6fc084f52..762b3e581 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,7 +1,12 @@ package com.engine.salary.enums.salarysob; import com.engine.salary.enums.BaseEnum; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.Objects; /** @@ -14,24 +19,34 @@ import java.util.Objects; **/ public enum IncomeCategoryEnum implements BaseEnum { - WAGES_AND_SALARIES(1, "正常工资薪金所得", 98656), - - REMUNERATION_FOR_LABOR(4, "劳务报酬所得", 105218), - - // 暂时注释掉,后续会开放 - ONETIME_ANNUAL_BONUS(2,"全年一次性奖金收入", 0) -// -// OTHER(11, "其他所得", 0), + // todo 多语言 + WAGES_AND_SALARIES(1, "0101", "正常工资薪金", 160487), + REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", 160488), + ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", 160489), + COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", 181936), + COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", 181937), + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", 181938), + ANNUITY_RECEIPT(110, "0110", "年金领取", 181939), + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", 181940), + INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", 181942), + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", 181943), + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", 175330), + REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", 181944), + ROYALTIES(600, "0600", "特许权使用费所得", 181945), ; + private int value; + private String code; + private String defaultLabel; private int labelId; - IncomeCategoryEnum(int value, String defaultLabel, int labelId) { + IncomeCategoryEnum(int value, String code, String defaultLabel, int labelId) { this.value = value; + this.code = code; this.defaultLabel = defaultLabel; this.labelId = labelId; } @@ -41,6 +56,10 @@ public enum IncomeCategoryEnum implements BaseEnum { return value; } + public String getCode() { + return code; + } + @Override public Integer getLabelId() { return labelId; @@ -51,6 +70,7 @@ public enum IncomeCategoryEnum implements BaseEnum { return defaultLabel; } + public static IncomeCategoryEnum parseByValue(Integer value) { for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) { if (Objects.equals(incomeCategoryEnum.getValue(), value)) { @@ -59,4 +79,19 @@ public enum IncomeCategoryEnum implements BaseEnum { } 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; + +/** + * 个人扣缴义务人-报税信息-验证类型 + * + * @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; + +/** + * 个人扣缴义务人-报税信息-密码校验类型 + * + * @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; + +/** + * 个人扣缴义务人-报税信息-验证状态 + * + * @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, "累计专项附加扣除", 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/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; + +/** + * 个税扣缴义务人范围 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxAgentRangeEnum implements BaseEnum { + + ALL_TAX_AGENT(1, "所有个税扣缴义务人", 107731), + ADMIN_TAX_AGENT(2, "作为管理员的个税扣缴义务人", 177858), + SELECT_TAX_AGENT(3, "选择个税扣缴义务人", 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, "正式地址", 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..27db64998 --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -0,0 +1,50 @@ +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 { + + 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, "正常申报", 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, "扣款成功", 0), + VERIFY_INFO_FAIL(1, "信息校验失败", 0), + DONT_NEED(2, "无欠费记录", 0), + FAIL(3, "扣款失败", 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/formlua/entity/parameter/ExcelFuncs.java b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java index 437d8376e..f770c4369 100644 --- a/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java +++ b/src/com/engine/salary/formlua/entity/parameter/ExcelFuncs.java @@ -6,280 +6,281 @@ 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; -@Component 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"}; - private FuncDescUtil funcDescUtil; - public List getCompList(){ - //比较操作符 - List compList=new LinkedList<>(); - ExcelFunc excelFunc=null; - String [] paramArray=new String[]{}; - excelFunc=new ExcelFunc(">",SalaryI18nUtil.getI18nLabel(12132,"大于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + 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"}; + private FuncDescUtil funcDescUtil; - excelFunc=new ExcelFunc(">=",SalaryI18nUtil.getI18nLabel(27694,"大于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + public List getCompList() { + //比较操作符 + 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(20009,"小于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc(">=", SalaryI18nUtil.getI18nLabel(27694, "大于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - excelFunc=new ExcelFunc("<=",SalaryI18nUtil.getI18nLabel(15251,"小于等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<", SalaryI18nUtil.getI18nLabel(20009, "小于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("=",SalaryI18nUtil.getI18nLabel(15112,"等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + excelFunc = new ExcelFunc("<=", SalaryI18nUtil.getI18nLabel(15251, "小于等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897,"不等于"), "","",paramArray,paramDatas,"Boolean",CURRENTDATA); - compList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("=", SalaryI18nUtil.getI18nLabel(15112, "等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - return compList; - } + paramArray = new String[]{}; + excelFunc = new ExcelFunc("!=", SalaryI18nUtil.getI18nLabel(14897, "不等于"), "", "", paramArray, paramDatas, "Boolean", CURRENTDATA); + compList.add(excelFunc); - /** - * 日期函数的列表 - * @return - */ - 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); - dateList.add(excelFunc); + return compList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("NOW",SalaryI18nUtil.getI18nLabel(94925,"当前日期时间"), funcDescUtil.get("NOW"),"NOW()",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); + /** + * 日期函数的列表 + * + * @return + */ + 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); + dateList.add(excelFunc); - 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("NOW", SalaryI18nUtil.getI18nLabel(94925, "当前日期时间"), funcDescUtil.get("NOW"), "NOW()", paramArray, nullParamDatas, "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); - dateList.add(excelFunc); + 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("DATEFORMAT",SalaryI18nUtil.getI18nLabel(94928,"返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"),"DATEFORMAT(日期, '可选格式')",paramArray,nullParamDatas,"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); + dateList.add(excelFunc); - paramArray=new String[]{}; - excelFunc=new ExcelFunc("YEAR",SalaryI18nUtil.getI18nLabel(94929,"返回日期中的年"), funcDescUtil.get("YEAR"),"YEAR(日期)",paramArray,nullParamDatas,"Number",CURRENTDATA); - dateList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("DATEFORMAT", SalaryI18nUtil.getI18nLabel(94928, "返回指定格式的日期"), funcDescUtil.get("DATEFORMAT"), "DATEFORMAT(日期, '可选格式')", paramArray, nullParamDatas, "String", CURRENTDATA); + dateList.add(excelFunc); - 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("YEAR", SalaryI18nUtil.getI18nLabel(94929, "返回日期中的年"), funcDescUtil.get("YEAR"), "YEAR(日期)", 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); - dateList.add(excelFunc); + 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("HOUR",SalaryI18nUtil.getI18nLabel(94932,"返回日期中的小时"), funcDescUtil.get("HOUR"),"HOUR(日期)",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); + dateList.add(excelFunc); - 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("HOUR", SalaryI18nUtil.getI18nLabel(94932, "返回日期中的小时"), funcDescUtil.get("HOUR"), "HOUR(日期)", 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); - dateList.add(excelFunc); + 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("WEEKNUM",SalaryI18nUtil.getI18nLabel(94936,"返回日期为第几周"), funcDescUtil.get("WEEKNUM"),"WEEKNUM(日期)",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); + dateList.add(excelFunc); - 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("WEEKNUM", SalaryI18nUtil.getI18nLabel(94936, "返回日期为第几周"), funcDescUtil.get("WEEKNUM"), "WEEKNUM(日期)", 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); - dateList.add(excelFunc); + 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("EOMONTH",SalaryI18nUtil.getI18nLabel(94939,"返回某月最后一天日期"), funcDescUtil.get("EOMONTH"),"EOMONTH(日期,指定日期之前或之后的月数)",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); + dateList.add(excelFunc); - 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("EOMONTH", SalaryI18nUtil.getI18nLabel(94939, "返回某月最后一天日期"), funcDescUtil.get("EOMONTH"), "EOMONTH(日期,指定日期之前或之后的月数)", paramArray, nullParamDatas, "Number", CURRENTDATA); + dateList.add(excelFunc); - 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("CURRYEAR", SalaryI18nUtil.getI18nLabel(101059, "返回当前年份"), funcDescUtil.get("CURRYEAR"), "CURRYEAR()", 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); - dateList.add(excelFunc); + 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("CURRWEEK",SalaryI18nUtil.getI18nLabel(101062,"返回当前是周几"), funcDescUtil.get("CURRWEEK"),"CURRWEEK()",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); + dateList.add(excelFunc); - 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("CURRWEEK", SalaryI18nUtil.getI18nLabel(101062, "返回当前是周几"), funcDescUtil.get("CURRWEEK"), "CURRWEEK()", 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); - dateList.add(excelFunc); + 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("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); - dateList.add(excelFunc); + 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("MINDATE",SalaryI18nUtil.getI18nLabel(100805,"返回一组日期中的最小值"), funcDescUtil.get("MINDATE"),"MINDATE(日期1,日期2,……)",paramArray,nullParamDatas,"String",CURRENTDATA); - dateList.add(excelFunc); - return dateList; - } + 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); + dateList.add(excelFunc); - /** - * 逻辑函数的列表 - * @return - */ - 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); - logicList.add(excelFunc); + 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; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("AND",SalaryI18nUtil.getI18nLabel(51100,"且"), funcDescUtil.get("AND"),"AND(条件1, 条件2, [条件3, …])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + /** + * 逻辑函数的列表 + * + * @return + */ + 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); + logicList.add(excelFunc); - 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("AND", SalaryI18nUtil.getI18nLabel(51100, "且"), funcDescUtil.get("AND"), "AND(条件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); - logicList.add(excelFunc); + 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("IN",SalaryI18nUtil.getI18nLabel(94943,"变量是否包含在一组结果中"), funcDescUtil.get("IN"),"IN(变量, [变量1, 变量2, …])",paramArray,allParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); + 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("LIKE",SalaryI18nUtil.getI18nLabel(94944,"文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"),"LIKE(文本, [文本1, 文本2, …])",paramArray,allParamDatas,"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); + logicList.add(excelFunc); - 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("LIKE", SalaryI18nUtil.getI18nLabel(94944, "文本是否包含任意一个关键字"), funcDescUtil.get("LIKE"), "LIKE(文本, [文本1, 文本2, …])", paramArray, allParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - 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("ISEMPTY", SalaryI18nUtil.getI18nLabel(94945, "是否为空"), funcDescUtil.get("ISEMPTY"), "ISEMPTY(变量)", paramArray, paramDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); - 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("TRUE", SalaryI18nUtil.getI18nLabel(94946, "返回真"), funcDescUtil.get("TRUE"), "TRUE()", 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); - logicList.add(excelFunc); + 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("FIND",SalaryI18nUtil.getI18nLabel(31835,"查找"), funcDescUtil.get("FIND"),"FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])",paramArray,nullParamDatas,"Boolean",CURRENTDATA); - logicList.add(excelFunc); - return logicList; - } + 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); - /** - * 字符函数的列表 - * @return - */ - 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); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("FIND", SalaryI18nUtil.getI18nLabel(31835, "查找"), funcDescUtil.get("FIND"), "FIND([{查找值1},{查找值2}...{查找值N}],[{查找目标1},{查找目标2}...{查找目标N}])", paramArray, nullParamDatas, "Boolean", CURRENTDATA); + logicList.add(excelFunc); + return logicList; + } - paramArray=new String[]{}; - excelFunc=new ExcelFunc("TEXT",SalaryI18nUtil.getI18nLabel(94950,"将变量转为文本"), funcDescUtil.get("TEXT"),"TEXT(变量)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + /** + * 字符函数的列表 + * + * @return + */ + 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); + stringList.add(excelFunc); - 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("TEXT", SalaryI18nUtil.getI18nLabel(94950, "将变量转为文本"), funcDescUtil.get("TEXT"), "TEXT(变量)", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); - 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("VALUE", SalaryI18nUtil.getI18nLabel(94951, "将文本转为数字"), funcDescUtil.get("VALUE"), "VALUE(文本)", 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); - stringList.add(excelFunc); + 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("REPLACE",SalaryI18nUtil.getI18nLabel(94954,"替换文本中的字"), funcDescUtil.get("REPLACE"),"REPLACE(原文本, 替换开始位置, 替换字符数, 新文本)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + 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("REPT",SalaryI18nUtil.getI18nLabel(94955,"将文本重复指定次数"), funcDescUtil.get("REPT"),"REPT(文本, 重复次数)",paramArray,nullParamDatas,"String",CURRENTDATA); - stringList.add(excelFunc); + 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("PAD",SalaryI18nUtil.getI18nLabel(94956,"将文本填充至指定长度"), funcDescUtil.get("PAD"),"PAD(原文本, 长度, 填充用的文本, ['填充位置'])",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); + stringList.add(excelFunc); - 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("PAD", SalaryI18nUtil.getI18nLabel(94956, "将文本填充至指定长度"), funcDescUtil.get("PAD"), "PAD(原文本, 长度, 填充用的文本, ['填充位置'])", 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); - stringList.add(excelFunc); + 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("RIGHT",SalaryI18nUtil.getI18nLabel(94959,"返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"),"RIGHT(文本, 截取字符数)",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); + stringList.add(excelFunc); - 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("RIGHT", SalaryI18nUtil.getI18nLabel(94959, "返回文本右侧开始的文字"), funcDescUtil.get("RIGHT"), "RIGHT(文本, 截取字符数)", 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); - stringList.add(excelFunc); + 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("IDCARD",SalaryI18nUtil.getI18nLabel(94962,"身份证函数"), funcDescUtil.get("IDCARD"),"IDCARD({身份证号码}, {查找类型})",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); + stringList.add(excelFunc); + + 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); - stringList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISSTRING", SalaryI18nUtil.getI18nLabel(0, "是否是字符串"), funcDescUtil.get("ISSTRING"), "ISSTRING({任意控件})", paramArray, nullParamDatas, "String", CURRENTDATA); + stringList.add(excelFunc); // paramArray=new String[]{}; // excelFunc=new ExcelFunc("SUBSTRING",SalaryI18nUtil.getI18nLabel(97524,"字符截取函数"), funcDescUtil.get("SUBSTRING"),"SUBSTRING({源字符}, {截取开始位置},{截取结束位置})",paramArray,nullParamDatas,"String",CURRENTDATA); @@ -296,123 +297,129 @@ public class ExcelFuncs { // paramArray=new String[]{}; // excelFunc=new ExcelFunc("EXACT",SalaryI18nUtil.getI18nLabel(97528,"字符比较函数"), funcDescUtil.get("EXACT"),"EXACT({字符1}, {字符2})",paramArray,nullParamDatas,"String",CURRENTDATA); // stringList.add(excelFunc); - return stringList; - } + return stringList; + } - /** - * 数学函数的列表 - * @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); - mathList.add(excelFunc); + /** + * 数学函数的列表 + * + * @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); + mathList.add(excelFunc); - 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("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); - mathList.add(excelFunc); + 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); - mathList.add(excelFunc); + 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); - mathList.add(excelFunc); + 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); - mathList.add(excelFunc); + 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); - mathList.add(excelFunc); + 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); - mathList.add(excelFunc); + paramArray = new String[]{}; + excelFunc = new ExcelFunc("ISNUMBER", SalaryI18nUtil.getI18nLabel(0, "字符内容是否是数字"), funcDescUtil.get("ISNUMBER"), "ISNUMBER({字符})", paramArray, nullParamDatas, "String", CURRENTDATA); + mathList.add(excelFunc); - return mathList; + return mathList; - } + } - /** - * 查找函数的列表 - * @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); - findList.add(excelFunc); + /** + * 查找函数的列表 + * + * @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); + findList.add(excelFunc); - 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("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); - findList.add(excelFunc); - return findList; - } + 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; + /** + * 聚合函数 COUNT(表格, [统计条件]) + * + * @return + */ + 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); - aggList.add(excelFunc); + 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); - aggList.add(excelFunc); + 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); - aggList.add(excelFunc); + 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); - aggList.add(excelFunc); + 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); - aggList.add(excelFunc); - return aggList; - } + 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(){ - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); - excelFunc = new ExcelFunc("GETMONEY",SalaryI18nUtil.getI18nLabel(0,"获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"),"GETMONEY({数字})",null,nullParamDatas,"",CURRENTDATA); - funcs.add(excelFunc); + /** + * 财务类函数列表 + * + * @return + */ + public Object getFinanceList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); + excelFunc = new ExcelFunc("GETMONEY", SalaryI18nUtil.getI18nLabel(0, "获取锁给定数字的金额大写"), funcDescUtil.get("GETMONEY"), "GETMONEY({数字})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } - /** - * 数据库函数列表 - * @return - */ - public Object getDataBaseList() { - ExcelFunc excelFunc = null; - List funcs = Lists.newArrayList(); + return funcs; + } + + /** + * 数据库函数列表 + * + * @return + */ + public Object getDataBaseList() { + ExcelFunc excelFunc = null; + List funcs = Lists.newArrayList(); // excelFunc = new ExcelFunc("GETHRMLOGINID",SalaryI18nUtil.getI18nLabel(100807,"返回指定人员系统账号"), funcDescUtil.get("GETHRMLOGINID"),"GETHRMLOGINID({表单.人员})",null,nullParamDatas,"",CURRENTDATA); // funcs.add(excelFunc); @@ -456,12 +463,12 @@ 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); - funcs.add(excelFunc); + 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); - funcs.add(excelFunc); + excelFunc = new ExcelFunc("GETHRMMOBILE", SalaryI18nUtil.getI18nLabel(100833, "获取人员手机号码"), funcDescUtil.get("GETHRMMOBILE"), "GETHRMMOBILE({人员})", null, nullParamDatas, "", CURRENTDATA); + funcs.add(excelFunc); - return funcs; - } + return funcs; + } } diff --git a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java index d4e5fcee3..666135c26 100644 --- a/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java +++ b/src/com/engine/salary/formlua/entity/parameter/FuncDescUtil.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; -@Component + public class FuncDescUtil { protected final Logger logger = LoggerFactory.getLogger(FuncDescUtil.class); Map funcMap = new HashMap(); diff --git a/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java b/src/com/engine/salary/maintainer/datacollection/AddUpSituationManager.java index c65d02559..da05677cb 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).taxAgentId(po.getTaxAgentId()).build()); + getTaxDeclarationService().save(TaxDeclarationSaveParam.builder().salaryMonth(po.getSalaryMonth()).taxAgentId(po.getTaxAgentId()).build()); } catch (Exception e) { bb.writeLog("错误:" + e); result = false; 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 返回记录,没有返回null + */ + EmployeeDeclarePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param employeeDeclare 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(EmployeeDeclarePO employeeDeclare); + + + + /** + * 批量插入 + * + * @param employeeDeclare + */ + void batchInsert(@Param("collection") List employeeDeclare); + + /** + * 修改,修改所有字段 + * + * @param employeeDeclare 修改的记录 + * @return 返回影响行数 + */ + int update(EmployeeDeclarePO employeeDeclare); + + /** + * 修改,忽略null字段 + * + * @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..e137ec1ab --- /dev/null +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -0,0 +1,918 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.tax_agent_id + , t.tax_cycle + , t.employee_id + , t.employee_type + , t.employee_name + , t.job_num + , 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.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 + + + + + + + + + + + + + + + INSERT INTO hrsa_employee_declare + + + + id, + + + tax_agent_id, + + + tax_cycle, + + + employee_id, + + + employee_type, + + + employee_name, + + + job_num, + + + card_type, + + + card_num, + + + gender, + + + birthday, + + + employment_status, + + + mobile, + + + employment_type, + + + employment_first_year, + + + employment_date, + + + dismiss_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, + + + + + #{id}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{employeeId}, + + + #{employeeType}, + + + #{employeeName}, + + + #{jobNum}, + + + #{cardType}, + + + #{cardNum}, + + + #{gender}, + + + #{birthday}, + + + #{employmentStatus}, + + + #{mobile}, + + + #{employmentType}, + + + #{employmentFirstYear}, + + + #{employmentDate}, + + + #{dismissDate}, + + + #{disability}, + + + #{disabilityCardNo}, + + + #{lonelyOld}, + + + #{martyrDependents}, + + + #{martyrDependentsCardNo}, + + + #{deductExpenses}, + + + #{successfullyDeclared}, + + + #{newEmployeeInfo}, + + + #{declareStatus}, + + + #{declareErrorMsg}, + + + #{tenantKey}, + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + + + + + INSERT INTO hrsa_employee_declare + ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_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 + ) + VALUES + ( + + #{item.birthday}, + #{item.cardNum}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{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} + + ) + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_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 + ) + + + select + #{item.birthday,jdbcType=DATE}, + #{item.cardNum,jdbcType=VARCHAR}, + #{item.cardType,jdbcType=}, + #{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.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} + from dual + + + + + + + INSERT INTO hrsa_employee_declare ( + birthday, + card_num, + card_type, + create_time, + creator, + declare_error_msg, + declare_status, + deduct_expenses, + delete_type, + disability, + disability_card_no, + dismiss_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 + ) + VALUES + ( + #{item.birthday}, + #{item.cardNum}, + #{item.cardType}, + #{item.createTime}, + #{item.creator}, + #{item.declareErrorMsg}, + #{item.declareStatus}, + #{item.deductExpenses}, + #{item.deleteType}, + #{item.disability}, + #{item.disabilityCardNo}, + #{item.dismissDate}, + #{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} + ) + + + + + + + UPDATE hrsa_employee_declare + + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + employee_name=#{employeeName}, + job_num=#{jobNum}, + 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}, + 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 + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + employee_name=#{employeeName}, + + + job_num=#{jobNum}, + + + 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}, + + + 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 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 返回记录,没有返回null + */ + EmployeeDeclareRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param employeeDeclareRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 批量插入 + * + * @param employeeDeclareRecord + */ + void batchInsert(@Param("collection") List employeeDeclareRecord); + + /** + * 修改,修改所有字段 + * + * @param employeeDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int update(EmployeeDeclareRecordPO employeeDeclareRecord); + + /** + * 修改,忽略null字段 + * + * @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/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index fcc53a473..794581fb9 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1139,6 +1139,7 @@ + @@ -1170,72 +1171,78 @@ 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_month IN + AND t.salary_month IN #{salaryMonth} - ORDER BY id DESC + ORDER BY t.id DESC diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java index 4b560b7c2..6b76b15f3 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; @@ -78,4 +79,12 @@ public interface SalaryAcctRecordMapper { void updateLockSalaryItemIds(SalaryAcctRecordPO salaryAcctRecord); List getBackCalcRecordByIds(@Param("collection") Set salaryAcctIds); + + + /** + * 获取核算记录和扣缴义务人对应关系 + * @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 4266b9277..b1abf055d 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml @@ -15,7 +15,8 @@ - + @@ -148,7 +149,7 @@ FROM hrsa_salary_acct_record t where delete_type = 0 - AND back_calc_status = 1 + AND back_calc_status = 1 AND id IN @@ -422,4 +423,24 @@ WHERE id = #{id} AND delete_type = 0 + + + \ 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 返回记录,没有返回null + */ + SalarySobAddUpRulePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param sobAddUpRule 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 批量插入 + * + * @param sobAddUpRule + */ + void batchInsert(@Param("collection") List sobAddUpRule); + + /** + * 修改,修改所有字段 + * + * @param sobAddUpRule 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobAddUpRulePO sobAddUpRule); + + /** + * 修改,忽略null字段 + * + * @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 ed7016175..9b5061794 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobItemMapper.xml @@ -15,6 +15,7 @@ + @@ -33,7 +34,8 @@ , 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 @@ -166,6 +168,7 @@ , t.pattern , t.value_type ,t.can_delete + ,t.salary_item_code ,h.item_hide FROM hrsa_salary_sob_item t LEFT JOIN hrsa_salary_item_hide h ON t.salary_item_id=h.salary_item_id and t.salary_sob_id = h.salary_sob_id @@ -382,7 +385,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) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code) VALUES ( @@ -400,13 +403,14 @@ #{item.canDelete}, #{item.roundingMode}, #{item.pattern}, - #{item.valueType} + #{item.valueType}, + #{item.salaryItemCode} ) 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) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code) select @@ -424,14 +428,15 @@ #{item.canDelete,jdbcType=INTEGER}, #{item.roundingMode,jdbcType=INTEGER}, #{item.pattern,jdbcType=INTEGER}, - #{item.valueType,jdbcType=INTEGER} + #{item.valueType,jdbcType=INTEGER}, + #{item.salaryItemCode,jdbcType=INTEGER} from dual 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) + sorted_index, description, create_time, update_time, creator, delete_type, tenant_key,can_delete,rounding_mode,pattern,value_type,salary_item_code) VALUES ( #{item.salarySobId}, @@ -448,7 +453,8 @@ #{item.canDelete}, #{item.roundingMode}, #{item.pattern}, - #{item.valueType} + #{item.valueType}, + #{item.salaryItemCode} ) 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 返回记录,没有返回null + */ + SalarySobTaxReportRulePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param sobTaxReportRule 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 批量插入 + * + * @param sobTaxReportRule + */ + void batchInsert(@Param("collection") List sobTaxReportRule); + + /** + * 修改,修改所有字段 + * + * @param sobTaxReportRule 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobTaxReportRulePO sobTaxReportRule); + + /** + * 修改,忽略null字段 + * + * @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/taxagent/TaxAgentMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java index 8a2155271..cae7bcb7e 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.java @@ -69,4 +69,10 @@ public interface TaxAgentMapper { List listEmployee(); + /** + * 查询包含删除状态的数据 + * @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 84e424805..2d9d361d5 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml @@ -238,5 +238,17 @@ where e.status not in (7) + \ 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; + +/** + * 个税扣缴义务人报税信息 + *

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 返回记录,没有返回null + */ + TaxAgentTaxReturnPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param TaxAgentTaxReturnPO 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,修改所有字段 + * + * @param TaxAgentTaxReturnPO 修改的记录 + * @return 返回影响行数 + */ + int update(TaxAgentTaxReturnPO TaxAgentTaxReturnPO); + + /** + * 修改,忽略null字段 + * + * @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..e5a86e57f --- /dev/null +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentTaxReturnMapper.xml @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 返回记录,没有返回null + */ + TaxDeclarationApiFlowWarnConfigPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowWarnConfig 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 批量插入 + * + * @param taxApiFlowWarnConfig + */ + void batchInsert(@Param("collection") List taxApiFlowWarnConfig); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowWarnConfig 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowWarnConfigPO taxApiFlowWarnConfig); + + /** + * 修改,忽略null字段 + * + * @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 返回记录,没有返回null + */ + TaxDeclarationApiFlowWarnReceiverPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowReceiver 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 批量插入 + * + * @param taxApiFlowReceiver + */ + void batchInsert(@Param("collection") List taxApiFlowReceiver); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowReceiver 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowWarnReceiverPO taxApiFlowReceiver); + + /** + * 修改,忽略null字段 + * + * @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 返回记录,没有返回null + */ + TaxDeclarationApiFlowRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxApiFlowRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 修改,修改所有字段 + * + * @param taxApiFlowRecord 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiFlowRecordPO taxApiFlowRecord); + + /** + * 修改,忽略null字段 + * + * @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 返回记录,没有返回null + */ + TaxDeclarationApiProfilePO getById(Long id); + + /** + * 新增,插入所有字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insert(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiProfile 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiProfile 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiProfilePO taxDeclareApiProfile); + + /** + * 修改,忽略null字段 + * + * @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 1810e8970..5b9a8e1cc 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 @@ -77,7 +79,7 @@ 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 ( @@ -91,13 +93,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 @@ -111,14 +114,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}, @@ -131,7 +135,8 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.incomeCategory} + #{item.incomeCategory}, + #{item.taxDeclareRecordId} ) @@ -147,4 +152,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..1515f916c --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -0,0 +1,123 @@ +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 返回记录,没有返回null + */ + TaxDeclarationValuePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclarationValue 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 批量插入 + * + * @param taxDeclarationValue + */ + void batchInsert(@Param("collection") List taxDeclarationValue); + + /** + * 修改,修改所有字段 + * + * @param taxDeclarationValue 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationValuePO taxDeclarationValue); + + /** + * 修改,忽略null字段 + * + * @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); + +} \ 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..dfcaecaf1 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -0,0 +1,431 @@ + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + 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, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxDeclareRecordId}, + + + #{taxDeclarationId}, + + + #{employeeType}, + + + #{employeeId}, + + + #{resultValueJson}, + + + + + + + + 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 + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson} + + ) + + + + + 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 + ) + + + 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} + 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 + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxDeclareRecordId}, + #{item.taxDeclarationId}, + #{item.employeeType}, + #{item.employeeId}, + #{item.resultValueJson} + ) + + + + + + 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}, + + 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}, + + + 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 返回记录,没有返回null + */ + TaxDeclarationApiConfigPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareApiConfig 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareApiConfig 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationApiConfigPO taxDeclareApiConfig); + + /** + * 修改,忽略null字段 + * + * @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 返回记录,没有返回null + */ + TaxDeclareFailPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareFail 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclareFailPO taxDeclareFail); + + /** + * 批量插入 + * + * @param taxDeclareFail + */ + void batchInsert(@Param("collection") List taxDeclareFail); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareFail 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclareFailPO taxDeclareFail); + + /** + * 修改,忽略null字段 + * + * @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 返回记录,没有返回null + */ + TaxDeclareRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxDeclareRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 批量插入 + * + * @param taxDeclareRecord + */ + void batchInsert(@Param("collection") List taxDeclareRecord); + + /** + * 修改,修改所有字段 + * + * @param taxDeclareRecord 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclareRecordPO taxDeclareRecord); + + /** + * 修改,忽略null字段 + * + * @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..7edc1e580 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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.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, + + + 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}, + + + #{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, + 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.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, + 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.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, + 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.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}, + 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}, + + + 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/TaxReportColumnMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java new file mode 100644 index 000000000..df8f8738a --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java @@ -0,0 +1,80 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface TaxReportColumnMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(TaxReportColumnPO taxReportColumn); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxReportColumnPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxReportColumn 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxReportColumnPO taxReportColumn); + + /** + * 批量插入 + * + * @param taxReportColumn + */ + void batchInsert(@Param("collection") List taxReportColumn); + + /** + * 修改,修改所有字段 + * + * @param taxReportColumn 修改的记录 + * @return 返回影响行数 + */ + int update(TaxReportColumnPO taxReportColumn); + + /** + * 修改,忽略null字段 + * + * @param taxReportColumn 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxReportColumnPO taxReportColumn); + + /** + * 删除记录 + * + * @param taxReportColumn 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxReportColumnPO taxReportColumn); + + /** + * 批量删除记录 + * + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ 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..1002208a0 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + INSERT INTO hrsa_tax_report_column + + + + id, + + + create_time, + + + 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, + + + + + #{id}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + #{taxReportType}, + + + #{incomeCategory}, + + + #{reportColumnName}, + + + #{reportColumnDataIndex}, + + + #{dataType}, + + + #{requestParamKey}, + + + #{reportColumnLabel}, + + + + + + + + INSERT INTO hrsa_tax_report_column + ( + id, + create_time, + 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 + ) + VALUES + ( + + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxReportType}, + #{item.incomeCategory}, + #{item.reportColumnName}, + #{item.reportColumnDataIndex}, + #{item.dataType}, + #{item.requestParamKey}, + #{item.reportColumnLabel} + + ) + + + + + INSERT INTO hrsa_tax_report_column ( + id, + create_time, + 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 + ) + + + 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.taxReportType,jdbcType=INTEGER}, + #{item.incomeCategory,jdbcType=INTEGER}, + #{item.reportColumnName,jdbcType=VARCHAR}, + #{item.reportColumnDataIndex,jdbcType=VARCHAR}, + #{item.dataType,jdbcType=VARCHAR}, + #{item.requestParamKey,jdbcType=VARCHAR}, + #{item.reportColumnLabel,jdbcType=INTEGER} + from dual + + + + + + + INSERT INTO hrsa_tax_report_column ( + id, + create_time, + 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 + ) + VALUES + ( + #{item.id}, + #{item.createTime}, + #{item.updateTime}, + #{item.creator}, + #{item.deleteType}, + #{item.tenantKey}, + #{item.taxReportType}, + #{item.incomeCategory}, + #{item.reportColumnName}, + #{item.reportColumnDataIndex}, + #{item.dataType}, + #{item.requestParamKey}, + #{item.reportColumnLabel} + ) + + + + + UPDATE hrsa_tax_report_column + + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + tax_report_type=#{taxReportType}, + income_category=#{incomeCategory}, + report_column_name=#{reportColumnName}, + report_column_data_index=#{reportColumnDataIndex}, + data_type=#{dataType}, + request_param_key=#{requestParamKey}, + report_column_label=#{reportColumnLabel}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_report_column + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + tax_report_type=#{taxReportType}, + + + income_category=#{incomeCategory}, + + + report_column_name=#{reportColumnName}, + + + report_column_data_index=#{reportColumnDataIndex}, + + + data_type=#{dataType}, + + + request_param_key=#{requestParamKey}, + + + report_column_label=#{reportColumnLabel}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_report_column + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_report_column + 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/taxpayment/TaxPaymentRequestMapper.java b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java new file mode 100644 index 000000000..6ec65e30f --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.java @@ -0,0 +1,86 @@ +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 返回记录,没有返回null + */ + TaxPaymentRequestPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param taxPaymentRequest 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 批量插入 + * + * @param taxPaymentRequest + */ + void batchInsert(@Param("collection") List taxPaymentRequest); + + /** + * 修改,修改所有字段 + * + * @param taxPaymentRequest 修改的记录 + * @return 返回影响行数 + */ + int update(TaxPaymentRequestPO taxPaymentRequest); + + /** + * 修改,忽略null字段 + * + * @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); + + void updateFeedbackByTaxDeclareRecordId(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..d1ca5dee2 --- /dev/null +++ b/src/com/engine/salary/mapper/taxpayment/TaxPaymentRequestMapper.xml @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + 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 + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{feedback}, + + + #{id}, + + + #{requestId}, + + + #{requestType}, + + + #{taxAgentId}, + + + #{taxDeclareRecordId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime} + + + + + + + + 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 + ) + 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} + + ) + + + + + 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 + ) + + + 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} + 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 + ) + 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} + ) + + + + + + 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}, + + 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}, + + + 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} + + + + UPDATE hrsa_tax_payment_request + + feedback=#{feedback} + + WHERE delete_type = 0 + AND tax_declare_record_id=#{taxDeclareRecordId} + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java index 6ba44dc79..528cfd8d9 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java @@ -120,7 +120,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/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..72e987d3c --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -0,0 +1,178 @@ +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.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 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); +} diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index ff5879c3f..8eef60d3e 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -15,6 +15,8 @@ import java.util.Map; public interface ExtEmpService { + List listAll(); + List list(ExtEmpQueryParam param); PageInfo listPage (ExtEmpQueryParam param); @@ -25,6 +27,8 @@ public interface ExtEmpService { void delete(Collection ids); + List getExtEmpByIds(List ids); + DataCollectionEmployee getEmployeeById(Long id); /** diff --git a/src/com/engine/salary/service/SalaryAcctEmployeeService.java b/src/com/engine/salary/service/SalaryAcctEmployeeService.java index 91bc0ec48..b3882c68c 100644 --- a/src/com/engine/salary/service/SalaryAcctEmployeeService.java +++ b/src/com/engine/salary/service/SalaryAcctEmployeeService.java @@ -124,6 +124,8 @@ public interface SalaryAcctEmployeeService { */ List listByParam(SalaryAcctEmployeeQueryParam queryParam); + List listByTaxCycleAndTaxAgentId(SalaryAcctEmployeeQueryParam queryParam); + /** * 根据薪资核算结果列表的列表查询条件查询薪资核算人员(分页) * diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 1ba3419bf..4e7c8eb2e 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -5,6 +5,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; @@ -207,4 +208,13 @@ public interface SalaryAcctRecordService { List listSome(SalaryAcctRecordPO po); + + /** + * 根据薪资核算记录id查询关联的个税扣缴义务人 + * + * @param salaryAcctRecordIds + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + } diff --git a/src/com/engine/salary/service/SalaryAcctTaxAgentService.java b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java new file mode 100644 index 000000000..be75f76bf --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctTaxAgentService.java @@ -0,0 +1,57 @@ +package com.engine.salary.service; + +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; + +import java.util.Collection; +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/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 1832d4772..d1bd2344a 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import java.util.Collection; import java.util.List; import java.util.Map; @@ -99,4 +100,12 @@ public interface SalaryEmployeeService { * @param formatDate */ Map getResignationMapByDate(String formatDate); + /** + * 根据人员id查询身份证 + * + * @param employeeIds + * @return + */ + Map mapByEmployeeIds(Collection employeeIds); + } 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 37197e51f..80d112a37 100644 --- a/src/com/engine/salary/service/SalarySobItemService.java +++ b/src/com/engine/salary/service/SalarySobItemService.java @@ -10,12 +10,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 { /** 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); + + /** + * 按薪资账套id删除 + * + * @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 2890f94b8..8dd73f1c4 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -250,4 +250,12 @@ public interface TaxAgentService { * @return */ Collection listEmployeeIdsInTaxAgent(Long taxAgentId); + + /** + * 查询包含删除状态的数据 + * + * @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; + +/** + * 个税扣缴义务人-报税信息service接口 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxAgentTaxReturnService { + /** + * 根据个税扣缴义务人id获取报税信息 + * + * @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..c43db36c9 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -0,0 +1,46 @@ +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); +} 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..15d6c81fd 100644 --- a/src/com/engine/salary/service/TaxDeclarationExcelService.java +++ b/src/com/engine/salary/service/TaxDeclarationExcelService.java @@ -1,5 +1,7 @@ package com.engine.salary.service; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** @@ -15,7 +17,32 @@ 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); } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 7537c1c06..4e7d0e3ce 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -50,4 +50,13 @@ public interface TaxDeclarationService { * @param taxDeclarationId */ void withDrawTaxDeclaration(Long taxDeclarationId); + + /** + * 删除个税申报表 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + void saveBatch(List taxDeclarations); } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java new file mode 100644 index 000000000..8ec154857 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -0,0 +1,67 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +/** + * 个税申报表明细 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface TaxDeclarationValueService { + + /** + * 查询个税申报表明细 + * + * @param taxDeclarationIds + * @return + */ + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam,Collection taxDeclarationIds); + + /** + * 查询个税申报表明细 + * + * @param taxDeclarationIds + * @return + */ + List listByTaxDeclarationIds(Collection taxDeclarationIds); + + /** + * 查询个税申报表明细 + * + * @param taxDeclarationIds + * @return + */ + List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds); + + /** + * 个税申报表明细列表 + * + * @param taxDeclarationValues + * @return + */ + TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues); + + /** + * 批量保存 + * + * @param taxDeclarationValues + */ + void batchSave(List taxDeclarationValues); + + /** + * 删除个税申报表明细 + * + * @param taxDeclareRecordIds + */ + void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); +} 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); + + /** + * 转换成数据异常人员dto + * + * @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); + + /** + * 转换成申报失败数据dto + * + * @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..c21ad68a7 --- /dev/null +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -0,0 +1,171 @@ +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.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 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); + + /** + * 根据个税扣缴义务人id、税款所属期查询个税申报记录 + * + * @param taxAgentIds + * @param taxCycle + * @return + */ + List listByTaxCycleAndTaxAgentIds(Date taxCycle, Collection taxAgentIds); + + /** + * 根据个税扣缴义务人id、薪资所属月查询个税申报记录 + * + * @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); + + /** + * 个税申报获取反馈 + * + * @param id + */ + void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); + + /** + * 作废 + * + * @param id + */ + void cancelDeclare(Long id); + + /** + * 获取作废反馈 + * + * @param id + */ + void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate); + + /** + * 更正申报 + * + * @param id + */ + void updateDeclare(Long id); + + /** + * 税局端申报状态查询 + * + * @param id + */ + String queryDeclareStatus(Long id); + + /** + * 税局端申报明细查询 + * + * @param id + */ + String queryCompanyIncomes(Long id); + + void updateById(TaxDeclareRecordPO taxDeclareRecord); + +} 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 { + /** + * 查询外部接口(异步接口) + * + * @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..c9f466e14 --- /dev/null +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -0,0 +1,32 @@ +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 incomeCategory + * @return + */ + List listByIncomeCategory(IncomeCategoryEnum incomeCategory); +} 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..296100b7a --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxAgentTaxReturnCheckService.java @@ -0,0 +1,205 @@ +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.service.TaxAgentService; +import com.engine.salary.service.TaxAgentTaxReturnCheckService; +import com.engine.salary.service.TaxAgentTaxReturnService; +import com.engine.salary.service.TaxDeclarationApiConfigService; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +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); + } + + /** + * 获取验证类型 + * + * @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())) { + po.setCheckStatus(TaxAgentTaxReturnStatusEnum.FAIL.getValue()); + po.setFailReason(response.getHead().getMsg()); + return new ArrayList<>(); + } + // 如果税友返回验证信息 + 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 getCompanyRegisterInfoResponse(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO taxAgentTaxReturnPO, TaxAgentTaxReturnSaveParam saveParam) { + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxAgentTaxReturnPO.getTaxAgentId()); + if (taxAgentPO == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.GET_REGISTER_INFO_URL; + 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()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + 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("getCompanyRegisterInfo === res : {}", res); + return JsonUtil.parseBean(res, CompanyRegisterInfoResponse.class); + } + + 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, "个税扣缴义务人不存在")); + } + String url = apiConfig.getHost() + SzyhApiConstant.CHECK_PASSWORD_URL; + 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()); + } + String reqJson = JsonUtil.toJsonString(requestParam); + 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("checkPassword === res : {}", res); + return JsonUtil.parseObject(res, CheckPasswordResponse.class); + } + + /** + * 检查校验密码接口数据 + * + * @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..dfb4be9c4 --- /dev/null +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -0,0 +1,322 @@ +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.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.MapperProxyFactory; +import dm.jdbc.util.IdGenerator; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import weaver.hrm.User; + +import java.math.BigDecimal; +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 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, "个税扣缴义务人不存在")); + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + SalaryAssert.notNull(taxDeclareRecord, "申报表不存在"); + return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord); + } + + @Transactional(rollbackFor = Exception.class) + 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.QuerySpecialAmountBody::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()) + .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()) + .build(); + getTaxPaymentRequestMapper().insertIgnoreNull(paymentRequestPO); + } + return requestId; + } + + protected TaxPaymentRequestPO getTaxPaymentRequestPO(TaxPaymentQueryParam param) { + List paymentRequests = getTaxPaymentRequestMapper().listSome(TaxPaymentRequestPO + .builder() + .taxAgentId(param.getTaxAgentId()) + .taxYearMonth(param.getTaxYearMonth()) + .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()) + .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, "个税扣缴义务人不存在")); + 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, "个税申报记录不存在"); + if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("当前申报状态不是[申报成功,未缴费],暂时无法获取"); + } + if (taxDeclareRecord.getTaxPayAmount() == null || taxDeclareRecord.getPersonNum() == null) { + throw new SalaryRunTimeException("未获取到应缴信息,请先进行个税在线申报"); + } + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + SalaryAssert.notNull(taxAgentPO, "个税扣缴义务人不存在"); + + return TaxAmountFormDTO.builder() + .taxAgent(taxAgentPO.getName()) + .amount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPayAmount())) + .personNum(taxDeclareRecord.getPersonNum().toString()) + .build(); + } + + protected TaxDeclareRecordPO updateTaxDeclareRecord(TaxPaymentQueryParam param, BigDecimal totalPaid) { + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId()); + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) { + throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态"); + } + BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); + BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); + if (SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()).equals(totalPaid) + && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) { + throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态"); + } + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue()); + taxDeclareRecord.setTaxPaidAmount(totalPaid.toString()); + taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString()); + taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); + taxDeclareRecord.setUpdateTime(new Date()); + getTaxDeclareRecordService(user).updateById(taxDeclareRecord); + // 填充回去后续返回数据用 + taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString()); + return taxDeclareRecord; + } + + @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/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index e4965928c..5a81ad857 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -1150,6 +1150,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { + list = encryptUtil.encryptList(list,AddUpSituation.class); List> partition = Lists.partition(list, 50); partition.forEach(getAddUpSituationMapper()::insertData); } diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index a3e279fec..f5557d517 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -375,7 +375,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa } // todo 记录日志 -// recordLog(attendQuote, currentEmployeeId, currentTenantKey, null); +// recordLog(attendQuote, null); return null; } @@ -890,13 +890,13 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa // * @param currentTenantKey // * @param clientIp // */ -// private void recordLog(AttendQuotePO attendQuote, Long currentEmployeeId, String currentTenantKey, String clientIp) { +// private void recordLog(AttendQuotePO attendQuote, String clientIp) { // List salarySobs = new LambdaQueryChainWrapper<>(getSalarySobMapper()) // .eq(SalarySobPO::getTenantKey, TenantContext.getCurrentTenantKey()) // .eq(SalarySobPO::getDeleteType, 0) // .eq(SalarySobPO::getId, attendQuote.getSalarySobId()) // .list(); -// String sourceType = AttendQuoteSourceTypeEnum.getDefaultLabelByValue(attendQuote.getSourceType(), currentEmployeeId, currentTenantKey); +// String sourceType = AttendQuoteSourceTypeEnum.getDefaultLabelByValue(attendQuote.getSourceType()); // // LoggerContext loggerContext = new LoggerContext(); // loggerContext.setTargetId(String.valueOf(attendQuote.getId())); 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..f50a2d337 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -0,0 +1,706 @@ +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.salary.common.LocalDateRange; +import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO; +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.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.SalaryCycleTypeEnum; +import com.engine.salary.enums.SalaryOnOffEnum; +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.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.SalaryCardUtil; +import com.engine.salary.util.valid.ValidUtil; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +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 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.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); + employeeDeclare.setCardNum(saveParam.getCardNum()); + employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()); + employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))); + 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.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(""); + 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.setTargetId(Util.null2String(saveParam.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setNewValues(employeeDeclare); +// 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.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared()); + employeeDeclare.setUpdateTime(now); + // 判断本次编辑是否有修改人员信息 + if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) { + employeeDeclare.setNewEmployeeInfo(1); + } + getEmployeeDeclareMapper().updateIgnoreNull(employeeDeclare); + // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156444, "编辑报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setOldValues(originEmployeeDeclare); +// loggerContext.setNewValues(employeeDeclare); +// 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()); + // 记录日志 +// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(Util.null2String(employeeDeclare.getTaxAgentId())); +// loggerContext.setTargetName(employeeDeclare.getEmployeeName()); +// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156445, "删除报送人员:") + employeeDeclare.getEmployeeName()); +// loggerContext.setNewValues(employeeDeclare); +// employeeDeclareLoggerTemplate.write(loggerContext); +// } + } + + @Override + public List convert(List employeeDeclares) { + if (CollectionUtils.isEmpty(employeeDeclares)) { + return Collections.emptyList(); + } + + // 查询个税扣缴义务人 + 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 + @Transactional(rollbackFor = Exception.class) + 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.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) + && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) + .collect(Collectors.toList()); + // 查询个税扣缴义务人 + 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; + } + // 查询薪资档案的发薪人员 + LocalDateRange salaryCycleRange = LocalDateRange.builder().fromDate(salaryCycle).endDate(SalaryDateUtil.localDateToDate(SalaryDateUtil.localDate2YearMonth(salaryCycle).atEndOfMonth())).build(); + List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salaryCycleRange, Collections.emptyList(), 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) +// .setEmployeeInfos(employeeInfos) + .setHrmEmployeeComInfos(employeeInfos); +// .setSimpleUserInfos(newSimpleUserInfos) +// .setExtEmployees(newExtEmployees) + EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId); + // 保存新增的人员 + if (CollectionUtils.isNotEmpty(result.getNewEmployeeDeclares())) { + result.getNewEmployeeDeclares().forEach(getEmployeeDeclareMapper()::insertIgnoreNull); +// getEmployeeDeclareMapper().batchInsert((result.getNewEmployeeDeclares())); + } + // 更新已有人员 + if (CollectionUtils.isNotEmpty(result.getEmployeeDeclares())) { + result.getEmployeeDeclares().forEach(getEmployeeDeclareMapper()::updateIgnoreNull); +// updateBatchById(result.getEmployeeDeclares()); + } +// // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156447, "刷新数据")); +// 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); + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId()); + // 查询个税扣缴义务人关联的企业信息 + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId()); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); + } + // 查询需要报送的人员 + 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); + 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.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); +// employeeDeclareLoggerTemplate.write(loggerContext); + } + + @Override + public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate) { + // 获取api配置信息 + TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); + // 查询个税扣缴义务人 + 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); + 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)) { + //todo + needUpdateEmployeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull); +// updateBatchById(needUpdateEmployeeDeclares); + } + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 记录日志 +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString()); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈")); +// 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()))); + } + } +} diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 1b550bb71..fe7671522 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -68,6 +68,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()); @@ -131,6 +136,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); diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 391289aaa..c9cdcf7e6 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -207,13 +207,18 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct @Override public List listByParam(SalaryAcctEmployeeQueryParam queryParam) { - ValidUtil.doValidator(queryParam); +// ValidUtil.doValidator(queryParam); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); 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); diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 459873c3e..9b4b123f6 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -11,6 +11,7 @@ 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.enums.salaryaccounting.SalaryAcctRecordStatusEnum; @@ -102,6 +103,15 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user); } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + @Override public SalaryAcctRecordPO getById(Long id) { @@ -328,33 +338,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 获取个税申报功能状态 TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); - -// if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) { -// // 关闭了个税申报功能 -// // 如果某个月(薪资所属期)还未归档,不可以新建之后月份的薪资核算 -// 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}的薪资核算结果还未归档,不能新建薪资所属期{1}的薪资核算") -// .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) -// .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); -// } -// // 如果有某个月(薪资所属期)已经归档了,不可以新建之前月份的薪资核算 -// SalaryAcctRecordPO havaSalaryAcctRecordPO = salaryAcctRecords.stream() -// .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) -// && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) -// .findAny() -// .orElse(null); -// if (Objects.nonNull(havaSalaryAcctRecordPO)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98755, "薪资所属期{0}的薪资核算结果已经归档,不能新建薪资所属期{1}的薪资核算") -// .replace("{0}", SalaryDateUtil.localDate2YearMonth(havaSalaryAcctRecordPO.getSalaryMonth()).toString()) -// .replace("{1}", salarySobCycleDTO.getSalaryMonth().toString())); -// } -// -// } if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.OPEN.getValue())) { // 开启了个税申报功能 // 如果某个月(税款所属期)已经归档了,不可以新建之前月份的薪资核算 @@ -660,31 +643,34 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); } - // 保存回算前的薪资核算结果 + // 查询本次薪资核算记录关联的个税扣缴义务人 + 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) { - getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); + salaryAcctRecordPO.setBackCalcStatus(1); + salaryAcctRecordPO.setSuperId(salaryAcctRecordPO.getId()); + salaryAcctRecordPO.setRootId(Objects.equals(salaryAcctRecordPO.getRootId(), 0L) ? salaryAcctRecordPO.getId() : salaryAcctRecordPO.getRootId()); } - // 撤回工资单 - getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); - - // 重新核算或者回算时,若本次薪资核算记录已经申报了,则本次薪资核算记录下的所有个税扣缴义务人在相同税款所属期内的所有薪资核算记录的状态都应该从已申报变更为已归档 - // 过滤获取所在税款所属期内该个税扣缴义务人所有的薪资核算记录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 != null && needUpdateSalaryAcctRecordIds.size() > 0) { - // 更新薪资核算记录的状态 - updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); - } - // 删除个税申报表及往期累计情况 - getTaxDeclarationService(user).delete(salaryAcctRecordPO); - } - // 更新薪资核算记录的状态 salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); salaryAcctRecordPO.setUpdateTime(new Date()); getSalaryAcctRecordMapper().updateIgnoreNull(salaryAcctRecordPO); + // 保存回算前的薪资核算结果 + if (!isReCalc) { + getSalaryAcctResultService(user).reCalc(salaryAcctRecordPO.getId()); + } + + // 撤回工资单 + getSalarySendService(user).revokeSalaryBill(salaryAcctRecordPO); + //删除报表缓存 getSalaryStatisticsReportService(user).removeReportCache(); } @@ -806,4 +792,12 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public List listSome(SalaryAcctRecordPO po) { return getSalaryAcctRecordMapper().listSome(po); } + + @Override + public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { + if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { + return Collections.emptyList(); + } + return getSalaryAcctRecordMapper().listAcctTaxAgent(salaryAcctRecordIds); + } } 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..49acd5b52 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctTaxAgentServiceImpl.java @@ -0,0 +1,112 @@ +//package com.engine.salary.service.impl; +// +//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +//import com.baomidou.mybatisplus.core.toolkit.Wrappers; +//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +//import com.engine.core.impl.Service; +//import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO; +//import com.engine.salary.service.SalaryAcctTaxAgentService; +//import com.google.common.collect.Lists; +//import com.google.common.collect.Sets; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.common.hr.util.Util; +//import com.weaver.hrm.salary.common.YearMonthRange; +//import com.weaver.hrm.salary.dao.SalaryAcctTaxAgentMapper; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum; +//import org.apache.commons.collections4.CollectionUtils; +//import org.springframework.transaction.annotation.Transactional; +// +//import java.time.LocalDateTime; +//import java.util.*; +// +///** +// * @description: +// * @author: xiajun +// * @modified By: xiajun +// * @date: 2022/7/29 9:45 +// * @version:v1.0 +// */ +//public class SalaryAcctTaxAgentServiceImpl extends Service implements SalaryAcctTaxAgentService { +// +// private SalaryAcctTaxAgentMapper salaryAcctTaxAgentMapper; +// +// @Override +// public List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { +// return Collections.emptyList(); +// } +// return new LambdaQueryChainWrapper<>(salaryAcctTaxAgentMapper) +// .eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey) +// .eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()) +// .in(SalaryAcctTaxAgentPO::getSalaryAcctRecordId, salaryAcctRecordIds) +// .list(); +// } +// +// @Override +// public List listByTaxCycleRange(YearMonthRange taxCycleRange, String tenantKey) { +// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); +// queryWrapper.eq(SalaryAcctTaxAgentPO::getTenantKey, tenantKey); +// queryWrapper.eq(SalaryAcctTaxAgentPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue()); +// if (Objects.nonNull(taxCycleRange.getStartMonth())) { +// queryWrapper.ge(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getStartMonth().toString()); +// } +// if (Objects.nonNull(taxCycleRange.getEndMonth())) { +// queryWrapper.le(SalaryAcctTaxAgentPO::getTaxCycle, taxCycleRange.getEndMonth().toString()); +// } +// return salaryAcctTaxAgentMapper.selectList(queryWrapper); +// } +// +// @Override +// public List initBySalaryAcctEmployees(List salaryAcctEmployees, Long employeeId, String tenantKey) { +// 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 +// @Transactional(rollbackFor = Exception.class) +// public void batchSave(List salaryAcctTaxAgents, String tenantKey) { +// if (CollectionUtils.isNotEmpty(salaryAcctTaxAgents)) { +// saveBatch(salaryAcctTaxAgents); +// } +// } +// +// @Override +// public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds, String tenantKey) { +// if (CollectionUtils.isEmpty(salaryAcctRecordIds)) { +// return; +// } +// new LambdaUpdateChainWrapper<>(salaryAcctTaxAgentMapper) +// .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/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 72fe58f97..29530bfb3 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -598,7 +598,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(), currentEmployeeId, currentTenantKey)); +// boolean checkIncomeCategory = saveParam.getIncomeCategory() == null || StringUtils.isEmpty(SalaryArchiveBO.getIncomeCategoryByValue(saveParam.getIncomeCategory())); // if (checkIncomeCategory) { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(122085, "收入所得项目不能为空或不存在")); // } else { @@ -706,7 +706,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(), currentEmployeeId, currentTenantKey); +// List salaryArchiveSobSaveList = SalaryArchiveBO.buildSalaryArchiveSob(salaryArchive.getId(), salarySobIds, LocalDateTime.now()); // this.salaryArchiveSobService.saveBatchBySalaryArchiveIdsAndSaves(Collections.singletonList(salaryArchive.getId()), salaryArchiveSobSaveList, currentTenantKey); return StringUtils.EMPTY; diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 6f0f8fb55..1870e97d7 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -283,4 +283,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee List employeeList = employBiz.listByDismissDate(dismissDate); return SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getDismissdate); } + + @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; + } } diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 3affdd0e3..c3674c65d 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -71,7 +71,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz(); -// @Autowired +// // private LoggerTemplate salaryItemLoggerTemplate; @Override diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 94658397e..94c34f599 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1241,7 +1241,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // * @param salaryTemplate // * @param currentTenantKey // */ -// private void sendMessage(SalarySendPO salarySend, List> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName, Long currentEmployeeId, String currentTenantKey) { +// private void sendMessage(SalarySendPO salarySend, List> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName) { // if (StringUtils.isNotBlank(salaryTemplate.getBackground())) { // FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey); // String encode = Base64Encoder.encode(fileByte.getData()); @@ -1251,17 +1251,17 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // boolean isEmailOpen = salaryTemplate.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()); // // LocalDate salaryMonth = salarySend.getSalaryMonth(); -// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "年"); -// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "月"); +// String yearI18n = SalaryI18nUtil.getI18nLabel( 100325, "年"); +// String monthI18n = SalaryI18nUtil.getI18nLabel( 100326, "月"); // String text = salaryMonth.getYear() + // yearI18n + // salaryMonth.getMonth().getValue() + // monthI18n + -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100520, "工资待发明细"); +// SalaryI18nUtil.getI18nLabel( 100520, "工资待发明细"); // // UserEntity sendUser = null; // // 标题 -// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName, currentEmployeeId, currentTenantKey); +// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName); // // // 获取所有人员信息 // List ids = enableSendList.stream().map(e->Long.valueOf(e.get("employeeId").toString())).collect(Collectors.toList()); @@ -1278,7 +1278,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // // List receivers = Collections.singletonList( // SalarySendBO.buildUser(Long.valueOf(e.get("employeeId").toString()), e.get("email") == null ? "" : e.get("email").toString(), currentTenantKey)); -// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单")); +// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel( 94626, "工资单")); // EmailEntity emailInfo = new EmailEntity(); // // 邮箱打开 // if (isEmailOpen) { @@ -1348,8 +1348,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // SalaryLoggerUtil.recordUpdateSingleLog(salarySendLoggerTemplate, // salarySend.getId(), // salarySend.getSalaryMonth() + "-" + (CollectionUtils.isNotEmpty(salarySobs) ? salarySobs.get(0).getName() : ""), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"), +// SalaryI18nUtil.getI18nLabel( 100521, "撤回工资单发放"), +// SalaryI18nUtil.getI18nLabel( 100521, "撤回工资单发放"), // salarySend, // salarySendNew); 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..b1d74cf3b --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobAddUpRuleServiceImpl.java @@ -0,0 +1,174 @@ +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 dm.jdbc.util.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()); + 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) { + // 校验参数是否合法 + // 根据保存参数构建出po + Date now = new Date(); + List salarySobAddUpRulePOS = Lists.newArrayList(); + for (SalarySobAddUpRuleSaveParam.AddUpRuleIncomeCategoryParam incomeCategoryParam : saveParam.getIncomeCategoryParams()) { + for (SalarySobAddUpRuleSaveParam.AddUpRuleParam addUpRuleParam : incomeCategoryParam.getAddUpRuleParams()) { + SalarySobAddUpRulePO salarySobAddUpRulePO = new SalarySobAddUpRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(saveParam.getSalarySobId()) + .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) + .setSalaryItemId(addUpRuleParam.getSalaryItemId()) + .setAddUpColumnDataIndex(addUpRuleParam.getAddUpColumnDataIndex()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreator((long) user.getUID()) + .setCreateTime(now) + .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)); +// getSalarySobAddUpRuleMapper().batchInsert(salarySobAddUpRules); + } + } +} 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..d5414a8fe --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -0,0 +1,390 @@ +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.SalaryCycleTypeEnum; +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 dm.jdbc.util.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"); + } + // 因为薪资账套的「名称」支持了"小地球",所以在打开新建表单时,后端就会将id传给前端,所以新建保存的时候前端是会将id传给后端的 + // 当前端未将id传给后端时,后端自动生成一个id + 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.getTaxAgentId()) + .setName(saveParam.getName()) + .setIncomeCategory(saveParam.getTaxableItems()) + .setSalaryCycleType(saveParam.getSalaryCycleType()) + .setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay()) + .setTaxCycleType(SalaryCycleTypeEnum.THIS_MONTH.getValue()) + .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:默认的账套薪资项目分组id;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注解字段的name和账套薪资项目的code都是对应的,除了「addUpAdvanceTax」 + // 遍历AddUpSituationPO.class的SalaryFormulaVar.class注解,生成累计字段对应规则po + 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 (!declaredField.isAnnotationPresent(SalaryFormulaVar.class) || Objects.isNull(salarySobItem)) { + continue; + } + SalarySobAddUpRulePO salarySobAddUpRule = new SalarySobAddUpRulePO() + .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue().toString()) + .setSalaryItemId(salarySobItem.getSalaryItemId()) + .setAddUpColumnDataIndex(declaredField.getName()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .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() + .setId(IdGenerator.generate()) + .setSalarySobId(env.getSalarySob().getId()) + .setIncomeCategory(salarySobItem.getIncomeCategory()) + .setReportColumnDataIndex(taxReportColumn.getReportColumnDataIndex()) + .setSalaryItemId(salarySobItem.getSalaryItemId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) env.getCurrentUser().getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .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 169b54bb8..1dda1ac54 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -398,6 +398,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(salarySobItemGroupId) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) @@ -477,6 +478,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .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)) @@ -515,6 +517,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .id(itemParam.getId()) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(groupId) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) @@ -567,6 +570,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder() .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) + .salaryItemCode(salaryItemPO.getCode()) .salarySobItemGroupId(NumberUtils.LONG_ZERO) .formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO)) .sortedIndex(itemParam.getSortedIndex()) diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 0a851f5db..0e58c83e3 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -131,6 +131,10 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySobInitService getSalarySobInitService(User user) { + return ServiceUtil.getService(SalarySobInitServiceImpl.class, user); + } + @Override public SalarySobPO getById(Long id) { return salarySobMapper.getById(id); @@ -272,23 +276,26 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98403, "薪资账套名称已存在")); } - // 保存参数转换成薪资账套po - SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID()); - // 保存薪资账套 - salarySobMapper.insert(salarySobPO); - //todo 记录日志 -// LoggerContext loggerContext = new LoggerContext<>(); -// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); -// loggerContext.setTargetName(salarySobPO.getName()); -// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); -// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName()); -// loggerContext.setOldValues(salarySobPO); -// salarySobLoggerTemplate.write(loggerContext); - // 新建薪资账套时,保存默认的员工信息字段 - saveDefaultEmpField(salarySobPO); - // 新建薪资账套时,保存默认的薪资项目 - saveDefaultItem(salarySobPO); + SalarySobPO salarySobPO = getSalarySobInitService(user).init(saveParam); + + +// // 保存参数转换成薪资账套po +// SalarySobPO salarySobPO = SalarySobBO.convert2PO(saveParam, (long) user.getUID()); +// // 保存薪资账套 +// salarySobMapper.insert(salarySobPO); +// //todo 记录日志 +//// LoggerContext loggerContext = new LoggerContext<>(); +//// loggerContext.setTargetId(String.valueOf(salarySobPO.getId())); +//// loggerContext.setTargetName(salarySobPO.getName()); +//// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +//// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套")); +//// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98404, "新建薪资账套") + ": " + salarySobPO.getName()); +//// loggerContext.setOldValues(salarySobPO); +//// salarySobLoggerTemplate.write(loggerContext); +// // 新建薪资账套时,保存默认的员工信息字段 +// saveDefaultEmpField(salarySobPO); +// // 新建薪资账套时,保存默认的薪资项目 +// saveDefaultItem(salarySobPO); // 新建薪资账套时,保存默认的关联人员范围及从范围中排除 saveDefaultEmployeeRange(salarySobPO); // 返回薪资账套的主键id 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..27ba515c8 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobTaxReportRuleServiceImpl.java @@ -0,0 +1,172 @@ +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 dm.jdbc.util.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() + .setId(IdGenerator.generate()) + .setSalarySobId(saveParam.getSalarySobId()) + .setIncomeCategory(incomeCategoryParam.getIncomeCategory()) + .setReportColumnDataIndex(taxReportRuleParam.getReportColumnDataIndex()) + .setSalaryItemId(taxReportRuleParam.getSalaryItemId()) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .setCreator((long) user.getUID()) + .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .setCreateTime(now) + .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); +// salarySobTaxReportRuleMapper().batchInsert(salarySobTaxReportRules); + } +} diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 973391c8f..bc1b7ba26 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -105,8 +105,8 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate // SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate, // salaryTemplate.getId(), // salaryTemplateNew.getName(), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), -// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"), +// SalaryI18nUtil.getI18nLabel( 100534, "设为默认使用"), +// SalaryI18nUtil.getI18nLabel( 100534, "设为默认使用"), // salaryTemplate, // salaryTemplateNew); diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index d3cbc3999..ea7fb6fbb 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -798,5 +798,10 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); } + @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); + + // 获取个税扣缴义务人信息 + 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, "个税扣缴义务人")); + 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; + // 获取个税扣缴义务人信息 + 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; + // 当前租户的api接口配置 + 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..f307a95c8 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -0,0 +1,129 @@ +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.taxagent.response.SzyhResponseHead; +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.exception.SalaryRunTimeException; +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.*; + +/** + * 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); + } + if (StringUtils.isNotEmpty(config.getAppKey()) && StringUtils.isNotEmpty(config.getAppSecret())) { + QuerySpecialAmountFeedbackResponse response = getQuerySpecialAmountFeedbackResponse(config); + // 校验请求结果 + String responseCode = Optional.ofNullable(response).map(QuerySpecialAmountFeedbackResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + + if (SzyhApiConstant.ERROR_CODE.equals(responseCode) + || SzyhApiConstant.APP_DISABLED_CODE.equals(responseCode) + || SzyhApiConstant.APP_PAUSED_CODE.equals(responseCode)) { + throw new SalaryRunTimeException("账号密码错误或账号已停用"); + } + } + } + + 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..2a2e51fed --- /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 dm.jdbc.util.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(apiConfigPO.getTotality() - apiConfigPO.getRemain()) + .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::getTaxNumber).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.getTaxNumber(), 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, "个税扣缴义务人暂无报税信息")); + List taxAgentPOS = getTaxAgentService(user).listByIdsIncludeDel(Collections.singleton(taxReturnPO.getTaxAgentId())); + SalaryAssert.notEmpty(taxAgentPOS, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + 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, "个税扣缴义务人")); + 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, "个税扣缴义务人")); + 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..0dd420668 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -0,0 +1,316 @@ +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.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +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 + @Transactional(rollbackFor = Exception.class) + 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"); + + /** + * 发送Em消息 + * + * @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);// 创建人id + 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 957957790..8a7e8a3e3 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -1,32 +1,30 @@ package com.engine.salary.service.impl; +import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.annotation.SalaryTableColumn; -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.salarysob.IncomeCategoryEnum; -import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; -import com.engine.salary.service.TaxDeclarationDetailService; -import com.engine.salary.service.TaxDeclarationExcelService; -import com.engine.salary.service.TaxDeclarationService; +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.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelSheetData; import com.engine.salary.util.excel.ExcelUtil; -import com.engine.salary.util.page.PageInfo; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.general.Util; import weaver.hrm.User; import java.lang.reflect.Field; +import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Objects; /** * 个税申报表导出 @@ -39,101 +37,126 @@ import java.util.Objects; @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); + } + + @Override + 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.newArrayList(); + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + + // 解析表头 + for (WeaTableColumn column : taxDeclarationValueListDTO.getColumns()) { + headerList.add(column.getText()); + dataIndexList.add(column.getColumn()); + } + + rows.add(headerList); + // 解析表中数据 + 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, "个税申报表"); + + return ExcelUtil.genWorkbook(rows, sheetName); + } @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); //总页数 - // excel导出的数据 - List> rows = Lists.newArrayListWithExpectedSize(count); - List headerList = Lists.newArrayList(); - List dataIndexList = Lists.newArrayList(); - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) { - // 解析表头 - 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) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_LABOR.getValue())) { - // 解析表头 - 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) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - - if (Objects.equals(taxDeclarationPO.getIncomeCategory(), IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue())) { - // 解析表头 - 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) { - row.add(map.get(dataIndex)); - } - rows.add(row); - } - } - } - return ExcelUtil.genWorkbookV2(rows, sheetName); + 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); + // 转换成列表dto + 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); + // 转换成列表dto + 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())); + // 转换成列表dto + 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(); + 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; + } + /** * 解析表头 * @@ -142,14 +165,14 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar * @param dataIndexList * @param */ - private void parseHeader(Class clazz, List headerList, List dataIndexList) { + private void parseHeader(Class clazz, List headerList, List dataIndexList) { Field[] declaredFields = clazz.getDeclaredFields(); for (Field declaredField : declaredFields) { if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { continue; } SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(SalaryI18nUtil.getI18nLabel( annotation.labelId(), annotation.text())); + headerList.add(SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text())); dataIndexList.add(declaredField.getName()); } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 6f66a9b54..20ed01799 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -101,10 +101,10 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration TaxDeclarationPO po = TaxDeclarationPO.builder().build(); LocalDateRange localDateRange = new LocalDateRange(); if (Objects.nonNull(queryParam.getFromSalaryMonth())) { - localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1))); + localDateRange.setFromDate(queryParam.getFromSalaryMonth()); } if (Objects.nonNull(queryParam.getEndSalaryMonth())) { - localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth())); + localDateRange.setEndDate(SalaryDateUtil.localDateToDate(SalaryDateUtil.localDate2YearMonth(queryParam.getEndSalaryMonth()).atEndOfMonth())); } po.setSalaryMonths(localDateRange); @@ -178,7 +178,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); // 薪资所属月的日期范围 - 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, "薪资所属月参数错误")); } @@ -189,13 +189,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration if (CollectionUtils.isNotEmpty(taxDeclarationPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(107986, "{0}在{1}已经生成过个税申报表,不允许再次生成") .replace("{0}", taxAgentNameMap.get(taxDeclarationPOS.get(0).getTaxAgentId())) - .replace("{1}", saveParam.getSalaryMonth().toString())); + .replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资所属月的薪资核算记录 List salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build()); // 无薪资核算记录,不允许生成个税申报表 if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", saveParam.getSalaryMonth().toString())); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}无申报数据").replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资核算结果 List salaryAcctResultPOS = getSalaryAcctResultService(user) @@ -204,7 +204,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 无薪资核算结果,不允许生成个税申报表 if (CollectionUtils.isEmpty(salaryAcctResultPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}无可申报数据") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId); @@ -213,14 +213,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration boolean notArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); if (notArchived) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98875, "{0}有未归档数据,请全部归档后再申报") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 如果当前薪资所属月下存在不同的税款所属期,属于异常业务场景,不允许生成个税申报表 Date taxCycle = salaryAcctRecordPOS.get(0).getTaxCycle(); boolean differentTaxCycle = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> salaryAcctRecordPO.getTaxCycle().compareTo(taxCycle) != 0); if (differentTaxCycle) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98876, "{0}存在不同的税款所属期,无法正常生成个税申报表,请调整账套设置,重新核算后再生成个税申报表") - .replace("{0}", saveParam.getSalaryMonth().toString())); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 查询薪资账套 Set salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId); @@ -318,7 +318,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public void withDrawTaxDeclaration(Long taxDeclarationId) { TaxDeclarationPO po = getTaxDeclarationMapper().getById(taxDeclarationId); - if(Objects.isNull(po)){ + if (Objects.isNull(po)) { throw new SalaryRunTimeException("个税申报表不存在"); } // 获取当前个税扣缴义务人下的薪资账套 @@ -331,8 +331,30 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 删除个税申报表 getTaxDeclarationMapper().deleteByIdZj(po.getId()); // 修改薪资核算记录状态为已归档 - if(CollectionUtils.isNotEmpty(salaryAcctRecordIds)){ - getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds,SalaryAcctRecordStatusEnum.ARCHIVED); + if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + } + } + + @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); } } } 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..c2fe1eabc --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -0,0 +1,153 @@ +package com.engine.salary.service.impl; + +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +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.taxdeclaration.bo.TaxDeclarationValueList; +import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +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.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.service.*; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +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 TaxDeclarationValueServiceImpl extends Service implements TaxDeclarationValueService { + public EncryptUtil encryptUtil = new EncryptUtil(); + + 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); + } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + @Override + public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { + List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); + 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 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); + // 人员id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 查询报送的人员 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 查询人员信息 + List simpleEmployeeIds = taxDeclarationValues.stream() + .filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) + .map(TaxDeclarationValuePO::getEmployeeId) + .distinct() + .collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); + // 查询人员薪资(身份证号码等) + List simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(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, simpleUserInfos, extEmployees); + + 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); +// getTaxDeclarationValueMapper().batchInsert(subTaxDeclarationValues); + } + } + } + + @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(); + } + // 解密 + taxDeclarationValues = encryptUtil.decryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + taxDeclarationValues.forEach(salaryAcctResultValue -> { + salaryAcctResultValue.setResultValue(JsonUtil.parseMap(salaryAcctResultValue.getResultValueJson(), String.class)); + }); + return taxDeclarationValues; + } +} 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(); + } + // 查询个税扣缴义务人 + 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..6991bdeea --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -0,0 +1,1028 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.common.YearMonthRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.constant.SzyhApiConstant; +import com.engine.salary.entity.datacollection.AddUpSituation; +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.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.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +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.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +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.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.service.*; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +import com.engine.salary.util.*; +import com.engine.salary.util.db.MapperProxyFactory; +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 dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import weaver.general.Util; +import weaver.hrm.User; + +import java.math.BigDecimal; +import java.time.YearMonth; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 个税申报 + *

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 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 salaryAcctTaxAgentService; + + 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 TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user); + + +// 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()); + // 可见范围内的个税扣缴义务人 + 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); + 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(); + // 根据个税扣缴义务人范围查询个税扣缴义务人 + Collection taxAgents = queryByTaxAgentRange(saveParam); + Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); + // 查询薪资所属月下的薪资核算记录,并按照权限过滤 + 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中的个税扣缴义务人范围过滤 + 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()) { + // 薪资核算人员按照个税扣缴义务人id聚合分类 + 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(), TaxDeclareStatusEnum.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(TaxDeclareStatusEnum.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)) { + 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()); + } + } + + //更新核算记录状态 + getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); +// // 记录日志 +// for (TaxDeclareRecordPO taxDeclareRecord : newTaxDeclareRecords) { +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), StringUtils.EMPTY)) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(99815, "生成个税申报表")); +// loggerContext.setNewValues(taxDeclareRecord); +// taxDeclarationLoggerTemplate.write(loggerContext); +// } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void refreshData(Long id) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getById(id); + if (Objects.isNull(taxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除")); + } + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.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); + // 如果存在未归档的薪资核算记录,不允许生成个税申报表 + 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()); + } + } + } + + 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(); + // 如果存在未归档的薪资核算记录,不允许生成个税申报表 + 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}", saveParam.getSalaryMonth().toString())); + } + // 查询已归档的薪资核算记录 + 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()))); + } + // 查询已归档的薪资核算记录是否已经生成过个税申报表 + 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(), TaxDeclareStatusEnum.NOT_DECLARE.getValue()) || Objects.equals(taxDeclareRecordPO.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_FAIL.getValue()))).findAny().orElse(null); + // 已经申报成功了的个税申报表的个税扣缴义务人不允许重新生成 + if (Objects.nonNull(declareSuccessTaxDeclareRecord)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160522, "已开启智能算薪业务,个税扣缴义务人{0}的税款所属期{1}的个税申报表正在申报中或者已经申报成功,不可重复生成").replace("{0}", taxAgentNameMap.get(declareSuccessTaxDeclareRecord.getTaxAgentId())).replace("{1}", SalaryDateUtil.getFormatYearMonth(declareSuccessTaxDeclareRecord.getTaxCycle()))); + } + resultList.addAll(taxDeclareRecords); + } + return resultList; + } + + /** + * 根据个税扣缴义务人范围查询个税扣缴义务人 + * + * @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); +// // 可见范围内的个税扣缴义务人 +// 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(), TaxDeclareStatusEnum.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 -> { + // 获取当前个税扣缴义务人下的薪资账套 + 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.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgentNameMap.getOrDefault(taxDeclareRecord.getTaxAgentId(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY)) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156453, "删除个税申报表")); +// taxDeclarationLoggerTemplate.write(loggerContext); +// } +// } + + @Override + public void declare(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160526, "目前正处于申报中,请稍后片刻再点击「申报反馈」获取结果")); + } + if (StringUtils.isNotEmpty(taxDeclareRecord.getRequestId()) && Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160527, "目前正处于作废申报中,请稍后片刻再点击「作废反馈」获取结果")); + } + + // 查询个税申报表 + 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()); + + 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); + // 综合所得 + Map taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares); + requestParam.put("zhsd", taxDeclarationParam); + 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("个税申报返回数据: {} , taxDeclareRecord: {}", 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()); + } + // 更新个税申报记录 + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); + taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); + taxDeclareRecord.setUpdateTime(new Date()); + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + // 删除个税申报申报失败的数据 + getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); + + // 记录日志 +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156454, "在线申报")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void getDeclareFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (StringUtils.isEmpty(taxDeclareRecord.getRequestId()) || !Objects.equals(taxDeclareRecord.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", taxDeclareRecord.getRequestId(), "reportType", "1"); + Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.getRequest(url, header, requestParam); + log.info("申报反馈返回数据: {}, taxDeclareRecord: {}", res, JsonUtil.toJsonString(taxDeclareRecord)); + 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"), 0); + DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); + if (declareFeedBackStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); + } + // 查询报送的人员 + 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) { + String msg = Util.null2String(map.get("msg")); + if (StringUtils.isNotEmpty(msg)) { + errorMsg.add(msg); + } + List details = JsonUtil.parseList(map.get("details"), List.class); + for (List detail : details) { + String employeeName = Util.null2String(detail.get(0)); + String cardNum = Util.null2String(detail.get(2)); + String incomeCategoryCode = Util.null2String(detail.get(4)); + TaxDeclareFailPO taxDeclareFailPO = TaxDeclareFailPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecord.getId()).employeeName(employeeName).cardNum(cardNum).incomeCategory(incomeCategoryCode).errorMsg(msg).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); + } + } + taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); + } + // 申报状态 + Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); + if (taxDeclareStatusEnum == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "服务异常,接口返回数据有误")); + } + // 为处理异常情况,如果反馈状态为申报失败,则记录申报状态也为申报失败 + if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) { + taxDeclareStatusEnum = TaxDeclareStatusEnum.DECLARE_FAIL; + } + taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.getValue()); + // 申报类型 + taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); + taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + taxDeclareRecord.setRequestId(""); + taxDeclareRecord.setUpdateTime(new Date()); + BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); + BigDecimal payAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount()); + if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) { + // 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税 + if (purePaidAmount.compareTo(payAmount) > 0) { + taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + BigDecimal paidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()); + taxDeclarationRate.setMsg(String.format(SalaryI18nUtil.getI18nLabel(183789, "应缴税额(不含滞纳金等):%s元,已缴金额(可能含滞纳金等):%s元,当前已缴款金额大于应缴纳金额,请线下前往办税大厅办理退款。"), payAmount, paidAmount)); + taxDeclarationRate.setMsgPersist(true); + } else if (purePaidAmount.compareTo(payAmount) == 0) { + taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString()); + } else { + throw new SalaryRunTimeException("缴款数据异常,请处理后重试"); + } + } else if (TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.equals(taxDeclareStatusEnum)) { + // 如果不是已缴纳状态,则减掉之前的已缴纳金额去更新应缴纳金额 + taxDeclareRecord.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString()); + } + // 更新个税申报记录 + getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + // 如果申报失败 + 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, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(currentEmployeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156455, "申报反馈")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void cancelDeclare(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + // 更正申报成功后不能作废 + if (Objects.equals(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.UPDATE_DECLARE.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182701, "更正申报后不允许作废")); + } + // 只有申报成功,无需缴款/申报成功,未缴款的状态才能作废 + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue()) && !Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156497, "只有申报成功,无需缴款/申报成功,未缴款的状态才能作废")); + } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 注册的企业信息-->请求参数 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 申报类型 + requestParam.put("sblx", "1"); + // 作废银联缴款凭证 + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); + // 是否清空所得 + requestParam.put("sfqksd", "0"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE; + 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); + 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()); + } + // 更新个税申报记录 + taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()); + taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); + 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, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156456, "申报作废")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void getCancelFeedback(Long id, TaxDeclarationRateDTO taxDeclarationRate) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + if (!Objects.equals(taxDeclareRecord.getTaxDeclareStatus(), TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue()) || StringUtils.isEmpty(taxDeclareRecord.getRequestId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156500, "请先点击「作废申报」后再来点击「申报反馈」按钮获取结果")); + } + // 供应商信息 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_DECLARE_FEEDBACK; + ImmutableMap requestParam = ImmutableMap.of("requestId", taxDeclareRecord.getRequestId(), "reportType", "1"); + 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, "服务异常,接口返回数据有误")); + } + taxDeclareRecord.setTaxDeclareStatus(taxDeclareStatusEnum.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, "个税扣缴义务人「{0}」税款所属期「{1}」") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156457, "获取申报作废的反馈")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + + @Override + public void updateDeclare(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.UPDATE_DECLARE; + 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, "个税扣缴义务人「{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 String queryDeclareStatus(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 申报类型 + requestParam.put("sblx", "1"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DECLARE_STATUS; + 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); + return res; + } + + @Override + public String queryCompanyIncomes(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + Map requestParam = taxDeclareRequest.getRequestParam(); + // 税款所属期 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 报表类型 + requestParam.put("reportType", "1"); + // 页码 + requestParam.put("pageNo", "1"); + // 每页数量 + requestParam.put("pageSize", "3000"); + // 请求 + String reqJson = JsonUtil.toJsonString(requestParam); + String url = apiConfig.getHost() + SzyhApiConstant.QUERY_COMPANY_INCOMES; + 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); + return res; + } + + @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, "参数异常,个税申报记录不存在或已被删除")); + } + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + // 查询个税扣缴义务人关联的企业信息 + TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(taxDeclareRecord.getTaxAgentId()); + if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息")); + } + // 注册的企业信息-->请求参数 + 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/TaxPaymentAgreementServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java new file mode 100644 index 000000000..5b140dd83 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentAgreementServiceImpl.java @@ -0,0 +1,100 @@ +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.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)) { + // 如果接口仍在处理中,则继续轮询 + return agreementFormDTO.setFinish(false); + } + // 获取返回的人员信息列表 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.error("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + 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)); + 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); + 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..eb977a7b7 --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithheldVoucherServiceImpl.java @@ -0,0 +1,68 @@ +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.TaxWithheldVoucherResultDTO; +import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +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.extern.slf4j.Slf4j; +import org.springframework.transaction.annotation.Transactional; + +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(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, String taxAgentName, TaxPaymentQueryParam param, TaxDeclarationApiConfigPO apiConfig, Class clazz) { + String url = apiConfig.getHost() + SzyhApiConstant.GET_WITHHELD_VOUCHER; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + WithheldVoucherResponse queryResponse = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), + param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class); + // 校验请求结果 + String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null); + WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(WithheldVoucherResponse.Body::getZhsd).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..4e6c5180e --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -0,0 +1,143 @@ +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.taxpayment.dto.TaxAgreementFeedbackResultDTO; +import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO; +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.BaseResponse; +import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse; +import com.engine.salary.enums.SalaryOnOffEnum; +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.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)) { + // 如果接口仍在处理中,则继续轮询 + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "缴款还在处理中,请稍后点击缴款反馈")); + } + // 获取返回的人员信息列表 + if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode)) { + log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(msg); + } + WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse) + .map(WithholdingFeedbackResponse::getBody) + .map(WithholdingFeedbackResponse.Body::getZhsdjk) + .orElse(null); + if (feedback == null) { + log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse)); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据")); + } + TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param); + // 判断缴款状态是否成功 + Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1); + TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class); + if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) { + 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); + // 更新个税申报记录状态为已缴款 + TaxDeclareRecordPO taxDeclareRecord = updateTaxDeclareRecord(param, totalPaid); + // 更新缴款请求为已反馈 + updateTaxPaymentRequest(param); + BigDecimal otherAmount = totalPaid.subtract(SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount())); + return new TaxAgreementFeedbackResultDTO() + .setPayAmount(SalaryEntityUtil.thousandthConvert(totalPaid.toString())) + .setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString())) + .setPersonNum(taxAmountFormDTO.getPersonNum()); + } + + @Override + public Integer getServiceType() { + return TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue(); + } + + protected T getRequestIdResponse(TaxAgentTaxReturnPO returnPO, + String taxAgentName, + TaxPaymentQueryParam param, + TaxDeclarationApiConfigPO apiConfig, + Class clazz) { + SalaryAssert.notBlank(param.getProtocolNumber(), SalaryI18nUtil.getI18nLabel(184071, "三方缴费参数错误")); + String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING; + Map requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + requestParam.put("sfxyh", param.getProtocolNumber()); + requestParam.put("ynse", param.getTaxAmount()); + requestParam.put("sblx", "1"); + return postRequest(apiConfig, url, requestParam, clazz); + } + + @Override + protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + requestParam.put("sblx", 1); + cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); + 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) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + 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); + 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..048f286ab --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -0,0 +1,182 @@ +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.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.WithholdingFeedbackResponse; +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.enums.taxdeclaration.TaxPaymentStatusEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.Objects; +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 + @Transactional(rollbackFor = Exception.class) + 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)) { + // 如果接口仍在处理中,则继续轮询 + 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", "1"); + } + return postRequest(apiConfig, url, requestParam, clazz); + } + + @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) { + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER; + QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class); + 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()) + .build()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void syncWithholdingFeedback(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), + param, tempWrapper.getApiConfigPO(), SyncWithholdingFeedbackResponse.class); + // 校验请求结果 + 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 + @Transactional(rollbackFor = Exception.class) + public void cancelWithholdingVoucher(TaxPaymentQueryParam param) { + TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param); + Map requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); + requestParam.put("sblx", 1); + 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); + 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..1ddd88cdc --- /dev/null +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -0,0 +1,36 @@ +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.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 listByIncomeCategory(IncomeCategoryEnum incomeCategory) { + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().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..12feb8d16 --- /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 = getCompanyRegisterInfoResponse(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..4ac507c1b --- /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 = getCompanyRegisterInfoResponse(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 2a141497f..b61775290 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -19,6 +19,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.AddUpDeductionMapper; @@ -35,6 +36,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.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.param.AppSettingSaveParam; import com.engine.salary.sys.entity.param.OrderRuleParam; @@ -138,6 +140,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class); } + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + /** * 操作是否需要申报功能 @@ -447,7 +453,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe @Override public List getListByCodes(List codes) { - if(CollectionUtils.isEmpty(codes)){ + if (CollectionUtils.isEmpty(codes)) { return Collections.emptyList(); } return getSalarySysConfMapper().getListByCodes(codes); @@ -519,11 +525,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } SalarySysConfPO salaryAcctEmployeeRule = salarySysConfMap.get(SALARY_ACCT_EMPLOYEE_RULE); - if (salaryAcctEmployeeRule == null ) { + if (salaryAcctEmployeeRule == null) { // 薪资核算人员匹配规则 appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()); } else { - appSettingVO.setSalaryAcctEmployeeRule( SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue() ); + appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue()); } SalarySysConfPO withDrawRule = salarySysConfMap.get(WITHDRAW_TAX_DECLARATION); @@ -544,7 +550,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe SalarySysConfPO salarySendFeedbackPO = salarySysConfMap.get(SALARY_SEND_FEEDBACK); - if (salarySendFeedbackPO == null ) { + if (salarySendFeedbackPO == null) { // 是否开启工资单反馈,默认不开启 appSettingVO.setSalarySendFeedback("0"); } else { @@ -1045,14 +1051,40 @@ 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(); - if (flag == 14) { + 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; + }); + 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(); + if (flag == 15) { 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 == 14; + return flag == 15; } 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 { + // 在调用SSL之前需要重写验证方法,取消检测SSL + 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,添加Connection配置信息 + 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 请求的url地址 ?之前的地址 + * @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, "抱歉,系统因网络原因无法访问税局个税系统,此功能暂时无法使用,请确保网络情况正常且允许访问外网")); + 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 af3eb35e2..49cb7b2aa 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -20,12 +20,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 { @@ -103,6 +104,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 getFormatLocalDate(LocalDate localDate) { if (localDate == null) { return StringUtils.EMPTY; @@ -224,7 +238,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) { @@ -254,6 +268,7 @@ 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); @@ -291,8 +306,6 @@ public class SalaryDateUtil { } - - public static String getMonthBegin(String specifiedDay) { int year; int month; @@ -495,7 +508,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -514,7 +527,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -532,7 +545,7 @@ public class SalaryDateUtil { localDate = format.parse(date); } } catch (Exception e) { - log.error("日期解析异常,{}", date); + log.error("日期解析异常,{}", date, e); localDate = null; } @@ -563,9 +576,10 @@ 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); @@ -574,8 +588,9 @@ public class SalaryDateUtil { /** * 转换时间对象 + * * @param dateTime LocalDateTime - * @param offset 时区,e.g. +8 + * @param offset 时区,e.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 3cc5fe7dd..d0d97905e 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; @@ -358,4 +359,58 @@ 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/SalaryEnumUtil.java b/src/com/engine/salary/util/SalaryEnumUtil.java index 0294bd14c..5e1eb1954 100644 --- a/src/com/engine/salary/util/SalaryEnumUtil.java +++ b/src/com/engine/salary/util/SalaryEnumUtil.java @@ -35,6 +35,25 @@ public class SalaryEnumUtil { return (T) Arrays.stream(list).filter(item -> Objects.equals(item.getValue(), value)).findFirst().get(); } + /** + * 根据枚举的value获取枚举对象 + * + * @param value + * @param clazz + * @param + * @param + * @return + */ + public static , R> T enumMatchByValue(R value, Class clazz) { + T[] enumConstants = clazz.getEnumConstants(); + for (T enumConstant : enumConstants) { + if (Objects.equals(enumConstant.getValue(), value)) { + return enumConstant; + } + } + return null; + } + /** * 枚举数组转字符串 * @@ -73,6 +92,7 @@ public class SalaryEnumUtil { for (BaseEnum enumMessage : enums) { Map hashMap = new HashMap(); + hashMap.put("enum", enumMessage); hashMap.put("value", enumMessage.getValue()); hashMap.put("defaultLabel", enumMessage.getDefaultLabel()); hashMap.put("labelId", enumMessage.getLabelId()); diff --git a/src/com/engine/salary/util/SalaryI18nUtil.java b/src/com/engine/salary/util/SalaryI18nUtil.java index f7d9272ce..d85f6984b 100644 --- a/src/com/engine/salary/util/SalaryI18nUtil.java +++ b/src/com/engine/salary/util/SalaryI18nUtil.java @@ -17,7 +17,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: 此线程池类只适用于Runnalbe接口,不适用与Callable接口 + * 此线程池类只适用于Runnalbe接口,不适用与Callable接口 * 如有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个字节为一组进行分组加密 + // 定义分组加密模式使用:PKCS5Padding + 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模式(电子密码本模式:Electronic 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 加密模式:ECB + * 密文长度不固定,会随着被加密字符串长度的变化而变化 + * @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; + } + + /** + * 加密模式之Ecb + * + * @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解密 + * + * @param hexKey 16进制密钥 + * @param cipherText 16进制的加密字符串(忽略大小写) + * @return 解密后的字符串 + * @throws Exception + * @explain 解密模式:采用ECB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + hexKey = strTo16(hexKey); + // 用于接收解密后的字符串 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 解密 + * + * @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); + // 解密 + 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/excel/ExcelSheetData.java b/src/com/engine/salary/util/excel/ExcelSheetData.java new file mode 100644 index 000000000..f4cf615ea --- /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 c50c11d2b..8c271981a 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -9,7 +9,7 @@ import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.*; import java.awt.*; -import java.util.Date; +import java.util.*; import java.util.List; public class ExcelUtil { @@ -267,4 +267,11 @@ public class ExcelUtil { } return workbook; } + + public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { + List> list = new ArrayList<>(); + list.add(Collections.singletonList(excelSheetData.getHeaders())); + list.addAll( excelSheetData.getRows()); + return genWorkbookV2(list, excelSheetData.getSheetName()); + } } diff --git a/src/com/engine/salary/util/page/PageInfo.java b/src/com/engine/salary/util/page/PageInfo.java index 86f73f742..44676ad56 100644 --- a/src/com/engine/salary/util/page/PageInfo.java +++ b/src/com/engine/salary/util/page/PageInfo.java @@ -38,9 +38,17 @@ public class PageInfo extends com.github.pagehelper.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 062b5408f..201dd799f 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -1,11 +1,13 @@ 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.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public class SalaryPageUtil { @@ -90,4 +92,12 @@ public class SalaryPageUtil { return source.subList(startIndex > source.size() ? source.size() : startIndex, endIndex > source.size() ? source.size() : endIndex); } + + + 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..d8794ecf4 --- /dev/null +++ b/src/com/engine/salary/util/valid/SalaryCardUtil.java @@ -0,0 +1,110 @@ +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.time.LocalDate; +import java.util.regex.Pattern; + +/** + * 身份证 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryCardUtil { + + /** + * 15位的身份证长度 + */ + public static final String CARD_15 = "^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}$"; + /** + * 18位的身份证长度 + */ + public static final String CARD_18 = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"; + /** + * 手机号码 + */ + 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 idNumber + */ + public static boolean checkIdNum(String idNumber) { + Pattern pattern_15 = Pattern.compile(CARD_15); + Pattern pattern_18 = Pattern.compile(CARD_18); + if (!pattern_15.matcher(idNumber).find() && !pattern_18.matcher(idNumber).find()) { + return false; + } + return true; + } + + /** + * 校验手机号码 + * + * @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); + } +} diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java new file mode 100644 index 000000000..75535d32f --- /dev/null +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -0,0 +1,333 @@ +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 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 java.util.Collection; +import java.util.Map; + +/** + * 人员报送 + *

Copyright: Copyright (c) 2023

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class EmployeeDeclareController { + + private EmployeeDeclareWrapper getEmployeeDeclareWrapper(User user) { + return ServiceUtil.getService(EmployeeDeclareWrapper.class, user); + } + + /** + * 人员报送-个税扣缴义务人列表 + * + * @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); + } + + /** + * 人员报送-获取整体的报送情况 + * + * @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); + } + + /** + * 人员报送-获取报送结果反馈 + * + * @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); + } + + /** + * 人员报送-后端业务逻辑是否已经完成 + * + * @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("/export") +// @Produces(MediaType.APPLICATION_JSON) +// public String export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { +// Map exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser()); +// return WeaResult.success(exportMap); +// } + +// /** +// * 人员报送-导出本月新增人员 +// * +// * @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/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 078060a02..5aea365d2 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -523,7 +523,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); } diff --git a/src/com/engine/salary/web/SalaryCommonController.java b/src/com/engine/salary/web/SalaryCommonController.java index ca7a439dc..afd17de39 100644 --- a/src/com/engine/salary/web/SalaryCommonController.java +++ b/src/com/engine/salary/web/SalaryCommonController.java @@ -1,19 +1,20 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.browser.dto.BrowserDataDTO; +import com.engine.salary.entity.browser.param.BrowserDataQueryParam; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.SalaryCommonWrapper; +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.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.List; @@ -51,5 +52,11 @@ 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 8ed4f0ebb..aab9889e3 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -72,6 +72,13 @@ public class SalarySobController { return ServiceUtil.getService(SalarySobBackItemWrapper.class, user); } + private SalarySobTaxReportRuleWrapper getSalarySobTaxReportRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobTaxReportRuleWrapper.class, user); + } + + private SalarySobAddUpRuleWrapper getSalarySobAddUpRuleWrapper(User user) { + return ServiceUtil.getService(SalarySobAddUpRuleWrapper.class, user); + } /**********************************薪资账套 start*********************************/ /** @@ -245,13 +252,13 @@ public class SalarySobController { public Response downloadSobRangeTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { User user = HrmUserVarify.getUser(request, response); SalarySobPO salarySobPO = Objects.isNull(salarySobId) ? null : getSalarySobWrapper(user).getSalarySobService(user).getById(salarySobId); - if(Objects.isNull(salarySobPO)){ + if (Objects.isNull(salarySobPO)) { throw new SalaryRunTimeException("薪资账套不存在或已被删除"); } try { XSSFWorkbook workbook = getSalarySobRangeWrapper(user).exportImportTemplate(); String time = LocalDate.now().toString(); - String fileName = salarySobPO.getName() + "人员范围导入模板" + time ; + String fileName = salarySobPO.getName() + "人员范围导入模板" + time; try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); } catch (UnsupportedEncodingException e) { @@ -262,17 +269,15 @@ public class SalarySobController { outputStream.flush(); }; response.setContentType("application/octet-stream"); - return Response.ok(output). - header("Content-disposition", "attachment;filename=" + fileName). - header("Cache-Control", "no-cache").build(); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); } catch (Exception e) { throw e; } } /** - * @description 薪资账套人员范围导入预览 * @return String + * @description 薪资账套人员范围导入预览 * @author Harryxzy * @date 2023/1/9 13:32 */ @@ -285,8 +290,8 @@ public class SalarySobController { } /** - * @description 薪资账套人员范围导入 * @return String + * @description 薪资账套人员范围导入 * @author Harryxzy * @date 2023/1/9 13:32 */ @@ -310,7 +315,7 @@ public class SalarySobController { @Produces(MediaType.APPLICATION_JSON) public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam queryParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult >(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam); + return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::listPage4SalaryItem, queryParam); } @@ -368,6 +373,7 @@ public class SalarySobController { return new ResponseResult>(user).run(getSalarySobItemWrapper(user)::save, saveParam); } + /** * 薪资账套-薪资项目的详情 */ @@ -384,26 +390,25 @@ public class SalarySobController { /**********************************薪资账套的薪资项目 end*********************************/ - /**********************************薪资账套的回算项目 start*********************************/ - + /** - * @description 薪资账套回算项目列表 * @return String + * @description 薪资账套回算项目列表 * @author Harryxzy * @date 2022/11/16 14:01 */ @GET @Path("/backitem/getAggregate") @Produces(MediaType.APPLICATION_JSON) - public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "salarySobId") Long salarySobId) { + public String getSalarySobBackItemAggregate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salarySobId") Long salarySobId) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId); + return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getAggregate, salarySobId); } /** - * @description 薪资账套回算项目详情(编辑前获取) * @return null + * @description 薪资账套回算项目详情(编辑前获取) * @author Harryxzy * @date 2022/11/16 14:02 */ @@ -411,27 +416,92 @@ public class SalarySobController { @Path("/backitem/getForm") @ApiOperation("薪资账套回算项目详情") @Produces(MediaType.APPLICATION_JSON) - public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value ="id") Long id) { + public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getForm, id); + return new ResponseResult(user).run(getSalarySobBackItemWrapper(user)::getForm, id); } /** * @description 保存薪资账套回算项目 - * @return String * @author Harryxzy * @date 2022/11/16 15:05 */ @POST @Path("/backitem/save") @Produces(MediaType.APPLICATION_JSON) - public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalarySobBackItemSaveParam saveParam) { + public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobBackItemSaveParam saveParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam); + return new ResponseResult>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam); } /**********************************薪资账套的回算项目 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*********************************/ diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index ae1b52d67..1d07bd7d3 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -274,7 +274,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; + +/** + * 个税扣缴义务人-报税信息 + *

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 6d2332dd4..c717016f5 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -1,23 +1,23 @@ 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.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.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; @@ -31,8 +31,10 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; -import java.text.ParseException; -import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Map; @Slf4j @@ -47,81 +49,275 @@ 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) throws ParseException { + public String listTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); - queryParam.setFromSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr())); - queryParam.setEndSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr())); - 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("/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, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxDeclarationWrapper(user)::getTaxDeclarationInfoById, taxDeclarationId); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationInfoById, id); } - //个税申报表生成 - @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("/updateIcon") + @Produces(MediaType.APPLICATION_JSON) + public String updateIcon(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam param) { + User user = HrmUserVarify.getUser(request, response); + 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("/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); + } + + /** + * 获取个税申报记录下的个税申报表TAB + * + * @param id 个税申报记录id + * @return + */ + @GET + @Path("/getTaxDeclarationTab") + @Produces(MediaType.APPLICATION_JSON) + public String getTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id); + } + + /** + * 在线申报 + * + * @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.getTaxDeclareRecordId()); + } + + /** + * 获取在线申报反馈 + * + * @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.getTaxDeclareRecordId()); + } + + /** + * 作废 + * + * @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.getTaxDeclareRecordId()); + } + + /** + * 获取作废反馈 + * + * @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.getTaxDeclareRecordId()); + } + + /** + * 更正申报 + * + * @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.getTaxDeclareRecordId()); + } + + /** + * 税局端申报状态查询 + * + * @param taxDeclareRecordParam 查询参数 + * @return + */ + @POST + @Path("/queryDeclareStatus") + @Produces(MediaType.APPLICATION_JSON) + public String queryDeclareStatus(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryDeclareStatus, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + + /** + * 税局端申报明细查询 + * + * @param taxDeclareRecordParam 查询申报明细参数 + * @return + */ + @POST + @Path("/queryCompanyIncomes") + @Produces(MediaType.APPLICATION_JSON) + public String queryCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, 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 queryParam 查询条件 + * @return + */ @POST @Path("/detail/list") @Produces(MediaType.APPLICATION_JSON) - public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationDetailListQueryParam param) { + public String listTaxDeclarationValue(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationValueListQueryParam queryParam) { 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)::listValuePage, queryParam); } - //个税申报表相关信息 + /** + * 导出个税申报表申报数据 + * + * @return + */ @GET - @Path("/export") + @Path("/detail/export") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response exportTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "taxDeclarationId") Long taxDeclarationId) { + public Response exportDetail(@Context HttpServletRequest request, @Context HttpServletResponse response) { + + TaxDeclarationValueListQueryParam queryParam = genTaxDeclarationValueListQueryParam(request); + try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getTaxDeclarationExcelService(user).exportTaxDeclaration(taxDeclarationId); - String fileName = "个税申报表" + LocalDate.now(); + 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) { @@ -132,11 +328,225 @@ public class TaxDeclarationController { 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(); + 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; } } + + 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; + } + } + } diff --git a/src/com/engine/salary/web/TaxPaymentController.java b/src/com/engine/salary/web/TaxPaymentController.java new file mode 100644 index 000000000..07e5203ca --- /dev/null +++ b/src/com/engine/salary/web/TaxPaymentController.java @@ -0,0 +1,196 @@ +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) + 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) + 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) + 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) + 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/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java new file mode 100644 index 000000000..e42aea3d6 --- /dev/null +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -0,0 +1,650 @@ +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.po.TaxAgentPO; +import com.engine.salary.enums.SalaryOnOffEnum; +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.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 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); + } + + /** + * 人员报送的个税扣缴义务人列表 + * + * @param queryParam + * @return + */ + public PageInfo taxAgentDeclareList(TaxAgentDeclareListQueryParam queryParam) { + // 判断是否是“总管理员” + Boolean isChief = getTaxAgentService(user).isChief(Long.valueOf(user.getUID())); + // 是否开启分权 + Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); + // 查询个税扣缴义务人 + List taxAgents = Lists.newArrayList(); + if (!openDevolution || isChief) { + taxAgents = getTaxAgentService(user).listAll(); + } else { + taxAgents = new ArrayList<>(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID()))); + } + if (StringUtils.isNotEmpty(queryParam.getTaxAgentName())) { + taxAgents = taxAgents.stream().filter(e -> StringUtils.contains(e.getName(), queryParam.getTaxAgentName())).collect(Collectors.toList()); + } + // 分页 + List taxAgentPOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), taxAgents); + List dtoList = Lists.newArrayList(); + for (TaxAgentPO taxAgent : taxAgentPOS) { + TaxAgentDeclareListDTO dto = new TaxAgentDeclareListDTO().setId(taxAgent.getId()).setTaxAgentName(taxAgent.getName()); + 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); + +// // 判断是否开启分部 +// 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 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(SalaryI18nUtil.getI18nLabel(94731, "中国")) + .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS) + .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)); + } 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, "是否扣除减除费用"))); +// 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(); + } + + /** + * 人员报送-获取人员报送的整体情况 + * + * @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(); + } + + /** + * 人员报送-获取报送结果反馈 + * + * @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(); + } + + /** + * 获取人员报送相关后端接口是否已经完成 + * + * @param index + * @return + */ + public EmployeeDeclareRateDTO getRate(String index) { + return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index); + } + +// /** +// * 人员报送-导出本月全部的人员 +// * +// * @param queryParam +// * @param simpleEmployee +// * @return +// */ +// public Map export(EmployeeDeclareListQueryParam queryParam, SimpleEmployee simpleEmployee) { +// ExcelExportParam excelExportParam = new ExcelExportParam() +// .setBiz(String.valueOf(IdGenerator.generate())) +// .setModule(EntityType.hrmsalary.name()) +// .setFunction("exportEmployeeDeclare"); +// LocalRunnable localRunnable = new LocalRunnable() { +// @Override +// public void execute() { +// employeeDeclareExcelService.export(excelExportParam, queryParam, simpleEmployee); +// } +// }; +// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportEmployeeDeclare", localRunnable); +// return JsonUtil.parseMap(excelExportParam, Object.class); +// } +// +// /** +// * 人员报送-导出本月新增的人员 +// * +// * @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/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 63f0b3d37..74015dee9 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -35,7 +35,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 baec86d91..6b112cee8 100644 --- a/src/com/engine/salary/wrapper/SalaryCommonWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryCommonWrapper.java @@ -2,10 +2,23 @@ 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.service.SalaryCacheService; +import com.engine.salary.service.SalarySobItemService; import com.engine.salary.service.impl.SalaryCacheServiceImpl; +import com.engine.salary.service.impl.SalarySobItemServiceImpl; +import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.page.PageInfo; +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 { @@ -13,6 +26,10 @@ public class SalaryCommonWrapper extends Service { return ServiceUtil.getService(SalaryCacheServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + public String getCacheInfo(String key) { return getSalaryCacheService(user).get(key); } @@ -20,4 +37,24 @@ public class SalaryCommonWrapper extends Service { public void removeCache(String key) { 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; + } + } 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/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/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; + +/** + * 个税扣缴义务人-报税信息包装类 + *

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.关闭所有tab + */ + 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 { + // 密码解密 + 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); + } + // 查询个税扣缴义务人名称 + TaxAgentPO agentPO = getTaxAgentService(user).getById(taxAgentId); + SalaryAssert.notNull(agentPO, SalaryI18nUtil.getI18nLabel(100545, "个税扣缴义务人不存在")); + 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 38670737a..aa39752db 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -134,12 +134,9 @@ public class TaxDeclarationWrapper extends Service { if (Objects.isNull(taxDeclaration)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除")); } - //日期转换 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); // 查询个税扣缴义务人 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(); + return TaxDeclarationInfoDTO.builder().salaryMonth(taxDeclaration.getSalaryMonth()).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java new file mode 100644 index 000000000..277d1d9d0 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -0,0 +1,652 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.cache.SalaryCacheKey; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.dto.*; +import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.po.*; +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.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.weaver.util.threadPool.ThreadPoolUtil; +import com.weaver.util.threadPool.constant.ModulePoolEnum; +import com.weaver.util.threadPool.entity.LocalRunnable; +import dm.jdbc.util.IdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.stereotype.Component; +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 +@Component +public class TaxDeclareRecordWrapper extends Service { + + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.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); + } + + /** + * 个税申报记录列表 + * + * @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)) { + // 查询个税扣缴义务人 + 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())); + 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())); + // 转换成dto + 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); +// } +// // 未开启分权,没有"作为管理员的个税扣缴义务人" +// if (!openDevolution && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(1); +// } +// // 开启分权,但不是总管理员,没有"所有个税扣缴义务人" +// if (openDevolution && !isChief && StringUtils.equals("taxAgentRange", k)) { +// v.getOptions().remove(0); +// } +// }); + return new HashMap(); + } + + /** + * 获取个税申报记录下的个税申报表TAB + * + * @param id + * @return + */ + public List getTaxDeclarationTab(Long id) { + // 查询个税申报记录 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); + // 查询个税申报记录下的个税申报表 + List taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), + Collections.singleton(taxDeclareRecord.getTaxAgentId())); +// taxDeclarations = taxDeclarations.stream() +// .filter(e -> Objects.equals(e.getControlView(), 0) || Objects.equals(e.getCreator(), (long)user.getUID())) +// .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 id 个税申报表id + * @return + */ + public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { + // 查询个税申报表 + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(id); + 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())); + // 查询个税扣缴义务人 + TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId()); + TaxDeclareTypeEnum taxDeclareTypeEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.getTaxDeclareType(), TaxDeclareTypeEnum.class); + TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(taxDeclareRecord.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(taxDeclareRecord.getTaxDeclareErrorMsg()) + .displayIcon(Objects.equals(taxDeclareRecord.getDisplayUpdateIcon(), 1)) + .declareFailSize(taxDeclareFails.size()) + .abnormalSize(notDeclareTaxDeclareEmployees.size() + noValueTaxDeclareEmployees.size()) + .taxPaidAmount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.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(); + } + + /** + * 更新个税申报表的待刷新数据的标识 + * + * @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 id + */ + public String declare(Long id) { + 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); + 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(); + } + + /** + * 获取申报反馈 + * + * @param id + */ + public String getDeclareFeedback(Long id) { + 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, 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(); + } + + /** + * 作废 + * + * @param id + */ + public String cancelDeclare(Long id) { + 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); + 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(); + } + + /** + * 获取作废反馈 + * + * @param id + */ + public String getCancelFeedback(Long id) { + 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, 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(); + } + + /** + * 更正申报 + * + * @param id + * @return + */ + public String updateDeclare(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).updateDeclare(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, "updateDeclare", localRunnable); + return taxDeclarationRate.getIndex(); + } + + /** + * 税局端申报状态查询 + * + * @param id + * @return + */ + public String queryDeclareStatus(Long id) { + return getTaxDeclareRecordService(user).queryDeclareStatus(id); + } + + /** + * 税局端申报明细查询 + * + * @param id + * @return + */ + public String queryCompanyIncomes(Long id) { + return getTaxDeclareRecordService(user).queryCompanyIncomes(id); + } + + /** + * 刷新数据 + * + * @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, "当前正处于「{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); + } +} diff --git a/src/com/engine/salary/wrapper/TaxPaymentWrapper.java b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java new file mode 100644 index 000000000..f90f62713 --- /dev/null +++ b/src/com/engine/salary/wrapper/TaxPaymentWrapper.java @@ -0,0 +1,55 @@ +package com.engine.salary.wrapper; + +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.enums.taxdeclaration.TaxPaymentServiceTypeEnum; +import com.engine.salary.service.factory.TaxPaymentServiceFactory; +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 taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).getFeedback(param); + } + + public TaxFeedbackResultDTO payAgreementFeedback(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_PAY.getValue()).getFeedback(param); + } + + public TaxFeedbackResultDTO printVoucherFeedback(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).getFeedback(param); + } + + public String getRequestId(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(param.getType()).getRequestId(param); + } + + public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.QUERY_AGREEMENT.getValue()).queryTaxAmount(param); + } + + public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) { + return taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHELD_VOUCHER.getValue()).getWithheldVoucher(param); + } + + public void getSyncWithholdingFeedback(TaxPaymentQueryParam param) { + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).syncWithholdingFeedback(param); + } + + public void cancelVoucher(TaxPaymentQueryParam param) { + taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(param); + } +}