diff --git a/resource/sqlupgrade/DM/sql202312130203.sql b/resource/sqlupgrade/DM/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/DM/sql202312190103.sql b/resource/sqlupgrade/DM/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/DM/sql202312270603.sql b/resource/sqlupgrade/DM/sql202312270603.sql new file mode 100644 index 000000000..f9aba2b22 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/DM/sql202312270703.sql b/resource/sqlupgrade/DM/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/DM/sql202401080103.sql b/resource/sqlupgrade/DM/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/GS/sql202312130203.sql b/resource/sqlupgrade/GS/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202312190103.sql b/resource/sqlupgrade/GS/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202312270603.sql b/resource/sqlupgrade/GS/sql202312270603.sql new file mode 100644 index 000000000..f9aba2b22 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/GS/sql202312270703.sql b/resource/sqlupgrade/GS/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/GS/sql202401080103.sql b/resource/sqlupgrade/GS/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/JC/sql202312130203.sql b/resource/sqlupgrade/JC/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202312190103.sql b/resource/sqlupgrade/JC/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202312270603.sql b/resource/sqlupgrade/JC/sql202312270603.sql new file mode 100644 index 000000000..f9aba2b22 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/JC/sql202312270703.sql b/resource/sqlupgrade/JC/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/JC/sql202401080103.sql b/resource/sqlupgrade/JC/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql new file mode 100644 index 000000000..15acb233a --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string text NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; diff --git a/resource/sqlupgrade/Mysql/sql202312190103.sql b/resource/sqlupgrade/Mysql/sql202312190103.sql new file mode 100644 index 000000000..9cc0240c6 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312190103.sql @@ -0,0 +1,47 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int(0) NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202312270603.sql b/resource/sqlupgrade/Mysql/sql202312270603.sql new file mode 100644 index 000000000..52d95fada --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int(0) NULL ; + +ALTER TABLE hrsa_tax_declare_record ADD COLUMN declare_request_id varchar(100) NULL ; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202312270703.sql b/resource/sqlupgrade/Mysql/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202401080103.sql b/resource/sqlupgrade/Mysql/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202309050203.sql b/resource/sqlupgrade/Oracle/sql202309050203.sql deleted file mode 100644 index 3caa7ac50..000000000 --- a/resource/sqlupgrade/Oracle/sql202309050203.sql +++ /dev/null @@ -1,23 +0,0 @@ -alter table hrsa_add_up_situation add add_up_taxable_income varchar2(255) -/ -alter table hrsa_add_up_situation add actual_add_up_advance_tax varchar2(255) -/ -alter table hrsa_add_up_situation add tax_adjustment varchar2(255) -/ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312885, 1, 674916065864646661, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 5) -/ -INSERT INTO hrsa_salary_sob_default_item(id, income_category, sys_salary_item_id, can_edit, can_delete, creator, create_time, update_time, delete_type, tenant_key, sob_default_item_group_id, sorted_index) VALUES (706066600446312886, 1, 674916065864646658, 1, 0, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 0, 'all_teams', 703433961629614119, 6) -/ - -INSERT INTO hrsa_formula(id, name, description, module, use_for, reference_type, return_type, validate_type, extend_param, formula, formulaRunScript, creator, delete_type, create_time, update_time) VALUES (1693896072589, '当前累计减免税额合计', '备注', 'salary', 'salaryitem', 'formula', 'number', 'number', '{"isCustomFunction":"0","sqlReturnKey":"","openDecrypt":"0","datasource":{"datasourceId":""}}', '{薪资项目.本月(次)减免税额}+{往期累计情况.累计减免税额}', 'salaryItem_taxDeduction+addUpSituation_addUpTaxSavings', 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072606, '本月(次)减免税额', 1693896072589, 'salaryItem_taxDeduction', '{薪资项目.本月(次)减免税额}', 'number', 'salaryItem', 0, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ -INSERT INTO hrsa_formula_var(id, name, formula_id, field_id, field_name, field_type, source, order_index, creator, delete_type, create_time, update_time) VALUES (1693896072611, '累计减免税额', 1693896072589, 'addUpSituation_addUpTaxSavings', '{往期累计情况.累计减免税额}', 'number', 'addUpSituation', 1, 27, 0, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')) -/ - -update hrsa_sys_salary_item set value_type = 2 ,formula_id =1693896072589 where id = 674916065864646658 -/ - -update hrsa_salary_item set value_type =2 ,formula_id =1693896072589 where sys_salary_item_id = 674916065864646658 -/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312130203.sql b/resource/sqlupgrade/Oracle/sql202312130203.sql new file mode 100644 index 000000000..f62d861b8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312190103.sql b/resource/sqlupgrade/Oracle/sql202312190103.sql new file mode 100644 index 000000000..14ad11e18 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312190103.sql @@ -0,0 +1,64 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1) +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1) +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出' +/ + +update hrsa_tax_report_column set contrast_type = 0 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270603.sql b/resource/sqlupgrade/Oracle/sql202312270603.sql new file mode 100644 index 000000000..4aea94ab0 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270603.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +) +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202312270703.sql b/resource/sqlupgrade/Oracle/sql202312270703.sql new file mode 100644 index 000000000..e2477f553 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401080103.sql b/resource/sqlupgrade/Oracle/sql202401080103.sql new file mode 100644 index 000000000..fc148da4a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202206090403.sql b/resource/sqlupgrade/PG/sql202206090403.sql index 679a8cc59..8f5d32f79 100644 --- a/resource/sqlupgrade/PG/sql202206090403.sql +++ b/resource/sqlupgrade/PG/sql202206090403.sql @@ -1,3 +1,3 @@ -ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int NOT NULL ; +ALTER TABLE hrsa_tax_declaration ADD COLUMN income_category int ; -ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int NOT NULL ; \ No newline at end of file +ALTER TABLE hrsa_tax_declaration_detail ADD COLUMN employee_type int ; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202303130202.sql b/resource/sqlupgrade/PG/sql202303130202.sql index 54a9eae70..c6ed8b220 100644 --- a/resource/sqlupgrade/PG/sql202303130202.sql +++ b/resource/sqlupgrade/PG/sql202303130202.sql @@ -2,9 +2,9 @@ Delete from LeftMenuInfo where id=100186; / Delete from LeftMenuConfig where infoid=100186; / -call LMConfig_U_ByInfoInsert (2,100118,9); +select LMConfig_U_ByInfoInsert (2,100118,9); / -call LMInfo_Insert (100186,541290,'','',2,100118,9,18); +select LMInfo_Insert (100186,541290,'','',2,100118,9,18); / update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/externalPersonManage' where id = 100186; / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307200603.sql b/resource/sqlupgrade/PG/sql202307200603.sql index e211c560e..522bcacec 100644 --- a/resource/sqlupgrade/PG/sql202307200603.sql +++ b/resource/sqlupgrade/PG/sql202307200603.sql @@ -1,17 +1,14 @@ -select @current_date:= date_format( now(),'%Y-%m-%d'); -select @current_time:= date_format( now(),'%T'); -INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA,SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL,BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER,WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME,onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl,isPhyPage, subcompanyid, unconditionalQuery) VALUES ('salaryExtEmp', '1', '1', '', 'SELECT * FROM hrsa_external_employee where delete_type=0', '', '', '', '', '1','id', '', '', '', '', '', '', 2, '薪酬非系统人员', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date,@current_time, NULL, NULL, '', '', '0', uuid(), '', '', '', '', '1', 0, 1); +INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA,SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL,BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER,WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME,onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl,isPhyPage, subcompanyid, unconditionalQuery) VALUES ('salaryExtEmp', '1', '1', '', 'SELECT * FROM hrsa_external_employee where delete_type=0', '', '', '', '', '1','id', '', '', '', '', '', '', 2, '薪酬非系统人员', NULL, '', NULL, NULL, NULL, NULL, '', '', '2020-01-01', '19:12:12', NULL, NULL, '', '', '0', uuid(), '', '', '', '', '1', 0, 1); -select @datashowset_id:= max(id)from datashowset; INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) -VALUES ('salaryExtEmp', '0', 0, @current_date, @current_time, NULL, NULL); +VALUES ('salaryExtEmp', '0', 0, '2020-01-01', '19:12:12', NULL, NULL); INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) -VALUES (@datashowset_id, '姓名', 'username', '', 1, 1, uuid(), NULL); +VALUES ((select max(id) from datashowparam), '姓名', 'username', '', 1, 1, uuid(), NULL); INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) -VALUES (@datashowset_id, '手机号', 'mobile', '', 0, 2, uuid(), NULL); +VALUES ((select max(id) from datashowparam), '手机号', 'mobile', '', 0, 2, uuid(), NULL); INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) -VALUES (@datashowset_id, '姓名', 'username', '2', '', 1, uuid(), ''); +VALUES ((select max(id) from datasearchparam), '姓名', 'username', '2', '', 1, uuid(), ''); INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) -VALUES (@datashowset_id, '手机号', 'mobile', '2', '', 2, uuid(), ''); \ No newline at end of file +VALUES ((select max(id) from datasearchparam), '手机号', 'mobile', '2', '', 2, uuid(), ''); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312130203.sql b/resource/sqlupgrade/PG/sql202312130203.sql new file mode 100644 index 000000000..9b9630ce6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312190103.sql b/resource/sqlupgrade/PG/sql202312190103.sql new file mode 100644 index 000000000..f999dbbc3 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312190103.sql @@ -0,0 +1,47 @@ +ALTER TABLE hrsa_tax_report_column ADD COLUMN contrast_type int NULL; + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; + +update hrsa_tax_report_column set contrast_type = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270603.sql b/resource/sqlupgrade/PG/sql202312270603.sql new file mode 100644 index 000000000..42b0d9089 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_tax_declaration_value ADD COLUMN source int NULL ; + +ALTER TABLE hrsa_salary_template ADD COLUMN declare_request_id varchar(200) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312270703.sql b/resource/sqlupgrade/PG/sql202312270703.sql new file mode 100644 index 000000000..099b6ab58 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312270703.sql @@ -0,0 +1 @@ +update hrsa_tax_declaration_value set source = 0; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401080103.sql b/resource/sqlupgrade/PG/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312130203.sql b/resource/sqlupgrade/SQLServer/sql202312130203.sql new file mode 100644 index 000000000..0738202b3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar(10) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312190103.sql b/resource/sqlupgrade/SQLServer/sql202312190103.sql new file mode 100644 index 000000000..1a0cd83fb --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312190103.sql @@ -0,0 +1,64 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1) +GO + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1) +GO + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出' +GO + +update hrsa_tax_report_column set contrast_type = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270603.sql b/resource/sqlupgrade/SQLServer/sql202312270603.sql new file mode 100644 index 000000000..6955742ff --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270603.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_tax_declaration_value ADD source int NULL +GO + +ALTER TABLE hrsa_tax_declare_record ADD declare_request_id varchar(100) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312270703.sql b/resource/sqlupgrade/SQLServer/sql202312270703.sql new file mode 100644 index 000000000..0384f9313 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312270703.sql @@ -0,0 +1,2 @@ +update hrsa_tax_declaration_value set source = 0 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401080103.sql b/resource/sqlupgrade/SQLServer/sql202401080103.sql new file mode 100644 index 000000000..ff92fddf9 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312130203.sql b/resource/sqlupgrade/ST/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/ST/sql202312190103.sql b/resource/sqlupgrade/ST/sql202312190103.sql new file mode 100644 index 000000000..659ca7b6d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312190103.sql @@ -0,0 +1,65 @@ +ALTER TABLE hrsa_tax_report_column ADD contrast_type int NULL; +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158174, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计收入额', 'addUpIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158175, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计免税收入', 'addUpTaxFreeIncome', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158176, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减除费用', 'addUpSubtraction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158177, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计专项扣除', 'addUpSpecialDeduction', 'number', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158184, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计其他扣除', 'addUpOtherDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158185, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计准予扣除的捐赠', 'addUpAllowedDonation', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158186, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税所得额', 'addUpTaxableIncome', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158187, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '税率', 'taxRate', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158188, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '速算扣除数', 'quickDeductionFactor', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158189, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应纳税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158190, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计减免税额', 'addUpTaxDeduction', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158191, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计应扣缴税额', 'addUpTaxPayable', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158192, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '累计已缴税额', 'addUpAdvanceTax', '', NULL, NULL,1); +/ + +INSERT INTO hrsa_tax_report_column(id, create_time, update_time, creator, delete_type, tenant_key, tax_report_type, income_category, report_column_name, report_column_data_index, data_type, request_param_key, report_column_label,contrast_type) VALUES +(805915446042158193, NULL, NULL, NULL, 0, 'all_teams', '1', '1', '应补(退)税额', 'refundedOrSupplementedTax', '', NULL, NULL,1); +/ + +update hrsa_tax_report_column set report_column_name = '累计3岁以下婴幼儿照护' where report_column_name = '累计3岁以下婴幼儿照护支出'; +/ + +update hrsa_tax_report_column set contrast_type = 0; +/ + diff --git a/resource/sqlupgrade/ST/sql202312270603.sql b/resource/sqlupgrade/ST/sql202312270603.sql new file mode 100644 index 000000000..f9aba2b22 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270603.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_tax_declaration_value add ( + source number +); +/ + +ALTER TABLE declare_request_id add ( + declare_request_id varchar2(100) +); +/ + diff --git a/resource/sqlupgrade/ST/sql202312270703.sql b/resource/sqlupgrade/ST/sql202312270703.sql new file mode 100644 index 000000000..fa59157ed --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312270703.sql @@ -0,0 +1,3 @@ +update hrsa_tax_declaration_value set source = 0; +/ + diff --git a/resource/sqlupgrade/ST/sql202401080103.sql b/resource/sqlupgrade/ST/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java new file mode 100644 index 000000000..838c4c494 --- /dev/null +++ b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java @@ -0,0 +1,83 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.util.db.MapperProxyFactory; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName FileSalaryAcctRecordAction + * @date 2023/12/13 9:17 + * @description 钖祫鏍哥畻璁板綍褰掓。action + */ +@Slf4j +public class FileSalaryAcctRecordAction implements Action { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + + private String recordIdFieldName; + + + public String getRecordIdFieldName() { + return recordIdFieldName; + } + + public void setRecordIdFieldName(String recordIdFieldName) { + this.recordIdFieldName = recordIdFieldName; + } + + @Override + public String execute(RequestInfo requestInfo) { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + String salaryAcctRecordId = fieldMap.get(recordIdFieldName); + if (StringUtils.isBlank(salaryAcctRecordId)) { + requestInfo.getRequestManager().setMessage("钖祫鏍哥畻璁板綍涓嶅瓨鍦"); + return FAILURE_AND_CONTINUE; + } + User user = new User(); + user.setUid(1); + Long acctRecordId = Long.valueOf(salaryAcctRecordId); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(acctRecordId); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("钖祫鏍哥畻璁板綍涓嶅瓨鍦,鎴栧凡琚垹闄"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() > 1) { + BaseBean baseBean = new BaseBean(); + baseBean.writeLog("鏍哥畻璁板綍褰掓。action锛 璇ユ牳绠楄褰曞凡缁忓綊妗o細" + salaryAcctRecordPO.getId()); + return SUCCESS; + } + try { + getSalaryAcctRecordService(user).file(acctRecordId); + } catch (Exception e) { + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/action/SendSalaryAction.java b/src/com/engine/salary/action/SendSalaryAction.java new file mode 100644 index 000000000..f0f3ef154 --- /dev/null +++ b/src/com/engine/salary/action/SendSalaryAction.java @@ -0,0 +1,118 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.biz.SalarySendInfoBiz; +import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.SalaryBillService; +import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.service.impl.SalaryBillServiceImpl; +import com.engine.salary.service.impl.SalarySendServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName FileSalaryAcctRecordAction + * @date 2023/12/13 9:17 + * @description 宸ヨ祫鍗曞彂鏀綼ction + */ +@Slf4j +public class SendSalaryAction implements Action { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySendService getSalarySendService(User user) { + return ServiceUtil.getService(SalarySendServiceImpl.class, user); + } + + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); + } + + private SalarySendInfoBiz salarySendInfoMapper = new SalarySendInfoBiz(); + + private SalaryBillService getSalaryBillService(User user) { + return ServiceUtil.getService(SalaryBillServiceImpl.class, user); + } + + + /** + * 鍙戞斁id锛堟牳绠楄褰昳d锛屽伐璧勫崟id锛夋祦绋嬪瓧娈靛悕 + */ + private String idFieldName; + + /** + * 鏍规嵁浠涔坕d锛堟牳绠楄褰昳d锛屽伐璧勫崟id锛夊彂宸ヨ祫鍗 + */ + private String sendBy; + + + @Override + public String execute(RequestInfo requestInfo) { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + String idStr = fieldMap.get(idFieldName); + if (StringUtils.isBlank(idStr)) { + requestInfo.getRequestManager().setMessage("鏍哥畻璁板綍id鎴栧伐璧勫崟id涓嶈兘涓虹┖"); + return FAILURE_AND_CONTINUE; + } + User user = new User(); + user.setUid(1); + Long id = Long.valueOf(idStr); + SalarySendPO salarySendPO; + if(!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salaryAcctRecordId")) { + // 鏍规嵁鏍哥畻璁板綍id鍙 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(id); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("钖祫鏍哥畻璁板綍涓嶅瓨鍦,鎴栧凡琚垹闄"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() == 1) { + requestInfo.getRequestManager().setMessage("鏍哥畻璁板綍杩樻湭褰掓。,璇峰厛褰掓。"); + return FAILURE_AND_CONTINUE; + } + // 鑾峰彇宸ヨ祫鍗昳d + List salarySendPOList = getSalarySendService(user).listSome(SalarySendPO.builder().salaryAccountingId(id).sendStatus(0).build()); + salarySendPO = salarySendPOList.get(0); + } else if (!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salarySendId")) { + // 鏍规嵁宸ヨ祫鍗曞彂 + salarySendPO = getSalarySendService(user).getById(id); + } else { + requestInfo.getRequestManager().setMessage("璇峰厛缁存姢鏍规嵁浠涔坕d鍙戞斁宸ヨ祫鍗曠殑sendBy鍙傛暟"); + return FAILURE_AND_CONTINUE; + } + + if (salarySendPO == null || salarySendPO.getId() == null) { + requestInfo.getRequestManager().setMessage("宸ヨ祫鍗曚笉瀛樺湪鎴栧凡琚垹闄わ紒"); + return FAILURE_AND_CONTINUE; + } + try { + // 鍏ㄩ儴鍙戞斁 + getSalaryBillService(user).grant(SalarySendGrantParam.builder().salarySendId(salarySendPO.getId()).build()); + } catch (Exception e) { + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 34b6aae17..7c661b682 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -7,7 +7,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; @@ -631,11 +630,13 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -719,7 +720,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楀叾浠栫殑绂忓埄id 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -742,10 +749,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -787,6 +795,7 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -794,6 +803,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -876,7 +886,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楀叕绉噾鐨勭鍒﹊d 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -899,10 +915,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -945,12 +962,14 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1036,7 +1055,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楃ぞ淇濈殑绂忓埄id 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1059,10 +1084,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1510,7 +1536,6 @@ public class SIAccountBiz extends Service { } else { accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); } - } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { @@ -1532,11 +1557,13 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -1611,7 +1638,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楀叾浠栫殑绂忓埄id 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1626,10 +1659,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1671,6 +1705,7 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -1678,6 +1713,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -1751,7 +1787,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楀叕绉噾鐨勭鍒﹊d 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1766,10 +1808,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1812,12 +1855,14 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1896,7 +1941,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //妗f涓寘鍚殑鍩烘暟淇℃伅 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //闇瑕佹牳绠楃ぞ淇濈殑绂忓埄id 鍗曚綅 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1911,10 +1962,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1964,6 +2016,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //鍒ゆ柇鏄惁鍦ㄨ捣濮嬬即绾虫湀鍜屾渶鍚庣即绾虫湀涔嬮棿 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 528849995..4f62417c6 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -13,8 +13,8 @@ import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; @@ -37,6 +37,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.enums.OpenEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -65,6 +69,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl @@ -113,6 +119,10 @@ public class SIArchivesBiz { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -266,15 +276,18 @@ public class SIArchivesBiz { */ public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); + //鍒ゆ柇鏄惁瑕佸尯鍒嗕釜浜哄拰鍗曚綅绂忓埄鍩烘暟 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; default: } @@ -289,17 +302,27 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("鍏跺畠绂忓埄缂寸撼鍩烘暟", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("鍏跺畠绂忓埄缂寸撼鍩烘暟", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -311,18 +334,28 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("鍏Н閲戠即绾冲熀鏁", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("鍏Н閲戠即绾冲熀鏁", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -334,18 +367,28 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("绀句繚缂寸撼鍩烘暟", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("绀句繚缂寸撼鍩烘暟", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -361,9 +404,27 @@ public class SIArchivesBiz { if (schemeId == null) { return new ArrayList<>(); } - List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new) - ); + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + SICategoryBiz siCategoryBiz = new SICategoryBiz(); + list.forEach(insuranceSchemeDetail -> { + ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); SICategoryBiz siCategoryBiz = new SICategoryBiz(); list.forEach(insuranceSchemeDetail -> { ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); @@ -621,17 +682,20 @@ public class SIArchivesBiz { * @param param * @param employeeId */ - public void insert(InsuranceArchivesSaveParam param, long employeeId) { + public void insert(InsuranceArchivesSaveParam param, User user) { SalaryAssert.notNull(param.getWelfareType(), "绂忓埄绫诲瀷涓虹┖"); + //鍒ゆ柇鏄惁瑕佸尯鍒嗕釜浜哄拰鍗曚綅绂忓埄鍩烘暟 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (param.getWelfareType()) { case SOCIAL_SECURITY: - socialSave(param, employeeId); + socialSave(param, user, welBaseDiffSign); break; case ACCUMULATION_FUND: - fundSave(param, employeeId); + fundSave(param, user, welBaseDiffSign); break; case OTHER: - otherSave(param, employeeId); + otherSave(param, user, welBaseDiffSign); break; default: throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); @@ -641,9 +705,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void otherSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); @@ -666,6 +731,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getOtherSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -677,6 +743,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); //鏂版暟鎹 InsuranceArchivesOtherSchemePO updateOtherInfo = InsuranceArchivesOtherSchemePO.builder() @@ -696,9 +763,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝 - if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("鍏朵粬绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("鍏朵粬绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.updateById(updateOtherInfo); //鏇存柊base_info琛ㄧ姸鎬 @@ -706,8 +781,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //瀵逛簬闈炵郴缁熶汉鍛橈紝缂栬緫鍚庣姸鎬佸垏鎹负姝e湪缂寸撼 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -732,9 +808,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝 - if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("鍏朵粬绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("鍏朵粬绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.insert(insertOtherInfo); sqlSession.commit(); @@ -768,9 +852,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void fundSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); @@ -792,6 +877,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getFundSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -803,6 +889,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); //鏂版暟鎹 InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() .id(oldFundInfo.getId()) @@ -823,9 +910,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝 - if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("鍏Н閲戠鍒╂槑缁嗕腑鐨勫熀鏁版洿鏂板唴瀹逛笉绗﹀悎鐩稿叧鍩烘暟涓婁笅闄愯姹傦紝璇锋鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("鍏Н閲戠鍒╂槑缁嗕腑鐨勫熀鏁版洿鏂板唴瀹逛笉绗﹀悎鐩稿叧鍩烘暟涓婁笅闄愯姹傦紝璇锋鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.updateById(updateFundInfo); //鏇存柊base_info琛ㄧ姸鎬 @@ -833,8 +928,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //瀵逛簬闈炵郴缁熶汉鍛橈紝缂栬緫鍚庣姸鎬佸垏鎹负姝e湪缂寸撼 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -861,9 +957,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝 - if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("鍏Н閲戠鍒╂槑缁嗕腑鐨勫熀鏁版洿鏂板唴瀹逛笉绗﹀悎鐩稿叧鍩烘暟涓婁笅闄愯姹傦紝璇锋鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("鍏Н閲戠鍒╂槑缁嗕腑鐨勫熀鏁版洿鏂板唴瀹逛笉绗﹀悎鐩稿叧鍩烘暟涓婁笅闄愯姹傦紝璇锋鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.insert(insertFundInfo); sqlSession.commit(); @@ -899,10 +1003,10 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ - public void socialSave(InsuranceArchivesSaveParam paramReq, long employeeId) { - + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); @@ -929,6 +1033,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getSocialSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -942,6 +1047,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); //鏂版暟鎹 InsuranceArchivesSocialSchemePO updateSocialInfo = InsuranceArchivesSocialSchemePO.builder() @@ -962,9 +1068,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 - if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("绀句繚绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("绀句繚绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.updateById(updateSocialInfo); //鏇存柊base_info琛ㄧ姸鎬 @@ -972,8 +1086,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //瀵逛簬闈炵郴缁熶汉鍛橈紝缂栬緫鍚庣姸鎬佸垏鎹负姝e湪缂寸撼 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() @@ -1000,9 +1115,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 - if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("绀句繚绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); } + //闇瑕佹媶鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟鏃 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("绀句繚绂忓埄鏄庣粏涓殑鍩烘暟鏇存柊鍐呭涓嶇鍚堢浉鍏冲熀鏁颁笂涓嬮檺瑕佹眰锛岃妫鏌ュ悗閲嶈瘯锛"); + } + } encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.insert(insertSocialInfo); sqlSession.commit(); @@ -1040,14 +1163,11 @@ public class SIArchivesBiz { * @param paymentBaseString * @return */ - public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString) { + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { if (primaryId ==null || paymentBaseString == null) { return true; } - //璁剧疆缂寸撼瀵硅薄鍜岀即璐圭姸鎬 -// Integer paymentScope = 2; -// Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -1071,7 +1191,7 @@ public class SIArchivesBiz { return false; } List isPaymentList = insuranceSchemeDetailPOList.stream() - .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); if (isPaymentList.size() > 0) { InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); @@ -1097,6 +1217,64 @@ public class SIArchivesBiz { return true; } + + /** + * 鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝骞惰繑鍥炵鍚堣姹傜殑鏁版嵁 + * @param primaryId + * @param paymentBaseString + * @return + */ + public String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return paymentBaseString; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + Map newPaymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + if (paymentBaseJson == null) { + return null; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + + //鍒ゆ柇绂忓埄鍊兼槸鍚︿负绌/鏁板瓧 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("绂忓埄鍊奸潪鏁板瓧锛"); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + //鏍规嵁绂忓埄鏂规id銆侀櫓绉峣d + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("绂忓埄鏂规id: {},, 绂忓埄鏄庣粏椤筰d锛歿}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("鏍规嵁绂忓埄鏂规id銆侀櫓绉峣d銆佺即绾冲璞℃煡璇㈡槑缁嗕负null锛佺鍒╂柟妗坕d: {}, 绂忓埄鏄庣粏椤筰d锛歿}", primaryId, Long.valueOf(entry.getKey())); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + List checkList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (checkList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = checkList.get(0); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //鏁板间綆浜庡搴旂鍒╂槑缁嗕笅闄 + log.info("绀句繚鍩烘暟 {} 鏁板 {} 浣庝簬瀵瑰簲绂忓埄鏄庣粏涓嬮檺 {}锛", entry.getKey(), entry.getValue(), lowerLimit); + newPaymentBaseJson.put(entry.getKey(), lowerLimit); + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //鏁板奸珮浜庡搴旂鍒╂槑缁嗕笂闄 + log.info("绀句繚鍩烘暟 {} 鏁板 {} 楂樹簬瀵瑰簲绂忓埄鏄庣粏涓婇檺 {} 锛", entry.getKey(), entry.getValue(), upperLimit); + newPaymentBaseJson.put(entry.getKey(), upperLimit); + } + } + } + return JSON.toJSONString(newPaymentBaseJson); + } + /** * 妗f鍒楄〃 *

@@ -1279,6 +1457,7 @@ public class SIArchivesBiz { * @return */ public List buildWeaTableColumns(List insuranceArchivesEmployeePOS, long operateId) { + Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId); List list = new ArrayList<>(); WeaTableColumn nameColumn = new WeaTableColumn("100px", "濮撳悕", "employeeName"); @@ -1318,6 +1497,9 @@ public class SIArchivesBiz { * @return */ public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId) { + + boolean welBaseDiffSign = isDiffWelBase(); + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); @@ -1333,16 +1515,17 @@ public class SIArchivesBiz { Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); -// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); -// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); -// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; if (socialList.size() > 0) { for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { @@ -1351,6 +1534,14 @@ public class SIArchivesBiz { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } } @@ -1361,6 +1552,14 @@ public class SIArchivesBiz { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } } @@ -1371,11 +1570,20 @@ public class SIArchivesBiz { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); @@ -1385,34 +1593,76 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "鐢虫姤鍩烘暟"); - } - }); + + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "鐢虫姤鍩烘暟"); - } - }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "鐢虫姤鍩烘暟"); - } - }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } // map鏍规嵁key鎺掑簭 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() .sorted(Map.Entry.comparingByKey()) @@ -1426,6 +1676,23 @@ public class SIArchivesBiz { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1448,6 +1715,9 @@ public class SIArchivesBiz { * @return */ public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + + boolean welBaseDiffSign = isDiffWelBase(); + List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -1495,16 +1765,39 @@ public class SIArchivesBiz { map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); map.put("socialEndTime", socialItem.getSocialEndTime()); @@ -1514,16 +1807,39 @@ public class SIArchivesBiz { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); map.put("fundEndTime", fundItem.getFundEndTime()); @@ -1533,16 +1849,39 @@ public class SIArchivesBiz { map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); } @@ -1565,6 +1904,19 @@ public class SIArchivesBiz { } return insuranceIdList; } + + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //寮鍚即绾崇殑 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + /** * 鑾峰彇淇℃伅鎻愮ず */ @@ -1906,6 +2258,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getSocialSchemeId()) .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1915,6 +2268,7 @@ public class SIArchivesBiz { InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"绀句繚妗f瀛樺湪鍐椾綑鏁版嵁锛")); @@ -1936,6 +2290,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getFundSchemeId()) .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1945,6 +2300,7 @@ public class SIArchivesBiz { InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"鍏Н閲戞。妗堝瓨鍦ㄥ啑浣欐暟鎹紒")); @@ -1965,6 +2321,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getOtherSchemeId()) .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -1974,6 +2331,7 @@ public class SIArchivesBiz { InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"鍏朵粬绂忓埄妗f瀛樺湪鍐椾綑鏁版嵁锛")); @@ -1987,6 +2345,8 @@ public class SIArchivesBiz { //鐢熸垚鍩烘暟璋冩暣璁板綍锛堝熀鏁板崟鍏冩湭鍙樺寲鍒欏拷鐣ワ級 public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); + boolean welBaseDiffSign = isDiffWelBase(); + List toCreateAdjustHistoryList = new ArrayList<>(); //鏃ф。妗堜笉瀛樺湪鍩烘暟淇℃伅锛屽垯鐩存帴閬嶅巻鏂扮殑鍩烘暟鏁版嵁锛岀敓鎴愯皟鏁磋褰曪紱鏃ф。妗堝瓨鍦ㄥ熀鏁颁俊鎭紝鍒欏悎骞舵柊鏃у熀鏁版暟鎹紝閬嶅巻鍚堝苟鍚庣殑鎶鏈暟鎹腑鐨刱ey锛岀敓鎴愯皟鏁磋褰曘 if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2005,6 +2365,7 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2039,12 +2400,75 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } } + //濡傛灉绯荤粺搴旂敤璁剧疆鎷嗗垎浜嗕釜浜哄拰鍏徃绂忓埄鍩烘暟锛屽垯瀵筧djustBeforeComBaseJson锛宎djustAfterComBaseJson涔熻繘琛屽鐞 + if (welBaseDiffSign) { + //鏃ф。妗堜笉瀛樺湪鍩烘暟淇℃伅锛屽垯鐩存帴閬嶅巻鏂扮殑鍩烘暟鏁版嵁锛岀敓鎴愯皟鏁磋褰曪紱鏃ф。妗堝瓨鍦ㄥ熀鏁颁俊鎭紝鍒欏悎骞舵柊鏃у熀鏁版暟鎹紝閬嶅巻鍚堝苟鍚庣殑鎶鏈暟鎹腑鐨刱ey锛岀敓鎴愯皟鏁磋褰曘 + if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } return toCreateAdjustHistoryList; } @@ -2123,4 +2547,12 @@ public class SIArchivesBiz { list.add(new WeaTableColumn("150px", "鎿嶄綔鏃堕棿", "operatorTime")); return list; } + + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //鍒ゆ柇鏄惁瑕佸尯鍒嗕釜浜哄拰鍗曚綅绂忓埄鍩烘暟 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } } diff --git a/src/com/engine/salary/component/WeaTableColumnGroup.java b/src/com/engine/salary/component/WeaTableColumnGroup.java index dac9a3569..0dcd305af 100644 --- a/src/com/engine/salary/component/WeaTableColumnGroup.java +++ b/src/com/engine/salary/component/WeaTableColumnGroup.java @@ -18,6 +18,11 @@ public class WeaTableColumnGroup extends WeaTableColumn { */ private Integer pattern; + /** + * 瀛楁绫诲瀷 + */ + private String dataType; + private List children; public WeaTableColumnGroup() { @@ -40,6 +45,13 @@ public class WeaTableColumnGroup extends WeaTableColumn { this.pattern = pattern; } + public WeaTableColumnGroup(String width, String text, String column, String lockStatus, Integer pattern, String dataType) { + super(width, text, column); + this.lockStatus = lockStatus; + this.pattern = pattern; + this.dataType = dataType; + } + public WeaTableColumnGroup(String width, String text, String column, List children) { super(width, text, column); diff --git a/src/com/engine/salary/constant/SzyhApiConstant.java b/src/com/engine/salary/constant/SzyhApiConstant.java index b4e04552a..608bf61a4 100644 --- a/src/com/engine/salary/constant/SzyhApiConstant.java +++ b/src/com/engine/salary/constant/SzyhApiConstant.java @@ -75,6 +75,11 @@ public class SzyhApiConstant { */ public static final String UPDATE_DECLARE = "/gateway/iit/report/correct"; + /** + * 鎾ら攢鏇存鐢虫姤 + */ + public static final String CANCEL_CORRECT = "gateway/iit/report/cancelCorrect"; + /** * 绋庡眬绔敵鎶ョ姸鎬佹煡璇 */ diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java new file mode 100644 index 000000000..48898d83d --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -0,0 +1,46 @@ +package com.engine.salary.entity.employeedeclare.bo; + +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import org.apache.commons.lang3.StringUtils; + +/** + * @author Harryxzy + * @ClassName EmployeeDeclareBO + * @date 2023/12/27 14:13 + * @description + */ +public class EmployeeDeclareBO { + + public static EmployeeDeclarePO convert2PO(EmployeeDeclareExcelDTO dto) { + if (dto == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鍙傛暟閿欒")); + } + EmployeeDeclarePO po = EmployeeDeclarePO.builder() + .jobNum(dto.getJobNum()) + .employeeName(dto.getEmployeeName()) + .cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) + .cardNum(dto.getCardNum()) + .employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) + .employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType())) + .employmentFirstYear(dto.getEmploymentFirstYear()) + .mobile(dto.getMobile()) + .employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) ) + .dismissDate(StringUtils.isBlank(dto.getDismissDate()) ? null : SalaryDateUtil.stringToDate(dto.getDismissDate())) + .disability(dto.getDisability()) + .disabilityCardNo(dto.getDisabilityCardNo()) + .martyrDependents(dto.getMartyrDependents()) + .martyrDependentsCardNo(dto.getMartyrDependentsCardNo()) + .lonelyOld(dto.getLonelyOld()) + .deductExpenses(dto.getDeductExpenses()) + .gender(StringUtils.isBlank(dto.getGender()) ? null : new Integer(dto.getGender())) + .birthday(StringUtils.isBlank(dto.getBirthday()) ? null : SalaryDateUtil.stringToDate(dto.getBirthday())) + .build(); + return po; + } + +} diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index 3ef2357b2..f3223479e 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -105,7 +105,7 @@ public class EmployeeDeclareRefresh { } EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId); DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId()); - String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo(); + String idNum = simpleUserInfo != null && simpleUserInfo.getIdNo() != null ? simpleUserInfo.getIdNo().toUpperCase() : ""; employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId()); employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); employeeDeclare.setEmployeeName(hrmEmployeeComInfo.getUsername()); diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java new file mode 100644 index 000000000..8880ce557 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -0,0 +1,147 @@ +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 EmployeeDeclareExcelDTO { + + // 涓婚敭id + private Long id; + + // 浜哄憳ID + private Long employeeId; + + // 浜哄憳绫诲瀷 + private EmployeeTypeEnum employeeType; + + + // 濮撳悕 + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "employeeName") + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + private String employeeName; + + // 鍒嗛儴 + @SalaryTableColumn(text = "鍒嗛儴", width = "10%", column = "subCompanyName") + @TableTitle(title = "鍒嗛儴", dataIndex = "subCompanyName", key = "subCompanyName") + private String subCompanyName; + + // 閮ㄩ棬 + @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") + @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + + // 涓◣鎵g即涔夊姟浜 + @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + private String taxAgentName; + + // 宸ュ彿 + @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + private String jobNum; + + // 璇佷欢绫诲瀷 + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "cardType") + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + private 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; + + // 鍏ヨ亴骞村害灏变笟鎯呭舰 + private String employmentFirstYear; + + + // 绂昏亴鏃ユ湡 + @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "dismissDate") + @TableTitle(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate", key = "dismissDate") + private String dismissDate; + + // 鏄惁娈嬬柧 + private Integer disability; + + // 娈嬬柧璇佸彿 + private String disabilityCardNo; + + // 鏄惁瀛よ + private Integer lonelyOld; + + // 鏄惁鏄儓灞 + private Integer martyrDependents; + + // 鐑堝睘璇佸彿 + private String martyrDependentsCardNo; + + // 鏄惁鎵i櫎鍑忛櫎璐圭敤 + private Integer deductExpenses; + + // 鐢虫姤鐘舵 + private DeclareStatusEnum declareStatus; + + // 鐢虫姤鐘舵 + @SalaryTableColumn(text = "鐢虫姤鐘舵", width = "10%", column = "declareStatusDesc") + @TableTitle(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + private String declareStatusDesc; + + // 鐢虫姤澶辫触鍘熷洜 + private String declareErrorMsg; + + // 缂栬緫杩囩殑瀛楁 + private Set updatedDataIndexSet; +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java index 93a06d3b5..76af21666 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareListDTO.java @@ -5,6 +5,7 @@ import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelHead; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,72 +43,86 @@ public class EmployeeDeclareListDTO { // 濮撳悕 @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "employeeName") @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "濮撳悕", dataIndex = "employeeName") private String employeeName; // 鍒嗛儴 @SalaryTableColumn(text = "鍒嗛儴", width = "10%", column = "subCompanyName") @TableTitle(title = "鍒嗛儴", dataIndex = "subCompanyName", key = "subCompanyName") + @ExcelHead(title = "鍒嗛儴", dataIndex = "subCompanyName") private String subCompanyName; // 閮ㄩ棬 @SalaryTableColumn(text = "閮ㄩ棬", width = "10%", column = "departmentName") @TableTitle(title = "閮ㄩ棬", dataIndex = "departmentName", key = "departmentName") + @ExcelHead(title = "閮ㄩ棬", dataIndex = "departmentName") private String departmentName; // 涓◣鎵g即涔夊姟浜 @SalaryTableColumn(text = "涓◣鎵g即涔夊姟浜", width = "10%", column = "taxAgentName") @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName") private String taxAgentName; // 宸ュ彿 @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "宸ュ彿", dataIndex = "jobNum") private String jobNum; // 璇佷欢绫诲瀷 @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "cardType") @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "cardType") private String cardType; // 璇佷欢鍙风爜 @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "cardNum") @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") private String cardNum; // 鎬у埆 @SalaryTableColumn(text = "鎬у埆", width = "10%", column = "gender") @TableTitle(title = "鎬у埆", dataIndex = "gender", key = "gender") + @ExcelHead(title = "鎬у埆", dataIndex = "gender") private String gender; // 鍑虹敓鏃ユ湡 @SalaryTableColumn(text = "鍑虹敓鏃ユ湡", width = "10%", column = "birthday") @TableTitle(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday", key = "birthday") + @ExcelHead(title = "鍑虹敓鏃ユ湡", dataIndex = "birthday") private String birthday; // 浜哄憳鐘舵 @SalaryTableColumn(text = "浜哄憳鐘舵", width = "10%", column = "employmentStatus") @TableTitle(title = "浜哄憳鐘舵", dataIndex = "employmentStatus", key = "employmentStatus") + @ExcelHead(title = "浜哄憳鐘舵", dataIndex = "employmentStatus") private String employmentStatus; // 鎵嬫満鍙风爜 @SalaryTableColumn(text = "鎵嬫満鍙风爜", width = "10%", column = "mobile") @TableTitle(title = "鎵嬫満鍙风爜", dataIndex = "mobile", key = "mobile") + @ExcelHead(title = "鎵嬫満鍙风爜", dataIndex = "mobile") private String mobile; // 浠昏亴鍙楅泧浠庝笟绫诲瀷 @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟绫诲瀷", width = "10%", column = "employmentType") @TableTitle(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType", key = "employmentType") + @ExcelHead(title = "浠昏亴鍙楅泧浠庝笟绫诲瀷", dataIndex = "employmentType") private String employmentType; // 浠昏亴鍙楅泧浠庝笟鏃ユ湡 @SalaryTableColumn(text = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", width = "10%", column = "employmentDate") @TableTitle(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate", key = "employmentDate") + @ExcelHead(title = "浠昏亴鍙楅泧浠庝笟鏃ユ湡", dataIndex = "employmentDate") private String employmentDate; // 绂昏亴鏃ユ湡 @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "dismissDate") @TableTitle(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate", key = "dismissDate") + @ExcelHead(title = "绂昏亴鏃ユ湡", dataIndex = "dismissDate") private String dismissDate; // 鐢虫姤鐘舵 @@ -116,6 +131,7 @@ public class EmployeeDeclareListDTO { // 鐢虫姤鐘舵 @SalaryTableColumn(text = "鐢虫姤鐘舵", width = "10%", column = "declareStatusDesc") @TableTitle(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc", key = "declareStatusDesc") + @ExcelHead(title = "鐢虫姤鐘舵", dataIndex = "declareStatusDesc") private String declareStatusDesc; // 鐢虫姤澶辫触鍘熷洜 diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java new file mode 100644 index 000000000..16f994ee5 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportEmployeeParam.java @@ -0,0 +1,30 @@ +package com.engine.salary.entity.employeedeclare.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ弬鏁 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class EmployeeDeclareImportEmployeeParam { + //涓婁紶鏂囦欢id + String imageId; + + Long taxAgentId; + + Date taxCycle; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java new file mode 100644 index 000000000..114013a90 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareImportParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.employeedeclare.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 浜哄憳鎶ラ佸鍏ュ弬鏁 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 2022/11/21 4:58 PM + * @version:v1.0 + */ +@Data +public class EmployeeDeclareImportParam extends EmployeeDeclareListQueryParam { + + @ApiModelProperty("鏄惁瀵煎嚭鐜版湁鏁版嵁") + private String exportData; + + //涓婁紶鏂囦欢id + String imageId; + + // 鏍¢獙瀛楁 + private String checkType; + + // 涓◣鎵d箟鍔′汉id + private Long taxAgentId; + +} diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java index e569ecbf1..27222c08f 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareListQueryParam.java @@ -48,6 +48,7 @@ public class EmployeeDeclareListQueryParam extends BaseQueryParam { // 鍛樺伐濮撳悕/缂栧彿 private String keyword; + private Long employeeId; // 閮ㄩ棬 private Collection departmentIds; diff --git a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java index 6a23857a5..06cb10a8a 100644 --- a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java +++ b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java @@ -62,7 +62,6 @@ public class SalaryAcctResultReportBO { .collect(Collectors.toList()); } - public static List convert2ReportPO(Collection temps, Map emps) { // Map longDataCollectionEmployeeMap = SalaryEntityUtil.convert2Map(emps, DataCollectionEmployee::getEmployeeId); if (CollectionUtils.isEmpty(temps)) { diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java index 893b0d55e..cd7af96ba 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java @@ -167,6 +167,8 @@ public class SalaryTemplateBO { .id(String.valueOf(e.getSalaryItemId())) .salaryItemId(String.valueOf(e.getSalaryItemId())) .name(e.getName()) + .salaryItemShowName(e.getName()) + .originName(e.getName()) .sortedIndex(e.getSortedIndex()) .build() ); diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 896b615a0..1a42fb1c5 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryacct.bo; +import cn.hutool.core.util.NumberUtil; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.common.LocalDateRange; import com.engine.salary.constant.SalaryFormulaFieldConstant; @@ -18,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum; @@ -562,6 +564,10 @@ public class CalculateFormulaVarBO { } // 濉厖鍒拌繑鍥炵粨鏋滈泦涓 employeeMap.forEach((key, po) -> { + // 鑾峰彇po鐨勭姸鎬 + if(po.getStatus() != null && NumberUtil.isNumber(po.getStatus())) { + po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(po.getStatus()))); + } List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); Map map = JsonUtil.parseMap(po, String.class); formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 8713f49fe..39434c235 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -23,9 +23,11 @@ import com.engine.salary.enums.salaryaccounting.LockStatusEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; @@ -85,7 +87,6 @@ public class SalaryAcctResultBO { // } - /** * 鏋勫缓钖祫鏍哥畻缁撴灉鍒楄〃鐨勮〃澶达紙绾夸笅瀵规瘮锛 * @@ -170,7 +171,7 @@ public class SalaryAcctResultBO { List columns = Lists.newArrayList(); // 鍛樺伐淇℃伅瀛楁 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new WeaTableColumnGroup("150", salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName(), 0), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); } // 钖祫椤圭洰鍒嗙粍涓嬬殑钖祫椤圭洰 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { @@ -180,29 +181,29 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } - WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup("150", salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName(), 0), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); columns.add(weaTableColumnWapper); } // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } // 鍥炵畻鐨勮柂璧勯」鐩 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } @@ -462,7 +463,8 @@ public class SalaryAcctResultBO { List salarySobBackItemPOS, List salaryBackItemPOS, Map salaryBackItemFormula, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { // 鍛樺伐淇℃伅瀛楁 Map employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee); @@ -487,24 +489,24 @@ public class SalaryAcctResultBO { sortItem(salarySobItemPOMap); // 鏍规嵁璐﹀鍒嗙粍灏佽钖祫椤圭洰鐨勫 List itemsByGroup = new ArrayList<>(); - for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){ - List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); - if(CollectionUtils.isNotEmpty(groupItems)){ + for (SalarySobItemGroupPO groupPO : salarySobItemGroupPOS) { + List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(), Collections.emptyList()); + if (CollectionUtils.isNotEmpty(groupItems)) { List items = groupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(groupPO.getId()) .salarySobItemGroupName(groupPO.getName()) .salaryItems(items) - .sortedIndex(groupPO.getSortedIndex()).build() ); + .sortedIndex(groupPO.getSortedIndex()).build()); } } // 鏈垎绫 List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); - if(CollectionUtils.isNotEmpty(noGroupItems)){ + if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(0L) @@ -514,7 +516,6 @@ public class SalaryAcctResultBO { } - // // 鍏紡椤圭殑鍊硷紙涓嶆牴鎹畇alaryItemPO鐨剉alueType鍒ゆ柇鏄洜涓鸿柂璧勯」鐩殑valueType灞炴ф敼鍙樺悗骞朵笉浼氬悓姝ユ洿鏂拌柂璧勮处濂椾腑鐨勮柂璧勯」鐩殑formulaId瀛楁锛 // List formulaItems = salarySobItemPOS.stream() // .filter(salarySobItemPO -> salarySobItemPO.getFormulaId() > 0) @@ -545,7 +546,7 @@ public class SalaryAcctResultBO { } public static List sortGroup(List salarySobItemGroupPOS) { - if(CollectionUtils.isEmpty(salarySobItemGroupPOS)){ + if (CollectionUtils.isEmpty(salarySobItemGroupPOS)) { return Collections.emptyList(); } return salarySobItemGroupPOS.stream().sorted(Comparator.comparingInt(SalarySobItemGroupPO::getSortedIndex)).collect(Collectors.toList()); @@ -553,10 +554,9 @@ public class SalaryAcctResultBO { /** * 钖祫璐﹀鐨勮柂璧勯」鐩寜鐓ortedIndex鎺掑簭 - * */ public static void sortItem(Map> salarySobItemPOMap) { - for(Map.Entry> entry : salarySobItemPOMap.entrySet()){ + for (Map.Entry> entry : salarySobItemPOMap.entrySet()) { List items = entry.getValue(); if (CollectionUtils.isNotEmpty(items)) { List sortedValue = items.stream().sorted(Comparator.comparingInt(SalarySobItemPO::getSortedIndex)).collect(Collectors.toList()); @@ -576,13 +576,14 @@ public class SalaryAcctResultBO { private static SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO convert2SalaryAcctResultDetailItemDTO(SalarySobItemPO salarySobItemPO, SalaryItemPO salaryItemPO, Map resultValueMap, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0)); String itemFormulaContent; - if(Objects.equals(salaryValueTypeEnum.getValue(),SalaryValueTypeEnum.FORMULA.getValue())){ + if (Objects.equals(salaryValueTypeEnum.getValue(), SalaryValueTypeEnum.FORMULA.getValue())) { itemFormulaContent = Optional.ofNullable(formulaContentMap.get(salarySobItemPO.getSalaryItemId().toString())).map(SalaryAcctResultListColumnDTO::getFormulaContent).orElse(""); - }else{ + } else { itemFormulaContent = salaryValueTypeEnum == null ? "" : salaryValueTypeEnum.getDefaultLabel(); } @@ -596,6 +597,7 @@ public class SalaryAcctResultBO { // .canEdit(Objects.equals(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getUseInEmployeeSalary).orElse(0), 0)) .canEdit(true) .pattern(salarySobItemPO.getPattern()) + .lockStatus(lockItems.contains(salarySobItemPO.getSalaryItemId()) ? LockStatusEnum.LOCK.getValue() : LockStatusEnum.UNLOCK.getValue()) .build(); } @@ -662,6 +664,34 @@ public class SalaryAcctResultBO { .collect(Collectors.toList()); } + + public static List batchEditConvert2PO(Map salaryAcctResultOldPOMap, + List items, + SalaryAcctEmployeePO salaryAcctEmployee, + Long employeeId) { + if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { + return Collections.emptyList(); + } + Date now = new Date(); + return items.stream() + .map(e -> SalaryAcctResultPO.builder() + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(e.getSalaryItemId()) + .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .resultValue(StringUtils.trim(e.getResultValue())) + .originResultValue(salaryAcctResultOldPOMap.get(salaryAcctEmployee.getId() + "-" + e.getSalaryItemId())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()) + .collect(Collectors.toList()); + } + public static Map buildEmployeeFieldName() { Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields(); Map employeeFieldNameMap = Maps.newHashMapWithExpectedSize(declaredFields.length); diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 313779404..031b979db 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -72,6 +72,9 @@ public class SalaryAcctResultDetailDTO { // 淇濈暀灏忔暟浣嶆暟 private Integer pattern; + + // 閿佸畾鐘舵 + private String lockStatus; } @Data diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java new file mode 100644 index 000000000..89c06ad5e --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @ClassName SalaryAcctResultBatchUpdateParam + * @author Harryxzy + * @date 2023/12/4 13:48 + * @description 鎵归噺鏇存柊鍙傛暟 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SalaryAcctResultBatchUpdateParam { + + //钖祫鏍哥畻璁板綍鐨刬d + @DataCheck(require = true, message = "钖祫鏍哥畻璁板綍ID涓嶅緱涓虹┖") + private Long salaryAcctRecordId; + + //钖祫椤圭洰鐨処d + @DataCheck(require = true, message = "钖祫椤圭洰id涓嶅緱涓虹┖") + private Long salaryItemId; + + // 钖祫鏍哥畻浜哄憳id + private List idList; + + //钖祫椤圭洰鍊 + private String value; + +} diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index 12a02998d..505ce3264 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -88,4 +89,25 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { */ private boolean extSalaryArchiveList; + + private String payStartDateStartDateStr; + private String payStartDateEndDateStr; + + // 璧峰鍙戣柂鏃ユ湡璧 + private Date payStartDateStartDate; + + // 璧峰鍙戣柂鏃ユ湡姝 + private Date payStartDateEndDate; + + // 鏈鍚庡彂钖棩鏈熻捣 + private String payEndDateStartDateStr; + // 鏈鍚庡彂钖棩鏈熸 + private String payEndDateEndDateStr; + + // 鏈鍚庡彂钖棩鏈熻捣 + private Date payEndDateStartDate; + + // 鏈鍚庡彂钖棩鏈熸 + private Date payEndDateEndDate; + } diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index f65c9f924..c11c58954 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -117,6 +117,7 @@ public class SalaryItemBO { .description(salaryItemPO.getDescription()) .canDelete(true) .canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE)) + .width(salaryItemPO.getWidth()) .build(); } ).collect(Collectors.toList()); @@ -200,7 +201,8 @@ public class SalaryItemBO { .setCanEdit(salaryItemPO.getCanEdit()) .setTaxAgentIds(salaryItemPO.getTaxAgentIds()) .setSharedType(salaryItemPO.getSharedType()) - .setSortedIndex(salaryItemPO.getSortedIndex()); + .setSortedIndex(salaryItemPO.getSortedIndex()) + .setWidth(salaryItemPO.getWidth()); } /** @@ -280,6 +282,7 @@ public class SalaryItemBO { .sharedType(Optional.ofNullable(saveParam.getSharedType()).orElse(0)) .taxAgentIds(saveParam.getTaxAgentIds()) .sortedIndex(saveParam.getSortedIndex()) + .width(saveParam.getWidth()) .build(); // 寮鍚簡"钖祫妗f寮曠敤"锛屽彇鍊兼柟寮忓浐瀹氫负杈撳叆 // if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 5101bf2e4..da0c6d4d5 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -95,4 +95,7 @@ public class SalaryItemFormDTO { private String taxAgentIds; private Integer sortedIndex; + + // 瀹藉害 + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index adb0dc4b1..1e0af69d4 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -105,6 +105,9 @@ public class SalaryItemListDTO { @TableTitle(title = "鏄剧ず椤哄簭",dataIndex = "sortedIndex",key = "sortedIndex") private Integer sortedIndex; + // 瀹藉害 + private Integer width; + @SalaryTableColumn(text = "鎿嶄綔", width = "20%", column = "operate") private String operate; } diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index a2c6fa84b..a200cea77 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -63,7 +63,7 @@ public class SalaryItemSaveParam { private Integer roundingMode; //淇濈暀灏忔暟浣 - @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 6, message = "灏忔暟浣嶆渶澶氫负6") + @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "灏忔暟浣嶆渶澶氫负8") private Integer pattern; /** @@ -102,4 +102,9 @@ public class SalaryItemSaveParam { * 鎺掑簭 */ private Integer sortedIndex; + + /** + * 瀹藉害 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index 3115f0efa..3929bfed4 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -159,4 +159,9 @@ public class SalaryItemPO { * 鎺掑簭 */ private Integer sortedIndex; + + /** + * 瀹藉害 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index 69644766d..c9dd35107 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -14,6 +14,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -32,6 +33,7 @@ import java.util.stream.Collectors; * @version 1.0 **/ @AllArgsConstructor +@NoArgsConstructor public class SalarySobItemAggregateBO { /** @@ -148,6 +150,7 @@ public class SalarySobItemAggregateBO { .sortedIndex(salarySobItemPO.getSortedIndex()) .canEdit(openFormulaForcedEditing || Objects.equals(salaryItemPO.getCanEdit(), 1)) .canDelete(openFormulaForcedEditing || salaryItemPO.getCanDelete() == null || Objects.equals(salaryItemPO.getCanDelete(), 1)) + .width(salaryItemPO.getWidth()) .build()); } } @@ -213,7 +216,7 @@ public class SalarySobItemAggregateBO { * @param salarySobEmpFields 钖祫璐﹀鐨勫憳宸ヤ俊鎭瓧娈 * @return */ - private List buildEmpField(Collection salarySobEmpFields) { + public List buildEmpField(Collection salarySobEmpFields) { if (CollectionUtils.isEmpty(salarySobEmpFields)) { return Collections.emptyList(); } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index 22589189f..7a7276519 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -113,4 +113,7 @@ public class SalarySobItemDTO { * 淇濈暀灏忔暟浣嶆暟 */ private Integer pattern; + + // 鏄剧ず瀹藉害 + private Integer width; } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java index e040b8a33..17ef54223 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java @@ -57,7 +57,7 @@ public class SalarySobItemFormDTO { private Integer roundingMode; //淇濈暀灏忔暟浣") - @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 6, message = "灏忔暟浣嶆渶澶氫负6") + @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "灏忔暟浣嶆渶澶氫负8") private Integer pattern; //鍙栧兼柟寮") diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 6a85ddd20..c6e6b40a3 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -41,7 +41,7 @@ public class InsuranceComparisonResultBO { * 鏋勫缓绂忓埄鏍哥畻缁撴灉鍒楄〃鐨勮〃澶达紙绾夸笅瀵规瘮锛 * */ - public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet) { + public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, boolean welBaseDiffSign) { List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); @@ -67,21 +67,63 @@ public class InsuranceComparisonResultBO { columns.add(new Column("绀句繚璐﹀彿", "socialAccount", "socialAccount")); columns.add(new Column("绀句繚鏂规鍚嶇О", "socialSchemeName", "socialSchemeName")); //缁勮绀句繚鍩烘暟 - for (ICategoryPO po : socialWelfareList) { - columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "socialBase", po.getId() + "socialBase")); + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉") + , po.getId() + "socialPerBase", po.getId() + "socialPerBase")); + socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅") + , po.getId() + "socialComBase", po.getId() + "socialComBase")); + } + columns.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "socialBase", po.getId() + "socialBase")); + } } +// for (ICategoryPO po : socialWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "socialBase", po.getId() + "socialBase")); +// } columns.add(new Column("鍏Н閲戣处鍙", "fundAccount", "fundAccount")); columns.add(new Column("鍏Н閲戞柟妗堝悕绉", "fundSchemeName", "fundSchemeName")); //缁勮鍏Н閲戝熀鏁 - for (ICategoryPO po : fundWelfareList) { - columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "fundBase", po.getId() + "fundBase")); + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉") + , po.getId() + "fundPerBase", po.getId() + "fundPerBase")); + fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅") + , po.getId() + "fundComBase", po.getId() + "fundComBase")); + } + columns.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "fundBase", po.getId() + "fundBase")); + } } +// for (ICategoryPO po : fundWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "fundBase", po.getId() + "fundBase")); +// } columns.add(new Column("琛ュ厖鍏Н閲戣处鍙", "supplementFundAccount", "supplementFundAccount")); columns.add(new Column("鍏朵粬绂忓埄鏂规鍚嶇О", "otherSchemeName", "otherSchemeName")); //缁勮鍏朵粬绂忓埄鍩烘暟 - for (ICategoryPO po : otherWelfareList) { - columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "otherBase", po.getId() + "otherBase")); + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉") + , po.getId() + "otherPerBase", po.getId() + "otherPerBase")); + otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅") + , po.getId() + "otherComBase", po.getId() + "otherComBase")); + } + columns.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "otherBase", po.getId() + "otherBase")); + } } +// for (ICategoryPO po : otherWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "鐢虫姤鍩烘暟", po.getId() + "otherBase", po.getId() + "otherBase")); +// } //绀句繚涓汉锛堢敓鑲蹭繚闄╀釜浜恒佸伐浼や繚闄╀釜浜恒佸け涓氫繚闄╀釜浜恒佸吇鑰佷繚闄╀釜浜恒佸尰鐤椾繚闄╀釜浜猴級 for (ICategoryPO po : socialWelPerList) { @@ -127,7 +169,8 @@ public class InsuranceComparisonResultBO { * 鏋勫缓绂忓埄鏍哥畻绾夸笅瀵规瘮缁撴灉 * */ - public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap) { + public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS + , Map schemeIdNameMap, boolean welBaseDiffSign) { Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); @@ -177,12 +220,28 @@ public class InsuranceComparisonResultBO { if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); } - //绀句繚鍩烘暟锛宻ocialPaymentBaseString - welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); - //鍏Н閲戝熀鏁帮紝fundPaymentBaseString - welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); - //鍏朵粬绂忓埄鍩烘暟锛宱therPaymentBaseString - welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + if (welBaseDiffSign) { + //绀句繚鍩烘暟-涓汉锛宻ocialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1); + //鍏Н閲戝熀鏁-涓汉锛宖undPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2); + //鍏朵粬绂忓埄鍩烘暟-涓汉锛宱therPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3); + + //绀句繚鍩烘暟-鍏徃锛宻ocialPaymentComBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1); + //鍏Н閲戝熀鏁-鍏徃锛宖undPaymentComBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2); + //鍏朵粬绂忓埄鍩烘暟-鍏徃锛宱therPaymentComBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3); + } else { + //绀句繚鍩烘暟锛宻ocialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); + //鍏Н閲戝熀鏁帮紝fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); + //鍏朵粬绂忓埄鍩烘暟锛宱therPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + } //绀句繚涓汉socialPerJson welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1); //鍏Н閲戜釜浜篺undPerJson diff --git a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java index 17b926b08..7a9090845 100644 --- a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java +++ b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java @@ -25,5 +25,6 @@ public class ExcelInsuranceImportParam { /** * 璐﹀崟鏈堜唤 */ - private String billMonth; + private String billMonth; + private String paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java index 4e7889544..9660b8602 100644 --- a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java @@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 绀句繚缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 鍏Н閲戞柟妗圛D */ @@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 鍏Н閲戠即绾冲熀鏁扳斺斿崟浣 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 鍏朵粬绂忓埄鏂规id */ @@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 鍏朵粬绂忓埄缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 绀句繚涓汉缂磋垂鏄庣粏 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index e8f7ce98f..9cd2ad7f0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -106,6 +106,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 绀句繚缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 鍏Н閲戞柟妗圛D */ @@ -117,6 +123,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 鍏Н閲戠即绾冲熀鏁扳斺斿崟浣 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 鍏朵粬绂忓埄鏂规id */ @@ -128,6 +140,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 鍏朵粬绂忓埄缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 绀句繚涓汉缂磋垂鏄庣粏 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 50897c6b2..dc8c1c2c0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String socialPaymentBaseString; + /** + * 绀句繚缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String socialPaymentComBaseString; /** * 鍏Н閲戞柟妗圛D */ @@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String fundPaymentBaseString; + /** + * 鍏Н閲戠即绾冲熀鏁扳斺斿崟浣 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 鍏朵粬绂忓埄鏂规id */ @@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String otherPaymentBaseString; + /** + * 鍏朵粬绂忓埄缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String otherPaymentComBaseString; + + /** * 绀句繚涓汉缂磋垂鏄庣粏 */ diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java index a96b96aad..710038513 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java @@ -35,6 +35,7 @@ public class InsuranceArchivesBO { .socialStartTime(po.getSocialStartTime()) .schemeAccount(po.getSocialAccount()) .schemePaymentBaseString(po.getSocialPaymentBaseString()) + .schemePaymentComBaseString(po.getSocialPaymentComBaseString()) .underTake(po.getUnderTake() == null ? null : String.valueOf(po.getUnderTake())) .build(); } @@ -52,6 +53,7 @@ public class InsuranceArchivesBO { .fundSchemeId(po.getFundSchemeId()) .paymentOrganization(po.getPaymentOrganization()) .fundPaymentBaseString(po.getFundPaymentBaseString()) + .fundPaymentComBaseString(po.getFundPaymentComBaseString()) .fundStartTime(po.getFundStartTime()) .supplementFundAccount(po.getSupplementFundAccount()) .nonPayment(po.getNonPayment()) @@ -72,6 +74,7 @@ public class InsuranceArchivesBO { .otherName(po.getOtherSchemeId() == null ? null : String.valueOf(po.getOtherSchemeId())) .otherSchemeId(po.getOtherSchemeId()) .otherPaymentBaseString(po.getOtherPaymentBaseString()) + .otherPaymentComBaseString(po.getOtherPaymentComBaseString()) .otherStartTime(po.getOtherStartTime()) .otherEndTime(po.getOtherEndTime()) .paymentOrganization(po.getPaymentOrganization()) diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java index 259cc3e54..a0c2d57e8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java @@ -70,12 +70,18 @@ public class InsuranceArchivesBaseHistoryDTO { private String adjustAfterBaseJson; + private String adjustBeforeComBaseJson; + + private String adjustAfterComBaseJson; + @TableTitle(title = "瀵硅薄", dataIndex = "employeeName", key = "employeeName") private String employeeName; @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName") private String paymentOrganizationName; @TableTitle(title = "绂忓埄椤瑰悕绉", dataIndex = "welfareItemName", key = "welfareItemName") private String welfareItemName; + @TableTitle(title = "缂磋垂瀵硅薄", dataIndex = "paymentScope", key = "paymentScope") + private String paymentScope; @TableTitle(title = "璋冩暣鍓嶆柟妗", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName") private String adjustBeforeSchemeName; @TableTitle(title = "璋冩暣鍓嶅熀鏁", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue") diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java index f85206c01..4fcfdbcd1 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java @@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO { //缂寸撼鍩烘暟 private String fundPaymentBaseString; + + private String fundPaymentComBaseString; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java index a3c55fee5..3fa89c1c2 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java @@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO { private String otherPaymentBaseString; + private String otherPaymentComBaseString; + //private WeaForm otherPaymentBase; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java index 1be1afbca..d4fc1dae8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java @@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO { //绀句繚缂寸撼鍩烘暟 private String schemePaymentBaseString; + //绀句繚缂寸撼鍩烘暟鈥斺斿崟浣 + private String schemePaymentComBaseString; + } diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java index 7e4e46fb7..8d086b1ad 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java @@ -23,4 +23,6 @@ public class InsuranceArchivesSaveParam { private String baseForm; private String paymentForm; + + private String paymentComForm; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java index 6939c2258..52d31f804 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java @@ -77,4 +77,6 @@ public class InsuranceArchivesBaseHistoryPO { private Date createTime; private Date updateTime; + + private String paymentScope; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java index 7b333f4e6..fc171c94b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -87,6 +87,13 @@ public class InsuranceArchivesFundSchemePO { @Encrypt private String fundPaymentBaseString; + /** + * 鍏Н閲戠即绾冲熀鏁扳斺斿崟浣 + */ + @Encrypt + private String fundPaymentComBaseString; + + /** * 绉熸埛key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java index 76146719d..9ad9d9668 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -77,6 +77,12 @@ public class InsuranceArchivesOtherSchemePO { @Encrypt private String otherPaymentBaseString; + /** + * 鍏朵粬绂忓埄缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 绉熸埛key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java index e6f4ff038..645e5215b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -83,6 +83,12 @@ public class InsuranceArchivesSocialSchemePO { @Encrypt private String socialPaymentBaseString; + /** + * 绀句繚缂寸撼鍩烘暟鈥斺斿崟浣 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 绉熸埛key */ diff --git a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java index 4c5cb33e3..584244e09 100644 --- a/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java +++ b/src/com/engine/salary/entity/taxapiflow/response/QueryAccountBalanceResponse.java @@ -22,15 +22,15 @@ public class QueryAccountBalanceResponse { public static class Body { /** * 宸茶喘涔版绘祦閲 - **/ + */ private String total; /** * 宸蹭娇鐢ㄦ祦閲 - **/ + */ private String used; /** * 鍓╀綑娴侀噺 - **/ + */ private String surplus; /** * 浣跨敤鏄庣粏 diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java index 88192ff3e..2fb43ef1a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java @@ -14,11 +14,13 @@ import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import dm.jdbc.util.IdGenerator; +import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; import java.math.BigDecimal; @@ -41,11 +43,9 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { public TaxDeclarationGenerateResult generate(TaxDeclareContext taxDeclareContext, Long employeeId) { Date now = new Date(); // 钖祫鏍哥畻缁撴灉鎸夌収钖祫鏍哥畻浜哄憳id鑱氬悎鍒嗙被 - Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map( - taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); + Map> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctResultValues(), SalaryAcctResultPO::getSalaryAcctEmpId); // 钖祫鏍哥畻浜哄憳鎸夌収浜哄憳id鑱氬悎鍒嗙被 - Map> employeeIdKeyMap = SalaryEntityUtil.group2Map( - taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); + Map> employeeIdKeyMap = SalaryEntityUtil.group2Map(taxDeclareContext.getSalaryAcctEmployees(), SalaryAcctEmployeePO::getEmployeeId); List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size()); for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) { @@ -63,8 +63,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { 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; + String value = ""; if (salarySobTaxReportRule != null && salaryAcctResultValue != null) { value = salaryAcctResultValue.stream() .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId())) @@ -72,6 +71,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .orElse(new SalaryAcctResultPO()) .getResultValue(); } + value = StringUtils.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); } TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() @@ -86,6 +86,7 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy { .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .createTime(now) .updateTime(now) + .source(SourceEnum.ACCT.getValue()) .build(); taxDeclarationValues.add(taxDeclarationValue); } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java index 81010fb7b..5b8454a82 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationDetailBO.java @@ -2,11 +2,9 @@ package com.engine.salary.entity.taxdeclaration.bo; import com.engine.salary.constant.TaxDeclarationDataIndexConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationEmployeeDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO; +import com.engine.salary.entity.taxdeclaration.dto.*; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -15,6 +13,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.util.*; +import java.util.stream.Collectors; /** * 涓◣鐢虫姤琛ㄨ鎯 @@ -177,4 +176,23 @@ public class TaxDeclarationDetailBO { } return taxDeclarationLaborListDTOS; } + + + public static List convert2ListTaxReportColumn(List pos) { + if (CollectionUtils.isEmpty(pos)) { + return Collections.emptyList(); + } + + List collect = pos.stream().map(po -> { + TaxDeclareRecordDetailFormDTO.TaxReportColumn taxReportColumn = new TaxDeclareRecordDetailFormDTO.TaxReportColumn(); + taxReportColumn.setReportColumnName(po.getReportColumnName()); + taxReportColumn.setReportColumnDataIndex(po.getReportColumnDataIndex()); + taxReportColumn.setTaxReportType(po.getTaxReportType()); + taxReportColumn.setIncomeCategory(po.getIncomeCategory()); + taxReportColumn.setDataType(po.getDataType()); + return taxReportColumn; + }).collect(Collectors.toList()); + + return collect; + } } diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java index ee755aad5..e557e155e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java +++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationValueList.java @@ -67,7 +67,7 @@ public class TaxDeclarationValueList { List employeeDeclares, List simpleEmployees, List simpleUserInfos, - List extEmployees) { + List extEmployees, boolean cnKey) { if (CollectionUtils.isEmpty(simpleEmployees)) { return Collections.emptyList(); } @@ -86,27 +86,27 @@ public class TaxDeclarationValueList { dataMap.put("employeeId", taxDeclarationValue.getEmployeeId() + ""); dataMap.put("incomeCategory", incomeCategoryEnum.getDefaultLabel()); for (TaxReportColumnPO taxReportColumn : taxReportColumns) { - dataMap.put(taxReportColumn.getReportColumnDataIndex(), taxDeclarationValue.getResultValue().get(taxReportColumn.getReportColumnDataIndex())); + dataMap.put(cnKey ? taxReportColumn.getReportColumnName() : 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()); + dataMap.put(cnKey ? "濮撳悕" : "username", employeeDeclare.getEmployeeName()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", employeeDeclare.getCardNum()); } else if (taxDeclarationValue.getEmployeeType() == null || 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()); + dataMap.put(cnKey ? "宸ュ彿" : "jobNum", simpleEmployee.getWorkcode()); + dataMap.put(cnKey ? "濮撳悕" : "username", simpleEmployee.getUsername()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", 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()); + dataMap.put(cnKey ? "宸ュ彿" : "jobNum", ""); + dataMap.put(cnKey ? "濮撳悕" : "username", extEmployee.getUsername()); + dataMap.put(cnKey ? "璇佷欢绫诲瀷" : "cardType", SalaryI18nUtil.getI18nLabel(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getLabelId(), CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel())); + dataMap.put(cnKey ? "璇佷欢鍙风爜" : "cardNum", extEmployee.getIdNo()); } tableDataList.add(dataMap); } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 7970724c7..88f0400cd 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.TableTitle; import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -32,18 +33,22 @@ public class AbnormalEmployeeListDTO { //濮撳悕") @TableTitle(title = "濮撳悕",dataIndex = "employeeName",key = "employeeName") + @ExcelHead(title = "濮撳悕",dataIndex = "employeeName") private String employeeName; //宸ュ彿") @TableTitle(title = "宸ュ彿",dataIndex = "jobNum",key = "jobNum") + @ExcelHead(title = "宸ュ彿",dataIndex = "jobNum") private String jobNum; //璇佷欢绫诲瀷") @TableTitle(title = "璇佷欢绫诲瀷",dataIndex = "cardType",key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷",dataIndex = "cardType") private String cardType; //璇佷欢鍙风爜") @TableTitle(title = "璇佷欢鍙风爜",dataIndex = "cardNum",key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜",dataIndex = "cardNum") private String cardNum; //鎶ラ佺姸鎬") @@ -51,5 +56,6 @@ public class AbnormalEmployeeListDTO { //鎶ラ佺姸鎬") @TableTitle(title = "鎶ラ佺姸鎬",dataIndex = "declareStatusDesc",key = "declareStatusDesc") + @ExcelHead(title = "鎶ラ佺姸鎬",dataIndex = "declareStatusDesc") private String declareStatusDesc; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java new file mode 100644 index 000000000..0d8fa7f8b --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/ContrastListDTO.java @@ -0,0 +1,20 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import lombok.Data; + +/** + * 涓◣鐢虫姤琛ㄨ鎯呭垪琛紙鍔冲姟鎶ラ叕鎵寰楋級 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastListDTO { + private String local; + + private String online; + + private Object diff; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 7d2ae71d2..a6e79e5ec 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -23,7 +24,8 @@ public class FailEmployeeListDTO { private Long id; //濮撳悕 - @TableTitle(title = "濮撳悕",dataIndex = "employeeName",key = "employeeName") + @TableTitle(title = "濮撳悕", dataIndex = "employeeName", key = "employeeName") + @ExcelHead(title = "濮撳悕", dataIndex = "employeeName") private String employeeName; //涓◣鎵g即涔夊姟浜篿d @@ -31,18 +33,22 @@ public class FailEmployeeListDTO { private Long taxAgentId; //涓◣鎵g即涔夊姟浜哄悕绉 - @TableTitle(title = "涓◣鎵g即涔夊姟浜哄悕绉",dataIndex = "taxAgentName",key = "taxAgentName") + @TableTitle(title = "涓◣鎵g即涔夊姟浜哄悕绉", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelHead(title = "涓◣鎵g即涔夊姟浜哄悕绉", dataIndex = "taxAgentName") private String taxAgentName; //璇佷欢鍙风爜 - @TableTitle(title = "璇佷欢鍙风爜",dataIndex = "cardNum",key = "cardNum") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") private String cardNum; //澶辫触鍘熷洜 - @TableTitle(title = "澶辫触鍘熷洜",dataIndex = "errorMsg",key = "errorMsg") + @TableTitle(title = "澶辫触鍘熷洜", dataIndex = "errorMsg", key = "errorMsg") + @ExcelHead(title = "澶辫触鍘熷洜", dataIndex = "errorMsg") private String errorMsg; //鎵寰楅」鐩 - @TableTitle(title = "鎵寰楅」鐩",dataIndex = "incomeCategory",key = "incomeCategory") + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeCategory", key = "incomeCategory") + @ExcelHead(title = "鎵寰楅」鐩", dataIndex = "incomeCategory") private String incomeCategory; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java index 75b1b3191..696a3f9f7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationAnnualListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -31,59 +32,69 @@ public class TaxDeclarationAnnualListDTO { text = "宸ュ彿", width = "10%", column = "jobNum" ) @TableTitle(title ="宸ュ彿",dataIndex = "jobNum",key = "jobNum") + @ExcelHead(title ="宸ュ彿",dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "濮撳悕", width = "10%", column = "username" ) @TableTitle(title ="濮撳悕",dataIndex = "username",key = "username") + @ExcelHead(title ="濮撳悕",dataIndex = "username") private String username; @SalaryTableColumn( text = "璇佷欢绫诲瀷", width = "10%", column = "cardType" ) @TableTitle(title ="璇佷欢绫诲瀷",dataIndex = "cardType",key = "cardType") + @ExcelHead(title ="璇佷欢绫诲瀷",dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "璇佷欢鍙风爜", width = "10%", column = "cardNum" ) @TableTitle(title ="璇佷欢鍙风爜",dataIndex = "cardNum",key = "cardNum") + @ExcelHead(title ="璇佷欢鍙风爜",dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "鍏ㄥ勾涓娆℃у閲戦", width = "10%", column = "annualIncome" ) @TableTitle(title ="鍏ㄥ勾涓娆℃у閲戦",dataIndex = "annualIncome",key = "annualIncome") + @ExcelHead(title ="鍏ㄥ勾涓娆℃у閲戦",dataIndex = "annualIncome") private String annualIncome; @SalaryTableColumn( text = "鍏嶇◣鏀跺叆", width = "10%", column = "annualTaxFreeIncome" ) @TableTitle(title ="鍏嶇◣鏀跺叆",dataIndex = "annualTaxFreeIncome",key = "annualTaxFreeIncome") + @ExcelHead(title ="鍏嶇◣鏀跺叆",dataIndex = "annualTaxFreeIncome") private String annualTaxFreeIncome; @SalaryTableColumn( text = "鍏朵粬", width = "10%", column = "annualOther" ) @TableTitle(title ="鍏朵粬",dataIndex = "annualOther",key = "annualOther") + @ExcelHead(title ="鍏朵粬",dataIndex = "annualOther") private String annualOther; @SalaryTableColumn( text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "annualDonateTax" ) @TableTitle(title ="鍑嗕簣鎵i櫎鐨勬崘璧犻",dataIndex = "annualDonateTax",key = "annualDonateTax") + @ExcelHead(title ="鍑嗕簣鎵i櫎鐨勬崘璧犻",dataIndex = "annualDonateTax") private String annualDonateTax; @SalaryTableColumn( text = "鍑忓厤绋庨", width = "10%", column = "annualTaxSavings" ) @TableTitle(title ="鍑忓厤绋庨",dataIndex = "annualTaxSavings",key = "annualTaxSavings") + @ExcelHead(title ="鍑忓厤绋庨",dataIndex = "annualTaxSavings") private String annualTaxSavings; @SalaryTableColumn( text = "澶囨敞", width = "10%", column = "annualRemark" ) @TableTitle(title ="澶囨敞",dataIndex = "annualRemark",key = "annualRemark") + @ExcelHead(title ="澶囨敞",dataIndex = "annualRemark") private String annualRemark; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java index 20a06d05a..c3d48af5b 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationInfoDTO.java @@ -29,11 +29,11 @@ public class TaxDeclarationInfoDTO { @ApiModelProperty("钖祫鎵灞炴湀") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date salaryMonth; @ApiModelProperty("绋庢鎵灞炴湡") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") private Date taxCycle; @ApiModelProperty("涓◣鎵g即涔夊姟浜篿d") diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java index 73872aa0a..ce03fd52c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationLaborListDTO.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.taxdeclaration.dto; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; @@ -30,78 +31,91 @@ public class TaxDeclarationLaborListDTO { @SalaryTableColumn( text = "宸ュ彿", width = "10%", column = "jobNum" ) - @TableTitle(title ="宸ュ彿",dataIndex = "jobNum",key = "jobNum") + @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "宸ュ彿", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn( text = "濮撳悕", width = "10%", column = "username" ) - @TableTitle(title ="濮撳悕",dataIndex = "username",key = "username") + @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelHead(title = "濮撳悕", dataIndex = "username") private String username; @SalaryTableColumn( text = "璇佷欢绫诲瀷", width = "10%", column = "cardType" ) - @TableTitle(title ="璇佷欢绫诲瀷",dataIndex = "cardType",key = "cardType") + @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "cardType") private String cardType; @SalaryTableColumn( text = "璇佷欢鍙风爜", width = "10%", column = "cardNum" ) - @TableTitle(title ="璇佷欢鍙风爜",dataIndex = "cardNum",key = "cardNum") + @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn( text = "鎵寰楅」鐩", width = "10%", column = "incomeItems" ) - @TableTitle(title ="鎵寰楅」鐩",dataIndex = "incomeItems",key = "incomeItems") + @TableTitle(title = "鎵寰楅」鐩", dataIndex = "incomeItems", key = "incomeItems") + @ExcelHead(title = "鎵寰楅」鐩", dataIndex = "incomeItems") private String incomeItems; @SalaryTableColumn( text = "鍔冲姟鏀跺叆", width = "10%", column = "laborIncome" ) - @TableTitle(title ="鍔冲姟鏀跺叆",dataIndex = "laborIncome",key = "laborIncome") + @TableTitle(title = "鍔冲姟鏀跺叆", dataIndex = "laborIncome", key = "laborIncome") + @ExcelHead(title = "鍔冲姟鏀跺叆", dataIndex = "laborIncome") private String laborIncome; @SalaryTableColumn( text = "鍔冲姟鍏嶇◣鏀跺叆", width = "10%", column = "laborTaxFreeIncome" ) - @TableTitle(title ="鍔冲姟鍏嶇◣鏀跺叆",dataIndex = "laborTaxFreeIncome",key = "laborTaxFreeIncome") + @TableTitle(title = "鍔冲姟鍏嶇◣鏀跺叆", dataIndex = "laborTaxFreeIncome", key = "laborTaxFreeIncome") + @ExcelHead(title = "鍔冲姟鍏嶇◣鏀跺叆", dataIndex = "laborTaxFreeIncome") private String laborTaxFreeIncome; @SalaryTableColumn( text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "commercialHealthInsurance" ) - @TableTitle(title ="鍟嗕笟鍋ュ悍淇濋櫓",dataIndex = "commercialHealthInsurance",key = "commercialHealthInsurance") + @TableTitle(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance") + @ExcelHead(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn( text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "taxDeferredEndowmentInsurance" ) - @TableTitle(title ="绋庡欢鍏昏佷繚闄",dataIndex = "taxDeferredEndowmentInsurance",key = "taxDeferredEndowmentInsurance") + @TableTitle(title = "绋庡欢鍏昏佷繚闄", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance") + @ExcelHead(title = "绋庡欢鍏昏佷繚闄", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn( text = "鍏朵粬", width = "10%", column = "other" ) - @TableTitle(title ="鍏朵粬",dataIndex = "other",key = "other") + @TableTitle(title = "鍏朵粬", dataIndex = "other", key = "other") + @ExcelHead(title = "鍏朵粬", dataIndex = "other") private String other; @SalaryTableColumn( text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "allowedDonation" ) - @TableTitle(title ="鍑嗕簣鎵i櫎鐨勬崘璧犻",dataIndex = "allowedDonation",key = "allowedDonation") + @TableTitle(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "allowedDonation", key = "allowedDonation") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn( text = "鍑忓厤绋庨", width = "10%", column = "taxDeduction" ) - @TableTitle(title ="鍑忓厤绋庨",dataIndex = "taxDeduction",key = "taxDeduction") + @TableTitle(title = "鍑忓厤绋庨", dataIndex = "taxDeduction", key = "taxDeduction") + @ExcelHead(title = "鍑忓厤绋庨", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn( text = "澶囨敞", width = "10%", column = "description" ) - @TableTitle(title ="澶囨敞",dataIndex = "description",key = "description") + @TableTitle(title = "澶囨敞", dataIndex = "description", key = "description") + @ExcelHead(title = "澶囨敞", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java index 3725aaf27..419f8f1e0 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationWageListDTO.java @@ -4,6 +4,7 @@ import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.salary.annotation.SalaryTable; import com.engine.salary.annotation.SalaryTableColumn; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.util.excel.ExcelHead; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,101 +36,126 @@ public class TaxDeclarationWageListDTO { @SalaryTableColumn(text = "宸ュ彿", width = "10%", column = "jobNum") @TableTitle(title = "宸ュ彿", dataIndex = "jobNum", key = "jobNum") + @ExcelHead(title = "宸ュ彿", dataIndex = "jobNum") private String jobNum; @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "username") @TableTitle(title = "濮撳悕", dataIndex = "username", key = "username") + @ExcelHead(title = "濮撳悕", dataIndex = "username") private String username; @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "cardType") @TableTitle(title = "璇佷欢绫诲瀷", dataIndex = "cardType", key = "cardType") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "cardType") private String cardType; @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "cardNum") @TableTitle(title = "璇佷欢鍙风爜", dataIndex = "cardNum", key = "cardNum") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "cardNum") private String cardNum; @SalaryTableColumn(text = "鏈湡鏀跺叆", width = "10%", column = "income") @TableTitle(title = "鏈湡鏀跺叆", dataIndex = "income", key = "income") + @ExcelHead(title = "鏈湡鏀跺叆", dataIndex = "income") private String income; @SalaryTableColumn(text = "鏈湡鍏嶇◣鏀跺叆", width = "10%", column = "taxFreeIncome") @TableTitle(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "taxFreeIncome", key = "taxFreeIncome") + @ExcelHead(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "taxFreeIncome") private String taxFreeIncome; @SalaryTableColumn(text = "鍩烘湰鍏昏佷繚闄╄垂", width = "10%", column = "endowmentInsurance") @TableTitle(title = "鍩烘湰鍏昏佷繚闄╄垂", dataIndex = "endowmentInsurance", key = "endowmentInsurance") + @ExcelHead(title = "鍩烘湰鍏昏佷繚闄╄垂", dataIndex = "endowmentInsurance") private String endowmentInsurance; @SalaryTableColumn(text = "鍩烘湰鍖荤枟淇濋櫓璐", width = "10%", column = "medicalInsurance") @TableTitle(title = "鍩烘湰鍖荤枟淇濋櫓璐", dataIndex = "medicalInsurance", key = "medicalInsurance") + @ExcelHead(title = "鍩烘湰鍖荤枟淇濋櫓璐", dataIndex = "medicalInsurance") private String medicalInsurance; @SalaryTableColumn(text = "澶变笟淇濋櫓璐", width = "10%", column = "unemploymentInsurance") @TableTitle(title = "澶变笟淇濋櫓璐", dataIndex = "unemploymentInsurance", key = "unemploymentInsurance") + @ExcelHead(title = "澶变笟淇濋櫓璐", dataIndex = "unemploymentInsurance") private String unemploymentInsurance; @SalaryTableColumn(text = "浣忔埧鍏Н閲", width = "10%", column = "housingProvidentFund") @TableTitle(title = "浣忔埧鍏Н閲", dataIndex = "housingProvidentFund", key = "housingProvidentFund") + @ExcelHead(title = "浣忔埧鍏Н閲", dataIndex = "housingProvidentFund") private String housingProvidentFund; @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "addUpChildEducation") @TableTitle(title = "绱瀛愬コ鏁欒偛", dataIndex = "addUpChildEducation", key = "addUpChildEducation") + @ExcelHead(title = "绱瀛愬コ鏁欒偛", dataIndex = "addUpChildEducation") private String addUpChildEducation; @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "addUpHousingLoanInterest") @TableTitle(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest") + @ExcelHead(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "addUpHousingLoanInterest") private String addUpHousingLoanInterest; @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "addUpHousingRent") @TableTitle(title = "绱浣忔埧绉熼噾", dataIndex = "addUpHousingRent", key = "addUpHousingRent") + @ExcelHead(title = "绱浣忔埧绉熼噾", dataIndex = "addUpHousingRent") private String addUpHousingRent; @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "addUpContinuingEducation") @TableTitle(title = "绱缁х画鏁欒偛", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation") + @ExcelHead(title = "绱缁х画鏁欒偛", dataIndex = "addUpContinuingEducation") private String addUpContinuingEducation; @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "addUpSupportElderly") @TableTitle(title = "绱璧″吇鑰佷汉", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly") + @ExcelHead(title = "绱璧″吇鑰佷汉", dataIndex = "addUpSupportElderly") private String addUpSupportElderly; @SalaryTableColumn(text = "绱澶х梾鍖荤枟", width = "10%", column = "addUpIllnessMedical") @TableTitle(title = "绱澶х梾鍖荤枟", dataIndex = "addUpIllnessMedical", key = "addUpIllnessMedical") + @ExcelHead(title = "绱澶х梾鍖荤枟", dataIndex = "addUpIllnessMedical") private String addUpIllnessMedical; @SalaryTableColumn(text = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", width = "10%", column = "addUpInfantCare") @TableTitle(title = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", dataIndex = "addUpInfantCare", key = "addUpInfantCare") + @ExcelHead(title = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", dataIndex = "addUpInfantCare") private String addUpInfantCare; @SalaryTableColumn(text = "绱涓汉鍏昏侀噾", width = "10%", column = "addUpPrivatePension") @TableTitle(title = "绱涓汉鍏昏侀噾", dataIndex = "addUpPrivatePension", key = "addUpPrivatePension") + @ExcelHead(title = "绱涓汉鍏昏侀噾", dataIndex = "addUpPrivatePension") private String addUpPrivatePension; @SalaryTableColumn(text = "浼佷笟锛堣亴涓氾級骞撮噾", width = "10%", column = "annuity") @TableTitle(title = "浼佷笟锛堣亴涓氾級骞撮噾", dataIndex = "annuity", key = "annuity") + @ExcelHead(title = "浼佷笟锛堣亴涓氾級骞撮噾", dataIndex = "annuity") private String annuity; @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "commercialHealthInsurance") @TableTitle(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance") + @ExcelHead(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "commercialHealthInsurance") private String commercialHealthInsurance; @SalaryTableColumn(text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "taxDeferredEndowmentInsurance") @TableTitle(title = "绋庡欢鍏昏佷繚闄", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance") + @ExcelHead(title = "绋庡欢鍏昏佷繚闄", dataIndex = "taxDeferredEndowmentInsurance") private String taxDeferredEndowmentInsurance; @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "other") @TableTitle(title = "鍏朵粬", dataIndex = "other", key = "other") + @ExcelHead(title = "鍏朵粬", dataIndex = "other") private String other; @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "allowedDonation") @TableTitle(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "allowedDonation", key = "allowedDonation") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "allowedDonation") private String allowedDonation; @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "taxDeduction") @TableTitle(title = "鍑忓厤绋庨", dataIndex = "taxDeduction", key = "taxDeduction") + @ExcelHead(title = "鍑忓厤绋庨", dataIndex = "taxDeduction") private String taxDeduction; @SalaryTableColumn(text = "澶囨敞", width = "10%", column = "description") @TableTitle(title = "澶囨敞", dataIndex = "description", key = "description") + @ExcelHead(title = "澶囨敞", dataIndex = "description") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java new file mode 100644 index 000000000..04e7d0bff --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordDetailFormDTO.java @@ -0,0 +1,87 @@ +package com.engine.salary.entity.taxdeclaration.dto; + +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * 涓◣鐢虫姤鏄庣粏鏂板琛ㄥ崟 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

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

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class ContrastQueryParam extends BaseQueryParam { + + /** + * 鐢虫姤琛╥d + */ + private Long taxDeclarationId; + + /** + * 鏄惁鍙樉绀哄樊寮備汉鍛 + */ + private boolean onlyShowDiffEmp; + + /** + * 鏄惁鍙樉绀哄樊寮傞」 + */ + private boolean onlyShowDiffItem; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java new file mode 100644 index 000000000..7ce6c69c7 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DeclareTaxResultFeedbackQueryParam.java @@ -0,0 +1,18 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class DeclareTaxResultFeedbackQueryParam { + Long id; + + String requestId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java new file mode 100644 index 000000000..d9371b3fd --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/DownloadTemplateParam.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DownloadTemplateParam { + /** + * 鐢虫姤琛╥d锛屼笅杞芥ā鏉 + */ + @DataCheck(require = true,message = "imageId涓虹┖") + Long taxDeclarationId; + + + + /** + * 瀵煎叆鏂囦欢id + */ + String imageId; +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java new file mode 100644 index 000000000..7104856ff --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationAddParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鏂板涓◣鐢虫姤琛ㄥ弬鏁 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationAddParam { + + /** + * 涓◣鐢虫姤璁板綍id + */ + @DataCheck(require = true, message = "涓◣鐢虫姤璁板綍id涓虹┖") + private Long taxDeclareRecordId; + + /** + * 钖祫绫诲瀷 + */ + @DataCheck(require = true, message = "钖祫绫诲瀷涓虹┖") + private IncomeCategoryEnum incomeCategory; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java new file mode 100644 index 000000000..aac346fb1 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationDeleteParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 鍒犻櫎涓◣鐢虫姤琛ㄥ弬鏁 + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationDeleteParam { + + /** + * 涓◣鐢虫姤琛╥d + */ + @DataCheck(require = true, message = "涓◣鐢虫姤琛╥d涓虹┖") + private Long taxDeclarationId; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 864c4dac9..ff40cf181 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -26,4 +26,9 @@ public class TaxDeclarationValueListQueryParam extends BaseQueryParam { //瀵煎嚭excel鏃跺姞瀵嗙殑瀵嗙爜") private String sharePassword; + + /** + * 濮撳悕鎴栬呭伐鍙 + */ + private String keyword; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java new file mode 100644 index 000000000..3386119bf --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordDetailFormParam.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.taxdeclaration.param; + +import lombok.Data; + +/** + * 涓◣鐢虫姤鏄庣粏淇濆瓨 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

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

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxDeclareRecordDetailSaveParam { + + //涓婚敭id + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + //涓◣鐢虫姤琛╥d + private Long taxDeclarationId; + + //浜哄憳id + @JsonSerialize(using = ToStringSerializer.class) + private Long employeeId; + private Integer employeeType; + + private Map taxReportColumnValues; + +} diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index 7e94fcc2e..673fd4aa8 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxdeclaration.param; +import com.engine.salary.util.valid.DataCheck; import lombok.Data; /** diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java index 682f1a87b..101b6dd52 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationPO.java @@ -94,10 +94,18 @@ public class TaxDeclarationPO { */ private Integer controlView; - //绋庢鎵灞炴湡 + /** + * 钖祫鎵灞炴湀 + */ LocalDateRange salaryMonths; + /** + * 绋庢鎵灞炴湡 + */ + LocalDateRange taxMonths; + + private Collection taxAgentIds; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 11b97036b..9c88986dd 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.taxdeclaration.po; import com.engine.salary.annotation.Encrypt; +import com.engine.salary.enums.taxdeclaration.SourceEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -88,6 +89,12 @@ public class TaxDeclarationValuePO implements Serializable { */ private Date updateTime; + /** + * 鏁版嵁鏉ユ簮 + * @see SourceEnum + */ + private Integer source; + private Collection ids; private Collection taxDeclarationIds; diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 6664f1985..6a6440435 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -1,5 +1,7 @@ package com.engine.salary.entity.taxdeclaration.po; +import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; +import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -46,10 +48,12 @@ public class TaxDeclareRecordPO implements Serializable { private Date taxCycle; /** * 鐢虫姤绫诲瀷 + * @see TaxDeclareTypeEnum */ private Integer taxDeclareType; /** * 鐢虫姤鐘舵 + * @see TaxDeclareStatusEnum */ private Integer taxDeclareStatus; /** @@ -60,6 +64,10 @@ public class TaxDeclareRecordPO implements Serializable { * 璇锋眰鐨剅equestId */ private String requestId; + /** + * 鐢虫姤鐨剅equestId锛岀敤浜庝笅杞界敵鎶ヨ繃绋 + */ + private String declareRequestId; /** * 澶囨敞 */ diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 5e824dc48..f2b61a35e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -20,35 +20,79 @@ import java.util.Date; @Builder @AllArgsConstructor @NoArgsConstructor -//hrsa_tax_report_column") +//hrsa_tax_report_column public class TaxReportColumnPO { - //name = "涓婚敭id") + /** + * 涓婚敭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") + + /** + * 涓◣瀵规帴鏃剁殑鍙傛暟key + */ private String requestParamKey; - //name = "绉熸埛key", ignore = true) + + /** + * 鏄惁鏄姣斿瓧娈碉紝1鏄0鍚 + */ + private Integer contrastType; + + /** + * 绉熸埛key + */ private String tenantKey; - //name = "鍒涘缓浜篿d", ignore = true) + + /** + * 鍒涘缓浜篿d + */ private Long creator; - //name = "鏄惁鍒犻櫎", ignore = true) + + /** + * 鏄惁鍒犻櫎 + */ private Integer deleteType; - //name = "鍒涘缓鏃堕棿", ignore = true) + + /** + * 鍒涘缓鏃堕棿 + */ private Date createTime; - //name = "鏇存柊鏃堕棿", ignore = true) + + /** + * 鏇存柊鏃堕棿 + */ private Date updateTime; Collection ids; + Collection contrastTypes; } diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 48c2a0973..34141f5a2 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -1,5 +1,7 @@ package com.engine.salary.entity.taxpayment.po; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -58,7 +60,7 @@ public class TaxPaymentRequestPO implements Serializable { /** * 璇锋眰绫诲瀷 * - * com.weaver.hrm.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum + * @see TaxPaymentServiceTypeEnum */ //寮傛璇锋眰ID") private Integer requestType; @@ -66,7 +68,7 @@ public class TaxPaymentRequestPO implements Serializable { /** * 鏄惁宸茶幏鍙栧弽棣 * - * com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum + *@see SalaryOnOffEnum */ //鏄惁宸茶幏鍙栧弽棣") private Integer feedback; diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java index 75a8901b6..88e40e0de 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentStatusEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 浜哄憳鐘舵 *

Copyright: Copyright (c) 2023

@@ -41,4 +43,17 @@ public enum EmploymentStatusEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentStatusEnum[] enumAry = EmploymentStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java index 609e7f8f8..08941637d 100644 --- a/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/EmploymentTypeEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 浠昏亴鍙楅泧浠庝笟绫诲瀷 *

Copyright: Copyright (c) 2023

@@ -44,4 +46,17 @@ public enum EmploymentTypeEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + EmploymentTypeEnum[] enumAry = EmploymentTypeEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java index 805afa7bd..a4849d129 100644 --- a/src/com/engine/salary/enums/employeedeclare/GenderEnum.java +++ b/src/com/engine/salary/enums/employeedeclare/GenderEnum.java @@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare; import com.engine.salary.enums.BaseEnum; +import java.util.Arrays; + /** * 鎬у埆 *

Copyright: Copyright (c) 2023

@@ -41,4 +43,17 @@ public enum GenderEnum implements BaseEnum { public Integer getLabelId() { return labelId; } + + public static Integer getValueByDefaultLabel(String defaultLabel) { + if (defaultLabel == null) { + return null; + } + GenderEnum[] enumAry = GenderEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getDefaultLabel().equals(defaultLabel)) { + return enumAry[i].getValue(); + } + } + return null; + } } diff --git a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java index 762b3e581..71009b4e6 100644 --- a/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java +++ b/src/com/engine/salary/enums/salarysob/IncomeCategoryEnum.java @@ -1,13 +1,12 @@ package com.engine.salary.enums.salarysob; import com.engine.salary.enums.BaseEnum; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; +import com.engine.salary.util.excel.ExcelUtil; 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; +import java.util.*; /** * 搴旂◣椤圭洰 @@ -20,19 +19,123 @@ import java.util.Objects; public enum IncomeCategoryEnum implements BaseEnum { // todo 澶氳瑷 - WAGES_AND_SALARIES(1, "0101", "姝e父宸ヨ祫钖噾", 160487), - REMUNERATION_FOR_LABOR(4, "0400", "涓鑸姵鍔℃姤閰墍寰", 160488), - ONETIME_ANNUAL_BONUS(2, "0103", "鍏ㄥ勾涓娆℃у閲戞敹鍏", 160489), - COMPENSATION_FOR_RETIRE(107, "0107", "鍐呴涓娆℃цˉ鍋块噾", 181936), - COMPENSATION_FOR_DISMISS(108, "0108", "瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾", 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), + WAGES_AND_SALARIES(1, "0101", "姝e父宸ヨ祫钖噾", 160487) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_LABOR(4, "0400", "涓鑸姵鍔℃姤閰墍寰", 160488) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ONETIME_ANNUAL_BONUS(2, "0103", "鍏ㄥ勾涓娆℃у閲戞敹鍏", 160489) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + COMPENSATION_FOR_RETIRE(107, "0107", "鍐呴涓娆℃цˉ鍋块噾", 181936) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + COMPENSATION_FOR_DISMISS(108, "0108", "瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾", 181937) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "涓汉鑲℃潈婵鍔辨敹鍏", 181938) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ANNUITY_RECEIPT(110, "0110", "骞撮噾棰嗗彇", 181939) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "淇濋櫓钀ラ攢鍛樹剑閲戞敹鍏", 181940) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + INCOME_FOR_SECURITIES_BROKER(403, "0403", "璇佸埜缁忕邯浜轰剑閲戞敹鍏", 181942) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "鍏朵粬杩炵画鍔冲姟鎶ラ叕鎵寰", 181943) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_OTHER_LABOR(499, "0499", "鍏朵粬闈炶繛缁姵鍔℃姤閰墍寰", 175330) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + REMUNERATION_FOR_AUTHOR(500, "0500", "绋块叕鎵寰", 181944) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, + ROYALTIES(600, "0600", "鐗硅鏉冧娇鐢ㄨ垂鎵寰", 181945) { + @Override + public Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) { + List zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb(); + List> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd); + result.put(this.getDefaultLabel(), zhsdSheetData); + return result; + } + }, ; @@ -51,6 +154,8 @@ public enum IncomeCategoryEnum implements BaseEnum { this.labelId = labelId; } + public abstract Map>> parseGetDeclareTaxResultFeedbackResponse(Map>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse); + @Override public Integer getValue() { return value; @@ -79,6 +184,7 @@ public enum IncomeCategoryEnum implements BaseEnum { } return null; } + public static List parseByValue(Collection values) { if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); diff --git a/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java new file mode 100644 index 000000000..999720d3f --- /dev/null +++ b/src/com/engine/salary/enums/taxdeclaration/SourceEnum.java @@ -0,0 +1,48 @@ +package com.engine.salary.enums.taxdeclaration; + +import com.engine.salary.enums.BaseEnum; + +/** + * 浣滃簾鐢虫姤 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +public enum SourceEnum implements BaseEnum { + + ACCT(0, "钖祫鏍哥畻", 160490), + AUTO(1, "鑷姩琛ュ厖", 160490), + ADD(2, "鐣岄潰鏂板", 160491), + EDIT(3, "鐣岄潰鏂板", 160491), + IMP(4, "鐣岄潰瀵煎叆", 160491); + + + SourceEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + private int value; + + private String defaultLabel; + + private int labelId; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } +} diff --git a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java index 27db64998..1335ff349 100644 --- a/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java +++ b/src/com/engine/salary/enums/taxdeclaration/TaxDeclareStatusEnum.java @@ -12,6 +12,7 @@ import com.engine.salary.enums.BaseEnum; **/ public enum TaxDeclareStatusEnum implements BaseEnum { + DECLARE_FAIL_UNFILLED(0, "鏈~鍐", 160495), NOT_DECLARE(1, "鏈敵鎶", 160495), DECLARING(2, "鐢虫姤涓", 160496), DECLARE_FAIL(3, "鐢虫姤澶辫触", 160494), diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 03facc683..c08dd87e2 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -183,6 +183,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -264,6 +276,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -346,6 +370,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index 890181735..008deae95 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -452,8 +452,7 @@ update_time ) VALUES - ( - + ( #{item.birthday}, #{item.cardNum}, #{item.cardType}, @@ -486,8 +485,8 @@ #{item.taxCycle}, #{item.tenantKey}, #{item.updateTime} - ) + @@ -838,6 +837,9 @@ AND declare_status = #{param.declareStatus.value} + + AND employee_id=#{param.employeeId} + AND employment_status = #{param.employmentStatus.value} diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index a88ac1600..17e371c33 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -956,7 +956,7 @@ #{tenantKey}, - #{sms_setting}, + #{smsSetting}, diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index 7dd705c72..93ec756ca 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -51,7 +51,8 @@ t.shared_type, t.tax_agent_ids, t.sorted_index, - t.hide_default + t.hide_default, + t.width @@ -217,6 +218,9 @@ sorted_index, + + width, + @@ -288,6 +292,9 @@ #{sortedIndex}, + + #{width}, + @@ -359,6 +366,9 @@ tax_agent_ids=#{taxAgentIds}, + + width=#{width}, + sorted_index=#{sortedIndex}, WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index d45fdec16..15ac635ce 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -157,7 +157,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -204,7 +205,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -213,7 +217,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.id,jdbcType=DOUBLE}, @@ -259,7 +264,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -269,7 +277,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.id}, @@ -315,7 +324,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 2e52ce986..925718b0b 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -18,10 +18,13 @@ + + + @@ -69,10 +72,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -117,10 +123,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -420,7 +429,8 @@ t.other_com_json,t.social_per_sum,t.social_com_sum, t.fund_per_sum,t.fund_com_sum,t.other_per_sum, t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization, - t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string + t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string, + t.social_payment_com_base_string, t.fund_payment_com_base_string, t.other_payment_com_base_string FROM hrsa_bill_detail t WHERE t.delete_type = 0 @@ -711,7 +721,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -757,7 +768,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -766,7 +780,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.employeeId,jdbcType=DOUBLE}, @@ -811,7 +826,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -821,7 +839,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -866,7 +885,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml index f99461416..19b6fb3e5 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml @@ -18,10 +18,13 @@ + + + @@ -68,10 +71,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -130,7 +136,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -175,7 +182,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -184,7 +194,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select @@ -229,7 +240,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -239,7 +253,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -283,7 +298,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index fc91b8885..afdde68a1 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -14,6 +14,7 @@ + @@ -35,6 +36,7 @@ , t.payment_organization , t.under_take , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -135,6 +137,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -154,6 +157,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -175,6 +179,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -193,6 +198,7 @@ #{item.fundEndTime,jdbcType=VARCHAR}, #{item.fundStartTime,jdbcType=VARCHAR}, #{item.fundPaymentBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, #{item.supplementFundAccount,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -215,6 +221,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -233,6 +240,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -311,6 +319,7 @@ welfare_type = #{welfareType}, fund_payment_base_string = #{fundPaymentBaseString}, + fund_payment_com_base_string = #{fundPaymentComBaseString}, fund_scheme_id = #{fundSchemeId}, fund_end_time = #{fundEndTime}, fund_start_time = #{fundStartTime}, @@ -353,6 +362,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -371,6 +381,7 @@ #{fundEndTime}, #{fundStartTime}, #{fundPaymentBaseString}, + #{fundPaymentComBaseString}, #{supplementFundAccount}, #{createTime}, #{creator}, diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml index da02c83b5..0752177a1 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml @@ -12,6 +12,7 @@ + @@ -33,6 +34,7 @@ , t.adjust_before_base_value , t.adjust_after_base_value , t.adjust_welfare_item_id + , t.payment_scope , t.operator , t.operate_time , t.create_time @@ -48,7 +50,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( @@ -67,7 +69,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -77,7 +80,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) select #{item.id,jdbcType=DOUBLE}, @@ -95,7 +98,8 @@ #{item.creator,jdbcType=DOUBLE}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} from dual @@ -106,7 +110,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( #{item.id}, @@ -124,7 +128,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -148,6 +153,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -180,6 +186,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -216,6 +223,7 @@ , eo.lastname as operatorName , ee.username as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrsa_external_employee ee on ee.id = t.employee_id diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index d1a18db07..2d67257b4 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -12,6 +12,7 @@ + @@ -31,6 +32,7 @@ , t.payment_organization , t.under_take , t.other_payment_base_string + , t.other_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -129,7 +131,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( @@ -146,7 +149,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -165,7 +169,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) select #{item.otherSchemeId,jdbcType=DOUBLE}, @@ -181,7 +186,8 @@ #{item.nonPayment,jdbcType=INTEGER}, #{item.creator,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE}, - #{item.otherPaymentBaseString,jdbcType=VARCHAR} + #{item.otherPaymentBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -201,7 +207,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{item.otherSchemeId}, @@ -217,7 +224,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -292,6 +300,7 @@ welfare_type = #{welfareType}, other_payment_base_string = #{otherPaymentBaseString}, + other_payment_com_base_string = #{otherPaymentComBaseString}, other_scheme_id = #{otherSchemeId}, other_end_time = #{otherEndTime}, other_start_time = #{otherStartTime}, @@ -340,7 +349,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{otherSchemeId}, @@ -356,7 +366,8 @@ #{nonPayment}, #{creator}, #{paymentOrganization}, - #{otherPaymentBaseString} + #{otherPaymentBaseString}, + #{otherPaymentComBaseString} ) \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 8472020a2..79562932f 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ , t.payment_organization , t.under_take , t.social_payment_base_string + , t.social_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -128,6 +130,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -146,6 +149,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -166,6 +170,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -183,6 +188,7 @@ #{item.welfareType,jdbcType=INTEGER}, #{item.deleteType,jdbcType=INTEGER}, #{item.socialPaymentBaseString,jdbcType=VARCHAR}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialSchemeId,jdbcType=DOUBLE}, #{item.createTime,jdbcType=DATE}, #{item.socialEndTime,jdbcType=VARCHAR}, @@ -204,6 +210,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -221,6 +228,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -955,6 +963,7 @@ welfare_type = #{welfareType}, social_payment_base_string = #{socialPaymentBaseString}, + social_payment_com_base_string = #{socialPaymentComBaseString}, social_scheme_id = #{socialSchemeId}, social_end_time = #{socialEndTime}, social_start_time = #{socialStartTime}, @@ -994,6 +1003,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -1011,6 +1021,7 @@ #{welfareType}, #{deleteType}, #{socialPaymentBaseString}, + #{socialPaymentComBaseString}, #{socialSchemeId}, #{createTime}, #{socialEndTime}, diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml index 2d9d361d5..4de75ae85 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentMapper.xml @@ -38,6 +38,31 @@ + + + + AND id IN + + #{id} + + + + AND name like '%'||#{param.name}||'%' + + + + + + AND id IN + + #{id} + + + + AND name like '%'+#{param.name}+'%' + + + diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java index 1515f916c..fc5d0415f 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.java @@ -120,4 +120,9 @@ public interface TaxDeclarationValueMapper { */ void batchInsert(@Param("collection") Collection taxDeclarationValues); + + List queryNotWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + + List queryWagesEmpIds(@Param("taxDeclareRecordId")Long taxDeclareRecordId); + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index dfcaecaf1..5eba618cb 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.employee_type , t.employee_id , t.result_value_json + , t.source @@ -88,6 +90,9 @@ AND result_value_json = #{resultValueJson} + + AND source = #{source} + AND id IN @@ -142,6 +147,9 @@ result_value_json, + + source, + @@ -177,6 +185,9 @@ #{resultValueJson}, + + #{source}, + @@ -195,7 +206,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) VALUES ( @@ -210,7 +222,8 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson} + #{item.resultValueJson}, + #{item.source} ) @@ -228,7 +241,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) @@ -243,7 +257,8 @@ #{item.taxDeclarationId,jdbcType=DOUBLE}, #{item.employeeType,jdbcType=INTEGER}, #{item.employeeId,jdbcType=DOUBLE}, - #{item.resultValueJson,jdbcType=VARCHAR} + #{item.resultValueJson,jdbcType=VARCHAR}, + #{item.source,jdbcType=INTEGER} from dual @@ -262,7 +277,8 @@ tax_declaration_id, employee_type, employee_id, - result_value_json + result_value_json, + source ) VALUES ( @@ -276,7 +292,8 @@ #{item.taxDeclarationId}, #{item.employeeType}, #{item.employeeId}, - #{item.resultValueJson} + #{item.resultValueJson}, + #{item.source} ) @@ -295,6 +312,7 @@ employee_type=#{employeeType}, employee_id=#{employeeId}, result_value_json=#{resultValueJson}, + source=#{source}, WHERE id = #{id} AND delete_type = 0 @@ -334,6 +352,9 @@ result_value_json=#{resultValueJson}, + + source=#{source}, + WHERE id = #{id} AND delete_type = 0 @@ -428,4 +449,24 @@ + + + + \ 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 index 7edc1e580..79b47b6fd 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclareRecordMapper.xml @@ -13,6 +13,7 @@ + @@ -38,6 +39,7 @@ , t.tax_cycle , t.remark , t.request_id + , t.declare_request_id , t.tax_declare_type , t.tax_declare_status , t.display_update_icon @@ -105,6 +107,9 @@ AND request_id = #{requestId} + + AND declare_request_id = #{declareRequestId} + AND tax_declare_type = #{taxDeclareType} @@ -147,6 +152,12 @@ AND tax_cycle #{endDate} + + AND salary_month = ]]> #{salaryMonthStartDate} + + + AND salary_month #{salaryMonthEndDate} + ORDER BY tax_cycle DESC @@ -189,6 +200,9 @@ request_id, + + declare_request_id, + tax_declare_type, @@ -248,6 +262,9 @@ #{requestId}, + + #{declareRequestId}, + #{taxDeclareType}, @@ -291,6 +308,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -314,6 +332,7 @@ #{item.taxCycle}, #{item.remark}, #{item.requestId}, + #{item.declareRequestId}, #{item.taxDeclareType}, #{item.taxDeclareStatus}, #{item.displayUpdateIcon}, @@ -340,6 +359,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -363,6 +383,7 @@ #{item.taxCycle,jdbcType=DATE}, #{item.remark,jdbcType=VARCHAR}, #{item.requestId,jdbcType=DOUBLE}, + #{item.declareRequestId,jdbcType=VARCHAR}, #{item.taxDeclareType,jdbcType=INTEGER}, #{item.taxDeclareStatus,jdbcType=INTEGER}, #{item.displayUpdateIcon,jdbcType=INTEGER}, @@ -390,6 +411,7 @@ tax_cycle, remark, request_id, + declare_request_id, tax_declare_type, tax_declare_status, display_update_icon, @@ -412,6 +434,7 @@ #{item.taxCycle}, #{item.remark}, #{item.requestId}, + #{item.declareRequestId}, #{item.taxDeclareType}, #{item.taxDeclareStatus}, #{item.displayUpdateIcon}, @@ -438,6 +461,7 @@ tax_cycle=#{taxCycle}, remark=#{remark}, request_id=#{requestId}, + declare_request_id=#{declareRequestId}, tax_declare_type=#{taxDeclareType}, tax_declare_status=#{taxDeclareStatus}, display_update_icon=#{displayUpdateIcon}, @@ -485,6 +509,9 @@ request_id=#{requestId}, + + declare_request_id=#{declareRequestId}, + tax_declare_type=#{taxDeclareType}, diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java index df8f8738a..1f767ca48 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.java @@ -1,9 +1,7 @@ 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 { @@ -21,60 +19,4 @@ public interface TaxReportColumnMapper { * @return 杩斿洖闆嗗悎锛屾病鏈夎繑鍥炵┖List */ List listSome(TaxReportColumnPO taxReportColumn); - - - /** - * 鏍规嵁涓婚敭鏌ヨ - * - * @param id 涓婚敭 - * @return 杩斿洖璁板綍锛屾病鏈夎繑鍥瀗ull - */ - TaxReportColumnPO getById(Long id); - - /** - * 鏂板锛屽拷鐣ull瀛楁 - * - * @param taxReportColumn 鏂板鐨勮褰 - * @return 杩斿洖褰卞搷琛屾暟 - */ - int insertIgnoreNull(TaxReportColumnPO taxReportColumn); - - /** - * 鎵归噺鎻掑叆 - * - * @param taxReportColumn - */ - void batchInsert(@Param("collection") List taxReportColumn); - - /** - * 淇敼锛屼慨鏀规墍鏈夊瓧娈 - * - * @param taxReportColumn 淇敼鐨勮褰 - * @return 杩斿洖褰卞搷琛屾暟 - */ - int update(TaxReportColumnPO taxReportColumn); - - /** - * 淇敼锛屽拷鐣ull瀛楁 - * - * @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 index 1002208a0..7ce9c9fae 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxReportColumnMapper.xml @@ -15,6 +15,7 @@ + @@ -34,6 +35,7 @@ , t.data_type , t.request_param_key , t.report_column_label + , t.contrast_type @@ -98,299 +100,23 @@ AND report_column_label = #{reportColumnLabel} + + AND contrast_type = #{contrastType} + AND id IN #{id} + + AND contrast_type IN + + #{contrastType} + + ORDER BY id - - - INSERT INTO hrsa_tax_report_column - - - - id, - - - create_time, - - - 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/remote/tax/client/DeclareClient.java b/src/com/engine/salary/remote/tax/client/DeclareClient.java index 3f5722b24..bd7a500da 100644 --- a/src/com/engine/salary/remote/tax/client/DeclareClient.java +++ b/src/com/engine/salary/remote/tax/client/DeclareClient.java @@ -1,12 +1,24 @@ package com.engine.salary.remote.tax.client; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.util.HttpUtil; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SingnatureData; +import lombok.extern.slf4j.Slf4j; import java.util.Collections; import java.util.HashMap; import java.util.Map; +/** + * 涓◣鐢虫姤瀹㈡埛绔 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j public class DeclareClient extends TaxBaseClient{ public DeclareClient(Long taxAgentId) { super(taxAgentId); @@ -17,14 +29,16 @@ public class DeclareClient extends TaxBaseClient{ * @param requestId路 * @return */ - public Object getDeclareTaxResultFeedback(String requestId){ + public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){ // 渚涘簲鍟嗕俊鎭 String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback"; Map params = new HashMap<>(1); params.put("requestId", requestId); Map header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret()); String res = HttpUtil.getRequest(url, header, params); - return res; + + log.info("getDeclareTaxResultFeedback res --- {}", res); + return JsonUtil.parseObject(res, GetDeclareTaxResultFeedbackResponse.class); } diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java index 8ea3f8177..90da29385 100644 --- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java +++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.Map; /** - * 浜哄憳淇℃伅鐧昏鎶ラ佹湇鍔 + * 浜哄憳淇℃伅鐧昏鎶ラ佸鎴风 *

Copyright: Copyright (c) 2023

*

Company: 娉涘井杞欢

* diff --git a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java index 38ba9862a..1eae80e88 100644 --- a/src/com/engine/salary/remote/tax/client/TaxBaseClient.java +++ b/src/com/engine/salary/remote/tax/client/TaxBaseClient.java @@ -8,14 +8,6 @@ import com.engine.salary.util.Sm4Utils; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; -/** - * 浜哄憳淇℃伅鐧昏鎶ラ佹湇鍔 - *

Copyright: Copyright (c) 2023

- *

Company: 娉涘井杞欢

- * - * @author qiantao - * @version 1.0 - **/ @Slf4j public class TaxBaseClient { private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() { diff --git a/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java new file mode 100644 index 000000000..43995fb0c --- /dev/null +++ b/src/com/engine/salary/remote/tax/response/employee/GetDeclareTaxResultFeedbackResponse.java @@ -0,0 +1,704 @@ +package com.engine.salary.remote.tax.response.employee; + +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.entity.taxpayment.response.BaseResponse; +import com.engine.salary.util.excel.ExcelHead; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GetDeclareTaxResultFeedbackResponse extends BaseResponse { + /** + * 杩斿洖鏁版嵁 + */ + private Body body; + + @Data + public static class Body { + /** + * 浼佷笟鍚嶇О 蹇呭~锛氭槸 + */ + private String qymc; + /** + * 绋庡彿 蹇呭~锛氭槸 + */ + private String nsrsbh; + /** + * 鍦板尯缂栧彿 蹇呭~锛氭槸 6浣嶈鏀垮尯鍒掍唬鐮,绮剧‘鍒板競绾э紝渚嬪锛440100,鍙傝冪渷甯傚尯缂栫爜 + */ + private String areaid; + /** + * 閮ㄩ棬缂栧彿 蹇呭~锛氭槸 + */ + private String bmbh; + /** + * 閮ㄩ棬鍚嶇О 蹇呭~锛氬惁 + */ + private String bmmc; + /** + * 绠楃◣鏈堜唤 蹇呭~锛氭槸 + */ + private String skssq; + /** + * 缁煎悎鎵寰 蹇呭~锛氭槸 瑙佺患鍚堟墍寰楄绠楃粨鏋 + */ + private zhsd zhsd; +// /** +// * 鍒嗙被鎵寰 蹇呭~锛氭槸 瑙佸垎绫绘墍寰楄绠楃粨鏋 +// */ +// private 瀵硅薄 flsd; +// /** +// * 闈炲眳姘戞墍寰 蹇呭~锛氭槸 瑙侀潪灞呮皯鎵寰楄绠楃粨鏋 +// */ +// private 瀵硅薄 fjmsd; +// /** +// * 闄愬敭鑲℃墍寰 蹇呭~锛氭槸 瑙侀檺鍞偂鎵寰楄绠楃粨鏋 +// */ +// private 瀵硅薄 xsgsd; + + /** + * 浜哄憳鐢虫姤澶辫触鍒楄〃 蹇呭~锛氭槸 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + + @Data + public static class zhsd { + /** + * 浜哄憳浠d唬鎶ュけ璐ュ垪琛 鍙傝冧汉鍛樹唬鎶ョ粨鏋滃璞 + */ + private List rysbsblb; + /** + * 姝e父宸ヨ祫钖噾绠楃◣缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj zcgzxj; + /** + * 鍏ㄥ勾涓娆℃у閲戞敹鍏ョ畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qnycxjjsslb; + /** + * 绋块叕鎵寰楃畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj gcsdlb; + /** + * 涓鑸姵鍔℃姤閰畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj lwbclb; + /** + * 瑙i櫎鍔冲姩鍚堝悓涓娆℃цˉ鍋块噾鍒楄〃 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj jcldhtycxbcjlb; + /** + * 淇濋櫓钀ラ攢鍛樿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj bxyxy; + /** + * 璇佸埜缁忕邯浜鸿柂閲戠畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj zqjjr; + /** + * 鐗硅鏉冪畻绋庣粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj txq; + /** + * 涓汉鑲℃潈婵鍔辩粨鏋滃璞 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj grgqjl; + /** + * 浼佷笟骞撮噾缁撴灉瀵硅薄 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qynj; + /** + * 鍐呴涓娆℃цˉ鍋块噾 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj ntycxbcjlb; + /** + * 鍏朵粬杩炵画鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qtlxlwbc; + /** + * 鍏朵粬闈炶繛缁姵鍔℃姤閰 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj qtflxlwbc; + /** + * 鎻愬墠閫浼戜竴娆℃цˉ璐 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj tqtxycxbt; + /** + * 澶紒璐熻矗浜虹哗鏁堣柂閲戝欢鏈熷厬鐜版敹鍏ュ拰浠绘湡濂栧姳 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj yqfzrsrhjl; + /** + * 娉曞緥鎻村姪鍔冲姟鎶ラ叕 鍙傝冪患鍚堟墍寰楃畻绋庣粨鏋滃璞 + */ + private zcgzxj flyzlwbclb; + + + /** + * 浜哄憳浠f姤缁撴灉瀵硅薄 + */ + @Data + public static class rydbjgdx { + /** + * 濮撳悕 + */ + private String xm; + /** + * 璇佷欢绫诲瀷鍚嶇О + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 浠f姤鐘舵 1 寰呮姤閫 2 浠f姤涓 3 浠f姤澶辫触 4 浠f姤鎴愬姛 + */ + private String sbzt; + /** + * 浜哄憳璁よ瘉鐘舵 + */ + private String rzzt; + /** + * 澶辫触鍘熷洜 + */ + private String sbyy; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + } + + + /** + * 缁煎悎鎵寰楃畻绋庣粨鏋滃璞 + */ + @Data + public static class zcgzxj { + /** + * 缁煎悎绠楃◣鎴愬姛鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sscglb; + /** + * 缁煎悎绠楃◣澶辫触鍒楄〃 鍙傝冪患鍚堟墍寰楄緭鍑虹粨鏋滄姤鏂 + */ + private List sssblb; + /** + * 缁煎悎绠楃◣澶辫触鍘熷洜鍒楄〃 鍙傝冪畻绋庡け璐ュ師鍥犲璞 + */ + private List sssbyylb; + /** + * 鍙備笌缁煎悎绠楃◣鎬讳汉鏁 + */ + private int sszrs; + /** + * 缁煎悎绠楃◣澶辫触鎬讳汉鏁 + */ + private int sssbrs; + /** + * 骞撮噾涓婇檺 + */ + private BigDecimal njsx; + /** + * 浣忔埧鍏Н閲戜笂闄 + */ + private BigDecimal zfgjjsx; + /** + * 骞村钩鍧囧伐璧 + */ + private BigDecimal npjgz; + /** + * 浼佷笟涓婃湀鏄惁宸茬敵鎶 0:涓婃湀鏈敵鎶 1:涓婃湀宸茬敵鎶 2:涓婁笂鏈堟湭鐢虫姤 + */ + private String qysysfysb; + /** + * 涓撻」浠f姤鐘舵 + */ + private String clzt; + /** + * 涓撻」浠f姤缁撴灉鍘熷洜 + */ + private String cljgms; + + + /** + * 缁煎悎鎵寰楄緭鍑虹粨鏋滄姤鏂 + */ + @Data + public static class zhsdscjgbw { + /** + * 鏄惁鏄庣粏鐢虫姤 蹇呭~锛氬惁 鏄垨鑰呭惁 + */ + private String sfmxsb; + /** + * 濮撳悕 蹇呭~锛歯ull 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "濮撳悕", width = "10%", column = "xm") + @ExcelHead(title = "濮撳悕", dataIndex = "xm") + private String xm; + /** + * 璇佷欢绫诲瀷 蹇呭~锛歯ull 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + @SalaryTableColumn(text = "璇佷欢绫诲瀷", width = "10%", column = "zzlx") + @ExcelHead(title = "璇佷欢绫诲瀷", dataIndex = "zzlx") + private String zzlx; + /** + * 璇佷欢鍙风爜 蹇呭~锛歯ull 濡傛灉鏄眹鎬荤敵鎶ヨ繑鍥炵┖ + */ + @SalaryTableColumn(text = "璇佷欢鍙风爜", width = "10%", column = "zzhm") + @ExcelHead(title = "璇佷欢鍙风爜", dataIndex = "zzhm") + private String zzhm; + /** + * 浠昏亴鍙楅泧鏃ユ湡 蹇呭~锛氭槸 鏍煎紡YYYY-MM-DD + */ + @SalaryTableColumn(text = "浠昏亴鍙楅泧鏃ユ湡", width = "10%", column = "rzsgrq") + @ExcelHead(title = "浠昏亴鍙楅泧鏃ユ湡", dataIndex = "rzsgrq") + private String rzsgrq; + /** + * 绂昏亴鏃ユ湡 蹇呭~锛氬惁 鏍煎紡YYYY-MM-DD + */ + @SalaryTableColumn(text = "绂昏亴鏃ユ湡", width = "10%", column = "lzrq") + @ExcelHead(title = "绂昏亴鏃ユ湡", dataIndex = "lzrq") + private String lzrq; + /** + * 褰撴湡鏀跺叆棰 蹇呭~锛氭槸 涓嶅~鍐欓粯璁や负0 + */ + @SalaryTableColumn(text = "鏈湡鏀跺叆", width = "10%", column = "sre") + @ExcelHead(title = "鏈湡鏀跺叆", dataIndex = "sre") + private BigDecimal sre; + /** + * 褰撴湡鍏嶇◣鏀跺叆 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鏈湡鍏嶇◣鏀跺叆", width = "10%", column = "mssd") + @ExcelHead(title = "鏈湡鍏嶇◣鏀跺叆", dataIndex = "mssd") + private BigDecimal mssd; + /** + * 鍩烘湰鍏昏佷繚闄 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍩烘湰鍏昏佷繚闄╄垂", width = "10%", column = "jbylaobxf") + @ExcelHead(title = "鍩烘湰鍏昏佷繚闄╄垂", dataIndex = "jbylaobxf") + private BigDecimal jbylaobxf; + /** + * 鍩烘湰鍖荤枟淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍩烘湰鍖荤枟淇濋櫓璐", width = "10%", column = "jbylbxf") + @ExcelHead(title = "鍩烘湰鍖荤枟淇濋櫓璐", dataIndex = "jbylbxf") + private BigDecimal jbylbxf; + /** + * 澶变笟淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "澶变笟淇濋櫓璐", width = "10%", column = "sybxf") + @ExcelHead(title = "澶变笟淇濋櫓璐", dataIndex = "sybxf") + private BigDecimal sybxf; + /** + * 浣忔埧鍏Н閲 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "浣忔埧鍏Н閲", width = "10%", column = "zfgjj") + @ExcelHead(title = "浣忔埧鍏Н閲", dataIndex = "zfgjj") + private BigDecimal zfgjj; + + /** + * 骞撮噾 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "浼佷笟(鑱屼笟)骞撮噾", width = "10%", column = "nj") + @ExcelHead(title = "浼佷笟(鑱屼笟)骞撮噾", dataIndex = "nj") + private BigDecimal nj; + + /** + * 鍟嗕笟鍋ュ悍淇濋櫓 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍟嗕笟鍋ュ悍淇濋櫓", width = "10%", column = "syjkbx") + @ExcelHead(title = "鍟嗕笟鍋ュ悍淇濋櫓", dataIndex = "syjkbx") + private BigDecimal syjkbx; + /** + * 绋庡欢鍏昏佷繚闄 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绋庡欢鍏昏佷繚闄", width = "10%", column = "syylbx") + @ExcelHead(title = "绋庡欢鍏昏佷繚闄", dataIndex = "syylbx") + private BigDecimal syylbx; + /** + * 鍏朵粬 蹇呭~锛歯ull 鎸夋硶寰嬭瀹氬彲浠ュ湪绋庡墠鎵i櫎鐨勯」鐩 + */ + @SalaryTableColumn(text = "鍏朵粬", width = "10%", column = "qt") + @ExcelHead(title = "鍏朵粬", dataIndex = "qt") + private BigDecimal qt; + /** + * 鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍑嗕簣鎵i櫎鐨勬崘璧犻", width = "10%", column = "zykcjze") + @ExcelHead(title = "鍑嗕簣鎵i櫎鐨勬崘璧犻", dataIndex = "zykcjze") + private BigDecimal zykcjze; + + /** + * 鍑忓厤绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "鍑忓厤绋庨", width = "10%", column = "jmse") + @ExcelHead(title = "鍑忓厤绋庨", dataIndex = "jmse") + private BigDecimal jmse; + + /** + * 澶囨敞 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "澶囨敞", width = "10%", column = "bz") + @ExcelHead(title = "澶囨敞", dataIndex = "bz") + private String bz; + + /** + * 绱鏀跺叆棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鏀跺叆棰", width = "10%", column = "ljsre") + @ExcelHead(title = "绱鏀跺叆棰", dataIndex = "ljsre") + private BigDecimal ljsre; + /** + * 绱鍏嶇◣鏀跺叆棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍏嶇◣鏀跺叆", width = "10%", column = "ljmssd") + @ExcelHead(title = "绱鍏嶇◣鏀跺叆", dataIndex = "ljmssd") + private BigDecimal ljmssd; + + /** + * 绱鍑忛櫎璐圭敤棰 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾绱鍑忛櫎璐圭敤 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉绱璐圭敤 + */ + @SalaryTableColumn(text = "绱鍑忛櫎璐圭敤", width = "10%", column = "ljjcfye") + @ExcelHead(title = "绱鍑忛櫎璐圭敤", dataIndex = "ljjcfye") + private BigDecimal ljjcfye; + + /** + * 绱涓撻」鎵i櫎棰 蹇呭~锛歯ull 涓夐櫓涓閲戝悎璁 + */ + @SalaryTableColumn(text = "绱涓撻」鎵i櫎", width = "10%", column = "ljzxkce") + @ExcelHead(title = "绱涓撻」鎵i櫎", dataIndex = "ljzxkce") + private BigDecimal ljzxkce; + + /** + * 绱瀛愬コ鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱瀛愬コ鏁欒偛", width = "10%", column = "ljznjyzc") + @ExcelHead(title = "绱瀛愬コ鏁欒偛", dataIndex = "ljznjyzc") + private BigDecimal ljznjyzc; + /** + * 绱缁х画鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱缁х画鏁欒偛", width = "10%", column = "ljjxjyzc") + @ExcelHead(title = "绱缁х画鏁欒偛", dataIndex = "ljjxjyzc") + private BigDecimal ljjxjyzc; + /** + * 绱闈炲鍘嗙户缁暀鑲叉敮鎸 蹇呭~锛歯ull + */ + private BigDecimal ljfxljxjyzc; + /** + * 绱瀛﹀巻缁х画鏁欒偛鏀寔 蹇呭~锛歯ull + */ + private BigDecimal ljxljxjyzc; + /** + * 绱浣忔埧绉熼噾鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱浣忔埧绉熼噾", width = "10%", column = "ljzfzjzc") + @ExcelHead(title = "绱浣忔埧绉熼噾", dataIndex = "ljzfzjzc") + private BigDecimal ljzfzjzc; + /** + * 绱鎴垮眿璐锋鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱浣忔埧璐锋鍒╂伅", width = "10%", column = "ljzfdklxzc") + @ExcelHead(title = "绱浣忔埧璐锋鍒╂伅", dataIndex = "ljzfdklxzc") + private BigDecimal ljzfdklxzc; + /** + * 绱璧″吇鑰佷汉鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱璧″吇鑰佷汉", width = "10%", column = "ljsylrzc") + @ExcelHead(title = "绱璧″吇鑰佷汉", dataIndex = "ljsylrzc") + private BigDecimal ljsylrzc; + /** + * 绱3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", width = "10%", column = "ljyyezhzc") + @ExcelHead(title = "绱3宀佷互涓嬪┐骞煎効鐓ф姢", dataIndex = "ljyyezhzc") + private BigDecimal ljyyezhzc; + + + /** + * 绱涓汉鍏昏侀噾 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱涓汉鍏昏侀噾", width = "10%", column = "ljgrylj") + @ExcelHead(title = "绱涓汉鍏昏侀噾", dataIndex = "ljgrylj") + private BigDecimal ljgrylj; + + /** + * 绱鍏朵粬鎵i櫎棰 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍏朵粬鎵i櫎", width = "10%", column = "ljqtkce") + @ExcelHead(title = "绱鍏朵粬鎵i櫎", dataIndex = "ljqtkce") + private BigDecimal ljqtkce; + + /** + * 绱鍑嗕簣鎵i櫎鐨勬崘璧犻 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍑嗕簣鎵i櫎鐨勬崘璧", width = "10%", column = "ljzykcjze") + @ExcelHead(title = "绱鍑嗕簣鎵i櫎鐨勬崘璧", dataIndex = "ljzykcjze") + private BigDecimal ljzykcjze; + + /** + * 绱搴旂撼绋庢墍寰楅 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱搴旂撼绋庢墍寰楅", width = "10%", column = "ljynssde") + @ExcelHead(title = "绱搴旂撼绋庢墍寰楅", dataIndex = "ljynssde") + private BigDecimal ljynssde; + + /** + * 绋庣巼 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绋庣巼", width = "10%", column = "sl") + @ExcelHead(title = "绋庣巼", dataIndex = "sl") + private BigDecimal sl; + /** + * 閫熺畻鎵i櫎鏁 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "閫熺畻鎵i櫎鏁", width = "10%", column = "sskcs") + @ExcelHead(title = "閫熺畻鎵i櫎鏁", dataIndex = "sskcs") + private BigDecimal sskcs; + + /** + * 绱搴旂撼绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱搴旂撼绋庨", width = "10%", column = "ljynse") + @ExcelHead(title = "绱搴旂撼绋庨", dataIndex = "ljynse") + private BigDecimal ljynse; + + /** + * 绱鍑忓厤绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱鍑忓厤绋庨", width = "10%", column = "ljjmse") + @ExcelHead(title = "绱鍑忓厤绋庨", dataIndex = "ljjmse") + private BigDecimal ljjmse; + + /** + * 绱搴旀墸缂寸◣棰 蹇呭~锛歯ull 绱搴旀墸缂寸◣棰 = 绱搴旂撼绋庨 - 绱鍑忓厤绋庨 + */ + @SalaryTableColumn(text = "绱搴旀墸缂寸◣棰", width = "10%", column = "ljyingkjse") + @ExcelHead(title = "绱搴旀墸缂寸◣棰", dataIndex = "ljyingkjse") + private BigDecimal ljyingkjse; + /** + * 绱宸茬即绋庨 蹇呭~锛歯ull + */ + @SalaryTableColumn(text = "绱宸茬即绋庨", width = "10%", column = "ljykjse") + @ExcelHead(title = "绱宸茬即绋庨", dataIndex = "ljykjse") + private BigDecimal ljykjse; + /** + * 宸茬即绋庨 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ykjse; + + /** + * 绱涓撻」闄勫姞鎵i櫎棰 蹇呭~锛歯ull 涓撻」闄勫姞鍚堣 + */ + private BigDecimal ljzxfjkce; + + /** + * 搴旇ˉ閫绋庨 蹇呭~锛歯ull 搴旇ˉ閫绋庨=绱搴旀墸缂寸◣棰-绱宸茬即绋庨 + */ + @SalaryTableColumn(text = "搴旇ˉ(閫)绋庨", width = "10%", column = "ybtse") + @ExcelHead(title = "搴旇ˉ(閫)绋庨", dataIndex = "ybtse") + private BigDecimal ybtse; + + /** + * 瀛愬コ鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal znjyzc; + /** + * 璧″吇鑰佷汉鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal sylrzc; + /** + * 浣忔埧璐锋鍒╂伅鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal zfdklxzc; + /** + * 浣忔埧绉熼噾鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal zfzjzc; + /** + * 缁х画鏁欒偛鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal jxjyzc; + /** + * 闈炲鍘嗙户缁暀鑲叉敮鍑 蹇呭~锛歯ull + */ + private BigDecimal fxljxjyzc; + /** + * 3宀佷互涓嬪┐骞煎効鐓ф姢鏀嚭 蹇呭~锛歯ull + */ + private BigDecimal yyezhzc; + + + /** + * 鍑忛櫎璐圭敤 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾鐨勫噺闄よ垂鐢ㄣ 瀵瑰簲淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉鐨勮垂鐢 + */ + private BigDecimal jcfy; + /** + * 鍏朵粬鎵i櫎鍚堣 蹇呭~锛歯ull + */ + private BigDecimal qtckhj; + /** + * 搴旂撼绋庢墍寰楅 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ynssde; + /** + * 搴旂撼绋庨 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal ynse; + + /** + * 搴旀墸缂寸◣棰 蹇呭~锛歯ull 姝e父宸ヨ祫钖噾杩斿洖Null + */ + private BigDecimal yingkjse; + + /** + * 鎵寰楅」鐩悕绉 蹇呭~锛氭槸 姝e父宸ヨ祫钖噾锛涘叏骞翠竴娆℃у閲戞敹鍏ワ紱绋块叕鎵寰楋紱鍔冲姟鎶ラ叕 + */ + private String sdxm; + + /** + * 绱鏈堝噺闄よ垂鐢 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal ljyjcfy; + /** + * 鍏佽鎵i櫎绋庤垂 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal yxkcsf; + /** + * 灞曚笟鎴愭湰 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉 + */ + private BigDecimal zycb; + /** + * 鏈堝噺闄よ垂鐢 蹇呭~锛歯ull 淇濋櫓钀ラ攢鍛樸佽瘉鍒哥粡绾汉锛屽叾浠栬繛缁姵鍔℃姤閰殑鍑忛櫎璐圭敤 + */ + private BigDecimal yjcfy; + + /** + * 绱涓汉鍏昏侀噾鏍¢獙鐮 蹇呭~锛歯ull + */ + private String ljgryljjym; + /** + * 浼佷笟涓婃湀鏄惁宸茬敵鎶 蹇呭~锛歯ull 浠呭湪涓や釜鏈堢畻绋庡満鏅椂浣跨敤锛屽綋鍓嶆湀鍒嗕负N鏈堬細 + * 0琛ㄧずN-1鏈堬紙涓婃湀锛夋湭鐢虫姤 + * 1琛ㄧずN-1鏈堬紙涓婃湀锛夊凡鐢虫姤 + * 2琛ㄧずN-2鏈堬紙涓婁笂涓湀锛夋湭鐢虫姤 + */ + private String qysysfysb; + /** + * 鍛樺伐鍦ㄧ◣灞绱宸叉墸缂寸殑绋庨 蹇呭~锛歯ull 褰撳墠鏈堝垎涓篘,濡傛灉N-1锛堜笂鏈堬級宸茬敵鎶ワ紝鍒欒繑鍥濶-1鏈堝憳宸ュ湪绋庡眬绱宸叉墸缂寸殑绋庨; + * 濡傛灉N-1鏈堟湭鐢虫姤锛屽垯杩斿洖N-2鏈堝伐鍦ㄧ◣灞绱宸叉墸缂寸殑绋庨; + */ + private BigDecimal ygzsjljykjse; + + /** + * 鏈湀宸茬疮璁℃墸闄ょ◣棰 蹇呭~锛歯ull 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁 + */ + private BigDecimal byyljkjse; + /** + * 鏈搴旀墸缂寸◣棰 蹇呭~锛歯ull 閽堝涓鏈堝娆$畻绋庣殑鍦烘櫙瀛楁锛屾湰娆″簲鎵g即绋庨=鏈湀搴旀墸缂寸◣棰-鏈湀宸茬疮璁$◣棰 + */ + private BigDecimal bcykjse; + /** + * 鍒嗘憡骞村害鏁 蹇呭~锛歯ull + */ + private Integer ftnds; + /** + * 骞村噺闄よ垂鐢 蹇呭~锛歯ull 榛樿涓60000 + */ + private BigDecimal njcfy; + + } + + /** + * 4.4.1.3.2绠楃◣澶辫触鍘熷洜瀵硅薄 + */ + @Data + public static class sssbyydx { + /** + * 浜哄憳ID + */ + private Integer ygid; + /** + * 浜哄憳鍚嶇О + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 閿欒鐮 + */ + private String cwm; + /** + * 閿欒淇℃伅 + */ + private String cwxx; + /** + * 鎵寰楃◣鐨刢ode + */ + private String sdxmdm; + /** + * 鎵寰楃◣鐨勫悕绉 + */ + private String sdxmmc; + } + + } + + } + + /** + * 4.4.1.3.1.1浜哄憳浠f姤缁撴灉瀵硅薄 + */ + @Data + public static class rydbjgdx { + /** + * 浜哄憳ID + */ + private Integer ygid; + /** + * 浜哄憳鍚嶇О + */ + private String xm; + /** + * 璇佷欢绫诲瀷 瑙佽瘉浠剁被鍨嬪瓧鍏 + */ + private String zzlx; + /** + * 璇佷欢鍙风爜 + */ + private String zzhm; + /** + * 閿欒鐮 + */ + private String cwm; + /** + * 閿欒淇℃伅 + */ + private String cwxx; + /** + * 鎵寰楃◣鐨刢ode + */ + private String sdxmdm; + /** + * 鎵寰楃◣鐨勫悕绉 + */ + private String sdxmmc; + } + } + + +} diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java index 6468f3f4b..ab3600c5e 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsItemServiceImpl.java @@ -116,10 +116,10 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt .maxRule(SalaryEntityUtil.toJSONString(saveParam.getMaxRule())) .minRule(SalaryEntityUtil.toJSONString(saveParam.getMinRule())) .medianRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule())) - .lastRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule())) - .oldRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule())) - .frequentRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule())) - .tileRule(SalaryEntityUtil.toJSONString(saveParam.getMedianRule())) + .lastRule(SalaryEntityUtil.toJSONString(saveParam.getLastRule())) + .oldRule(SalaryEntityUtil.toJSONString(saveParam.getOldRule())) + .frequentRule(SalaryEntityUtil.toJSONString(saveParam.getFrequentRule())) + .tileRule(SalaryEntityUtil.toJSONString(saveParam.getTileRule())) .indexValue(max + 1) .statReportId(saveParam.getStatReportId()) .unitType(saveParam.getUnitType() == null ? UnitTypeEnum.YUAN.getValue() : saveParam.getUnitType()) diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java index c71f5193c..3f9745f11 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java @@ -352,7 +352,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary po.setCreator(uid); po.setCreateTime(now); po.setUpdateTime(now); - po.setReportName(po.getReportName()+"_copy"); + po.setReportName(po.getReportName() + "_copy"); getSalaryStatisticsReportMapper().insertIgnoreNull(po); @@ -414,11 +414,21 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth())); param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth())); String key = "id"; - param.setTaxAgent(((List) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setSubCompany(((List) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setDepart(((List) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setEmployee(((List) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); - param.setHiredate(JSON.parseArray(reportPO.getHiredateSetting(), Date.class)); + if (reportPO.getTaxAgentSetting() != null) { + param.setTaxAgent(((List) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getSubCompanySetting() != null) { + param.setSubCompany(((List) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getDepartSetting() != null) { + param.setDepart(((List) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getEmployeeSetting() != null) { + param.setEmployee(((List) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList())); + } + if (reportPO.getHiredateSetting() != null) { + param.setHiredate(JSON.parseArray(reportPO.getHiredateSetting(), Date.class)); + } SalaryStatisticsReportDataQueryParam queryParam = new SalaryStatisticsReportDataQueryParam(); com.mzlion.core.utils.BeanUtils.copyProperties(param, queryParam); // 鑾峰彇鏈湡鎶ヨ〃鍒嗘潈鍚庣殑鏍哥畻浜哄憳 @@ -487,7 +497,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Arrays.asList(salaryReportConditions.split(",")).forEach(paramMd5 -> { if (StringUtils.isNotBlank(paramMd5)) { //鏉′欢瀵瑰簲鐨勭粨鏋 - getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); + getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5); } } ); @@ -1062,7 +1072,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary List fieldSettings = Optional.ofNullable(Optional.ofNullable(employeeInfoExpandDTO).orElse(new EmployeeInfoExpandDTO()).getFieldSettings()).orElse(new ArrayList<>()); Map> expandEmployeeMap = getSalaryEmployeeService(user).expandEmployeeMap(empIds, employeeInfoExpandDTO); - log.info("鎵╁睍灞炴"+expandEmployeeMap); + log.info("鎵╁睍灞炴" + expandEmployeeMap); // List extEmployees = extEmployeeService.listByIdsWithDeleted(accountDetailPOList.stream().filter(e -> EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(e.getEmployeeType())).map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()), data.getTenantKey()); // Map employeeExtByIdMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getId, ExtEmployeePO::getUsername); @@ -1075,7 +1085,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary temp.put(DM, employeeByIdMap.get(k).getUsername()); fieldSettings.forEach( fieldSetting -> { - temp.put(fieldSetting.getField(), expandEmployeeMap.getOrDefault(k,new HashMap<>()).get(fieldSetting.getField())); + temp.put(fieldSetting.getField(), expandEmployeeMap.getOrDefault(k, new HashMap<>()).get(fieldSetting.getField())); } ); temp.putAll(SalaryStatisticsReportBO.calculateItem(v, lastEmployeeListMap.get(k), sameEmployeeListMap.get(k), salaryAcctResultValueMap, data.getSalaryStatisticsItemList())); diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java index ce270b1fa..508877028 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java @@ -216,6 +216,7 @@ public class SalaryStatisticsReportWrapper extends Service { /** * 澶嶅埗钖祫璐﹀ + * * @param id */ public void duplicate(Long id) { @@ -322,7 +323,7 @@ public class SalaryStatisticsReportWrapper extends Service { //鎶ヨ〃涓紦瀛樼殑鏉′欢 salaryReportConditions = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id)); if (StringUtils.isNotBlank(salaryReportConditions) && salaryReportConditions.contains(paramMd5)) { - return getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5); + return getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5); } } @@ -344,9 +345,10 @@ public class SalaryStatisticsReportWrapper extends Service { resultMap.put("reportId", id); + //璁剧疆鎶ヨ〃缂撳瓨 getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_IDS, salaryReportIds + "," + id); getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_CONDITIONS + id, salaryReportConditions + "," + paramMd5); - getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_DATA + paramMd5, resultMap); + getSalaryCacheService(user).set(SalaryCacheKey.SALARY_REPORT_DATA + id + "_" + paramMd5, resultMap); return resultMap; diff --git a/src/com/engine/salary/service/EmployeeDeclareExcelService.java b/src/com/engine/salary/service/EmployeeDeclareExcelService.java index 6b0f75775..cce2e72e9 100644 --- a/src/com/engine/salary/service/EmployeeDeclareExcelService.java +++ b/src/com/engine/salary/service/EmployeeDeclareExcelService.java @@ -1,8 +1,11 @@ package com.engine.salary.service; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.util.Map; + /** * @description: 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ鍑 * @author: xiajun @@ -18,7 +21,22 @@ public interface EmployeeDeclareExcelService { * @param importParam * @return */ -// Map exportTemplate(EmployeeDeclareImportParam importParam); + XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam); + + + /** + * 瀵煎叆棰勮 + * @param param + * @return + */ + Map preview(EmployeeDeclareImportParam param); + + /** + * 瀵煎叆浜哄憳鎶ラ佹暟鎹 + * @param param + * @return + */ + Map importData(EmployeeDeclareImportParam param); /** * 瀵煎嚭浜哄憳淇℃伅閲囬泦-鍏ㄩ儴 diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 0869a5869..ed184159a 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -182,4 +182,6 @@ public interface EmployeeDeclareService{ * @return */ String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param); + + void batchInsert(List insertList); } diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index 67320ed0d..0090f8330 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -4,10 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.util.page.PageInfo; @@ -207,4 +204,10 @@ public interface SalaryAcctResultService { * @return */ Boolean checkAuth(Long salaryAcctRecordId); + + /** + * 钖祫鏍哥畻缁撴灉鎵归噺鏇存柊 + * @param param + */ + void batchUpdate(SalaryAcctResultBatchUpdateParam param); } diff --git a/src/com/engine/salary/service/SalarySendService.java b/src/com/engine/salary/service/SalarySendService.java index 90da3440f..72fc71423 100644 --- a/src/com/engine/salary/service/SalarySendService.java +++ b/src/com/engine/salary/service/SalarySendService.java @@ -216,4 +216,6 @@ public interface SalarySendService { void autoConfirmSalaryBill(List needAutoIds); List getByIds(List salarySendId); + + List listSome(SalarySendPO param); } diff --git a/src/com/engine/salary/service/TaxDeclarationExcelService.java b/src/com/engine/salary/service/TaxDeclarationExcelService.java index 15d6c81fd..e5e154fe7 100644 --- a/src/com/engine/salary/service/TaxDeclarationExcelService.java +++ b/src/com/engine/salary/service/TaxDeclarationExcelService.java @@ -1,9 +1,12 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.util.Map; + /** * 涓◣鐢虫姤琛ㄥ鍑 *

Copyright: Copyright (c) 2022

@@ -45,4 +48,16 @@ public interface TaxDeclarationExcelService { * @return */ XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam); + + XSSFWorkbook downloadTemplate(DownloadTemplateParam param); + /** + * 棰勮 + */ + Map preview(DownloadTemplateParam importParam); + + /** + * 瀵煎叆鏁版嵁 + */ + Map importData(DownloadTemplateParam importParam); + } diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index 2731904a5..ef4c71fd1 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -3,6 +3,8 @@ package com.engine.salary.service; import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -23,6 +25,9 @@ public interface TaxDeclarationService { */ List listByTaxCycleAndTaxAgentIds(YearMonth salaryMonth, Collection taxAgentIds); + List listByTaxDeclareRecordId(Long taxDeclareRecordId); + List listByTaxDeclareRecordId(Long taxDeclareRecordId,Integer incomeCategory); + PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam); List countByTaxDeclarationId(Collection taxAgentIds); @@ -33,7 +38,6 @@ public interface TaxDeclarationService { /** * 鍒犻櫎涓◣鐢虫姤琛 - * */ void delete(SalaryAcctRecordPO salaryAcctRecordPO); @@ -48,6 +52,7 @@ public interface TaxDeclarationService { /** * 鎾ゅ洖涓◣鐢虫姤鍗 + * * @param taxDeclarationId */ void withDrawTaxDeclaration(Long taxDeclarationId); @@ -70,4 +75,12 @@ public interface TaxDeclarationService { */ List listByTaxCycleRange(YearMonthRange yearMonthRange); + + /** + * 鏂板鐢虫姤琛 + * @param param + */ + void addTaxDeclaration(TaxDeclarationAddParam param); + + void deleteTaxDeclaration(TaxDeclarationDeleteParam param); } diff --git a/src/com/engine/salary/service/TaxDeclarationValueService.java b/src/com/engine/salary/service/TaxDeclarationValueService.java index 8ec154857..69b4acdb2 100644 --- a/src/com/engine/salary/service/TaxDeclarationValueService.java +++ b/src/com/engine/salary/service/TaxDeclarationValueService.java @@ -1,13 +1,17 @@ package com.engine.salary.service; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.util.page.PageInfo; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 涓◣鐢虫姤琛ㄦ槑缁 @@ -25,7 +29,7 @@ public interface TaxDeclarationValueService { * @param taxDeclarationIds * @return */ - PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam,Collection taxDeclarationIds); + PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds); /** * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 @@ -35,6 +39,8 @@ public interface TaxDeclarationValueService { */ List listByTaxDeclarationIds(Collection taxDeclarationIds); + List listByTaxDeclarationId(Long taxDeclarationId); + /** * 鏌ヨ涓◣鐢虫姤琛ㄦ槑缁 * @@ -58,10 +64,40 @@ public interface TaxDeclarationValueService { */ void batchSave(List taxDeclarationValues); + void batchEdit(List taxDeclarationValues); + + + void save(TaxDeclareRecordDetailSaveParam param); + + void edit(TaxDeclareRecordDetailSaveParam param); + + TaxDeclarationValuePO getById(Long id); + /** * 鍒犻櫎涓◣鐢虫姤琛ㄦ槑缁 * * @param taxDeclareRecordIds */ void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds); + + /** + * 鍥犱负鍗曠嫭鐢虫姤骞寸粓濂栦笉鍙 + * 闇瑕佽ˉ鍏呮甯稿伐璧勮柂閲戠殑鐢虫姤锛屾寜0鐢虫姤 + * + * @param po + */ + void autoAddWagesDeclare(TaxDeclareRecordPO po); + + /** + * 瀵规瘮 + * @param param + */ + Map contrast(ContrastQueryParam param); + + + /** + * 鏍规嵁涓婚敭鍒犻櫎 + * @param deleteId + */ + void deleteById(Long deleteId); } diff --git a/src/com/engine/salary/service/TaxDeclareRecordService.java b/src/com/engine/salary/service/TaxDeclareRecordService.java index 4c325a520..25906560f 100644 --- a/src/com/engine/salary/service/TaxDeclareRecordService.java +++ b/src/com/engine/salary/service/TaxDeclareRecordService.java @@ -2,11 +2,13 @@ package com.engine.salary.service; import com.engine.salary.common.YearMonthRange; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO; +import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.util.page.PageInfo; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.util.Collection; import java.util.Date; @@ -20,7 +22,7 @@ import java.util.List; * @author qiantao * @version 1.0 **/ -public interface TaxDeclareRecordService { +public interface TaxDeclareRecordService { /** * 鏌ヨ涓◣鐢虫姤璁板綍 @@ -79,6 +81,13 @@ public interface TaxDeclareRecordService { */ void save(TaxDeclarationSaveParam saveParam); + /** + * 绋庡眬绔敵鎶ユ槑缁嗘煡璇 + * + * @param id + */ + String queryCompanyIncomes(Long id); + /** * 鍒锋柊鏁版嵁 @@ -134,11 +143,14 @@ public interface TaxDeclareRecordService { /** * 鐢虫姤鍐呯疆绠楃◣缁撴灉鏌ヨ + * * @param id * @return */ Object getDeclareTaxResultFeedback(Long id); + XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param); + /** * 浣滃簾 * @@ -160,6 +172,13 @@ public interface TaxDeclareRecordService { */ void updateDeclare(Long id); + /** + * 鎾ら攢鐢虫姤 + * + * @param id + */ + void cancelCorrect(Long id); + /** * 绋庡眬绔敵鎶ョ姸鎬佹煡璇 * @@ -167,12 +186,7 @@ public interface TaxDeclareRecordService { */ String queryDeclareStatus(Long id); - /** - * 绋庡眬绔敵鎶ユ槑缁嗘煡璇 - * - * @param id - */ - String queryCompanyIncomes(Long id); + void updateById(TaxDeclareRecordPO taxDeclareRecord); diff --git a/src/com/engine/salary/service/TaxReportColumnService.java b/src/com/engine/salary/service/TaxReportColumnService.java index c9f466e14..329cd697e 100644 --- a/src/com/engine/salary/service/TaxReportColumnService.java +++ b/src/com/engine/salary/service/TaxReportColumnService.java @@ -28,5 +28,5 @@ public interface TaxReportColumnService { * @param incomeCategory * @return */ - List listByIncomeCategory(IncomeCategoryEnum incomeCategory); + List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes); } diff --git a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java index 2b001a10c..47647f058 100644 --- a/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java +++ b/src/com/engine/salary/service/impl/AbstractTaxPaymentService.java @@ -39,7 +39,6 @@ import java.math.BigDecimal; import java.util.*; /** - * *

Copyright: Copyright (c) 2023

*

Company: 娉涘井杞欢

* @@ -202,12 +201,15 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa .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); + 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()); diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index f15ae19f1..5312f1c51 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.core.impl.Service; @@ -31,6 +32,8 @@ import java.util.stream.Collectors; **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } @@ -122,58 +125,128 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap, Long employeeId, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if(fundJson!=null){ fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if(otherJson!=null){ otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "鐢虫姤鍩烘暟"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "鐢虫姤鍩烘暟"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"), social + "otherBase"); + } + }); + } + // map鏍规嵁value鎺掑簭 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -188,6 +261,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index bdf2bfb67..805bbf910 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -2,41 +2,76 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareBO; +import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO; +import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareImportParam; import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareListQueryParam; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.SalaryOnOffEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper; import com.engine.salary.service.EmployeeDeclareExcelService; import com.engine.salary.service.EmployeeDeclareService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; -import com.engine.salary.util.JsonUtil; -import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.*; +import com.engine.salary.util.valid.SalaryCardUtil; +import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.BeanWrapper; +import org.springframework.beans.BeanWrapperImpl; +import weaver.file.ExcelSheet; +import weaver.file.ImageFileManager; +import weaver.general.Util; import weaver.hrm.User; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.beans.PropertyDescriptor; +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** - * @description: 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ鍑 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 9/7/22 5:39 PM - * @version:v1.0 - */ + * 浜哄憳鎶ラ侊紙浜哄憳锛夊鍏ュ鍑 + *

Copyright: Copyright (c) 2023

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ @Slf4j public class EmployeeDeclareExcelServiceImpl extends Service implements EmployeeDeclareExcelService { - private EmployeeDeclareService getEmployeeDeclareService(User user) { return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -46,67 +81,484 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } -// @Override -// public Map exportTemplate( EmployeeDeclareImportParam importParam) { -// String tenantKey = simpleEmployee.getTenantKey(); -// Long currentEmployeeId = simpleEmployee.getEmployeeId(); -// // 鏌ヨ浜哄憳 -// List employeeDeclares = Collections.emptyList(); -// if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { -// employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); -// } -// String yesI18 = SalaryI18nUtil.getI18nLabel( 84967, "鏄"); -// String noI18 = SalaryI18nUtil.getI18nLabel( 84968, "鍚"); -// List> rows = Lists.newArrayList(); -// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { -// EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); -// EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); -// List row = Lists.newArrayList(); -// row.add(employeeDeclare.getJobNum()); -// row.add(employeeDeclare.getEmployeeName()); -// row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); -// row.add(employeeDeclare.getCardNum()); -// row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); -// row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); -// row.add(employeeDeclare.getEmploymentFirstYear()); -// row.add(employeeDeclare.getMobile()); -// row.add(Util.null2String(employeeDeclare.getEmploymentDate())); -// row.add(Util.null2String(employeeDeclare.getDismissDate())); -// row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); -// row.add(employeeDeclare.getDisabilityCardNo()); -// row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); -// row.add(employeeDeclare.getMartyrDependentsCardNo()); -// row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); -// row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); -// rows.add(row); -// } -// // 缁勮excel瀵煎嚭鏁版嵁 -// String[] headers = getImportHeader(currentEmployeeId, tenantKey).toArray(new String[0]); -// ExcelSheetData excelSheetData = new ExcelSheetData(); -// excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel( 156425, "浜哄憳淇℃伅閲囬泦")); -// excelSheetData.setHeaders(Collections.singletonList(headers)); -// excelSheetData.setRows(rows); -// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder() -// .fileName(SalaryI18nUtil.getI18nLabel( 156424, "浜哄憳淇℃伅閲囬泦瀵煎叆妯℃澘") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now())) -// .dataType(SalaryI18nUtil.getI18nLabel( 156424, "浜哄憳淇℃伅閲囬泦瀵煎叆妯℃澘")) -// .function(excelExportParam.getFunction()) -// .handlerName("exportEmployeeDeclareTemplate") -// .flag(true) -// .bizId(excelExportParam.getBiz()) -// .module(excelExportParam.getModule()) -// .userId(simpleEmployee.getEmployeeId()) -// .tenantKey(simpleEmployee.getTenantKey()) -// .operator(simpleEmployee.getUsername()) -// .eteamsId(TenantRpcContext.getEteamsId()) -// .build(); -// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData)); -// } -// -// @BatchExportHandler("exportEmployeeDeclareTemplate") -// private void exportEmployeeDeclareTemplate() { -// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage(); -// log.info("瀵煎嚭缁撴潫锛歿}", JsonUtil.toJsonString(message)); -// } + private EmployeeDeclareMapper getEmployeeDeclareMapper() { + return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); + } + + @Override + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam importParam) { + // 鏌ヨ浜哄憳 + List employeeDeclares = Collections.emptyList(); + if (StringUtils.equalsIgnoreCase(importParam.getExportData(), "true")) { + employeeDeclares = getEmployeeDeclareService(user).listByParam(importParam); + } + String yesI18 = SalaryI18nUtil.getI18nLabel(111111, "鏄"); + String noI18 = SalaryI18nUtil.getI18nLabel(111111, "鍚"); + List> rows = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class); + EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class); + List row = Lists.newArrayList(); + row.add(employeeDeclare.getJobNum()); + row.add(employeeDeclare.getEmployeeName()); + row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); + row.add(employeeDeclare.getCardNum()); + row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); + row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); + row.add(employeeDeclare.getEmploymentFirstYear()); + row.add(employeeDeclare.getMobile()); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); + row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); + row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getDisabilityCardNo()); + row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); + row.add(employeeDeclare.getMartyrDependentsCardNo()); + row.add(Objects.equals(employeeDeclare.getLonelyOld(), 1) ? yesI18 : noI18); + row.add(Objects.equals(employeeDeclare.getDeductExpenses(), 1) ? yesI18 : noI18); + rows.add(row); + } + // 缁勮excel瀵煎嚭鏁版嵁 + ExcelSheetData excelSheetData = new ExcelSheetData(); + excelSheetData.setSheetName(SalaryI18nUtil.getI18nLabel(111111, "浜哄憳淇℃伅閲囬泦")); + excelSheetData.setHeaders(getImportHeader()); + excelSheetData.setRows(rows); + return ExcelUtil.genWorkbook(excelSheetData); + } + + @Override + public Map preview(EmployeeDeclareImportParam param) { + //1銆佸弬鏁版牎楠 + String imageId = param.getImageId(); + if (StringUtils.isBlank(imageId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鏂囦欢id涓虹┖")); + } + Map map = new HashMap<>(); + + InputStream fileInputStream = null; + try { + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + map.put("headers", headers); + map.put("list", ExcelParseHelper.parse2List(sheet, 1)); + + return map; + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + } + + @Override + public Map importData(EmployeeDeclareImportParam param) { + Map apidatas = new HashMap<>(); + InputStream fileInputStream = null; + try { + Date now = new Date(); + // 涓◣鎵g即涔夊姟浜篿d + Long taxAgentId = param.getTaxAgentId(); + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); + if (taxAgent == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "鍙傛暟閿欒锛屾棤娉曟壘鍒颁釜绋庢墸缂翠箟鍔′汉")); + } + // 绋庢鎵灞炴湡 + String taxCycle = SalaryDateUtil.getFormatDate(param.getTaxCycle()); + Date taxCycleDate = param.getTaxCycle(); + + // 瀵煎嚭妯℃澘涓殑琛ㄥご + List headerList = getImportHeader().stream().map(header -> header.toString()).collect(Collectors.toList()); + // 鏌ヨ鎵鏈夌殑浜哄憳 + List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + // 鏌ヨ鎵鏈夌殑澶栭儴浜哄憳 + List extEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.EXT); + // 鏌ヨ浜哄憳鎶ラ佽〃鐨勪汉鍛 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(SalaryDateUtil.dateStrToLocalDate(taxCycle), taxAgentId); + // 鏍¢獙瀛楁 + String checkType = param.getCheckType(); + Map extEmployeeMap = Maps.newHashMap(); + Map simpleEmployeeMap = Maps.newHashMap(); + Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); + if (Objects.equals(checkType, "jobNum")) { + extEmployeeMap = Collections.emptyMap(); + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getWorkcode); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); + } else { + // 鏌ヨ鎵鏈変汉鍛樼殑涓汉淇℃伅 + simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getIdNo); + extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, DataCollectionEmployee::getIdNo); + employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); + } + // 闇瑕佹柊澧炵殑鎶ラ佷汉鍛 + List needAddEmployeeDeclares = Lists.newArrayList(); + // 闇瑕佹洿鏂扮殑鎶ラ佷汉鍛 + List needUpdateEmployeeDeclares = Lists.newArrayList(); + // 绱㈠紩(鐢ㄤ簬璁$畻杩涘害) + int index = 0; + // 澶辫触鐨勬暟閲 + int failCount = 0; + // 鎴愬姛鐨勬暟閲 + int successCount = 0; + // 閿欒琛岀殑绱㈠紩 + int failRowIndex = 1; + // 鍖呭惈閿欒鎻愮ず淇℃伅鐨剆heet椤 + List errorExcelSheets = Lists.newArrayList(); + + String imageId = Util.null2String(param.getImageId()); + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + // 琛ㄥご + List headers = ExcelSupport.getSheetHeader(sheet, 0); + + // 妫鏌ヨ〃澶 + String isCorrectHeader = checkHeader(headers, headerList); + if (isCorrectHeader != null) { + throw new SalaryRunTimeException(isCorrectHeader); + } + // 鏁版嵁 + List> data = ExcelParseHelper.parse2Map(sheet, 1); + if (CollectionUtils.isEmpty(data)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "瀵煎叆鏁版嵁涓嶈兘涓虹┖")); + } + // 閿欒鎻愮ず淇℃伅 + List excelComments = Lists.newArrayList(); + List errorData = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + //琛屽彿 + String rowIndex = String.format("绗%s琛", i + 2); + + Map map = data.get(i); + // 鏁版嵁鏄惁瀛樺湪閿欒 + boolean isError = false; + EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); + for (String dataKey : headerList) { + String dataValue = Util.null2String(map.get(dataKey)); + if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel( 0, "宸ュ彿"))) { + if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "宸ュ彿涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } + employeeDeclareExcel.setJobNum(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "濮撳悕"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "濮撳悕涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmployeeName(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "璇佷欢绫诲瀷"))) { + employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue().toString()); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else if (!SalaryCardUtil.checkIdNum(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "璇佷欢鍙风爜鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + // 韬唤璇佸彿鍏ㄩ儴杞负澶у啓 + employeeDeclareExcel.setCardNum(dataValue.toUpperCase()); + employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); + employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "浜哄憳鐘舵"))) { + boolean legalDataValue = false; + for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { + if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue().toString()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浜哄憳鐘舵佸彧鑳藉~鍐欐甯告垨闈炴甯")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))) { + boolean legalDataValue = false; + for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { + if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { + legalDataValue = true; + employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue().toString()); + break; + } + } + if (!legalDataValue) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷濉啓閿欒")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鍏ヨ亴骞村害灏变笟鎯呭舰"))) { + employeeDeclareExcel.setEmploymentFirstYear(dataValue); + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜"))) { + if (StringUtils.isEmpty(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜涓嶈兘涓虹┖")); + errorData.add(errorMessageMap); + } else if (!SalaryCardUtil.checkMobile(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鎵嬫満鍙风爜鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setMobile(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))) { + if (StringUtils.isEmpty(dataValue)) { + if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浠昏亴鍙楅泧浠庝笟绫诲瀷涓嶄负銆屽叾浠栥嶆椂锛屼换鑱屽彈闆囦粠涓氭棩鏈熶负蹇呭~")); + errorData.add(errorMessageMap); + } + } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0,10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "绂昏亴鏃ユ湡"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue().toString())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "浜哄憳鐘舵佷负闈炴甯告椂锛岀鑱屾棩鏈熷繀濉")); + errorData.add(errorMessageMap); + } + } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0,10); + } + if (!SalaryDateUtil.checkDay(dataValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏃ユ湡鏍煎紡涓嶆纭")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setDismissDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); + } + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁娈嬬柧"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁娈嬬柧鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "娈嬬柧璇佸彿"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "銆屾槸鍚︽畫鐤俱嶅~銆屾槸銆嶆椂锛屾畫鐤捐瘉鍙峰繀濉")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setDisabilityCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁鐑堝睘"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁鐑堝睘鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鐑堝睘璇佸彿"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "銆屾槸鍚︾儓灞炪嶅~銆屾槸銆嶆椂锛岀儓灞炶瘉鍙峰繀濉")); + errorData.add(errorMessageMap); + } + } else { + employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁瀛よ"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁瀛よ佸彧鑳藉~鍐欐槸涓庡惁")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "鏄惁鎵i櫎鍑忛櫎璐圭敤鍙兘濉啓鏄笌鍚")); + errorData.add(errorMessageMap); + } + } + } + if (!isError) { + if (StringUtils.equals(checkType, "jobNum")) { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ宸ュ彿")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + } + } else { + EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); + if (employeeDeclare == null) { + DataCollectionEmployee extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); + DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); + if (extEmployee == null && simpleEmployee == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ璇佷欢鍙风爜")); + errorData.add(errorMessageMap); + } else { + needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, + employeeDeclareExcel, taxAgentId, taxCycleDate, now)); + } + } else { + EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); + BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO)); + newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); + newEmployeeDeclare.setUpdateTime(now); + if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { + newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); + newEmployeeDeclare.setDeclareErrorMsg(""); + } + needUpdateEmployeeDeclares.add(newEmployeeDeclare); + } + } + } + if (isError) { + failCount++; + failRowIndex++; + continue; + } + successCount++; + } + + if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { + getEmployeeDeclareService(user).batchInsert(needAddEmployeeDeclares); + } + if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) { + needUpdateEmployeeDeclares.stream().forEach(getEmployeeDeclareMapper()::update); + } + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", failCount); + apidatas.put("errorData", errorData); + // 鍙戦佸鍏ュ洖璋冧俊鎭 +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); + + } catch (Exception e) { + log.error("浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細{}", e.getMessage(), e); + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + + + public static String[] getNullPropertyNames (Object source) { + final BeanWrapper src = new BeanWrapperImpl(source); + PropertyDescriptor[] pds = src.getPropertyDescriptors(); + + Set emptyNames = new HashSet<>(); + for(PropertyDescriptor pd : pds) { + Object srcValue = src.getPropertyValue(pd.getName()); + // 姝ゅ鍒ゆ柇鍙牴鎹渶姹備慨鏀 + if (srcValue == null) { + emptyNames.add(pd.getName()); + } + } + String[] result = new String[emptyNames.size()]; + return emptyNames.toArray(result); + } + + + + private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, + EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, + Date taxCycle, Date now) { + EmployeeDeclarePO employeeDeclare = EmployeeDeclarePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .taxCycle(taxCycle) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(Long.valueOf(user.getUID())) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()) + .build(); + EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel); + + BeanUtils.copyProperties(employeeDeclarePO, employeeDeclare, getNullPropertyNames(employeeDeclarePO)); + if (extEmployee != null) { + employeeDeclare.setEmployeeId(extEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue()); + } + if (simpleEmployee != null) { + employeeDeclare.setEmployeeId(simpleEmployee.getEmployeeId()); + employeeDeclare.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); + } + return employeeDeclare; + } @Override public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { @@ -115,7 +567,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // 杞崲鎴恉to List dtoList = getEmployeeDeclareService(user).convert(employeeDeclares); // 闇瑕佸鍑虹殑鏁版嵁 - List> excelSheetData = getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); + List> excelSheetData = ExcelUtil.getExcelSheetData(EmployeeDeclareListDTO.class, dtoList); return ExcelUtil.genWorkbookV2(excelSheetData, "浜哄憳淇℃伅閲囬泦"); } @@ -213,73 +665,46 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // } - private List> getExcelSheetData(Class clazz, List dtoList) { - // 瀵煎嚭鐨勮〃澶 - Map> headerMap = getHeader(clazz); - // 瀵煎嚭鐨勬暟鎹 - List> rows = new ArrayList<>(); - rows.add(headerMap.get("header")); - dtoList.forEach(dto -> { - Map map = JsonUtil.parseMap(dto, Object.class); - List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); - headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); - rows.add(row); - }); - return rows; - } -// -// @Transactional(rollbackFor = Exception.class) -// @BatchImportHandler("importEmployeeDeclare") -// public void importEmployeeDeclare() { -// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage(); -// Long employeeId = message.getUserId(); -// String tenantKey = message.getTenantKey(); +// public Map importEmployeeDeclare(EmployeeDeclareImportEmployeeParam param) { // try { -// LocalDateTime now = LocalDateTime.now(); -// Map paramMap = JsonUtil.parseMap(message.getUploadSet().getCustomData(), Object.class); +// Date now = new Date(); // // 涓◣鎵g即涔夊姟浜篿d -// Long taxAgentId = Util.getLongValue(Util.null2String(paramMap.get("taxAgentId"))); -// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId, employeeId, tenantKey); +// Long taxAgentId = param.getTaxAgentId(); +// TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); // if (taxAgent == null) { -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 187469, "鍙傛暟閿欒锛屾棤娉曟壘鍒颁釜绋庢墸缂翠箟鍔′汉")); -// return; +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "鍙傛暟閿欒锛屾棤娉曟壘鍒颁釜绋庢墸缂翠箟鍔′汉")); // } // // 绋庢鎵灞炴湡 -// String taxCycle = Util.null2String(paramMap.get("taxCycle")); -// if (!SalaryDateUtil.checkYearMonth(taxCycle)) { -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156384, "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒")); -// return; +// Date taxCycle = param.getTaxCycle(); +// if (taxCycle == null) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(111111, "鍙傛暟閿欒锛岀◣娆炬墍灞炴湡鍙傛暟鏍煎紡閿欒")); // } // +// InputStream fileInputStream = null; +// fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); +// // // 瀵煎嚭妯℃澘涓殑琛ㄥご -// List headerList = getImportHeader(employeeId, tenantKey); +// List headerList = getImportHeader(); // // 鏌ヨ鎵鏈夌殑浜哄憳 -// List orgEmployeeIds = hrmCommonEmployeeService.getAllEmployee(tenantKey); -// List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(orgEmployeeIds, tenantKey); -// // 鏌ヨ鎵鏈夌殑澶栭儴浜哄憳 -// List extEmployees = extEmployeeService.listAll(tenantKey); +// List simpleEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); // // 鏌ヨ浜哄憳鎶ラ佽〃鐨勪汉鍛 -// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(YearMonth.parse(taxCycle), -// taxAgentId, tenantKey); +// List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxCycle, taxAgentId); // // 鏍¢獙瀛楁 // String checkType = Util.null2String(paramMap.getOrDefault("checkType", "jobNum")); -// Map extEmployeeMap = Maps.newHashMap(); -// Map simpleEmployeeMap = Maps.newHashMap(); +// Map simpleEmployeeMap = Maps.newHashMap(); // Map employeeDeclareMap = Maps.newHashMapWithExpectedSize(employeeDeclares.size()); // if (Objects.equals(checkType, "jobNum")) { -// extEmployeeMap = Collections.emptyMap(); // simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getJobNum); // employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getJobNum); // } else { // // 鏌ヨ鎵鏈変汉鍛樼殑涓汉淇℃伅 -// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds, tenantKey); -// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); +// List simpleUserInfos = getSalaryEmployeeService(user).listByEmployeeIds(orgEmployeeIds); +// Map idKeySimpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); // for (SimpleUserInfo simpleUserInfo : simpleUserInfos) { // if (idKeySimpleEmployeeMap.containsKey(simpleUserInfo.getEmployeeId())) { // simpleEmployeeMap.put(simpleUserInfo.getIdNo(), idKeySimpleEmployeeMap.get(simpleUserInfo.getEmployeeId())); // } // } -// extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployees, ExtEmployeePO::getCardNum); // employeeDeclareMap = SalaryEntityUtil.convert2Map(employeeDeclares, EmployeeDeclarePO::getCardNum); // // } @@ -290,263 +715,308 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // // 绱㈠紩(鐢ㄤ簬璁$畻杩涘害) // int index = 0; // // 澶辫触鐨勬暟閲 -// int failCount = 0; +// int errorCount = 0; // // 鎴愬姛鐨勬暟閲 // int successCount = 0; // // 閿欒琛岀殑绱㈠紩 // int failRowIndex = 1; -// // 鍖呭惈閿欒鎻愮ず淇℃伅鐨剆heet椤 -// List errorExcelSheets = Lists.newArrayList(); -// for (ExcelSheet excelSheet : message.getBatchFile().getExcelSheets()) { -// if (CollectionUtils.isEmpty(excelSheet.getHeader())) { -// continue; +// // 閿欒鎻愮ず +// List> excelComments = new ArrayList<>(); +// // 閿欒excel鍐呭 +// List errorData = new ArrayList<>(); +// +// Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); +// // 琛ㄥご +// List headers = ExcelSupport.getSheetHeader(sheet, 0); +// +// // 妫鏌ヨ〃澶 +// String isValidHeader = checkHeader(headers, headerList); +// if (StringUtils.isNotBlank(isValidHeader)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", isValidHeader); +// excelComments.add(errorMessageMap); +// apidatas.put("errorData", excelComments); +// return apidatas; +// } +// +// // 鏁版嵁 +// List data = ExcelParseHelper.parse2Map(fileInputStream, EmployeeDeclareExcelDTO.class, 0, 1, 14, "1.xlsx"); +// if (CollectionUtils.isEmpty(data)) { +// Map apidatas = new HashMap(); +// apidatas.put("successCount", successCount); +// apidatas.put("errorCount", errorCount); +// return apidatas; +// } +// +// for (int i = 0; i < data.size(); i++) { +// EmployeeDeclareExcelDTO employeeDeclareExcelDTO = data.get(i); +// +// employeeDeclareExcelDTO.getEmployeeName() +// +// //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 +// List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(simpleEmployees, userName, deparmentName, mobile, workcode, null); +// +// if (StringUtils.isBlank(userName) && "0".equals(confValue)) { +// //濮撳悕 涓嶈兘涓虹┖ +// //閿欒娑堟伅瀵硅薄 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "濮撳悕涓嶈兘涓虹┖"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (CollectionUtils.isEmpty(employeeSameIds)) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else if (employeeSameIds.size() > 1) { +// //瀛樺湪绂昏亴鍜屽湪鑱岀姸鎬佸彇鍦ㄨ亴鐘舵 +// employeeSameIds = employeeSameIds.stream() +// .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) +// .collect(Collectors.toList()); +// if (employeeSameIds.size() != 1) { +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// addUpDeduction.setEmployeeId(employeeId); +// } +// } else { +// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; +// if (employeeId != null && employeeId > 0) { +// addUpDeduction.setEmployeeId(employeeId); +// } else { +// //濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕 +// Map errorMessageMap = Maps.newHashMap(); +// errorMessageMap.put("message", rowIndex + "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕"); +// errorData.add(errorMessageMap); +// errorSum += 1; +// } // } -// // 琛ㄥご -// List headers = excelSheet.getHeader().stream() -// .map(m -> Util.null2String(m.get("key"))) -// .collect(Collectors.toList()); -// // 妫鏌ヨ〃澶 -// boolean isCorrectHeader = checkHeader(message, headers, headerList); -// if (!isCorrectHeader) { -// return; -// } -// // 琛ㄥご姣忎竴鍒楃殑浣嶇疆 -// Map columnIndexMap = Maps.newHashMap(); -// for (int i = 0; i < headers.size(); i++) { -// columnIndexMap.put(headers.get(i), i); -// } -// // 鏁版嵁 -// List> data = excelSheet.getData(); -// if (CollectionUtils.isEmpty(data)) { -// continue; -// } -// // 閿欒鎻愮ず淇℃伅 -// List excelComments = Lists.newArrayList(); -// // 瀛樺湪閿欒鐨勯偅琛屾暟鎹 -// List> errorData = Lists.newArrayList(); -// for (int i = 0; i < data.size(); i++) { -// Map map = data.get(i); -// // 鏁版嵁鏄惁瀛樺湪閿欒 -// boolean isError = false; -// EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); -// for (String dataKey : getImportHeader(employeeId, tenantKey)) { -// Integer j = columnIndexMap.get(dataKey); -// String dataValue = Util.null2String(map.get(dataKey)); -// if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86317, "宸ュ彿"))) { -// if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 136250, "宸ュ彿涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); -// } -// employeeDeclareExcel.setJobNum(dataValue); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 85429, "濮撳悕"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 102838, "濮撳悕涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setEmployeeName(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 105139, "璇佷欢绫诲瀷"))) { -// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 86318, "璇佷欢鍙风爜"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156386, "璇佷欢鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); -// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156429, "璇佷欢鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setCardNum(dataValue); -// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); -// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156394, "浜哄憳鐘舵"))) { -// boolean legalDataValue = false; -// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { -// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { -// legalDataValue = true; -// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); -// break; -// } -// } -// if (!legalDataValue) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156430, "浜哄憳鐘舵佸彧鑳藉~鍐欐甯告垨闈炴甯"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156396, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))) { -// boolean legalDataValue = false; -// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { -// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { -// legalDataValue = true; -// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); -// break; -// } -// } -// if (!legalDataValue) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156431, "浠昏亴鍙楅泧浠庝笟绫诲瀷濉啓閿欒"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187374, "鍏ヨ亴骞村害灏变笟鎯呭舰"))) { -// employeeDeclareExcel.setEmploymentFirstYear(dataValue); -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 98621, "鎵嬫満鍙风爜"))) { -// if (StringUtils.isEmpty(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 106429, "鎵嬫満鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); -// } else if (!SalaryCardUtil.checkMobile(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160510, "鎵嬫満鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setMobile(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156409, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160511, "浠昏亴鍙楅泧浠庝笟绫诲瀷涓嶄负銆屽叾浠栥嶆椂锛屼换鑱屽彈闆囦粠涓氭棩鏈熶负蹇呭~"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// if (!SalaryDateUtil.checkDay(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); -// } -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 95228, "绂昏亴鏃ユ湡"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160512, "浜哄憳鐘舵佷负闈炴甯告椂锛岀鑱屾棩鏈熷繀濉"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// if (!SalaryDateUtil.checkDay(dataValue)) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); -// } else { -// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); -// } -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156399, "鏄惁娈嬬柧"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "鏄惁娈嬬柧鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156412, "娈嬬柧璇佸彿"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160513, "銆屾槸鍚︽畫鐤俱嶅~銆屾槸銆嶆椂锛屾畫鐤捐瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// employeeDeclareExcel.setDisabilityCardNo(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 187385, "鏄惁鐑堝睘"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156433, "鏄惁鐑堝睘鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156413, "鐑堝睘璇佸彿"))) { -// if (StringUtils.isEmpty(dataValue)) { -// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 160514, "銆屾槸鍚︾儓灞炪嶅~銆屾槸銆嶆椂锛岀儓灞炶瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); -// } -// } else { -// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156400, "鏄惁瀛よ"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156434, "鏄惁瀛よ佸彧鑳藉~鍐欐槸涓庡惁"), failRowIndex, failRowIndex, j, j); -// } -// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(employeeId, 156402, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))) { -// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { -// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); -// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { -// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); -// } else { -// isError = true; -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156435, "鏄惁鎵i櫎鍑忛櫎璐圭敤鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); -// } +// +// +// // 鏁版嵁鏄惁瀛樺湪閿欒 +// boolean isError = false; +// if (StringUtils.equals(employeeDeclareExcelDTO.getJobNum(), SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"))) { +// if (StringUtils.isEmpty(employeeDeclareExcelDTO.getJobNum()) ) { +// isError = true; +// +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(136250, "宸ュ彿涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } +// employeeDeclareExcel.setJobNum(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "濮撳悕涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmployeeName(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(105139, "璇佷欢绫诲瀷"))) { +// employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(86318, "璇佷欢鍙风爜"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156386, "璇佷欢鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkIdNum(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156429, "璇佷欢鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setCardNum(dataValue); +// employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue()); +// employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue)); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156394, "浜哄憳鐘舵"))) { +// boolean legalDataValue = false; +// for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { +// if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue()); +// break; // } // } -// if (!isError) { -// if (StringUtils.equals(checkType, "jobNum")) { -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); -// if (employeeDeclare == null) { -// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); -// if (extEmployee == null && simpleEmployee == null) { -// isError = true; -// String jobNumI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86317, "宸ュ彿"); -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156436, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ宸ュ彿"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); -// } else { -// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, -// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); -// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156430, "浜哄憳鐘舵佸彧鑳藉~鍐欐甯告垨闈炴甯"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156396, "浠昏亴鍙楅泧浠庝笟绫诲瀷"))) { +// boolean legalDataValue = false; +// for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) { +// if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) { +// legalDataValue = true; +// employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue()); +// break; +// } +// } +// if (!legalDataValue) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156431, "浠昏亴鍙楅泧浠庝笟绫诲瀷濉啓閿欒"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187374, "鍏ヨ亴骞村害灏变笟鎯呭舰"))) { +// employeeDeclareExcel.setEmploymentFirstYear(dataValue); +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(98621, "鎵嬫満鍙风爜"))) { +// if (StringUtils.isEmpty(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(106429, "鎵嬫満鍙风爜涓嶈兘涓虹┖"), failRowIndex, failRowIndex, j, j); +// } else if (!SalaryCardUtil.checkMobile(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160510, "鎵嬫満鍙风爜鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setMobile(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156409, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160511, "浠昏亴鍙楅泧浠庝笟绫诲瀷涓嶄负銆屽叾浠栥嶆椂锛屼换鑱屽彈闆囦粠涓氭棩鏈熶负蹇呭~"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setEmploymentDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(95228, "绂昏亴鏃ユ湡"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getEmploymentStatus(), EmploymentStatusEnum.ABNORMAL.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160512, "浜哄憳鐘舵佷负闈炴甯告椂锛岀鑱屾棩鏈熷繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// if (!SalaryDateUtil.checkDay(dataValue)) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156432, "鏃ユ湡鏍煎紡涓嶆纭"), failRowIndex, failRowIndex, j, j); +// } else { +// employeeDeclareExcel.setDismissDate(LocalDate.parse(dataValue)); +// } +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156399, "鏄惁娈嬬柧"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDisability(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "鏄惁娈嬬柧鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156412, "娈嬬柧璇佸彿"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getDisability(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160513, "銆屾槸鍚︽畫鐤俱嶅~銆屾槸銆嶆椂锛屾畫鐤捐瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setDisabilityCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(187385, "鏄惁鐑堝睘"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setMartyrDependents(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156433, "鏄惁鐑堝睘鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156413, "鐑堝睘璇佸彿"))) { +// if (StringUtils.isEmpty(dataValue)) { +// if (Objects.equals(employeeDeclareExcel.getMartyrDependents(), SalaryOnOffEnum.ON.getValue())) { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(160514, "銆屾槸鍚︾儓灞炪嶅~銆屾槸銆嶆椂锛岀儓灞炶瘉鍙峰繀濉"), failRowIndex, failRowIndex, j, j); +// } +// } else { +// employeeDeclareExcel.setMartyrDependentsCardNo(dataValue); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156400, "鏄惁瀛よ"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setLonelyOld(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156434, "鏄惁瀛よ佸彧鑳藉~鍐欐槸涓庡惁"), failRowIndex, failRowIndex, j, j); +// } +// } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(156402, "鏄惁鎵i櫎鍑忛櫎璐圭敤"))) { +// if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.ON.getValue()); +// } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { +// employeeDeclareExcel.setDeductExpenses(SalaryOnOffEnum.OFF.getValue()); +// } else { +// isError = true; +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156435, "鏄惁鎵i櫎鍑忛櫎璐圭敤鍙兘濉啓鏄笌鍚"), failRowIndex, failRowIndex, j, j); +// } +// } +// if (!isError) { +// if (StringUtils.equals(checkType, "jobNum")) { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getJobNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getJobNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String jobNumI18 = SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156436, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ宸ュ彿"), failRowIndex, failRowIndex, headers.indexOf(jobNumI18), headers.indexOf(jobNumI18)); // } else { -// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); -// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); -// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); -// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) -// .setUpdateTime(now); -// needUpdateEmployeeDeclares.add(newEmployeeDeclare); -// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { -// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// newEmployeeDeclare.setDeclareErrorMsg(""); -// } +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); // } // } else { -// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); -// if (employeeDeclare == null) { -// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); -// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); -// if (extEmployee == null && simpleEmployee == null) { -// isError = true; -// String cardNoI18 = SalaryI18nUtil.getI18nLabel(employeeId, 86318, "璇佷欢鍙风爜"); -// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(employeeId, 156437, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ璇佷欢鍙风爜"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); -// } else { -// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, -// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId, tenantKey)); -// } -// } else { -// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); -// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); -// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); -// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) -// .setUpdateTime(now); -// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { -// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); -// newEmployeeDeclare.setDeclareErrorMsg(""); -// } -// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); // } // } +// } else { +// EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(employeeDeclareExcel.getCardNum()); +// if (employeeDeclare == null) { +// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(employeeDeclareExcel.getCardNum()); +// if (extEmployee == null && simpleEmployee == null) { +// isError = true; +// String cardNoI18 = SalaryI18nUtil.getI18nLabel(86318, "璇佷欢鍙风爜"); +// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(156437, "绯荤粺鍐呯殑浜哄憳涓嶅瓨鍦ㄨ璇佷欢鍙风爜"), failRowIndex, failRowIndex, headers.indexOf(cardNoI18), headers.indexOf(cardNoI18)); +// } else { +// needAddEmployeeDeclares.add(buildEmployeeDeclare(extEmployee, simpleEmployee, +// employeeDeclareExcel, taxAgentId, taxCycle, now, employeeId)); +// } +// } else { +// EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); +// BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); +// BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); +// newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1) +// .setUpdateTime(now); +// if (Objects.equals(newEmployeeDeclare.getNewEmployeeInfo(), 1)) { +// newEmployeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue()); +// newEmployeeDeclare.setDeclareErrorMsg(""); +// } +// needUpdateEmployeeDeclares.add(newEmployeeDeclare); +// } // } -// if (isError) { -// failCount++; -// failRowIndex++; -// errorData.add(map); -// continue; -// } -// successCount++; // } -// // 濡傛灉sheet鍖呭惈閿欒鏁版嵁 -// if (CollectionUtils.isNotEmpty(errorData)) { -// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// if (isError) { +// errorCount++; +// failRowIndex++; +// errorData.add(map); +// continue; // } +// successCount++; // } +// // 濡傛灉sheet鍖呭惈閿欒鏁版嵁 +// if (CollectionUtils.isNotEmpty(errorData)) { +// salaryBatchService.createErrorExcelSheet(excelSheet.getHeader(), errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// } +// // if (CollectionUtils.isNotEmpty(needAddEmployeeDeclares)) { // getEmployeeDeclareService(user).saveBatch(needAddEmployeeDeclares); // } @@ -554,16 +1024,16 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // getEmployeeDeclareService(user).updateBatchById(needUpdateEmployeeDeclares); // } // // 鍙戦佸鍏ュ洖璋冧俊鎭 -// salaryBatchService.sendImportCallBackInfo(message, successCount, failCount, errorExcelSheets); +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); // } catch (Exception e) { // log.error("浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細{}", e.getMessage(), e); -// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(employeeId, 156438, "浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細") + e.getMessage()); +// salaryBatchService.sendImportCallBackInfo(message, SalaryI18nUtil.getI18nLabel(156438, "浜哄憳鎶ラ佷俊鎭鍏ュけ璐ワ細") + e.getMessage()); // } // } // // private EmployeeDeclarePO buildEmployeeDeclare(ExtEmployeePO extEmployee, // EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, -// String taxCycle, LocalDateTime now, Long employeeId, String tenantKey) { +// String taxCycle, LocalDateTime now, Long String tenantKey) { // EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO() // .setId(IdGenerator.generate()) // .setTaxAgentId(taxAgentId) @@ -583,67 +1053,48 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee // .setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue()); // } // return employeeDeclare; -// } -// -// private List getImportHeader(Long employeeId, String tenantKey) { -// return Lists.newArrayList( -// SalaryI18nUtil.getI18nLabel(employeeId, 86317, "宸ュ彿"), -// SalaryI18nUtil.getI18nLabel(employeeId, 85429, "濮撳悕"), -// SalaryI18nUtil.getI18nLabel(employeeId, 105139, "璇佷欢绫诲瀷"), -// SalaryI18nUtil.getI18nLabel(employeeId, 86318, "璇佷欢鍙风爜"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156394, "浜哄憳鐘舵"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156396, "浠昏亴鍙楅泧浠庝笟绫诲瀷"), -// SalaryI18nUtil.getI18nLabel(employeeId, 187374, "鍏ヨ亴骞村害灏变笟鎯呭舰"), -// SalaryI18nUtil.getI18nLabel(employeeId, 98621, "鎵嬫満鍙风爜"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156409, "浠昏亴鍙楅泧浠庝笟鏃ユ湡"), -// SalaryI18nUtil.getI18nLabel(employeeId, 95228, "绂昏亴鏃ユ湡"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156399, "鏄惁娈嬬柧"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156412, "娈嬬柧璇佸彿"), -// SalaryI18nUtil.getI18nLabel(employeeId, 187385, "鏄惁鐑堝睘"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156413, "鐑堝睘璇佸彿"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156400, "鏄惁瀛よ"), -// SalaryI18nUtil.getI18nLabel(employeeId, 156402, "鏄惁鎵i櫎鍑忛櫎璐圭敤")); // } - private Map> getHeader(Class clazz) { - Map> headerMap = new HashMap<>(); - // 瀵煎嚭鐨勮〃澶 - List headerList = Lists.newArrayList(); - List dataIndexList = Lists.newArrayList(); - Field[] declaredFields = clazz.getDeclaredFields(); - for (Field declaredField : declaredFields) { - if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) { - continue; - } - SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class); - headerList.add(annotation.text()); - dataIndexList.add(annotation.column()); - } - headerMap.put("header", headerList); - headerMap.put("dataIndex", dataIndexList); - return headerMap; + private List getImportHeader() { + List headers = new ArrayList<>(); + + headers.add(SalaryI18nUtil.getI18nLabel(111111, "宸ュ彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "濮撳悕")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "璇佷欢绫诲瀷")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "璇佷欢鍙风爜")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "浜哄憳鐘舵")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "浠昏亴鍙楅泧浠庝笟绫诲瀷")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鍏ヨ亴骞村害灏变笟鎯呭舰")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鎵嬫満鍙风爜")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "浠昏亴鍙楅泧浠庝笟鏃ユ湡")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "绂昏亴鏃ユ湡")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁娈嬬柧")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "娈嬬柧璇佸彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁鐑堝睘")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鐑堝睘璇佸彿")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁瀛よ")); + headers.add(SalaryI18nUtil.getI18nLabel(111111, "鏄惁鎵i櫎鍑忛櫎璐圭敤")); + + return headers; + } -// /** -// * 妫鏌ヨ〃澶 -// * -// * @param message -// * @param headers -// * @return -// */ -// private boolean checkHeader(BatchDocumentMessage message, List headers, List headerList) { -// Long employeeId = message.getUserId(); -// String tenantKey = message.getTenantKey(); -// // 缂哄皯鐨勫垪 -// List lackHeaders = headerList.stream() -// .filter(header -> !headers.contains(header)) -// .collect(Collectors.toList()); -// if (CollectionUtils.isNotEmpty(lackHeaders)) { -// // 鍙戦佸鍏ュ洖璋冧俊鎭 -// String errorMsg = SalaryI18nUtil.getI18nLabel(employeeId, 101850, "缂哄皯濡備笅鍒楋紝璇锋鏌ワ細") + Joiner.on(",").join(lackHeaders); -// salaryBatchService.sendImportCallBackInfo(message, errorMsg); -// return false; -// } -// return true; -// } + + /** + * 妫鏌ヨ〃澶 + * + * @param headers + * @return + */ + private String checkHeader(List headers, List headerList) { + // 缂哄皯鐨勫垪 + List lackHeaders = headerList.stream() + .filter(header -> !headers.contains(header)) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(lackHeaders)) { + // 鍙戦佸鍏ュ洖璋冧俊鎭 + return SalaryI18nUtil.getI18nLabel(111111, "缂哄皯濡備笅鍒楋紝璇锋鏌ワ細") + Joiner.on(",").join((Iterable) lackHeaders); + } + return null; + } } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 32bf9a06b..8143756ed 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -193,7 +193,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setEmployeeName(saveParam.getEmployeeName()); employeeDeclare.setJobNum(saveParam.getJobNum()); employeeDeclare.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()); - employeeDeclare.setCardNum(saveParam.getCardNum()); + employeeDeclare.setCardNum(saveParam.getCardNum().toUpperCase()); employeeDeclare.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue()); employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))); employeeDeclare.setEmploymentStatus(saveParam.getEmploymentStatus().getValue()); @@ -727,4 +727,13 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla return "鎵ц瀹屾瘯"; } + + @Override + public void batchInsert(List insertList) { + if (CollectionUtils.isEmpty(insertList)) { + return; + } + List> partition = Lists.partition(insertList, 50); + partition.forEach(getEmployeeDeclareMapper()::batchInsert); + } } diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 138eb8cf1..a18ca32e0 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIArchivesBiz; @@ -15,6 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; @@ -60,8 +62,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + @Override public List> buildCommonRecords(List list, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); if (CollectionUtils.isEmpty(list)) { return result; @@ -99,34 +104,130 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("socialAccount", item.getSocialAccount()); record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId())); - if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", (String) v); +// if(socialJson!=null){ +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("fundAccount", item.getFundAccount()); record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); - if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", (String) v); + if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) { + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if(fundJson!=null){ +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId())); - if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", (String) v); + if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) { + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if(otherJson!=null){ +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } if (StringUtils.isNotEmpty(item.getSocialPerJson())) { diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index 89f725a87..389e4ef2b 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO; import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO; @@ -24,6 +25,7 @@ import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -45,6 +47,8 @@ import java.util.stream.Collectors; public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService { private EncryptUtil encryptUtil = new EncryptUtil(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private InsuranceExportMapper getInsuranceExportMapper() { return MapperProxyFactory.getProxy(InsuranceExportMapper.class); } @@ -131,7 +135,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar String sheetName = "绾夸笅瀵规瘮缁撴灉"; - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -140,6 +144,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar */ private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //鎺掑簭閰嶇疆 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -200,10 +205,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); //3-鏋勫缓绂忓埄鏍哥畻瀵规瘮缁撴灉鍒楄〃琛ㄥご - List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet); + List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, welBaseDiffSign); //4-閫氳繃绾夸笂绾夸笅涓や唤鏁版嵁鑾峰緱瀵规瘮缁撴灉 Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); - List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap); + List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, welBaseDiffSign); // 绯荤粺鍊煎拰绾夸笅鍊间竴鑷寸殑浜哄憳 if (queryParam.isOnlyDiffEmployee()) { @@ -227,7 +232,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar } private Set welfareInfo() { - + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set info = new HashSet<>(); List listAll = getICategoryMapper().listAll(); @@ -235,18 +240,37 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); - //缁勮绀句繚鍩烘暟 - for (ICategoryPO po : socialWelfareList) { - info.add(po.getId() + "socialBase"); - } - //缁勮鍏Н閲戝熀鏁 - for (ICategoryPO po : fundWelfareList) { - info.add(po.getId() + "fundBase"); - } - //缁勮鍏朵粬绂忓埄鍩烘暟 - for (ICategoryPO po : otherWelfareList) { - info.add(po.getId() + "otherBase"); + if (welBaseDiffSign) { + //缁勮绀句繚鍩烘暟 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialPerBase"); + info.add(po.getId() + "socialComBase"); + } + //缁勮鍏Н閲戝熀鏁 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundPerBase"); + info.add(po.getId() + "fundComBase"); + } + //缁勮鍏朵粬绂忓埄鍩烘暟 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherPerBase"); + info.add(po.getId() + "otherComBase"); + } + } else { + //缁勮绀句繚鍩烘暟 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialBase"); + } + //缁勮鍏Н閲戝熀鏁 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundBase"); + } + //缁勮鍏朵粬绂忓埄鍩烘暟 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherBase"); + } } + //绀句繚涓汉锛堢敓鑲蹭繚闄╀釜浜恒佸伐浼や繚闄╀釜浜恒佸け涓氫繚闄╀釜浜恒佸吇鑰佷繚闄╀釜浜恒佸尰鐤椾繚闄╀釜浜猴級 for (ICategoryPO po : socialWelfareList) { info.add(po.getId() + "socialPer"); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 282a6f545..cbed96243 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -65,6 +65,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -2221,7 +2222,79 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { + Map> welColumnMap = createWelColumnMap(param); + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), + SalaryI18nUtil.getI18nLabel(86185, "閮ㄩ棬"), + SalaryI18nUtil.getI18nLabel(86186, "鎵嬫満鍙"), + SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"), + SalaryI18nUtil.getI18nLabel(86187, "鍛樺伐鐘舵"), + SalaryI18nUtil.getI18nLabel(100377, "鏁版嵁鏉ユ簮"), + SalaryI18nUtil.getI18nLabel(91325, "涓◣鎵g即涔夊姟浜")); + headerList.add(SalaryI18nUtil.getI18nLabel(91324, "绀句繚璐﹀彿")); + headerList.add(SalaryI18nUtil.getI18nLabel(91323, "绀句繚鏂规鍚嶇О")); + //缁勮绀句繚鍩烘暟 + if (welColumnMap.get("socialBase") != null) { + headerList.addAll(welColumnMap.get("socialBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91486, "鍏Н閲戣处鍙")); + headerList.add(SalaryI18nUtil.getI18nLabel(91485, "鍏Н閲戞柟妗堝悕绉")); + //缁勮鍏Н閲戝熀鏁 + if (welColumnMap.get("fundBase") != null) { + headerList.addAll(welColumnMap.get("fundBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91487, "琛ュ厖鍏Н閲戣处鍙")); + headerList.add(SalaryI18nUtil.getI18nLabel(91496, "鍏朵粬绂忓埄鏂规鍚嶇О")); + //缁勮鍏朵粬绂忓埄鍩烘暟 + if (welColumnMap.get("otherBase") != null) { + headerList.addAll(welColumnMap.get("otherBase")); + } + //绀句繚涓汉锛堢敓鑲蹭繚闄╀釜浜恒佸伐浼や繚闄╀釜浜恒佸け涓氫繚闄╀釜浜恒佸吇鑰佷繚闄╀釜浜恒佸尰鐤椾繚闄╀釜浜猴級 + if (welColumnMap.get("socialPer") != null) { + headerList.addAll(welColumnMap.get("socialPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100388, "绀句繚涓汉鍚堣")); + //浣忔埧鍏Н閲戜釜浜恒佽ˉ鍏呬綇鎴垮叕绉噾涓汉 + if (welColumnMap.get("fundPer") != null) { + headerList.addAll(welColumnMap.get("fundPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100390, "鍏Н閲戜釜浜哄悎璁")); + //鍏朵粬涓汉锛堟瘮濡備紒涓氬勾閲戜釜浜猴級 + if (welColumnMap.get("otherPer") != null) { + headerList.addAll(welColumnMap.get("otherPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100392, "鍏朵粬绂忓埄涓汉鍚堣")); + headerList.add(SalaryI18nUtil.getI18nLabel(100393, "涓汉鍚堣")); + //绀句繚鍗曚綅锛堢敓鑲蹭繚闄╁崟浣嶃佸伐浼や繚闄╁崟浣嶃佸け涓氫繚闄╁崟浣嶃佸吇鑰佷繚闄╁崟浣嶃佸尰鐤椾繚闄╁崟浣嶏級 + if (welColumnMap.get("socialCom") != null) { + headerList.addAll(welColumnMap.get("socialCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100394, "绀句繚鍗曚綅鍚堣")); + //浣忔埧鍏Н閲戝崟浣嶃佽ˉ鍏呬綇鎴垮叕绉噾鍗曚綅 + if (welColumnMap.get("fundCom") != null) { + headerList.addAll(welColumnMap.get("fundCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100395, "鍏Н閲戝崟浣嶅悎璁")); + //鍏朵粬鍗曚綅锛堟瘮濡備紒涓氬勾閲戝崟浣嶏級 + if (welColumnMap.get("otherCom") != null) { + headerList.addAll(welColumnMap.get("otherCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100396, "鍏朵粬绂忓埄鍗曚綅鍚堣")); + headerList.add(SalaryI18nUtil.getI18nLabel(100397, "鍗曚綅鍚堣")); + headerList.add(SalaryI18nUtil.getI18nLabel(100398, "绀句繚鍚堣")); + headerList.add(SalaryI18nUtil.getI18nLabel(100399, "鍏Н閲戝悎璁")); + headerList.add(SalaryI18nUtil.getI18nLabel(100400, "鍏朵粬绂忓埄鍚堣")); + headerList.add(SalaryI18nUtil.getI18nLabel(93278, "鍚堣")); + + List> rows = new ArrayList<>(); + rows.add(headerList); + String sheetName = "绂忓埄鏍哥畻-绾夸笅瀵规瘮瀵煎叆妯℃澘"; + + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + } + + public Map> createWelColumnMap(InsuranceAccountDetailParam param) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //鏌ヨ绾夸笂绂忓埄鏍哥畻璁板綍 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); insuranceExportParam.setBillMonth(param.getBillMonth()); @@ -2265,77 +2338,238 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), - SalaryI18nUtil.getI18nLabel(86185, "閮ㄩ棬"), - SalaryI18nUtil.getI18nLabel(86186, "鎵嬫満鍙"), - SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿"), - SalaryI18nUtil.getI18nLabel(86187, "鍛樺伐鐘舵"), - SalaryI18nUtil.getI18nLabel(100377, "鏁版嵁鏉ユ簮"), - SalaryI18nUtil.getI18nLabel(91325, "涓◣鎵g即涔夊姟浜")); - headerList.add(SalaryI18nUtil.getI18nLabel(91324, "绀句繚璐﹀彿")); - headerList.add(SalaryI18nUtil.getI18nLabel(91323, "绀句繚鏂规鍚嶇О")); -// "澶变笟淇濋櫓鐢虫姤鍩烘暟" -// "鐢熻偛淇濋櫓鐢虫姤鍩烘暟" -// "鍏昏佷繚闄╃敵鎶ュ熀鏁" -// "鍖荤枟淇濋櫓鐢虫姤鍩烘暟" -// "宸ヤ激淇濋櫓鐢虫姤鍩烘暟" - for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + "鐢虫姤鍩烘暟"); + //缁勮绀句繚鍩烘暟 + List socialBaseColumns = new ArrayList<>(); + List socialPerBaseColumns = new ArrayList<>(); + List socialComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + socialPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + socialComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + socialBaseColumns.addAll(socialPerBaseColumns); + socialBaseColumns.addAll(socialComBaseColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + socialBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } } - headerList.add(SalaryI18nUtil.getI18nLabel(91486, "鍏Н閲戣处鍙")); - headerList.add(SalaryI18nUtil.getI18nLabel(91485, "鍏Н閲戞柟妗堝悕绉")); + //缁勮鍏Н閲戝熀鏁 - for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + "鐢虫姤鍩烘暟"); + List fundBaseColumns = new ArrayList<>(); + List fundPerBaseColumns = Lists.newArrayList(); + List fundComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + fundPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + fundComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + fundBaseColumns.addAll(fundPerBaseColumns); + fundBaseColumns.addAll(fundComBaseColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + fundBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } } - headerList.add(SalaryI18nUtil.getI18nLabel(91487, "琛ュ厖鍏Н閲戣处鍙")); - headerList.add(SalaryI18nUtil.getI18nLabel(91496, "鍏朵粬绂忓埄鏂规鍚嶇О")); + //缁勮鍏朵粬绂忓埄鍩烘暟 - for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + "鐢虫姤鍩烘暟"); + List otherBaseColumns = new ArrayList<>(); + List otherPerBaseColumns = new ArrayList<>(); + List otherComBaseColumns = Lists.newArrayList(); + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + otherPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + otherComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + otherBaseColumns.addAll(otherPerBaseColumns); + otherBaseColumns.addAll(otherComBaseColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + otherBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } } + + //绀句繚涓汉锛堢敓鑲蹭繚闄╀釜浜恒佸伐浼や繚闄╀釜浜恒佸け涓氫繚闄╀釜浜恒佸吇鑰佷繚闄╀釜浜恒佸尰鐤椾繚闄╀釜浜猴級 + List socialPerColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelPerList) { + socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + //浣忔埧鍏Н閲戜釜浜恒佽ˉ鍏呬綇鎴垮叕绉噾涓汉 + List fundPerColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelPerList) { + fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + //鍏朵粬涓汉锛堟瘮濡備紒涓氬勾閲戜釜浜猴級 + List otherPerColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelPerList) { + otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + //绀句繚鍗曚綅锛堢敓鑲蹭繚闄╁崟浣嶃佸伐浼や繚闄╁崟浣嶃佸け涓氫繚闄╁崟浣嶃佸吇鑰佷繚闄╁崟浣嶃佸尰鐤椾繚闄╁崟浣嶏級 + List socialComColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelComList) { + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + //浣忔埧鍏Н閲戝崟浣嶃佽ˉ鍏呬綇鎴垮叕绉噾鍗曚綅 + List fundComColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelComList) { + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + + //鍏朵粬鍗曚綅锛堟瘮濡備紒涓氬勾閲戝崟浣嶏級 + List otherComColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelComList) { + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + + Map> welColumnMap = new HashMap<>(); + welColumnMap.put("socialPerBase", socialPerBaseColumns); + welColumnMap.put("fundPerBase", fundPerBaseColumns); + welColumnMap.put("otherPerBase", otherPerBaseColumns); + welColumnMap.put("socialComBase", socialComBaseColumns); + welColumnMap.put("fundComBase", fundComBaseColumns); + welColumnMap.put("otherComBase", otherComBaseColumns); + welColumnMap.put("socialBase", socialBaseColumns); + welColumnMap.put("fundBase", fundBaseColumns); + welColumnMap.put("otherBase", otherBaseColumns); + welColumnMap.put("socialPer", socialPerColumns); + welColumnMap.put("fundPer", fundPerColumns); + welColumnMap.put("otherPer", otherPerColumns); + welColumnMap.put("socialCom", socialComColumns); + welColumnMap.put("fundCom", fundComColumns); + welColumnMap.put("otherCom", otherComColumns); + return welColumnMap; + } + + public Map welColumnNameCodeMap(InsuranceAccountDetailParam param) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + //鏌ヨ绾夸笂绂忓埄鏍哥畻璁板綍 + InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); + insuranceExportParam.setBillMonth(param.getBillMonth()); + insuranceExportParam.setPaymentOrganization(param.getPaymentOrganization()); + List accountExportPOS = getInsuranceExportMapper().exportAccount(param.getPaymentStatus(), insuranceExportParam); + + //鏁寸悊绾夸笂鏍哥畻璁板綍鐩稿叧鐨勭鍒╂柟妗堬紝骞朵互姝ゆ暣鐞嗛渶瑕佸姣旂殑绂忓埄椤圭被鍒暟鎹 + Set welfareSchemeIds = new HashSet<>(); + accountExportPOS.forEach(f -> { + welfareSchemeIds.add(f.getSocialSchemeId()); + welfareSchemeIds.add(f.getFundSchemeId()); + welfareSchemeIds.add(f.getOtherSchemeId()); + }); + List insuranceSchemeDetailPos = getInsuranceSchemeDetailMapper().listAll(); + List insuranceBaseIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insurancePerPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 2) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insuranceComPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + Set insuranceBaseSet = new HashSet<>(insuranceBaseIds); + Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); + Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); + + List listAll = getICategoryMapper().listAll(); + List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelComList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + + //缁勮绀句繚鍩烘暟 + Map result = new HashMap<>(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"涓汉"), po.getId() + "socialPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅"), po.getId() + "socialComBase"); + } + } else { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"), po.getId() + "socialBase"); + } + } + + //缁勮鍏Н閲戝熀鏁 + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"涓汉"), po.getId() + "fundPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅"), po.getId() + "fundComBase"); + } + } else { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"), po.getId() + "fundBase"); + } + } + + //缁勮鍏朵粬绂忓埄鍩烘暟 + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"涓汉"), po.getId() + "otherPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅"), po.getId() + "otherComBase"); + } + } else { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"), po.getId() + "otherBase"); + } + } + //绀句繚涓汉锛堢敓鑲蹭繚闄╀釜浜恒佸伐浼や繚闄╀釜浜恒佸け涓氫繚闄╀釜浜恒佸吇鑰佷繚闄╀釜浜恒佸尰鐤椾繚闄╀釜浜猴級 for (ICategoryPO po : socialWelPerList) { - headerList.add(po.getInsuranceName() + "涓汉"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "涓汉"), po.getId() + "socialPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100388, "绀句繚涓汉鍚堣")); //浣忔埧鍏Н閲戜釜浜恒佽ˉ鍏呬綇鎴垮叕绉噾涓汉 for (ICategoryPO po : fundWelPerList) { - headerList.add(po.getInsuranceName() + "涓汉"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "涓汉"), po.getId() + "fundPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100390, "鍏Н閲戜釜浜哄悎璁")); //鍏朵粬涓汉锛堟瘮濡備紒涓氬勾閲戜釜浜猴級 for (ICategoryPO po : otherWelPerList) { - headerList.add(po.getInsuranceName() + "涓汉"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "涓汉"), po.getId() + "otherPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100392, "鍏朵粬绂忓埄涓汉鍚堣")); - headerList.add(SalaryI18nUtil.getI18nLabel(100393, "涓汉鍚堣")); //绀句繚鍗曚綅锛堢敓鑲蹭繚闄╁崟浣嶃佸伐浼や繚闄╁崟浣嶃佸け涓氫繚闄╁崟浣嶃佸吇鑰佷繚闄╁崟浣嶃佸尰鐤椾繚闄╁崟浣嶏級 for (ICategoryPO po : socialWelComList) { - headerList.add(po.getInsuranceName() + "鍗曚綅"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅"), po.getId() + "socialCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100394, "绀句繚鍗曚綅鍚堣")); //浣忔埧鍏Н閲戝崟浣嶃佽ˉ鍏呬綇鎴垮叕绉噾鍗曚綅 for (ICategoryPO po : fundWelComList) { - headerList.add(po.getInsuranceName() + "鍗曚綅"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅"), po.getId() + "fundCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100395, "鍏Н閲戝崟浣嶅悎璁")); + //鍏朵粬鍗曚綅锛堟瘮濡備紒涓氬勾閲戝崟浣嶏級 for (ICategoryPO po : otherWelComList) { - headerList.add(po.getInsuranceName() + "鍗曚綅"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅"), po.getId() + "otherCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100396, "鍏朵粬绂忓埄鍗曚綅鍚堣")); - headerList.add(SalaryI18nUtil.getI18nLabel(100397, "鍗曚綅鍚堣")); - headerList.add(SalaryI18nUtil.getI18nLabel(100398, "绀句繚鍚堣")); - headerList.add(SalaryI18nUtil.getI18nLabel(100399, "鍏Н閲戝悎璁")); - headerList.add(SalaryI18nUtil.getI18nLabel(100400, "鍏朵粬绂忓埄鍚堣")); - headerList.add(SalaryI18nUtil.getI18nLabel(93278, "鍚堣")); - List> rows = new ArrayList<>(); - rows.add(headerList); - String sheetName = "绂忓埄鏍哥畻-绾夸笅瀵规瘮瀵煎叆妯℃澘"; - - return ExcelUtil.genWorkbookV2(rows, sheetName); + return result; } /** @@ -2386,6 +2620,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } String billMonth = importParam.getBillMonth(); + +// Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() +// .billMonth(billMonth) +// .paymentOrganization(importParam.getPaymentOrganization()) +// .paymentStatus(PaymentStatusEnum.COMMON.getValue()) +// .build()); + Map welColumnNameCodeMap = new HashMap<>(); //瀛樺偍寰呮洿鏂扮殑InsuranceAccountDetailPO鏁版嵁 List addCompareList = new ArrayList<>(); //璁板綍寰呭垹闄rsa_excel_bill_detail.id @@ -2407,6 +2648,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (taxAgentPoList.size() == 1) { paymentOrganization = taxAgentPoList.get(0).getId(); + welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(paymentOrganization.toString()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -2480,7 +2726,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { idList.addAll(ids); } //鎷艰寰呮洿鏂版暟鎹 - addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map)); + addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map, welColumnNameCodeMap)); } @@ -2519,7 +2765,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { * @param billMonth 瀵规瘮鐨勮处鍗曟湀浠 * @param baseMap excel瀵煎叆鐨勫姣旀暟鎹 */ - private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap) { + private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap, Map welColumnNameCodeMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO(); excelInsuranceDetailPO.setId(IdGenerator.generate()); @@ -2535,6 +2782,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundPaymentBaseMap = new HashMap<>(); Map otherPaymentBaseMap = new HashMap<>(); + Map socialPaymentComBaseMap = new HashMap<>(); + Map fundPaymentComBaseMap = new HashMap<>(); + Map otherPaymentComBaseMap = new HashMap<>(); + //绛涢夊嚭绂忓埄鏍哥畻椤 Map toDealMap = baseMap.entrySet().stream() @@ -2548,73 +2799,157 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for(Map.Entry entry : toDealMap.entrySet()) { - //鍒ゆ柇鍏冪礌鏄惁灞炰簬绂忓埄绫 - String keyName = entry.getKey(); - //鑾峰彇鍏冪礌鍚嶅悗缂锛屾柟渚夸箣鍚庡垽鏂滀釜浜衡濇垨鈥滃崟浣嶁濇垨鑰呪滃熀鏁扳 - String payScope = keyName.substring(keyName.length() - 2); - //鑾峰彇绂忓埄绫诲瀷 - Integer welfareType; - //鏍规嵁鍏冪礌鍚嶅悗缂锛屽尯鍒嗘埅鍙栧唴瀹 - String targetWelfareName; - if ("鍩烘暟".equals(payScope)) { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); - } else { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); - } - List categoryPOList = siCategoryBiz.listByName(targetWelfareName); - if (categoryPOList.size() == 1) { - ICategoryPO iCategoryPO = categoryPOList.get(0); - welfareType = iCategoryPO.getWelfareType(); +// //鍒ゆ柇鍏冪礌鏄惁灞炰簬绂忓埄绫 +// String keyName = entry.getKey(); +// //鑾峰彇鍏冪礌鍚嶅悗缂锛屾柟渚夸箣鍚庡垽鏂滀釜浜衡濇垨鈥滃崟浣嶁濇垨鑰呪滃熀鏁扳 +// String payScope = keyName.substring(keyName.length() - 2); +// //鑾峰彇绂忓埄绫诲瀷 +// Integer welfareType; +// //鏍规嵁鍏冪礌鍚嶅悗缂锛屽尯鍒嗘埅鍙栧唴瀹 +// String targetWelfareName; +// if ("鍩烘暟".equals(payScope)) { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); +// } else { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); +// } +// List categoryPOList = siCategoryBiz.listByName(targetWelfareName); +// if (categoryPOList.size() == 1) { +// ICategoryPO iCategoryPO = categoryPOList.get(0); +// welfareType = iCategoryPO.getWelfareType(); +// +// switch (payScope) { +// case "涓汉": +// switch (welfareType) { +// case 1: +// socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); +// } +// break; +// case "鍗曚綅": +// switch (welfareType) { +// case 1: +// socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); +// } +// break; +// case "鍩烘暟": +// switch (welfareType) { +// case 1: +// socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); +// } +// break; +// } +// } - switch (payScope) { - case "涓汉": - switch (welfareType) { - case 1: - socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); - } - break; - case "鍗曚綅": - switch (welfareType) { - case 1: - socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); - } - break; - case "鍩烘暟": - switch (welfareType) { - case 1: - socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("绂忓埄绫诲瀷涓嶅瓨鍦"); - } - break; + if (welColumnNameCodeMap.get(entry.getKey()) != null) { + String code = welColumnNameCodeMap.get(entry.getKey()); + if (welBaseDiffSign) { + if (code.contains("socialPerBase")) { + code = code.replace("socialPerBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("socialComBase")) { + code = code.replace("socialComBase", ""); + socialPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPerBase")) { + code = code.replace("fundPerBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundComBase")) { + code = code.replace("fundComBase", ""); + fundPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPerBase")) { + code = code.replace("otherPerBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherComBase")) { + code = code.replace("otherComBase", ""); + otherPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + } else { + if (code.contains("socialBase")) { + code = code.replace("socialBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundBase")) { + code = code.replace("fundBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherBase")) { + code = code.replace("otherBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + } + + + if (code.contains("socialPer") && !code.contains("socialPerBase")) { + code = code.replace("socialPer", ""); + socialPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPer") && !code.contains("fundPerBase")) { + code = code.replace("fundPer", ""); + fundPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPer") && !code.contains("otherPerBase")) { + code = code.replace("otherPer", ""); + otherPerMap.put(code, entry.getValue().toString()); + continue; + } + + if (code.contains("socialCom") && !code.contains("socialComBase")) { + code = code.replace("socialCom", ""); + socialComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundCom") && !code.contains("fundComBase")) { + code = code.replace("fundCom", ""); + fundComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherCom") && !code.contains("otherComBase")) { + code = code.replace("otherCom", ""); + otherComMap.put(code, entry.getValue().toString()); + continue; } } - } //璁剧疆绀句繚涓汉鍜屽叕鍙哥即绾虫槑缁 @@ -2631,6 +2966,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap)); excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap)); + excelInsuranceDetailPO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBaseMap)); + excelInsuranceDetailPO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBaseMap)); + excelInsuranceDetailPO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBaseMap)); + //缁勮鏂扮殑insuranceAccountDetailPO瀵硅薄鏁版嵁 excelInsuranceDetailPO.setEmployeeId(employeeId); excelInsuranceDetailPO.setBillMonth(billMonth); diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 59b4d8e48..8738c66f9 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -20,6 +20,7 @@ import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.NonPaymentEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -141,7 +142,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public String insert(InsuranceArchivesSaveParam param) { SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - siArchivesBiz.insert(param, (long) user.getUID()); + siArchivesBiz.insert(param, user); return null; } @@ -1158,6 +1159,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService public PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) { List adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + adjustHistoryDTOS.forEach(f -> { + if (StringUtils.isNotBlank(f.getPaymentScope())) { + if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "涓汉")); + } else if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "鍏徃")); + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "涓汉") + "," + SalaryI18nUtil.getI18nLabel(0, "鍏徃")); + } + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "涓汉") + "," + SalaryI18nUtil.getI18nLabel(0, "鍏徃")); + } + }); PageInfo listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class); diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index 1c351dfac..ac3ec8488 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIAccountBiz; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; @@ -17,6 +19,7 @@ import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; import com.engine.salary.enums.sicategory.DataTypeEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.mapper.InsuranceExportMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; @@ -37,6 +40,7 @@ import com.engine.salary.util.SalaryEnumUtil; 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.excel.ExcelUtilPlus; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -66,6 +70,8 @@ public class SIExportServiceImpl extends Service implements SIExportService { private SIAccountBiz siAccountBiz = new SIAccountBiz(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private SISchemeService getSISchemeService(User user) { return ServiceUtil.getService(SISchemeServiceImpl.class, user); } @@ -242,11 +248,12 @@ public class SIExportServiceImpl extends Service implements SIExportService { } excelSheetData.addAll(rows); - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, total); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName, total); } @Override public List> buildCommonRecords(List list) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); List paymentList = getTaxAgentMapper().listAll(); @@ -272,10 +279,42 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("socialSchemeName", schemeIdNameMap.get(item.getSocialSchemeId())); if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", v); +// if (socialJson != null) { +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } @@ -284,22 +323,86 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("fundSchemeName", schemeIdNameMap.get(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", v); + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if (fundJson != null) { +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", paymentMap.get(item.getOtherPayOrg()) == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName()); record.put("otherSchemeName", schemeIdNameMap.get(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", v); + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if (otherJson != null) { +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } @@ -628,58 +731,127 @@ public class SIExportServiceImpl extends Service implements SIExportService { } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if (socialJson != null) { socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if (fundJson != null) { fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if (otherJson != null) { otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"), social + "otherBase"); + } + }); + } // map鏍规嵁value鎺掑簭 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -694,6 +866,24 @@ public class SIExportServiceImpl extends Service implements SIExportService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 8fc7eccdb..c8b41704c 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -27,6 +27,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; @@ -184,7 +185,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { //宸ヤ綔绨挎暟鎹 - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName,excelComments); } @@ -194,6 +195,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public List buildHeader() { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List result = new ArrayList<>(); result.add(SalaryI18nUtil.getI18nLabel( 85429, "濮撳悕")); result.add(SalaryI18nUtil.getI18nLabel( 86184, "涓◣鎵g即涔夊姟浜")); @@ -206,7 +208,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91325, "绀句繚缂寸撼缁勭粐")); //绀句繚绂忓埄鍩烘暟 Map socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY); - socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "鐢虫姤鍩烘暟"))); + if (welBaseDiffSign) { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"))); + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"))); + } else { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91324, "绀句繚璐﹀彿")); result.add(SalaryI18nUtil.getI18nLabel( 91319, "绀句繚璧峰缂寸撼鏈")); result.add(SalaryI18nUtil.getI18nLabel( 91320, "绀句繚鏈鍚庣即绾虫湀")); @@ -215,7 +223,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { result.add(SalaryI18nUtil.getI18nLabel( 91486, "鍏Н閲戣处鍙")); //鍏Н閲戠鍒╁熀鏁 Map fundMap = welfareNameIdMap( WelfareTypeEnum.ACCUMULATION_FUND); - fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "鐢虫姤鍩烘暟"))); + if (welBaseDiffSign) { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"))); + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"))); + } else { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91487, "琛ュ厖鍏Н閲戣处鍙")); result.add(SalaryI18nUtil.getI18nLabel( 91483, "鍏Н閲戣捣濮嬬即绾虫湀")); result.add(SalaryI18nUtil.getI18nLabel( 91484, "鍏Н閲戞渶鍚庣即绾虫湀")); @@ -223,7 +237,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91497, "鍏朵粬绂忓埄缂寸撼缁勭粐")); //鍏朵粬绂忓埄鍩烘暟 Map otherMap = welfareNameIdMap( WelfareTypeEnum.OTHER); - otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "鐢虫姤鍩烘暟"))); + if (welBaseDiffSign) { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "涓汉"))); + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel( 0, "鍗曚綅"))); + } else { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "鐢虫姤鍩烘暟"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91490, "鍏朵粬绂忓埄璧峰缂寸撼鏈")); result.add(SalaryI18nUtil.getI18nLabel( 91494, "鍏朵粬绂忓埄鏈鍚庣即绾虫湀")); return result; diff --git a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java index e1cf27275..e9a446dac 100644 --- a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java @@ -197,6 +197,9 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic // temp.setExternalFlag(insuranceAccountDetailPO.getExternalFlag()); temp.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()); // temp.setPaymentAgency(insuranceAccountDetailPO.getPaymentAgency()); + temp.setSocialPaymentComBaseString(insuranceAccountDetailPO.getSocialPaymentComBaseString()); + temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString()); + temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString()); } private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) { //閫宸ぞ淇濅釜浜虹即璐 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 8746fdd48..da2c8b0ae 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -44,6 +44,7 @@ import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; +import com.engine.salary.sys.enums.OpenEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.*; @@ -51,6 +52,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; @@ -73,6 +75,7 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** @@ -261,6 +264,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public List> buildTableData(List insuranceArchivesEmployeePOS) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> records = new ArrayList<>(); List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -286,9 +290,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map fundSchemePOMap = SalaryEntityUtil.convert2Map(fundList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); Map otherSchemePOMap = SalaryEntityUtil.convert2Map(otherList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); -// Map socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); -// Map fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); -// Map otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); @@ -307,15 +308,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("socialName", getSiSchemeService().querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -326,15 +349,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -345,15 +390,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("otherName", getSiSchemeService().querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -422,11 +489,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } //宸ヤ綔绨挎暟鎹 - List> rows = new LinkedList<>(); - List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); + List> rows = new LinkedList<>(); + List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); rows.add(collect); for (Map recordData : records) { - List row = new LinkedList<>(); + List row = new LinkedList<>(); for (WeaTableColumn column : columns) { try { Object o = recordData.get(column.getColumn()); @@ -437,20 +504,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } rows.add(row); } -// return salaryBatchService.simpleExportExcel(ExportExcelInfo.builder() -// .bizId(exportMap.get("biz")) -// .flag(true) -// .userId(employeeId) -// .eteamsId(eteamsId) -// .tenantKey(tenantKey) -// .operator(operator) -// .module(exportMap.get("module")) -// .fileName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 94629, "绀句繚绂忓埄妗f") + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now())) -// .handlerName("insuranceArchivesExportHandler") -// .dataType(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99915, "妗f")) -// .function(exportMap.get("function")).build(), sheetList); //鑾峰彇excel - return ExcelUtil.genWorkbook(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -532,10 +587,17 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + Map> result = new HashMap<>(); Set socialSet = new HashSet<>(); Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); @@ -571,6 +633,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } if (fundItem != null) { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { @@ -578,6 +648,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } if (otherItem != null) { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { @@ -585,42 +663,92 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //濡傛灉闇瑕佸尯鍒嗕釜浜哄拰鍏徃绂忓埄鍩烘暟 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - } - }); + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - } - }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - } - }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"涓汉")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0,"鍗曚綅")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + } + }); + } // map鏍规嵁key鎺掑簭 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() @@ -635,6 +763,23 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1084,41 +1229,78 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } /**************鏍¢獙鐢虫姤鍩烘暟**************/ - for (Map.Entry entry : welfareMap.entrySet()) { - String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟"); - String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); - if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "璇疯緭鍏ユ暟瀛")); - excelComments.add(errorMessageMap); - isError = true; + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + if (welBaseDiffSign) { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉"); + String keyComName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅"); + String numberPerValue = findElement(singleAccount, keyPerName).get(keyPerName) == null ? "" : findElement(singleAccount, keyPerName).get(keyPerName).toString(); + String numberComValue = findElement(singleAccount, keyComName).get(keyComName) == null ? "" : findElement(singleAccount, keyComName).get(keyComName).toString(); + + if (!"".equals(numberPerValue) && !NumberUtils.isParsable(numberPerValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyPerName + SalaryI18nUtil.getI18nLabel(0, "璇疯緭鍏ユ暟瀛")); + excelComments.add(errorMessageMap); + isError = true; + } + if (!"".equals(numberComValue) && !NumberUtils.isParsable(numberComValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyComName + SalaryI18nUtil.getI18nLabel(0, "璇疯緭鍏ユ暟瀛")); + excelComments.add(errorMessageMap); + isError = true; + } + } + } else { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟"); + String numberValue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); + if (!"".equals(numberValue) && !NumberUtils.isParsable(numberValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(0, "璇疯緭鍏ユ暟瀛")); + excelComments.add(errorMessageMap); + isError = true; + } } } + //鐢熸垚绂忓埄妗f鍩虹淇℃伅鏁版嵁 InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp()); - if (!isError) { + + //鍒ゆ柇鏄惁绂忓埄妗f瀵煎叆鏃讹紝涓嶇鍚堜笂涓嬮檺鐨勫熀鏁拌皟鏁翠负涓婇檺/涓嬮檺 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + + if (!isError && !welBaseAutoAdjustSign) { insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝 - Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString()); + Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString()); + Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString()); + Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - if (socialCheckBase && fundCheckBase && otherCheckBase) { + Boolean socialCheckComBase = true; + Boolean fundCheckComBase = true; + Boolean otherCheckComBase = true; + if (welBaseDiffSign) { + socialCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + } + if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } else { String checkMessage = "璇ユ潯鏁版嵁涓"; - if (!socialCheckBase) { + if (!socialCheckBase || !socialCheckComBase) { checkMessage = checkMessage + "绀句繚绂忓埄鍩烘暟銆"; } - if (!fundCheckBase) { + if (!fundCheckBase || !fundCheckComBase) { checkMessage = checkMessage + "鍏Н閲戠鍒╁熀鏁般"; } - if (!otherCheckBase) { + if (!otherCheckBase || !otherCheckComBase) { checkMessage = checkMessage + "鍏朵粬绂忓埄鍩烘暟銆"; } checkMessage = checkMessage.substring(0, checkMessage.length() - 1); @@ -1129,6 +1311,32 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { isError = true; } + } else if (!isError) { + //鏍¢獙绂忓埄鍩烘暟鏄惁绗﹀悎涓婁笅闄愯姹傦紝涓嶇鍚堜笂涓嬮檺鐨勫熀鏁拌皟鏁翠负涓婇檺 /涓嬮檺 + String newSocialPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newFundPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newOtherPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString); + + if (welBaseDiffSign) { + String newSocialPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newFundPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newOtherPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(newSocialPaymentComBaseString); + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(newFundPaymentComBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(newOtherPaymentComBaseString); + } + + insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); + insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); + insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); + insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); + + insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } return isError; } @@ -1162,12 +1370,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "绀句繚璐﹀彿")).get(SalaryI18nUtil.getI18nLabel(91324, "绀句繚璐﹀彿")); Long socialSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "绀句繚鏂规鍚嶇О")).get(SalaryI18nUtil.getI18nLabel(91323, "绀句繚鏂规鍚嶇О"))); HashMap oldSocialBaseMap = new HashMap<>(); + HashMap oldSocialComBaseMap = new HashMap<>(); if (oldSocialSchemeInfos.size() > 0) { oldSocialSchemePO = oldSocialSchemeInfos.get(0); encryptUtil.decrypt(oldSocialSchemePO, InsuranceArchivesSocialSchemePO.class); BeanUtils.copyProperties(oldSocialSchemePO, insuranceArchivesSocialSchemePO); //绀句繚鍩烘暟 oldSocialBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + oldSocialComBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesSocialSchemePO.setId(IdGenerator.generate()); @@ -1202,21 +1412,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); HashMap socialPaymentBase = new HashMap<>(); + HashMap socialPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialComBaseMap != null && StringUtils.isNotBlank(oldSocialComBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentComBase.put(String.valueOf(insuranceId), oldSocialComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } } } + } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); } @@ -1243,12 +1480,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String supplementFundAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "琛ュ厖鍏Н閲戣处鍙")).get(SalaryI18nUtil.getI18nLabel(91487, "琛ュ厖鍏Н閲戣处鍙")); Long fundSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "鍏Н閲戞柟妗堝悕绉")).get(SalaryI18nUtil.getI18nLabel(91485, "鍏Н閲戞柟妗堝悕绉"))); HashMap oldFundBaseMap = new HashMap<>(); + HashMap oldFundComBaseMap = new HashMap<>(); if (oldFundSchemeInfos.size() > 0) { oldFundSchemePO = oldFundSchemeInfos.get(0); encryptUtil.decrypt(oldFundSchemePO, InsuranceArchivesFundSchemePO.class); BeanUtils.copyProperties(oldFundSchemePO, insuranceArchivesFundSchemePO); //绀句繚鍩烘暟 oldFundBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + oldFundComBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesFundSchemePO.setId(IdGenerator.generate()); @@ -1286,24 +1525,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap fundPaymentBase = new HashMap<>(); + HashMap fundPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundComBaseMap != null && StringUtils.isNotBlank(oldFundComBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentComBase.put(String.valueOf(insuranceId), oldFundComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBase)); } return insuranceArchivesFundSchemePO; } @@ -1325,12 +1589,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //璁剧疆鍏朵粬绂忓埄鏂规銆佽捣濮嬬即绾虫湀銆佹渶鍚庣即绾虫湀 Long otherSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "鍏朵粬绂忓埄鏂规鍚嶇О")).get(SalaryI18nUtil.getI18nLabel(91496, "鍏朵粬绂忓埄鏂规鍚嶇О"))); HashMap oldOtherBaseMap = new HashMap<>(); + HashMap oldOtherComBaseMap = new HashMap<>(); if (oldOtherSchemeInfos.size() > 0) { oldOtherSchemePO = oldOtherSchemeInfos.get(0); encryptUtil.decrypt(oldOtherSchemePO, InsuranceArchivesOtherSchemePO.class); BeanUtils.copyProperties(oldOtherSchemePO, insuranceArchivesOtherSchemePO); //绀句繚鍩烘暟 oldOtherBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + oldOtherComBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesOtherSchemePO.setId(IdGenerator.generate()); @@ -1361,24 +1627,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO.setEmployeeId(employeeId); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap otherPaymentBase = new HashMap<>(); + HashMap otherPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "鐢虫姤鍩烘暟")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "涓汉")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟") + SalaryI18nUtil.getI18nLabel(0, "鍗曚綅")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherComBaseMap != null && StringUtils.isNotBlank(oldOtherComBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentComBase.put(String.valueOf(insuranceId), oldOtherComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "鐢虫姤鍩烘暟")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBase)); } return insuranceArchivesOtherSchemePO; } diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 5d497e172..59be851cc 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -18,9 +18,9 @@ import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO; import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.*; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; +import com.engine.salary.entity.salarysob.dto.SalarySobEmpFieldDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; -import com.engine.salary.entity.salarysob.dto.SalarySobItemDTO; -import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO; import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; @@ -680,19 +680,22 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc parseHeader(headerColumnGroup, finalWeaTableColumns); List headerList = new ArrayList<>(finalWeaTableColumns); - // 鏌ヨ钖祫鏍哥畻缁撴灉 - List> resultMapList = getSalaryAcctResultService(user).listByParam(param); // excel瀵煎嚭鐨勬暟鎹 List> rows = new ArrayList<>(); rows.add(headerList); - for (Map map : resultMapList) { - List row = Lists.newArrayListWithExpectedSize(headerColumnGroup.size()); - for (WeaTableColumnGroup weaTableColumn : headerColumnGroup) { - row.add(map.getOrDefault(weaTableColumn.getColumn(), StringUtils.EMPTY)); + if (param.getImportType() != null && param.getImportType().equals("true")) { + // 闇瑕佸鍑虹幇鏈夋暟鎹紝鏌ヨ钖祫鏍哥畻缁撴灉 + List> resultMapList = getSalaryAcctResultService(user).listByParam(param); + for (Map map : resultMapList) { + List row = Lists.newArrayListWithExpectedSize(headerColumnGroup.size()); + for (WeaTableColumnGroup weaTableColumn : headerColumnGroup) { + row.add(map.getOrDefault(weaTableColumn.getColumn(), StringUtils.EMPTY)); + } + rows.add(row); } - rows.add(row); } + String sheetName = "钖祫鏍哥畻瀵煎叆妯℃澘"; return ExcelUtilPlus.genWorkbookWithChildTitleColumn(rows, sheetName, false); } @@ -794,12 +797,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (Objects.isNull(salaryAcctRecordPO)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "钖祫鏍哥畻璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎")); } - // 妯℃澘琛ㄥご(榛樿蹇呭甫"涓◣鎵g即涔夊姟浜"銆"濮撳悕") - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); - //瀹氫綅浜哄憳甯︹滈儴闂ㄢ濓紝鈥滄墜鏈哄彿鈥濓紝鈥滃伐鍙封 - headerList.add("閮ㄩ棬"); - headerList.add("鎵嬫満鍙"); - headerList.add("宸ュ彿"); + // // 妯℃澘琛ㄥご(榛樿蹇呭甫"涓◣鎵g即涔夊姟浜"銆"濮撳悕") + // List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜")); + // //瀹氫綅浜哄憳甯︹滈儴闂ㄢ濓紝鈥滄墜鏈哄彿鈥濓紝鈥滃伐鍙封 + // headerList.add("閮ㄩ棬"); + // headerList.add("鎵嬫満鍙"); + // headerList.add("宸ュ彿"); // 鏌ヨ钖祫璐﹀涓嬬殑钖祫椤圭洰 SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId()); @@ -814,16 +817,16 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // } // // } - // 钖祫椤圭洰鍒嗙被涓嬬殑鏂拌祫椤圭洰 - for (SalarySobItemGroupDTO itemGroup : salarySobItemAggregateDTO.getItemGroups()) { - for (SalarySobItemDTO item : itemGroup.getItems()) { - headerList.add(item.getName()); - } - } - // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 - for (SalarySobItemDTO item : salarySobItemAggregateDTO.getItems()) { - headerList.add(item.getName()); - } +// // 钖祫椤圭洰鍒嗙被涓嬬殑鏂拌祫椤圭洰 +// for (SalarySobItemGroupDTO itemGroup : salarySobItemAggregateDTO.getItemGroups()) { +// for (SalarySobItemDTO item : itemGroup.getItems()) { +// headerList.add(item.getName()); +// } +// } +// // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 +// for (SalarySobItemDTO item : salarySobItemAggregateDTO.getItems()) { +// headerList.add(item.getName()); +// } // 鏃犲垎绫昏柂璧勯」鐩甶d @@ -831,11 +834,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 鏌ヨ鍒楄〃鐨勮〃澶 List weaTableColumns = listWeaTableColumn(salaryAcctRecordPO); List finalWeaTableColumns = new ArrayList<>(); - finalWeaTableColumns.add(new WeaTableColumnGroup("150", SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"), SalaryI18nUtil.getI18nLabel(85429, "濮撳悕"))); - finalWeaTableColumns.add(new WeaTableColumnGroup("150", SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜"), SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜"))); - finalWeaTableColumns.add(new WeaTableColumnGroup("150", "閮ㄩ棬", "閮ㄩ棬")); - finalWeaTableColumns.add(new WeaTableColumnGroup("150", "鎵嬫満鍙", "鎵嬫満鍙")); - finalWeaTableColumns.add(new WeaTableColumnGroup("150", "宸ュ彿", "宸ュ彿")); + // 鏌ヨ钖祫鏍哥畻鎵鐢ㄧ殑钖祫璐﹀鐨勫憳宸ヤ俊鎭瓧娈 + List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List salarySobEmpFieldDTOS = new SalarySobItemAggregateBO().buildEmpField(salarySobEmpFieldPOS); + salarySobEmpFieldDTOS.stream().forEach(empField -> finalWeaTableColumns.add(new WeaTableColumnGroup("150", SalaryI18nUtil.getI18nLabel(0, empField.getFieldName()), SalaryI18nUtil.getI18nLabel(0, empField.getFieldName())))); for (WeaTableColumnGroup tableColumn : weaTableColumns) { WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) tableColumn; if (columnGroupItem.getChildren() != null) { @@ -879,7 +881,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); map.put("headers", ExcelSupport.getSheetHeader(sheet, 1)); - map.put("list", ExcelParseHelper.parse2List(sheet, 2)); + map.put("list", ExcelParseHelper.parse2List(sheet, 2, 1)); return map; } finally { @@ -954,7 +956,11 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // 绉熸埛涓嬫墍鏈夌殑涓◣鎵g即涔夊姟浜 List taxAgents = getTaxAgentService(user).listAll(); Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); - + // 钖祫鏍哥畻浜哄憳淇℃伅瀛楁 + List salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List salarySobEmpFields = SalaryEntityUtil.properties(new SalarySobItemAggregateBO().buildEmpField(salarySobEmpFieldPOS), SalarySobEmpFieldDTO::getFieldName, Collectors.toList()); + List excludeFields = Arrays.asList("涓◣鎵g即涔夊姟浜", "閮ㄩ棬", "濮撳悕"); + salarySobEmpFields = salarySobEmpFields.stream().filter(field -> !excludeFields.contains(field)).collect(Collectors.toList()); // 绱㈠紩(鐢ㄤ簬璁$畻杩涘害) int index = 0; // 澶辫触鐨勬暟閲 @@ -1076,7 +1082,9 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc } } else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "閮ㄩ棬"), dataKey.toString()) || StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "鎵嬫満鍙"), dataKey.toString()) - || StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "宸ュ彿"), dataKey.toString())) { + || StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "宸ュ彿"), dataKey.toString()) + || salarySobEmpFields.contains(dataKey.toString()) + ) { } else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "涓◣鎵g即涔夊姟浜"), dataKey.toString())) { if (StringUtils.isEmpty(dataValue)) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 0d9a4cab2..0f3f645bd 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -5,6 +5,9 @@ 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.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; import com.engine.salary.entity.salaryacct.param.SalaryAcctApprovalWorkflowParam; @@ -15,6 +18,7 @@ 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.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; @@ -36,6 +40,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; +import dm.jdbc.util.IdGenerator; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; @@ -44,6 +49,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; +import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; @@ -85,6 +91,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) { return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user); } @@ -114,6 +124,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } @@ -516,7 +530,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe .findAny() .orElse(null); if (diffTaxCycleSalaryAcctTaxAgent != null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "鍏ㄥ勾涓娆℃у閲戞敹鍏ヤ竴骞村唴鍙兘鐢虫姤涓娆★紝鎵浠ョ◣娆炬墍灞炴湡蹇呴』鐩稿悓")); +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160502, "鍏ㄥ勾涓娆℃у閲戞敹鍏ヤ竴骞村唴鍙兘鐢虫姤涓娆★紝鎵浠ョ◣娆炬墍灞炴湡蹇呴』鐩稿悓")); } } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 625321877..385e85b17 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; @@ -48,15 +49,18 @@ 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 com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.jetbrains.annotations.NotNull; @@ -305,9 +309,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe TaxAgentPO taxAgent = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); // 鏌ヨ鍏紡 Map formulaContentMap = getSalaryAcctResultService(user).getColumnBySalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()); + List lockItems = byId.getLockSalaryItemIds() == null ? Collections.emptyList() : byId.getLockSalaryItemIds(); // 杞崲鎴愯柂璧勬牳绠楃粨鏋滆鎯卍to - return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap); + return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap, lockItems); } @Override @@ -1137,4 +1142,107 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } return true; } + + @Override + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { + ValidUtil.doValidator(param); + + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); + if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { + throw new SalaryRunTimeException("钖祫鏍哥畻璁板綍涓嶅瓨鍦紝鎴栧凡琚垹闄"); + } + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 钖祫璐﹀涓寘鍚殑钖祫椤圭洰 + List salarySobItemIds = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); + if (!salarySobItemIds.contains(param.getSalaryItemId())) { + throw new SalaryRunTimeException("璇ヨ处濂椾笉鍖呭惈璇ヨ柂璧勯」鐩垨宸茶鍒犻櫎锛岃鍏堟鏌ヨ处濂"); + } + // 鑾峰彇闇瑕佹洿鏂扮殑鏍哥畻浜哄憳淇℃伅 + List salaryAcctEmployeePOList = new ArrayList<>(); + if (CollectionUtils.isEmpty(param.getIdList())) { + // 娌℃湁閫夋嫨鏍哥畻浜哄憳锛屾洿鏂版牳绠楄褰曚腑鎵鏈変汉鍛 + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId())); + } else { + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listByIds(param.getIdList())); + } + + if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) { + List salaryAcctEmployeeIdList = SalaryEntityUtil.properties(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId, Collectors.toList()); + // 鏌ヨ钖祫鏍哥畻缁撴灉 + List resultPOS = listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIdList, Collections.singleton(param.getSalaryItemId())); + Map salaryAcctResultPOMap = SalaryEntityUtil.convert2Map(resultPOS, SalaryAcctResultPO::getSalaryAcctEmpId); + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); + List needUpdateList = new ArrayList<>(); + List needInsertList = new ArrayList<>(); + Date now = new Date(); + List salaryAcctResultReportPOS = new ArrayList<>(); + salaryAcctEmployeePOList.forEach(salaryAcctEmployeePO -> { + if (salaryAcctResultPOMap.containsKey(salaryAcctEmployeePO.getId())) { + // 鏇存柊 + SalaryAcctResultPO po = salaryAcctResultPOMap.get(salaryAcctEmployeePO.getId()); + po.setResultValue(param.getValue()); + po.setUpdateTime(now); + needUpdateList.add(po); + } else { + // 鏂板 + needInsertList.add(SalaryAcctResultPO.builder() + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId()) + .employeeId(salaryAcctEmployeePO.getEmployeeId()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(param.getValue()) + .originResultValue("") + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); + } + + // 鎶ヨ〃 + SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() + .id(IdGenerator.generate()) + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId().toString()) + .employeeId(salaryAcctEmployeePO.getEmployeeId().toString()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(param.getValue()) + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployeePO.getEmployeeId()); + if (dataCollectionEmployee != null) { + po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); + po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); + po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); + po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); + po.setLocationId(dataCollectionEmployee.getLocationId()); + } + salaryAcctResultReportPOS.add(po); + }); + + // 鍏ュ簱 + if (CollectionUtils.isNotEmpty(needUpdateList)) { + // 鏁版嵁鍔犲瘑 + encryptUtil.encryptList(needUpdateList, SalaryAcctResultPO.class); + List> partition = Lists.partition(needUpdateList, 100); + partition.forEach(getSalaryAcctResultMapper()::batchUpdate); + } + batchSave(needInsertList); + + // 鎶ヨ〃鍏ュ簱鍓嶅厛鍒犻櫎 + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(param.getIdList(), Collections.singletonList(param.getSalaryItemId()) ); + getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); + + } + } } \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 6e9545ff5..a8afb24d2 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -163,6 +163,19 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe if (queryParam.isExtSalaryArchiveList()) { return getSalaryArchiveMapper().listExtSalaryArchive(queryParam); } + if (StringUtils.isNotBlank(queryParam.getPayStartDateStartDateStr())) { + queryParam.setPayStartDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayStartDateEndDateStr())) { + queryParam.setPayStartDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateEndDateStr())); + } + + if (StringUtils.isNotBlank(queryParam.getPayEndDateStartDateStr())) { + queryParam.setPayEndDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayEndDateEndDateStr())) { + queryParam.setPayEndDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateEndDateStr())); + } return getSalaryArchiveMapper().list(queryParam); } @@ -320,11 +333,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe @Override public void deleteSalaryArchive(Collection salaryArchiveIds) { - if(CollectionUtils.isEmpty(salaryArchiveIds)){ + if (CollectionUtils.isEmpty(salaryArchiveIds)) { throw new SalaryRunTimeException("钖祫妗f鍙傛暟涓虹┖!"); } SalarySysConfPO canDelete = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ARCHIVE_DELETE); - if(Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(),"0") ){ + if (Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(), "0")) { throw new SalaryRunTimeException("涓嶅厑璁稿垹闄よ柂璧勬。妗堬紝璇峰厛寮鍚垹闄ゆ。妗堣鍒欓厤缃紒"); } List salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build()); @@ -333,17 +346,17 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()) .stream().map(TaxAgentPO::getId).collect(Collectors.toList()); boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId())); - if(CollectionUtils.isEmpty(salaryArchiveList) || err){ + if (CollectionUtils.isEmpty(salaryArchiveList) || err) { throw new SalaryRunTimeException("钖祫妗f涓嶅瓨鍦紝鎴栨病鏈夋潈闄愬垹闄よ钖祫妗f锛"); } Optional fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue()) && !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst(); - if(fixedList.isPresent()){ + if (fixedList.isPresent()) { throw new SalaryRunTimeException("鍙戣柂鍛樺伐銆佸緟鍋滆柂鍛樺伐銆佸仠钖猒鏉ヨ嚜寰呭仠钖紝鏃犳硶鍒犻櫎钖祫妗f锛"); } List deleteIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); // 鍒犻櫎钖祫妗f鍙婃。妗堥」鐩 - if(CollectionUtils.isNotEmpty(deleteIds)){ + if (CollectionUtils.isNotEmpty(deleteIds)) { getSalaryArchiveMapper().deleteByIds(deleteIds); getSalaryArchiveItemMapper().deleteBySalaryArchiveId(deleteIds); } @@ -432,7 +445,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); // 1.鑾峰彇钖祫妗f鎵瀵瑰簲鐨勫綋鍓嶇敓鏁堢殑钖祫椤圭洰鏁版嵁 List salaryArchiveItemList = Collections.emptyList(); - if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage){ + if (CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage) { salaryArchiveItemList = getCurrentEffectiveItemList(ids, salaryItemIds); } List finalSalaryArchiveItemList = salaryArchiveItemList; @@ -461,7 +474,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 3.缁勮鏁版嵁 List> listMaps = new ArrayList<>(); salaryArchives.forEach(e -> { - e.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus()))); + e.setEmployeeStatus(NumberUtils.isCreatable(e.getEmployeeStatus()) ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus())) : ""); Map map = new LinkedHashMap<>(); map.put("id", e.getId()); @@ -757,11 +770,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 鑾峰彇鏍哥畻浜哄憳瑙勫垯 List statusList = Collections.emptyList(); SalarySysConfPO employeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE); - if(Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())){ + if (Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())) { // 榛樿鍖呭惈鍋滆柂鍒楄〃 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue(), - SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue() ); - }else{ + SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()); + } else { // 浠呭寘鍚彂钖佸緟瀹氳柂 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue()); } diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 4f91464d3..e1be33ccd 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -254,6 +254,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService newSalaryItemPO.setSharedType(saveParam.getSharedType()); newSalaryItemPO.setTaxAgentIds(saveParam.getTaxAgentIds()); newSalaryItemPO.setSortedIndex(saveParam.getSortedIndex()); + newSalaryItemPO.setWidth(saveParam.getWidth()); salaryItemBiz.updateById(newSalaryItemPO); //鏀瑰悕鍚庢洿鏂板叕寮 @@ -421,6 +422,9 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService List salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId)); Set salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId); List salarySobs = getSalarySobService(user).listByIds(salarySobIds); + // 鑾峰彇鑳藉绠$悊鐨勪箟鍔′汉 + Set taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())), TaxAgentPO::getId); + salarySobs = salarySobs.stream().filter(sob -> taxAgentIds.contains(sob.getTaxAgentId())).collect(Collectors.toList()); return salarySobs.stream().map(m -> { Map map = new HashMap<>(); map.put("id", String.valueOf(m.getId())); diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 90d055358..65193a36a 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1725,4 +1725,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } return getSalarySendMapper().getByIds(salarySendId); } + + @Override + public List listSome(SalarySendPO param) { + return getSalarySendMapper().listSome(param); + } } diff --git a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java index e277bac7f..e2dec0af8 100644 --- a/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobInitServiceImpl.java @@ -11,7 +11,6 @@ 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; @@ -112,7 +111,7 @@ public class SalarySobInitServiceImpl extends AbstractSalarySobInitService { .setIncomeCategory(saveParam.getTaxableItems()) .setSalaryCycleType(saveParam.getSalaryCycleType()) .setSalaryCycleFromDay(saveParam.getSalaryCycleFromDay()) - .setTaxCycleType(SalaryCycleTypeEnum.THIS_MONTH.getValue()) + .setTaxCycleType(saveParam.getTaxCycleType()) .setAttendCycleType(saveParam.getAttendCycleType()) .setAttendCycleFromDay(saveParam.getAttendCycleFromDay()) .setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType()) diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 7cd9cfd6f..f7fd19a94 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -53,7 +53,9 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List idList = taxAgentEmpList.stream().map(TaxAgentEmpPO::getId).collect(Collectors.toList()); - getTaxAgentEmpMapper().deleteByIds(idList); + + List> partition = Lists.partition(idList, 500); + partition.forEach(getTaxAgentEmpMapper()::deleteByIds); } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java index 8a7e8a3e3..f8a7db934 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationExcelServiceImpl.java @@ -1,30 +1,53 @@ package com.engine.salary.service.impl; +import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxdeclaration.dto.AbnormalEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.FailEmployeeListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.DownloadTemplateParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSheetData; +import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; -import java.lang.reflect.Field; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** * 涓◣鐢虫姤琛ㄥ鍑 @@ -57,6 +80,19 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public XSSFWorkbook exportTaxDeclarationValue(TaxDeclarationValueListQueryParam queryParam) { // 鏌ヨ涓◣鐢虫姤琛 @@ -138,9 +174,9 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar private ExcelSheetData getExcelSheetData(Class clazz, List dtoList) { // 瀵煎嚭鐨勮〃澶 - List headerList = Lists.newArrayList(); + List headerList = Lists.newArrayList(); List dataIndexList = Lists.newArrayList(); - parseHeader(clazz, headerList, dataIndexList); + ExcelUtil.parseHeader(clazz, headerList, dataIndexList); // 瀵煎嚭鐨勬暟鎹 List> rows = Lists.newArrayListWithExpectedSize(dtoList.size()); dtoList.forEach(dto -> { @@ -157,23 +193,222 @@ public class TaxDeclarationExcelServiceImpl extends Service implements TaxDeclar return excelSheetData; } - /** - * 瑙f瀽琛ㄥご - * - * @param clazz - * @param headerList - * @param dataIndexList - * @param - */ - 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((int) annotation.labelId(), annotation.text())); - dataIndexList.add(declaredField.getName()); + @Override + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); + + + List heads = new ArrayList<>(); + heads.add(SalaryI18nUtil.getI18nLabel(85429, "濮撳悕")); + heads.add(SalaryI18nUtil.getI18nLabel(86185, "閮ㄩ棬")); + heads.add(SalaryI18nUtil.getI18nLabel(86186, "鎵嬫満鍙")); + heads.add(SalaryI18nUtil.getI18nLabel(86317, "宸ュ彿")); + heads.addAll(SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList())); + + List> rowList = new ArrayList<>(); + rowList.add(heads); + XSSFWorkbook book = ExcelUtil.genWorkbookV2(rowList, incomeCategoryEnum.getDefaultLabel()); + return book; + } + + @Override + public Map preview(DownloadTemplateParam importParam) { + //excel鏂囦欢id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId涓虹┖"); + + InputStream fileInputStream = null; + Map map = new HashMap<>(); + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(importParam.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + map.put("headers", ExcelSupport.getSheetHeader(sheet, 0)); + map.put("list", ExcelParseHelper.parse2List(sheet, 1, 0)); + return map; + } finally { + IOUtils.closeQuietly(fileInputStream); } } + + @Override + public Map importData(DownloadTemplateParam param) { + Map apidatas = new HashMap<>(); + + //鏌ヨ瀵逛簬浜哄憳淇℃伅瀵煎叆绛涢夌殑鍏ㄥ眬閰嶇疆 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + + // 绉熸埛涓嬫墍鏈夌殑浜哄憳 + List salaryEmployees = getSalaryEmployeeService(user).listAllForReport(); + + + TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(declarationPO.getIncomeCategory()); + List taxReportColumnPOS = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum,0); + List taxReportColumnNames = SalaryEntityUtil.properties(taxReportColumnPOS, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(declarationPO.getId()); + Map empDeclarationValueMap = SalaryEntityUtil.convert2Map(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + // 澶辫触鐨勬暟閲 + int errorCount = 0; + // 鎴愬姛鐨勬暟閲 + int successCount = 0; + Date now = new Date(); + + List addList = Lists.newArrayList(); + List editList = Lists.newArrayList(); + + + InputStream fileInputStream = null; + try { + + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + + // 閿欒鎻愮ず淇℃伅 + List excelComments = Lists.newArrayList(); + // 瀛樺湪閿欒鐨勯偅琛屾暟鎹 + List> errorDatas = Lists.newArrayList(); + // 琛ㄥご + List headers = ExcelSupport.getSheetHeader(sheet, 0); + List> data = ExcelParseHelper.parse2Map(sheet, 1, 0); + + if (CollectionUtils.isEmpty(headers)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "琛ㄥご涓虹┖"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + if (CollectionUtils.isEmpty(data)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "鏃犳暟鎹"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + + Optional first = taxReportColumnNames.stream().filter(name -> !headers.contains(name)).findFirst(); + if (first.isPresent()) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", "鐢虫姤妯℃澘寮傚父锛岀己澶" + first.get() + "鍒,璇锋鏌ユ槸鍚︿负" + incomeCategoryEnum.getDefaultLabel() + "鐢虫姤妯℃澘"); + excelComments.add(errorMessageMap); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } + + + for (int i = 0; i < data.size(); i++) { + + String row = "绗" + (i + 2) + "琛"; + + boolean isError = false; + Map map = data.get(i); + Long employeeId = 0L; + + String username = (String) map.getOrDefault("濮撳悕", ""); + String deparmentName = (String) map.getOrDefault("閮ㄩ棬", ""); + String mobile = (String) map.getOrDefault("鎵嬫満鍙", ""); + String workcode = (String) map.getOrDefault("宸ュ彿", ""); + + if (StringUtils.isEmpty(username) && "0".equals(confValue)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "濮撳悕涓嶈兘涓虹┖")); + excelComments.add(errorMessageMap); + } else { + //绛涢夊鍏ヤ汉鍛樹俊鎭彲浠ュ湪浜哄姏璧勬簮姹犱腑鍖归厤鍒扮殑浜哄憳淇℃伅 + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, username, deparmentName, mobile, workcode, null); + + if (CollectionUtils.isEmpty(employeeSameIds)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "濮撳悕閿欒锛岀郴缁熷唴涓嶅瓨鍦ㄨ濮撳悕")); + excelComments.add(errorMessageMap); + } else if (employeeSameIds.size() > 1) { + //瀛樺湪绂昏亴鍜屽湪鑱岀姸鎬佸彇鍦ㄨ亴鐘舵 + employeeSameIds = employeeSameIds.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .collect(Collectors.toList()); + if (employeeSameIds.size() != 1) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + "鍛樺伐淇℃伅涓嶅瓨鍦ㄦ垨鑰呭瓨鍦ㄥ涓憳宸"); + excelComments.add(errorMessageMap); + } else { + employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null; + } + } else { + employeeId = employeeSameIds.get(0).getEmployeeId(); + } + } + + if (isError) { + errorCount++; + errorDatas.add(map); + continue; + } + + successCount++; + + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumnPOS) { + String value = (String) map.getOrDefault(taxReportColumn.getReportColumnName(), ""); + valueMap.put(taxReportColumn.getReportColumnDataIndex(), StringUtils.isNotBlank(value) ? value.toString() : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""); + } + + if (empDeclarationValueMap.containsKey(employeeId)) { + TaxDeclarationValuePO taxDeclarationValue = empDeclarationValueMap.get(employeeId); + taxDeclarationValue.setResultValue(valueMap); + taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(valueMap)); + taxDeclarationValue.setUpdateTime(new Date()); + taxDeclarationValue.setSource(SourceEnum.IMP.getValue()); + editList.add(taxDeclarationValue); + } else { + //鏂板 + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(declarationPO.getTaxDeclareRecordId()) + .taxDeclarationId(declarationPO.getId()) + .employeeType(EmployeeTypeEnum.ORGANIZATION.getValue()) + .employeeId(employeeId) + .resultValue(valueMap) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .creator(employeeId) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(now) + .updateTime(now) + .source(SourceEnum.IMP.getValue()) + .build(); + addList.add(taxDeclarationValue); + } + } + + getTaxDeclarationValueService(user).batchSave(addList); + getTaxDeclarationValueService(user).batchEdit(editList); + + if (incomeCategoryEnum == IncomeCategoryEnum.ONETIME_ANNUAL_BONUS) { + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(declarationPO.getTaxDeclareRecordId()); + getTaxDeclarationValueService(user).autoAddWagesDeclare(declareRecordPO); + } + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 987eacf58..9ba7b8237 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -4,16 +4,23 @@ 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.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.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationAddParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDeleteParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; @@ -25,6 +32,8 @@ 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 com.engine.salary.util.valid.ValidUtil; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; @@ -84,6 +93,16 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } + + private TaxDeclareRecordService getTaxDeclareRecordService(User user) { + return ServiceUtil.getService(TaxDeclareRecordServiceImpl.class, user); + } + + private TaxDeclarationValueService getTaxDeclarationValueService(User user) { + return ServiceUtil.getService(TaxDeclarationValueServiceImpl.class, user); + } + + @Override public List listByTaxCycleAndTaxAgentIds(YearMonth taxCycle, Collection taxAgentIds) { if (Objects.isNull(taxCycle) || CollectionUtils.isEmpty(taxAgentIds)) { @@ -94,6 +113,25 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration return taxDeclarationPOS; } + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).build(); + return getTaxDeclarationMapper().listSome(po); + } + + @Override + public List listByTaxDeclareRecordId(Long taxDeclareRecordId, Integer incomeCategory) { + if (Objects.isNull(taxDeclareRecordId)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "鍙傛暟閿欒")); + } + TaxDeclarationPO po = TaxDeclarationPO.builder().taxDeclareRecordId(taxDeclareRecordId).incomeCategory(incomeCategory).build(); + return getTaxDeclarationMapper().listSome(po); + } + + @Override public PageInfo listPageByParam(TaxDeclarationListQueryParam queryParam) { long currentEmployeeId = user.getUID(); @@ -205,7 +243,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration // 鏃犺柂璧勬牳绠楃粨鏋滐紝涓嶅厑璁哥敓鎴愪釜绋庣敵鎶ヨ〃 if (CollectionUtils.isEmpty(salaryAcctResultPOS)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110093, "{0}鏃犲彲鐢虫姤鏁版嵁") - .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } Set salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctRecordId); @@ -214,14 +252,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}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .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}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); + .replace("{0}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth()))); } // 鏌ヨ钖祫璐﹀ Set salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId); @@ -362,7 +400,79 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public List listByTaxCycleRange(YearMonthRange yearMonthRange) { return getTaxDeclarationMapper().listSome(TaxDeclarationPO.builder() - .salaryMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) + .taxMonths(LocalDateRange.builder().fromDate(yearMonthRange.getStartMonth()).endDate(yearMonthRange.getEndMonth()).build()) .build()); } + + + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + @Override + public void addTaxDeclaration(TaxDeclarationAddParam param) { + ValidUtil.doValidator(param); + + Long taxDeclareRecordId = param.getTaxDeclareRecordId(); + IncomeCategoryEnum incomeCategory = param.getIncomeCategory(); + + TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(taxDeclareRecordId); + if (taxDeclareRecord == null) { + throw new SalaryRunTimeException("鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + List taxDeclarations = listByTaxDeclareRecordId(taxDeclareRecordId); + Optional first = taxDeclarations.stream().filter(taxDeclarationPO -> incomeCategory.getValue().equals(taxDeclarationPO.getIncomeCategory())).findFirst(); + if (first.isPresent()) { + throw new SalaryRunTimeException("宸插瓨鍦" + incomeCategory.getDefaultLabel() + "鐢虫姤琛"); + } + + Date now = new Date(); + TaxDeclarationPO taxDeclaration = TaxDeclarationPO + .builder() + .id(IdGenerator.generate()) + .taxDeclareRecordId(taxDeclareRecord.getId()) + .incomeCategory(incomeCategory.getValue()) + .taxAgentId(taxDeclareRecord.getTaxAgentId()) + .salaryMonth(taxDeclareRecord.getSalaryMonth()) + .taxCycle(taxDeclareRecord.getTaxCycle()) + .description(taxDeclareRecord.getRemark()) + .controlView(0) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + List objects = new ArrayList<>(); + objects.add(taxDeclaration); + getTaxDeclarationMapper().batchInsert(objects); + } + + + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + @Override + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + ValidUtil.doValidator(param); + Long taxDeclarationId = param.getTaxDeclarationId(); + TaxDeclarationPO declarationPO = getById(taxDeclarationId); + + if (declarationPO == null) { + throw new SalaryRunTimeException("鐢虫姤琛ㄤ笉瀛樺湪锛"); + } + + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationId(taxDeclarationId); + + if (CollectionUtils.isNotEmpty(taxDeclarationValuePOS)) { + throw new SalaryRunTimeException("瀛樺湪鐢虫姤鏄庣粏涓嶅厑璁稿垹闄わ紝璇峰厛鍒犻櫎鐢虫姤琛ㄦ槑缁嗭紒"); + } + + getTaxDeclarationMapper().deleteByIdZj(taxDeclarationId); + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java index f7aaf17c9..65e927c19 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationValueServiceImpl.java @@ -1,21 +1,34 @@ package com.engine.salary.service.impl; +import cn.hutool.core.util.NumberUtil; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList; +import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO; import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO; +import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam; +import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO; import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; +import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.enums.sicategory.DeleteTypeEnum; +import com.engine.salary.enums.taxdeclaration.SourceEnum; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; +import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; import com.engine.salary.service.*; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -24,11 +37,16 @@ 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 com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import weaver.general.Util; import weaver.hrm.User; +import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** @@ -47,6 +65,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); } + private TaxDeclareRecordMapper getTaxDeclareRecordMapper() { + return MapperProxyFactory.getProxy(TaxDeclareRecordMapper.class); + } + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } @@ -63,6 +85,10 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); } + private TaxDeclarationService getTaxDeclarationService(User user) { + return ServiceUtil.getService(TaxDeclarationServiceImpl.class, user); + } + @Override public PageInfo listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection taxDeclarationIds) { List taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); @@ -76,6 +102,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar return decryptBatch(taxDeclarationValues); } + @Override + public List listByTaxDeclarationId(Long taxDeclarationId) { + List taxDeclarationValues = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationId(taxDeclarationId).build()); + return decryptBatch(taxDeclarationValues); + } + @Override public List listByTaxDeclarationIdsNoDecrypt(Collection taxDeclarationIds) { return getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build()); @@ -85,32 +117,24 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar public TaxDeclarationValueListDTO convert2List(TaxDeclarationPO taxDeclaration, List taxDeclarationValues) { // 鏌ヨ涓◣鐢虫姤琛ㄨ〃澶 IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); - List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0); // 浜哄憳id Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); // 鏌ヨ鎶ラ佺殑浜哄憳 List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); // 鏌ヨ浜哄憳淇℃伅 - List simpleEmployeeIds = taxDeclarationValues.stream() - .filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) - .map(TaxDeclarationValuePO::getEmployeeId) - .distinct() - .collect(Collectors.toList()); + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).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 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); + List> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, false); return new TaxDeclarationValueListDTO().setColumns(weaTableColumns).setData(data); } @@ -119,18 +143,76 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar public void batchSave(List taxDeclarationValues) { if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { // 鍔犲瘑 - taxDeclarationValues.forEach(taxDeclarationValue -> - taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + 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 batchEdit(List taxDeclarationValues) { + if (CollectionUtils.isNotEmpty(taxDeclarationValues)) { + // 鍔犲瘑 + taxDeclarationValues.forEach(taxDeclarationValue -> taxDeclarationValue.setResultValueJson(JsonUtil.toJsonString(taxDeclarationValue.getResultValue()))); + taxDeclarationValues = encryptUtil.encryptList(taxDeclarationValues, TaxDeclarationValuePO.class); + // 鍒嗘壒淇濆瓨 + List> partition = Lists.partition(taxDeclarationValues, 100); + for (List subTaxDeclarationValues : partition) { + subTaxDeclarationValues.forEach(getTaxDeclarationValueMapper()::updateIgnoreNull); + } + } + } + + @Override + public void save(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤琛ㄤ笉瀛樺湪锛"); + } + + Long taxDeclareRecordId = taxDeclaration.getTaxDeclareRecordId(); + TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId); + if (declareRecordPO == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + TaxDeclarationValuePO po = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclarationId(param.getTaxDeclarationId()).taxDeclareRecordId(taxDeclareRecordId).employeeId(param.getEmployeeId()).employeeType(param.getEmployeeType()).resultValue(param.getTaxReportColumnValues()).resultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())).createTime(new Date()).updateTime(new Date()).source(SourceEnum.ADD.getValue()).creator((long) user.getUID()).deleteType(0).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + getTaxDeclarationValueMapper().insertIgnoreNull(po); + + //鏂板骞寸粓濂 + if (IncomeCategoryEnum.ONETIME_ANNUAL_BONUS.getValue().equals(taxDeclaration.getIncomeCategory())) { + autoAddWagesDeclare(declareRecordPO); + } + } + + @Override + public void edit(TaxDeclareRecordDetailSaveParam param) { + TaxDeclarationValuePO po = getById(param.getId()); + po.setResultValue(param.getTaxReportColumnValues()); + po.setResultValueJson(JsonUtil.toJsonString(param.getTaxReportColumnValues())); + po.setUpdateTime(new Date()); + po.setSource(SourceEnum.EDIT.getValue()); + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + getTaxDeclarationValueMapper().updateIgnoreNull(po); + } + + @Override + public TaxDeclarationValuePO getById(Long id) { + TaxDeclarationValuePO po = getTaxDeclarationValueMapper().getById(id); + if (po == null) { + throw new SalaryRunTimeException("涓◣鐢虫姤鏄庣粏涓嶅瓨鍦紒"); + } + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); + po.setResultValue(JsonUtil.parseMap(po.getResultValueJson(), String.class)); + + return po; + } + @Override public void deleteByTaxDeclareRecordIds(Collection taxDeclareRecordIds) { if (CollectionUtils.isEmpty(taxDeclareRecordIds)) { @@ -150,4 +232,182 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar }); return taxDeclarationValues; } + + + @Override + public void autoAddWagesDeclare(TaxDeclareRecordPO taxDeclareRecord) { + + Long taxDeclareRecordId = taxDeclareRecord.getId(); + Date now = new Date(); + + //闈炴甯歌柂璧勭殑浜哄憳 + List notWagesEmpIds = getTaxDeclarationValueMapper().queryNotWagesEmpIds(taxDeclareRecordId); + if (CollectionUtils.isEmpty(notWagesEmpIds)) { + return; + } + + //姝e父钖祫浜哄憳 + List wagesEmpIds = getTaxDeclarationValueMapper().queryWagesEmpIds(taxDeclareRecordId); + + //姣旇緝宸紓 + List autoAddIds = notWagesEmpIds.stream().filter(id -> !wagesEmpIds.contains(id)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(autoAddIds)) { + return; + } + + //姝e父钖祫鐨勮〃澶 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES, 0); + Map valueMap = Maps.newHashMap(); + for (TaxReportColumnPO taxReportColumn : taxReportColumns) { + String value = Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : ""; + valueMap.put(taxReportColumn.getReportColumnDataIndex(), value); + } + + //褰撳墠鐢虫姤琛ㄦ槸鍚﹀惈姝e父鐢虫姤 + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId, IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()); + TaxDeclarationPO taxDeclarationPO; + if (CollectionUtils.isNotEmpty(list)) { + if (list.size() > 1) { + throw new SalaryRunTimeException("瀛樺湪澶氭潯姝e父宸ヨ祫钖噾鐢虫姤琛ㄦ暟鎹"); + } + taxDeclarationPO = list.get(0); + } else { + taxDeclarationPO = TaxDeclarationPO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclareRecordId).incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()).taxAgentId(taxDeclareRecord.getTaxAgentId()).salaryMonth(taxDeclareRecord.getSalaryMonth()).taxCycle(taxDeclareRecord.getTaxCycle()).description(taxDeclareRecord.getRemark()).controlView(0).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).build(); + List taxList = new ArrayList<>(); + getTaxDeclarationService(user).saveBatch(taxList); + } + + //缁勮鏁版嵁锛岃嚜鍔ㄨˉ瓒 + List autoAddValuePOs = autoAddIds.stream().map((empId -> { + TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder().id(IdGenerator.generate()).taxDeclareRecordId(taxDeclarationPO.getTaxDeclareRecordId()).taxDeclarationId(taxDeclarationPO.getId()).employeeType(0).employeeId(empId).resultValue(valueMap).tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).creator((long) user.getUID()).deleteType(DeleteTypeEnum.NOT_DELETED.getValue()).createTime(now).updateTime(now).source(SourceEnum.AUTO.getValue()).build(); + return taxDeclarationValue; + })).collect(Collectors.toList()); + batchSave(autoAddValuePOs); + } + + @Override + public Map contrast(ContrastQueryParam param) { + + + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + if (taxDeclaration == null) { + throw new SalaryRunTimeException("鏃犵敵鎶ヨ〃"); + } + + TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclaration.getTaxDeclareRecordId()); + if (taxDeclareRecordPO == null) { + throw new SalaryRunTimeException("鐢虫姤璁板綍涓嶅瓨鍦紒"); + } + + + //绾夸笂鏁版嵁 + DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId()); + + Map>> onlineDataMap = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId()); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse)); + + Map resultList = new HashMap<>(); + List taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId()); + + // 鏌ヨ涓◣鐢虫姤琛ㄨ〃澶 + IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class); + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum); + List columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList()); + // 浜哄憳id + Set employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId); + // 鏌ヨ鎶ラ佺殑浜哄憳 + List employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds); + // 鏌ヨ浜哄憳淇℃伅 + List simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList()); + List simpleEmployees = getSalaryEmployeeService(user).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> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true); + + + Map> localMap = new HashMap<>(); + for (Map map : localList) { + String no = map.getOrDefault("璇佷欢鍙风爜", "").toString(); + localMap.put(no, map); + } + + List> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel()); + List heads = onlineData.get(0); + List> data = onlineData.subList(1, onlineData.size()); + List> onlineMap = new ArrayList<>(); + for (int i = 0; i < data.size(); i++) { + List row = data.get(i); + Map m = new HashMap<>(); + for (int j = 0; j < heads.size(); j++) { + String key = heads.get(j).toString(); + m.put(key, row.get(j)); + } + onlineMap.add(m); + } + + Map> onlineNoMap = new HashMap<>(); + for (Map map : onlineMap) { + String no = map.getOrDefault("璇佷欢鍙风爜", "").toString(); + onlineNoMap.put(no, map); + } + + Set onlyShowColumns = new HashSet<>(); + List> oneResultList = new ArrayList<>(); + for (Map local : localList) { + AtomicBoolean hasDiff = new AtomicBoolean(false); + Map result = new HashMap<>(); + result.put("濮撳悕", local.get("濮撳悕")); + result.put("璇佷欢绫诲瀷", local.get("璇佷欢绫诲瀷")); + result.put("璇佷欢鍙风爜", local.get("璇佷欢鍙风爜")); + String no = local.getOrDefault("璇佷欢鍙风爜", "").toString(); + Map online = onlineNoMap.get(no); + + taxReportColumns.stream().map(TaxReportColumnPO::getReportColumnName).forEach(col -> { + ContrastListDTO dto = new ContrastListDTO(); + // 绯荤粺鍊 + String localValue = Util.null2String(local.get(col)); + // 绾夸笂鍊 + String onlineValue = Util.null2String(online.get(col)); + dto.setLocal(localValue); + dto.setOnline(onlineValue); + if (NumberUtil.isNumber(localValue) && NumberUtil.isNumber(onlineValue)) { + BigDecimal diff = new BigDecimal(localValue).subtract(new BigDecimal(onlineValue)); + if (diff.compareTo(new BigDecimal(0)) != 0) { + dto.setDiff(diff); + onlyShowColumns.add(col); + hasDiff.set(true); + } + } else { + if (!Objects.equals(localValue, onlineValue)) { + dto.setDiff(localValue); + onlyShowColumns.add(col); + hasDiff.set(true); + } + } + result.put(col, dto); + }); + if (param.isOnlyShowDiffEmp()) { + if (hasDiff.get()) { + oneResultList.add(result); + } + } else { + oneResultList.add(result); + } + } + resultList.put("columns", param.isOnlyShowDiffItem() ? onlyShowColumns : columns); + resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList)); + return resultList; + } + + @Override + public void deleteById(Long deleteId) { + getTaxDeclarationValueMapper().deleteByIds(Collections.singletonList(deleteId)); + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java index 109ef366c..f9ea9de2f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java @@ -26,6 +26,7 @@ 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.DeclareTaxResultFeedbackQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.*; @@ -35,16 +36,19 @@ 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.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum; import com.engine.salary.enums.taxdeclaration.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper; import com.engine.salary.remote.tax.client.DeclareClient; +import com.engine.salary.remote.tax.response.employee.GetDeclareTaxResultFeedbackResponse; 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.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.ImmutableMap; @@ -54,7 +58,7 @@ 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 org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.general.Util; import weaver.hrm.User; @@ -304,6 +308,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } + //琛ュ厖姝e父宸ヨ祫钖噾鐨勭敵鎶ヤ汉鍛 + newTaxDeclareRecords.forEach(taxDeclareRecordPO -> { + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecordPO); + }); + + //鏇存柊鏍哥畻璁板綍鐘舵 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); // // 璁板綍鏃ュ織 @@ -323,7 +333,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } @Override - @Transactional(rollbackFor = Exception.class) public void refreshData(Long id) { // 鏌ヨ涓◣鐢虫姤璁板綍 TaxDeclareRecordPO taxDeclareRecord = getById(id); @@ -372,6 +381,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } + //琛ュ厖姝e父宸ヨ祫钖噾鐨勭敵鎶ヤ汉鍛 + getTaxDeclarationValueService(user).autoAddWagesDeclare(taxDeclareRecord); + //鏇存柊鏍哥畻璁板綍鐘舵 getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED); } @@ -411,7 +423,15 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 钖祫鏍哥畻缁撴灉 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); + 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()); @@ -657,6 +677,8 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue()); taxDeclareRecord.setRequestId(declareTaxResponse.getBody().getRequestId()); taxDeclareRecord.setUpdateTime(new Date()); + //娓呴櫎涔嬪墠鐨勯敊璇 + taxDeclareRecord.setTaxDeclareErrorMsg(""); getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); // 鍒犻櫎涓◣鐢虫姤鐢虫姤澶辫触鐨勬暟鎹 getTaxDeclareFailService(user).deleteByTaxDeclareRecordIds(Collections.singleton(taxDeclareRecord.getId())); @@ -697,7 +719,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe throw new SalaryRunTimeException(declareTaxFeedbackResponse.getHead().getMsg()); } // 鐢虫姤鍙嶉鐘舵 - Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), 0); + Integer declareFeedbackStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("fkztbj"), -1); DeclareFeedBackStatusEnum declareFeedBackStatusEnum = SalaryEnumUtil.enumMatchByValue(declareFeedbackStatus, DeclareFeedBackStatusEnum.class); if (declareFeedBackStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); @@ -739,12 +761,12 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe } } taxDeclareRecord.setTaxDeclareErrorMsg(String.join(",", errorMsg)); - }else { + } else { //娓呴櫎涔嬪墠鐨勯敊璇 taxDeclareRecord.setTaxDeclareErrorMsg(""); } // 鐢虫姤鐘舵 - Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), 0); + Integer declareStatus = SalaryEntityUtil.getIntValue(declareTaxFeedbackResponse.getBody().get("sbztbj"), -1); TaxDeclareStatusEnum taxDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(declareStatus, TaxDeclareStatusEnum.class); if (taxDeclareStatusEnum == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156509, "鏈嶅姟寮傚父锛屾帴鍙h繑鍥炴暟鎹湁璇")); @@ -757,6 +779,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 鐢虫姤绫诲瀷 taxDeclareRecord.setTaxPayAmount(Util.null2String(declareTaxFeedbackResponse.getBody().get("ykjse"))); taxDeclareRecord.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString())); + taxDeclareRecord.setDeclareRequestId(taxDeclareRecord.getRequestId()); taxDeclareRecord.setRequestId(""); taxDeclareRecord.setUpdateTime(new Date()); BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()); @@ -826,7 +849,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // 鐢虫姤绫诲瀷 requestParam.put("sblx", "1"); // 浣滃簾閾惰仈缂存鍑瘉 - taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); +// taxPaymentServiceFactory.get(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue()).cancelWithholdingVoucher(apiConfig, taxDeclareRecord, requestParam); // 鏄惁娓呯┖鎵寰 requestParam.put("sfqksd", "0"); // 璇锋眰 @@ -921,7 +944,28 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); - return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getRequestId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId()); + } + + @Override + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + Long id = param.getId(); + String requestId = param.getRequestId(); + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); + + DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId()); + GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? taxDeclareRecord.getDeclareRequestId() : requestId); + + Map>> map = new HashMap<>(); + List list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id); + list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse)); + return ExcelUtil.genWorkbookV2(map); } @@ -976,6 +1020,58 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe // taxDeclarationLoggerTemplate.write(loggerContext); } + + @Override + public void cancelCorrect(Long id) { + TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); + TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord(); +// List taxDeclareStatusEnumValueList = Lists.newArrayList(TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue(), TaxDeclareStatusEnum.DECLARE_SUCCESS_PAYING.getValue()); +// if (!taxDeclareStatusEnumValueList.contains(taxDeclareRecord.getTaxDeclareStatus())) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(182702, "瀵逛笉璧凤紝鍙湁鐢虫姤鎴愬姛鍚庢墠鍏佽鏇存鐢虫姤")); +// } + // 渚涘簲鍟嗕俊鎭 + TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig(); + // 娉ㄥ唽鐨勪紒涓氫俊鎭-->璇锋眰鍙傛暟 + Map requestParam = taxDeclareRequest.getRequestParam(); + // 绋庢鎵灞炴湡 + requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle())); + // 鐢虫姤绫诲瀷 + requestParam.put("sblx", "1"); + // 璇锋眰 + String reqJson = JsonUtil.toJsonString(requestParam); + log.info("鎾ら攢鏇存鐢虫姤璇锋眰鏁版嵁锛" + reqJson); + String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_CORRECT; + Map params = new HashMap<>(1); + Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret()); + String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE); + log.info("鎾ら攢鏇存鐢虫姤杩斿洖鏁版嵁锛" + res); + UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class); + if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "鏈嶅姟寮傚父")); + } + if (!Objects.equals(updateDeclareResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + throw new SalaryRunTimeException(updateDeclareResponse.getHead().getMsg()); + } +// taxDeclareRecord.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue()); +// taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue()); +// taxDeclareRecord.setRequestId(""); +// taxDeclareRecord.setUpdateTime(new Date()); +// getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); + + // 璁板綍鏃ュ織 +// TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent(); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId(String.valueOf(taxDeclareRecord.getId())); +// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(203562, "涓◣鎵g即涔夊姟浜恒寋0}銆嶇◣娆炬墍灞炴湡銆寋1}銆") +// .replace("{0}", taxAgent.getName()) +// .replace("{1}", taxDeclareRecord.getTaxCycle())); +// loggerContext.setOperator(Util.null2String(employeeId)); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(177637, "鏇存鐢虫姤")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(177637, "鏇存鐢虫姤")); +// taxDeclarationLoggerTemplate.write(loggerContext); + } + @Override public String queryDeclareStatus(Long id) { TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id); @@ -1020,11 +1116,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe return res; } + @Override public void updateById(TaxDeclareRecordPO taxDeclareRecord) { getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord); } + private TaxDeclareRequest buildTaxDeclareRequest(Long id) { // 鏌ヨ渚涘簲鍟嗕俊鎭 TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true); diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java index 4e6c5180e..eab790615 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingServiceImpl.java @@ -117,7 +117,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - if (paymentRequestPO != null) { +// 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) @@ -132,7 +132,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - } +// } } protected BaseResponse getFeedbackResponse(TaxDeclarationApiConfigPO apiConfig, String requestId) { diff --git a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java index 048f286ab..44e895087 100644 --- a/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxPaymentWithholdingVoucherServiceImpl.java @@ -113,7 +113,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - if (paymentRequestPO != null) { +// 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) @@ -126,7 +126,7 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS .taxAgentId(taxDeclareRecord.getTaxAgentId()) .taxYearMonth(taxDeclareRecord.getTaxCycle()) .build()); - } +// } } @Override diff --git a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java index 1ddd88cdc..30ebbe9d5 100644 --- a/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxReportColumnServiceImpl.java @@ -7,6 +7,7 @@ import com.engine.salary.mapper.taxdeclaration.TaxReportColumnMapper; import com.engine.salary.service.TaxReportColumnService; import com.engine.salary.util.db.MapperProxyFactory; +import java.util.Arrays; import java.util.List; /** @@ -17,7 +18,7 @@ import java.util.List; * @author qiantao * @version 1.0 **/ -public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { +public class TaxReportColumnServiceImpl extends Service implements TaxReportColumnService { private TaxReportColumnMapper getTaxReportColumnMapper() { return MapperProxyFactory.getProxy(TaxReportColumnMapper.class); @@ -26,11 +27,11 @@ public class TaxReportColumnServiceImpl extends Service implements TaxReportCol @Override public List listAll() { - return getTaxReportColumnMapper().listAll(); + return getTaxReportColumnMapper().listAll(); } @Override - public List listByIncomeCategory(IncomeCategoryEnum incomeCategory) { - return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().incomeCategory(incomeCategory.getValue().toString()).build()); + public List listByIncomeCategory(IncomeCategoryEnum incomeCategory, Integer... contrastTypes) { + return getTaxReportColumnMapper().listSome(TaxReportColumnPO.builder().contrastTypes(Arrays.asList(contrastTypes)).incomeCategory(incomeCategory.getValue().toString()).build()); } } diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index c5b6b08db..afe54d3c0 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -105,4 +105,14 @@ public class SalarySysConstant { * 鏍哥畻鍥哄畾鍒楀ご鏁 */ public static final String SALARY_ACCT_FIXED_COLUMNS = "salaryAcctFixedColumns"; + + /** + * 搴旂敤璁剧疆鏄惁绂忓埄妗f鍩烘暟鍖哄垎涓汉鍜屽崟浣 + */ + public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom"; + + /** + * 搴旂敤璁剧疆鏄惁绂忓埄妗f瀵煎叆鏃讹紝涓嶇鍚堜笂涓嬮檺鐨勫熀鏁拌皟鏁翠负涓婇檺 /涓嬮檺 + */ + public static final String WEL_BASE_AUTO_ADJUST = "welBaseAutoAdjust"; } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 790822d90..1f6275f7e 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -761,8 +761,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesSocialSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); } else { po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesSocialSchemePos, 50); @@ -788,8 +790,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesFundSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); } else { po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesFundSchemePos, 50); @@ -815,8 +819,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesOtherSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); } else { po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesOtherSchemePos, 50); @@ -875,6 +881,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo)); po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo)); po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo)); @@ -893,6 +902,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson())); po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum())); po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson())); diff --git a/src/com/engine/salary/util/excel/DataTypeEnum.java b/src/com/engine/salary/util/excel/DataTypeEnum.java new file mode 100644 index 000000000..15e845cd9 --- /dev/null +++ b/src/com/engine/salary/util/excel/DataTypeEnum.java @@ -0,0 +1,32 @@ +package com.engine.salary.util.excel; + +import java.util.Arrays; +import java.util.Objects; + +public enum DataTypeEnum { + string("string", "瀛楃绫诲瀷"), + number("string", "鏁板瓧绫诲瀷"), + date("string", "鏃ユ湡绫诲瀷"); + + private String value; + private String name; + + DataTypeEnum(String value, String name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return value; + } + + public String getName() { + return name; + } + + + public static DataTypeEnum parseByValue(String value) { + return Arrays.stream(DataTypeEnum.values()).filter(typeEnum -> Objects.equals(typeEnum.getValue(), value)).findFirst().orElse(null); + } + +} diff --git a/src/com/engine/salary/util/excel/ExcelHead.java b/src/com/engine/salary/util/excel/ExcelHead.java new file mode 100644 index 000000000..cec7da51d --- /dev/null +++ b/src/com/engine/salary/util/excel/ExcelHead.java @@ -0,0 +1,28 @@ +package com.engine.salary.util.excel; + +import java.lang.annotation.*; + +/** + * 鏁版嵁鍒楄〃琛ㄥご + *

Copyright: Copyright (c) 2022

+ *

Company: 娉涘井杞欢

+ * + * @author qiantao + * @version 1.0 + **/ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelHead { + + String title() default ""; + + String dataIndex() default ""; + + DataTypeEnum dataType() default DataTypeEnum.string; + + int labelId() default -1; + + String width() default ""; + +} diff --git a/src/com/engine/salary/util/excel/ExcelSheetData.java b/src/com/engine/salary/util/excel/ExcelSheetData.java index f4cf615ea..87a827d55 100644 --- a/src/com/engine/salary/util/excel/ExcelSheetData.java +++ b/src/com/engine/salary/util/excel/ExcelSheetData.java @@ -8,7 +8,7 @@ import java.util.List; public class ExcelSheetData { private String sheetName; - private List headers; + 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 8c271981a..53b79fba8 100644 --- a/src/com/engine/salary/util/excel/ExcelUtil.java +++ b/src/com/engine/salary/util/excel/ExcelUtil.java @@ -1,6 +1,9 @@ package com.engine.salary.util.excel; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.FillPatternType; @@ -9,8 +12,9 @@ import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.*; import java.awt.*; -import java.util.*; +import java.lang.reflect.Field; import java.util.List; +import java.util.*; public class ExcelUtil { /** @@ -268,10 +272,131 @@ public class ExcelUtil { return workbook; } + public static XSSFWorkbook genWorkbookV2(Map>> map) { + XSSFWorkbook workbook = new XSSFWorkbook(); + + map.entrySet().forEach(en->{ + + String sheetName = en.getKey(); + List> rowList = en.getValue(); + // 璁剧疆title鏍峰紡 + XSSFCellStyle titleCellStyle = workbook.createCellStyle(); + XSSFFont titleFont = workbook.createFont(); + titleFont.setFontName("浠垮畫"); + titleFont.setFontHeightInPoints((short) 15); + titleCellStyle.setFont(titleFont); + titleCellStyle.setAlignment(HorizontalAlignment.CENTER); + titleCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//鑳屾櫙鑹 + titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + + + // 璁剧疆涓讳綋鏍峰紡 + XSSFCellStyle cellStyle = workbook.createCellStyle(); + XSSFFont font = workbook.createFont(); + font.setFontName("瀹嬩綋"); + font.setFontHeightInPoints((short) 10);// 璁剧疆瀛椾綋澶у皬 + cellStyle.setFont(font);// 閫夋嫨闇瑕佺敤鍒扮殑瀛椾綋鏍煎紡 + cellStyle.setWrapText(true); + + XSSFSheet sheet = workbook.createSheet(sheetName); + //鑷傚簲瀹藉害 + sheet.autoSizeColumn(0, true); + //榛樿鍒楀 + sheet.setDefaultColumnWidth(20); + //榛樿琛岄珮 + sheet.setDefaultRowHeightInPoints(18); + + for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) { + List infoList = rowList.get(rowIndex); + XSSFRow row = sheet.createRow(rowIndex); + for (int cellIndex = 0; cellIndex < infoList.size(); cellIndex++) { + XSSFCell cell = row.createCell(cellIndex); + if (rowIndex == 0) { + cell.setCellStyle(titleCellStyle); + } else { + cell.setCellStyle(cellStyle); + } + Object o = infoList.get(cellIndex); + if (o instanceof String) { + cell.setCellType(CellType.STRING); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Boolean) { + cell.setCellType(CellType.BOOLEAN); + cell.setCellValue(String.valueOf(o)); + } else if (o instanceof Date) { + cell.setCellType(CellType.STRING); + cell.setCellValue(SalaryDateUtil.getFormatLocalDate((Date) o)); + } else { + cell.setCellType(CellType.STRING); + cell.setCellValue(o == null ? "" : o.toString()); + } + } + } + }); + + return workbook; + } + public static XSSFWorkbook genWorkbook(ExcelSheetData excelSheetData) { List> list = new ArrayList<>(); - list.add(Collections.singletonList(excelSheetData.getHeaders())); - list.addAll( excelSheetData.getRows()); + list.add(excelSheetData.getHeaders()); + list.addAll(excelSheetData.getRows()); return genWorkbookV2(list, excelSheetData.getSheetName()); } + + + public static Map> getHeader(Class clazz) { + Map> headerMap = new HashMap<>(); + // 瀵煎嚭鐨勮〃澶 + List headerList = Lists.newArrayList(); + List dataIndexList = Lists.newArrayList(); + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { + continue; + } + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(annotation.title()); + dataIndexList.add(annotation.dataIndex()); + } + headerMap.put("header", headerList); + headerMap.put("dataIndex", dataIndexList); + return headerMap; + } + + public static List> getExcelSheetData(Class clazz, List dtoList) { + // 瀵煎嚭鐨勮〃澶 + Map> headerMap = getHeader(clazz); + // 瀵煎嚭鐨勬暟鎹 + List> rows = new ArrayList<>(); + rows.add(headerMap.get("header")); + dtoList.forEach(dto -> { + Map map = JsonUtil.parseMap(dto, Object.class); + List row = Lists.newArrayListWithExpectedSize(headerMap.get("dataIndex").size()); + headerMap.get("dataIndex").forEach(dataIndex -> row.add(map.get(dataIndex))); + rows.add(row); + }); + return rows; + } + + + /** + * 瑙f瀽琛ㄥご + * + * @param clazz + * @param headerList + * @param dataIndexList + * @param + */ + public static void parseHeader(Class clazz, List headerList, List dataIndexList) { + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field declaredField : declaredFields) { + if (!declaredField.isAnnotationPresent(ExcelHead.class)) { + continue; + } + ExcelHead annotation = declaredField.getAnnotation(ExcelHead.class); + headerList.add(SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.title())); + dataIndexList.add(declaredField.getName()); + } + } } diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index 201dd799f..8f681714a 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -4,6 +4,9 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; +import java.awt.*; +import java.awt.font.FontRenderContext; +import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -39,8 +42,8 @@ public class SalaryPageUtil { return pageInfo; } - public static PageInfo buildPage(Integer pageNo, Integer pageSize,List totalCollection) { - PageInfo pageInfo = new PageInfo<>(); + public static PageInfo buildPage(Integer pageNo, Integer pageSize, List totalCollection) { + PageInfo pageInfo = new PageInfo<>(); pageInfo.setTotal(totalCollection.size()); totalCollection = subList(pageNo, pageSize, totalCollection); pageInfo.setPageNum(pageNo); @@ -94,6 +97,26 @@ public class SalaryPageUtil { } + static Font font = new Font("Arial", Font.PLAIN, 12); // 璁剧疆瀛椾綋鏍峰紡銆佸ぇ灏忕瓑灞炴 + static FontRenderContext frc = new FontRenderContext(null, true, false); +// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + + /** + * 鑷傚簲鏂囧瓧闀垮害 + * @param chars + * @param width + * @return + */ + public static String selfAdaption(String chars, Integer width) { + if (width != null && width != 0) { + return width + ""; + } + Rectangle2D bounds = font.getStringBounds(chars, frc); + int pxLength = (int) Math.ceil(bounds.getWidth()); + return pxLength + 55 + ""; + } + + 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()); diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index d63e336be..fa54d79f3 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -272,19 +272,81 @@ public class EmployeeDeclareController { } /** - * 浜哄憳鎶ラ-瀵煎嚭鍏ㄩ儴浜哄憳 + * 浜哄憳鎶ラ-涓嬭浇瀵煎叆妯℃澘 * * @param queryParam 瀵煎嚭鍙傛暟 * @return */ @POST - @Path("/export") + @Path("/exportTemplate") @Produces(MediaType.APPLICATION_OCTET_STREAM) - public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) { + public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { try { User user = HrmUserVarify.getUser(request, response); - XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(queryParam); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).exportTemplate(queryParam); + String fileName = "浜哄憳淇℃伅閲囬泦瀵煎叆妯℃澘-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + } catch (Exception e) { + log.error("浜哄憳鎶ラ-浜哄憳淇℃伅閲囬泦瀵煎叆妯℃澘寮傚父", e); + throw e; + } + } + + /** + * 浜哄憳鎶ラ-瀵煎叆棰勮 + * + * @param queryParam 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::preview, queryParam); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆 + * + * @param queryParam 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_JSON) + public String importData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareImportParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getEmployeeDeclareWrapper(user)::importData, queryParam); + } + + + /** + * 浜哄憳鎶ラ-瀵煎嚭鍏ㄩ儴浜哄憳 + * + * @param param 瀵煎嚭鍙傛暟 + * @return + */ + @POST + @Path("/export") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam param) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getEmployeeDeclareWrapper(user).export(param); String fileName = "浜哄憳淇℃伅閲囬泦-" + LocalDate.now(); try { fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 75ad6975a..ab9a41c9c 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO; @@ -37,11 +38,9 @@ import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.time.LocalDate; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 绂忓埄鏍哥畻鎺у埗鍣 @@ -50,6 +49,7 @@ import java.util.stream.Collectors; public class SIAccountController { public SIAccountService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIAccountServiceImpl.class, user); } diff --git a/src/com/engine/salary/web/SIArchivesController.java b/src/com/engine/salary/web/SIArchivesController.java index ecc61b1b5..e0b3bfe89 100644 --- a/src/com/engine/salary/web/SIArchivesController.java +++ b/src/com/engine/salary/web/SIArchivesController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam; @@ -33,6 +34,7 @@ import java.util.Map; public class SIArchivesController { private SIArchivesService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIArchivesServiceImpl.class,user); } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 561ff9f61..0e597c943 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -167,6 +167,7 @@ public class SalaryAcctController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::backCalculate, param.getSalaryAcctRecordId()); } + /* ********************************钖祫鏍哥畻璁板綍鐩稿叧 end*********************************/ @@ -466,6 +467,15 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::updateLockStatusByParam, param); } + //鎵归噺鏇存柊 + @POST + @Path("/acctresult/batchUpdate") + @Produces(MediaType.APPLICATION_JSON) + public String batchUpdate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchUpdateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::batchUpdate, param); + } + //钖祫鏍哥畻 @POST @Path("/acctresult/accounting") diff --git a/src/com/engine/salary/web/TaxDeclarationController.java b/src/com/engine/salary/web/TaxDeclarationController.java index ba563895b..d584782ed 100644 --- a/src/com/engine/salary/web/TaxDeclarationController.java +++ b/src/com/engine/salary/web/TaxDeclarationController.java @@ -31,6 +31,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Collection; import java.util.List; @@ -133,7 +134,7 @@ public class TaxDeclarationController { } /** - * 鍒犻櫎涓◣鐢虫姤琛 + * 鍒犻櫎涓◣鐢虫姤璁板綍 * * @param ids 涓◣鐢虫姤璁板綍id * @return @@ -174,6 +175,37 @@ public class TaxDeclarationController { return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::getTaxDeclarationTab, id); } + /** + * 鏂板涓◣鐢虫姤璁板綍涓嬬殑涓◣鐢虫姤琛═AB + * + * @param param 涓◣鐢虫姤璁板綍id + * @return + */ + @POST + @Path("/addTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String addTaxDeclarationTab(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationAddParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::addTaxDeclaration, param); + } + + /** + * 鍒犻櫎鐢虫姤琛 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteTaxDeclaration") + @Produces(MediaType.APPLICATION_JSON) + public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, TaxDeclarationDeleteParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteTaxDeclaration, param); + } + + /** * 鍦ㄧ嚎鐢虫姤 * @@ -211,11 +243,59 @@ public class TaxDeclarationController { @GET @Path("/getDeclareTaxResultFeedback") @Produces(MediaType.APPLICATION_JSON) - public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getDeclareTaxResultFeedback, id); } + /** + * 鐢虫姤鍐呯疆绠楃◣缁撴灉 + * + * @return + */ + @POST + @Path("/exportGetDeclareTaxResultFeedback") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeclareTaxResultFeedbackQueryParam param) { + + try { + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(param); + String fileName = "鐢虫姤鍐呯疆绠楃◣缁撴灉-" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + } catch (Exception e) { + log.error("鐢虫姤鍐呯疆绠楃◣缁撴灉瀵煎嚭寮傚父", e); + throw e; + } + } + + /** + * 瀵规瘮绠楃◣杩囩▼ + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/contrast") + @Produces(MediaType.APPLICATION_JSON) + public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ContrastQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param); + } + /** * 浣滃簾 @@ -259,6 +339,20 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::updateDeclare, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 鎾ら攢鏇存鐢虫姤锛岀◣灞瀛樺湪閫昏緫闂銆傝鏇存鐢虫姤锛屽厛鍐嶈蛋鐢虫姤澶勭悊 + * + * @param taxDeclareRecordParam 鎾ら攢鏇存鐢虫姤鍙傛暟 + * @return + */ + @POST + @Path("/cancelCorrect") + @Produces(MediaType.APPLICATION_JSON) + public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId()); + } + /** * 绋庡眬绔敵鎶ョ姸鎬佹煡璇 * @@ -287,6 +381,7 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** * 鍒锋柊鏁版嵁 * @@ -301,6 +396,88 @@ public class TaxDeclarationController { return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::refreshData, taxDeclareRecordParam.getTaxDeclareRecordId()); } + /** + * 鏂板琛ㄥ崟 + * + * @param param + * @return + */ + @POST + @Path("/getAddForm") + @Produces(MediaType.APPLICATION_JSON) + public String getAddForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailFormParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::getAddForm, param); + } + + /** + * 鏂板 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/add") + @Produces(MediaType.APPLICATION_JSON) + public String add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::add, param); + } + + + /** + * 缂栬緫 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/edit") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::edit, param); + } + + /** + * 鑾峰彇璇︾粏璇︾粏 + * + * @param request + * @param response + * @param id + * @return + */ + @GET + @Path("/detailInfo") + @Produces(MediaType.APPLICATION_JSON) + public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::detailInfo, id); + } + + /** + * 鍒犻櫎璇︾粏璇︾粏 + * + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/deleteInfo") + @Produces(MediaType.APPLICATION_JSON) + public String deleteInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordDetailSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxDeclareRecordWrapper(user)::deleteInfo, param.getId()); + } + + + + /** * 涓◣鐢虫姤琛ㄨ鎯呭垪琛 * @@ -345,9 +522,7 @@ public class TaxDeclarationController { }; 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); throw e; @@ -466,7 +641,7 @@ public class TaxDeclarationController { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NotDeclare(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156420, "鏈姤閫佺殑浜哄憳") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); @@ -482,9 +657,7 @@ public class TaxDeclarationController { }; 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); throw e; @@ -503,7 +676,7 @@ public class TaxDeclarationController { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4NoValue(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156421, "缂哄皯鐢虫姤鏁版嵁鐨勪汉鍛") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); @@ -519,9 +692,7 @@ public class TaxDeclarationController { }; 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); throw e; @@ -539,7 +710,7 @@ public class TaxDeclarationController { public Response exportEmployee4Fail(@Context HttpServletRequest request, @Context HttpServletResponse response) { try { User user = HrmUserVarify.getUser(request, response); - AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); + AbnormalEmployeeListQueryParam queryParam = genAbnormalEmployeeListQueryParam(request); XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportEmployee4Fail(queryParam); String fileName = SalaryI18nUtil.getI18nLabel(156422, "鐢虫姤澶辫触浜哄憳") + "-" + SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); @@ -555,13 +726,57 @@ public class TaxDeclarationController { }; 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); throw e; } } + @POST + @Path("/downloadTemplate") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response downloadTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam param) { + try { + User user = HrmUserVarify.getUser(request, response); + + XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).downloadTemplate(param); + + String fileName = "鐢虫姤琛ㄥ鍏ユā鏉" + LocalDate.now(); + + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error(e.getMessage(), e); + } + + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + + } catch (Exception e) { + log.error("鐢虫姤琛ㄥ鍏ユā鏉垮鍑哄紓甯", e); + throw e; + } + } + + @POST + @Path("/preview") + @Produces(MediaType.APPLICATION_JSON) + public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::preview, importParam); + } + + @POST + @Path("/importData") + @Produces(MediaType.APPLICATION_JSON) + public String importAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DownloadTemplateParam importParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxDeclareRecordWrapper(user)::importData, importParam); + } + } diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 5c8fb6c19..39623bb5a 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -558,13 +558,43 @@ public class EmployeeDeclareWrapper extends Service { } /** - * 浜哄憳鎶ラ-瀵煎嚭鏈湀鍏ㄩ儴鐨勪汉鍛 + * 浜哄憳鎶ラ-涓嬭浇瀵煎叆妯℃澘 * - * @param queryParam + * @param param * @return */ - public XSSFWorkbook export(EmployeeDeclareListQueryParam queryParam) { - return getEmployeeDeclareExcelService(user).export(queryParam); + public XSSFWorkbook exportTemplate(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).exportTemplate(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆鏁版嵁 + * + * @param param + * @return + */ + public Map preview(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).preview(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎叆鏁版嵁 + * + * @param param + * @return + */ + public Map importData(EmployeeDeclareImportParam param) { + return getEmployeeDeclareExcelService(user).importData(param); + } + + /** + * 浜哄憳鎶ラ-瀵煎嚭鏈湀鍏ㄩ儴鐨勪汉鍛 + * + * @param param + * @return + */ + public XSSFWorkbook export(EmployeeDeclareListQueryParam param) { + return getEmployeeDeclareExcelService(user).export(param); } // /** diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index 3c108c815..bfd0e6784 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -9,10 +9,7 @@ import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.po.WorkflowItemHidePO; import com.engine.salary.enums.salaryaccounting.LockStatusEnum; @@ -319,6 +316,13 @@ public class SalaryAcctResultWrapper extends Service { return getSalaryAcctResultService(user).checkAuth(salaryAcctRecordId); } + /** + * 钖祫鏍哥畻缁撴灉鎵归噺鏇存柊 + * @param param + */ + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { + getSalaryAcctResultService(user).batchUpdate(param); + } /** diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index aa39752db..d98b8a419 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -2,35 +2,14 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.component.WeaFormOption; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO; -import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; -import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; -import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; -import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; -import com.engine.salary.util.SalaryDateUtil; -import com.engine.salary.util.SalaryEntityUtil; -import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.PageInfo; -import com.google.common.collect.Lists; -import org.apache.commons.collections4.CollectionUtils; import weaver.hrm.User; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - /** * 涓◣鐢虫姤琛 *

Copyright: Copyright (c) 2022

@@ -53,106 +32,4 @@ public class TaxDeclarationWrapper extends Service { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } - /** - * 涓◣鐢虫姤琛ㄥ垪琛 - * - * @param queryParam 鍒楄〃鏌ヨ鏉′欢 - * @param - * @return - */ - public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { - // 璇釜绋庣敵鎶ヨ〃锛堝垎椤碉級 - PageInfo page = getTaxDeclarationService(user).listPageByParam(queryParam); - PageInfo dtoPage = new PageInfo(TaxDeclarationListDTO.class); - dtoPage.setPageNum(queryParam.getCurrent()); - dtoPage.setPageSize(queryParam.getPageSize()); - dtoPage.setTotal(page.getTotal()); - List list = page.getList(); - if (CollectionUtils.isNotEmpty(list)) { - // 鏌ヨ浜哄憳 - List employeeIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getCreator, Collectors.toList()); - List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); - // 鏌ヨ涓◣鎵g即涔夊姟浜 - Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getTaxAgentId); - List taxAgentPOS = getTaxDeclarationService(user).countByTaxDeclarationId(taxAgentIds); - // 杞崲鎴愬垪琛╠to - List taxDeclarationListDTOS = TaxDeclarationBO.convert2ListDTO(list, employeeComInfos, taxAgentPOS); - dtoPage.setList(taxDeclarationListDTOS); - } - return dtoPage; - } - - - public TaxDeclarationFormDTO getForm(Long id) { - TaxDeclarationFormDTO formDTO = new TaxDeclarationFormDTO(); - if (Objects.nonNull(id)) { - // 鏌ヨ涓◣鐢虫姤琛 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡鍒犻櫎")); - } - // 鏌ヨ涓◣鎵g即涔夊姟浜 - TaxAgentPO taxAgent = getTaxAgentService(user).getById(id); - //鏃ユ湡杞崲 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - String transformDate = simpleDateFormat.format(taxDeclaration.getSalaryMonth()); - // 杞崲鎴愪釜绋庣敵鎶ヨ〃璇︽儏dto - formDTO = TaxDeclarationFormDTO.builder().salaryMonth(SalaryDateUtil.String2YearMonth(transformDate)).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgent).map(TaxAgentPO::getName).orElse("")).description(taxDeclaration.getDescription()).build(); - } - // 杞崲鎴愬墠绔墍闇鐨勬暟鎹牸寮 - // WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(TaxDeclarationFormDTO.class, formDTO); - - // 鏌ヨ绉熸埛鎵鏈夌殑涓◣鎵g即涔夊姟浜 - Collection taxAgentListDTOS = getTaxAgentService(user).listAll(); - // 琛ㄥ崟涓釜绋庢墸缂翠箟鍔′汉鐨勫彲閫夐」 - List weaFormOptions = Lists.newArrayListWithExpectedSize(taxAgentListDTOS.size()); - for (TaxAgentPO taxAgent : taxAgentListDTOS) { - weaFormOptions.add(new WeaFormOption("" + taxAgent.getId(), taxAgent.getName())); - } -// weaForm.getItems().forEach((k, v) -> { -// if (StringUtils.equals("taxAgentId", k)) { -// v.setOptions(weaFormOptions); -// } -// if (StringUtils.equals("salaryMonth", k)) { -// Map otherParams = new HashMap<>(); -// otherParams.put("type", "month"); -// v.setOtherParams(otherParams); -// } -// }); - return formDTO; - } - - /** - * 鏌ヨ涓◣鐢虫姤琛ㄧ殑鍩烘湰淇℃伅 - * - * @param id 涓◣鐢虫姤琛╥d - * @return - */ - public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) { - // 鏌ヨ涓◣鐢虫姤琛 - TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(id); - if (Objects.isNull(taxDeclaration)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "涓◣鐢虫姤琛ㄤ笉瀛樺湪鎴栧凡鍒犻櫎")); - } - // 鏌ヨ涓◣鎵g即涔夊姟浜 - TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclaration.getTaxAgentId()); - return TaxDeclarationInfoDTO.builder().salaryMonth(taxDeclaration.getSalaryMonth()).taxAgentId(taxDeclaration.getTaxAgentId()).taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse("")).build(); - } - - /** - * 淇濆瓨 - * - * @param saveParam 淇濆瓨鍙傛暟 - */ - public void save(TaxDeclarationSaveParam saveParam) { - getTaxDeclarationService(user).save(saveParam); - } - - /** - * 鎾ゅ洖涓◣鐢虫姤 - * @param taxDeclarationId - */ - public void withDrawTaxDeclaration(Long taxDeclarationId) { - getTaxDeclarationService(user).withDrawTaxDeclaration(taxDeclarationId); - } } diff --git a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java index c47959f3c..4613a52e0 100644 --- a/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclareRecordWrapper.java @@ -4,13 +4,16 @@ 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.employeedeclare.param.EmployeeDeclareListQueryParam; +import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; import com.engine.salary.entity.taxdeclaration.dto.*; -import com.engine.salary.entity.taxdeclaration.param.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.param.*; import com.engine.salary.entity.taxdeclaration.po.*; +import com.engine.salary.enums.employeedeclare.CardTypeEnum; +import com.engine.salary.enums.employeedeclare.DeclareStatusEnum; +import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum; import com.engine.salary.enums.taxdeclaration.TaxDeclareTypeEnum; @@ -30,10 +33,10 @@ 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.ObjectUtils; 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; @@ -49,7 +52,6 @@ import java.util.stream.Collectors; * @version 1.0 **/ @Slf4j -@Component public class TaxDeclareRecordWrapper extends Service { @@ -89,6 +91,15 @@ public class TaxDeclareRecordWrapper extends Service { return ServiceUtil.getService(TaxDeclareFailServiceImpl.class, user); } + private TaxReportColumnService getTaxReportColumnService(User user) { + return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user); + } + + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + + /** * 涓◣鐢虫姤璁板綍鍒楄〃 * @@ -300,6 +311,20 @@ public class TaxDeclareRecordWrapper extends Service { return tabs; } + /** + * 鏂板鐢虫姤琛 + * + * @param param + */ + public void addTaxDeclaration(TaxDeclarationAddParam param) { + getTaxDeclarationService(user).addTaxDeclaration(param); + } + + + public void deleteTaxDeclaration(TaxDeclarationDeleteParam param) { + getTaxDeclarationService(user).deleteTaxDeclaration(param); + } + /** * 鏌ヨ涓◣鐢虫姤琛ㄧ殑鍩烘湰淇℃伅 * @@ -463,7 +488,12 @@ public class TaxDeclareRecordWrapper extends Service { public Object getDeclareTaxResultFeedback(Long id) { - return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id); + } + + + public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) { + return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param); } /** @@ -557,6 +587,37 @@ public class TaxDeclareRecordWrapper extends Service { return taxDeclarationRate.getIndex(); } + /** + * 鎾ら攢鏇存鐢虫姤 + * + * @param id + * @return + */ + public String cancelCorrect(Long id) { + checkBefore(id); + TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true).setIndex(Util.null2String(id)) + .setMsg(SalaryI18nUtil.getI18nLabel(177637, "鎾ら攢鏇存鐢虫姤")); + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + LocalRunnable localRunnable = new LocalRunnable() { + @Override + public void execute() { + try { + getTaxDeclareRecordService(user).cancelCorrect(id); + taxDeclarationRate.setFinish(true); + } catch (SalaryRunTimeException e) { + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage()); + } catch (Exception e) { + log.error("鎾ら攢鏇存鐢虫姤澶辫触锛歿}", e.getMessage(), e); + taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187269, "鎾ら攢鏇存鐢虫姤澶辫触锛") + e.getMessage()); + } finally { + getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate); + } + } + }; + ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "cancelCorrect", localRunnable); + return taxDeclarationRate.getIndex(); + } + /** * 绋庡眬绔敵鎶ョ姸鎬佹煡璇 * @@ -577,6 +638,15 @@ public class TaxDeclareRecordWrapper extends Service { return getTaxDeclareRecordService(user).queryCompanyIncomes(id); } + /** + * 瀵规瘮绠楃◣缁撴灉 + * + * @param param + */ + public Map contrast(ContrastQueryParam param) { + return getTaxDeclarationValueService(user).contrast(param); + } + /** * 鍒锋柊鏁版嵁 * @@ -654,4 +724,123 @@ public class TaxDeclareRecordWrapper extends Service { public XSSFWorkbook exportEmployee4Fail(AbnormalEmployeeListQueryParam queryParam) { return getTaxDeclarationExcelService(user).exportEmployee4Fail(queryParam); } + + /** + * 鏂板琛ㄥ崟 + * + * @param param + * @return + */ + public TaxDeclareRecordDetailFormDTO getAddForm(TaxDeclareRecordDetailFormParam param) { + TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId()); + + if (taxDeclaration == null) { + throw new SalaryRunTimeException("鐢虫姤琛ㄤ笉瀛樺湪!"); + } + + // 鏌ヨ涓◣鐢虫姤琛ㄥ垪 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()), 0); + //褰撳墠绋庢鎵灞炴湡鎶ラ佹垚鍔熶笖鐘舵佹甯哥殑浜哄憳 + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclaration.getTaxCycle()) + .taxAgentId(taxDeclaration.getTaxAgentId()) + .declareStatus(DeclareStatusEnum.DECLARE_SUCCESS) + .employmentStatus(EmploymentStatusEnum.NORMAL) + .build() + ); + + //杩囨护鐢虫姤琛ㄤ腑宸插瓨鍦ㄧ殑浜哄憳 + List taxDeclarationValuePOS = getTaxDeclarationValueService(user).listByTaxDeclarationIds(Collections.singletonList(param.getTaxDeclarationId())); + Set empIds = SalaryEntityUtil.properties(taxDeclarationValuePOS, TaxDeclarationValuePO::getEmployeeId); + + employeeDeclarePOS = employeeDeclarePOS.stream().filter(emp -> !empIds.contains(emp.getEmployeeId())).collect(Collectors.toList()); + + return TaxDeclareRecordDetailFormDTO.builder() + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .employeeDeclares(employeeDeclarePOS) + .taxDeclarationId(taxDeclaration.getTaxAgentId()) + .build(); + } + + /** + * 鏂板 + * + * @param param + */ + public void add(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).save(param); + } + + /** + * 缂栬緫 + * + * @param param + */ + public void edit(TaxDeclareRecordDetailSaveParam param) { + getTaxDeclarationValueService(user).edit(param); + } + + /** + * 璇︾粏淇℃伅 + * + * @param id + * @return + */ + public TaxDeclareRecordDetailFormDTO detailInfo(Long id) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(id); + TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(declarationValuePO.getTaxDeclarationId()); + + List employeeDeclarePOS = getEmployeeDeclareService(user).listByParam( + EmployeeDeclareListQueryParam + .builder() + .taxCycle(taxDeclarationPO.getTaxCycle()) + .taxAgentId(taxDeclarationPO.getTaxAgentId()) + .employeeId(declarationValuePO.getEmployeeId()) + .build() + ); + + if (CollectionUtils.isEmpty(employeeDeclarePOS)) { + throw new SalaryRunTimeException("褰撳墠浜哄憳鏈姤閫侊紒"); + } + EmployeeDeclarePO employeeDeclarePO = employeeDeclarePOS.get(0); + // 鏌ヨ涓◣鐢虫姤琛ㄥ垪 + List taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()), 0); + return TaxDeclareRecordDetailFormDTO + .builder() + .id(id) + .employeeId(employeeDeclarePO.getEmployeeId()) + .employeeType(employeeDeclarePO.getEmployeeType()) + .taxDeclarationId(taxDeclarationPO.getId()) + .incomeCategory(IncomeCategoryEnum.parseByValue(taxDeclarationPO.getIncomeCategory()).getDefaultLabel()) + .cardNum(employeeDeclarePO.getCardNum()) + .cardType(SalaryEnumUtil.enumMatchByValue(employeeDeclarePO.getCardType(), CardTypeEnum.class).getDefaultLabel()) + .username(employeeDeclarePO.getEmployeeName()) + .jobNum(employeeDeclarePO.getJobNum()) + .taxReportColumns(TaxDeclarationDetailBO.convert2ListTaxReportColumn(taxReportColumns)) + .resultValue(declarationValuePO.getResultValue()) + .build(); + } + + public XSSFWorkbook downloadTemplate(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).downloadTemplate(param); + } + + public Map preview(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).preview(param); + } + + public Map importData(DownloadTemplateParam param) { + return getTaxDeclarationExcelService(user).importData(param); + } + + public void deleteInfo(Long deleteId) { + TaxDeclarationValuePO declarationValuePO = getTaxDeclarationValueService(user).getById(deleteId); + if (ObjectUtils.isEmpty(declarationValuePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "璇ユ槑缁嗕笉瀛樺湪鎴栧凡琚垹闄わ紒")); + } + getTaxDeclarationValueService(user).deleteById(deleteId); + + } } diff --git a/test/ApiReturnDes.java b/test/ApiReturnDes.java new file mode 100644 index 000000000..e27dc5cc4 --- /dev/null +++ b/test/ApiReturnDes.java @@ -0,0 +1,18 @@ +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ApiReturnDes { + @ExcelProperty(index = 0) + public String name; + @ExcelProperty(index = 1) + public String mean; + @ExcelProperty(index = 2) + public String type; + @ExcelProperty(index = 3) + public String des; +} diff --git a/test/ParseTaxApi.java b/test/ParseTaxApi.java index 957f424d3..3e4b45d9d 100644 --- a/test/ParseTaxApi.java +++ b/test/ParseTaxApi.java @@ -7,7 +7,9 @@ import java.util.List; public class ParseTaxApi { public static void main(String[] args) { - readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); +// readExcel("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); + + readExcel2("H:\\code\\salary\\resource\\sql\\ApiDes.xlsx"); } @@ -27,17 +29,17 @@ public class ParseTaxApi { apiDesList.forEach(des -> { String type = des.getType(); - if(StringUtils.isNotEmpty(type)){ - if(type.startsWith("String")){ - type= "String"; + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; } } String a = "/** * " + des.getMean() - +" " + + " " + "蹇呭~锛" + des.getRequired() - +" " + des.getDes() + + " " + (des.getDes() == null ? "" : des.getDes()) + " */" + " private " + type + " " + des.getName() + ";"; System.out.println(a); @@ -50,6 +52,41 @@ public class ParseTaxApi { } + public static void readExcel2(String path) { + try { + // 鑾峰彇鏂囦欢杈撳叆娴 + InputStream inputStream = new FileInputStream(path); + + List apiDesList = ExcelParseHelper.parse2Map(inputStream, ApiReturnDes.class, 0, 1, 4, "ApiDes.xlsx"); + + /** + * 瀛楁鍚嶇О 瀛楁鍚箟 瀛楁绫诲瀷 蹇呭~ 璇存槑 + * qtzzlx 鍏朵粬璇佷欢绫诲瀷 String(64) 鏉′欢蹇呭~ 瑙佽瘉浠剁被鍨嬪瓧鍏 + * + * private String qtzzlx; + */ + + apiDesList.forEach(des -> { + String type = des.getType(); + if (StringUtils.isNotEmpty(type)) { + if (type.startsWith("String")) { + type = "String"; + } + } + + String a = "/** * " + + des.getMean() + + " " + (des.getDes() == null ? "" : des.getDes()) + + " */" + " private " + type + " " + des.getName() + ";"; + System.out.println(a); + + }); + + + } catch (Exception e) { + e.printStackTrace(); + } + } }