diff --git a/resource/sql/薪资档案重复.sql b/resource/sql/薪资档案重复.sql new file mode 100644 index 000000000..400a2ad97 --- /dev/null +++ b/resource/sql/薪资档案重复.sql @@ -0,0 +1,6 @@ + +select max(id) FROM hrsa_salary_archive where tax_agent_id = 35 and delete_type = 0 GROUP BY employee_id HAVING COUNT(employee_id)>1; + + +update hrsa_salary_archive set delete_type =3 where tax_agent_id = 35 and delete_type = 0 + and id in (select max(id) FROM hrsa_salary_archive where tax_agent_id = 35 and delete_type = 0 GROUP BY employee_id HAVING COUNT(employee_id)>1); \ No newline at end of file diff --git a/resource/sql/还原.sql b/resource/sql/还原.sql new file mode 100644 index 000000000..fc70ed7b0 --- /dev/null +++ b/resource/sql/还原.sql @@ -0,0 +1,138 @@ +delete from hrsa_acct_result_temp where 1=1 +; +delete from hrsa_add_up_deduction where 1=1 +; +delete from hrsa_add_up_situation where 1=1 +; +delete from hrsa_attend_quote where 1=1 +; +delete from hrsa_attend_quote_data where 1=1 +; +delete from hrsa_attend_quote_data_value where 1=1 +; +delete from hrsa_attend_quote_field where 1=1 +; +delete from hrsa_attend_quote_sync_set where 1=1 +; + + +delete from hrsa_scheme_detail where 1=1 +; +delete from hrsa_social_archives where 1=1 +; +delete from hrsa_fund_archives where 1=1 +; +delete from hrsa_other_archives where 1=1 +; + + +delete from hrsa_bill_batch where 1=1 +; + +delete from hrsa_bill_detail where 1=1 +; +delete from hrsa_bill_detail_temp where 1=1 +; +delete from hrsa_bill_inspect where 1=1 +; + + + +delete from hrsa_check_result where 1=1 +; +delete from hrsa_check_result_record where 1=1 +; +delete from hrsa_ck_result_detail_temp where 1=1 +; +delete from hrsa_excel_acct_result where 1=1 +; + +delete from hrsa_other_deduction where 1=1 +; +delete from hrsa_salary_acct_emp where 1=1 +; +delete from hrsa_salary_acct_record where 1=1 +; +delete from hrsa_salary_acct_result where 1=1 +; +delete from hrsa_salary_archive where 1=1 +; +delete from hrsa_salary_archive_dimission where 1=1 +; +delete from hrsa_salary_archive_item where 1=1 +; +delete from hrsa_salary_archive_tax_agent where 1=1 +; +delete from hrsa_salary_item where 1=1 +; +delete from hrsa_salary_send where 1=1 +; +delete from hrsa_salary_send_info where 1=1 +; +delete from hrsa_salary_sob where 1=1 +; +delete from hrsa_salary_sob_adjust_rule where 1=1 +; +delete from hrsa_salary_sob_emp_field where 1=1 +; +delete from hrsa_salary_sob_item where 1=1 +; +delete from hrsa_salary_sob_item_group where 1=1 +; +delete from hrsa_salary_sob_range where 1=1 +; +delete from hrsa_salary_template where 1=1 +; + +delete from hrsa_social_security_scheme where 1=1 +; +delete from hrsa_sys_tax_rate_base where 1=1 +; +delete from hrsa_sys_tax_rate_detail where 1=1 +; +delete from hrsa_tax_agent where 1=1 +; +delete from hrsa_tax_agent_emp where 1=1 +; +delete from hrsa_tax_agent_emp_change where 1=1 +; +delete from hrsa_tax_agent_admin where 1=1 +; +delete from hrsa_tax_agent_manage_range where 1=1 +; + +delete from hrsa_tax_agent_sub_admin where 1=1 +; +delete from hrsa_tax_agent_sub_admin_emp where 1=1 +; + +delete from hrsa_tax_declaration where 1=1 +; +delete from hrsa_tax_declaration_detail where 1=1 +; +delete from hrsa_tax_rate_base where 1=1 +; +delete from hrsa_tax_rate_detail where 1=1 +; +delete from hrsa_salary_acct_result_report where 1=1 +; + +delete from hrsa_insurance_base_info where 1=1 +; + + +delete from hrsa_salary_sob_back_item where 1=1 +; +delete from hrsa_salary_send_range where 1=1 +; +delete from hrsa_salary_send_range_obj where 1=1 +; +delete from hrsa_compensation_log where 1=1 +; +delete from hrsa_compensation_config where 1=1 +; +delete from hrsa_special_add_deduction where 1=1 +; + + + diff --git a/resource/sqlupgrade/DM/sql202303130101.sql b/resource/sqlupgrade/DM/sql202303130101.sql new file mode 100644 index 000000000..671629174 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202303130101.sql @@ -0,0 +1,23 @@ +delete from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/DM/sql202303130202.sql b/resource/sqlupgrade/DM/sql202303130202.sql new file mode 100644 index 000000000..9038f9cd1 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202303130202.sql @@ -0,0 +1,14 @@ +Delete from LeftMenuInfo where id=100186; +/ + +Delete from LeftMenuConfig where infoid=100186; +/ + +call LMConfig_U_ByInfoInsert (2,100118,9); +/ + +call 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/DM/sql202303150403.sql b/resource/sqlupgrade/DM/sql202303150403.sql new file mode 100644 index 000000000..1de44bdc4 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202303150403.sql @@ -0,0 +1,74 @@ +ALTER TABLE hrsa_tax_agent_emp ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_archive ADD employee_type number; +/ + +ALTER TABLE hrsa_tax_agent_emp_change ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_acct_emp ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_send_info ADD employee_type number; +/ + +CREATE TABLE hrsa_external_employee +( + id NUMBER(38,0) primary key NOT NULL, + username varchar2(200) DEFAULT '', + department_name varchar2(200) DEFAULT '', + department_id NUMBER(38,0) DEFAULT 0, + subcompany_name varchar2(200) DEFAULT '', + subcompany_id NUMBER(38,0) DEFAULT 0, + jobtitle_name varchar2(200) DEFAULT '', + jobtitle_id NUMBER(38,0) DEFAULT 0, + companystartdate varchar2(200) DEFAULT '', + mobile varchar2(20) DEFAULT '', + status varchar2(10) DEFAULT '', + workcode varchar2(200) DEFAULT '', + sex varchar2(10) DEFAULT '', + email varchar2(200) DEFAULT '', + telephone varchar2(200) DEFAULT '', + jobcall varchar2(200) DEFAULT '', + birthday varchar2(200) DEFAULT '', + id_no varchar2(200) DEFAULT '', + bank_card_num varchar2(200) DEFAULT '', + bank_name varchar2(200) DEFAULT '', + delete_type number DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + modifier NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + tenant_key varchar2(200) DEFAULT '' +); +/ + +CREATE TABLE hrsa_salary_sob_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_agent_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/DM/sql202307170403.sql b/resource/sqlupgrade/DM/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + diff --git a/resource/sqlupgrade/DM/sql202307180603.sql b/resource/sqlupgrade/DM/sql202307180603.sql new file mode 100644 index 000000000..9154924fe --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180603.sql @@ -0,0 +1,4 @@ +alter table hrsa_salary_item + add hide_default NUMBER null; +/ + diff --git a/resource/sqlupgrade/DM/sql202307200603.sql b/resource/sqlupgrade/DM/sql202307200603.sql new file mode 100644 index 000000000..849cc35dc --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307200603.sql @@ -0,0 +1,14 @@ +declare +datashowset_id NUMBER; +hrmjobgroups_id NUMBER; +begin +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, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1); +SELECT max(id) INTO datashowset_id FROM DATASHOWSET; +INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('salaryExtEmp', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, '', 'username', '', 1, 1, SYS_GUID(), NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, 'ֻ', 'mobile', '', 0, 2, SYS_GUID(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, '', 'username', '2', '', 1, SYS_GUID(), ''); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, 'ֻ', 'mobile', '2', '', 2, SYS_GUID(), ''); +end; +/ + diff --git a/resource/sqlupgrade/JC/sql202303130101.sql b/resource/sqlupgrade/JC/sql202303130101.sql new file mode 100644 index 000000000..671629174 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202303130101.sql @@ -0,0 +1,23 @@ +delete from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is null ) ; +/ + +insert into HtmlLabelIndex(id,indexdesc) select 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 ; +/ + +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is null ) ; +/ + +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/JC/sql202303130202.sql b/resource/sqlupgrade/JC/sql202303130202.sql new file mode 100644 index 000000000..9038f9cd1 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202303130202.sql @@ -0,0 +1,14 @@ +Delete from LeftMenuInfo where id=100186; +/ + +Delete from LeftMenuConfig where infoid=100186; +/ + +call LMConfig_U_ByInfoInsert (2,100118,9); +/ + +call 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/JC/sql202303150403.sql b/resource/sqlupgrade/JC/sql202303150403.sql new file mode 100644 index 000000000..1de44bdc4 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202303150403.sql @@ -0,0 +1,74 @@ +ALTER TABLE hrsa_tax_agent_emp ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_archive ADD employee_type number; +/ + +ALTER TABLE hrsa_tax_agent_emp_change ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_acct_emp ADD employee_type number; +/ + +ALTER TABLE hrsa_salary_send_info ADD employee_type number; +/ + +CREATE TABLE hrsa_external_employee +( + id NUMBER(38,0) primary key NOT NULL, + username varchar2(200) DEFAULT '', + department_name varchar2(200) DEFAULT '', + department_id NUMBER(38,0) DEFAULT 0, + subcompany_name varchar2(200) DEFAULT '', + subcompany_id NUMBER(38,0) DEFAULT 0, + jobtitle_name varchar2(200) DEFAULT '', + jobtitle_id NUMBER(38,0) DEFAULT 0, + companystartdate varchar2(200) DEFAULT '', + mobile varchar2(20) DEFAULT '', + status varchar2(10) DEFAULT '', + workcode varchar2(200) DEFAULT '', + sex varchar2(10) DEFAULT '', + email varchar2(200) DEFAULT '', + telephone varchar2(200) DEFAULT '', + jobcall varchar2(200) DEFAULT '', + birthday varchar2(200) DEFAULT '', + id_no varchar2(200) DEFAULT '', + bank_card_num varchar2(200) DEFAULT '', + bank_name varchar2(200) DEFAULT '', + delete_type number DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + modifier NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + tenant_key varchar2(200) DEFAULT '' +); +/ + +CREATE TABLE hrsa_salary_sob_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +); +/ + +CREATE TABLE hrsa_tax_agent_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +); +/ + diff --git a/resource/sqlupgrade/JC/sql202307170403.sql b/resource/sqlupgrade/JC/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180603.sql b/resource/sqlupgrade/JC/sql202307180603.sql new file mode 100644 index 000000000..9154924fe --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180603.sql @@ -0,0 +1,4 @@ +alter table hrsa_salary_item + add hide_default NUMBER null; +/ + diff --git a/resource/sqlupgrade/JC/sql202307200603.sql b/resource/sqlupgrade/JC/sql202307200603.sql new file mode 100644 index 000000000..849cc35dc --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307200603.sql @@ -0,0 +1,14 @@ +declare +datashowset_id NUMBER; +hrmjobgroups_id NUMBER; +begin +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, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1); +SELECT max(id) INTO datashowset_id FROM DATASHOWSET; +INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('salaryExtEmp', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, '', 'username', '', 1, 1, SYS_GUID(), NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, 'ֻ', 'mobile', '', 0, 2, SYS_GUID(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, '', 'username', '2', '', 1, SYS_GUID(), ''); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, 'ֻ', 'mobile', '2', '', 2, SYS_GUID(), ''); +end; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202303130101.sql b/resource/sqlupgrade/Mysql/sql202303130101.sql new file mode 100644 index 000000000..c03a6e987 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202303130101.sql @@ -0,0 +1,16 @@ +delete from HtmlLabelIndex where id = 541290 and ( indexdesc is null or indexdesc = '' ) +; +insert into HtmlLabelIndex(id,indexdesc) select 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( indexdesc is not null and indexdesc <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 +; +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=char_length(labelname) ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=char_length(labelname) )) limit 1 +; +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is null or labelname = '' ) +; +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 +; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202303130202.sql b/resource/sqlupgrade/Mysql/sql202303130202.sql new file mode 100644 index 000000000..81f96bbd2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202303130202.sql @@ -0,0 +1,10 @@ +Delete from LeftMenuInfo where id=100186 +; +Delete from LeftMenuConfig where infoid=100186 +; +call LMConfig_U_ByInfoInsert (2,100118,9) +; +call 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/Mysql/sql202303150403.sql b/resource/sqlupgrade/Mysql/sql202303150403.sql new file mode 100644 index 000000000..0311cd908 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202303150403.sql @@ -0,0 +1,78 @@ +ALTER TABLE hrsa_tax_agent_emp + ADD COLUMN employee_type int(0) NULL ; + + +ALTER TABLE hrsa_salary_archive + ADD COLUMN employee_type int(0) NULL ; + + +ALTER TABLE hrsa_tax_agent_emp_change + ADD COLUMN employee_type int(0) NULL ; + +ALTER TABLE hrsa_salary_acct_emp + ADD COLUMN employee_type int(0) NULL ; + +ALTER TABLE hrsa_salary_send_info ADD COLUMN employee_type int(0) ; + +CREATE TABLE hrsa_external_employee +( + id bigint(0) NOT NULL, + username varchar(255) NULL DEFAULT NULL COMMENT '', + department_name varchar(255) NULL DEFAULT NULL COMMENT '', + department_id bigint(0) NULL DEFAULT NULL COMMENT 'ID', + subcompany_name varchar(255) NULL DEFAULT NULL COMMENT 'ֲ', + subcompany_id bigint(0) NULL DEFAULT NULL COMMENT 'ֲID', + jobtitle_name varchar(255) NULL DEFAULT NULL COMMENT 'λ', + jobtitle_id bigint(0) NULL DEFAULT NULL COMMENT 'λID', + companystartdate varchar(255) NULL DEFAULT NULL COMMENT 'ְ', + mobile varchar(255) NULL DEFAULT NULL COMMENT 'ֻ', + status varchar(255) NULL DEFAULT NULL COMMENT '״̬', + workcode varchar(255) NULL DEFAULT NULL COMMENT '', + sex varchar(255) NULL DEFAULT NULL COMMENT 'Ա', + email varchar(255) NULL DEFAULT NULL COMMENT 'ʼ', + telephone varchar(255) NULL DEFAULT NULL COMMENT '绰', + jobcall varchar(255) NULL DEFAULT NULL COMMENT 'ְ', + birthday varchar(255) NULL DEFAULT NULL COMMENT '', + id_no varchar(255) NULL DEFAULT NULL COMMENT '֤', + bank_card_num varchar(255) NULL DEFAULT NULL COMMENT '˿п', + bank_name varchar(255) NULL DEFAULT NULL COMMENT '˿п֧ȫ', + delete_type int(0) NULL DEFAULT NULL COMMENT 'Ƿɾ0δɾ1ɾ', + creator bigint(0) NULL DEFAULT NULL COMMENT '', + modifier bigint(0) NULL DEFAULT NULL COMMENT '޸', + create_time datetime(0) NULL DEFAULT NULL COMMENT 'ʱ', + update_time datetime(0) NULL DEFAULT NULL COMMENT '޸ʱ', + tenant_key varchar(255) NULL DEFAULT NULL COMMENT '⻧ID', + PRIMARY KEY (id) USING BTREE +); + +CREATE TABLE hrsa_salary_sob_ext_range +( + id bigint(0) NOT NULL COMMENT 'id', + salary_sob_id bigint(0) NOT NULL DEFAULT 0 COMMENT 'id', + target_type tinyint(0) NOT NULL DEFAULT 1 COMMENT '͡1ⲿԱ', + target_id bigint(0) NOT NULL DEFAULT 0 COMMENT 'id', + creator bigint(0) NOT NULL DEFAULT 0 COMMENT '', + create_time datetime(0) NOT NULL COMMENT 'ʱ', + update_time datetime(0) NOT NULL COMMENT 'ʱ', + delete_type int(0) NOT NULL DEFAULT 0 COMMENT 'Ƿɾ0δɾ1ɾ', + tenant_key varchar(10) NOT NULL DEFAULT '' COMMENT '⻧ID', + PRIMARY KEY (id) USING BTREE, + INDEX idx_tenant(tenant_key) USING BTREE, + INDEX idx_tenant_key(tenant_key) USING BTREE +); + +CREATE TABLE hrsa_tax_agent_ext_range +( + id bigint(0) NOT NULL COMMENT 'id', + tax_agent_id bigint(0) NOT NULL DEFAULT 0 COMMENT '˰۽˵id', + target_type tinyint(0) NOT NULL DEFAULT 1 COMMENT '͡1ⲿԱ', + target_id bigint(0) NOT NULL DEFAULT 0 COMMENT 'id', + creator bigint(0) NOT NULL DEFAULT 0 COMMENT '', + create_time datetime(0) NOT NULL COMMENT 'ʱ', + update_time datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP (0) COMMENT 'ʱ', + delete_type int(0) NOT NULL DEFAULT 0 COMMENT 'Ƿɾ0δɾ1ɾ', + tenant_key varchar(10) NOT NULL DEFAULT '' COMMENT '⻧ID', + PRIMARY KEY (id) USING BTREE, + INDEX idx_tenant(tenant_key) USING BTREE, + INDEX idx_tenant_key(tenant_key) USING BTREE +); \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307170403.sql b/resource/sqlupgrade/Mysql/sql202307170403.sql new file mode 100644 index 000000000..a01647d03 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307170403.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_salary_send_info +ADD COLUMN bill_read_status int NULL, +ADD COLUMN bill_confirm_status int NULL, +ADD COLUMN send_employee_id BIGINT NULL; + +ALTER TABLE hrsa_salary_template +ADD COLUMN ack_feedback_status int NULL, +ADD COLUMN auto_ack_days int NULL, +ADD COLUMN feedback_url varchar(500) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307180603.sql b/resource/sqlupgrade/Mysql/sql202307180603.sql new file mode 100644 index 000000000..5ddb48c1c --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_item +ADD COLUMN hide_default int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Mysql/sql202307200603.sql b/resource/sqlupgrade/Mysql/sql202307200603.sql new file mode 100644 index 000000000..e211c560e --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307200603.sql @@ -0,0 +1,17 @@ +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); + +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); + +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) +VALUES (@datashowset_id, '', 'username', '', 1, 1, uuid(), NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) +VALUES (@datashowset_id, 'ֻ', 'mobile', '', 0, 2, uuid(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) +VALUES (@datashowset_id, '', '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 diff --git a/resource/sqlupgrade/Oracle/sql202303130101.sql b/resource/sqlupgrade/Oracle/sql202303130101.sql new file mode 100644 index 000000000..99adf5d4f --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202303130101.sql @@ -0,0 +1,16 @@ +delete from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is null ) +/ +insert into HtmlLabelIndex(id,indexdesc) select 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( trim(indexdesc) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( trim(labelname) is not null )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is null or length(labelname)!=lengthb(labelname) ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( trim(labelname) is not null and length(labelname)=lengthb(labelname) )) and rownum = 1 +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is null ) +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( trim(labelname) is not null )) and rownum = 1 +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202303130202.sql b/resource/sqlupgrade/Oracle/sql202303130202.sql new file mode 100644 index 000000000..d6b3c8be5 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202303130202.sql @@ -0,0 +1,10 @@ +Delete from LeftMenuInfo where id=100186 +/ +Delete from LeftMenuConfig where infoid=100186 +/ +call LMConfig_U_ByInfoInsert (2,100118,9) +/ +call 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/Oracle/sql202303150403.sql b/resource/sqlupgrade/Oracle/sql202303150403.sql new file mode 100644 index 000000000..925fcc20b --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202303150403.sql @@ -0,0 +1,74 @@ +ALTER TABLE hrsa_tax_agent_emp ADD employee_type number +/ + +ALTER TABLE hrsa_salary_archive ADD employee_type number +/ + +ALTER TABLE hrsa_tax_agent_emp_change ADD employee_type number +/ + +ALTER TABLE hrsa_salary_acct_emp ADD employee_type number +/ + +ALTER TABLE hrsa_salary_send_info ADD employee_type number +/ + + +CREATE TABLE hrsa_external_employee +( + id NUMBER(38,0) primary key NOT NULL, + username varchar2(200) DEFAULT '', + department_name varchar2(200) DEFAULT '', + department_id NUMBER(38,0) DEFAULT 0, + subcompany_name varchar2(200) DEFAULT '', + subcompany_id NUMBER(38,0) DEFAULT 0, + jobtitle_name varchar2(200) DEFAULT '', + jobtitle_id NUMBER(38,0) DEFAULT 0, + companystartdate varchar2(200) DEFAULT '', + mobile varchar2(20) DEFAULT '', + status varchar2(10) DEFAULT '', + workcode varchar2(200) DEFAULT '', + sex varchar2(10) DEFAULT '', + email varchar2(200) DEFAULT '', + telephone varchar2(200) DEFAULT '', + jobcall varchar2(200) DEFAULT '', + birthday varchar2(200) DEFAULT '', + id_no varchar2(200) DEFAULT '', + bank_card_num varchar2(200) DEFAULT '', + bank_name varchar2(200) DEFAULT '', + delete_type number DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + modifier NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + tenant_key varchar2(200) DEFAULT '' +) +/ + +CREATE TABLE hrsa_salary_sob_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + salary_sob_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +) +/ + +CREATE TABLE hrsa_tax_agent_ext_range +( + id NUMBER(38,0) primary key NOT NULL, + tax_agent_id NUMBER(38,0) DEFAULT 0, + target_type NUMBER(38,0) DEFAULT 0, + target_id NUMBER(38,0) DEFAULT 0, + creator NUMBER(38,0) DEFAULT 0, + create_time DATE DEFAULT sysdate, + update_time DATE DEFAULT sysdate, + delete_type number DEFAULT 0, + tenant_key varchar2(200) DEFAULT '' +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307170403.sql b/resource/sqlupgrade/Oracle/sql202307170403.sql new file mode 100644 index 000000000..8765e111d --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307170403.sql @@ -0,0 +1,23 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180603.sql b/resource/sqlupgrade/Oracle/sql202307180603.sql new file mode 100644 index 000000000..8bccbf455 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180603.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item + add hide_default NUMBER null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307200603.sql b/resource/sqlupgrade/Oracle/sql202307200603.sql new file mode 100644 index 000000000..0700475ea --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307200603.sql @@ -0,0 +1,13 @@ +declare +datashowset_id NUMBER; +hrmjobgroups_id NUMBER; +begin +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, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1); +SELECT max(id) INTO datashowset_id FROM DATASHOWSET; +INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('salaryExtEmp', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, '', 'username', '', 1, 1, SYS_GUID(), NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (datashowset_id, 'ֻ', 'mobile', '', 0, 2, SYS_GUID(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, '', 'username', '2', '', 1, SYS_GUID(), ''); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (datashowset_id, 'ֻ', 'mobile', '2', '', 2, SYS_GUID(), ''); +end; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202303130101.sql b/resource/sqlupgrade/PG/sql202303130101.sql new file mode 100644 index 000000000..843e5994d --- /dev/null +++ b/resource/sqlupgrade/PG/sql202303130101.sql @@ -0,0 +1,16 @@ +delete from HtmlLabelIndex where id = 541290 and ( indexdesc is null or indexdesc = '' ) ; +/ +insert into HtmlLabelIndex(id,indexdesc) select 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( indexdesc is not null and indexdesc <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is null or labelname = '' or length(labelname)!=octet_length(labelname) ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is not null and labelname <> '' and length(labelname)=octet_length(labelname) )) limit 1 ; +/ +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is null or labelname = '' ) ; +/ +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is not null and labelname <> '' )) limit 1 ; +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202303130202.sql b/resource/sqlupgrade/PG/sql202303130202.sql new file mode 100644 index 000000000..54a9eae70 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202303130202.sql @@ -0,0 +1,10 @@ +Delete from LeftMenuInfo where id=100186; +/ +Delete from LeftMenuConfig where infoid=100186; +/ +call LMConfig_U_ByInfoInsert (2,100118,9); +/ +call 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/sql202303150403.sql b/resource/sqlupgrade/PG/sql202303150403.sql new file mode 100644 index 000000000..f587ca6b0 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202303150403.sql @@ -0,0 +1,74 @@ +ALTER TABLE hrsa_tax_agent_emp + ADD COLUMN employee_type int NULL ; + + +ALTER TABLE hrsa_salary_archive + ADD COLUMN employee_type int NULL ; + + +ALTER TABLE hrsa_tax_agent_emp_change + ADD COLUMN employee_type int NULL ; + +ALTER TABLE hrsa_salary_acct_emp + ADD COLUMN employee_type int NULL ; + +ALTER TABLE hrsa_salary_send_info ADD COLUMN employee_type int ; + +CREATE TABLE hrsa_external_employee +( + id bigint NOT NULL, + username varchar(255) NULL DEFAULT NULL , + department_name varchar(255) NULL DEFAULT NULL, + department_id bigint NULL DEFAULT NULL , + subcompany_name varchar(255) NULL DEFAULT NULL , + subcompany_id bigint NULL DEFAULT NULL , + jobtitle_name varchar(255) NULL DEFAULT NULL , + jobtitle_id bigint NULL DEFAULT NULL , + companystartdate varchar(255) NULL DEFAULT NULL , + mobile varchar(255) NULL DEFAULT NULL , + status varchar(255) NULL DEFAULT NULL , + workcode varchar(255) NULL DEFAULT NULL , + sex varchar(255) NULL DEFAULT NULL , + email varchar(255) NULL DEFAULT NULL , + telephone varchar(255) NULL DEFAULT NULL , + jobcall varchar(255) NULL DEFAULT NULL , + birthday varchar(255) NULL DEFAULT NULL , + id_no varchar(255) NULL DEFAULT NULL , + bank_card_num varchar(255) NULL DEFAULT NULL , + bank_name varchar(255) NULL DEFAULT NULL , + delete_type int NULL DEFAULT NULL , + creator bigint NULL DEFAULT NULL , + modifier bigint NULL DEFAULT NULL , + create_time timestamp NULL DEFAULT NULL , + update_time timestamp NULL DEFAULT NULL , + tenant_key varchar(255) NULL DEFAULT NULL , + PRIMARY KEY (id) +); + +CREATE TABLE hrsa_salary_sob_ext_range +( + id bigint NOT NULL , + salary_sob_id bigint NOT NULL DEFAULT 0 , + target_type smallint NOT NULL DEFAULT 1 , + target_id bigint NOT NULL DEFAULT 0 , + creator bigint NOT NULL DEFAULT 0 , + create_time timestamp , + update_time timestamp, + delete_type int NOT NULL DEFAULT 0 , + tenant_key varchar(10) NOT NULL DEFAULT '', + PRIMARY KEY (id) +); + +CREATE TABLE hrsa_tax_agent_ext_range +( + id bigint NOT NULL , + tax_agent_id bigint NOT NULL DEFAULT 0 , + target_type smallint NOT NULL DEFAULT 1 , + target_id bigint NOT NULL DEFAULT 0 , + creator bigint NOT NULL DEFAULT 0 , + create_time timestamp , + update_time timestamp , + delete_type int NOT NULL DEFAULT 0 , + tenant_key varchar(10) NOT NULL DEFAULT '' , + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307170403.sql b/resource/sqlupgrade/PG/sql202307170403.sql new file mode 100644 index 000000000..a01647d03 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307170403.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_salary_send_info +ADD COLUMN bill_read_status int NULL, +ADD COLUMN bill_confirm_status int NULL, +ADD COLUMN send_employee_id BIGINT NULL; + +ALTER TABLE hrsa_salary_template +ADD COLUMN ack_feedback_status int NULL, +ADD COLUMN auto_ack_days int NULL, +ADD COLUMN feedback_url varchar(500) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180603.sql b/resource/sqlupgrade/PG/sql202307180603.sql new file mode 100644 index 000000000..5ddb48c1c --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_item +ADD COLUMN hide_default int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307200603.sql b/resource/sqlupgrade/PG/sql202307200603.sql new file mode 100644 index 000000000..e211c560e --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307200603.sql @@ -0,0 +1,17 @@ +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); + +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); + +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) +VALUES (@datashowset_id, '', 'username', '', 1, 1, uuid(), NULL); +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) +VALUES (@datashowset_id, 'ֻ', 'mobile', '', 0, 2, uuid(), NULL); +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) +VALUES (@datashowset_id, '', '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 diff --git a/resource/sqlupgrade/SQLServer/sql202303130101.sql b/resource/sqlupgrade/SQLServer/sql202303130101.sql new file mode 100644 index 000000000..6f7276eef --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202303130101.sql @@ -0,0 +1,16 @@ +delete from HtmlLabelIndex where id = 541290 and ( indexdesc is null or indexdesc = '' ) +GO +insert into HtmlLabelIndex(id,indexdesc) select top 1 541290,'ϵͳԱ' from HtmlLabelIndex where not exists (select id from HtmlLabelIndex where id = 541290 and ( indexdesc is not null and indexdesc <> '' )) +GO +delete from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 541290 as indexid ,'ϵͳԱ' as content,7 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=7 and ( labelname is not null and labelname <> '' )) +GO +delete from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is null or labelname = '' or labelname like '%[߹-]%' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 541290 as indexid ,'Non-system personnel management' as content,8 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=8 and ( labelname is not null and labelname <> '' and labelname not like '%[߹-]%' )) +GO +delete from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is null or labelname = '' ) +GO +insert into HtmlLabelInfo(indexid,labelname,languageid) select * from (select top 1 541290 as indexid ,'ϵyˆT' as content,9 as languageid from HtmlLabelInfo) t where not exists (select indexid,languageid from HtmlLabelInfo where indexid = 541290 and languageid=9 and ( labelname is not null and labelname <> '' )) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202303130202.sql b/resource/sqlupgrade/SQLServer/sql202303130202.sql new file mode 100644 index 000000000..9b7bbe305 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202303130202.sql @@ -0,0 +1,10 @@ +Delete from LeftMenuInfo where id=100186 +GO +Delete from LeftMenuConfig where infoid=100186 +GO +EXECUTE LMConfig_U_ByInfoInsert 2,100118,9 +GO +EXECUTE LMInfo_Insert 100186,541290,'','',2,100118,9,18 +GO +update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/externalPersonManage' where id = 100186 +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202303150403.sql b/resource/sqlupgrade/SQLServer/sql202303150403.sql new file mode 100644 index 000000000..d7b0d357e --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202303150403.sql @@ -0,0 +1,79 @@ +ALTER TABLE hrsa_tax_agent_emp ADD employee_type int NULL +GO + +ALTER TABLE hrsa_salary_archive ADD employee_type int NULL +GO + +ALTER TABLE hrsa_tax_agent_emp_change ADD employee_type int NULL +GO + +ALTER TABLE hrsa_salary_acct_emp ADD employee_type int NULL +GO + +ALTER TABLE hrsa_salary_send_info ADD employee_type int NULL +GO + + + + +CREATE TABLE hrsa_external_employee +( + id bigint NOT NULL, + username varchar(255) , + department_name varchar(255) , + department_id bigint , + subcompany_name varchar(255) , + subcompany_id bigint , + jobtitle_name varchar(255) , + jobtitle_id bigint , + companystartdate varchar(255) , + mobile varchar(255) , + status varchar(255) , + workcode varchar(255) , + sex varchar(255) , + email varchar(255) , + telephone varchar(255) , + jobcall varchar(255) , + birthday varchar(255) , + id_no varchar(255) , + bank_card_num varchar(255) , + bank_name varchar(255) , + delete_type int , + creator bigint , + modifier bigint , + create_time datetime , + update_time datetime , + tenant_key varchar(255) , + PRIMARY KEY (id) +) +GO + +CREATE TABLE hrsa_salary_sob_ext_range +( + id bigint NOT NULL , + salary_sob_id bigint , + target_type tinyint , + target_id bigint , + creator bigint , + create_time datetime , + update_time datetime , + delete_type int , + tenant_key varchar(10) , + PRIMARY KEY (id) +) +GO + +CREATE TABLE hrsa_tax_agent_ext_range +( + id bigint NOT NULL , + tax_agent_id bigint , + target_type tinyint , + target_id bigint , + creator bigint , + create_time datetime, + update_time datetime, + delete_type int , + tenant_key varchar(10) , + PRIMARY KEY (id) +) +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307170403.sql b/resource/sqlupgrade/SQLServer/sql202307170403.sql new file mode 100644 index 000000000..de0724f06 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307170403.sql @@ -0,0 +1,11 @@ +ALTER TABLE hrsa_salary_send_info +ADD bill_read_status int NULL, +bill_confirm_status int NULL, +send_employee_id BIGINT NULL +GO + +ALTER TABLE hrsa_salary_template +ADD ack_feedback_status int NULL, +auto_ack_days int NULL, +feedback_url varchar(500) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180603.sql b/resource/sqlupgrade/SQLServer/sql202307180603.sql new file mode 100644 index 000000000..8160ebc94 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_salary_item +ADD hide_default int NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307200603.sql b/resource/sqlupgrade/SQLServer/sql202307200603.sql new file mode 100644 index 000000000..4739ad629 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307200603.sql @@ -0,0 +1,17 @@ +declare @datashowset_id int +declare @current_date varchar(100) +declare @current_time varchar(100) + +set @current_date = (select CONVERT(varchar(100), GETDATE(), 23)) +set @current_time = (select CONVERT(varchar(100), GETDATE(), 24)) + +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',newid(), '', '', '', '', '1', 0, 1) +set @datashowset_id = (select max(id) from datashowset) +INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('salaryExtEmp', '0', 0, @current_date, @current_time, NULL, NULL) + +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (@datashowset_id, '', 'username', '', 1, 1, newid(), NULL) +INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES (@datashowset_id, 'ֻ', 'mobile', '', 0, 2, newid(), NULL) +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (@datashowset_id, '', 'username', '2', '', 1, newid(), '') +INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES (@datashowset_id, 'ֻ', 'mobile', '2', '', 2, newid(), '') + +GO \ No newline at end of file diff --git a/src/com/api/salary/web/ExtEmpController.java b/src/com/api/salary/web/ExtEmpController.java new file mode 100644 index 000000000..9b349b2ef --- /dev/null +++ b/src/com/api/salary/web/ExtEmpController.java @@ -0,0 +1,8 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/extEmp") +public class ExtEmpController extends com.engine.salary.web.ExtEmpController{ + +} diff --git a/src/com/engine/salary/action/SalaryAcctFileByIdAction.java b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java new file mode 100644 index 000000000..710233ecb --- /dev/null +++ b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java @@ -0,0 +1,64 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.util.SalaryI18nUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.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.Map; +import java.util.stream.Collectors; + +/** + * @Author: sy + * @Description: 通过薪资核算id归档台账记录 + * @Date: 2023/7/18 + **/ +@Slf4j +public class SalaryAcctFileByIdAction implements Action { + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private String acctRecordId; + + public String getAcctRecordId() { + return acctRecordId; + } + + public void setAcctRecordId(String acctRecordId) { + this.acctRecordId = acctRecordId; + } + + @Override + public String execute(RequestInfo requestInfo) { + User user = requestInfo.getRequestManager().getUser(); + + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + + Long salaryAcctId = StringUtils.isNotBlank(fieldMap.get(acctRecordId)) ? Long.parseLong(fieldMap.get(acctRecordId)) : 0L; + + if (!salaryAcctId.equals(0L)) { + try { + getSalaryAcctRecordService(user).file(salaryAcctId); + } catch (Exception e) { + log.error("薪资核算归档异常", e); + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + } else { + requestInfo.getRequestManager().setMessage(SalaryI18nUtil.getI18nLabel(542300, "薪资核算记录不存在或已被删除")); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index beb8c4741..cc412c210 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -80,24 +80,6 @@ public class EmployBiz extends BaseBean { } } - public List getAdminEmployeeByIds(List list) { - if (CollectionUtils.isEmpty(list)) { - return new ArrayList<>(); - } - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - List employeeList = Lists.newArrayList(); - List> partition = Lists.partition(list, 1000); - for (List longs : partition) { - employeeList.addAll(mapper.getAdminEmployeeByIds(longs)); - } - return employeeList; - } finally { - sqlSession.close(); - } - } - /** * 岗位信息 diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 7c2826fb9..4d395d988 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -9,7 +9,6 @@ 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.datacollection.DataCollectionEmployee; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.dto.SIAccountUtilDTO; @@ -22,7 +21,6 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.siaccount.*; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; @@ -59,6 +57,7 @@ import org.springframework.beans.BeanUtils; import weaver.hrm.User; import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -120,6 +119,11 @@ public class SIAccountBiz extends Service { return (ProgressService) ServiceUtil.getService(ProgressServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SIAccountDetailTempMapper getSIAccountDetailTempMapper() { return MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class); } @@ -128,10 +132,6 @@ public class SIAccountBiz extends Service { return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); } - private EmployMapper getEmployMapper() { - return MapperProxyFactory.getProxy(EmployMapper.class); - } - private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } @@ -1154,7 +1154,6 @@ public class SIAccountBiz extends Service { InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, param.getPaymentOrganization()); encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class, user); - DataCollectionEmployee simpleEmployee = getEmployMapper().getEmployeeById(employeeId); insuranceAccountBatchPO.setAccountant(currentUserName); insuranceAccountBatchPO.setUpdateTime(new Date()); insuranceAccountBatchPO.setSocialPay(socialSum.toPlainString()); @@ -1197,6 +1196,14 @@ public class SIAccountBiz extends Service { InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()); encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class, user); SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(user.getLanguage(),389204, "参数错误")); +// if (insuranceAccountBatchPO.getBillStatus().equals(BillStatusEnum.ARCHIVED.getValue())) { +// int num = checkIfBusinessaccounting(insuranceAccountBatchPO); +// //表示已经被核算过不能重新核算 +// if (num > 0) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "已被薪酬核算给核算过,无法删除!")); +// } +// } + // if(param.getPaymentOrganization()==null){ // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542563,"个税扣缴义务人为空")); // } @@ -2359,11 +2366,19 @@ public class SIAccountBiz extends Service { */ public int checkIfBusinessaccounting(InsuranceAccountBatchPO param) { List list = getSIAccountUtilMapper().checkIfBusinessaccounting(param.getId()); - return (int) list.stream().filter(e -> e.getBillmonth().equals(e.getTaxcycle().substring(0, 7))).count(); - - + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + return (int) list.stream().filter( f -> { + String billMonthBySob = sdf.format(convertSalaryMonthToBillMonth(f.getSalaryMonth(), f.getSocialSecurityCycleType())); + return f.getBillmonth().equals(billMonthBySob.substring(0, 7)); + }).count(); } + public Date convertSalaryMonthToBillMonth(Date salaryMonth, Integer socialSecurityCycleType) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(salaryMonth); + calendar.add(Calendar.MONTH, socialSecurityCycleType - 3); + return calendar.getTime(); + } /** * 更新薪资台账 * diff --git a/src/com/engine/salary/biz/SICategoryBiz.java b/src/com/engine/salary/biz/SICategoryBiz.java index 59f257033..837f91bf1 100644 --- a/src/com/engine/salary/biz/SICategoryBiz.java +++ b/src/com/engine/salary/biz/SICategoryBiz.java @@ -163,7 +163,7 @@ public class SICategoryBiz extends Service { throw new SalaryRunTimeException("isUse is required"); } List insuranceSchemeDetailPOS = new SISchemeBiz().queryListByInsuranceIdIsPayment(id, IsPaymentEnum.YES.getValue()); - if(CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { + if(CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS) && isUse == 0) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 543888, "该福利开启缴费,不可删除(或停用)")); } ICategoryPO iCategoryPO = getByID(id); diff --git a/src/com/engine/salary/constant/SalaryItemConstant.java b/src/com/engine/salary/constant/SalaryItemConstant.java index 790a288cb..26bac736b 100644 --- a/src/com/engine/salary/constant/SalaryItemConstant.java +++ b/src/com/engine/salary/constant/SalaryItemConstant.java @@ -20,5 +20,10 @@ public class SalaryItemConstant { */ public static final String RESULT_IMPORT_FIELD_SIGN="_salaryAcctResultImportFieldSign"; + /** + * 薪资核算导出缓存表头字段key + */ + public static final String RESULT_EXPORT_FIELD_SIGN="_salaryAcctResultExportFieldSign"; + } diff --git a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java index 8d318c69a..70a799d8c 100644 --- a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java +++ b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java @@ -103,5 +103,8 @@ public class DataCollectionEmployee { //是否是系统管理员 private Boolean isAdmin; + //是否外部人员 + private boolean extEmp; + } diff --git a/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java b/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java new file mode 100644 index 000000000..ac68f247f --- /dev/null +++ b/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.extemp.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 数据采集-累计专项附加扣除查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExtEmpQueryParam extends BaseQueryParam { + + //姓名 + private String username; + + +} diff --git a/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java new file mode 100644 index 000000000..f38362d8a --- /dev/null +++ b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java @@ -0,0 +1,101 @@ +package com.engine.salary.entity.extemp.param; + +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 ExtEmpSaveParam { + + private Long id; + + /** + * 姓名 + */ + private String username; + /** + * 部门 + */ + private String departmentName; + /** + * 部门ID + */ + private Long departmentId; + /** + * 分部 + */ + private String subcompanyName; + /** + * 分部ID + */ + private Long subcompanyId; + /** + * 岗位 + */ + private String jobtitleName; + /** + * 岗位ID + */ + private Long jobtitleId; + /** + * 入职日期 + */ + private String companystartdate; + /** + * 手机 + */ + private String mobile; + /** + * 状态编码 + */ + private String status; + /** + * 工号 + */ + private String workcode; + /** + * 性别 + */ + private String sex; + /** + * 邮件 + */ + private String email; + /** + * 电话 + */ + private String telephone; + /** + * 职称 + */ + private String jobcall; + /** + * 出生日期 + */ + private String birthday; + /** + * 身份证号码 + */ + private String idNo; + /** + * 本人开户的银行卡卡号 + */ + private String bankCardNum; + /** + * 本人开户的银行卡开户支行全称 + */ + private String bankName; + +} diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java new file mode 100644 index 000000000..3d67dea25 --- /dev/null +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -0,0 +1,136 @@ +package com.engine.salary.entity.extemp.po; + + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 外部人员 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_external_employee +public class ExtEmpPO { + + private Long id; + /** + * 姓名 + */ + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + private String username; + /** + * 部门 + */ + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + /** + * 部门ID + */ + private Long departmentId; + /** + * 分部 + */ + @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName") + private String subcompanyName; + /** + * 分部ID + */ + private Long subcompanyId; + /** + * 岗位 + */ +// @TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName") + private String jobtitleName; + /** + * 岗位ID + */ + private Long jobtitleId; + /** + * 入职日期 + */ + @TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate") + private String companystartdate; + /** + * 手机 + */ + private String mobile; + /** + * 状态编码 + */ + private String status; + /** + * 工号 + */ + @TableTitle(title = "工号", dataIndex = "workcode", key = "workcode") + private String workcode; + /** + * 性别 + */ + private String sex; + /** + * 邮件 + */ + private String email; + /** + * 电话 + */ + private String telephone; + /** + * 职称 + */ + private String jobcall; + /** + * 出生日期 + */ + private String birthday; + /** + * 身份证号码 + */ + private String idNo; + /** + * 本人开户的银行卡卡号 + */ + private String bankCardNum; + /** + * 本人开户的银行卡开户支行全称 + */ + private String bankName; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 创建人 + */ + private Long creator; + /** + * 修改人 + */ + private Long modifier; + /** + * 创建时间 + */ + private Date createTime; + /** + * 修改时间 + */ + private Date updateTime; + /** + * 租户ID + */ + private String tenantKey; + + private Collection ids; + + + private String departmentOrgName; + private String subcompanyOrgName; +} diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java index e1ad131df..dba599a59 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java @@ -78,6 +78,9 @@ public class SalaryTemplateBO { .autoSendStatus(saveParam.getAutoSendStatus()?1:0) .autoSendDayOfMonth(saveParam.getAutoSendDayOfMonth()) .autoSendTimeOfDay(saveParam.getAutoSendTimeOfDay()) + .ackFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0) + .autoAckDays(saveParam.getAutoAckDays()) + .feedbackUrl(saveParam.getFeedbackUrl()) .createTime(new Date()) .updateTime(new Date()) .creator(employeeId) diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java index 020e858cb..5bc07f1e1 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java @@ -29,10 +29,7 @@ public class SalaryBaseSetFormDTO { // 水印设置 private Object watermarkSetting; - // 签名确认 - private Boolean ackStatus; - - // 员工反馈 - private Boolean feedbackStatus; + // 工资单反馈设置 + private SalaryBillAckFeedbackDTO ackFeedbackSetting; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java new file mode 100644 index 000000000..340e97387 --- /dev/null +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.salaryBill.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Harryxzy + * @ClassName SalaryBillAckFeedbackDTO + * @date 2023/07/12 13:46 + * @description 工资单确认和反馈DTO + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryBillAckFeedbackDTO { + + /** + * 工资单确认反馈是否开启。0:否,1:是 + */ + private String ackStatus; + + /** + * 反馈地址 + */ + private String feedBackUrl; + + /** + * 超时自动确认天数 + */ + private Integer autoAckDays; + +} diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendDetailListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendDetailListDTO.java index 1ecf8a6ab..e18392e20 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendDetailListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendDetailListDTO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.dto; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -14,16 +15,22 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -////"工资单发放详情列表") +//"工资单发放详情列表") public class SalarySendDetailListDTO { -// 主键id") +// 主键id // @JsonSerialize(using = ToStringSerializer.class) private Long id; -// @JsonIgnore private Long employeeId; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 用于发送工资单邮件 */ diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java index 6f976855a..5eb79677b 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryBill.dto; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.AllArgsConstructor; @@ -48,6 +49,12 @@ public class SalarySendInfoListDTO { @TableTitle(title = "发送状态", dataIndex = "sendStatus", key = "sendStatus") private String sendStatus; + @TableTitle(title = "查看状态", dataIndex = "billReadStatus", key = "billReadStatus") + private String billReadStatus; + + @TableTitle(title = "确认状态", dataIndex = "billConfirmStatus", key = "billConfirmStatus") + private String billConfirmStatus; + private String email; private Long salaryAcctRecordId; /** @@ -55,5 +62,18 @@ public class SalarySendInfoListDTO { */ private Integer salaryAcctType; + /** + * 该模板是否开启了工资单反馈确认 + */ + private boolean needAck; + + + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java index d25ec6b98..5dd280387 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java @@ -141,5 +141,10 @@ public class SalarySendListDTO { */ // private Integer haveBackCalc; + /** + * 工资单确认反馈状态 + */ + private Integer ackFeedbackStatus; + } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java index b09f269b0..910e38e10 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java @@ -66,4 +66,20 @@ public class SalaryTemplateBaseSetDTO { // 发送时间 private String autoSendTimeOfDay; + + /** + * 工资单确认反馈状态 + */ + private Boolean ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java index 8f976ec9d..4b5efcd1c 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java @@ -54,4 +54,5 @@ public class SalaryTemplateShowSetDTO { // 薪资项为0时不显示") private Boolean salaryItemZeroStatus; + } diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java index b6ee25db5..5a9f07278 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.param; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.SalaryI18nUtil; @@ -7,6 +8,7 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; import java.util.Map; @@ -33,11 +35,8 @@ public class SalaryBaseSetSaveParam { // 自定义设置内容") private Map wmSetting; - // 是否启用确认") - private Boolean ackStatus; - - // 是否启用反馈") - private Boolean feedbackStatus; + // 工资单确认反馈设置 + private SalaryBillAckFeedbackDTO ackFeedbackSetting; public static void checkParam(SalaryBaseSetSaveParam saveParam, User user) { if (Objects.isNull(saveParam.getWatermarkStatus())) { @@ -52,14 +51,10 @@ public class SalaryBaseSetSaveParam { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 544206, "自定义水印的设置内容必传")); } } + if (Objects.isNull(saveParam.getAckFeedbackSetting()) || StringUtils.isBlank(saveParam.getAckFeedbackSetting().getAckStatus())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(220418, "工资单确认反馈信息必传")); + } -// if (Objects.isNull(saveParam.getAckStatus())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 544207, "是否启用确认必传")); -// } -// -// if (Objects.isNull(saveParam.getFeedbackStatus())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 544208, "是否启用反馈必传")); -// } } } diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java index 3614e2d56..c398e8e09 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java @@ -89,6 +89,22 @@ public class SalaryTemplateSaveParam { // 补发薪资项目设置 private List replenishSalaryItemSetting; + /** + * 工资单确认反馈状态 + */ + private Boolean ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; + public static void checkParam(SalaryTemplateSaveParam saveParam, User user) { if (saveParam.getSalarySobId() == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544117,"薪资账套表的主键id必传;")); diff --git a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java index 5efa58c05..3a0822673 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.po; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -42,6 +43,13 @@ public class SalarySendInfoPO { */ private Long employeeId; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 人员信息表的主键id */ @@ -52,6 +60,21 @@ public class SalarySendInfoPO { */ private Integer sendStatus; + /** + * 查看状态。0:未查看、1:已查看 + */ + private Integer billReadStatus; + + /** + * 确认状态 0:未确认、1:已确认 + */ + private Integer billConfirmStatus; + + /** + * 操作发送工资单人员id + */ + private Long sendEmployeeId; + /** * 发送时间 */ diff --git a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java index f5c416305..fd8e1a1c9 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java @@ -170,5 +170,23 @@ public class SalaryTemplatePO { */ private String tenantKey; + /** + * 工资单确认反馈状态 + */ + private Integer ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; + + + private Collection salarySobIds; } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java index e5f5de8b9..316574a4e 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java @@ -125,6 +125,45 @@ public class SalaryAcctEmployeeBO { return resultList; } + public static List convert2Employee(Collection employee, + SalaryAcctRecordPO salaryAcctRecord, + List salaryArchiveTaxAgentData, + Long employeeId) { + if (CollectionUtils.isEmpty(employee)) { + return Collections.emptyList(); + } + List resultList = Lists.newArrayList(); + Map>> empIdKeyTaxAgentMap = SalaryEntityUtil.group2Map(salaryArchiveTaxAgentData, SalaryArchiveDataDTO::getEmployeeId, SalaryArchiveDataDTO::getTaxAgents); + Date now = new Date(); + for (DataCollectionEmployee emp : employee) { + Set taxAgentIds = Sets.newHashSet(); + Set> taxAgentSet = empIdKeyTaxAgentMap.getOrDefault(emp.getEmployeeId(), Collections.emptySet()); + for (List taxAgents : taxAgentSet) { + taxAgentIds.addAll(SalaryEntityUtil.properties(taxAgents, SalaryArchiveTaxAgentDataDTO::getTaxAgentId)); + } + if (CollectionUtils.isEmpty(taxAgentIds)) { + taxAgentIds.add(0L); + } + for (Long taxAgentId : taxAgentIds) { + SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder() + .salaryAcctRecordId(salaryAcctRecord.getId()) + .salarySobId(salaryAcctRecord.getSalarySobId()) + .salaryMonth(salaryAcctRecord.getSalaryMonth()) + .employeeId(emp.getEmployeeId()) + .employeeType(emp.isExtEmp() ? 1 : 0) + .taxAgentId(taxAgentId) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + resultList.add(salaryAcctEmployee); + } + } + return resultList; + } + public static List> partitionByEmployeeId(List salaryAcctEmployees) { if (CollectionUtils.isEmpty(salaryAcctEmployees)) { diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java index c82ebf8af..f5b3d3bce 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java @@ -60,4 +60,7 @@ public class SalaryAcctResultQueryParam extends BaseQueryParam { private Collection ids; private String workcode; + + //薪资项目id + private Collection salaryItemIds; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index 64a10d30d..1acee8726 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryacct.po; import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -49,6 +50,13 @@ public class SalaryAcctEmployeePO { @SalaryFormulaVar(defaultLabel = "人员id", labelId = 86321, dataType = "number") private Long employeeId; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 个税扣缴义务人id */ diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java index accfb51a2..508bab585 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java @@ -184,12 +184,12 @@ public class SalaryArchiveBO { Date end = localDateRange.getEndDate(); List list = new ArrayList<>(); - allEmployeeIds.forEach(e->{ + allEmployeeIds.forEach(e -> { // 同一个人的档案数据 - List salaryArchives = salaryArchiveList.stream().filter(f->f.getEmployeeId().equals(e)).collect(Collectors.toList()); + List salaryArchives = salaryArchiveList.stream().filter(f -> f.getEmployeeId().equals(e)).collect(Collectors.toList()); List salaryArchiveIds = salaryArchives.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); // 同一个人的薪资项目调整历史数据 - List salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d->salaryArchiveIds.contains(d.getSalaryArchiveId())).collect(Collectors.toList()); + List salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d -> salaryArchiveIds.contains(d.getSalaryArchiveId())).collect(Collectors.toList()); List salaryArchiveItemIds = salaryArchiveItems.stream().map(SalaryArchiveItemPO::getSalaryItemId).distinct().collect(Collectors.toList()); SalaryArchiveDataDTO salaryArchiveData = new SalaryArchiveDataDTO(); @@ -206,7 +206,7 @@ public class SalaryArchiveBO { taxAgent.setTaxAgentId(salaryArchive.getTaxAgentId()); // taxAgent.setIncomeCategory(salaryArchive.getIncomeCategory()); // taxAgent.setSalarySobIds(salaryArchiveSobList.stream().filter(sob->sob.getSalaryArchiveId().equals(salaryArchive.getId())).map(SalaryArchiveSobPO::getSalarySobId).distinct().collect(Collectors.toList())); - taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.before(start)?start:fromDate)).endDate(endDate == null || endDate.after(end)?end:endDate).build()); + taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.before(start) ? start : fromDate)).endDate(endDate == null || endDate.after(end) ? end : endDate).build()); // 薪资项目数据按个税扣缴义务人切割 if (!isOnlyTaxAgent) { // 开始日期 @@ -225,11 +225,11 @@ public class SalaryArchiveBO { if (fromDateItem.after(endTempItem) || endTempItem.before(startItem)) { continue; } - if ( endTempItem.equals(startItem) && flag) { + if (endTempItem.equals(startItem) && flag) { continue; } SalaryArchiveItemDataDTO salaryArchiveItemData = new SalaryArchiveItemDataDTO(); - salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.before(startItem)?startItem:fromDateItem)).endDate(endTempItem).build()); + salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.before(startItem) ? startItem : fromDateItem)).endDate(endTempItem).build()); salaryArchiveItemData.setSalaryItemId(salaryArchiveItem.getSalaryItemId()); salaryArchiveItemData.setValue(salaryArchiveItem.getItemValue()); salaryItemValues.add(salaryArchiveItemData); @@ -326,6 +326,7 @@ public class SalaryArchiveBO { .id(IdGenerator.generate()) .employeeId(change.getEmployeeId()) .taxAgentId(change.getTaxAgentId()) + .employeeType(change.getEmployeeType()) .runStatus(SalaryArchiveStatusEnum.PENDING.getValue()) // .incomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES.getValue()) // .modifier(0L) @@ -387,4 +388,9 @@ public class SalaryArchiveBO { */ private List changeIds; } + + + public static boolean isNotExtEmp(SalaryArchivePO po) { + return po.getEmployeeType() == null || po.getEmployeeType() == 1; + } } diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java index 50226fdb3..a7a1232ae 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.salaryarchive.bo; -import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryArchiveConstant; import com.engine.salary.constant.SalaryDefaultTenantConstant; @@ -18,10 +17,6 @@ import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.*; import com.engine.salary.enums.salarysob.TargetTypeEnum; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentManageRangeService; -import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; -import com.engine.salary.service.impl.TaxAgentManageRangeServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelComment; @@ -33,6 +28,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; +import weaver.hrm.User; import java.time.LocalDate; import java.util.*; @@ -47,15 +43,6 @@ import java.util.stream.Collectors; */ public class SalaryArchiveExcelBO extends Service { - - private SalaryEmployeeService getSalaryEmployeeService() { - return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); - } - - public TaxAgentManageRangeService getTaxAgentManageRangeService() { - return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user); - } - public static String userNameI18n; public static String departmentI18n; public static String jobNumI18n; @@ -353,11 +340,9 @@ public class SalaryArchiveExcelBO extends Service { * @param excelComments * @param errorCount * @param importHandleParam - * @param confValue 人员匹配规则 * @return */ - public static boolean singleRowCheck(List allTodoSalaryArchives, Map map, List headers, int effectiveTimeIndex, List> excelComments, - int errorCount, SalaryArchiveImportHandleParam importHandleParam, String confValue, User user) { + public static boolean singleRowCheck(List allTodoSalaryArchives, Map map, List headers, int effectiveTimeIndex, List> excelComments, int errorCount, SalaryArchiveImportHandleParam importHandleParam, User user) { //是否是流程 boolean process = importHandleParam.isProcess(); @@ -369,27 +354,27 @@ public class SalaryArchiveExcelBO extends Service { String userName = Optional.ofNullable(map.get(userNameI18n)).orElse("").toString(); String deparmentName = Optional.ofNullable(map.get(departmentI18n)).orElse("").toString(); String mobileName = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),125238, "手机号"))).orElse("").toString(); - String jobNum = Optional.ofNullable(map.get(jobNumI18n)).orElse("").toString(); - String hrmStatus = Optional.ofNullable(map.get(hrStatusI18n)).orElse("").toString(); - String workCode = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),1933,"工号"))).orElse("").toString(); -// Optional optionalStatus = importHandleParam.getHrmStatusList().stream().filter(s -> s.getName().equals(hrmStatus)).findFirst(); -// String codeId = optionalStatus.map(status -> status.getCodeId() + "").orElse(""); + String workcode = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(user.getLanguage(),1933,"工号"))).orElse("").toString(); + String validType = importHandleParam.getEmpValidType(); List emps = new ArrayList<>(); - // "0"代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 - if("0".equals(confValue)){ + //外部人员 + if(importHandleParam.isExtEmp()){ emps = importHandleParam.getEmployees().stream().filter(e -> - (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) - && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) - && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName)) -// && (StringUtils.isBlank(jobNum) || Objects.equals(e.getWorkcode(), jobNum)) - ) -// && (StringUtils.isBlank(hrmStatus) || Objects.equals(e.getPersonnelStatus(), codeId)) -// .map(DataCollectionEmployee::getEmployeeId) - .collect(Collectors.toList()); - }else if("1".equals(confValue)){ - emps = importHandleParam.getEmployees().stream().filter(e -> (StringUtils.isBlank(workCode) || Objects.equals(e.getWorkcode(), workCode))) - .collect(Collectors.toList()); + (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) + && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) + && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName))).collect(Collectors.toList()); + }else { + if ("0".equals(validType)) { + //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 + emps = importHandleParam.getEmployees().stream().filter(e -> + (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) + && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) + && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName))).collect(Collectors.toList()); + } else if ("1".equals(validType)) { + emps = importHandleParam.getEmployees().stream().filter(e -> (StringUtils.isBlank(workcode) || Objects.equals(e.getWorkcode(), workcode))) + .collect(Collectors.toList()); + } } List employeeSameIds = new ArrayList<>(); @@ -411,7 +396,7 @@ public class SalaryArchiveExcelBO extends Service { if (employeeId == null) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowindex + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542649, "人员存在重复数据,请确定姓名、部门、手机号或工号唯一")); + errorMessageMap.put("message", rowindex + SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "查找人员失败,请确定姓名、部门、手机号正确且唯一")); excelComments.add(errorMessageMap); isError = true; return isError; @@ -529,7 +514,7 @@ public class SalaryArchiveExcelBO extends Service { // 必填判空 boolean isEmpty = StringUtils.isEmpty(cellVal) && - ((userNameI18n.equals(key.toString()) && !process && "0".equals(confValue)) || taxAgentI18n.equals(key.toString()) || incomeCategoryI18n.equals(key.toString()) || salarySobI18n.equals(key.toString()) + ((userNameI18n.equals(key.toString()) && !process) || taxAgentI18n.equals(key.toString()) || incomeCategoryI18n.equals(key.toString()) || salarySobI18n.equals(key.toString()) // 定薪列表初始化导入必填: 起始发薪日期、生效日期 || ((payStartDateI18n.equals(key.toString()) || effectiveTimeI18n.equals(key.toString())) && importHandleParam.isInit()) // 定薪列表调薪必填: 调整原因、生效日期 diff --git a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java index 00e64d7d6..107b71b50 100644 --- a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java +++ b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java @@ -36,6 +36,8 @@ public class SalaryArchiveListDTO { @TableTitle(title = "人员信息表的主键id", dataIndex = "employeeId", key = "employeeId") private Long employeeId; + private Integer employeeType; + /** * 姓名 */ diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java index cf5173288..17b552ca6 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java @@ -62,6 +62,11 @@ public class SalaryArchiveImportHandleParam { */ boolean isProcess; + /** + * 是否是外部人员 + */ + boolean isExtEmp; + /** * 说明 */ @@ -72,6 +77,11 @@ public class SalaryArchiveImportHandleParam { Long currentEmployeeId; String tenantKey; + /** + * 人员验证方式 + */ + String empValidType; + // 待定薪列表 boolean isPendingList; // 定薪列表 @@ -86,10 +96,6 @@ public class SalaryArchiveImportHandleParam { */ List employees; - /** - * 租户下的人员状态 - */ -// List hrmStatusList; /** * 获取所有个税扣缴义务人 diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index f52e8bee2..12a02998d 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -83,4 +83,9 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { private SalaryArchiveListTypeEnum listType; private String workcode; + /** + * 是否是外部系统档案 + */ + private boolean extSalaryArchiveList; + } diff --git a/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java b/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java index 542b69380..1b44a0d7a 100644 --- a/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java +++ b/src/com/engine/salary/entity/salaryarchive/po/SalaryArchivePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryarchive.po; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveAddTypeEnum; import com.fasterxml.jackson.annotation.JsonFormat; @@ -57,6 +58,14 @@ public class SalaryArchivePO { */ private String runStatus; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + /** * 定薪类型 * @@ -102,6 +111,7 @@ public class SalaryArchivePO { private Long taxAgentId; + //---------条件------- private Collection ids; private Collection employeeIds; diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index 237366d7f..62ed13872 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -100,6 +100,7 @@ public class SalaryItemBO { .systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY)) .useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .useDefault(salaryItemPO.getUseDefault()) + .hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .roundingMode(Optional.ofNullable(salaryRoundingModeEnum) .map(e -> SalaryI18nUtil.getI18nLabel(user.getLanguage(),e.getLabelId(), e.getDefaultLabel())) .orElse(StringUtils.EMPTY)) @@ -146,6 +147,7 @@ public class SalaryItemBO { .systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY)) .useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .useDefault(salaryItemPO.getUseDefault()) + .hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .roundingMode(Optional.ofNullable(salaryRoundingModeEnum) .map(e -> SalaryI18nUtil.getI18nLabel(user.getLanguage(), e.getLabelId(), e.getDefaultLabel())) .orElse(StringUtils.EMPTY)) @@ -182,6 +184,7 @@ public class SalaryItemBO { .setName(salaryItemPO.getName()) .setSystemType(salaryItemPO.getSystemType()) .setUseDefault(salaryItemPO.getUseDefault()) + .setHideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .setRoundingMode(salaryItemPO.getRoundingMode()) .setPattern(salaryItemPO.getPattern()) @@ -257,6 +260,7 @@ public class SalaryItemBO { .sysSalaryItemId(NumberUtils.LONG_ZERO) .useDefault(saveParam.getUseDefault()) .useInEmployeeSalary(saveParam.getUseInEmployeeSalary()) + .hideDefault(saveParam.getHideDefault()) .roundingMode(saveParam.getRoundingMode() == null ? SalaryRoundingModeEnum.ROUNDING.getValue() : saveParam.getRoundingMode()) .pattern(Optional.ofNullable(saveParam.getPattern()).orElse(2)) .valueType(saveParam.getValueType()) diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index ea8edd533..b496aeb3e 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -94,6 +94,7 @@ public class SysSalaryItemBO { .setCanEdit(sysSalaryItemPO.getCanEdit()) .setSystemType(sysSalaryItemPO.getSystemType()) .setUseDefault(sysSalaryItemPO.getUseDefault()) + .setHideDefault(0) .setUseInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary()) .setRoundingMode(sysSalaryItemPO.getRoundingMode()) .setPattern(sysSalaryItemPO.getPattern()) diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java index 96eaf0bec..e8a2afa8f 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java @@ -40,6 +40,11 @@ public class SalaryFieldListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时隐藏 + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 95903867d..c00b85844 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -42,6 +42,9 @@ public class SalaryItemFormDTO { //默认使用") private Integer useDefault; + //核算时隐藏") + private Integer hideDefault; + //薪资档案引用") private Integer useInEmployeeSalary; diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index 510a75f18..adb0dc4b1 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -51,6 +51,11 @@ public class SalaryItemListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时隐藏 + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java index ef88c307a..ae0ecf30f 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java @@ -49,6 +49,11 @@ public class SalaryItemSobListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时默认隐藏 + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 00325afc1..a2c6fa84b 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -49,6 +49,10 @@ public class SalaryItemSaveParam { //薪资档案引用 private Integer useInEmployeeSalary; + //核算时默认隐藏 + @DataCheck(require = true, message = "核算时隐藏不允许为空") + private Integer hideDefault; + /** * 舍入规则 diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index f54afc630..3115f0efa 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -64,6 +64,11 @@ public class SalaryItemPO { */ private Integer useInEmployeeSalary; + /** + * 核算时隐藏 + */ + private Integer hideDefault; + /** * 进位规则 * diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 311dabd63..3e2513908 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -12,10 +12,7 @@ import lombok.Data; import lombok.experimental.Accessors; import org.apache.commons.lang3.math.NumberUtils; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -70,6 +67,8 @@ public class SalarySobItemBO { List defaultSalaryItemPOS, Long employeeId, String tenantKey) { Date now = new Date(); + // 需要保存的隐藏项目 + List needInsertItemHides = new ArrayList<>(); // 处理薪资账套默认的薪资项目分类 Map salarySobItemGroupIdMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroupPOS.size()); List salarySobItemGroups = Lists.newArrayListWithExpectedSize(salarySobDefaultItemGroupPOS.size()); @@ -88,8 +87,23 @@ public class SalarySobItemBO { .deleteType(NumberUtils.INTEGER_ZERO) .build()); salarySobItemGroupIdMap.put(salarySobDefaultItemGroupPO.getId(), salarySobItemGroupId); + + // 保存薪资项目分类隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salarySobItemGroupId) + .isGroup(1) + .itemHide(0L) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } + List salarySobItems = Lists.newArrayListWithExpectedSize(defaultSalaryItemPOS.size()); // 处理薪资账套默认的系统薪资项目 Set sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItemPOS, SalarySobDefaultItemPO::getSysSalaryItemId); @@ -113,6 +127,20 @@ public class SalarySobItemBO { .tenantKey(tenantKey) .deleteType(NumberUtils.INTEGER_ZERO) .build()); + + // 保存薪资项目隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salaryItemPO.getId()) + .isGroup(0) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault()== null ? 0 : salaryItemPO.getHideDefault())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } // 处理薪资账套默认的自定义薪资项目(开启了"默认使用") for (int i = 0; i < defaultSalaryItemPOS.size(); i++) { @@ -139,6 +167,19 @@ public class SalarySobItemBO { .tenantKey(tenantKey) .deleteType(NumberUtils.INTEGER_ZERO) .build()); + // 保存薪资项目隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salaryItemPO.getId()) + .isGroup(0) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } // 薪资账套默认的回算薪资项目 @@ -165,7 +206,8 @@ public class SalarySobItemBO { salarySobBackItems.add(salarySobBackItemPO); } - return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups).setNeedInsertSalarySobBackItems(salarySobBackItems); + return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups) + .setNeedInsertSalarySobBackItems(salarySobBackItems).setNeedInsertItemHides(needInsertItemHides); } @Data @@ -186,5 +228,10 @@ public class SalarySobItemBO { * 需要保存的回算薪资项目 */ List needInsertSalarySobBackItems; + + /** + * 需要保存的薪资项目隐藏信息 + */ + List needInsertItemHides; } } diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java new file mode 100644 index 000000000..69aedbb32 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java @@ -0,0 +1,42 @@ +package com.engine.salary.entity.salarysob.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 外部人员管理范围保存参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobRangeExtSaveParam { + + //薪资账套的id + @DataCheck(require = true, message = "薪资账套的ID不允许为空") + private Long salarySobId; + + + /** + * 对象id + */ + private List targetIds; + + /** + * 对象类型。1:外部人员 + */ + private Long targetType; + + + +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java new file mode 100644 index 000000000..1e2c82838 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 个税扣缴义务人的管理范围表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobExtRangePO { + + /** + * 主键id + */ + private Long id; + /** + * 账套id + */ + private Long salarySobId; + /** + * 对象id + */ + private Long targetId; + /** + * 对象类型。1:外部人员 + */ + private Integer targetType; + /** + * 租户ID + */ + private String tenantKey; + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + //主键id集合 + private Collection ids; + + @TableTitle(title = "名称", dataIndex = "targetName", key = "targetName") + private String targetName; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/siaccount/dto/SIAccountUtilDTO.java b/src/com/engine/salary/entity/siaccount/dto/SIAccountUtilDTO.java index 841753485..63921df3c 100644 --- a/src/com/engine/salary/entity/siaccount/dto/SIAccountUtilDTO.java +++ b/src/com/engine/salary/entity/siaccount/dto/SIAccountUtilDTO.java @@ -6,6 +6,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; + @Data @Builder @NoArgsConstructor @@ -23,4 +25,12 @@ public class SIAccountUtilDTO { * 税款所属期 */ private String taxcycle; + /** + * 薪资所属月 + */ + private Date salaryMonth; + /** + * 社保福利所属期。1:上上月、2:上月、3:本月、4:下月 + */ + private Integer socialSecurityCycleType; } diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentManageRangeExtSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentManageRangeExtSaveParam.java new file mode 100644 index 000000000..a4e4969cf --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentManageRangeExtSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.taxagent.param; + +import lombok.Data; + +import java.util.List; + +/** + * 外部人员管理范围保存参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class TaxAgentManageRangeExtSaveParam { + + /** + * 对象id + */ + private List targetIds; + + /** + * 对象类型。1:外部人员 + */ + private Long targetType; + + /** + * 个税扣缴义务人的id + */ + private Long taxAgentId; + + //是否同步/异步执行生成档案 + private boolean sync; + +} diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java new file mode 100644 index 000000000..29ea1586c --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxagent.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 个税扣缴义务人人员范围查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//个税扣缴义务人人员范围查询参数 +public class TaxAgentRangeExtQueryParam extends BaseQueryParam { + + //个税扣缴义务人id + private Long taxAgentId; + + //对象") + private String targetName; +} diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpChangePO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpChangePO.java index 505112ce2..90d382f0a 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpChangePO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpChangePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxagent.po; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import lombok.AllArgsConstructor; @@ -59,6 +60,13 @@ public class TaxAgentEmpChangePO { */ private Integer moduleType; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpPO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpPO.java index 671adb4a6..ba8c2f0c1 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpPO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentEmpPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxagent.po; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -68,6 +69,13 @@ public class TaxAgentEmpPO { */ private Date updateTime; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + private Collection taxAgentIds; private Collection ids; } diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java new file mode 100644 index 000000000..071380108 --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java @@ -0,0 +1,69 @@ +package com.engine.salary.entity.taxagent.po; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 个税扣缴义务人的管理范围表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxAgentExtRangePO { + + /** + * 主键id + */ + private Long id; + /** + * 对象id + */ + private Long targetId; + /** + * 对象类型。1:外部人员 + */ + private Integer targetType; + /** + * 个税扣缴义务人的id + */ + private Long taxAgentId; + /** + * 租户ID + */ + private String tenantKey; + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + //主键id集合 + private Collection ids; + + /** + * 名字 + */ + @TableTitle(title = "姓名",key = "targetName",dataIndex = "targetName") + private String targetName; + + +} \ No newline at end of file diff --git a/src/com/engine/salary/enums/datacollection/DataCollectionEmployeeTypeEnum.java b/src/com/engine/salary/enums/datacollection/DataCollectionEmployeeTypeEnum.java new file mode 100644 index 000000000..6811ae3fb --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/DataCollectionEmployeeTypeEnum.java @@ -0,0 +1,53 @@ +package com.engine.salary.enums.datacollection; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Optional; + +/** + * 人员类型 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum DataCollectionEmployeeTypeEnum implements BaseEnum { + + ORGANIZATION(0, "组织架构", 109125), + EXT_EMPLOYEE(1, "非系统人员", 119127), + ; + + private int value; + + private String defaultLabel; + + private int labelId; + + DataCollectionEmployeeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + public static String getNameByValue(String value) { + Optional optional = Arrays.stream(DataCollectionEmployeeTypeEnum.values()).filter(r -> r.getValue().toString().equals(value)).findFirst(); + return optional.isPresent() ? optional.get().name() : ""; + } +} diff --git a/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java new file mode 100644 index 000000000..64b0cdde2 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java @@ -0,0 +1,54 @@ +package com.engine.salary.enums.datacollection; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Optional; + +/** + * 人员使用枚举 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum UseEmployeeTypeEnum implements BaseEnum { + + ORG(0, "组织架构", 109125), + EXT(1, "非系统人员", 119127), + ALL(2, "所有人员", 119127), + ; + + private int value; + + private String defaultLabel; + + private int labelId; + + UseEmployeeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + public static String getNameByValue(String value) { + Optional optional = Arrays.stream(UseEmployeeTypeEnum.values()).filter(r -> r.getValue().toString().equals(value)).findFirst(); + return optional.isPresent() ? optional.get().name() : ""; + } +} diff --git a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java index f0827ea58..859633792 100644 --- a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java +++ b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java @@ -16,7 +16,8 @@ public enum SalaryArchiveListTypeEnum { PENDING("PENDING", SalaryI18nUtil.getI18nLabel(542689, "待定薪"), 542689), FIXED("FIXED", SalaryI18nUtil.getI18nLabel(542690, "发薪"), 542690), SUSPEND("SUSPEND", SalaryI18nUtil.getI18nLabel(542691, "待停薪"), 542691), - STOP("STOP", SalaryI18nUtil.getI18nLabel(542692, "停薪"), 542692); + STOP("STOP", SalaryI18nUtil.getI18nLabel(542692, "停薪"), 542692), + EXT("EXT", "非系统人员", 542679); private String value; diff --git a/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java new file mode 100644 index 000000000..2a1626532 --- /dev/null +++ b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java @@ -0,0 +1,71 @@ +package com.engine.salary.enums.salarybill; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; + +/** + * @ClassName BillConfimStatusEnum + * @author Harryxzy + * @date 2023/7/10 17:03 + * @description 工资单确认 + */ +public enum BillConfimStatusEnum implements BaseEnum { + + UNCONFIRMED(0, "未确认", 93286), + CONFIRMED(1, "已确认", 93212), + FEEDBACK(2, "已反馈", 0); + + private final int value; + + private final String defaultLabel; + + private final int labelId; + + BillConfimStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static String getDefaultLabelByValue(Integer value) { + if (value == null) { + return ""; + } + BillConfimStatusEnum[] enumAry = BillConfimStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getValue().equals(value)) { + return enumAry[i].getDefaultLabel(); + } + } + return ""; + } + + public static String getNameByValue(Integer value) { + if (value == null) { + return ""; + } + BillConfimStatusEnum[] enumAry = BillConfimStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (enumAry[i].getValue().equals(value)) { + return enumAry[i].name(); + } + } + return ""; + } +} diff --git a/src/com/engine/salary/enums/salarybill/BillReadStatusEnum.java b/src/com/engine/salary/enums/salarybill/BillReadStatusEnum.java new file mode 100644 index 000000000..09fd47107 --- /dev/null +++ b/src/com/engine/salary/enums/salarybill/BillReadStatusEnum.java @@ -0,0 +1,70 @@ +package com.engine.salary.enums.salarybill; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; + +/** + * @ClassName BillReadStatusEnum + * @author Harryxzy + * @date 2023/7/10 17:13 + * @description 工资单查看 + */ +public enum BillReadStatusEnum implements BaseEnum { + + UNREAD(0, "未查看", 93286), + READED(1, "已查看", 93212); + + private int value; + + private String defaultLabel; + + private int labelId; + + BillReadStatusEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + public static String getDefaultLabelByValue(Integer value) { + if (value == null) { + return ""; + } + BillReadStatusEnum[] enumAry = BillReadStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (Integer.valueOf(enumAry[i].getValue()).equals(value)) { + return enumAry[i].getDefaultLabel(); + } + } + return ""; + } + + public static String getNameByValue(Integer value) { + if (value == null) { + return ""; + } + BillReadStatusEnum[] enumAry = BillReadStatusEnum.values(); + for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ + if (Integer.valueOf(enumAry[i].getValue()).equals(value)) { + return enumAry[i].name(); + } + } + return ""; + } +} diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml index ba93b03b2..db76c9cb2 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml @@ -536,32 +536,60 @@ SELECT FROM hrsa_salary_archive_item t1 - LEFT JOIN hrmresource e ON e.id = t1.employee_id - LEFT JOIN hrmdepartment d ON d.id = e.departmentid LEFT JOIN hrmresource o ON o.id = t1.operator LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id WHERE t1.delete_type = 0 - AND e.status != '7' and (e.accounttype is null or e.accounttype = 0) AND t1.salary_item_id IN #{id} - - - AND - ( - e.lastname like CONCAT('%',#{param.keyword},'%') - OR d.departmentname like CONCAT('%',#{param.keyword},'%') - OR t2.name like CONCAT('%',#{param.keyword},'%') - ) - AND t2.name like CONCAT('%',#{param.adjustItem},'%') - + + AND t1.id IN + + #{id} + + + + + AND t1.employee_id = #{param.employeeId} + + + + AND t1.salary_archive_id = #{param.salaryArchiveId} + + + + AND d.id IN + + #{id} + + + + + AND t1.adjust_reason = #{param.adjustReason} + + + + AND (t1.effective_time BETWEEN #{param.effectiveTime[0]} AND #{param.effectiveTime[1]}) + + + + AND (t1.operate_time BETWEEN CONCAT(#{param.operateTime[0]},' 00:00:00') AND + CONCAT(#{param.operateTime[1]},' 23:59:59')) + + + + AND t1.operator IN + + #{id} + + ORDER BY t1.effective_time DESC,t1.id DESC t1.id, t1.employee_id, - e.lastname as username, - e.status AS employeeStatus, - d.departmentname AS departmentName, t1.effective_time, t1.adjust_reason, t2.name AS adjust_item, diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java index 952c37bbb..14d179d2c 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java @@ -51,6 +51,13 @@ public interface SalaryArchiveMapper { */ List list(@Param("param") SalaryArchiveQueryParam param); + /** + * 外部人员 + * @param queryParam + * @return + */ + List listExtSalaryArchive(@Param("param")SalaryArchiveQueryParam queryParam); + /** * 批量插入 diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index b5adf6ec8..48b6acc51 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.pay_start_date , t.pay_end_date , t.run_status + , t.employee_type @@ -53,6 +55,7 @@ pay_start_date=#{payStartDate}, pay_end_date=#{payEndDate}, run_status=#{runStatus}, + employee_type=#{employeeType}, WHERE id = #{id} @@ -88,6 +91,7 @@ , t.pay_start_date , t.pay_end_date , t.run_status + , t.employee_type , e.mobile , e.workcode , e.lastname as username @@ -110,6 +114,7 @@ LEFT JOIN hrmdepartment d ON d.id = e.departmentid LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1 WHERE t.delete_type = 0 + and t.employee_type is null and e.status not in (7) and (e.accounttype is null or e.accounttype = 0) @@ -194,6 +199,7 @@ LEFT JOIN hrmdepartment d ON d.id = e.departmentid LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1 WHERE t.delete_type = 0 + and t.employee_type is null and e.status not in (7) and (e.accounttype is null or e.accounttype = 0) @@ -275,6 +281,7 @@ LEFT JOIN hrmdepartment d ON d.id = e.departmentid LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1 WHERE t.delete_type = 0 + and t.employee_type is null and e.status not in (7) and (e.accounttype is null or e.accounttype = 0) @@ -345,6 +352,95 @@ + + + INSERT INTO hrsa_salary_archive ( id, @@ -356,7 +452,8 @@ tax_agent_id, pay_start_date, pay_end_date, - run_status + run_status, + employee_type ) VALUES @@ -370,7 +467,8 @@ #{item.taxAgentId}, #{item.payStartDate}, #{item.payEndDate}, - #{item.runStatus} + #{item.runStatus}, + #{item.employeeType} ) @@ -385,7 +483,8 @@ tax_agent_id, pay_start_date, pay_end_date, - run_status + run_status, + employee_type ) @@ -399,7 +498,8 @@ #{item.taxAgentId,jdbcType=DOUBLE}, #{item.payStartDate,jdbcType=DATE}, #{item.payEndDate,jdbcType=DATE}, - #{item.runStatus,jdbcType=VARCHAR} + #{item.runStatus,jdbcType=VARCHAR}, + #{item.employeeType,jdbcType=INTEGER} from dual @@ -415,7 +515,8 @@ tax_agent_id, pay_start_date, pay_end_date, - run_status + run_status, + employee_type ) VALUES ( @@ -428,7 +529,8 @@ #{item.taxAgentId}, #{item.payStartDate}, #{item.payEndDate}, - #{item.runStatus} + #{item.runStatus}, + #{item.employeeType} ) diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.java b/src/com/engine/salary/mapper/datacollection/EmployMapper.java index 496f00ed0..d73cef7ba 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.java @@ -14,20 +14,34 @@ import java.util.List; public interface EmployMapper { + /** - * 获取所有员工 + * 只查人力资源表 + * @return + */ + List listAll(); + + /** + * 获取所有员工,关联部门 * * @return */ List listEmployee(); + /** + * 单表查询 + * @param ids + * @return + */ List getEmployeeByIds(@Param("collection") List ids); + /** + * 多表联查 + * @param ids + * @return + */ List getEmployeeByIdsAll(@Param("collection") List ids); - List getAdminEmployeeByIds(@Param("collection") List list); - - List getEmployeeIdsByUserName(@Param("userName") String userName); /** * 根据薪资账套的人员范围转换而成的查询参数查询人员 @@ -37,24 +51,40 @@ public interface EmployMapper { */ List listByParams(@Param("params") Collection queryParams); + /** + * 多表,详细信息 + * @param employeeId + * @return + */ DataCollectionEmployee getEmployeeById(Long employeeId); - List listAllFields(); - /** * 报表专用 * @return */ List listAllForReport(); + /** + * 所以岗位 + * @param ids + * @return + */ List listPositionInfo(@Param("collection") List ids); + /** + * 所以部门 + * @param departmentIds + * @return + */ List getDeptInfoList(@Param("departmentIds") List departmentIds); + /** + * 所以分部 + * @param subDepartmentIds + * @return + */ List getSubCompanyInfoList(@Param("subDepartmentIds") List subDepartmentIds); - List listAll(); - List listHrmInfoByIdAndName(@Param("param") HrmQueryParam param); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index 298dc2fbe..9965888f7 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -85,19 +85,6 @@ - - - select - a.LASTNAME as username - from hrmresource a - where - e.status not in (7) - and (e.accounttype is null or e.accounttype = 0) - - + SELECT + + FROM hrsa_external_employee t + WHERE delete_type = 0 + + + + + + + + + + + + + + + + + INSERT INTO hrsa_external_employee + + + + id, + + + username, + + + department_name, + + + department_id, + + + subcompany_name, + + + subcompany_id, + + + jobtitle_name, + + + jobtitle_id, + + + companystartdate, + + + mobile, + + + status, + + + workcode, + + + sex, + + + email, + + + telephone, + + + jobcall, + + + birthday, + + + id_no, + + + bank_card_num, + + + bank_name, + + + delete_type, + + + creator, + + + modifier, + + + create_time, + + + update_time, + + + tenant_key, + + + + + #{id}, + + + #{username}, + + + #{departmentName}, + + + #{departmentId}, + + + #{subcompanyName}, + + + #{subcompanyId}, + + + #{jobtitleName}, + + + #{jobtitleId}, + + + #{companystartdate}, + + + #{mobile}, + + + #{status}, + + + #{workcode}, + + + #{sex}, + + + #{email}, + + + #{telephone}, + + + #{jobcall}, + + + #{birthday}, + + + #{idNo}, + + + #{bankCardNum}, + + + #{bankName}, + + + #{deleteType}, + + + #{creator}, + + + #{modifier}, + + + #{createTime}, + + + #{updateTime}, + + + #{tenantKey}, + + + + + + + UPDATE hrsa_external_employee + + username=#{username}, + department_name=#{departmentName}, + department_id=#{departmentId}, + subcompany_name=#{subcompanyName}, + subcompany_id=#{subcompanyId}, + jobtitle_name=#{jobtitleName}, + jobtitle_id=#{jobtitleId}, + companystartdate=#{companystartdate}, + mobile=#{mobile}, + status=#{status}, + workcode=#{workcode}, + sex=#{sex}, + email=#{email}, + telephone=#{telephone}, + jobcall=#{jobcall}, + birthday=#{birthday}, + id_no=#{idNo}, + bank_card_num=#{bankCardNum}, + bank_name=#{bankName}, + delete_type=#{deleteType}, + creator=#{creator}, + modifier=#{modifier}, + create_time=#{createTime}, + update_time=#{updateTime}, + tenant_key=#{tenantKey}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_external_employee + + + username=#{username}, + + + department_name=#{departmentName}, + + + department_id=#{departmentId}, + + + subcompany_name=#{subcompanyName}, + + + subcompany_id=#{subcompanyId}, + + + jobtitle_name=#{jobtitleName}, + + + jobtitle_id=#{jobtitleId}, + + + companystartdate=#{companystartdate}, + + + mobile=#{mobile}, + + + status=#{status}, + + + workcode=#{workcode}, + + + sex=#{sex}, + + + email=#{email}, + + + telephone=#{telephone}, + + + jobcall=#{jobcall}, + + + birthday=#{birthday}, + + + id_no=#{idNo}, + + + bank_card_num=#{bankCardNum}, + + + bank_name=#{bankName}, + + + delete_type=#{deleteType}, + + + creator=#{creator}, + + + modifier=#{modifier}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + tenant_key=#{tenantKey}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_external_employee + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index c4a31854d..d48bd3629 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -14,6 +14,7 @@ + @@ -44,13 +46,13 @@ . id , emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) VALUES ( @@ -63,14 +65,15 @@ #{emp.createTime}, #{emp.updateTime}, #{emp.deleteType}, - #{emp.tenantKey} + #{emp.tenantKey}, + #{emp.employeeType} ) INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) select @@ -83,7 +86,8 @@ #{emp.createTime,jdbcType=DATE}, #{emp.updateTime,jdbcType=DATE}, #{emp.deleteType,jdbcType=INTEGER}, - #{emp.tenantKey,jdbcType=VARCHAR} + #{emp.tenantKey,jdbcType=VARCHAR}, + #{emp.employeeType,jdbcType=INTEGER} from dual @@ -91,7 +95,7 @@ INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) VALUES ( #{emp.salaryAcctRecordId}, @@ -103,7 +107,8 @@ #{emp.createTime}, #{emp.updateTime}, #{emp.deleteType}, - #{emp.tenantKey} + #{emp.tenantKey}, + #{emp.employeeType} ) @@ -151,13 +156,13 @@ SELECT DISTINCT emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type FROM ( SELECT id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key + creator, create_time, update_time, delete_type, tenant_key,employee_type FROM hrsa_salary_acct_emp WHERE @@ -232,13 +237,13 @@ SELECT DISTINCT emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type FROM ( SELECT id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key + creator, create_time, update_time, delete_type, tenant_key,employee_type FROM hrsa_salary_acct_emp WHERE @@ -944,6 +949,7 @@ , t.update_time , t.delete_type , t.tenant_key + , t.employee_type diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java index 140c47376..2da9e21b9 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java @@ -101,4 +101,17 @@ public interface SalarySendInfoMapper { void deleteBySalaryAcctRecordIds(@Param("salaryAcctRecordId") Collection ids); List getNeedSendInfoList(@Param("salarySendIds") List salarySendIds); + + /** + * 自动确认工资单 + * @param needAutoIds + */ + void autoConfirmSalaryBill(@Param("ids") List needAutoIds); + + /** + * 根据薪资账套id获取已发送,确认状态为未确认的工资单 + * @param salarySobIds + * @return + */ + List listUnConfirmedSendInfo(@Param("salarySobIds") List salarySobIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml index 0b96d4c22..0895b3560 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml @@ -17,6 +17,7 @@ + @@ -36,6 +37,10 @@ , t.delete_type , t.tenant_key , t.salary_acct_type + , t.employee_type + , t.bill_read_status + , t.bill_confirm_status + , t.send_employee_id update hrsa_salary_send_info @@ -68,7 +73,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) VALUES @@ -84,7 +90,8 @@ #{item.createTime}, #{item.updateTime}, #{item.tenantKey}, - #{item.salaryAcctType} + #{item.salaryAcctType}, + #{item.employeeType} ) @@ -101,7 +108,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) @@ -117,7 +125,8 @@ #{item.createTime,jdbcType=DATE}, #{item.updateTime,jdbcType=DATE}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.salaryAcctType,jdbcType=INTEGER} + #{item.salaryAcctType,jdbcType=INTEGER}, + #{item.employeeType,jdbcType=INTEGER} from dual @@ -135,7 +144,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) VALUES ( @@ -150,7 +160,8 @@ #{item.createTime}, #{item.updateTime}, #{item.tenantKey}, - #{item.salaryAcctType} + #{item.salaryAcctType}, + #{item.employeeType} ) @@ -168,6 +179,9 @@ t1.send_status, t1.employee_id, t1.salary_month, + t1.employee_type, + t1.bill_read_status as billReadStatus, + t1.bill_confirm_status as billConfirmStatus, e.email @@ -609,7 +623,16 @@ delete_type = #{po.deleteType}, - salary_template = #{po.salaryTemplate} + salary_template = #{po.salaryTemplate}, + + + bill_read_status = #{po.billReadStatus}, + + + bill_confirm_status = #{po.billConfirmStatus}, + + + send_employee_id = #{po.sendEmployeeId} @@ -682,6 +705,12 @@ AND tenant_key = #{tenantKey} + + AND bill_confirm_status = #{billConfirmStatus} + + + AND bill_read_status = #{billReadStatus} + ORDER BY id DESC + - + UPDATE hrsa_salary_send_info @@ -709,9 +752,6 @@ salary_month=#{salaryMonth}, - - use_type=#{useType}, - salary_acct_record_id=#{salaryAcctRecordId}, @@ -745,8 +785,27 @@ tenant_key=#{tenantKey}, + + bill_read_status=#{billReadStatus}, + + + bill_confirm_status=#{billConfirmStatus}, + WHERE id = #{id} AND delete_type = 0 + + UPDATE hrsa_salary_send_info + set + bill_confirm_status = 1 + where + delete_type = 0 + + AND id IN + + #{id} + + + diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java index ef1e6f6cb..95e3e73ed 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java +++ b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java @@ -65,4 +65,6 @@ public interface SalarySendMapper { void deleteBySalaryAcctRecordIds(@Param("salaryAcctRecordId") Collection ids); List getNeedSendListBySalarySobIds(@Param("salarySobIds")List salarySobIds); + + List getByIds(@Param("ids") List salarySendId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml index 5b87e3774..c78a00525 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml @@ -252,6 +252,18 @@ + diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index 56cd60808..29a016b93 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -48,13 +48,16 @@ , t.salary_item_null_status , t.salary_item_zero_status , t.salary_item_setting - , replenish_name - , replenish_rule - , replenish_salary_item_setting - , auto_send_status - , auto_send_cycle_type - , auto_send_day_of_month - , auto_send_time_of_day + , t.replenish_name + , t.replenish_rule + , t.replenish_salary_item_setting + , t.auto_send_status + , t.auto_send_cycle_type + , t.auto_send_day_of_month + , t.auto_send_time_of_day + , t.ack_feedback_status + , t.auto_ack_days + , t.feedback_url , t.create_time , t.update_time , t.creator @@ -84,6 +87,9 @@ auto_send_cycle_type, auto_send_day_of_month, auto_send_time_of_day, + ack_feedback_status, + auto_ack_days, + feedback_url, create_time, update_time, creator, @@ -321,6 +327,9 @@ AND auto_send_status = #{autoSendStatus} + + AND ack_feedback_status = #{ackFeedbackStatus} + AND salary_sob_id IN @@ -513,6 +522,15 @@ auto_send_time_of_day=#{autoSendTimeOfDay}, + + ack_feedback_status=#{ackFeedbackStatus}, + + + auto_ack_days=#{autoAckDays}, + + + feedback_url=#{feedbackUrl}, + create_time=#{createTime}, @@ -603,6 +621,15 @@ auto_send_time_of_day, + + ack_feedback_status, + + + auto_ack_days, + + + feedback_url, + create_time, @@ -689,6 +716,15 @@ #{autoSendTimeOfDay}, + + #{ackFeedbackStatus}, + + + #{autoAckDays}, + + + #{feedbackUrl}, + #{createTime}, @@ -785,6 +821,15 @@ auto_send_time_of_day, + + ack_feedback_status, + + + auto_ack_days, + + + feedback_url, + create_time, @@ -871,6 +916,15 @@ #{autoSendTimeOfDay}, + + #{ackFeedbackStatus}, + + + #{autoAckDays}, + + + #{feedbackUrl}, + #{createTime}, diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index 557ff7364..7dd705c72 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -50,7 +50,8 @@ t.data_type, t.shared_type, t.tax_agent_ids, - t.sorted_index + t.sorted_index, + t.hide_default @@ -168,6 +169,9 @@ use_in_employee_salary, + + hide_default, + rounding_mode, @@ -236,6 +240,9 @@ #{useInEmployeeSalary}, + + #{hideDefault}, + #{roundingMode}, @@ -307,6 +314,9 @@ use_in_employee_salary=#{useInEmployeeSalary}, + + hide_default=#{hideDefault}, + rounding_mode=#{roundingMode}, diff --git a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java index baf9716cb..64fc27445 100644 --- a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java +++ b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java @@ -20,6 +20,13 @@ public interface SysSalaryItemMapper { * @return */ List listSome(SysSalaryItemPO po); + + /** + * 条件查询 + * @param po + * @return + */ + List listLikeName(SysSalaryItemPO po); /** diff --git a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml index f8faf9c90..5f0f1977d 100644 --- a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml @@ -75,7 +75,7 @@ AND id = #{id} - AND name like '%'+#{name}+'%' + AND name = #{name} AND code = #{code} @@ -143,6 +143,214 @@ AND id = #{id} + + AND name = #{name} + + + AND code = #{code} + + + AND system_type = #{systemType} + + + AND use_default = #{useDefault} + + + AND use_in_employee_salary = #{useInEmployeeSalary} + + + AND rounding_mode = #{roundingMode} + + + AND pattern = #{pattern} + + + AND value_type = #{valueType} + + + AND formula_id = #{formulaId} + + + AND description = #{description} + + + AND can_edit = #{canEdit} + + + AND data_type = #{dataType} + + + AND creator = #{creator} + + + AND delete_type = #{deleteType} + + + AND tenant_key = #{tenantKey} + + + AND create_time = #{createTime} + + + AND update_time = #{updateTime} + + + AND id IN + + #{id} + + + ORDER BY id DESC + + + + + + + + - + SELECT + + FROM hrsa_salary_sob_ext_range t + WHERE delete_type = 0 + + + + + + + + + + + + INSERT INTO hrsa_salary_sob_ext_range + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + salary_sob_id, + + + target_id, + + + target_type, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{salarySobId}, + + + #{targetId}, + + + #{targetType}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_salary_sob_ext_range + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + salary_sob_id=#{salarySobId}, + target_id=#{targetId}, + target_type=#{targetType}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_sob_ext_range + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + salary_sob_id=#{salarySobId}, + + + target_id=#{targetId}, + + + target_type=#{targetType}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_sob_ext_range + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + + + + + UPDATE hrsa_salary_sob_ext_range + SET delete_type=1 + WHERE id IN + + #{id} + + and delete_type=0 + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml index 4aeeafc25..784c6e848 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml @@ -156,7 +156,7 @@ left join hrsa_tax_agent t1 on t.payment_organization = t1.id WHERE t.delete_type = 0 - ORDER BY t.bill_month DESC + ORDER BY t.bill_month DESC, t.update_time DESC SELECT - a.bill_month billmonth,c.tax_cycle taxcycle + a.bill_month billmonth,c.tax_cycle taxcycle, c.salary_month salaryMonth, b.social_security_cycle_type socialSecurityCycleType FROM hrsa_bill_batch a,hrsa_salary_sob b,hrsa_salary_acct_record c WHERE diff --git a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java index 36e3a4d37..88f07ce7f 100644 --- a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java +++ b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java @@ -1,6 +1,7 @@ package com.engine.salary.mapper.sys; import com.engine.salary.sys.entity.po.SalarySysConfPO; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -73,4 +74,6 @@ public interface SalarySysConfMapper { * @date 2022/11/9 21:09 */ Date getTaxDeclarationRebootDate(); + + List getListByCodes(@Param("codes") List codes); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml index 3d0c299c4..a30c8e822 100644 --- a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml +++ b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml @@ -237,4 +237,17 @@ select update_time from HRSA_SALARY_SYS_CONF WHERE conf_key = 'taxDeclarationFunction' + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpChangeMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpChangeMapper.xml index c90f38636..5d245ddb7 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpChangeMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpChangeMapper.xml @@ -13,6 +13,7 @@ + @@ -30,6 +31,7 @@ , t.tax_agent_id , t.tenant_key , t.update_time + , t.employee_type @@ -89,6 +91,9 @@ AND update_time = #{updateTime} + + AND employee_type = #{employeeType} + AND id IN @@ -137,6 +142,9 @@ update_time, + + employee_type, + @@ -172,6 +180,9 @@ #{updateTime}, + + #{employeeType}, + @@ -189,6 +200,7 @@ tax_agent_id=#{taxAgentId}, tenant_key=#{tenantKey}, update_time=#{updateTime}, + employee_type=#{employeeType}, WHERE id = #{id} AND delete_type = 0 @@ -228,6 +240,9 @@ update_time=#{updateTime}, + + employee_type=#{employeeType}, + WHERE id = #{id} AND delete_type = 0 @@ -273,6 +288,7 @@ create_time, update_time, creator, + employee_type, tenant_key ) VALUES @@ -287,6 +303,7 @@ #{item.createTime}, #{item.updateTime}, #{item.creator}, + #{item.employeeType}, #{item.tenantKey} ) @@ -302,6 +319,7 @@ create_time, update_time, creator, + employee_type, tenant_key ) @@ -316,6 +334,7 @@ #{item.createTime,jdbcType=DATE}, #{item.updateTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, + #{item.employeeType,jdbcType=INTEGER}, #{item.tenantKey,jdbcType=VARCHAR} from dual @@ -332,6 +351,7 @@ create_time, update_time, creator, + employee_type, tenant_key ) VALUES @@ -345,6 +365,7 @@ #{item.createTime}, #{item.updateTime}, #{item.creator}, + #{item.employeeType}, #{item.tenantKey} ) diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml index 570c3dc72..bae6797bf 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml @@ -2,20 +2,23 @@ - - - - - - - - - + + + + + + + + + + - t.create_time + t + . + create_time , t.creator , t.delete_type , t.employee_id @@ -24,12 +27,13 @@ , t.tax_agent_id , t.tenant_key , t.update_time + , t.employee_type @@ -37,7 +41,7 @@ @@ -45,7 +49,7 @@ + SELECT + + FROM hrsa_tax_agent_ext_range t + WHERE delete_type = 0 + + + + + + + + + + + + + + INSERT INTO hrsa_tax_agent_ext_range + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + target_id, + + + target_type, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{targetId}, + + + #{targetType}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_agent_ext_range + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + target_id=#{targetId}, + target_type=#{targetType}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_ext_range + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + target_id=#{targetId}, + + + target_type=#{targetType}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_ext_range + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_tax_agent_ext_range + SET delete_type=1 + WHERE id in + + #{id} + + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java index 1fd2dd55b..1f5a0adc3 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java @@ -10,6 +10,7 @@ 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.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.report.entity.bo.SalaryStatisticsEmployeeBO; @@ -138,7 +139,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala // .collect(Collectors.toSet()); // } if (CollectionUtils.isNotEmpty(innerEmployeeIds)) { - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); Set finalInnerEmployeeIds = innerEmployeeIds; innerEmployeeIds = salaryEmployees.stream() .filter(e -> finalInnerEmployeeIds.contains(e.getEmployeeId()) && (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword())))) diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java new file mode 100644 index 000000000..d6f3b2d7d --- /dev/null +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -0,0 +1,48 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +public interface ExtEmpService { + + List list(ExtEmpQueryParam param); + + PageInfo listPage (ExtEmpQueryParam param); + + void save(ExtEmpSaveParam po); + + void update(ExtEmpSaveParam po); + + void delete(Collection ids); + + DataCollectionEmployee getEmployeeById(Long id); + + /** + * 获取人员信息 + * @param ids + * @return + */ + List getEmployeeByIds(List ids); + + List listByParams(List includeQueryParams); + + /** + * 查询人员列表 + * + * @return + */ + List listEmployee(); + + Collection getEmployeeByIdsAll(List ids); + + Collection listAllForReport(); + + ExtEmpPO getById(Long id); +} \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryAcctExcelService.java b/src/com/engine/salary/service/SalaryAcctExcelService.java index 147c38eea..25dbc0d18 100644 --- a/src/com/engine/salary/service/SalaryAcctExcelService.java +++ b/src/com/engine/salary/service/SalaryAcctExcelService.java @@ -73,6 +73,14 @@ public interface SalaryAcctExcelService { */ SalaryAcctImportFieldDTO getImportField(Long salaryAcctId); + /** + * 薪资核算导出时候薪资项目按取值方式分组 + * + * @param salaryAcctId + * @return + */ + SalaryAcctImportFieldDTO getExportField(Long salaryAcctId); + /** * 下载薪资核算导入模板 * @@ -110,6 +118,8 @@ public interface SalaryAcctExcelService { void cacheImportField(List salaryItems); + void cacheExportField(List salaryItems); + // // /** // * 薪资核算结果校验异常导出 diff --git a/src/com/engine/salary/service/SalaryArchiveService.java b/src/com/engine/salary/service/SalaryArchiveService.java index f45bfc388..43f2efbda 100644 --- a/src/com/engine/salary/service/SalaryArchiveService.java +++ b/src/com/engine/salary/service/SalaryArchiveService.java @@ -36,6 +36,8 @@ public interface SalaryArchiveService { */ SalaryArchivePO getById(Long salaryArchiveId); + List getSalaryArchiveList (SalaryArchiveQueryParam queryParam); + List listSome(SalaryArchivePO po); /** diff --git a/src/com/engine/salary/service/SalaryBillBaseSetService.java b/src/com/engine/salary/service/SalaryBillBaseSetService.java index 42a2b5f45..4ea8ef0a6 100644 --- a/src/com/engine/salary/service/SalaryBillBaseSetService.java +++ b/src/com/engine/salary/service/SalaryBillBaseSetService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; @@ -28,7 +29,7 @@ public interface SalaryBillBaseSetService { // SalaryBillAckFeedbackDTO getAckFeedbackSetting(); /** - * 保存工资单水印设置 + * 保存工资单模板基础设置 * * @param saveParam * @return @@ -41,4 +42,10 @@ public interface SalaryBillBaseSetService { * @return */ String previewWaterMark(Map wmSetting); + + /** + * 获取默认工资单确认反馈设置 + * @return + */ + SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting(); } diff --git a/src/com/engine/salary/service/SalaryBillService.java b/src/com/engine/salary/service/SalaryBillService.java index 9a37671a0..0f8b9030a 100644 --- a/src/com/engine/salary/service/SalaryBillService.java +++ b/src/com/engine/salary/service/SalaryBillService.java @@ -30,6 +30,18 @@ public interface SalaryBillService { */ List> getSendInfoList(Long sendId, List ids); + /** + * 确认工资单 + * @param salaryInfoId + */ + void confirmSalaryBill(Long salaryInfoId); + + /** + * 工资单反馈 + * @param salaryInfoId + */ + void feedBackSalaryBill(Long salaryInfoId); + /** * 工资单撤回 * diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 7e4f1915c..297b455c5 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -5,6 +5,11 @@ import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.entity.hrm.DeptInfo; +import com.engine.salary.entity.hrm.PositionInfo; +import com.engine.salary.entity.hrm.SubCompanyInfo; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import java.util.List; @@ -23,7 +28,7 @@ public interface SalaryEmployeeService { * * @return */ - List listAll(); + List listAll(UseEmployeeTypeEnum empType); /** * 获取报表人员字段 diff --git a/src/com/engine/salary/service/SalarySendService.java b/src/com/engine/salary/service/SalarySendService.java index d2b90fed3..90da3440f 100644 --- a/src/com/engine/salary/service/SalarySendService.java +++ b/src/com/engine/salary/service/SalarySendService.java @@ -201,4 +201,19 @@ public interface SalarySendService { * @return */ List getNeedSendListBySalarySobIds(List salarySobIds); + + /** + * 获取所有为确认的工资单 + * @return + * @return + */ + List listUnConfirmedSendInfo(List salarySobIds); + + /** + * 自动确认工资单 + * @param needAutoIds + */ + void autoConfirmSalaryBill(List needAutoIds); + + List getByIds(List salarySendId); } diff --git a/src/com/engine/salary/service/SalarySobExtRangeService.java b/src/com/engine/salary/service/SalarySobExtRangeService.java new file mode 100644 index 000000000..0fd6d5bb1 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobExtRangeService.java @@ -0,0 +1,54 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.SalarySobExtRangePO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; +import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +/** + * 薪资账套人员范围 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobExtRangeService { + + /** + * 根据主键id查询薪资账套的人员范围 + * + * @param ids 薪资账套的人员范围的主键id + * @return + */ + List listByIds(Collection ids); + + /** + * 根据薪资账套ID和类型查询薪资账套的人员范围 + * + * @param salarySobId 薪资账套id + * @return + */ + List listBySalarySobId(Long salarySobId); + + + /** + * 保存外部人员 + * @param saveParam + */ + void saveExtRange(SalarySobRangeExtSaveParam saveParam); + + /** + * 外部人员列表 + * @param param + * @return + */ + PageInfo listPage4Ext(SalarySobRangeQueryParam param); + + + void deleteSalarySobExtRange(Collection ids); + +} diff --git a/src/com/engine/salary/service/SalaryTemplateService.java b/src/com/engine/salary/service/SalaryTemplateService.java index 37c13637e..bdf8826cb 100644 --- a/src/com/engine/salary/service/SalaryTemplateService.java +++ b/src/com/engine/salary/service/SalaryTemplateService.java @@ -125,4 +125,10 @@ public interface SalaryTemplateService { * 获取所有设置了定时发送的默认工资单模板 */ List getAutoSendTemplate(); + + /** + * 获取所有开启了工资单确认反馈的默认工资单模板 + * @return + */ + List listNeedAckDefaultTemplate(); } diff --git a/src/com/engine/salary/service/SysSalaryItemService.java b/src/com/engine/salary/service/SysSalaryItemService.java index 2025408a8..f20e629cf 100644 --- a/src/com/engine/salary/service/SysSalaryItemService.java +++ b/src/com/engine/salary/service/SysSalaryItemService.java @@ -57,4 +57,6 @@ public interface SysSalaryItemService { List listAll(); List listSome(SysSalaryItemPO po); + + List listLikeName(SysSalaryItemPO po); } diff --git a/src/com/engine/salary/service/TaxAgentEmpService.java b/src/com/engine/salary/service/TaxAgentEmpService.java index d5c9f6127..06cf297b3 100644 --- a/src/com/engine/salary/service/TaxAgentEmpService.java +++ b/src/com/engine/salary/service/TaxAgentEmpService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import java.util.Collection; import java.util.List; @@ -29,7 +30,7 @@ public interface TaxAgentEmpService{ * @param taxAgentIds * @return */ - List listByTaxAgentIds(List taxAgentIds); + List listByTaxAgentIds(List taxAgentIds, UseEmployeeTypeEnum type); /** * 同步人员到本地关联表 @@ -38,4 +39,11 @@ public interface TaxAgentEmpService{ * @param currentEmployeeId */ void syncTaxAgentEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId); + + /** + * 同步外部人员 + * @param taxAgentEmpSaveParamList + * @param currentEmployeeId + */ + void syncTaxAgentExtEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId); } diff --git a/src/com/engine/salary/service/TaxAgentManageRangeService.java b/src/com/engine/salary/service/TaxAgentManageRangeService.java index 35f665594..00cc7eb76 100644 --- a/src/com/engine/salary/service/TaxAgentManageRangeService.java +++ b/src/com/engine/salary/service/TaxAgentManageRangeService.java @@ -1,10 +1,8 @@ package com.engine.salary.service; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; -import com.engine.salary.entity.taxagent.param.TaxAgentImportParam; -import com.engine.salary.entity.taxagent.param.TaxAgentRangeQueryParam; -import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; -import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminRangeQueryParam; +import com.engine.salary.entity.taxagent.param.*; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.util.page.PageInfo; @@ -63,6 +61,17 @@ public interface TaxAgentManageRangeService { */ void deleteByIds(Collection ids); + PageInfo listExt(TaxAgentRangeExtQueryParam param); + + /** + * 保存外部人员范围 + * @param saveParam + */ + void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam); + + void deleteExtRange(Collection ids); + + /** * 根据个税扣缴义务人的id删除管理范围 * diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 5f2fc42ec..122795af6 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -195,7 +195,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); Map apidatas = new HashMap(); - AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz(); //检验参数 @@ -671,8 +670,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List accountedEmployeeData = getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM")); for (TaxAgentPO taxAgent : taxAgents) { - Collection employeeIds = getTaxAgentService(user) - .listEmployeeIdsInTaxAgent(taxAgent.getId()); List employeePOs = getSpecialAddDeductionService(user) .getSpecialAddDeductionPOByEmployee(null, taxAgent.getId()); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java new file mode 100644 index 000000000..8de9513ee --- /dev/null +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -0,0 +1,206 @@ +package com.engine.salary.service.impl; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.hrm.DeptInfo; +import com.engine.salary.entity.hrm.SubCompanyInfo; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.SalaryEmployeeService; +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 dm.jdbc.util.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 累计专项 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpServiceImpl extends Service implements ExtEmpService { + + + private ExternalEmployeeMapper getExternalEmployeeMapper() { + return MapperProxyFactory.getProxy(ExternalEmployeeMapper.class); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + + @Override + public List list(ExtEmpQueryParam param) { + return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); + } + + @Override + public PageInfo listPage(ExtEmpQueryParam param) { + List extEmpPOS = list(param); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class); + + } + + @Override + public void save(ExtEmpSaveParam param) { + + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); + if (CollectionUtils.isNotEmpty(extEmpPOS)) { + throw new SalaryRunTimeException("姓名已存在!"); + } + + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); + + po.setId(IdGenerator.generate()); + po.setStatus("2"); + po.setCreator((long) user.getUID()); + po.setModifier((long) user.getUID()); + Date now = new Date(); + po.setCreateTime(now); + po.setUpdateTime(now); + po.setDeleteType(0); + + getExternalEmployeeMapper().insertIgnoreNull(po); + } + + @Override + public void update(ExtEmpSaveParam param) { + + ExtEmpPO oldPO = getExternalEmployeeMapper().getById(param.getId()); + if (!StringUtils.equals(oldPO.getUsername(), param.getUsername())) { + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); + if (CollectionUtils.isNotEmpty(extEmpPOS)) { + throw new SalaryRunTimeException("姓名已存在!"); + } + } + + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); + + po.setModifier((long) user.getUID()); + Date now = new Date(); + po.setUpdateTime(now); + + getExternalEmployeeMapper().updateIgnoreNull(po); + } + + @Override + public void delete(Collection ids) { + if (CollectionUtils.isNotEmpty(ids)) { + ids.forEach(getExternalEmployeeMapper()::delete); + } + } + + @Override + public DataCollectionEmployee getEmployeeById(Long id) { + ExtEmpPO po = getExternalEmployeeMapper().getById(id); + return cover(po); + } + + @Override + public List getEmployeeByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List extEmpPOS = new ArrayList<>(); + List> partition = Lists.partition(ids, 500); + partition.forEach(list -> extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build()))); + return coverList(extEmpPOS); + + } + + @Override + public List listByParams(List includeQueryParams) { + List emps = new ArrayList<>(); + List> partition = Lists.partition(includeQueryParams, 100); + partition.forEach(list -> { + emps.addAll(getExternalEmployeeMapper().listByParams(list)); + }); + return emps; + } + + @Override + public List listEmployee() { + return getExternalEmployeeMapper().listEmployee(); + } + + @Override + public Collection getEmployeeByIdsAll(List ids) { + List employeeList = new ArrayList<>(); + List> partition = Lists.partition(ids, 1000); + partition.forEach(e -> { + List employeeByIdsAll = getExternalEmployeeMapper().getEmployeeByIdsAll(e); + employeeList.addAll(employeeByIdsAll); + }); + return employeeList; + } + + @Override + public Collection listAllForReport() { + return getExternalEmployeeMapper().listAllForReport(); + } + + @Override + public ExtEmpPO getById(Long id) { + ExtEmpPO po = getExternalEmployeeMapper().getById(id); + if (po != null) { + if (po.getDepartmentId() != null) { + List deptInfoList = getSalaryEmployeeService(user).getDeptInfoList(Collections.singletonList(po.getDepartmentId())); + if (CollectionUtils.isNotEmpty(deptInfoList)) { + po.setDepartmentOrgName(deptInfoList.get(0).getName()); + } + } + if (po.getSubcompanyId() != null) { + List subInfoList = getSalaryEmployeeService(user).getSubCompanyInfoList(Collections.singletonList(po.getSubcompanyId())); + if (CollectionUtils.isNotEmpty(subInfoList)) { + po.setSubcompanyOrgName(subInfoList.get(0).getName()); + } + } + } + return po; + } + + + public DataCollectionEmployee cover(ExtEmpPO extPo) { + if (extPo == null) { + return null; + } + DataCollectionEmployee employee = new DataCollectionEmployee(); + BeanUtils.copyProperties(extPo, employee); + employee.setEmployeeId(extPo.getId()); + employee.setExtEmp(true); + return employee; + } + + public List coverList(List extEmps) { + if (CollectionUtils.isEmpty(extEmps)) { + return new ArrayList<>(); + } + + return extEmps.stream().map(emp -> { + DataCollectionEmployee employee = new DataCollectionEmployee(); + BeanUtils.copyProperties(emp, employee); + employee.setEmployeeId(emp.getId()); + employee.setExtEmp(true); + return employee; + }).collect(Collectors.toList()); + } +} diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 3b774aa02..b617bcf5c 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.biz.OtherDeductionBiz; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index bdb786ced..df2d93d8f 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.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -18,11 +19,16 @@ import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.RecordsBuildService; -import com.engine.salary.util.*; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.util.SalaryAssert; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -50,6 +56,10 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public List> buildCommonRecords(List list, Long employeeId) { List> result = new ArrayList<>(); @@ -60,7 +70,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ List employeeByIds = new ArrayList<>(); List> partition = Lists.partition(employeeIds, 1000); for (List longs : partition) { - employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs)); + employeeByIds.addAll(getSalaryEmployeeService(user).getEmployeeByIdsAll(longs)); } if (CollectionUtils.isEmpty(employeeByIds)) { return result; @@ -211,7 +221,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ List employeeByIds = new ArrayList<>(); List> partition = Lists.partition(employeeIds, 1000); for (List longs : partition) { - employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs)); + employeeByIds.addAll(getSalaryEmployeeService(user).getEmployeeByIdsAll(longs)); } if (CollectionUtils.isEmpty(employeeByIds)) { return result; diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index dcace0b7f..8530c7c2c 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -34,6 +34,7 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; @@ -869,7 +870,20 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (insuranceAccountBatchPO == null || Objects.equals(BillStatusEnum.NOT_ARCHIVED.getValue(), insuranceAccountBatchPO.getBillStatus())) { return Lists.newArrayList(); } - List list = queryList(billMonth, taxAgentId, employeeIds); +// List list = queryList(billMonth, taxAgentId, employeeIds); + //20230707增加福利核算明细中的缴纳状态+合计的数据项 + List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().queryList(billMonth, taxAgentId, employeeIds); + //退差数据不参与薪资核算 + insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream() + .filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue()) + || f.getPaymentStatus().equals(PaymentStatusEnum.REPAIR.getValue()) + || f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue()) ) + .collect(Collectors.toList()); + List list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS); + Map siAcctResultWithEmpAndPayStatus = insuranceAccountDetailPOS.stream() + .collect(Collectors.toMap(po -> po.getEmployeeId() + "_" + po.getPaymentStatus(), a -> a, (a, b) -> a)); + + List> result = new ArrayList<>(); list.stream().forEach(item -> { Map record = new HashMap<>(); @@ -921,6 +935,156 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("otherComSum", item.getOtherComSum()); record.put("perSum", item.getPerSum()); record.put("comSum", item.getComSum()); + + //20230707增加福利核算明细中的缴纳状态+合计的数据项、缴纳状态+福利项的数据项 + InsuranceAccountDetailPO commonSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.COMMON.getValue()); + InsuranceAccountDetailPO repairSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.REPAIR.getValue()); + InsuranceAccountDetailPO balanceSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.BALANCE.getValue()); + //社保-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialCommonCom", v); + }); + } + record.put("socialPerCommonSum", commonSiAcct != null ? commonSiAcct.getSocialPerSum() : new BigDecimal("0")); + record.put("socialComCommonSum", commonSiAcct != null ? commonSiAcct.getSocialComSum() : new BigDecimal("0")); + //社保-补缴 + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(repairSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialRepairPer", v); + }); + } + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(repairSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialRepairCom", v); + }); + } + record.put("socialPerRepairSum", repairSiAcct != null ? repairSiAcct.getSocialPerSum() : new BigDecimal("0")); + record.put("socialComRepairSum", repairSiAcct != null ? repairSiAcct.getSocialComSum() : new BigDecimal("0")); + //社保-补差 + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(balanceSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialBalancePer", v); + }); + } + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(balanceSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialBalanceCom", v); + }); + } + record.put("socialPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialPerSum() : new BigDecimal("0")); + record.put("socialComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialComSum() : new BigDecimal("0")); + + //公积金-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getFundPerJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getFundPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "fundCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getFundComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getFundComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "fundCommonCom", v); + }); + } + record.put("fundPerCommonSum", commonSiAcct != null ? commonSiAcct.getFundPerSum() : new BigDecimal("0")); + record.put("fundComCommonSum", commonSiAcct != null ? commonSiAcct.getFundComSum() : new BigDecimal("0")); + //公积金-补缴 + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getFundPerJson())) { + Map fundJson = JSON.parseObject(repairSiAcct.getFundPerJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundRepairPer", v); + }); + } + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getFundComJson())) { + Map fundJson = JSON.parseObject(repairSiAcct.getFundComJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundRepairCom", v); + }); + } + record.put("fundPerRepairSum", repairSiAcct != null ? repairSiAcct.getFundPerSum() : new BigDecimal("0")); + record.put("fundComRepairSum", repairSiAcct != null ? repairSiAcct.getFundComSum() : new BigDecimal("0")); + //公积金-补差 + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getFundPerJson())) { + Map fundJson = JSON.parseObject(balanceSiAcct.getFundPerJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundBalancePer", v); + }); + } + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getFundComJson())) { + Map fundJson = JSON.parseObject(balanceSiAcct.getFundComJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundBalanceCom", v); + }); + } + record.put("fundPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundPerSum() : new BigDecimal("0")); + record.put("fundComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundComSum() : new BigDecimal("0")); + + //其他福利-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(commonSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(commonSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherCommonCom", v); + }); + } + record.put("otherPerCommonSum", commonSiAcct != null ? commonSiAcct.getOtherPerSum() : new BigDecimal("0")); + record.put("otherComCommonSum", commonSiAcct != null ? commonSiAcct.getOtherComSum() : new BigDecimal("0")); + //其他福利-补缴 + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(repairSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherRepairPer", v); + }); + } + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(repairSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherRepairCom", v); + }); + } + record.put("otherPerRepairSum", repairSiAcct != null ? repairSiAcct.getOtherPerSum() : new BigDecimal("0")); + record.put("otherComRepairSum", repairSiAcct != null ? repairSiAcct.getOtherComSum() : new BigDecimal("0")); + //其他福利-补差 + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(balanceSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherBalancePer", v); + }); + } + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(balanceSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherBalanceCom", v); + }); + } + record.put("otherPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherPerSum() : new BigDecimal("0")); + record.put("otherComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherComSum() : new BigDecimal("0")); + + record.put("perCommonSum", commonSiAcct != null ? commonSiAcct.getPerSum() : new BigDecimal("0")); + record.put("comCommonSum", commonSiAcct != null ? commonSiAcct.getComSum() : new BigDecimal("0")); + record.put("perRepairSum", repairSiAcct != null ? repairSiAcct.getPerSum() : new BigDecimal("0")); + record.put("comRepairSum", repairSiAcct != null ? repairSiAcct.getComSum() : new BigDecimal("0")); + record.put("perBalanceSum", balanceSiAcct != null ? balanceSiAcct.getPerSum() : new BigDecimal("0")); + record.put("comBalanceSum", balanceSiAcct != null ? balanceSiAcct.getComSum() : new BigDecimal("0")); + result.add(record); }); return result; @@ -935,37 +1099,92 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } Map result = new LinkedHashMap<>(); + + Map commonResult = new LinkedHashMap<>(); + Map repairResult = new LinkedHashMap<>(); + Map balanceResult = new LinkedHashMap<>(); + result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542275, "个人合计"), "perSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542272, "社保个人合计"), "socialPerSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542273, "公积金个人合计"), "fundPerSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542274, "其他福利个人合计"), "otherPerSum"); + + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人正常缴纳合计"), "perCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人正常缴纳合计"), "socialPerCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人正常缴纳合计"), "fundPerCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人正常缴纳合计"), "otherPerCommonSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "个人补缴合计"), "perRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补缴合计"), "socialPerRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补缴合计"), "fundPerRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补缴合计"), "otherPerRepairSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "个人补差合计"), "perBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补差合计"), "socialPerBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补差合计"), "fundPerBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补差合计"), "otherPerBalanceSum"); + Map categoryIdNameMap = getSICategoryService(user).categoryIdNameMap(); list.stream().forEach(item -> { if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人"), item.getId() + "socialPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "socialCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "socialRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "socialBalancePer"); } if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人"), item.getId() + "fundPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "fundCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "fundRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "fundBalancePer"); } if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),500201, "个人"), item.getId() + "otherPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "otherCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "otherRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "otherBalancePer"); } }); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542279, "单位合计"), "comSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542276, "社保单位合计"), "socialComSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542277, "公积金单位合计"), "fundComSum"); result.put(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542278, "其他福利单位合计"), "otherComSum"); + + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位正常缴纳合计"), "comCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位正常缴纳合计"), "socialComCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位正常缴纳合计"), "fundComCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位正常缴纳合计"), "otherComCommonSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "单位补缴合计"), "comRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补缴合计"), "socialComRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补缴合计"), "fundComRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补缴合计"), "otherComRepairSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "单位补差合计"), "comBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补差合计"), "socialComBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补差合计"), "fundComBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补差合计"), "otherComBalanceSum"); + list.stream().forEach(item -> { if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位"), item.getId() + "socialCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "socialCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "socialRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "socialBalanceCom"); } if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位"), item.getId() + "fundCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "fundCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "fundRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "fundBalanceCom"); } if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(user.getLanguage(),1329, "单位"), item.getId() + "otherCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "otherCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "otherRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "otherBalanceCom"); } }); + + result.putAll(commonResult); + result.putAll(repairResult); + result.putAll(balanceResult); return result; } @@ -1193,11 +1412,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) { //fixme 重新核算的校验逻辑 1、先取台账对应扣缴义务人下的所有账套 2、取账套下所有核算记录 3、判断核算记录有没有使用对应月份的福利台账 -// int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); -// //表示已经被核算过不能重新核算 -// if (num > 0) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98831, "已被薪酬核算给核算过,无法重新核算!")); -// } + int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); + //表示已经被核算过不能重新核算 + if (num > 0) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544192, "已被薪酬核算给核算过,无法重新核算!")); + } param.setBillStatus(0); getSiAccountBiz(user).updateById(param); } @@ -1269,7 +1488,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); // 获取租户下所有的人员 - List salaryEmployees = getSalaryEmployeeService(user).listEmployee(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); // 失败的数量 int failCount = 0; @@ -2043,6 +2262,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public Map importExcelInsuranceDetail(ExcelInsuranceImportParam importParam) { Map apidatas = new HashMap(); + //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; @@ -2055,7 +2275,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } // 获取租户下所有的人员 - List salaryEmployees = getSalaryEmployeeService(user).listEmployee(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); // 失败的数量 int failCount = 0; diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 25c2c087e..b8882a77b 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -6,7 +6,6 @@ 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.biz.EmployBiz; import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.biz.SISchemeBiz; import com.engine.salary.cmd.sischeme.*; diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 8c46d7627..3b401e4b7 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -54,48 +54,48 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc private SalaryAcctResultService getSalaryAcctResultService(User user) { - return (SalaryAcctResultService) ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); + return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user); } private SalaryEmployeeService getSalaryEmployeeService(User user) { - return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } private SalaryArchiveService getSalaryArchiveService(User user) { - return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); } private AddUpSituationService getAddUpSituationService(User user) { - return (AddUpSituationService) ServiceUtil.getService(AddUpSituationServiceImpl.class, user); + return ServiceUtil.getService(AddUpSituationServiceImpl.class, user); } private AddUpDeductionService getAddUpDeductionService(User user) { - return (AddUpDeductionService) ServiceUtil.getService(AddUpDeductionServiceImpl.class, user); + return ServiceUtil.getService(AddUpDeductionServiceImpl.class, user); } private OtherDeductionService getOtherDeductionService(User user) { - return (OtherDeductionService) ServiceUtil.getService(OtherDeductionServiceImpl.class, user); + return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); } private SIAccountService getSIAccountService(User user) { - return (SIAccountService) ServiceUtil.getService(SIAccountServiceImpl.class, user); + return ServiceUtil.getService(SIAccountServiceImpl.class, user); } private AttendQuoteDataService getAttendQuoteDataService(User user) { - return (AttendQuoteDataService) ServiceUtil.getService(AttendQuoteDataServiceImpl.class, user); + return ServiceUtil.getService(AttendQuoteDataServiceImpl.class, user); } private FormulaRunService getFormulaRunService(User user) { - return (FormulaRunService) ServiceUtil.getService(FormulaRunServiceImpl.class, user); + return ServiceUtil.getService(FormulaRunServiceImpl.class, user); } private SalaryAcctResultTempService getSalaryAcctResultTempService(User user) { - return (SalaryAcctResultTempService) ServiceUtil.getService(SalaryAcctResultTempServiceImpl.class, user); + return ServiceUtil.getService(SalaryAcctResultTempServiceImpl.class, user); } private ProgressService getSalaryAcctProgressService(User user) { @@ -103,7 +103,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc } private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) { - return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); + return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user); } @Override diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 0fb30290f..9b0dfdcd0 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -501,7 +501,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct List employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList()); List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId); // 转换成薪资核算人员po - List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(employeeIds, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); + List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); //过滤掉不属于当前账套扣缴义务人的人员 salaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().filter(po -> Objects.equals(taxAgentId, po.getTaxAgentId())).collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 9dc8832b7..d7f24929e 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -44,6 +44,7 @@ import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.valid.ValidUtil; +import com.engine.salary.wrapper.SalarySobItemWrapper; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -102,10 +103,6 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user); } -// private SalaryFormulaService getSalaryFormulaService(User user) { -// return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); -// } - private SalaryComparisonResultService getSalaryComparisonResultService(User user) { return (SalaryComparisonResultService) ServiceUtil.getService(SalaryComparisonResultServiceImpl.class, user); } @@ -123,12 +120,6 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); } - private SalaryCheckResultService salaryCheckResultService; - - private SalaryCheckResultDetailService salaryCheckResultDetailService; - - private SalarySobCheckRuleService salarySobCheckRuleService; - private SalaryAcctReportService getSalaryAcctReportService(User user) { return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user); } @@ -145,6 +136,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return ServiceUtil.getService(SalaryAcctResultLogServiceImpl.class, user); } + private SalarySobItemWrapper getSalarySobItemWrapper(User user) { + return ServiceUtil.getService(SalarySobItemWrapper.class, user); + } + @Override public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) { ValidUtil.doValidator(queryParam); @@ -287,13 +282,44 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc List headerColumnGroup = Lists.newArrayList(); // 查询列表的表头 List weaTableColumns = listWeaTableColumn(salaryAcctRecordPO); - parseHeader(headerColumnGroup, weaTableColumns); + + //判断是否按照自定义字段导出表头 + List finalWeaTableColumns = new ArrayList<>(); + if (queryParam.getSalaryItemIds() != null ) { + //获取人员基本信息字段(汇总) + Collection> empFieldList = getSalarySobItemWrapper(user).empFieldList(); + List empFieldIdList= new ArrayList<>(); + empFieldList.forEach(f -> empFieldIdList.add(f.get("id"))); + // 必须选择导出所需的薪资项目 + if (CollectionUtils.isEmpty(queryParam.getSalaryItemIds())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的薪资项目")); + } + List headerRangeList = new ArrayList<>(); + List salaryItemPOS = getSalaryItemService(user).listByIds(queryParam.getSalaryItemIds()); + for (SalaryItemPO salaryItemPO : salaryItemPOS) { + headerRangeList.add(salaryItemPO.getId().toString()); + } + for (WeaTableColumnGroup tableColumn : weaTableColumns) { + WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) tableColumn; + if (columnGroupItem.getChildren() != null) { + List childrenColumns = columnGroupItem.getChildren().stream().filter(f -> headerRangeList.contains(f.getColumn())).collect(Collectors.toList()); + if (childrenColumns.size() > 0) { + columnGroupItem.setChildren(childrenColumns); + finalWeaTableColumns.add(columnGroupItem); + } + } else if (empFieldIdList.contains(tableColumn.getColumn()) || headerRangeList.contains(tableColumn.getColumn())){ + finalWeaTableColumns.add(columnGroupItem); + } + + } + } else { + finalWeaTableColumns = weaTableColumns; + } +// parseHeader(headerColumnGroup, weaTableColumns); + parseHeader(headerColumnGroup, finalWeaTableColumns); // // excel导出的表头 -// String[] headers = headerColumnGroup.stream() -// .map(WeaTableColumn::getText) -// .toArray(String[]::new); -// List headerList = new ArrayList<>(Arrays.asList(headers)); - List headerList = new ArrayList<>(weaTableColumns); +// List headerList = new ArrayList<>(weaTableColumns); + List headerList = new ArrayList<>(finalWeaTableColumns); // 查询薪资核算结果 List> resultMapList = getSalaryAcctResultService(user).listByParam(queryParam); @@ -461,6 +487,70 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return SalaryAcctImportFieldDTO.builder().itemsByGroup(itemsByGroup).checkItems(checkItems).build(); } + @Override + public SalaryAcctImportFieldDTO getExportField(Long salaryAcctRecordId) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 查询薪资核算记录所用的薪资账套的薪资项目副本 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + Set salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId); + // 查询薪资项目 + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + + Map> salarySobItemPOMap = SalaryEntityUtil.group2Map(salarySobItems, SalarySobItemPO::getSalarySobItemGroupId); + + // 查询薪资账套的薪资项目分类 + List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 对分组进行排序 + salarySobItemGroupPOS = SalaryAcctResultBO.sortGroup(salarySobItemGroupPOS); + // 对分组内薪资项目排序 + SalaryAcctResultBO.sortItem(salarySobItemPOMap); + // 根据账套分组封装薪资项目的值 + List itemsByGroup = new ArrayList<>(); + for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){ + List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); + List items = groupItems.stream() + .map(salarySobItemPO -> SalaryAcctImportFieldDTO.ImportFieldDTO.builder() + .salaryItemId(salarySobItemPO.getSalaryItemId()) + .salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) + .build()) + .collect(Collectors.toList()); + + itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder() + .salarySobItemGroupId(groupPO.getId()) + .salarySobItemGroupName(groupPO.getName()) + .salaryItems(items) + .sortedIndex(groupPO.getSortedIndex()).build() ); + } + // 未分类 + List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); + if(CollectionUtils.isNotEmpty(noGroupItems)){ + List items = noGroupItems.stream() + .map(salarySobItemPO ->SalaryAcctImportFieldDTO.ImportFieldDTO.builder() + .salaryItemId(salarySobItemPO.getSalaryItemId()) + .salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) + .build()) + .collect(Collectors.toList()); + + itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder() + .salarySobItemGroupId(0L) + .salarySobItemGroupName("未分类") + .salaryItems(items) + .sortedIndex(itemsByGroup.size()).build()); + } + // 缓存勾选 + String cacheKey = user.getUID() + SalaryItemConstant.RESULT_EXPORT_FIELD_SIGN; + String cacheValue = (String)Util_DataCache.getObjVal(cacheKey); + List checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class); + // 转换成dto +// return SalaryAcctImportFieldDTO.builder().formulaItems(formulaItems).sqlItems(sqlItems).inputItems(inputItems).checkItems(checkItems).build(); + return SalaryAcctImportFieldDTO.builder().itemsByGroup(itemsByGroup).checkItems(checkItems).build(); + } + @Override public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) { ValidUtil.doValidator(param); @@ -697,6 +787,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryItems)); } + @Override + public void cacheExportField(List salaryItems) { + String cacheKey = user.getUID() + SalaryItemConstant.RESULT_EXPORT_FIELD_SIGN; + Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryItems)); + } + @Override public Map previewImportSalaryAcctResult(SalaryAcctImportParam param) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 0d9bce605..e7c3a5ff9 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -329,48 +329,48 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 获取个税申报功能状态 TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); - if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) { - // 关闭了个税申报功能 - // 如果某个月(薪资所属期)还未归档,不可以新建之后月份的薪资核算 - SalaryAcctRecordPO notArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) - && e.getSalaryMonth().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(notArchivedSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") - + "{0}" - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542325, "薪资核算结果还未归档,") - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") - + "{1}" - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542326, "不能新建薪资核算") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) - .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98754, "薪资所属期{0}的薪资核算结果还未归档,不能新建薪资所属期{1}的薪资核算") +// if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.CLOSURE.getValue())) { +// // 关闭了个税申报功能 +// // 如果某个月(薪资所属期)还未归档,不可以新建之后月份的薪资核算 +// SalaryAcctRecordPO notArchivedSalaryAcctRecordPO = salaryAcctRecords.stream() +// .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) +// && e.getSalaryMonth().before(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) +// .findAny() +// .orElse(null); +// if (Objects.nonNull(notArchivedSalaryAcctRecordPO)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") +// + "{0}" +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542325, "薪资核算结果还未归档,") +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") +// + "{1}" +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542326, "不能新建薪资核算") // .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) // .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); - } - // 如果有某个月(薪资所属期)已经归档了,不可以新建之前月份的薪资核算 - SalaryAcctRecordPO havaSalaryAcctRecordPO = salaryAcctRecords.stream() - .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) - && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) - .findAny() - .orElse(null); - if (Objects.nonNull(havaSalaryAcctRecordPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") - + "{0}" - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542327, "薪资核算结果已经归档,") - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") - + "{1}" - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542326, "不能新建薪资核算") - .replace("{0}", SalaryDateUtil.localDate2YearMonth(havaSalaryAcctRecordPO.getSalaryMonth()).toString()) - .replace("{1}", salarySobCycleDTO.getSalaryMonth().toString())); -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98755, "薪资所属期{0}的薪资核算结果已经归档,不能新建薪资所属期{1}的薪资核算") +//// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98754, "薪资所属期{0}的薪资核算结果还未归档,不能新建薪资所属期{1}的薪资核算") +//// .replace("{0}", SalaryDateUtil.localDate2YearMonth(notArchivedSalaryAcctRecordPO.getTaxCycle()).toString()) +//// .replace("{1}", salarySobCycleDTO.getTaxCycle().toString())); +// } +// // 如果有某个月(薪资所属期)已经归档了,不可以新建之前月份的薪资核算 +// SalaryAcctRecordPO havaSalaryAcctRecordPO = salaryAcctRecords.stream() +// .filter(e -> Objects.equals(e.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) +// && e.getTaxCycle().after(SalaryDateUtil.localDateToDate(salarySobCycleDTO.getSalaryMonth().atDay(1)))) +// .findAny() +// .orElse(null); +// if (Objects.nonNull(havaSalaryAcctRecordPO)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") +// + "{0}" +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542327, "薪资核算结果已经归档,") +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542324, "薪资所属期") +// + "{1}" +// + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542326, "不能新建薪资核算") // .replace("{0}", SalaryDateUtil.localDate2YearMonth(havaSalaryAcctRecordPO.getSalaryMonth()).toString()) // .replace("{1}", salarySobCycleDTO.getSalaryMonth().toString())); - } - - } +//// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98755, "薪资所属期{0}的薪资核算结果已经归档,不能新建薪资所属期{1}的薪资核算") +//// .replace("{0}", SalaryDateUtil.localDate2YearMonth(havaSalaryAcctRecordPO.getSalaryMonth()).toString()) +//// .replace("{1}", salarySobCycleDTO.getSalaryMonth().toString())); +// } +// +// } if (taxDeclarationFunctionEnum.getValue().equals(TaxDeclarationFunctionEnum.OPEN.getValue())) { // 开启了个税申报功能 // 如果某个月(税款所属期)已经归档了,不可以新建之前月份的薪资核算 diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 89e5b8ba2..c3ef48766 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,10 +14,10 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; @@ -314,32 +314,24 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch rows.add(header); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listAll(); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); -// boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo()); -// if (isSearchIdNo) { -// Map idNoEmpMap = salaryEmployeeService -// .mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey); -// salaryArchives = salaryArchives.stream().filter(f -> Optional.ofNullable(idNoEmpMap.get(f.getEmployeeId())).orElse("").contains(queryParam.getIdNo())) -// .collect(Collectors.toList()); -// } - // 开启分权并且不是薪酬模块总管理员 + Collection salaryArchives = new ArrayList<>(); + + if (queryParam.isExtSalaryArchiveList()) { + //非系统人员档案 + salaryArchives = getSalaryArchiveMapper().listExtSalaryArchive(queryParam); + } else { + salaryArchives = getSalaryArchiveMapper().list(queryParam); + } long employeeId = user.getUID(); if (getTaxAgentService(user).isNeedAuth(employeeId)) { - List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - salaryArchives = salaryArchives.stream().filter(f -> + salaryArchives = salaryArchives.stream() + .filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - // 作为分管理员 -// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId()) -// || employeeId.equals(f.getModifier()) - ).collect(Collectors.toList()); + ).collect(Collectors.toList()); } - Map idNoEmpMap = -// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey) -// : - new HashMap<>(); if (queryParam.getHasData()) { List> listMaps = salaryArchiveService(user) .buildSalaryArchiveData(salaryArchives, taxAgentList, salaryItems, Boolean.FALSE); @@ -509,7 +501,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch map = data.get(i); map.put("index", i + 2); // 3.校验行内容 - boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, confValue, user); + boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, user); if (isError) { errorCount += 1; // 添加错误数据 @@ -557,8 +549,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch public Map processInit(SalaryArchiveImportActionParam param) { - log.info("salary process param {}", param); - // 初始化国际化标签 SalaryArchiveExcelBO.initI18n(user); @@ -623,7 +613,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch map = data.get(i); map.put("index", i + 2); // 3.校验行内容 - boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, confValue, user); + boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, user); if (isError) { errorCount += 1; // 添加错误数据 @@ -659,9 +649,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch apidatas.put("successCount", successCount); apidatas.put("errorCount", errorCount); apidatas.put("errorNotice", excelComments); - - log.info("salary process param {} result {}", param, apidatas); - return apidatas; // 发送导入回调信息 @@ -718,11 +705,11 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch List salaryArchiveIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); Map salaryArchivesMap = SalaryEntityUtil.convert2Map(salaryArchiveList, k -> k.getEmployeeId() + "-" + k.getTaxAgentId()); -// List employees = getTaxAgentService(user).listEmployees(); - - // 查询人员状态 -// List hrmStatusList = hrmCommonHrmStatusService.list(tenantKey); - + UseEmployeeTypeEnum empType = UseEmployeeTypeEnum.ORG; + //外部人员导入 + if (param.isExtEmp()) { + empType = UseEmployeeTypeEnum.EXT; + } return SalaryArchiveImportHandleParam.builder() .isProcess(param.isProcess()) .description(param.getDescription()) @@ -730,18 +717,22 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch .importType(importType) .currentEmployeeId((long) user.getUID()) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + //人员定位方式 + .empValidType(getSalaryEmployeeService(user).empValidType()) // 待定薪列表 .isPendingList(isPendingList) // 定薪列表 .isFixedList(isFixedList) // 待停薪列表 .isSuspendList(isSuspendList) + //外部人员 + .isExtEmp(param.isExtEmp()) // 初始化导入 .isInit(isInit) // 调薪导入 .isSalaryItemAdjust(isSalaryItemAdjust) // 获取租户下所有的人员 - .employees(getSalaryEmployeeService(user).listAll()) + .employees(getSalaryEmployeeService(user).listAll(empType)) // .hrmStatusList(hrmStatusList) // 获取所有个税扣缴义务人 .taxAgentList(taxAgentList) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 48529d267..6c648d676 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -11,12 +11,14 @@ import com.engine.salary.entity.salaryarchive.param.*; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryArchiveItemService; +import com.engine.salary.service.TaxAgentService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelUtil; @@ -56,6 +58,10 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + /** * 获取未生效 lt * @@ -179,7 +185,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi List salaryArchiveItems = Lists.newArrayList(); if (isNoNeedSalaryItem) { - salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds)); + salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds)); } else { List> partition = Lists.partition((List) saIds, 1000); Collection finalSalaryItemIds = salaryItemIds; @@ -216,7 +222,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542351, "停薪列表禁止操作")); } SalaryArchiveItemPO salaryArchiveItem = null; - if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null ) { + if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null) { salaryArchiveItem = salaryArchiveItemMapper.getById(salaryArchiveItemSaveParam.getSalaryArchiveItemId(), user); if (salaryArchiveItem == null || !salaryArchiveItem.getSalaryArchiveId().equals(salaryArchiveId)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542352, "该薪资档案的薪资项目的调整记录不存在")); @@ -228,19 +234,19 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi } } // 构建更新PO - SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam,salaryArchiveItems,salaryItemIds,salaryArchiveItem); + SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam, salaryArchiveItems, salaryItemIds, salaryArchiveItem); salaryArchiveItemMapper.updateIgnoreNull(updateSalaryArchiveItemPO, user); } return StringUtils.EMPTY; } /** - * @description 构建薪资档案中调薪的更新PO * @return null + * @description 构建薪资档案中调薪的更新PO * @author Harryxzy * @date 2022/11/14 14:24 */ - private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam,List salaryArchiveItems,List salaryItemIds,SalaryArchiveItemPO salaryArchiveItem) { + private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam, List salaryArchiveItems, List salaryItemIds, SalaryArchiveItemPO salaryArchiveItem) { // 获取所有可被引用的薪资项目 List salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); // 获取生效+未生效的数据 @@ -267,8 +273,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi } // 修改了生效日期 - if(!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())){ - boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime)); + if (!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())) { + boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime)); if (isEffectiveTimeRepeat) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542355, "已经存在该生效日期的调整记录,请修改生效日期")); } @@ -276,9 +282,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi // 1.检验是否可以调整 // if (effectiveSalaryItem != null) { - // 当前已经生效的时间 + // 当前已经生效的时间 // Date effectiveTime = effectiveSalaryItem.getEffectiveTime(); - // 1.1 如果保存的生效日期早于<当前已生效 + // 1.1 如果保存的生效日期早于<当前已生效 // if (saveEffectiveTime.before(effectiveTime)) { // if(salaryArchiveItemSaveParam.getCanOperator() == Boolean.TRUE){ // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542357, "生效日期不可早于当前已生效的调整日期")); @@ -545,9 +551,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542360, "参数错误,薪资项目不存在或已被删除")); } // if (salaryArchiveItem.getEffectiveTime().after(new Date())) { - salaryArchiveItem.setDeleteType(1); - // 删除未生效数据 - salaryArchiveItemMapper.updateById(salaryArchiveItem, user); + salaryArchiveItem.setDeleteType(1); + // 删除未生效数据 + salaryArchiveItemMapper.updateById(salaryArchiveItem, user); // } else { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),98299, "该薪资项目已生效不可删除")); // } @@ -561,7 +567,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi */ @Override public List getCanAdjustSalaryItems() { - return salaryItemMapper.getCanAdjustSalaryItems(); + Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + List taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList()); + + List canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems(); + canAdjustSalaryItems = canAdjustSalaryItems.stream() + .filter(item -> item.getSharedType() == null + || 0 == item.getSharedType() + || (StringUtils.isNotBlank(item.getTaxAgentIds()) && SalaryEntityUtil.judgeIntersection(taxAgentIds, Arrays.stream(item.getTaxAgentIds().split(",")).map(Long::valueOf).collect(Collectors.toList())))) + .collect(Collectors.toList()); + return canAdjustSalaryItems; } diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 77ec73673..12e5f218d 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -156,6 +156,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe return getSalaryArchiveMapper().listSome(po); } + @Override + public List getSalaryArchiveList(SalaryArchiveQueryParam queryParam) { + if (queryParam.isExtSalaryArchiveList()) { + return getSalaryArchiveMapper().listExtSalaryArchive(queryParam); + } + return getSalaryArchiveMapper().list(queryParam); + } + @Override public PageInfo listPage(SalaryArchiveQueryParam queryParam) { long currentEmployeeId = user.getUID(); @@ -164,7 +172,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe * 异步处理档案数据 */ String handleable = Util.null2String(Util_DataCache.getObjVal("salaryArchiveHandleable")); - if (StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) { + if ((StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) && !queryParam.isExtSalaryArchiveList()) { new Thread() { public void run() { Util_DataCache.setObjVal("salaryArchiveHandleable", "0"); @@ -185,7 +193,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - List list = getSalaryArchiveMapper().list(queryParam); + List list = getSalaryArchiveList(queryParam); list = list.stream() //过滤档案状态 .filter(dto -> { @@ -234,12 +242,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 1.定薪员工非在职 if (CollectionUtils.isNotEmpty(personnelStatuss)) { - List noNormalList = getSalaryArchiveMapper().list(SalaryArchiveQueryParam.builder() + SalaryArchiveQueryParam queryParam = SalaryArchiveQueryParam.builder() // 离职 .personnelStatuss(personnelStatuss) // 定薪列表 .runStatusList(Collections.singletonList(SalaryArchiveStatusEnum.FIXED.getValue())) - .build()); + .build(); + List noNormalList = getSalaryArchiveList(queryParam); if (CollectionUtils.isNotEmpty(noNormalList)) { List idList = noNormalList.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList()); List> partition = Lists.partition(idList, 999); @@ -364,12 +373,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); //获取所有薪资档案 - List list = getSalaryArchiveMapper().list(queryParam); + List list = getSalaryArchiveList(queryParam); List finalAllArchive = list.stream().filter(dto -> employeeId.contains(dto.getEmployeeId()) && taxAgentIds.contains(dto.getTaxAgentId())).collect(Collectors.toList()); return finalAllArchive; } else { - return getSalaryArchiveMapper().list(queryParam); + return getSalaryArchiveList(queryParam); } } @@ -517,7 +526,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); + Collection salaryArchives = getSalaryArchiveList(queryParam); //分权 Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId); @@ -681,6 +690,10 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } } salaryArchive.setPayEndDate(saveParam.getPayEndDate()); + //如果是非系统人员,需要将起始发薪日期初始化 + if (Objects.equals(salaryArchive.getEmployeeType(), 1)) { + salaryArchive.setRunStatus(SalaryArchiveStatusEnum.FIXED.getValue()); + } // 待停薪 } else if (saveParam.getStatus().equals(SalaryArchiveStatusEnum.SUSPEND)) { if (saveParam.getPayEndDate() == null) { @@ -972,14 +985,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe public Map queryTabTotal() { long currentEmployeeId = user.getUID(); -// // 1.历史数据处理 -// handleHistory(currentEmployeeId); -// // 2.待停薪自动处理 -// handleSuspendData(currentEmployeeId); -// // 3.增量数据处理 -// handleChangeData(currentEmployeeId); - - // tab页签数量 Map result = new HashMap<>(); @@ -988,7 +993,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //获取管理的人员范围 List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); Map> taxAgentEmployeesMap = SalaryEntityUtil.convert2Map(taxAgentEmployeeDTOS, TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getEmployeeList); - List list = null; + List list = new ArrayList<>(); if (needAuth) { // 获取作为管理员的所有个税扣缴义务人列表 Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId); @@ -1013,17 +1018,23 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe long fixedTotal = 0L; long suspendTotal = 0L; long stopTotal = 0L; + long extTotal = 0L; for (SalaryArchivePO sa : list) { - if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) { - pendingTotal += 1; - } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { - fixedTotal += 1; - if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { - suspendTotal += 1; + Integer employeeType = sa.getEmployeeType(); + if (employeeType == null || employeeType == 0) { + if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) { + pendingTotal += 1; + } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { + fixedTotal += 1; + if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { + suspendTotal += 1; + } + } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { + stopTotal += 1; } - } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { - stopTotal += 1; + } else { + extTotal += 1; } } @@ -1031,6 +1042,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe result.put(SalaryArchiveListTypeEnum.FIXED.getValue(), fixedTotal); result.put(SalaryArchiveListTypeEnum.SUSPEND.getValue(), suspendTotal); result.put(SalaryArchiveListTypeEnum.STOP.getValue(), stopTotal); + result.put(SalaryArchiveListTypeEnum.EXT.getValue(), extTotal); return result; } @@ -1200,9 +1212,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentManageRangeEmployeeDTO::getTaxAgentId); // 判断删除待停薪代办的人是否在个税扣缴义务人的人员范围中 - for(SalaryArchiveListDTO dto : list){ + for (SalaryArchiveListDTO dto : list) { TaxAgentManageRangeEmployeeDTO taxAgentManageRangeEmployeeDTO = taxAgentMap.get(dto.getTaxAgentId()); - if(Objects.nonNull(taxAgentManageRangeEmployeeDTO)){ + if (Objects.nonNull(taxAgentManageRangeEmployeeDTO)) { boolean canDelete = taxAgentManageRangeEmployeeDTO.getEmployeeList().stream() .map(TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee::getEmployeeId) .anyMatch(id -> Objects.equals(id, dto.getEmployeeId())); @@ -1214,7 +1226,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } } // 删除最后发薪日期,设置状态为发薪 - if(CollectionUtils.isNotEmpty(list)){ + if (CollectionUtils.isNotEmpty(list)) { getSalaryArchiveMapper().deleteSuspendTodo(list.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList())); } return StringUtils.EMPTY; diff --git a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java index b5af2d3d6..299d740e0 100644 --- a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java @@ -6,6 +6,7 @@ import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.bo.SalaryBillBO; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; import com.engine.salary.entity.salaryBill.po.SalaryBillWatermarkPO; @@ -13,7 +14,12 @@ import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum; import com.engine.salary.service.SalaryBillBaseSetService; import com.engine.salary.service.SalaryBillWatermarkService; import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.sys.constant.SalarySysConstant; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections.CollectionUtils; @@ -21,10 +27,9 @@ import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; + +import static com.engine.salary.sys.constant.SalarySysConstant.*; /** * @Description: 工资单水印 @@ -42,6 +47,10 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + public SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + @Override public SalaryBillWatermarkDTO getWatermarkSetting() { List list = getSalaryBillWatermarkService(user).listAll(); @@ -96,23 +105,16 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB .build()); -// // 工资单确认和反馈 =========================================================== -// new LambdaUpdateChainWrapper<>(salaryBillAckFeedbackMapper) -// .eq(SalaryBillAckFeedbackPO::getDeleteType, 0) -// .eq(SalaryBillAckFeedbackPO::getTenantKey, tenantKey) -// .set(SalaryBillAckFeedbackPO::getDeleteType, 3) -// .update(); -// salaryBillAckFeedbackMapper.insert(SalaryBillAckFeedbackPO.builder() -// .id(IdGenerator.generate()) -// .ackStatus(saveParam.getAckStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO) -// .feedbackStatus(saveParam.getFeedbackStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO) -// .createTime(now) -// .updateTime(now) -// .creator(employeeId) -// .deleteType(NumberUtils.INTEGER_ZERO) -// .tenantKey(tenantKey) -// .build()); - + // 工资单确认和反馈 =========================================================== + SalaryBillAckFeedbackDTO ackFeedbackSetting = saveParam.getAckFeedbackSetting(); + // 1.保存确认反馈开关状态 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAckStatus(), SALARY_SEND_FEEDBACK, "工资单确认反馈状态", "billSend"); + if(StringUtils.equals(ackFeedbackSetting.getAckStatus(),"1")){ + // 2.保存反馈地址 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getFeedBackUrl(), SALARY_FEEDBACK_URL, "工资单反馈地址", "billSend"); + // 3.保存自动确认时间 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAutoAckDays().toString(), SALARY_AUTO_ACK_DAYS, "工资单反馈自动确认", "billSend"); + } return StringUtils.EMPTY; } @@ -126,4 +128,30 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(Long.valueOf(user.getUID())); return SalaryBillBO.handleWmText(wmText, wmTextFieldIds, simpleEmployee); } + + @Override + public SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting() { + // 获取反馈开启状态、自动确认时长、反馈地址 + List codes = Arrays.asList(SalarySysConstant.SALARY_SEND_FEEDBACK, SalarySysConstant.SALARY_AUTO_ACK_DAYS, SalarySysConstant.SALARY_FEEDBACK_URL); + List sysConfList= getSalarySysConfService(user).getListByCodes(codes); + Map sysConfMap = SalaryEntityUtil.convert2Map(sysConfList, SalarySysConfPO::getConfKey, SalarySysConfPO::getConfValue); + + SalaryBillAckFeedbackDTO defaultAckFeedBackDTO = SalaryBillAckFeedbackDTO.builder().build(); + String ackStatus = sysConfMap.getOrDefault(SalarySysConstant.SALARY_SEND_FEEDBACK, "0"); + if (StringUtils.equals(ackStatus,"0")) { + // 未开启工资单确认 + defaultAckFeedBackDTO.setAckStatus("0"); + defaultAckFeedBackDTO.setAutoAckDays(0); + defaultAckFeedBackDTO.setFeedBackUrl("/"); + return defaultAckFeedBackDTO; + } + defaultAckFeedBackDTO.setAckStatus(ackStatus); + // 获取超时自动确认时间 + Integer autoAckDays = Integer.valueOf(sysConfMap.getOrDefault(SalarySysConstant.SALARY_AUTO_ACK_DAYS, "7")); + defaultAckFeedBackDTO.setAutoAckDays(autoAckDays); + // 反馈地址 + String feedbackUrl = sysConfMap.getOrDefault(SalarySysConstant.SALARY_FEEDBACK_URL, ""); + defaultAckFeedBackDTO.setFeedBackUrl(feedbackUrl); + return defaultAckFeedBackDTO; + } } diff --git a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java index 94fdf195d..64ae6fa02 100644 --- a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java @@ -24,9 +24,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; -import com.engine.salary.enums.salarybill.MessageChannelEnum; -import com.engine.salary.enums.salarybill.SalarySendStatusEnum; -import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum; +import com.engine.salary.enums.salarybill.*; import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarybill.SalarySendInfoMapper; @@ -42,6 +40,7 @@ import com.weaver.util.threadPool.entity.LocalRunnable; import lombok.extern.slf4j.Slf4j; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; @@ -426,6 +425,28 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService .buildDetailList(list, salaryAcctEmployees, salaryAcctResultValues); } + @Override + public void confirmSalaryBill(Long salaryInfoId) { + SalarySendInfoPO sendInfoPO = getSalarySendInfoMapper().getById(salaryInfoId); + if(ObjectUtils.isEmpty(sendInfoPO)){ + throw new SalaryRunTimeException("工资单不存在或已被删除!"); + } + sendInfoPO.setBillConfirmStatus(BillConfimStatusEnum.CONFIRMED.getValue()); + sendInfoPO.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO); + } + + @Override + public void feedBackSalaryBill(Long salaryInfoId) { + SalarySendInfoPO sendInfoPO = getSalarySendInfoMapper().getById(salaryInfoId); + if(ObjectUtils.isEmpty(sendInfoPO)){ + throw new SalaryRunTimeException("工资单不存在或已被删除!"); + } + sendInfoPO.setBillConfirmStatus(BillConfimStatusEnum.FEEDBACK.getValue()); + sendInfoPO.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO); + } + public List> getSendInfoList(Long sendId, List ids) { SalarySendPO salarySend = getSalarySendMapper().getById(sendId); @@ -631,6 +652,9 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService po.setSendStatus(SalarySendStatusEnum.ALREADYSEND.getValue()); po.setSendTime(sendTime); po.setSalaryTemplate(JsonUtil.toJsonString(salaryTemplate)); + po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue()); + po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()); + po.setSendEmployeeId(Long.valueOf(user.getUID())); partition.forEach(idsp -> { salarySendInfoMapper.updateGrantWithdraw(po, salarySend.getId(), Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()), idsp); }); diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 3c9988c52..d4cbdb8bf 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.EmployBiz; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; @@ -12,9 +13,12 @@ import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryEntityUtil; @@ -52,52 +56,99 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + + boolean openExtEmp = true; + @Override - public List listAll() { - return employBiz.listEmployee(); + public List listAll(UseEmployeeTypeEnum empType) { + List result = new ArrayList<>(); + if (empType == UseEmployeeTypeEnum.ORG) { + result = employBiz.listEmployee(); + } + if (empType == UseEmployeeTypeEnum.EXT) { + result = getExtEmpService(user).listEmployee(); + } + if (empType == UseEmployeeTypeEnum.ALL) { + result.addAll(employBiz.listEmployee()); + result.addAll(getExtEmpService(user).listEmployee()); + } + return result; } @Override public List listAllForReport() { - return getEmployMapper().listAllForReport(); + List result = employBiz.listAllForReport(); + if (openExtEmp) { + result.addAll(getExtEmpService(user).listAllForReport()); + } + return result; } @Override public List listBySalarySobId(Long salarySobId) { + + List includeSalaryEmployees = new ArrayList<>(); + // 查询薪资账套的人员范围 List includeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ONE); - if (CollectionUtils.isEmpty(includeSalarySobRangePOS)) { - return Collections.emptyList(); - } - // 将薪资账套的人员范围转换成人员查询参数 - List includeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(includeSalarySobRangePOS); - // 根据上一步的查询参数查询人员 - List includeSalaryEmployees = employBiz.listByParams(includeQueryParams); - if (CollectionUtils.isEmpty(includeSalaryEmployees)) { - return Collections.emptyList(); - } - //去重 - includeSalaryEmployees = includeSalaryEmployees.stream().distinct().collect(Collectors.toList()); - // 查询薪资账套的人员范围(从范围中排除) - List excludeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ZERO); - if (CollectionUtils.isNotEmpty(excludeSalarySobRangePOS)) { + if (CollectionUtils.isNotEmpty(includeSalarySobRangePOS)) { // 将薪资账套的人员范围转换成人员查询参数 - List excludeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(excludeSalarySobRangePOS); + List includeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(includeSalarySobRangePOS); // 根据上一步的查询参数查询人员 - List excludeSalaryEmployees = employBiz.listByParams(excludeQueryParams); - // 需要排除的人员范围 - Set excludeEmployeeIds = SalaryEntityUtil.properties(excludeSalaryEmployees, DataCollectionEmployee::getEmployeeId); - // 过滤人员 - includeSalaryEmployees = includeSalaryEmployees.stream() - .filter(salaryEmployee -> !excludeEmployeeIds.contains(salaryEmployee.getEmployeeId())) - .collect(Collectors.toList()); + includeSalaryEmployees = listByParams(includeQueryParams); + if (CollectionUtils.isEmpty(includeSalaryEmployees)) { + return Collections.emptyList(); + } + //去重 + includeSalaryEmployees = includeSalaryEmployees.stream().distinct().collect(Collectors.toList()); + // 查询薪资账套的人员范围(从范围中排除) + List excludeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ZERO); + if (CollectionUtils.isNotEmpty(excludeSalarySobRangePOS)) { + // 将薪资账套的人员范围转换成人员查询参数 + List excludeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(excludeSalarySobRangePOS); + // 根据上一步的查询参数查询人员 + List excludeSalaryEmployees = listByParams(excludeQueryParams); + // 需要排除的人员范围 + Set excludeEmployeeIds = SalaryEntityUtil.properties(excludeSalaryEmployees, DataCollectionEmployee::getEmployeeId); + // 过滤人员 + includeSalaryEmployees = includeSalaryEmployees.stream() + .filter(salaryEmployee -> !excludeEmployeeIds.contains(salaryEmployee.getEmployeeId())) + .collect(Collectors.toList()); + } } + + //外部人员 + List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); + if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { + List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + List extEmps = getExtEmpService(user).getEmployeeByIds(ids); + extEmps = extEmps.stream().distinct().collect(Collectors.toList()); + + includeSalaryEmployees.addAll(extEmps); + } + return includeSalaryEmployees; } @Override public List getEmployeeByIdsAll(List ids) { - return employBiz.getEmployeeByIdsAll(ids); + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List employeeList = employBiz.getEmployeeByIdsAll(ids); + if (openExtEmp) { + employeeList.addAll(getExtEmpService(user).getEmployeeByIds(ids)); + } + return employeeList; } @Override @@ -107,6 +158,12 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public DataCollectionEmployee getEmployeeById(Long employeeId) { + if (openExtEmp) { + DataCollectionEmployee employeeById = getExtEmpService(user).getEmployeeById(employeeId); + if (Objects.nonNull(employeeById)) { + return employeeById; + } + } return employBiz.getEmployeeById(employeeId); } @@ -119,7 +176,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee List> partition = Lists.partition(simpleEmployeeIds, 1000); for (List longs : partition) { employeeList.addAll(employBiz.getEmployeeByIds(longs)); + if (openExtEmp) { + employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs)); + } } + return employeeList; } @@ -147,8 +208,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } //查询对于人员信息导入筛选的全局配置 - SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); - String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + String confValue = empValidType(); List employees = new ArrayList<>(); //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 if ("0".equals(confValue)) { @@ -195,13 +255,18 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listEmployee() { List result = employBiz.listEmployee(); + if (openExtEmp) { + result.addAll(getExtEmpService(user).listEmployee()); + } return result; } @Override public List listByParams(List includeQueryParams) { List result = employBiz.listByParams(includeQueryParams); + if (openExtEmp) { + result.addAll(getExtEmpService(user).listByParams(includeQueryParams)); + } return result; } - } diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index d6d4e8614..39e6d265b 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -139,6 +139,8 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe param.setFormula(param.getFormula().replaceAll("EXISTS", "EXISTS")); param.setFormula(param.getFormula().replaceAll("between", "between")); param.setFormula(param.getFormula().replaceAll("BETWEEN", "BETWEEN")); + param.setFormula(param.getFormula().replaceAll("union", "union")); + param.setFormula(param.getFormula().replaceAll("UNION", "UNION")); // 解析公式中的参数 if (ReferenceTypeEnum.parseByValue(param.getReferenceType()) == ReferenceTypeEnum.FORMULA) { diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 7206f9484..3c390c7f8 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -236,6 +236,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService newSalaryItemPO.setName(saveParam.getName()); newSalaryItemPO.setUseDefault(saveParam.getUseDefault()); newSalaryItemPO.setUseInEmployeeSalary(saveParam.getUseInEmployeeSalary()); + newSalaryItemPO.setHideDefault(saveParam.getHideDefault()); newSalaryItemPO.setRoundingMode(saveParam.getRoundingMode()); newSalaryItemPO.setPattern(saveParam.getPattern()); // newSalaryItemPO.setValueType(saveParam.getValueType()); diff --git a/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java index cb8bee12f..7d9bc06c9 100644 --- a/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java @@ -3,7 +3,6 @@ package com.engine.salary.service.impl; import cn.hutool.core.util.StrUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 41782cef6..4dba50cd0 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1,7 +1,7 @@ package com.engine.salary.service.impl; -import com.alibaba.fastjson.JSON; import cn.hutool.core.lang.Validator; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.dev.api.bean.MessageBean; @@ -37,6 +37,8 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum; +import com.engine.salary.enums.salarybill.BillConfimStatusEnum; +import com.engine.salary.enums.salarybill.BillReadStatusEnum; import com.engine.salary.enums.salarybill.SalarySendStatusEnum; import com.engine.salary.enums.salarybill.SalaryTemplateReplenishRuleEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; @@ -55,7 +57,6 @@ import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -63,6 +64,7 @@ import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.CollectionUtils; +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; @@ -103,6 +105,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService return ServiceUtil.getService(SalarySendRangeServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + private SalaryTemplateService getSalaryTemplateService(User user) { return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); @@ -292,6 +298,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService .id(IdGenerator.generate()) .salarySendId(salarySendId) .employeeId(m.getEmployeeId()) + .employeeType(m.getEmployeeType()) .salaryMonth(m.getSalaryMonth()) .taxAgentId(m.getTaxAgentId()) .salaryAcctRecordId(m.getSalaryAcctRecordId()) @@ -417,11 +424,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } Long salaryAcctId = salarySend.getSalaryAccountingId(); SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctId); -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); -// List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listBySalarySobIds(Collections.singletonList(salarySobCycleDTO.getSalarySobId())); -// // 是否有回算记录 -// boolean haveBackCalc = salaryAcctRecordPOS.stream().filter(PO -> Objects.equals(PO.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && -// Objects.equals(sdf.format(PO.getSalaryMonth()), SalaryDateUtil.MONTH_FORMATTER.format(salarySobCycleDTO.getSalaryMonth()))).collect(Collectors.toList()).size() > 0; String template = ""; // 获取默认模板 List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId())); @@ -437,7 +439,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService Boolean canSend = true; SalaryAcctRecordPO acctRecord = getSalaryAcctRecordService(user).getById(salaryAcctId); // 回算过,但是查看的是普通工资单(不能发);回算过,但是查看的是回算工资单(可以发);记录没回算过(可以发) - if(Objects.equals(acctRecord.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && Objects.equals(salarySend.getSalaryAcctType(),NumberUtils.INTEGER_ZERO)){ + if (Objects.equals(acctRecord.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && Objects.equals(salarySend.getSalaryAcctType(), NumberUtils.INTEGER_ZERO)) { canSend = false; } @@ -475,6 +477,17 @@ public class SalarySendServiceImpl extends Service implements SalarySendService throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),0, "当前账号无法查看此工资单")); } SalarySendInfoPO salarySendInfo = salarySendInfos.get(0); + // 获取默认模板信息 + SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId()); + if(ObjectUtils.isEmpty(salarySendPO)){ + throw new SalaryRunTimeException("工资单不存在"); + } + // 更新查看状态 + if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0) { + salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); + salarySendInfo.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); + } // List salarySends = new LambdaQueryChainWrapper<>(mapper) // .eq(SalarySendPO::getDeleteType, 0) // .eq(SalarySendPO::getTenantKey, currentTenantKey) @@ -598,6 +611,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService handleSalaryWatermark(salaryTemplate, salarySendInfo, currentEmployeeId); map.put("salaryTemplate", salaryTemplate); map.put("salaryAcctResult", salaryAcctResultS); + // 工资单发送人、是否已确认 + if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(),1) == 0) { + map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); + map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); + }else{ + map.put("confirmStatus", "1"); + } return map; } @@ -611,7 +631,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService */ private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long currentEmployeeId) { SalaryBillWatermarkDTO salaryBillWatermark = JsonUtil.parseObject(salaryTemplate.getSalaryWatermark(), SalaryBillWatermarkDTO.class); - if (Objects.isNull(salaryBillWatermark) || !salaryBillWatermark.getWatermarkStatus() ) { + if (Objects.isNull(salaryBillWatermark) || Boolean.FALSE.equals(salaryBillWatermark.getWatermarkStatus()) ) { return; } // 发送时已经处理好变量字段,可直接获取判断 @@ -643,8 +663,48 @@ public class SalarySendServiceImpl extends Service implements SalarySendService queryParam.setOrderRule(orderRule); List page = salarySendInfoMapper.list(queryParam); - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), page, SalarySendInfoListDTO.class); + SalarySendPO salarySendPO = getSalarySendMapper().getById(queryParam.getSalarySendId()); + if (ObjectUtils.isEmpty(salarySendPO)){ + throw new SalaryRunTimeException("工资单不存在或已被删除"); + } + List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); + if(CollectionUtils.isEmpty(salaryTemplates)){ + throw new SalaryRunTimeException("请先设置工资单模板"); + } + Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); + if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { + // 默认为空时,未读未确认 + pageInfo.getList().stream().forEach(obj -> { + SalarySendInfoListDTO dto = (SalarySendInfoListDTO) obj; + if (StringUtils.isBlank( dto.getBillReadStatus() )){ + dto.setBillReadStatus(BillReadStatusEnum.UNREAD.getDefaultLabel()); + } else { + dto.setBillReadStatus(BillReadStatusEnum.getDefaultLabelByValue( Integer.valueOf(dto.getBillReadStatus()) )); + } + if (StringUtils.isBlank(dto.getBillConfirmStatus())){ + dto.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getDefaultLabel()); + } else { + dto.setBillConfirmStatus(BillConfimStatusEnum.getDefaultLabelByValue( Integer.valueOf(dto.getBillConfirmStatus()) )); + } + }); + } + List list = pageInfo.getList(); + + List employeeList = getExtEmpService(user).listEmployee(); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + list.forEach(dto -> { + if (dto.getEmployeeType() != null && Objects.equals(dto.getEmployeeType(), 1)) { + DataCollectionEmployee employee = employeeMap.get(dto.getEmployeeId()); + dto.setUsername(employee.getUsername()); + dto.setDepartment(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + } + }); + pageInfo.setList(list); + return pageInfo; } @Override @@ -684,7 +744,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService return new PageInfo<>(); } } - List list = MapperProxyFactory.getProxy(SalarySendInfoMapper.class).detailList(queryParam, otherSalaryAcctRecordIds); + List list = getSalarySendInfoMapper().detailList(queryParam, otherSalaryAcctRecordIds); return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalarySendDetailListDTO.class); } @@ -728,6 +788,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService Map map = JsonUtil.parseMap(salaryTemplateContent, Object.class); return SalaryTemplatePO.builder() .id(Long.valueOf(map.getOrDefault("id", "0").toString())) + .ackFeedbackStatus(Integer.valueOf(map.getOrDefault("ackFeedbackStatus", "0").toString())) + .autoAckDays(Integer.valueOf(map.getOrDefault("autoAckDays", "0").toString())) + .feedbackUrl(map.getOrDefault("feedbackUrl", "").toString()) .name(map.getOrDefault("name", "").toString()) .salarySobId(Long.valueOf(map.getOrDefault("salarySobId", "0").toString())) .useType(Integer.valueOf(map.getOrDefault("useType", "0").toString())) @@ -823,16 +886,27 @@ public class SalarySendServiceImpl extends Service implements SalarySendService List salaryAccountingResults = getSalaryAcctResultMapper().listSome(po); encryptUtil.decryptList(salaryAccountingResults, SalaryAcctResultPO.class, user); // 动态列 + List employeeList = getExtEmpService(user).listEmployee(); + Map> idEmpMap = SalaryEntityUtil.group2Map(employeeList, DataCollectionEmployee::getEmployeeId); list.forEach(e -> { + //是否外部人员 + Integer employeeType = e.getEmployeeType(); + DataCollectionEmployee extEmp = new DataCollectionEmployee(); + if (Objects.equals(employeeType, 1)) { + List employees = idEmpMap.getOrDefault(e.getEmployeeId(), new ArrayList<>()); + if (CollectionUtils.isNotEmpty(employees) && employees.size() == 1) { + extEmp = employees.get(0); + } + } Map map = new LinkedHashMap<>(); map.put("id", e.getId()); map.put("employeeId", e.getEmployeeId()); - map.put("username", e.getUsername()); + map.put("username", Objects.equals(employeeType, 1) ? extEmp.getUsername() : e.getUsername()); map.put("taxAgent", e.getTaxAgent()); - map.put("department", e.getDepartment()); - map.put("mobile", e.getMobile()); - map.put("jobNum", e.getJobNum()); - map.put("email", e.getEmail()); + map.put("department", Objects.equals(employeeType, 1) ? extEmp.getDepartmentName() : e.getDepartment()); + map.put("mobile", Objects.equals(employeeType, 1) ? extEmp.getMobile() : e.getMobile()); + map.put("jobNum", Objects.equals(employeeType, 1) ? extEmp.getWorkcode() : e.getJobNum()); + map.put("email", Objects.equals(employeeType, 1) ? extEmp.getEmail() : e.getEmail()); salaryItems.forEach(i -> { Optional optional = salaryAccountingResults.stream() .filter(r -> r.getEmployeeId().equals(e.getEmployeeId()) && r.getSalaryItemId().equals(Long.valueOf(i.getSalaryItemId()))).findFirst(); @@ -960,9 +1034,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if (isReplenish && StringUtils.isNotEmpty(salaryTemplate.getReplenishSalaryItemSetting())) { List salaryTemplateShowSetData = JsonUtil.parseList(salaryTemplate.getReplenishSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class); - salaryTemplateShowSetData.stream().filter(f -> !f.getGroupId().equals(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)).forEach(e -> { - salaryItems.addAll(e.getItems()); - }); + salaryTemplateShowSetData.stream().filter(f -> !f.getGroupId().equals(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)).forEach(e -> + salaryItems.addAll(e.getItems()) + ); } return salaryItems; } @@ -1008,6 +1082,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService po.setSendStatus(SalarySendStatusEnum.ALREADYSEND.getValue()); po.setSendTime(sendTime); po.setSalaryTemplate(JsonUtil.toJsonString(templatePO)); + po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue()); + po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()); + po.setSendEmployeeId(Long.valueOf(user.getUID())); salarySendInfoMapper.updateGrantWithdraw(po, salarySendId, Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()), ids); @@ -1066,7 +1143,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if (CollectionUtils.isNotEmpty(param.getIds())) { pos = list.stream().filter(f -> param.getIds().contains(f.getId())).collect(Collectors.toList()); } - pos.forEach(po -> { + pos.stream().filter(po -> !Objects.equals(po.getEmployeeType(), 1)).forEach(po -> { Long employeeId = po.getEmployeeId(); if (sendFlag) { sendPayRollEMMessage(po, param.getTemplate(), employeeId); @@ -1242,6 +1319,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // 撤回 SalarySendInfoPO po = new SalarySendInfoPO(); po.setSendStatus(SalarySendStatusEnum.WITHDRAW.getValue()); + po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue()); + po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()); List statusList = new ArrayList<>(); statusList.add(SalarySendStatusEnum.ALREADYSEND.getValue()); salarySendInfoMapper.updateGrantWithdraw(po, salarySendId, statusList, ids); @@ -1311,11 +1390,24 @@ public class SalarySendServiceImpl extends Service implements SalarySendService OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); List list = salarySendInfoMapper.list(queryParam); + List employeeList = getExtEmpService(user).listEmployee(); + Map> idEmpMap = SalaryEntityUtil.group2Map(employeeList, DataCollectionEmployee::getEmployeeId); list.forEach(e -> { SalarySendStatusEnum salarySendStatusEnum = SalarySendStatusEnum.parseByValue(Integer.parseInt(e.getSendStatus())); // 发放状态 -// e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getSendStatus()))); + // e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getSendStatus()))); e.setSendStatus(SalaryI18nUtil.getI18nLabel(user.getLanguage(),salarySendStatusEnum.getLabelId(), salarySendStatusEnum.getDefaultLabel())); + //外部人员 + if (Objects.equals(e.getEmployeeType(), 1)) { + List employees = idEmpMap.getOrDefault(e.getEmployeeId(), new ArrayList<>()); + if (CollectionUtils.isNotEmpty(employees) && employees.size() == 1) { + DataCollectionEmployee employee = employees.get(0); + e.setUsername(employee.getUsername()); + e.setDepartment(employee.getDepartmentName()); + e.setMobile(employee.getMobile()); + e.setJobNum(employee.getWorkcode()); + } + } }); @@ -1442,7 +1534,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if(Objects.isNull(salarySendPO)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542419, "工资发放记录不存在或已被删除")); } -// return getSalaryAcctResultService(user).sumRow(); SalaryAcctResultQueryParam queryParam = SalaryAcctResultQueryParam.builder().salaryAcctRecordId(salarySendPO.getSalaryAccountingId()).build(); // 查询薪资核算人员 @@ -1450,7 +1541,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService .listByResultQueryParam(queryParam); if (org.apache.commons.collections4.CollectionUtils.isEmpty(salaryAcctEmployeePOS)) { - return null; + return Collections.emptyMap(); } // 查询薪资核算记录 SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId()); @@ -1473,7 +1564,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService // 是否是补发工资单 List salarySendInfoPOS = getSalarySendInfoMapper().listSome(SalarySendInfoPO.builder().salarySendId(salarySendId).build()); List sendEmployeeIds = salarySendInfoPOS.stream().map(SalarySendInfoPO::getEmployeeId).collect(Collectors.toList()); - salaryAcctResultPOS = salaryAcctResultPOS.stream().filter(PO -> sendEmployeeIds.contains(PO.getEmployeeId())).collect(Collectors.toList()); + salaryAcctResultPOS = salaryAcctResultPOS.stream().filter(po -> sendEmployeeIds.contains(po.getEmployeeId())).collect(Collectors.toList()); Map map = new HashMap<>(); Map> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryItemId); @@ -1563,7 +1654,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService @Override public List getNeedSendInfoList(List salarySendIds) { - if(CollectionUtils.isEmpty(salarySendIds)){ + if (CollectionUtils.isEmpty(salarySendIds)) { return Collections.emptyList(); } return getSalarySendInfoMapper().getNeedSendInfoList(salarySendIds); @@ -1571,9 +1662,33 @@ public class SalarySendServiceImpl extends Service implements SalarySendService @Override public List getNeedSendListBySalarySobIds(List salarySobIds) { - if(CollectionUtils.isEmpty(salarySobIds)){ + if (CollectionUtils.isEmpty(salarySobIds)) { return Collections.emptyList(); } return getSalarySendMapper().getNeedSendListBySalarySobIds(salarySobIds); } + + @Override + public List listUnConfirmedSendInfo(List salarySobIds) { + if(CollectionUtils.isEmpty(salarySobIds)) + return Collections.emptyList(); + return getSalarySendInfoMapper().listUnConfirmedSendInfo(salarySobIds); + } + + @Override + public void autoConfirmSalaryBill(List needAutoSendIds) { + if(CollectionUtils.isEmpty(needAutoSendIds)){ + return; + } + List> partition = Lists.partition((List) needAutoSendIds, 500); + partition.forEach(getSalarySendInfoMapper()::autoConfirmSalaryBill); + } + + @Override + public List getByIds(List salarySendId) { + if(CollectionUtils.isEmpty(salarySendId)){ + return Collections.emptyList(); + } + return getSalarySendMapper().getByIds(salarySendId); + } } diff --git a/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java new file mode 100644 index 000000000..54808736d --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java @@ -0,0 +1,131 @@ +package com.engine.salary.service.impl; + +import com.api.formmode.mybatis.util.SqlProxyHandle; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.SalarySobExtRangePO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; +import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobExtRangeMapper; +import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.SalarySobExtRangeService; +import com.engine.salary.service.SalarySobService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +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 org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 薪资账套人员范围 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobExtRangeServiceImpl extends Service implements SalarySobExtRangeService { + + + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + + private SalarySobExtRangeMapper getSalarySobExtRangeMapper() { + return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); + } + +// private ComInfoCache comInfoCache; +// private LoggerTemplate salarySobLoggerTemplate; + + @Override + public List listByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + return getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().ids(ids).build()); + } + + @Override + public List listBySalarySobId(Long salarySobId) { + if (salarySobId ==null) { + return Collections.emptyList(); + } + return getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(salarySobId).build()); + } + + + @Override + public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { + ValidUtil.doValidator(saveParam); + + // 查询薪资账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); + } + // 查询已有的人员范围 + List salarySobRangePOS = getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(saveParam.getSalarySobId()).build()); + // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) + List oldTargetIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + + List targetIds = saveParam.getTargetIds(); + Date date = new Date(); + if (CollectionUtils.isNotEmpty(targetIds)) { + targetIds.stream().filter(targetId -> !oldTargetIds.contains(targetId)).forEach(targetId -> { + SalarySobExtRangePO po = SalarySobExtRangePO.builder() + .id(IdGenerator.generate()) + .targetType(1) + .salarySobId(saveParam.getSalarySobId()) + .targetId(targetId) + .createTime(date) + .updateTime(date) + .creator((long) user.getUID()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getSalarySobExtRangeMapper().insertIgnoreNull(po); + }); + } + } + + @Override + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + List salarySobRangePOS = getSalarySobExtRangeMapper().listPage4Ext(SalarySobExtRangePO.builder().salarySobId(param.getSalarySobId()).build()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), salarySobRangePOS, SalarySobExtRangePO.class); + } + + + @Override + public void deleteSalarySobExtRange(Collection ids) { + if(CollectionUtils.isEmpty(ids)){ + return; + } + getSalarySobExtRangeMapper().deleteByIds(ids); + } + +} diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 8a8ff5d0e..1b5beea90 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -378,16 +378,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .salarySobId(salarySobId) .salaryItemId(salarySobItemGroupId) .isGroup(1) - .itemHide(itemGroupParam.getItemHide()) + .itemHide(itemGroupParam.getItemHide() == null ? 0L : itemGroupParam.getItemHide()) .creator(employeeId) .createTime(now) .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); - if (itemGroupParam.getItemHide() == null) { - salarySobGroupItemHidePO.setItemHide(Long.valueOf(0)); - } needInsertItemShow.add(salarySobGroupItemHidePO); // salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); @@ -448,17 +445,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .salarySobId(salarySobId) .salaryItemId(groupId) .isGroup(1) - .itemHide(itemGroupParam.getItemHide()) + .itemHide(itemGroupParam.getItemHide() == null ? 0L : itemGroupParam.getItemHide()) .creator(employeeId) .createTime(now) .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); - if (itemGroupParam.getItemHide() == null) { - salarySobGroupItemHidePO.setItemHide(Long.valueOf(0)); - } -// salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); needInsertItemShow.add(salarySobGroupItemHidePO); @@ -502,7 +495,6 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); -// salarySobItemMapper.InsertItemShow(salarySobItemHidePO); needInsertItemShow.add(salarySobItemHidePO); } //更新 @@ -520,7 +512,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); // 保存薪资项目是否展示 Long salarySobItemShowId = IdGenerator.generate(); - SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder() + needInsertItemShow.add(SalarySobItemHidePO.builder() .id(salarySobItemShowId) .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) @@ -531,9 +523,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); -// salarySobItemMapper.InsertItemShow(salarySobItemHidePO); - needInsertItemShow.add(salarySobItemHidePO); + .build()); } diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index bfadad155..53cc39974 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -4,7 +4,6 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrm.biz.OrganizationShowSetBiz; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.biz.SalarySobRangeBiz; import com.engine.salary.biz.SpecialAddDeductionBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -25,6 +24,7 @@ import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobExtRangeMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.SalarySobRangeService; @@ -44,7 +44,6 @@ import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -85,6 +84,10 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + private SalarySobExtRangeMapper getSalarySobExtRangeMapper() { + return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); + } + // private ComInfoCache comInfoCache; // private LoggerTemplate salarySobLoggerTemplate; @@ -145,7 +148,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange List positionInfos = getSalaryEmployeeService(user).listPositionInfo(positionIds); // 薪资账套的人员范围po转换成列表dto - List salarySobRangeListDTOS = SalarySobRangeBO.convert2ListDTO(salarySobRangePOS, empInfos, deptInfos,subCompanyInfos, positionInfos, user); + List salarySobRangeListDTOS = SalarySobRangeBO.convert2ListDTO(salarySobRangePOS, empInfos, deptInfos, subCompanyInfos, positionInfos, user); // 根据对象名称过滤 if (StringUtils.isNotEmpty(queryParam.getTargetName())) { salarySobRangeListDTOS = salarySobRangeListDTOS.stream() @@ -153,7 +156,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange .collect(Collectors.toList()); } // 填充总数和当页数据 - PageInfo pageInfo = new PageInfo(salarySobRangeListDTOS,SalarySobRangeListDTO.class); + PageInfo pageInfo = new PageInfo(salarySobRangeListDTOS, SalarySobRangeListDTO.class); pageInfo.setTotal(salarySobRangeListDTOS.size()); pageInfo.setList(SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), salarySobRangeListDTOS)); pageInfo.setPageNum(queryParam.getCurrent()); @@ -206,13 +209,13 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // 删除薪资账套的人员范围 salarySobRangeBiz.deleteByIds(ids); // 查询薪资账套 - Set salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId); - List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); - // 是"关联人员范围"还是"从范围中排除" - Integer includeType = salarySobRangePOS.get(0).getIncludeType(); - // todo 记录日志 - String operateTypeName = Objects.equals(includeType, NumberUtils.INTEGER_ONE) ? - SalaryI18nUtil.getI18nLabel(user.getLanguage(),542427, "关联人员范围删除对象") : SalaryI18nUtil.getI18nLabel(user.getLanguage(),542428, "从范围中排除删除对象"); +// Set salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId); +// List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); +// // 是"关联人员范围"还是"从范围中排除" +// Integer includeType = salarySobRangePOS.get(0).getIncludeType(); +// // todo 记录日志 +// String operateTypeName = Objects.equals(includeType, NumberUtils.INTEGER_ONE) ? +// SalaryI18nUtil.getI18nLabel(user.getLanguage(),542427, "关联人员范围删除对象") : SalaryI18nUtil.getI18nLabel(user.getLanguage(),542428, "从范围中排除删除对象"); // salarySobPOS.forEach(salarySobPO -> { // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salarySobPO.getId()); @@ -242,10 +245,10 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; // 注释 List excelComments = Lists.newArrayList(); - if(confValue.equals("1")){ + if (confValue.equals("1")) { // 人员校验规则为工号 excelComments.add(new ExcelComment(3, 0, 4, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),30036, "必填"))); - }else { + } else { excelComments.add(new ExcelComment(0, 0, 1, 2, SalaryI18nUtil.getI18nLabel(user.getLanguage(),30036, "必填"))); } excelComments.add(new ExcelComment(4, 0, 6, 3, SalaryI18nUtil.getI18nLabel(user.getLanguage(),542429, "若不填,默认全部员工状态。指定员工状态格式:试用、正式、临时、试用延期"))); @@ -365,19 +368,19 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange } // 设置员工状态 - if(StringUtils.isEmpty(employeeStatusStr)){ + if (StringUtils.isEmpty(employeeStatusStr)) { SalaryEmployeeStatusEnum[] values = SalaryEmployeeStatusEnum.values(); po.setEmployeeStatus(SalaryEmployeeStatusEnum.values()); - }else{ + } else { Boolean[] haveError = {false}; // 人员状态字符串转换为对应的value SalaryEmployeeStatusEnum[] status = SalaryEmployeeStatusEnum.getEnumsParseByFormatStr(employeeStatusStr, haveError); - if(haveError[0]){ + if (haveError[0]) { Map errorMessageMap = new HashMap<>(); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(user.getLanguage(),542431,"员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期")); errorData.add(errorMessageMap); errorSum += 1; - }else{ + } else { po.setEmployeeStatus(status); } } @@ -428,7 +431,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange } // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); // 去重(通过记录的唯一条件(人员id) - List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new)); + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId()))), ArrayList::new)); return finalPos; } @@ -455,7 +458,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx"); + List salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx"); apidatas.put("preview", salarySobRangeImportList); } finally { IOUtils.closeQuietly(fileInputStream); @@ -465,8 +468,8 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange /** + * @return List> * @description 获取excel数据行 - * @return List> * @author Harryxzy * @date 2023/1/9 11:37 */ diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 7cc322679..84f8a3b5b 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -11,20 +11,19 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; import com.engine.salary.entity.salarysob.bo.*; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; -import com.engine.salary.entity.salarysob.param.SalarySobBasicSaveParam; -import com.engine.salary.entity.salarysob.param.SalarySobDisableParam; -import com.engine.salary.entity.salarysob.param.SalarySobDuplicateParam; -import com.engine.salary.entity.salarysob.param.SalarySobListQueryParam; +import com.engine.salary.entity.salarysob.param.*; import com.engine.salary.entity.salarysob.po.*; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.SalarySystemTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobMapper; +import com.engine.salary.mapper.taxagent.TaxAgentExtRangeMapper; import com.engine.salary.service.*; import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; import com.engine.salary.sys.service.SalarySysConfService; @@ -82,6 +81,14 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return MapperProxyFactory.getProxy(SalarySobMapper.class); } + private TaxAgentExtRangeMapper getTaxAgentExtRangeMapper() { + return MapperProxyFactory.getProxy(TaxAgentExtRangeMapper.class); + } + + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + private SalaryItemService getSalaryItemService(User user) { return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } @@ -124,7 +131,6 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } - @Override public SalarySobPO getById(Long id) { return salarySobMapper.getById(id); @@ -372,6 +378,13 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobBackItems())) { getSalarySobBackItemService(user).batchInsert(result.getNeedInsertSalarySobBackItems()); } + if (CollectionUtils.isNotEmpty(result.getNeedInsertItemHides())) { + //去重 + List list = new ArrayList<>(result.getNeedInsertItemHides().stream() + .collect(Collectors.toMap(SalarySobItemHidePO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue)) + .values()); + salarySobItemService.batchInsertItemShow(list); + } } /** @@ -401,6 +414,14 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { salarySobRangeBiz.batchInsert(rangeList); } + //非系统人员 + List taxAgentExtRangePOS = getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().taxAgentId(salarySobPO.getTaxAgentId()).build()); + taxAgentExtRangePOS.forEach(po -> { + SalarySobRangeExtSaveParam build = SalarySobRangeExtSaveParam.builder().salarySobId(salarySobPO.getId()).targetIds(Collections.singletonList(po.getTargetId())).targetType(1L).build(); + getSalarySobExtRangeService(user).saveExtRange(build); + }); + + } diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 0fda50b28..dd8f88fdf 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -198,6 +198,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0); salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus()?1:0); salaryTemplateNew.setAutoSendCycleType(saveParam.getAutoSendCycleType()); + salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0); + salaryTemplateNew.setAutoAckDays(saveParam.getAutoAckDays()); + salaryTemplateNew.setFeedbackUrl(saveParam.getFeedbackUrl()); // todo 薪资项目设置检查校验 salaryTemplateNew.setSalaryItemSetting(saveParam.getSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()) : ""); salaryTemplateNew.setReplenishSalaryItemSetting(saveParam.getReplenishSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getReplenishSalaryItemSetting()) : ""); @@ -353,4 +356,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate public List getAutoSendTemplate() { return mapper.listSome(SalaryTemplatePO.builder().autoSendStatus(NumberUtils.INTEGER_ONE).useType(NumberUtils.INTEGER_ONE).deleteType(NumberUtils.INTEGER_ZERO).build()); } + + @Override + public List listNeedAckDefaultTemplate() { + return mapper.listSome(SalaryTemplatePO.builder().useType(NumberUtils.INTEGER_ONE).ackFeedbackStatus(NumberUtils.INTEGER_ONE).build()); + } } diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 24354d288..f9b6138c6 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -3,7 +3,6 @@ package com.engine.salary.service.impl; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.biz.SpecialAddDeductionBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; diff --git a/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java index 8f51aa59e..6accd0dae 100644 --- a/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SysSalaryItemServiceImpl.java @@ -111,4 +111,9 @@ public class SysSalaryItemServiceImpl extends Service implements SysSalaryItemSe public List listSome(SysSalaryItemPO po) { return getSysSalaryItemMapper().listSome(po); } + + @Override + public List listLikeName(SysSalaryItemPO po) { + return getSysSalaryItemMapper().listLikeName(po); + } } diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 4cf2168ed..cc2d23985 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -7,6 +7,8 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import com.engine.salary.mapper.taxagent.TaxAgentEmpMapper; @@ -55,11 +57,20 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic } @Override - public List listByTaxAgentIds(List taxAgentIds) { + public List listByTaxAgentIds(List taxAgentIds, UseEmployeeTypeEnum type) { if (CollectionUtils.isEmpty(taxAgentIds)) { return Lists.newArrayList(); } - return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build()); + TaxAgentEmpPO param = TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build(); + if (type == UseEmployeeTypeEnum.ORG) { + param.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } + + if (type == UseEmployeeTypeEnum.EXT) { + param.setEmployeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()); + } + + return getTaxAgentEmpMapper().listSome(param); } @Override @@ -68,7 +79,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); - List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds); + List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); Date now = new Date(); // 关联表 List taxAgentEmployeeAddList = Lists.newArrayList(); @@ -154,4 +165,101 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList); } } + + @Override + public void syncTaxAgentExtEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId) { + if (CollectionUtils.isEmpty(taxAgentEmpSaveParamList)) { + return; + } + List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); + List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); + Date now = new Date(); + // 关联表 + List taxAgentEmployeeAddList = Lists.newArrayList(); + List taxAgentEmployeeDelIds = Lists.newArrayList(); + // 增量表 + List taxAgentEmpChangeList = Lists.newArrayList(); + + taxAgentEmpSaveParamList.forEach(saveParam -> { + List existList = taxAgentEmployeeExistList.stream().filter(f -> f.getTaxAgentId().equals(saveParam.getTaxAgentId())).collect(Collectors.toList()); + Map taxAgentEmployeeMap = SalaryEntityUtil.convert2Map(existList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + for (DataCollectionEmployee se : saveParam.getSalaryEmployeeList()) { + String key = saveParam.getTaxAgentId() + "-" + se.getEmployeeId(); + // 本地有的不动 + if (taxAgentEmployeeMap.containsKey(key)) { + taxAgentEmployeeMap.remove(key); + continue; + } + taxAgentEmployeeAddList.add(TaxAgentEmpPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(se.getEmployeeId()) + .employeeName(se.getUsername()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + + Arrays.stream(TaxAgentEmpChangeModuleEnum.values()).forEach(e -> { + taxAgentEmpChangeList.add(TaxAgentEmpChangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(se.getEmployeeId()) + .employeeName(se.getUsername()) + .changeType(TaxAgentEmpChangeTypeEnum.ADD.getValue()) + .moduleType(e.getValue()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + }); + + } + //遍历剩余的就是删除的 + for (String key : taxAgentEmployeeMap.keySet()) { + TaxAgentEmpPO value = taxAgentEmployeeMap.get(key); + taxAgentEmployeeDelIds.add(value.getId()); + + Arrays.stream(TaxAgentEmpChangeModuleEnum.values()).forEach(e -> { + taxAgentEmpChangeList.add(TaxAgentEmpChangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(value.getEmployeeId()) + .employeeName(value.getEmployeeName()) + .changeType(TaxAgentEmpChangeTypeEnum.DEL.getValue()) + .moduleType(e.getValue()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + }); + } + }); + + // 关联表==================================================== + // 新增 + if (CollectionUtils.isNotEmpty(taxAgentEmployeeAddList)) { + List> partition = Lists.partition(taxAgentEmployeeAddList, 100); + partition.forEach(getTaxAgentEmpMapper()::batchInsert); + } + // 删除 + if (CollectionUtils.isNotEmpty(taxAgentEmployeeDelIds)) { + List> partition = Lists.partition(taxAgentEmployeeDelIds, 100); + partition.forEach(getTaxAgentEmpMapper()::deleteByIds); + } + // 增量表==================================================== + if (CollectionUtils.isNotEmpty(taxAgentEmpChangeList)) { + getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList); + } + } + } diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 953a585a9..f1ab0ef4e 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.HrmStatus; @@ -13,15 +14,17 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeListDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.*; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.mapper.taxagent.TaxAgentExtRangeMapper; import com.engine.salary.mapper.taxagent.TaxAgentManageRangeMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; @@ -35,6 +38,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.weaver.util.threadPool.ThreadPoolUtil; 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.lang3.StringUtils; @@ -69,6 +73,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM return MapperProxyFactory.getProxy(TaxAgentManageRangeMapper.class); } + private TaxAgentExtRangeMapper getTaxAgentExtRangeMapper() { + return MapperProxyFactory.getProxy(TaxAgentExtRangeMapper.class); + } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -81,10 +89,15 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); } - private EmployMapper getEmployMapper() { - return MapperProxyFactory.getProxy(EmployMapper.class); + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } @@ -318,7 +331,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(saveParam.getTaxAgentId(), allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ @@ -373,6 +386,112 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } } + + /** + * 根据个税口角义务人id保存管理范围 + * + * @param saveParam 保存参数 + */ + @Override + public void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam) { + + if (saveParam == null) { + throw new SalaryRunTimeException("参数错误"); + } + Long taxAgentId = saveParam.getTaxAgentId(); + if (Objects.isNull(taxAgentId)) { + throw new SalaryRunTimeException("个税扣缴义务人的id不允许为空"); + } + + + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); + if (Objects.isNull(taxAgent)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,个税扣缴义务人不存在或不在权限范围内")); + } + + List targetIds = saveParam.getTargetIds(); + List employees = getExtEmpService(user).getEmployeeByIds(targetIds); + if (Objects.isNull(employees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,无此外部人员")); + } + + Date now = new Date(); + List oldPO = listAllExtBytaxAgentId(taxAgentId); + List oldIds = SalaryEntityUtil.properties(oldPO, TaxAgentExtRangePO::getTargetId, Collectors.toList()); + targetIds.stream().filter(targetId -> !oldIds.contains(targetId)).forEach(targetId -> { + TaxAgentExtRangePO po = TaxAgentExtRangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .targetId(targetId) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(0) + .targetType(1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + + getTaxAgentExtRangeMapper().insertIgnoreNull(po); + }); + + + /* 同步本地人员范围的关联人员=========================== */ + if (saveParam.isSync()) { + //同步执行 + syncLocalExtEmp(taxAgentId, employees); + } else { + taskExecutor.execute(() -> { + syncLocalExtEmp(taxAgentId, employees); + }); + } + } + + private List listAllExtBytaxAgentId(Long taxAgentId) { + if (taxAgentId == null) { + return new ArrayList<>(); + } + return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().taxAgentId(taxAgentId).build()); + } + + private List listExtByIds(Collection targetIds) { + if (CollectionUtils.isEmpty(targetIds)) { + return new ArrayList<>(); + } + return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build()); + } + + @Override + public void deleteExtRange(Collection ids) { + // 查询管理范围 + List taxAgentManageRanges = listExtByIds(ids); + if (CollectionUtils.isEmpty(taxAgentManageRanges)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98604, "数据不存在或已被删除")); + } + List taxAgentIds = taxAgentManageRanges.stream().map(TaxAgentExtRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); + if (taxAgentIds.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110159, "一次只能删一个个税个税扣缴义务人的范围")); + } + // 删除管理范围 + getTaxAgentExtRangeMapper().deleteByIds(ids); + } + + private void syncLocalExtEmp(Long taxAgentId, List allSalaryEmployees) { + + List taxAgentEmpSaveParamList = Collections.singletonList(getTaxAgentEmpSyncParam(taxAgentId, allSalaryEmployees)); + // 同步个税扣缴义务人的人员 + getTaxAgentEmpService(user).syncTaxAgentExtEmployee(taxAgentEmpSaveParamList, (long) user.getUID()); + +// //生成档案 + getSalaryArchiveService(user).handleChangeData(1L); +// //生成社保福利档案 +// String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign"); +// if (welSign == null || "0".equals(welSign)) { +// getSIArchivesService(user).handleChangeData(1L); +// } + } + + /** * 获取个税口角义务人的管理范围 * @@ -422,7 +541,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // List allSubAdminRanges = allManageRanges.stream().filter(f -> f.getRangeType().equals(TaxAgentRangeTypeEnum.SUBADMIN.getValue())).collect(Collectors.toList()); Long taxAgentId = taxAgentIds.get(0); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); // List allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allSubAdminRanges, salaryEmployees); @@ -440,6 +559,16 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 记录日志 todo } + @Override + public PageInfo listExt(TaxAgentRangeExtQueryParam param) { + if (param.getTaxAgentId() == null) { + throw new SalaryRunTimeException("扣缴义务人id为空"); + } + + List taxAgentExtRangePOS = getTaxAgentExtRangeMapper().list(TaxAgentExtRangePO.builder().taxAgentId(param.getTaxAgentId()).build()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), taxAgentExtRangePOS, TaxAgentExtRangePO.class); + } + @Override public void deleteByTaxAgentIds(Collection taxAgentIds) { getTaxAgentManageRangeMapper().deleteByTaxAgentIds(taxAgentIds); @@ -462,7 +591,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } taxAgentIds = allManageRanges.stream().map(TaxAgentManageRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); // 获取所有人员 - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List taxAgentEmpSaveParamList = Lists.newArrayList(); List subAdminEmpSaveParamList = Lists.newArrayList(); @@ -737,7 +866,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index d2399204e..1834d5f38 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -7,10 +7,14 @@ import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryAuthConstant; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO; @@ -20,6 +24,7 @@ import com.engine.salary.entity.taxagent.param.TaxAgentAdminChangeCheckParam; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.param.TaxAgentSaveParam; import com.engine.salary.entity.taxagent.po.*; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.taxagent.TaxAgentRoleTypeEnum; @@ -27,9 +32,10 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.archive.SalaryArchiveMapper; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; -import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; +import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; +import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; @@ -112,8 +118,16 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return MapperProxyFactory.getProxy(TaxAgentMapper.class); } - private EmployMapper getEmployMapper() { - return MapperProxyFactory.getProxy(EmployMapper.class); + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() { + return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class); + } + + private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); } @@ -133,7 +147,18 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public List listEmployees() { - return getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + return convert2TaxAgentEmployeePO(employees); + } + + public List convert2TaxAgentEmployeePO(List dataCollectionEmployees) { + List result = new ArrayList<>(); + dataCollectionEmployees.stream().forEach(PO -> { + TaxAgentEmployeePO taxAgentEmployeePO = new TaxAgentEmployeePO(); + BeanUtils.copyProperties(PO, taxAgentEmployeePO); + result.add(taxAgentEmployeePO); + }); + return result; } @Override @@ -274,7 +299,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { List taxAgents = getTaxAgentMapper().listAll(); List taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds); + List taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); if (CollectionUtils.isEmpty(taxAgentEmployees)) { return Lists.newArrayList(); @@ -296,6 +321,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public String save(TaxAgentSaveParam saveParam) { ValidUtil.doValidator(saveParam); + saveParam.setName(StringUtils.trim(saveParam.getName())); // 是否开启分权 boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution(); @@ -340,6 +366,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public String update(TaxAgentSaveParam saveParam) { ValidUtil.doValidator(saveParam, RuntimeTypeEnum.UPDATE); + saveParam.setName(StringUtils.trim(saveParam.getName())); TaxAgentPO taxAgent = getById(saveParam.getId()); if (taxAgent == null) { @@ -455,6 +482,16 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { if (CollectionUtils.isNotEmpty(salaryArchiveList)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542567, "存在薪资档案引用")); } + // 被社保福利档案引用 + List socialByPaymentOrganization = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(id); + if(CollectionUtils.isNotEmpty(socialByPaymentOrganization)){ + throw new SalaryRunTimeException("存在社保福利档案引用"); + } + // 被社保福利台账引用 + List insuranceArchiveList = getInsuranceAccountBatchMapper().list(InsuranceAccountBatchParam.builder().taxAgents(Collections.singletonList(id)).build()); + if(CollectionUtils.isNotEmpty(insuranceArchiveList)){ + throw new SalaryRunTimeException("存在社保福利台账引用"); + } //被社保福利档案引用 // List socialSchemePOList = new LambdaQueryChainWrapper<>(siArchivesSocialMapper) // .eq(InsuranceArchivesSocialSchemePO::getTenantKey) @@ -590,7 +627,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees = convert2TaxAgentEmployeePO(employees); if (employeeStatus != null) { List personnelStatusList; // 查询人员状态 @@ -614,13 +652,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { if (CollectionUtils.isNotEmpty(adminTaxAgentIds)) { taxAgentManageRangeEmployeeList.addAll(getTaxAgentEmp(allTaxAgents, adminTaxAgentIds, allEmployees)); } - // 2.根据作为非管理员查找自己作为分管理员, 对应的管理范围人员 - List noAdminTaxAgentIds = allTaxAgents.stream() - .map(TaxAgentPO::getId) - .filter(id -> !adminTaxAgentIds.contains(id)).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(noAdminTaxAgentIds)) { -// taxAgentManageRangeEmployeeList.addAll(getTaxAgentSubAdminEmp(allTaxAgents, noAdminTaxAgentIds, allEmployees)); - } return taxAgentManageRangeEmployeeList; } @@ -635,7 +666,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return taxAgentManageRangeEmployeeList; } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees = convert2TaxAgentEmployeePO(employees); taxAgentManageRangeEmployeeList.addAll(getTaxAgentEmp(allTaxAgents, taxAgentIds, allEmployees)); return taxAgentManageRangeEmployeeList; } @@ -650,7 +682,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees = convert2TaxAgentEmployeePO(employees); // 1.判断自己是否是管理员, 如果是管理员,就是能够操作所属个税扣缴义务人下的所有人的数据 List taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIdsAndEmployeeId(taxAgentIds, (long) user.getUID()); @@ -706,7 +739,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { */ private List getTaxAgentEmp(List allTaxAgents, List taxAgentIds, List allEmployees) { List taxAgentManageRangeEmployeeList = Lists.newArrayList(); - List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds); + List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ALL); taxAgentEmps = taxAgentEmps.stream().filter(f -> allEmployees.stream().anyMatch(e -> e.getEmployeeId().equals(f.getEmployeeId()))).collect(Collectors.toList()); @@ -760,7 +793,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public Collection listEmployeeIdsInTaxAgent(Long taxAgentId) { - List taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId)); + List taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId),UseEmployeeTypeEnum.ALL); return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); } diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index b89a5aa20..b6d49d941 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -80,4 +80,19 @@ public class SalarySysConstant { * 删除薪资档案 */ public static final String SALARY_ARCHIVE_DELETE = "salaryArchiveDelete"; + + /** + * 工资单确认反馈状态 + */ + public static final String SALARY_SEND_FEEDBACK = "SALARY_SEND_FEEDBACK"; + + /** + * 工资单反馈自动确认 + */ + public static final String SALARY_AUTO_ACK_DAYS = "SALARY_AUTO_ACK_DAYS"; + /** + * 工资单反馈地址 + */ + public static final String SALARY_FEEDBACK_URL = "SALARY_FEEDBACK_URL"; + } diff --git a/src/com/engine/salary/sys/entity/vo/AppSettingVO.java b/src/com/engine/salary/sys/entity/vo/AppSettingVO.java index c9b04d7bb..f4b9ac890 100644 --- a/src/com/engine/salary/sys/entity/vo/AppSettingVO.java +++ b/src/com/engine/salary/sys/entity/vo/AppSettingVO.java @@ -80,4 +80,9 @@ public class AppSettingVO { */ private String salaryArchiveDelete; + /** + * 工资单反馈 + */ + private String salarySendFeedback; + } diff --git a/src/com/engine/salary/sys/service/SalarySysConfService.java b/src/com/engine/salary/sys/service/SalarySysConfService.java index 5f0414164..73cd384dd 100644 --- a/src/com/engine/salary/sys/service/SalarySysConfService.java +++ b/src/com/engine/salary/sys/service/SalarySysConfService.java @@ -108,4 +108,32 @@ public interface SalarySysConfService { * @param setting */ void saveArchiveDelete(String setting); + + /** + * 保存或者更新 + * @param salarySysConfPO + */ + void operate(SalarySysConfPO salarySysConfPO); + + /** + * 保存工资单反馈 + * @param param + */ + void saveSalarySendFeedback(SalarySysConfPO param); + + /** + * 根据code返回list + * @param codes + * @return + */ + List getListByCodes(List codes); + + /** + * 保存或者修改应用设置 + * @param confValue + * @param confKey + * @param title + * @param app + */ + void saveSettingByType(String confValue, String confKey, String title, String app); } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 832dfc1df..3449e9fe8 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -422,7 +422,6 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe if (StringUtils.isBlank(param.getConfValue())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),544141,"无效规则!")); } - saveSettingByType(param.getConfValue(), WITHDRAW_TAX_DECLARATION, "个税申报撤回", "basic"); } @@ -434,6 +433,27 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe saveSettingByType(setting, SALARY_ARCHIVE_DELETE, "薪资、社保福利档案删除规则", "basic"); } + @Override + public void operate(SalarySysConfPO salarySysConfPO) { + saveSettingByType(salarySysConfPO.getConfValue(), salarySysConfPO.getConfKey(), salarySysConfPO.getTitle(), salarySysConfPO.getModule()); + } + + @Override + public void saveSalarySendFeedback(SalarySysConfPO param) { + if (StringUtils.isBlank(param.getConfValue())) { + throw new SalaryRunTimeException("无效规则!"); + } + saveSettingByType(param.getConfValue(), SALARY_SEND_FEEDBACK, "工资单反馈", "basic"); + } + + @Override + public List getListByCodes(List codes) { + if(CollectionUtils.isEmpty(codes)){ + return Collections.emptyList(); + } + return getSalarySysConfMapper().getListByCodes(codes); + } + /** * 保存或者修改应用设置 * @@ -442,7 +462,8 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe * @param title * @param app */ - private void saveSettingByType(String confValue, String confKey, String title, String app) { + @Override + public void saveSettingByType(String confValue, String confKey, String title, String app) { SalarySysConfPO po = getOneByCode(confKey); if (po == null) { SalarySysConfPO build = SalarySysConfPO.builder() @@ -507,21 +528,30 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } SalarySysConfPO withDrawRule = salarySysConfMap.get(WITHDRAW_TAX_DECLARATION); - if (withDrawRule == null ) { + if (withDrawRule == null) { // 个税申报撤回 appSettingVO.setWithDrawTaxDeclaration("0"); } else { - appSettingVO.setWithDrawTaxDeclaration( withDrawRule.getConfValue() ); + appSettingVO.setWithDrawTaxDeclaration(withDrawRule.getConfValue()); } SalarySysConfPO salaryArchiveDeletePO = salarySysConfMap.get(SALARY_ARCHIVE_DELETE); - if (salaryArchiveDeletePO == null ) { + if (salaryArchiveDeletePO == null) { // 是否允许删除薪资、社保档案,默认不允许删除 appSettingVO.setSalaryArchiveDelete("0"); } else { appSettingVO.setSalaryArchiveDelete(salaryArchiveDeletePO.getConfValue()); } + + SalarySysConfPO salarySendFeedbackPO = salarySysConfMap.get(SALARY_SEND_FEEDBACK); + if (salarySendFeedbackPO == null ) { + // 是否开启工资单反馈,默认不开启 + appSettingVO.setSalarySendFeedback("0"); + } else { + appSettingVO.setSalarySendFeedback(salarySendFeedbackPO.getConfValue()); + } + //默认加密开启 if (StringUtils.isEmpty(appSettingVO.getIsOpenEncrypt())) { appSettingVO.setIsOpenEncrypt(OpenEnum.OPEN.getValue()); diff --git a/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java new file mode 100644 index 000000000..9ddee0497 --- /dev/null +++ b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java @@ -0,0 +1,71 @@ +package com.engine.salary.timer; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO; +import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; +import com.engine.salary.service.impl.SalarySendServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import org.apache.commons.lang3.ObjectUtils; +import weaver.hrm.User; +import weaver.interfaces.schedule.BaseCronJob; + +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName AutoConfirmSalaryBill + * @date 2023/07/11 15:50 + * @description 自动确认工资单 + */ +public class AutoConfirmSalaryBillCronJob extends BaseCronJob { + private SalarySendService getSalarySendService(User user) { + return ServiceUtil.getService(SalarySendServiceImpl.class, user); + } + + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); + } + + @Override + public void execute() { + User user = new User(); + user.setUid(1); + user.setLoginid("sysadmin"); + // 获取所有需要确认反馈的默认工资单模板 + List templates = getSalaryTemplateService(user).listNeedAckDefaultTemplate(); + // key:薪资账套id,value:对应的自动确认天数 + Map salarySobAckDaysMap = SalaryEntityUtil.convert2Map(templates, SalaryTemplatePO::getSalarySobId, SalaryTemplatePO::getAutoAckDays); + // 根据薪资账套id获取已发送,确认状态为未确认的工资单 + List unConfirmedList = getSalarySendService(user).listUnConfirmedSendInfo(new ArrayList<>(salarySobAckDaysMap.keySet())); + List sendList = getSalarySendService(user).getByIds(unConfirmedList.stream().map(SalarySendInfoPO::getSalarySendId).distinct().collect(Collectors.toList())); + // key:工资单发放id,value:自动确认超时天数 + HashMap autoAckDaysMap = new HashMap<>(); + sendList.stream().forEach(send -> { + Integer autoAckDays = salarySobAckDaysMap.getOrDefault(send.getSalarySobId(), 7); + autoAckDaysMap.put(send.getId(), autoAckDays); + }); + LocalDateTime now = LocalDateTime.now(); + List needAutoIds = unConfirmedList.stream().filter(po -> { + LocalDateTime sendDateTime = SalaryDateUtil.dateToLocalDateTime(po.getSendTime()); + Integer autoDays = autoAckDaysMap.get(po.getSalarySendId()); + if (ObjectUtils.isEmpty(autoDays)) + return false; + LocalDateTime autoDateTime = sendDateTime.plus(autoDays, ChronoUnit.DAYS); + return !autoDateTime.isAfter(now); + }).map(SalarySendInfoPO::getId).collect(Collectors.toList()); + // 自动确认 + getSalarySendService(user).autoConfirmSalaryBill(needAutoIds); + } + +} diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java new file mode 100644 index 000000000..9be31acf7 --- /dev/null +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -0,0 +1,77 @@ +package com.engine.salary.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.wrapper.ExtEmpWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Collection; + +/** + * 外部人员 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpController { + + private ExtEmpWrapper getExtEmpWrapper(User user) { + return ServiceUtil.getService(ExtEmpWrapper.class, user); + } + + @POST + @Path("/listPage") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getExtEmpWrapper(user)::listPage, param); + } + + @POST + @Path("/save") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::save, param); + } + + @POST + @Path("/update") + @Produces(MediaType.APPLICATION_JSON) + public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::update, param); + } + + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getExtEmpWrapper(user)::delete, ids); + } + + @GET + @Path("/detail") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::detail, id); + } + + + +} diff --git a/src/com/engine/salary/web/SIReportController.java b/src/com/engine/salary/web/SIReportController.java index 4911b2e6e..8eebafe76 100644 --- a/src/com/engine/salary/web/SIReportController.java +++ b/src/com/engine/salary/web/SIReportController.java @@ -12,7 +12,6 @@ import com.engine.salary.wrapper.SalaryArchiveItemWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; -import weaver.login.AuthenticUtil; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -22,10 +21,8 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import java.util.Arrays; import java.util.Map; import java.util.Optional; -import java.util.Vector; /** * 福利报表 @@ -73,7 +70,6 @@ public class SIReportController { String pageSize = Optional.ofNullable(request.getParameter("pageSize")).orElse("10"); salaryItemAdjustRecordQueryParam.setCurrent(Integer.valueOf(current)); salaryItemAdjustRecordQueryParam.setPageSize(Integer.valueOf(pageSize)); - getSalaryArchiveItemWrapper(user).adjustRecordList(salaryItemAdjustRecordQueryParam); return new ResponseResult>(user).run(getSalaryArchiveItemWrapper(user)::adjustRecordList, salaryItemAdjustRecordQueryParam); } } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index d986e86e0..d37e41a15 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -493,6 +493,39 @@ public class SalaryAcctController { } } + //导出核算结果(自定义导出字段) + @GET + @Path("/acctresult/exportWithCustomFields") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportSalaryAcctResultWithCustomFields(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + SalaryAcctResultQueryParam param = new SalaryAcctResultQueryParam(); + setSalaryAcctResultQueryParam(request, param); + //设置自定义导出字段 + String salaryItemIds = request.getParameter("salaryItemIds"); + if (StringUtils.isNotBlank(salaryItemIds)) { + param.setSalaryItemIds(Arrays.stream(salaryItemIds.split(",")).map(Long::valueOf).collect(Collectors.toList())); + } + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getSalaryAcctExcelWrapper(user).exportSalaryAcctResult(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; + } + } + //导入核算结果前生成导入模板时可选的薪资项目 @GET @@ -503,6 +536,15 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getImportField, salaryAcctRecordId); } + //导出核算结果前生成可选的薪资项目 + @GET + @Path("/acctresult/exportField") + @Produces(MediaType.APPLICATION_JSON) + public String exportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getExportField, salaryAcctRecordId); + } + // 薪资核算导入字段缓存 @POST @Path("/acctresult/cacheImportField") @@ -512,6 +554,15 @@ public class SalaryAcctController { return new ResponseResult, String>(user).run(getSalaryAcctExcelService(user)::cacheImportField, param.getSalaryItems()); } + // 薪资核算导出字段缓存 + @POST + @Path("/acctresult/cacheExportField") + @Produces(MediaType.APPLICATION_JSON) + public String cacheExportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalaryAcctExcelService(user)::cacheExportField, param.getSalaryItems()); + } + //导出导入模板 @GET @Path("/acctresult/importtemplate/export") diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 8e86dad41..00e2a219e 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -241,6 +241,22 @@ public class SalaryArchiveController { return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::stopList, queryParam); } + /** + * 外部人员列表 + * + * @param request + * @param response + * @param queryParam + * @return + */ + @POST + @Path("/extList") + @Produces(MediaType.APPLICATION_JSON) + public String extList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::extList, queryParam); + } + /** * 取消停薪 @@ -413,9 +429,15 @@ public class SalaryArchiveController { boolean isInit = SalaryArchiveImportTypeEnum.INIT.getValue().equals(queryParam.getImportType()); boolean isSalaryItemAdjust = SalaryArchiveImportTypeEnum.SALARYITEMADJUST.getValue().equals(queryParam.getImportType()); + boolean isExtEmp = queryParam.isExtSalaryArchiveList(); + // 名称 String finalNameI18n = SalaryI18nUtil.getI18nLabel(user.getLanguage(),542344, "薪资档案导入模板") + "-" - + SalaryI18nUtil.getI18nLabel(user.getLanguage(),listTypeEnum.getLabelId(), listTypeEnum.getDefaultLabel()); + + SalaryI18nUtil.getI18nLabel(listTypeEnum.getLabelId(), listTypeEnum.getDefaultLabel()); + if (isExtEmp) { + finalNameI18n += "-非系统人员"; + } + if (isFixedList) { // 初始化 if (isInit) { @@ -510,6 +532,11 @@ public class SalaryArchiveController { if (StringUtils.isNotBlank(listType)) { param.setListType(SalaryArchiveListTypeEnum.parseByValue(listType)); } + //1标识外部人员 + String extSalaryArchiveList = request.getParameter("extSalaryArchiveList"); + if (StringUtils.isNotBlank(extSalaryArchiveList)) { + param.setExtSalaryArchiveList("true".equals(extSalaryArchiveList)); + } return param; } @@ -750,8 +777,8 @@ public class SalaryArchiveController { /** - * @description 编辑前获取薪资项目调整信息 * @return String + * @description 编辑前获取薪资项目调整信息 * @author Harryxzy * @date 2022/11/15 9:25 */ @@ -764,8 +791,8 @@ public class SalaryArchiveController { } /** - * @description 单个档案的薪资项目调整的编辑 * @return String + * @description 单个档案的薪资项目调整的编辑 * @author Harryxzy * @date 2022/11/11 13:50 */ @@ -958,7 +985,6 @@ public class SalaryArchiveController { /******** 个税扣缴义务人调整记录 end ***********************************************************************************************/ - @GET @Path("/handleRepeatData") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/salary/web/SalaryBillController.java b/src/com/engine/salary/web/SalaryBillController.java index 08949d4fd..cb3f291c5 100644 --- a/src/com/engine/salary/web/SalaryBillController.java +++ b/src/com/engine/salary/web/SalaryBillController.java @@ -549,6 +549,54 @@ public class SalaryBillController { } return new ResponseResult>(user).run(getSalarySendWrapper(user)::mySalaryBill, salaryInfoId); } + + /** + * 确认工资单 + * + * @param salaryInfoId + * @return + */ + @GET + @Path("/confirmSalaryBill") + @Produces(MediaType.APPLICATION_JSON) + public String confirmSalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) { + User user = null; + String recipient = request.getParameter("recipient"); + String em_auth_userid = request.getParameter("em_auth_userid"); + log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid); + if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) { + user = new User(Integer.parseInt(recipient)); + } else if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) { + user = new User(Integer.parseInt(em_auth_userid)); + } else { + user = HrmUserVarify.getUser(request, response); + } + return new ResponseResult>(user).run(getSalarySendWrapper(user)::confirmSalaryBill, salaryInfoId); + } + + /** + * 工资单反馈 + * + * @param salaryInfoId + * @return + */ + @GET + @Path("/feedBackSalaryBill") + @Produces(MediaType.APPLICATION_JSON) + public String feedBackSalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) { + User user = null; + String recipient = request.getParameter("recipient"); + String em_auth_userid = request.getParameter("em_auth_userid"); + log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid); + if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) { + user = new User(Integer.parseInt(recipient)); + } else if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) { + user = new User(Integer.parseInt(em_auth_userid)); + } else { + user = HrmUserVarify.getUser(request, response); + } + return new ResponseResult>(user).run(getSalarySendWrapper(user)::feedBackSalaryBill, salaryInfoId); + } /******** 工资单发放 end ***********************************************************************************************/ /** diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 8e5dcb59c..01acac1dd 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -1,6 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO; @@ -190,6 +191,33 @@ public class SalarySobController { // return WeaResult.success(weaForm); // } + @POST + @Path("/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); + } + + @POST + @Path("/range/ext/list") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); + } + + /** + * 删除薪资账套人员范围 + */ + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::deleteSalarySobExtRange, ids); + } + /** * 保存薪资账套人员范围 */ diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index b36f6196a..38d1a3a9c 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -65,6 +65,7 @@ public class SalarySystemConfigController { return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::operateTaxDeclarationFunction, TaxDeclarationFunctionEnum.parseByValue(param.getOperateTaxDeclaration())); } + /** * 获取系统配置 * @@ -142,6 +143,22 @@ public class SalarySystemConfigController { return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::update, param); } + /** + * 新增或更新系统配置 + * + * @param request + * @param response + * @return + */ + @POST + @Path("/operate") + @Produces(MediaType.APPLICATION_JSON) + public String operate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::operate, param); + } + + /** * 单个规则配置 * @@ -182,6 +199,13 @@ public class SalarySystemConfigController { return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param); } + /** + * 薪资核算人员匹配规则 + * @param request + * @param response + * @param param + * @return + */ @POST @Path("/saveSalaryAcctEmployeeRule") @Produces(MediaType.APPLICATION_JSON) @@ -190,6 +214,28 @@ public class SalarySystemConfigController { return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::saveSalaryAcctEmployeeRule, param.getRule()); } + /** + * 工资单反馈 + * @param request + * @param response + * @param param + * @return + */ + @POST + @Path("/saveSalarySendFeedback") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySendFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::saveSalarySendFeedback, param); + } + + /** + * 撤回个税申报 + * @param request + * @param response + * @param param + * @return + */ @POST @Path("/saveWithDrawTaxDeclaration") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/salary/web/TaxAgentController.java b/src/com/engine/salary/web/TaxAgentController.java index 7508b1678..f5eb2c6e6 100644 --- a/src/com/engine/salary/web/TaxAgentController.java +++ b/src/com/engine/salary/web/TaxAgentController.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeFormDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentBasePO; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.SalaryI18nUtil; @@ -258,6 +259,8 @@ public class TaxAgentController { return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveRange, saveParam); } + + //删除人员范围 @POST @Path("/range/delete") @@ -267,6 +270,33 @@ public class TaxAgentController { return new ResponseResult, String>(user).run(getTaxAgentWrapper(user)::deleteRange, ids); } + //外部人员 + @POST + @Path("/range/listExt") + @Produces(MediaType.APPLICATION_JSON) + public String listExt(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeExtQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxAgentWrapper(user)::listExt, queryParam); + } + + + @POST + @Path("/range/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentManageRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveExtRange, saveParam); + } + + //删除外部人员范围 + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getTaxAgentWrapper(user)::deleteExtRange, ids); + } + /** * 下载人员范围导入模板 * diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java new file mode 100644 index 000000000..f78f0e2ec --- /dev/null +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -0,0 +1,49 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.impl.ExtEmpServiceImpl; +import com.engine.salary.util.page.PageInfo; +import weaver.hrm.User; + +import java.util.Collection; + +/** + * 累计专项 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpWrapper extends Service { + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + + public PageInfo listPage(ExtEmpQueryParam param) { + return getExtEmpService(user).listPage(param); + } + + public void save(ExtEmpSaveParam param) { + getExtEmpService(user).save(param); + } + + public void update(ExtEmpSaveParam param) { + getExtEmpService(user).update(param); + } + + public void delete(Collection ids) { + getExtEmpService(user).delete(ids); + } + + public ExtEmpPO detail(Long id) { + return getExtEmpService(user).getById(id); + } +} diff --git a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java index 843ff5e40..57eb30ddb 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java @@ -2,6 +2,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveItemFormDTO; import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO; import com.engine.salary.entity.salaryarchive.dto.SingleSalaryItemAdjustRecordListDTO; @@ -15,12 +16,8 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.service.SalaryArchiveItemService; -import com.engine.salary.service.SalaryItemService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl; -import com.engine.salary.service.impl.SalaryItemServiceImpl; -import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.proxy.SalaryArchiveItemWrapperProxy; @@ -56,6 +53,15 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + /** * 构建薪资项目基础信息表单 * @@ -217,6 +223,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt List salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); List salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); + DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(queryParam.getEmployeeId()); + List listAll = getSalaryArchiveItemService(user).salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds); PageInfo list = getSalaryArchiveItemService(user).salaryItemAdjustRecordListPage(queryParam, salaryItemIds); List listResult = list.getList(); @@ -228,6 +236,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt Optional optional = listAll.stream().filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId()) && f.getSalaryItemId().equals(m.getSalaryItemId())).findFirst(); m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : ""); + m.setUsername(employee.getUsername()); + m.setDepartmentName(employee.getDepartmentName()); + UserStatusEnum userStatusEnum = UserStatusEnum.parseByValue(Integer.parseInt(m.getEmployeeStatus())); // m.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(m.getEmployeeStatus()))); m.setEmployeeStatus(SalaryI18nUtil.getI18nLabel(user.getLanguage(),userStatusEnum.getLabelId(), userStatusEnum.getDefaultLabel())); @@ -247,7 +258,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt * @return */ public PageInfo singleSalaryItemAdjustRecordList(SingleSalaryItemAdjustRecordQueryParam queryParam) { - if (queryParam.getSalaryArchiveId() == null) { + Long salaryArchiveId = queryParam.getSalaryArchiveId(); + + if (salaryArchiveId == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542363, "薪资档案id不能为空")); } // 获取所有可被引用的薪资项目 @@ -271,8 +284,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt } Optional optional = listAll.stream() .filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId())) - .filter(f ->f.getSalaryItemId().equals(m.getSalaryItemId())) - .filter(f->f.getEffectiveTime().before(m.getEffectiveTime())) + .filter(f -> f.getSalaryItemId().equals(m.getSalaryItemId())) + .filter(f -> f.getEffectiveTime().before(m.getEffectiveTime())) .findFirst(); m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : ""); @@ -286,7 +299,7 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt }); List salaryItemPageIds = resultList.stream().map(SingleSalaryItemAdjustRecordListDTO::getSalaryItemId).collect(Collectors.toList()); - List effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(queryParam.getSalaryArchiveId(), salaryItemPageIds); + List effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(salaryArchiveId, salaryItemPageIds); // 行记录按钮权限控制 for (int i = 0; i < resultList.size(); i++) { SingleSalaryItemAdjustRecordListDTO singleSalaryItemAdjustRecord = resultList.get(i); diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 557145f11..53f12f3a4 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -140,7 +140,6 @@ public class SalaryArchiveWrapper extends Service { .filter(po -> getSalaryItemService(user).filterInRange(userTaxAgentIds, po)) .collect(Collectors.toList()); - //整合所有的显示列(固定列+薪资项目动态列) List> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE); @@ -187,8 +186,6 @@ public class SalaryArchiveWrapper extends Service { * @return */ public Map listPage(SalaryArchiveQueryParam queryParam) { -// queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue())); -// WeaTable weaTable = list(queryParam, SalaryArchiveListTypeEnum.PENDING); Map list = list(queryParam); return list; } @@ -310,6 +307,19 @@ public class SalaryArchiveWrapper extends Service { } + /** + * 外部人员 + * + * @param queryParam + * @return + */ + public Map extList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue())); + queryParam.setExtSalaryArchiveList(true); + return list(queryParam, SalaryArchiveListTypeEnum.EXT); + } + + /** * 获取薪资档案详情表单 * @@ -431,15 +441,17 @@ public class SalaryArchiveWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(SalaryArchiveQueryParam queryParam) { - if (queryParam.getListType() == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542370, "列表类型必传")); - } else { - // 定薪列表导入有调薪导入和初始化导入 - if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) { - Optional optional = Arrays.stream(SalaryArchiveImportTypeEnum.values()) - .filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst(); - if (!optional.isPresent()) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542371, "导入类型不正确")); + if(!queryParam.isExtSalaryArchiveList()){ + if (queryParam.getListType() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542370, "列表类型必传")); + } else { + // 定薪列表导入有调薪导入和初始化导入 + if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) { + Optional optional = Arrays.stream(SalaryArchiveImportTypeEnum.values()) + .filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst(); + if (!optional.isPresent()) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),542371, "导入类型不正确")); + } } } } diff --git a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 033dbd18e..63f0b3d37 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -3,6 +3,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.salaryBill.dto.SalaryBaseSetFormDTO; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; import com.engine.salary.service.SalaryBillBaseSetService; @@ -45,7 +46,7 @@ public class SalaryBillBaseSetWrapper extends Service { public SalaryBaseSetFormDTO getBaseSetForm() { SalaryBaseSetFormDTO dto = new SalaryBaseSetFormDTO(); SalaryBillWatermarkDTO salaryBillWatermark = getSalaryBillBaseSetService(user).getWatermarkSetting(); -// SalaryBillAckFeedbackDTO salaryBillAckFeedback = salaryBillBaseSetService.getAckFeedbackSetting(); + SalaryBillAckFeedbackDTO salaryBillAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); if (Objects.isNull(salaryBillWatermark)) { dto.setWatermarkStatus(false); @@ -57,16 +58,16 @@ public class SalaryBillBaseSetWrapper extends Service { dto.setWatermarkSetting(salaryBillWatermark.getWmSetting()); dto.setWatermark(salaryBillWatermark.getWatermarkType()); } -// if (Objects.nonNull(salaryBillAckFeedback)) { -// data.put("ackStatus", salaryBillAckFeedback.getAckStatus()); -// data.put("feedbackStatus", salaryBillAckFeedback.getFeedbackStatus()); -// } + if (Objects.nonNull(salaryBillAckFeedback)) { + // 工资单反馈默认设置 + dto.setAckFeedbackSetting(salaryBillAckFeedback); + } return dto; } /** - * 保存工资单水印设置 + * 保存工资单模板基础设置 * * @param saveParam * @return diff --git a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java index 117586bc8..382ba5a41 100644 --- a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java @@ -25,6 +25,9 @@ import com.engine.salary.service.impl.SalaryFormulaServiceImpl; import com.engine.salary.service.impl.SalaryItemServiceImpl; import com.engine.salary.service.impl.SalarySobItemServiceImpl; import com.engine.salary.service.impl.SysSalaryItemServiceImpl; +import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.Column; @@ -49,11 +52,11 @@ import java.util.*; public class SalaryFieldWrapper extends Service { private SalaryItemService getSalaryItemService(User user) { - return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } private SalaryFormulaService getSalaryFormulaService(User user) { - return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); + return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); } @@ -69,6 +72,10 @@ public class SalaryFieldWrapper extends Service { return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * 薪资项目列表 * @@ -100,6 +107,9 @@ public class SalaryFieldWrapper extends Service { salaryItemListDTOPage.getColumns().clear(); salaryItemListDTOPage.setColumns(fieldColumns); + //是否需要系统算税,不需要则去除系统项目 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + // 被薪资账套引用的薪资项目 if (CollectionUtils.isNotEmpty(salaryItemList)) { // 查询系统薪资项目 @@ -109,7 +119,9 @@ public class SalaryFieldWrapper extends Service { List salaryItemListDTOS = SalaryItemBO.convert2ListDTO(salaryItemList, Collections.emptyList(), sysSalaryItemPOS, user); //系统项目不删除 salaryItemListDTOS.forEach(dto -> { - if (StringUtils.isNotBlank(dto.getSystemName()) || usingItemIds.contains(dto.getId()) || usingCodes.contains(dto.getCode())) { + if ((taxDeclarationFunctionEnum != TaxDeclarationFunctionEnum.CLOSURE && StringUtils.isNotBlank(dto.getSystemName())) + || usingItemIds.contains(dto.getId()) + || usingCodes.contains(dto.getCode())) { dto.setCanDelete(false); } }); @@ -207,6 +219,7 @@ public class SalaryFieldWrapper extends Service { /** * 保存字段排序信息 + * * @param salaryItemPOS */ public void saveSortedIndex(List salaryItemPOS) { diff --git a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java index f6475c32e..872e6cd11 100644 --- a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java @@ -112,6 +112,7 @@ public class SalaryFormulaWrapper extends Service { param.setSourceId("welfare"); //获取福利类薪资项目 List list = getRemoteExcelService(user).fieldList(param.getSourceId(), param.getExtendParam()); + list = list.stream().filter(f -> !(f.getName().contains("正常缴纳") || f.getName().contains("补缴") || f.getName().contains("补差"))).collect(Collectors.toList()); //提取出福利类项目名称 for (FormulaVar formulaVar : list) { InsuranceAcctDetailImportFieldDTO insuranceAcctDetailImportFieldDTO = new InsuranceAcctDetailImportFieldDTO(); diff --git a/src/com/engine/salary/wrapper/SalaryItemWrapper.java b/src/com/engine/salary/wrapper/SalaryItemWrapper.java index acd8acda3..3765f7bbd 100644 --- a/src/com/engine/salary/wrapper/SalaryItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryItemWrapper.java @@ -18,6 +18,9 @@ import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; +import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; @@ -61,6 +64,10 @@ public class SalaryItemWrapper extends Service { return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * 薪资项目列表 * @@ -89,6 +96,10 @@ public class SalaryItemWrapper extends Service { salaryItemListDTOPage.setPageNum(page.getPageNum()); salaryItemListDTOPage.setTotal(page.getTotal()); + //是否需要系统算税,不需要则去除系统项目 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + + // 被薪资账套引用的薪资项目 if (CollectionUtils.isNotEmpty(salaryItemList)) { //2、填充公式内容 @@ -101,7 +112,9 @@ public class SalaryItemWrapper extends Service { List salaryItemListDTOS = SalaryItemBO.convert2ListDTO(salaryItemList, expressFormulas, sysSalaryItemPOS, user); //系统项目不删除 salaryItemListDTOS.forEach(dto -> { - if (StringUtils.isNotBlank(dto.getSystemName()) || usingItemIds.contains(dto.getId()) || usingCodes.contains(dto.getCode())) { + if ((taxDeclarationFunctionEnum != TaxDeclarationFunctionEnum.CLOSURE && StringUtils.isNotBlank(dto.getSystemName())) + || usingItemIds.contains(dto.getId()) + || usingCodes.contains(dto.getCode())) { dto.setCanDelete(false); } }); diff --git a/src/com/engine/salary/wrapper/SalarySendWrapper.java b/src/com/engine/salary/wrapper/SalarySendWrapper.java index eb8e0e04e..b21447172 100644 --- a/src/com/engine/salary/wrapper/SalarySendWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySendWrapper.java @@ -1,5 +1,6 @@ package com.engine.salary.wrapper; +import cn.hutool.core.util.ObjectUtil; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionOption; @@ -13,6 +14,7 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryItemConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.dto.*; import com.engine.salary.entity.salaryBill.param.*; import com.engine.salary.entity.salaryBill.po.SalarySendPO; @@ -83,6 +85,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + private SalarySysConfService getSalarySysConfService(User user) { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } @@ -147,22 +153,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy // todo 目前就一个回算,那么没有冻结且是回算,就展示补发名称 e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? optional.get().getReplenishName() : optional.get().getName()); e.setTemplateId(optional.get().getId()); + e.setAckFeedbackStatus(optional.get().getAckFeedbackStatus() == null ? 0 : optional.get().getAckFeedbackStatus()); } -// e.setHaveBackCalc(NumberUtils.INTEGER_ZERO); }); } - // 薪资核算ID - Set salaryAcctIds = SalaryEntityUtil.properties(pageList, SalarySendListDTO::getSalaryAcctId); - // 获取是回算的薪资核算ID - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - List salaryAcctRecordPOS = getSalaryAcctRecordService(user).getBackCalcRecordByIds(salaryAcctIds); -// Set backCalcSalarySobs = SalaryEntityUtil.properties(salaryAcctRecordPOS, salaryAcctRecordPO -> salaryAcctRecordPO.getSalarySobId() + "-" + sdf.format(salaryAcctRecordPO.getSalaryMonth())); -// // 判断是否回算过,haveBackCalc 属性 -// pageList.stream().forEach(salarySendDTO -> { -// if (backCalcSalarySobs.contains(salarySendDTO.getSalarySobId() + "-" + sdf.format(salarySendDTO.getSalaryYearMonth()))) { -// salarySendDTO.setHaveBackCalc(NumberUtils.INTEGER_ONE); -// } -// }); List columns = buildWeaTableColumns(); WeaTable table = new WeaTable(); table.setColumns(columns); @@ -327,7 +321,6 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy PageInfo pageInfo = getSalarySendService(user).salarySendInfoListPage(queryParam); - return pageInfo; } @@ -691,9 +684,18 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy return PayrollCheckTypeEnum.parseByValue(conf.getConfValue()); } + + public void confirmSalaryBill(Long salaryInfoId) { + if(ObjectUtil.isNull(salaryInfoId)){ + throw new SalaryRunTimeException("工资单id不能为空!"); + } + getSalaryBillService(user).confirmSalaryBill(salaryInfoId); + } + + public void feedBackSalaryBill(Long salaryInfoId) { + if(ObjectUtil.isNull(salaryInfoId)){ + throw new SalaryRunTimeException("工资单id不能为空!"); + } + getSalaryBillService(user).feedBackSalaryBill(salaryInfoId); + } } - - - - - diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 9dbc7afda..b46123508 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -96,7 +96,7 @@ public class SalarySobItemWrapper extends Service { } }) .collect(Collectors.toList()); - SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList); + salaryItemList = SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList).getList(); //最终返回的分页对象 PageInfo dtoPage = new PageInfo<>(SalaryItemSobListDTO.class); diff --git a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java index dbc24da12..e85253543 100644 --- a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java @@ -2,11 +2,15 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; +import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; +import com.engine.salary.service.impl.SalarySobExtRangeServiceImpl; import com.engine.salary.service.impl.SalarySobRangeServiceImpl; import com.engine.salary.util.page.PageInfo; import org.apache.commons.lang.math.NumberUtils; @@ -30,6 +34,10 @@ public class SalarySobRangeWrapper extends Service { return ServiceUtil.getService(SalarySobRangeServiceImpl.class, user); } + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + /** * 薪资账套的人员范围列表(关联人员范围) * @@ -68,6 +76,19 @@ public class SalarySobRangeWrapper extends Service { getSalarySobRangeService(user).save(saveParam); } + /** + * 保存 + * + * @param saveParam 保存参数 + */ + public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { + getSalarySobExtRangeService(user).saveExtRange(saveParam); + } + + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + return getSalarySobExtRangeService(user).listPage4Ext(param); + } + /** * 删除 * @@ -77,6 +98,10 @@ public class SalarySobRangeWrapper extends Service { getSalarySobRangeService(user).deleteByIds(ids); } + public void deleteSalarySobExtRange(Collection ids) { + getSalarySobExtRangeService(user).deleteSalarySobExtRange(ids); + } + /*** * @description 下载薪资账套人员范围导入模板 * @return XSSFWorkbook @@ -88,8 +113,8 @@ public class SalarySobRangeWrapper extends Service { } /** - * @description 薪资账套人员范围导入预览 * @return void + * @description 薪资账套人员范围导入预览 * @author Harryxzy * @date 2023/1/9 13:37 */ @@ -98,8 +123,8 @@ public class SalarySobRangeWrapper extends Service { } /** + * @return Map * @description 导入薪资账套人员范围 - * @return Map * @author Harryxzy * @date 2023/1/9 14:10 */ diff --git a/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java b/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java index 87b083e02..46b470aa4 100644 --- a/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java @@ -159,4 +159,12 @@ public class SalarySystemConfigWrapper extends Service { public void saveArchiveDelete(String setting) { getSalarySysConfService(user).saveArchiveDelete(setting); } + + public void operate(SalarySysConfPO salarySysConfPO) { + getSalarySysConfService(user).operate(salarySysConfPO); + } + + public void saveSalarySendFeedback(SalarySysConfPO param) { + getSalarySysConfService(user).saveSalarySendFeedback(param); + } } diff --git a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java index 1dcd921f6..0e3ffaf05 100644 --- a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java @@ -20,6 +20,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.mzlion.core.utils.BeanUtils; 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 weaver.hrm.User; @@ -60,6 +61,10 @@ public class SalaryTemplateWrapper extends Service { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryBillBaseSetService getSalaryBillBaseSetService(User user) { + return ServiceUtil.getService(SalaryBillBaseSetServiceImpl.class, user); + } + /** * 工资单模板列表 * @@ -154,6 +159,8 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId()); salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId()); salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() == null ? false : po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); + salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0); + salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); // 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule()); // 规则设置赋值 @@ -182,6 +189,13 @@ public class SalaryTemplateWrapper extends Service { // WeaForm salaryTemplateBase = SalaryFormatUtil.getInstance().buildForm(SalaryTemplateBaseSetDTO.class, SalaryTemplateBaseSetDTO.builder().salarySobOptions(salarySobOptions).sendEmailOptions(sendEmailOptions).build()); + if(id == null){ + // 新建,获取默认的确认反馈信息 + SalaryBillAckFeedbackDTO defaultAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); + salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(),"1")); + salaryTemplateBaseSetDTO.setAutoAckDays(defaultAckFeedback.getAutoAckDays()); + salaryTemplateBaseSetDTO.setFeedbackUrl(defaultAckFeedback.getFeedBackUrl()); + } Map salaryTemplateBase = new HashMap<>(); salaryTemplateBase.put("data", salaryTemplateBaseSetDTO); salaryTemplateBase.put("salarySobOptions", salarySobOptions); diff --git a/src/com/engine/salary/wrapper/SysSalaryItemWrapper.java b/src/com/engine/salary/wrapper/SysSalaryItemWrapper.java index 0357e7134..56a02f2c0 100644 --- a/src/com/engine/salary/wrapper/SysSalaryItemWrapper.java +++ b/src/com/engine/salary/wrapper/SysSalaryItemWrapper.java @@ -55,7 +55,7 @@ public class SysSalaryItemWrapper extends Service { Set sysSalaryItemIds = SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getSysSalaryItemId); searchParam.setExcludeIds(sysSalaryItemIds); - List sysSalaryItemPOS = getSysSalaryItemService(user).listSome(SysSalaryItemPO.builder().name(searchParam.getName()).build()); + List sysSalaryItemPOS = getSysSalaryItemService(user).listLikeName(SysSalaryItemPO.builder().name(searchParam.getName()).build()); List finalItems = sysSalaryItemPOS.stream().filter(item -> !sysSalaryItemIds.contains(item.getId())).collect(Collectors.toList()); List sysSalaryItemListDTOS = SysSalaryItemBO.convert2ListDTO(finalItems, user); // 分页参数 diff --git a/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java b/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java index 1bd3d920c..f32fd83d9 100644 --- a/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java @@ -2,11 +2,13 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.*; -import com.engine.salary.entity.taxagent.param.*; +import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminBaseFormParam; +import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminBaseSaveParam; +import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminQueryParam; +import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminRangeQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentSubAdminPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index efe3c7f5e..2fe084b84 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.*; import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; @@ -66,7 +67,6 @@ public class TaxAgentWrapper extends Service { } - // private PaymentAgencyService paymentAgencyService; // // private SIEmployeeStatusMapper siEmployeeStatusMapper; @@ -308,8 +308,7 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo listRangeInclude(TaxAgentRangeQueryParam queryParam) { - PageInfo listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE); - return listPage; + return getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE); } /** @@ -319,8 +318,7 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo listRangeExclude(TaxAgentRangeQueryParam queryParam) { - PageInfo listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO); - return listPage; + return getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO); } /** @@ -361,6 +359,7 @@ public class TaxAgentWrapper extends Service { return StringUtils.EMPTY; } + /** * 删除管理范围 * @@ -372,6 +371,28 @@ public class TaxAgentWrapper extends Service { return StringUtils.EMPTY; } + + public PageInfo listExt(TaxAgentRangeExtQueryParam param) { + return getTaxAgentManageRangeService(user).listExt(param); + } + + /** + * 外部人员范围 + * + * @param saveParam + * @return + */ + public String saveExtRange(TaxAgentManageRangeExtSaveParam saveParam) { + getTaxAgentManageRangeService(user).saveExtRange(saveParam); + return StringUtils.EMPTY; + } + + public void deleteExtRange(Collection ids) { + + getTaxAgentManageRangeService(user).deleteExtRange(ids); + } + + /** * 获取个税管理的人员情况 * @@ -420,6 +441,7 @@ public class TaxAgentWrapper extends Service { /** * 下载人员范围导入模板 + * * @param downloadTemplateParam * @return */ @@ -429,6 +451,7 @@ public class TaxAgentWrapper extends Service { /** * 预览人员范围 + * * @param taxAgentImportParam */ public Map preview(TaxAgentImportParam taxAgentImportParam) { @@ -437,9 +460,12 @@ public class TaxAgentWrapper extends Service { /** * 个税扣缴义务人-人员范围导入 + * * @param taxAgentImportParam */ public Map importData(TaxAgentImportParam taxAgentImportParam) { return getTaxAgentManageRangeService(user).importData(taxAgentImportParam); } + + }